Skip to content

chore: tighten agent prompt contracts (v0.16.17)#119

Merged
shinpr merged 2 commits intomainfrom
chore/agent-prompt-contracts
May 1, 2026
Merged

chore: tighten agent prompt contracts (v0.16.17)#119
shinpr merged 2 commits intomainfrom
chore/agent-prompt-contracts

Conversation

@shinpr
Copy link
Copy Markdown
Owner

@shinpr shinpr commented May 1, 2026

Summary

Strengthen subagent prompts so that each contract (output protocol, gates, scope, file boundaries, intermediate state) is unambiguous and model-independent. Removes vague phrases, redundant output instructions, and heading drift that previously left execution open to interpretation.

Highlights

  • Output Protocol: every JSON-returning agent now requires a single raw JSON object (no code fence, no surrounding prose) as the final message.
  • task-executor / task-executor-frontend: Phase Entry Gate is limited to true preconditions; Step 1 / Step 2 / Exit gates take over mid-flow checks. File Scope Constraint and Out-of-Scope Escalation (2-5) added, with the allowed list aligned to the actual task-template fields (Target Files, task file, work plan, Provides:).
  • security-reviewer: introduces suspected_risk, downgrades uncertain findings instead of discarding them, and routes them through Status Determination and the Quality Checklist.
  • technical-designer / -frontend: explicit Gate 0/1/2/3 ordering with inline annotations on every subsection, and physical subsection order rearranged to match Gate order.
  • subagents-orchestration-guide: Basic Flow split into a Planning flow and a separate task execution cycle; placeholder substitution rule and context isolation contract made explicit; direct implementation removed in favor of routing through task-executor even at Small scale.
  • Recipes: collapsed the CRITICAL/MANDATORY/ALWAYS suffix block into a short positive Subagent Prompt Suffix across all 16 recipes.
  • Investigation Notes: agents now append observations to the task file's ## Investigation Notes section (added to task-template), so intermediate state is contractually persisted.
  • quality-fixer / -frontend: Step 1 stub-detection scope is now filesModified (primary) with git diff HEAD as fallback, preventing cross-task false positives.
  • skills-index.yaml: refreshed to match the actual sections of each SKILL.md (resolves several pre-existing drifts beyond this branch's renames).
  • Version: bumped to 0.16.17 across package.json, marketplace, and all three plugin manifests.

Notes

  • Plugin subdirectories (dev-workflows/, dev-workflows-frontend/, dev-skills/) are regenerated via pnpm sync. sync:check passes.
  • All edits are scoped to canonical sources under agents/ and skills/; plugin subdirectories follow the existing single-source-of-truth pattern.

Test plan

  • pnpm sync:check passes (verified locally).
  • Spot-check a representative subagent invocation (task-executor, quality-fixer, code-reviewer) to confirm raw-JSON output and gate behavior.
  • Verify a recipe-orchestrated flow (recipe-implement or recipe-design) executes through to completion without falling back to orchestrator-direct edits.

🤖 Generated with Claude Code

Strengthen subagent prompts so each contract (output protocol, gates,
scope, file boundaries, intermediate state) is unambiguous and model-
independent. Removes vague phrases, redundant output instructions, and
heading drift that previously left execution open to interpretation.

Highlights
- Output Protocol: every JSON-returning agent now requires a single raw
  JSON object (no fence, no surrounding prose) as the final message.
- task-executor / task-executor-frontend: Phase Entry Gate is limited to
  true preconditions; Step 1 / Step 2 / Exit gates take over mid-flow
  checks. File Scope Constraint and Out-of-Scope Escalation (2-5) added,
  with allowed list aligned to the actual task-template fields.
- security-reviewer: introduces `suspected_risk`, downgrades uncertain
  findings instead of discarding them, and routes them through Status
  Determination and the Quality Checklist.
- technical-designer / -frontend: explicit Gate 0/1/2/3 ordering with
  inline annotations, and physical subsection order matching gate order.
- subagents-orchestration-guide: Basic Flow split into a Planning flow
  and a separate task execution cycle; placeholder substitution and
  context isolation rules made explicit.
- Recipes: collapsed CRITICAL/MANDATORY/ALWAYS suffix block into a short
  positive Subagent Prompt Suffix across all 16 recipes.
- skills-index.yaml: refreshed to match the actual sections of each
  SKILL.md (resolves several pre-existing drifts).
- Patch version bumped to 0.16.17 across marketplace and plugins.

Plugin subdirectories regenerated via `pnpm sync`; sync:check passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shinpr shinpr self-assigned this May 1, 2026
Skills should not depend on specific downstream agents, and agents
should not reference other agents by name. Subagents run in isolated
contexts and cannot resolve agent identifiers at execution time, so
naming a specific peer or downstream agent only adds noise without
improving precision.

Restored dependency direction: recipe -> agent -> skill (skills know
nothing about agents; agents know nothing about each other).

Skill -> agent (rewrites)
- documentation-criteria SKILL: "acceptance-test-generator skeletons"
  -> "test skeleton generation output"; "test skeleton file paths from
  acceptance-test-generator" -> "test skeleton file paths produced for
  this work plan".
- task-template: "determined by task-decomposer" -> "determined during
  task decomposition"; "task-executor appends" -> agent-neutral phrasing.
- ui-spec-template: "based on requirement-analyzer output" -> "based on
  requirements analysis output".
- testing-principles: removed code-verifier reference; the mitigation
  now only states that Design Docs should include explicit schema
  references for review-time cross-checking.

Agent -> agent (rewrites)
- quality-fixer / -frontend: "task-executor" / "task-executor-frontend"
  -> "upstream implementation step" (in Input Parameters, Step 1 scope,
  and stub_detected routing).
- solver: "verifier output" -> "upstream verification output";
  "discovered by verifier" -> "discovered during verification".
- verifier: investigator references -> "upstream investigation".
- work-planner: "Consider running acceptance-test-generator" ->
  "Consider running the test skeleton generation step".
- technical-designer / -frontend: "codebase-analyzer output" ->
  "codebase analysis output"; "verifier output" -> "prior-layer
  verification output"; "design-sync in the subsequent pipeline step"
  -> "Cross-document checks are handled in a subsequent pipeline step".

Plugin subdirectories regenerated via `pnpm sync`; sync:check passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shinpr shinpr merged commit 70b3bbc into main May 1, 2026
1 check passed
@shinpr shinpr deleted the chore/agent-prompt-contracts branch May 1, 2026 02:27
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