Skip to content

fix(spec-workflow): migrate skills for Opus 5 behavior - #567

Merged
wkoutre merged 1 commit into
nextfrom
nickkoutrelakos/opus5-spec-workflow
Aug 5, 2026
Merged

fix(spec-workflow): migrate skills for Opus 5 behavior#567
wkoutre merged 1 commit into
nextfrom
nickkoutrelakos/opus5-spec-workflow

Conversation

@wkoutre

@wkoutre wkoutre commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Applies the Opus 5 migration deltas to packages/plugins/spec-workflow. Both .md skill files were read in full; no other plugin is touched.

Headline fix: the invented quality_threshold loop gate

auto-spec declared an input quality_threshold: 0.8 with no rubric defined anywhere in the plugin, and Phase 5 then said Iterate until quality threshold met. The model has no data from which to compute a quality score, so it fabricates one — and that fabricated number was the loop's termination condition. A made-up number decided when implementation stopped.

Replaced with exit criteria that are observable from tool output:

  • The project's test command has been run and passes.
  • The project's lint and typecheck commands have been run and pass.
  • Every reviewer finding has been applied, or recorded as an explicit reasoned rejection.
  • Hard stop after 3 passes: mark the task blocked and record what failed, rather than looping.

The quality_threshold input and the --quality-threshold=0.9 usage example are gone.

Changes by delta

Invented numbers

  • Removed the quality_threshold input, the loop gate, and the usage example (above).
  • Removed Quality Score: [X/10] from the output template — nothing measures it.
  • Unit Tests: [X% coverage] → coverage is reported only if a coverage tool actually ran, quoting its output; the line is omitted otherwise. Test result must be quoted from the real run.
  • implement-spec output: replaced undefined quality metrics and duration with the observed result of the test/lint/typecheck run, plus an explicit "do not report a score you did not measure".
  • Phase 2's Iterate until consensus reached (unbounded, undefined "consensus") → revise until each finding is applied or explicitly rejected, then stop.

