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 Edit tool for all implementer agents. This prevents agents from falsely marking tasks as complete without actually executing them, aligns skills usage with Claude Code's built-in mechanisms, and allows efficient file modifications.

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 agents can use Edit tool for targeted file modifications (not just full file rewrites)

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: Missing Edit tool

Problem solved:
All agent files previously had only Write and Read tools in their YAML frontmatter, which meant agents could only:

  • Write - create or overwrite entire files
  • Read - read files

But they couldn't use Edit for targeted string replacements (old_stringnew_string). This was inefficient when working with existing code, forcing agents to rewrite entire files for small changes.

Changes:
Added Edit tool to 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:
The Edit tool is the preferred approach in Claude Code for modifying existing files, as documented in the official Claude Code tool reference. It allows precise modifications without rewriting entire files, reducing the risk of accidentally losing content.

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
  • Edit tool is additive - agents can still use Write when full file replacement is needed

References

Documentation sources used for these changes:

Claude Code Tools Documentation

Key Documentation Excerpts

From the frontmatter reference, the correct format for specifying multiple tools:

allowed-tools: Read, Write, Edit

From the agent creator documentation, agent files support a tools field:

---
name: [identifier]
description: [Use this agent when...]
model: inherit
color: [chosen-color]
tools: ["Tool1", "Tool2"]  # Optional
---

Important: Write and Edit are separate tools with different purposes:

  • Write - creates or completely overwrites a file
  • Edit - performs targeted string replacements (old_stringnew_string)

Both should be included when agents need full file manipulation capabilities.

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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
@Perlover Perlover changed the title Fix/implementer task completion rules feat(agents): add task completion rules, skills discovery, and Edit tool Dec 19, 2025
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