diff --git a/.claude/agents/action-planning-agent.md b/.claude/agents/action-planning-agent.md index 9ec525bc..1fce3e83 100644 --- a/.claude/agents/action-planning-agent.md +++ b/.claude/agents/action-planning-agent.md @@ -834,10 +834,35 @@ Use `analysis_results.complexity` or task count to determine structure: - Proper linking between documents - Consistent navigation and references -### 3.3 Guidelines Checklist +### 3.3 N+1 Context Recording + +**Purpose**: Record decisions and deferred items for N+1 planning continuity. + +**When**: After task generation, update `## N+1 Context` in planning-notes.md. + +**What to Record**: +- **Decisions**: Architecture/technology choices with rationale (mark `Revisit?` if may change) +- **Deferred**: Items explicitly moved to N+1 with reason + +**Example**: +```markdown +## N+1 Context +### Decisions +| Decision | Rationale | Revisit? | +|----------|-----------|----------| +| JWT over Session | Stateless scaling | No | +| CROSS::B::api → IMPL-B1 | B1 defines base | Yes | + +### Deferred +- [ ] Rate limiting - Requires Redis (N+1) +- [ ] API versioning - Low priority +``` + +### 3.4 Guidelines Checklist **ALWAYS:** - **Load planning-notes.md FIRST**: Read planning-notes.md before context-package.json. Use its Consolidated Constraints as primary constraint source for all task generation +- **Record N+1 Context**: Update `## N+1 Context` section with key decisions and deferred items - **Search Tool Priority**: ACE (`mcp__ace-tool__search_context`) → CCW (`mcp__ccw-tools__smart_search`) / Built-in (`Grep`, `Glob`, `Read`) - Apply Quantification Requirements to all requirements, acceptance criteria, and modification points - Load IMPL_PLAN template: `Read(~/.claude/workflows/cli-templates/prompts/workflow/impl-plan-template.txt)` before generating IMPL_PLAN.md diff --git a/.claude/commands/workflow/plan.md b/.claude/commands/workflow/plan.md index 6f5ac020..f3070a20 100644 --- a/.claude/commands/workflow/plan.md +++ b/.claude/commands/workflow/plan.md @@ -119,7 +119,7 @@ CONTEXT: Existing user database schema, REST API endpoints **After Phase 1**: Initialize planning-notes.md with user intent ```javascript -// Create minimal planning notes document +// Create planning notes document with N+1 context support const planningNotesPath = `.workflow/active/${sessionId}/planning-notes.md` const userGoal = structuredDescription.goal const userConstraints = structuredDescription.context || "None specified" @@ -144,6 +144,19 @@ Write(planningNotesPath, `# Planning Notes ## Consolidated Constraints (Phase 4 Input) 1. ${userConstraints} + +--- + +## Task Generation (Phase 4) +(To be filled by action-planning-agent) + +## N+1 Context +### Decisions +| Decision | Rationale | Revisit? | +|----------|-----------|----------| + +### Deferred +- [ ] (For N+1) `) ``` diff --git a/.claude/commands/workflow/tools/task-generate-agent.md b/.claude/commands/workflow/tools/task-generate-agent.md index 560b31b2..2b818be7 100644 --- a/.claude/commands/workflow/tools/task-generate-agent.md +++ b/.claude/commands/workflow/tools/task-generate-agent.md @@ -378,16 +378,26 @@ Hard Constraints: - Return completion status with document count and task breakdown summary ## PLANNING NOTES RECORD (REQUIRED) -After completing all documents, append a brief execution record to planning-notes.md: +After completing, update planning-notes.md: **File**: .workflow/active/{session_id}/planning-notes.md -**Location**: Create new section after "## Consolidated Constraints" -**Format**: -\`\`\` -## Task Generation (Phase 4) +1. **Task Generation (Phase 4)**: Task count and key tasks +2. **N+1 Context**: Key decisions (with rationale) + deferred items + +\`\`\`markdown +## Task Generation (Phase 4) ### [Action-Planning Agent] YYYY-MM-DD -- **Note**: [智能补充:简短总结任务数量、关键任务、依赖关系等] +- **Tasks**: [count] ([IDs]) + +## N+1 Context +### Decisions +| Decision | Rationale | Revisit? | +|----------|-----------|----------| +| [choice] | [why] | [Yes/No] | + +### Deferred +- [ ] [item] - [reason] \`\`\` ` ) @@ -543,19 +553,13 @@ Hard Constraints: - Return: task count, task IDs, dependency summary (internal + cross-module) ## PLANNING NOTES RECORD (REQUIRED) -After completing module task JSONs, append a brief execution record to planning-notes.md: +After completing, append to planning-notes.md: -**File**: .workflow/active/{session_id}/planning-notes.md -**Location**: Create new section after "## Consolidated Constraints" (if not exists) -**Format**: +\`\`\`markdown +### [${module.name}] YYYY-MM-DD +- **Tasks**: [count] ([IDs]) +- **CROSS deps**: [placeholders used] \`\`\` -## Task Generation (Phase 4) - -### [Action-Planning Agent - ${module.name}] YYYY-MM-DD -- **Note**: [智能补充:简短总结本模块任务数量、关键任务等] -\`\`\` - -**Note**: Multiple module agents will append their records. Phase 3 Integration Coordinator will add final summary. ` ) ); @@ -638,14 +642,21 @@ Module Count: ${modules.length} - Return: task count, per-module breakdown, resolved dependency count ## PLANNING NOTES RECORD (REQUIRED) -After completing integration, append final summary to planning-notes.md: +After integration, update planning-notes.md: -**File**: .workflow/active/{session_id}/planning-notes.md -**Location**: Under "## Task Generation (Phase 4)" section (after module agent records) -**Format**: -\`\`\` -### [Integration Coordinator] YYYY-MM-DD -- **Note**: [智能补充:简短总结总任务数、跨模块依赖解决情况等] +\`\`\`markdown +### [Coordinator] YYYY-MM-DD +- **Total**: [count] tasks +- **Resolved**: [CROSS:: resolutions] + +## N+1 Context +### Decisions +| Decision | Rationale | Revisit? | +|----------|-----------|----------| +| CROSS::X → IMPL-Y | [why this resolution] | [Yes/No] | + +### Deferred +- [ ] [unresolved CROSS or conflict] - [reason] \`\`\` ` )