fix(#671): add project CLAUDE.md discovery to subagent spawn points

Subagents now read project-level CLAUDE.md if it exists:
- Workflows: execute-phase, plan-phase, quick
- Agents: gsd-executor, gsd-planner, gsd-phase-researcher, gsd-plan-checker

Agents read ./CLAUDE.md in their fresh context, following project-specific
guidelines, security requirements, and coding conventions.

Fixes: #671

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Lex Christopherson
2026-02-19 10:45:59 -06:00
parent 270b6c4aaa
commit 8fd7d0b635
7 changed files with 14 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ Your job: Execute the plan completely, commit each task, create SUMMARY.md, upda
<project_context>
Before executing, discover project context:
**Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
**Project skills:** Check `.agents/skills/` directory if it exists:
1. List available skills (subdirectories)
2. Read `SKILL.md` for each skill (lightweight index ~130 lines)

View File

@@ -21,6 +21,8 @@ Spawned by `/gsd:plan-phase` (integrated) or `/gsd:research-phase` (standalone).
<project_context>
Before researching, discover project context:
**Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
**Project skills:** Check `.agents/skills/` directory if it exists:
1. List available skills (subdirectories)
2. Read `SKILL.md` for each skill (lightweight index ~130 lines)

View File

@@ -26,6 +26,8 @@ You are NOT the executor or verifier — you verify plans WILL work before execu
<project_context>
Before verifying, discover project context:
**Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
**Project skills:** Check `.agents/skills/` directory if it exists:
1. List available skills (subdirectories)
2. Read `SKILL.md` for each skill (lightweight index ~130 lines)

View File

@@ -28,6 +28,8 @@ Your job: Produce PLAN.md files that Claude executors can implement without inte
<project_context>
Before planning, discover project context:
**Project instructions:** Read `./CLAUDE.md` if it exists in the working directory. Follow all project-specific guidelines, security requirements, and coding conventions.
**Project skills:** Check `.agents/skills/` directory if it exists:
1. List available skills (subdirectories)
2. Read `SKILL.md` for each skill (lightweight index ~130 lines)

View File

@@ -121,6 +121,7 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true`
- Plan: {phase_dir}/{plan_file}
- State: .planning/STATE.md
- Config: .planning/config.json (if exists)
- Project instructions: ./CLAUDE.md (if exists — follow project-specific guidelines and coding conventions)
- Project skills: .agents/skills/ (if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
</files_to_read>

View File

@@ -124,6 +124,7 @@ IMPORTANT: If CONTEXT.md exists below, it contains user decisions from /gsd:disc
**Requirements:** {requirements}
**Prior decisions:** {decisions}
**Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
**Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, research should account for project skill patterns
</additional_context>
@@ -203,6 +204,7 @@ IMPORTANT: If context exists below, it contains USER DECISIONS from /gsd:discuss
**Research:** {research_content}
**Gap Closure (if --gaps):** {verification_content} {uat_content}
**Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
**Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, plans should account for project skill rules
</planning_context>
@@ -273,6 +275,7 @@ IMPORTANT: Plans MUST honor user decisions. Flag as issue if plans contradict.
{context_content}
**Project instructions:** Read ./CLAUDE.md if exists — verify plans honor project guidelines
**Project skills:** Check .agents/skills/ directory (if exists) — verify plans account for project skill rules
</verification_context>

View File

@@ -99,6 +99,7 @@ Task(
**Project State:**
@.planning/STATE.md
**Project instructions:** Read ./CLAUDE.md if exists — follow project-specific guidelines
**Project skills:** Check .agents/skills/ directory (if exists) — read SKILL.md files, plans should account for project skill rules
</planning_context>
@@ -251,6 +252,7 @@ Execute quick task ${next_num}.
Plan: @${QUICK_DIR}/${next_num}-PLAN.md
Project state: @.planning/STATE.md
Project instructions: ./CLAUDE.md (if exists — follow project-specific guidelines)
Project skills: .agents/skills/ (if exists — list skills, read SKILL.md for each, follow relevant rules during implementation)
<constraints>