Delta 2 — delegation ceilings

  • New "Agent staffing" section in auto-spec: rosters are a menu, not a checklist; ceiling of 4 concurrent agents, stated as a ceiling not a quota; and a "when NOT to delegate" rule (don't spawn an agent for work that finishes in a handful of direct tool calls).
  • Same ceiling + menu framing added to implement-spec Phase 3, which previously read as a prescribed team per task type over an unbounded task list with parallel_execution: true.
  • Phase 5 parallel execution now explicitly says the ceiling covers implementation and review agents together.

Delta 1 — verification ceremony

  • implement-spec Phase 4 now prefers running the project's own test/lint/typecheck commands over spawning an agent to judge quality: "a tool result is evidence, an agent's opinion of code it just read is not." Grounding instructions were kept, not removed.

Delta 3 — literal instruction-following / decorative emphasis

  • auto-spec stated its autonomy contract three times (header block, a **CRITICAL** bullet list, and a numbered CRITICAL INSTRUCTIONS section). Kept one operative statement — the numbered contract, which is the only one naming the specific tool never to call. Removed the duplicate **CRITICAL** block and the (NOT user review) / (INSTEAD of user review) parentheticals that restated it on six more lines.
  • Softened the shouty CRITICAL / NEVER / ALWAYS / ANY decoration in that block while keeping the constraints themselves intact.

Delta 4 — output length

  • New "Document Length" section in auto-spec: the four generated documents feed a later agent's context, so ~600 words each unless the feature needs more. The skill previously said "comprehensive" with no length guidance at all.
  • Final summary capped at ~400 words in both skills.

Broken references

  • implement-spec referenced agent-capability-analyst, which does not exist as an agent anywhere in the repo (verified against every agents/*.md name: frontmatter value). Replaced with a plain description of the behavior.
  • implement-spec Phase 4 listed review-plan among agents; it is a skill in development-planning, and Task(subagent_type:) takes agent names. Removed.
  • Every other agent name in both skills was verified to exist: planner-agent, plan-reviewer-agent, security-analyzer-agent, performance-analyzer-agent, refactorer-agent, test-writer-agent, code-explainer-agent, agent-orchestrator-agent, code-generator-agent, documentation-agent, style-enforcer-agent, agent-tester-agent, infrastructure-agent, cicd-agent, migration-assistant-agent.

Stale facts

  • Removed MultiEdit(*) from auto-spec's allowed-tools; the tool no longer exists and Edit covers its cases.
  • No model IDs, pricing claims, budget_tokens, or OpenAI-only params appear anywhere in this plugin.

Repo conventions

  • Version bumped 2.0.1 → 2.1.0 (minor: allowed-tools change and a changed loop-exit condition are behavior changes), in this commit.
  • Root CLAUDE.md version table row updated in the same commit.
  • Plugin CLAUDE.md gained a short "Agent Staffing Conventions" section documenting the ceiling and the observable-exit-criteria rule.
  • README.md needed no change: no component was added, removed, or renamed.

Test plan

  • bunx nx format:write --uncommitted — clean, no diff produced.
  • bunx markdownlint-cli2 --fix "packages/plugins/spec-workflow/**/*.md"Summary: 0 error(s), exit 0.
  • node scripts/validate-plugin.cjs packages/plugins/spec-workflowValidation PASSED (plugin.json: spec-workflow v2.1.0, 2 skills, 1 MCP server).
  • Pre-commit lefthook run green across format / lint / lint-markdown / test / typecheck / update-lockfile.
  • Agent-name verification: extracted the name: frontmatter from every packages/plugins/**/agents/*.md and diffed it against every agent named in both skills. agent-capability-analyst was the only miss (also referenced in prose by two files outside this plugin, left untouched as out of scope).
  • Residual-reference sweep: grep -rn -i 'quality_threshold|quality threshold|consensus|MultiEdit' packages/plugins/spec-workflow/ returns nothing.

🤖 Generated with Claude Code

@wkoutre
wkoutre requested a review from a team as a code owner August 5, 2026 15:43
@vercel

vercel Bot commented Aug 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-toolkit-slack-oauth-backend Ready Ready Preview Aug 5, 2026 11:27pm

Request Review

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

● Reviewed · 2026-08-05 23:28 UTC · view run ↗

Approved — one gap in the delegation-ceiling work, two info notes.

Applies the Opus 5 migration deltas to spec-workflow: replaces the fabricated quality_threshold loop gate with observable exit criteria, adds a 4-agent delegation ceiling, deduplicates the autonomy contract, and removes references to nonexistent agents and tools.

Assessment

The core fix is sound: loop exits now key off test/lint/typecheck results and applied-or-rejected reviewer findings instead of a number the model would invent, and every remaining agent name resolves to a real agent. The version bump (2.0.1 → 2.1.0), root table, plugin CLAUDE.md, and manifest all agree. The one gap is in the ceiling plumbing — it constrains the fallback path but not the orchestrator path that runs whenever agent-orchestrator-agent is available.

Suggestions

  • The 4-agent ceiling in Phase 3 never reaches Phase 2, which delegates execution to agent-orchestrator-agent without it — pass the ceiling through as part of the orchestrator's execution configuration. view inline thread →
  • The retained skip_final_review input contradicts contract item 1 and is consumed by no phase — same invented-gate class this PR removed elsewhere. view inline thread →
  • The auto-spec description changed enough that its Notion marketplace entry is stale; counts are unaffected. view inline thread →

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

📚 Documentation Check ✅

Verdict: Passed

The spec-workflow plugin version was bumped (2.0.1 → 2.1.0) in both plugin.json and the root CLAUDE.md version table, satisfying the mandatory version-bump rule. The plugin's own CLAUDE.md was updated with a new "Agent Staffing Conventions" section that accurately reflects the behavioral changes made to both SKILL.md files. No blocking issues found.


Summary

Plugin version bump (blocking check): satisfied. packages/plugins/spec-workflow/.claude-plugin/plugin.json goes from 2.0.12.1.0, and the root CLAUDE.md version table (line 232) is updated to match — the two required sources of truth stay in sync.

Bump size: Minor is defensible. The change is a behavioral refinement across auto-spec/SKILL.md and implement-spec/SKILL.md (replacing subjective "quality threshold"/consensus language with observable exit criteria — test/lint/typecheck results and explicit reviewer-finding resolution — plus an explicit 4-agent concurrency ceiling and removal of the quality_threshold input and agent-capability-analyst reference). No skills/agents/commands were added or removed, so this isn't clearly a "new feature" minor bump per the repo's own rubric, but it's also not purely a typo/doc fix, so patch-vs-minor is a judgment call either way — not something to block on.

packages/plugins/spec-workflow/CLAUDE.md: updated correctly. The new "Agent Staffing Conventions" section (ceiling of 4 concurrent agents, staff-only-what's-needed, observable loop-exit conditions) directly documents the same conventions just added to both SKILL.md files — this is exactly the kind of plugin-CLAUDE.md sync the repo's docs rule calls for.

packages/plugins/spec-workflow/README.md: not touched by this PR, and doesn't strictly need to be. It currently describes auto-spec as "Fully autonomous spec creation and implementation" and lists "quality validation"/"quality gates" — both still accurate under the new SKILL.md wording (the never-prompt-for-approval contract is preserved, just reworded; quality gates now mean concrete test/lint/typecheck runs rather than a numeric score). No factual mismatch, so this is informational only.

Changelog: none added; per the validator config this is informational, not blocking.

Naming conventions: no new skills/agents/commands were introduced, so the skill-vs-agent naming convention rule doesn't apply here.

Missing Updates

Type File Severity Reason
📝 changelog packages/plugins/spec-workflow/ ℹ️ info No CHANGELOG.md exists for this plugin and none was added for this behavioral change to auto-spec/implement-spec. Per validator config this is informational only, not blocking.

Suggestions (1)

💡 Inline suggestions have been posted as review comments. Click "Commit suggestion" to apply each fix directly.

  • ℹ️ packages/plugins/spec-workflow/README.md: Optional wording tweak for consistency: the SKILL.md description was softened from 'FULLY AUTONOMOUS... NEVER prompts' to 'runs end to end without stopping for user approval (see the autonomous execution contract)'. The README's 'Fully autonomous' phrasing is still technically accurate (the never-prompt contract is preserved) but could be aligned to the new, less absolute phrasing used in the SKILL.md. Not required since behavior is unchanged.

🤖 Generated by Claude Documentation Validator | Mode: suggest

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5d747e6468

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- **Documentation**: documentation-agent, review-plan
- **Documentation**: documentation-agent

Prefer running the project's own test, lint, and typecheck commands over spawning an agent to judge quality - a tool result is evidence, an agent's opinion of code it just read is not.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow direct command execution for quality gates

When implement-spec runs with quality gates enabled, this new instruction tells the skill to prefer running the project's test/lint/typecheck commands directly, but the skill's frontmatter still only allows Read, Task, and the spec-workflow MCP tools, with no Bash permission. In that context the main skill cannot actually collect the tool-result evidence it now prefers and must either skip these checks or delegate to agents anyway; add the necessary Bash(...) permissions or keep the checks explicitly delegated.

Useful? React with 👍 / 👎.


### Phase 3: Task Execution

Each list below is a menu of agents that fit that task type, not a team to staff in full. Pick only the ones the task actually needs, and do the work directly rather than spawning an agent when it would finish in a handful of tool calls. **Ceiling: at most 4 concurrent agents at any moment** - a ceiling, not a quota.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ warning · correctness — The 4-agent ceiling lands here in Phase 3, but Phase 2 is the primary path: it hands the whole execution to agent-orchestrator-agent, whose context list (lines 54-58) doesn't include the ceiling, and whose own definition has no concurrency bound (agent-orchestrator.md: "Launch all agents simultaneously", "Maximize parallel execution opportunities"). Whenever the orchestrator is available, the ceiling is inert — pass it through as part of the Phase 2 execution configuration.

Suggested change
Each list below is a menu of agents that fit that task type, not a team to staff in full. Pick only the ones the task actually needs, and do the work directly rather than spawning an agent when it would finish in a handful of tool calls. **Ceiling: at most 4 concurrent agents at any moment** - a ceiling, not a quota.
Each list below is a menu of agents that fit that task type, not a team to staff in full. Pick only the ones the task actually needs, and do the work directly rather than spawning an agent when it would finish in a handful of tool calls. **Ceiling: at most 4 concurrent agents at any moment** - a ceiling, not a quota. Pass this ceiling to `agent-orchestrator-agent` as part of its execution configuration in Phase 2; it does not apply one by default.

### CRITICAL INSTRUCTIONS FOR AUTONOMOUS EXECUTION
### Autonomous execution contract

1. Never prompt the user for review or approval at any point in the workflow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 info · correctness — This contract line contradicts the retained skip_final_review input at line 24 ("skip final user review (default: false)"), which no phase consumes. Read literally, the input spec says a final user review happens by default — the same invented-gate class this PR removed elsewhere.

@@ -1,29 +1,20 @@
---
description: Autonomously create and implement a complete spec workflow with multi-agent collaboration, bypassing manual review steps through intelligent consensus-building
description: Autonomously create and implement a complete spec workflow with multi-agent collaboration, replacing manual review steps with agent review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 info · docs — The skill's description and behavior contract changed (consensus-based review → agent review with observable exit criteria); component counts are unchanged, but the Notion Plugin Marketplace description for auto-spec is now stale — update the spec-workflow section there.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Approved — see full review in the sticky comment ↑

Replace the invented quality_threshold loop gate with observable exit
criteria, cap agent fan-out, remove the defunct MultiEdit tool, drop a
fabricated agent reference, and add output length guidance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@wkoutre
wkoutre force-pushed the nickkoutrelakos/opus5-spec-workflow branch from 5d747e6 to bc18144 Compare August 5, 2026 23:26
@wkoutre
wkoutre merged commit eb093ec into next Aug 5, 2026
18 checks passed
@wkoutre
wkoutre deleted the nickkoutrelakos/opus5-spec-workflow branch August 5, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant