Skip to content

Conversation

@Perlover
Copy link
Contributor

@Perlover Perlover commented Dec 18, 2025

Summary

Add strict task completion rules, improve skills discovery, and enable full tool inheritance for all subagents. This prevents agents from falsely marking tasks as complete without actually executing them, aligns skills usage with Claude Code's built-in mechanisms, and gives subagents access to all tools including MCP servers.

Linked item

  • Closes: # (must be an open Issue) OR
  • Implements: # (must be a Discussion)

Checklist

  • Linked to related Issue/Discussion
  • Documented steps to test (below)
  • Drafted "how to use" docs (if this adds new behavior)
  • Backwards compatibility considered (notes if applicable)

Documented steps to test

  1. Create a spec with tasks that include "Run tests" or "Verify in browser" requirements
  2. Run implementer agent on the spec
  3. Verify that implementer reads CLAUDE.md from project root
  4. Verify that implementer uses Skill(skill_name) tool to invoke relevant skills from <available_skills> section
  5. Verify that tasks requiring test execution are NOT marked complete without actual test output
  6. Verify that parent tasks remain [ ] if any subtasks are incomplete
  7. Verify that subagents have access to Edit tool and other inherited tools
  8. Verify that subagents have access to MCP tools (e.g., Playwright, Context7) when configured

Notes for reviewers

Problem 1: False task completion

Problem solved:
Implementer agents were marking tasks as completed without actually executing them. For example:

  • Tasks saying "Run E2E tests" were marked [x] without running tests
  • Parent tasks marked complete while subtasks remained [ ]
  • TDD GREEN phase marked complete without test execution output

Root causes addressed:

  1. Implementer did not read CLAUDE.md (project-specific rules)
  2. Implementer did not leverage available skills (may contain mandatory requirements like E2E testing)
  3. No explicit rules about what constitutes task completion

Changes:

  1. Added instruction to read CLAUDE.md from project root

  2. Added instruction to use available skills via Skill(skill_name) tool

    • Initially added hardcoded paths (.claude/skills/, ~/.claude/skills/)
    • Replaced with reference to <available_skills> section and Skill() tool
    • Reason: Claude Code already pre-loads skills as YAML frontmatter in system context, subagents inherit this context, so reading files manually is redundant
  3. Added 6 critical task completion rules:

    • Rule 1: Tasks complete only when actually executed
    • Rule 2: Handle missing prerequisites (start services, but don't install deps)
    • Rule 3: Parent tasks require all subtasks complete
    • Rule 4: TDD phases require actual test execution
    • Rule 5: Verification tasks require evidence
    • Rule 6: Incomplete tasks must stay incomplete

Problem 2: Limited tool access for subagents

Problem solved:
All agent files previously had explicit tools: field in their YAML frontmatter listing only specific tools (Read, Write, etc.). This restricted subagents to only those listed tools, preventing access to:

  • Edit tool - for targeted string replacements
  • MCP tools - Playwright, Context7, or any user-installed MCP servers
  • Future tools - any new tools added to Claude Code

Solution:
Removed the tools: field entirely from all 8 agent files:

  • implementer.md
  • spec-writer.md
  • tasks-list-creator.md
  • spec-shaper.md
  • spec-verifier.md
  • implementation-verifier.md
  • product-planner.md
  • spec-initializer.md

Rationale:
Per Claude Code documentation: "Omit the tools field to inherit all tools from the main thread (default), including MCP tools." This approach:

  1. Enables full tool inheritance - subagents automatically get all tools available to main Claude Code instance
  2. Includes MCP tools - Playwright for browser automation, Context7 for docs, any user-configured MCP servers
  3. Zero maintenance - new tools or MCP servers don't require updating agent files
  4. Edit tool now available - subagents can use targeted string replacements instead of full file rewrites

Backwards compatibility

  • Fully backwards compatible
  • Existing workflows continue to work
  • New rules only add stricter validation, don't break existing behavior
  • Rule 2 explicitly prevents dependency installation conflicts when running parallel agents
  • Removing tools: field is additive - subagents gain access to more tools, not fewer

References

Documentation sources used for these changes:

Claude Code Tools Documentation

Key Documentation Excerpts

From the agent creator documentation regarding tool inheritance:

"Omit the tools field to inherit all tools from the main thread (default), including MCP tools"

This is the recommended approach for maximum flexibility, allowing subagents to access:

  • All built-in Claude Code tools (Read, Write, Edit, Bash, Glob, Grep, etc.)
  • All configured MCP server tools (Playwright, Context7, etc.)
  • Any future tools without configuration changes

Perlover and others added 4 commits December 17, 2025 16:20
…group

With Claude Opus 4.5, the previous wording caused two issues:

1. Multiple task groups in single implementer - Claude often attempted to
   pass all task groups to a single implementer subagent, exhausting context

2. No subagent at all - Sometimes Claude implemented task groups directly
   in the current conversation window without spawning any implementer

This fix adds:
- CRITICAL instruction to spawn SEPARATE implementer for EACH task group
- Execution strategy based on task group dependencies
- Examples of parallel execution (independent groups)
- Examples of sequential execution (dependent groups)

Each subagent now gets its own context window for focused implementation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…etion rules

Problem:
Implementer agents were marking tasks as completed without actually executing
them. For example, tasks requiring "Run E2E tests" were marked done without
running tests, and parent tasks were marked complete while subtasks remained
incomplete. This led to false completion reports and unverified implementations.

Root causes identified:
1. Implementer did not read CLAUDE.md which contains project-specific rules
2. Implementer did not read project or global skills which may contain
   mandatory requirements (e.g., E2E testing requirements)
3. No explicit rules about what constitutes task completion
4. No rules about parent/subtask relationships

Changes:
1. Added instruction to read CLAUDE.md from project root
2. Added instruction to read project skills from .claude/skills/
3. Added instruction to read global skills from ~/.claude/skills/
4. Added 6 critical task completion rules:
   - Rule 1: Tasks complete only when actually executed
   - Rule 2: Start services yourself, but don't install dependencies
            (may conflict with parallel agents)
   - Rule 3: Parent tasks require all subtasks complete
   - Rule 4: TDD phases require actual test execution output
   - Rule 5: Verification tasks require evidence (screenshots)
   - Rule 6: Incomplete tasks must stay marked incomplete with explanation

This ensures implementer agents:
- Follow project-specific conventions and requirements
- Don't falsely mark tasks as complete
- Provide evidence for verification tasks
- Handle parallel execution safely (no dependency conflicts)
…ference

Problem:
The previous commit added instructions for implementer to read skills from
specific directories (.claude/skills/ and ~/.claude/skills/). However, this
approach has issues:

1. Hardcoded paths are Claude Code internal implementation details
2. Claude Code already pre-loads available skills as YAML frontmatter
   in the <available_skills> section of the system context
3. Subagents inherit the same context with available skills already visible
4. Reading files manually duplicates what Claude Code already provides

Solution:
Replace the two lines with specific paths with a single instruction that:
- Points to <available_skills> section in system context
- Instructs to use the Skill(skill_name) tool to invoke relevant skills
- Removes dependency on internal Claude Code directory structure

This makes the instructions more portable and aligned with how Claude Code
actually handles skills discovery and invocation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…tions

All agent files previously had only Write and Read tools, which meant
agents could only create/overwrite entire files but couldn't make
targeted edits. This was inefficient when working with existing code.

The Edit tool allows precise string replacements (old_string → new_string)
without rewriting entire files. This is the preferred approach in Claude
Code for modifying existing files, as documented in the official Claude
Code skills reference.

Changes:
- implementer.md: added Edit tool
- spec-writer.md: added Edit tool
- tasks-list-creator.md: added Edit tool
- spec-shaper.md: added Edit tool
- spec-verifier.md: added Edit tool
- implementation-verifier.md: added Edit tool
- product-planner.md: added Edit tool
- spec-initializer.md: added Edit tool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@Perlover Perlover changed the title Fix/implementer task completion rules feat(agents): add task completion rules, skills discovery, and Edit tool Dec 19, 2025
Perlover and others added 2 commits December 19, 2025 16:28
…eritance

Remove the `tools:` field from all 8 subagent YAML frontmatter configurations.

Why this change was made:

1. **Default behavior is better**: When the `tools` field is omitted, subagents
   automatically inherit ALL tools from the main thread, including all MCP tools
   from user-configured MCP servers.

2. **MCP tools access**: With explicit `tools` field, subagents were restricted
   only to the listed tools. This meant MCP tools (like Playwright, Context7,
   or any user-installed MCP servers) required manual addition to each agent.

3. **Maintenance burden eliminated**: Previously, every new tool or MCP server
   required updating all agent files. Now subagents automatically get access
   to any tools available to the main Claude Code instance.

4. **Per Claude Code docs**: "Omit the tools field to inherit all tools from
   the main thread (default), including MCP tools" - this is the recommended
   approach for maximum flexibility.

Affected agents:
- implementer.md
- implementation-verifier.md
- spec-initializer.md
- spec-shaper.md
- spec-verifier.md
- spec-writer.md
- tasks-list-creator.md
- product-planner.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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