diff --git a/.claude/commands/task/replan.md b/.claude/commands/task/replan.md index 28c9e5e7..2223a3a7 100644 --- a/.claude/commands/task/replan.md +++ b/.claude/commands/task/replan.md @@ -357,7 +357,7 @@ Review error details in summary report # No replan recommendations found Verification report contains no replan recommendations -Check report content or use /workflow:action-plan-verify first +Check report content or use /workflow:plan-verify first ``` ## Batch Mode Integration diff --git a/.claude/commands/workflow/action-plan-verify.md b/.claude/commands/workflow/action-plan-verify.md index cc3933be..8ae2222a 100644 --- a/.claude/commands/workflow/action-plan-verify.md +++ b/.claude/commands/workflow/action-plan-verify.md @@ -1,8 +1,8 @@ --- -name: action-plan-verify -description: Perform non-destructive cross-artifact consistency analysis between IMPL_PLAN.md and task JSONs with quality gate validation +name: plan-verify +description: Perform READ-ONLY verification analysis between IMPL_PLAN.md, task JSONs, and brainstorming artifacts. Generates structured report with quality gate recommendation. Does NOT modify any files. argument-hint: "[optional: --session session-id]" -allowed-tools: Read(*), TodoWrite(*), Glob(*), Bash(*) +allowed-tools: Read(*), Write(*), Glob(*), Bash(*) --- ## User Input @@ -15,13 +15,26 @@ You **MUST** consider the user input before proceeding (if not empty). ## Goal -Identify inconsistencies, duplications, ambiguities, and underspecified items between action planning artifacts (`IMPL_PLAN.md`, `task.json`) and brainstorming artifacts (`role analysis documents`) before implementation. This command MUST run only after `/workflow:plan` has successfully produced complete `IMPL_PLAN.md` and task JSON files. +Generate a comprehensive verification report that identifies inconsistencies, duplications, ambiguities, and underspecified items between action planning artifacts (`IMPL_PLAN.md`, `task.json`) and brainstorming artifacts (`role analysis documents`). This command MUST run only after `/workflow:plan` has successfully produced complete `IMPL_PLAN.md` and task JSON files. + +**Output**: A structured Markdown report saved to `.workflow/active/WFS-{session}/.process/ACTION_PLAN_VERIFICATION.md` containing: +- Executive summary with quality gate recommendation +- Detailed findings by severity (CRITICAL/HIGH/MEDIUM/LOW) +- Requirements coverage analysis +- Dependency integrity check +- Synthesis alignment validation +- Actionable remediation recommendations ## Operating Constraints -**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands). +**STRICTLY READ-ONLY FOR SOURCE ARTIFACTS**: +- **MUST NOT** modify `IMPL_PLAN.md`, any `task.json` files, or brainstorming artifacts +- **MUST NOT** create or delete task files +- **MUST ONLY** write the verification report to `.process/ACTION_PLAN_VERIFICATION.md` -**Synthesis Authority**: The `role analysis documents` is **authoritative** for requirements and design decisions. Any conflicts between IMPL_PLAN/tasks and synthesis are automatically CRITICAL and require adjustment of the plan/tasks—not reinterpretation of requirements. +**Synthesis Authority**: The `role analysis documents` are **authoritative** for requirements and design decisions. Any conflicts between IMPL_PLAN/tasks and synthesis are automatically CRITICAL and require adjustment of the plan/tasks—not reinterpretation of requirements. + +**Quality Gate Authority**: The verification report provides a binding recommendation (BLOCK_EXECUTION / PROCEED_WITH_FIXES / PROCEED_WITH_CAUTION / PROCEED) based on objective severity criteria. User MUST review critical/high issues before proceeding with implementation. ## Execution Steps @@ -47,6 +60,12 @@ ELSE: session_dir = .workflow/active/WFS-{session} brainstorm_dir = session_dir/.brainstorming task_dir = session_dir/.task +process_dir = session_dir/.process +session_file = session_dir/workflow-session.json + +# Create .process directory if not exists (report output location) +IF NOT EXISTS(process_dir): + bash(mkdir -p "{process_dir}") # Validate required artifacts # Note: "role analysis documents" refers to [role]/analysis.md files (e.g., product-manager/analysis.md) @@ -54,7 +73,12 @@ SYNTHESIS_DIR = brainstorm_dir # Contains role analysis files: */analysis.md IMPL_PLAN = session_dir/IMPL_PLAN.md TASK_FILES = Glob(task_dir/*.json) -# Abort if missing +# Abort if missing - in order of dependency +SESSION_FILE_EXISTS = EXISTS(session_file) +IF NOT SESSION_FILE_EXISTS: + WARNING: "workflow-session.json not found. User intent alignment verification will be skipped." + # Continue execution - this is optional context, not blocking + SYNTHESIS_FILES = Glob(brainstorm_dir/*/analysis.md) IF SYNTHESIS_FILES.count == 0: ERROR: "No role analysis documents found in .brainstorming/*/analysis.md. Run /workflow:brainstorm:synthesis first" @@ -73,12 +97,14 @@ IF TASK_FILES.count == 0: Load only minimal necessary context from each artifact: -**From workflow-session.json** (NEW - PRIMARY REFERENCE): +**From workflow-session.json** (OPTIONAL - Primary Reference for User Intent): +- **ONLY IF EXISTS**: Load user intent context - Original user prompt/intent (project or description field) - User's stated goals and objectives - User's scope definition +- **IF MISSING**: Set user_intent_analysis = "SKIPPED: workflow-session.json not found" -**From role analysis documents**: +**From role analysis documents** (AUTHORITATIVE SOURCE): - Functional Requirements (IDs, descriptions, acceptance criteria) - Non-Functional Requirements (IDs, targets) - Business Requirements (IDs, success metrics) @@ -126,9 +152,21 @@ Create internal representations (do not include raw artifacts in output): ### 4. Detection Passes (Token-Efficient Analysis) -Focus on high-signal findings. Limit to 50 findings total; aggregate remainder in overflow summary. +**Token Budget Strategy**: +- **Total Limit**: 50 findings maximum (aggregate remainder in overflow summary) +- **Priority Allocation**: CRITICAL (unlimited) → HIGH (15) → MEDIUM (20) → LOW (15) +- **Early Exit**: If CRITICAL findings > 0 in User Intent/Requirements Coverage, skip LOW/MEDIUM priority checks -#### A. User Intent Alignment (NEW - CRITICAL) +**Execution Order** (Process in sequence; skip if token budget exhausted): + +1. **Tier 1 (CRITICAL Path)**: A, B, C - User intent, coverage, consistency (process fully) +2. **Tier 2 (HIGH Priority)**: D, E - Dependencies, synthesis alignment (limit 15 findings total) +3. **Tier 3 (MEDIUM Priority)**: F - Specification quality (limit 20 findings) +4. **Tier 4 (LOW Priority)**: G, H - Duplication, feasibility (limit 15 findings total) + +--- + +#### A. User Intent Alignment (CRITICAL - Tier 1) - **Goal Alignment**: IMPL_PLAN objectives match user's original intent - **Scope Drift**: Plan covers user's stated scope without unauthorized expansion diff --git a/.claude/commands/workflow/plan-verify.md b/.claude/commands/workflow/plan-verify.md new file mode 100644 index 00000000..f0567f6e --- /dev/null +++ b/.claude/commands/workflow/plan-verify.md @@ -0,0 +1,527 @@ +--- +name: plan-verify +description: Perform READ-ONLY verification analysis between IMPL_PLAN.md, task JSONs, and brainstorming artifacts. Generates structured report with quality gate recommendation. Does NOT modify any files. +argument-hint: "[optional: --session session-id]" +allowed-tools: Read(*), Write(*), Glob(*), Bash(*) +--- + +## User Input + +```text +$ARGUMENTS +``` + +You **MUST** consider the user input before proceeding (if not empty). + +## Goal + +Generate a comprehensive verification report that identifies inconsistencies, duplications, ambiguities, and underspecified items between action planning artifacts (`IMPL_PLAN.md`, `task.json`) and brainstorming artifacts (`role analysis documents`). This command MUST run only after `/workflow:plan` has successfully produced complete `IMPL_PLAN.md` and task JSON files. + +**Output**: A structured Markdown report saved to `.workflow/active/WFS-{session}/.process/PLAN_VERIFICATION.md` containing: +- Executive summary with quality gate recommendation +- Detailed findings by severity (CRITICAL/HIGH/MEDIUM/LOW) +- Requirements coverage analysis +- Dependency integrity check +- Synthesis alignment validation +- Actionable remediation recommendations + +## Operating Constraints + +**STRICTLY READ-ONLY FOR SOURCE ARTIFACTS**: +- **MUST NOT** modify `IMPL_PLAN.md`, any `task.json` files, or brainstorming artifacts +- **MUST NOT** create or delete task files +- **MUST ONLY** write the verification report to `.process/PLAN_VERIFICATION.md` + +**Synthesis Authority**: The `role analysis documents` are **authoritative** for requirements and design decisions. Any conflicts between IMPL_PLAN/tasks and synthesis are automatically CRITICAL and require adjustment of the plan/tasks—not reinterpretation of requirements. + +**Quality Gate Authority**: The verification report provides a binding recommendation (BLOCK_EXECUTION / PROCEED_WITH_FIXES / PROCEED_WITH_CAUTION / PROCEED) based on objective severity criteria. User MUST review critical/high issues before proceeding with implementation. + +## Execution Steps + +### 1. Initialize Analysis Context + +```bash +# Detect active workflow session +IF --session parameter provided: + session_id = provided session +ELSE: + # Auto-detect active session + active_sessions = bash(find .workflow/active/ -name "WFS-*" -type d 2>/dev/null) + IF active_sessions is empty: + ERROR: "No active workflow session found. Use --session " + EXIT + ELSE IF active_sessions has multiple entries: + # Use most recently modified session + session_id = bash(ls -td .workflow/active/WFS-*/ 2>/dev/null | head -1 | xargs basename) + ELSE: + session_id = basename(active_sessions[0]) + +# Derive absolute paths +session_dir = .workflow/active/WFS-{session} +brainstorm_dir = session_dir/.brainstorming +task_dir = session_dir/.task +process_dir = session_dir/.process +session_file = session_dir/workflow-session.json + +# Create .process directory if not exists (report output location) +IF NOT EXISTS(process_dir): + bash(mkdir -p "{process_dir}") + +# Validate required artifacts +# Note: "role analysis documents" refers to [role]/analysis.md files (e.g., product-manager/analysis.md) +SYNTHESIS_DIR = brainstorm_dir # Contains role analysis files: */analysis.md +IMPL_PLAN = session_dir/IMPL_PLAN.md +TASK_FILES = Glob(task_dir/*.json) + +# Abort if missing - in order of dependency +SESSION_FILE_EXISTS = EXISTS(session_file) +IF NOT SESSION_FILE_EXISTS: + WARNING: "workflow-session.json not found. User intent alignment verification will be skipped." + # Continue execution - this is optional context, not blocking + +SYNTHESIS_FILES = Glob(brainstorm_dir/*/analysis.md) +IF SYNTHESIS_FILES.count == 0: + ERROR: "No role analysis documents found in .brainstorming/*/analysis.md. Run /workflow:brainstorm:synthesis first" + EXIT + +IF NOT EXISTS(IMPL_PLAN): + ERROR: "IMPL_PLAN.md not found. Run /workflow:plan first" + EXIT + +IF TASK_FILES.count == 0: + ERROR: "No task JSON files found. Run /workflow:plan first" + EXIT +``` + +### 2. Load Artifacts (Progressive Disclosure) + +Load only minimal necessary context from each artifact: + +**From workflow-session.json** (OPTIONAL - Primary Reference for User Intent): +- **ONLY IF EXISTS**: Load user intent context +- Original user prompt/intent (project or description field) +- User's stated goals and objectives +- User's scope definition +- **IF MISSING**: Set user_intent_analysis = "SKIPPED: workflow-session.json not found" + +**From role analysis documents** (AUTHORITATIVE SOURCE): +- Functional Requirements (IDs, descriptions, acceptance criteria) +- Non-Functional Requirements (IDs, targets) +- Business Requirements (IDs, success metrics) +- Key Architecture Decisions +- Risk factors and mitigation strategies +- Implementation Roadmap (high-level phases) + +**From IMPL_PLAN.md**: +- Summary and objectives +- Context Analysis +- Implementation Strategy +- Task Breakdown Summary +- Success Criteria +- Brainstorming Artifacts References (if present) + +**From task.json files**: +- Task IDs +- Titles and descriptions +- Status +- Dependencies (depends_on, blocks) +- Context (requirements, focus_paths, acceptance, artifacts) +- Flow control (pre_analysis, implementation_approach) +- Meta (complexity, priority) + +### 3. Build Semantic Models + +Create internal representations (do not include raw artifacts in output): + +**Requirements inventory**: +- Each functional/non-functional/business requirement with stable ID +- Requirement text, acceptance criteria, priority + +**Architecture decisions inventory**: +- ADRs from synthesis +- Technology choices +- Data model references + +**Task coverage mapping**: +- Map each task to one or more requirements (by ID reference or keyword inference) +- Map each requirement to covering tasks + +**Dependency graph**: +- Task-to-task dependencies (depends_on, blocks) +- Requirement-level dependencies (from synthesis) + +### 4. Detection Passes (Token-Efficient Analysis) + +**Token Budget Strategy**: +- **Total Limit**: 50 findings maximum (aggregate remainder in overflow summary) +- **Priority Allocation**: CRITICAL (unlimited) → HIGH (15) → MEDIUM (20) → LOW (15) +- **Early Exit**: If CRITICAL findings > 0 in User Intent/Requirements Coverage, skip LOW/MEDIUM priority checks + +**Execution Order** (Process in sequence; skip if token budget exhausted): + +1. **Tier 1 (CRITICAL Path)**: A, B, C - User intent, coverage, consistency (process fully) +2. **Tier 2 (HIGH Priority)**: D, E - Dependencies, synthesis alignment (limit 15 findings total) +3. **Tier 3 (MEDIUM Priority)**: F - Specification quality (limit 20 findings) +4. **Tier 4 (LOW Priority)**: G, H - Duplication, feasibility (limit 15 findings total) + +--- + +#### A. User Intent Alignment (CRITICAL - Tier 1) + +- **Goal Alignment**: IMPL_PLAN objectives match user's original intent +- **Scope Drift**: Plan covers user's stated scope without unauthorized expansion +- **Success Criteria Match**: Plan's success criteria reflect user's expectations +- **Intent Conflicts**: Tasks contradicting user's original objectives + +#### B. Requirements Coverage Analysis + +- **Orphaned Requirements**: Requirements in synthesis with zero associated tasks +- **Unmapped Tasks**: Tasks with no clear requirement linkage +- **NFR Coverage Gaps**: Non-functional requirements (performance, security, scalability) not reflected in tasks + +#### C. Consistency Validation + +- **Requirement Conflicts**: Tasks contradicting synthesis requirements +- **Architecture Drift**: IMPL_PLAN architecture not matching synthesis ADRs +- **Terminology Drift**: Same concept named differently across IMPL_PLAN and tasks +- **Data Model Inconsistency**: Tasks referencing entities/fields not in synthesis data model + +#### D. Dependency Integrity + +- **Circular Dependencies**: Task A depends on B, B depends on C, C depends on A +- **Missing Dependencies**: Task requires outputs from another task but no explicit dependency +- **Broken Dependencies**: Task depends on non-existent task ID +- **Logical Ordering Issues**: Implementation tasks before foundational setup without dependency note + +#### E. Synthesis Alignment + +- **Priority Conflicts**: High-priority synthesis requirements mapped to low-priority tasks +- **Success Criteria Mismatch**: IMPL_PLAN success criteria not covering synthesis acceptance criteria +- **Risk Mitigation Gaps**: Critical risks in synthesis without corresponding mitigation tasks + +#### F. Task Specification Quality + +- **Ambiguous Focus Paths**: Tasks with vague or missing focus_paths +- **Underspecified Acceptance**: Tasks without clear acceptance criteria +- **Missing Artifacts References**: Tasks not referencing relevant brainstorming artifacts in context.artifacts +- **Weak Flow Control**: Tasks without clear implementation_approach or pre_analysis steps +- **Missing Target Files**: Tasks without flow_control.target_files specification + +#### G. Duplication Detection + +- **Overlapping Task Scope**: Multiple tasks with nearly identical descriptions +- **Redundant Requirements Coverage**: Same requirement covered by multiple tasks without clear partitioning + +#### H. Feasibility Assessment + +- **Complexity Misalignment**: Task marked "simple" but requires multiple file modifications +- **Resource Conflicts**: Parallel tasks requiring same resources/files +- **Skill Gap Risks**: Tasks requiring skills not in team capability assessment (from synthesis) + +### 5. Severity Assignment + +Use this heuristic to prioritize findings: + +- **CRITICAL**: + - Violates user's original intent (goal misalignment, scope drift) + - Violates synthesis authority (requirement conflict) + - Core requirement with zero coverage + - Circular dependencies + - Broken dependencies + +- **HIGH**: + - NFR coverage gaps + - Priority conflicts + - Missing risk mitigation tasks + - Ambiguous acceptance criteria + +- **MEDIUM**: + - Terminology drift + - Missing artifacts references + - Weak flow control + - Logical ordering issues + +- **LOW**: + - Style/wording improvements + - Minor redundancy not affecting execution + +### 6. Produce Compact Analysis Report + +**Report Generation**: Generate report content and save to file. + +Output a Markdown report with the following structure: + +```markdown +# Plan Verification Report + +**Session**: WFS-{session-id} +**Generated**: {timestamp} +**Artifacts Analyzed**: role analysis documents, IMPL_PLAN.md, {N} task files +**User Intent Analysis**: {user_intent_analysis or "SKIPPED: workflow-session.json not found"} + +--- + +## Executive Summary + +### Quality Gate Decision + +| Metric | Value | Status | +|--------|-------|--------| +| Overall Risk Level | CRITICAL \| HIGH \| MEDIUM \| LOW | {status_emoji} | +| Critical Issues | {count} | 🔴 | +| High Issues | {count} | 🟠 | +| Medium Issues | {count} | 🟡 | +| Low Issues | {count} | 🟢 | + +### Recommendation + +**{RECOMMENDATION}** + +**Decision Rationale**: +{brief explanation based on severity criteria} + +**Quality Gate Criteria**: +- **BLOCK_EXECUTION**: Critical issues > 0 (must fix before proceeding) +- **PROCEED_WITH_FIXES**: Critical = 0, High > 0 (fix recommended before execution) +- **PROCEED_WITH_CAUTION**: Critical = 0, High = 0, Medium > 0 (proceed with awareness) +- **PROCEED**: Only Low issues or None (safe to execute) + +--- + +## Findings Summary + +| ID | Category | Severity | Location(s) | Summary | Recommendation | +|----|----------|----------|-------------|---------|----------------| +| C1 | Coverage | CRITICAL | synthesis:FR-03 | Requirement "User auth" has zero task coverage | Add authentication implementation task | +| H1 | Consistency | HIGH | IMPL-1.2 vs synthesis:ADR-02 | Task uses REST while synthesis specifies GraphQL | Align task with ADR-02 decision | +| M1 | Specification | MEDIUM | IMPL-2.1 | Missing context.artifacts reference | Add @synthesis reference | +| L1 | Duplication | LOW | IMPL-3.1, IMPL-3.2 | Similar scope | Consider merging | + +(Generate stable IDs prefixed by severity initial: C/H/M/L + number) + +--- + +## User Intent Alignment Analysis + +{IF user_intent_analysis != "SKIPPED"} + +### Goal Alignment +- **User Intent**: {user_original_intent} +- **IMPL_PLAN Objectives**: {plan_objectives} +- **Alignment Status**: {ALIGNED/MISALIGNED/PARTIAL} +- **Findings**: {specific alignment issues} + +### Scope Verification +- **User Scope**: {user_defined_scope} +- **Plan Scope**: {plan_actual_scope} +- **Drift Detection**: {NONE/MINOR/MAJOR} +- **Findings**: {specific scope issues} + +{ELSE} +> ⚠️ User intent alignment analysis was skipped because workflow-session.json was not found. + +{END IF} + +--- + +## Requirements Coverage Analysis + +### Functional Requirements + +| Requirement ID | Requirement Summary | Has Task? | Task IDs | Priority Match | Notes | +|----------------|---------------------|-----------|----------|----------------|-------| +| FR-01 | User authentication | Yes | IMPL-1.1, IMPL-1.2 | Match | Complete | +| FR-02 | Data export | Yes | IMPL-2.3 | Mismatch | High req → Med priority task | +| FR-03 | Profile management | No | - | - | **CRITICAL: Zero coverage** | + +### Non-Functional Requirements + +| Requirement ID | Requirement Summary | Has Task? | Task IDs | Notes | +|----------------|---------------------|-----------|----------|-------| +| NFR-01 | Response time <200ms | No | - | **HIGH: No performance tasks** | +| NFR-02 | Security compliance | Yes | IMPL-4.1 | Complete | + +### Business Requirements + +| Requirement ID | Requirement Summary | Has Task? | Task IDs | Notes | +|----------------|---------------------|-----------|----------|-------| +| BR-01 | Launch by Q2 | Yes | IMPL-1.* through IMPL-5.* | Timeline realistic | + +### Coverage Metrics + +| Requirement Type | Total | Covered | Coverage % | +|------------------|-------|---------|------------| +| Functional | {count} | {count} | {percent}% | +| Non-Functional | {count} | {count} | {percent}% | +| Business | {count} | {count} | {percent}% | +| **Overall** | **{total}** | **{covered}** | **{percent}%** | + +--- + +## Dependency Integrity + +### Dependency Graph Analysis + +**Circular Dependencies**: {None or List} + +**Broken Dependencies**: +- IMPL-2.3 depends on "IMPL-2.4" (non-existent) + +**Missing Dependencies**: +- IMPL-5.1 (integration test) has no dependency on IMPL-1.* (implementation tasks) + +**Logical Ordering Issues**: +{List or "None detected"} + +--- + +## Synthesis Alignment Issues + +| Issue Type | Synthesis Reference | IMPL_PLAN/Task | Impact | Recommendation | +|------------|---------------------|----------------|--------|----------------| +| Architecture Conflict | synthesis:ADR-01 (JWT auth) | IMPL_PLAN uses session cookies | HIGH | Update IMPL_PLAN to use JWT | +| Priority Mismatch | synthesis:FR-02 (High) | IMPL-2.3 (Medium) | MEDIUM | Elevate task priority | +| Missing Risk Mitigation | synthesis:Risk-03 (API rate limits) | No mitigation tasks | HIGH | Add rate limiting implementation task | + +--- + +## Task Specification Quality + +### Aggregate Statistics + +| Quality Dimension | Tasks Affected | Percentage | +|-------------------|----------------|------------| +| Missing Artifacts References | {count} | {percent}% | +| Weak Flow Control | {count} | {percent}% | +| Missing Target Files | {count} | {percent}% | +| Ambiguous Focus Paths | {count} | {percent}% | + +### Sample Issues + +- **IMPL-1.2**: No context.artifacts reference to synthesis +- **IMPL-3.1**: Missing flow_control.target_files specification +- **IMPL-4.2**: Vague focus_paths ["src/"] - needs refinement + +--- + +## Feasibility Concerns + +| Concern | Tasks Affected | Issue | Recommendation | +|---------|----------------|-------|----------------| +| Skill Gap | IMPL-6.1, IMPL-6.2 | Requires Kubernetes expertise not in team | Add training task or external consultant | +| Resource Conflict | IMPL-3.1, IMPL-3.2 | Both modify src/auth/service.ts in parallel | Add dependency or serialize | + +--- + +## Detailed Findings by Severity + +### CRITICAL Issues ({count}) + +{Detailed breakdown of each critical issue with location, impact, and recommendation} + +### HIGH Issues ({count}) + +{Detailed breakdown of each high issue with location, impact, and recommendation} + +### MEDIUM Issues ({count}) + +{Detailed breakdown of each medium issue with location, impact, and recommendation} + +### LOW Issues ({count}) + +{Detailed breakdown of each low issue with location, impact, and recommendation} + +--- + +## Metrics Summary + +| Metric | Value | +|--------|-------| +| Total Requirements | {count} ({functional} functional, {nonfunctional} non-functional, {business} business) | +| Total Tasks | {count} | +| Overall Coverage | {percent}% ({covered}/{total} requirements with ≥1 task) | +| Critical Issues | {count} | +| High Issues | {count} | +| Medium Issues | {count} | +| Low Issues | {count} | +| Total Findings | {total_findings} | + +--- + +## Remediation Recommendations + +### Priority Order + +1. **CRITICAL** - Must fix before proceeding +2. **HIGH** - Fix before execution +3. **MEDIUM** - Fix during or after implementation +4. **LOW** - Optional improvements + +### Next Steps + +Based on the quality gate recommendation ({RECOMMENDATION}): + +{IF BLOCK_EXECUTION} +**🛑 BLOCK EXECUTION** + +You must resolve all CRITICAL issues before proceeding with implementation: + +1. Review each critical issue in detail +2. Determine remediation approach (modify IMPL_PLAN.md, update task.json, or add new tasks) +3. Apply fixes systematically +4. Re-run verification to confirm resolution + +{ELSE IF PROCEED_WITH_FIXES} +**⚠️ PROCEED WITH FIXES RECOMMENDED** + +No critical issues detected, but HIGH issues exist. Recommended workflow: + +1. Review high-priority issues +2. Apply fixes before execution for optimal results +3. Re-run verification (optional) + +{ELSE IF PROCEED_WITH_CAUTION} +**✅ PROCEED WITH CAUTION** + +Only MEDIUM issues detected. You may proceed with implementation: + +- Address medium issues during or after implementation +- Maintain awareness of identified concerns + +{ELSE} +**✅ PROCEED** + +No significant issues detected. Safe to execute implementation workflow. + +{END IF} + +--- + +**Report End** +``` + +### 7. Save and Display Report + +**Step 7.1: Save Report**: +```bash +report_path = ".workflow/active/WFS-{session}/.process/PLAN_VERIFICATION.md" +Write(report_path, full_report_content) +``` + +**Step 7.2: Display Summary to User**: +```bash +# Display executive summary in terminal +echo "=== Plan Verification Complete ===" +echo "Report saved to: {report_path}" +echo "" +echo "Quality Gate: {RECOMMENDATION}" +echo "Critical: {count} | High: {count} | Medium: {count} | Low: {count}" +echo "" +echo "Next: Review full report for detailed findings and recommendations" +``` + +**Step 7.3: Completion**: +- Report is saved to `.process/PLAN_VERIFICATION.md` +- User can review findings and decide on remediation approach +- No automatic modifications are made to source artifacts +- User can manually apply fixes or use separate remediation command (if available) diff --git a/.claude/commands/workflow/plan.md b/.claude/commands/workflow/plan.md index f51259d0..ff111296 100644 --- a/.claude/commands/workflow/plan.md +++ b/.claude/commands/workflow/plan.md @@ -322,11 +322,11 @@ Tasks generated: [count] Plan: .workflow/active/[sessionId]/IMPL_PLAN.md Recommended Next Steps: -1. /workflow:action-plan-verify --session [sessionId] # Verify plan quality before execution +1. /workflow:plan-verify --session [sessionId] # Verify plan quality before execution 2. /workflow:status # Review task breakdown 3. /workflow:execute # Start implementation (after verification) -Quality Gate: Consider running /workflow:action-plan-verify to catch issues early +Quality Gate: Consider running /workflow:plan-verify to catch issues early ``` ## TodoWrite Pattern @@ -550,6 +550,6 @@ CONSTRAINTS: [Limitations or boundaries] - `/workflow:tools:task-generate-agent` - Phase 4: Generate task JSON files with agent-driven approach **Follow-up Commands**: -- `/workflow:action-plan-verify` - Recommended: Verify plan quality and catch issues before execution +- `/workflow:plan-verify` - Recommended: Verify plan quality and catch issues before execution - `/workflow:status` - Review task breakdown and current progress - `/workflow:execute` - Begin implementation of generated tasks diff --git a/.claude/commands/workflow/tdd-plan.md b/.claude/commands/workflow/tdd-plan.md index a834fe81..1d343c29 100644 --- a/.claude/commands/workflow/tdd-plan.md +++ b/.claude/commands/workflow/tdd-plan.md @@ -449,11 +449,11 @@ User Configuration Applied: This is crucial for valid TDD - if you don't know why the test fails, you can't verify it tests the right thing. Recommended Next Steps: -1. /workflow:action-plan-verify --session [sessionId] # Verify TDD plan quality and dependencies +1. /workflow:plan-verify --session [sessionId] # Verify TDD plan quality and dependencies 2. /workflow:execute --session [sessionId] # Start TDD execution with CLI strategies 3. /workflow:tdd-verify [sessionId] # Post-execution TDD compliance check -Quality Gate: Consider running /workflow:action-plan-verify to validate TDD task structure, dependencies, and CLI execution strategies +Quality Gate: Consider running /workflow:plan-verify to validate TDD task structure, dependencies, and CLI execution strategies ``` ## TodoWrite Pattern @@ -531,7 +531,7 @@ TDD Workflow Orchestrator │ └─ Phase 6: TDD Structure Validation └─ Internal validation + summary returned - └─ Recommend: /workflow:action-plan-verify + └─ Recommend: /workflow:plan-verify Key Points: • ← ATTACHED: SlashCommand attaches sub-tasks to orchestrator TodoWrite @@ -598,7 +598,7 @@ Convert user input to TDD-structured format: - `/workflow:tools:task-generate-tdd` - Phase 5: Generate TDD tasks (CLI tool usage determined semantically) **Follow-up Commands**: -- `/workflow:action-plan-verify` - Recommended: Verify TDD plan quality and structure before execution +- `/workflow:plan-verify` - Recommended: Verify TDD plan quality and structure before execution - `/workflow:status` - Review TDD task breakdown - `/workflow:execute` - Begin TDD implementation - `/workflow:tdd-verify` - Post-execution: Verify TDD compliance and generate quality report @@ -607,7 +607,7 @@ Convert user input to TDD-structured format: | Situation | Recommended Command | Purpose | |-----------|---------------------|---------| -| First time planning | `/workflow:action-plan-verify` | Validate task structure before execution | +| First time planning | `/workflow:plan-verify` | Validate task structure before execution | | Warnings in tdd-warnings.log | Review log, refine tasks | Address Red Flags before proceeding | | High task count warning | Consider `/workflow:session:start` | Split into focused sub-sessions | | Ready to implement | `/workflow:execute` | Begin TDD Red-Green-Refactor cycles | @@ -620,7 +620,7 @@ Convert user input to TDD-structured format: ``` /workflow:tdd-plan ↓ -[Planning Complete] ──→ /workflow:action-plan-verify (recommended) +[Planning Complete] ──→ /workflow:plan-verify (recommended) ↓ [Verified/Ready] ─────→ /workflow:execute ↓ diff --git a/.claude/skills/ccw-coordinator/specs/command-library.md b/.claude/skills/ccw-coordinator/specs/command-library.md new file mode 100644 index 00000000..c01c007d --- /dev/null +++ b/.claude/skills/ccw-coordinator/specs/command-library.md @@ -0,0 +1,169 @@ +# Command Library + +CCW Coordinator 支持的命令库。基于 CCW workflow 命令系统。 + +## Command Categories + +### Planning Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/workflow:lite-plan` | 轻量级规划 | L2 | +| `/workflow:plan` | 标准规划 | L3 | +| `/workflow:multi-cli-plan` | 多CLI协作规划 | L2 | +| `/workflow:brainstorm:auto-parallel` | 头脑风暴规划 | L4 | +| `/workflow:tdd-plan` | TDD规划 | L3 | + +### Execution Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/workflow:lite-execute` | 轻量级执行 | L2 | +| `/workflow:execute` | 标准执行 | L3 | +| `/workflow:test-cycle-execute` | 测试循环执行 | L3 | + +### BugFix Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/workflow:lite-fix` | 轻量级修复 | L2 | +| `/workflow:lite-fix --hotfix` | 紧急修复 | L2 | + +### Testing Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/workflow:test-gen` | 测试生成 | L3 | +| `/workflow:test-fix-gen` | 测试修复生成 | L3 | +| `/workflow:tdd-verify` | TDD验证 | L3 | + +### Review Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/workflow:review-session-cycle` | 会话审查 | L3 | +| `/workflow:review-module-cycle` | 模块审查 | L3 | +| `/workflow:review-fix` | 审查修复 | L3 | +| `/workflow:plan-verify` | 计划验证 | L3 | + +### Documentation Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/memory:docs` | 生成文档 | L2 | +| `/memory:update-related` | 更新相关文档 | L2 | +| `/memory:update-full` | 全面更新文档 | L2 | + +### Issue Commands + +| Command | Description | Level | +|---------|-------------|-------| +| `/issue:discover` | 发现Issue | Supplementary | +| `/issue:discover-by-prompt` | 基于提示发现Issue | Supplementary | +| `/issue:plan --all-pending` | 规划所有待处理Issue | Supplementary | +| `/issue:queue` | 排队Issue | Supplementary | +| `/issue:execute` | 执行Issue | Supplementary | + +## Command Chains (Recommended) + +### 标准开发流程 + +``` +1. /workflow:lite-plan +2. /workflow:lite-execute +3. /workflow:test-cycle-execute +``` + +### 完整规划流程 + +``` +1. /workflow:plan +2. /workflow:plan-verify +3. /workflow:execute +4. /workflow:review-session-cycle +``` + +### TDD 流程 + +``` +1. /workflow:tdd-plan +2. /workflow:execute +3. /workflow:tdd-verify +``` + +### Issue 批处理流程 + +``` +1. /issue:plan --all-pending +2. /issue:queue +3. /issue:execute +``` + +## JSON Format + +```json +{ + "workflow_commands": [ + { + "category": "Planning", + "commands": [ + { "name": "/workflow:lite-plan", "description": "轻量级规划" }, + { "name": "/workflow:plan", "description": "标准规划" }, + { "name": "/workflow:multi-cli-plan", "description": "多CLI协作规划" }, + { "name": "/workflow:brainstorm:auto-parallel", "description": "头脑风暴" }, + { "name": "/workflow:tdd-plan", "description": "TDD规划" } + ] + }, + { + "category": "Execution", + "commands": [ + { "name": "/workflow:lite-execute", "description": "轻量级执行" }, + { "name": "/workflow:execute", "description": "标准执行" }, + { "name": "/workflow:test-cycle-execute", "description": "测试循环执行" } + ] + }, + { + "category": "BugFix", + "commands": [ + { "name": "/workflow:lite-fix", "description": "轻量级修复" }, + { "name": "/workflow:lite-fix --hotfix", "description": "紧急修复" } + ] + }, + { + "category": "Testing", + "commands": [ + { "name": "/workflow:test-gen", "description": "测试生成" }, + { "name": "/workflow:test-fix-gen", "description": "测试修复" }, + { "name": "/workflow:tdd-verify", "description": "TDD验证" } + ] + }, + { + "category": "Review", + "commands": [ + { "name": "/workflow:review-session-cycle", "description": "会话审查" }, + { "name": "/workflow:review-module-cycle", "description": "模块审查" }, + { "name": "/workflow:review-fix", "description": "审查修复" }, + { "name": "/workflow:plan-verify", "description": "计划验证" } + ] + }, + { + "category": "Documentation", + "commands": [ + { "name": "/memory:docs", "description": "生成文档" }, + { "name": "/memory:update-related", "description": "更新相关文档" }, + { "name": "/memory:update-full", "description": "全面更新文档" } + ] + }, + { + "category": "Issues", + "commands": [ + { "name": "/issue:discover", "description": "发现Issue" }, + { "name": "/issue:discover-by-prompt", "description": "基于提示发现Issue" }, + { "name": "/issue:plan --all-pending", "description": "规划所有待处理Issue" }, + { "name": "/issue:queue", "description": "排队Issue" }, + { "name": "/issue:execute", "description": "执行Issue" } + ] + } + ] +} +``` diff --git a/.claude/skills/ccw-coordinator/specs/specs.md b/.claude/skills/ccw-coordinator/specs/specs.md index ac0e4d4d..c0c24746 100644 --- a/.claude/skills/ccw-coordinator/specs/specs.md +++ b/.claude/skills/ccw-coordinator/specs/specs.md @@ -46,7 +46,7 @@ | `/workflow:review-session-cycle` | 会话审查 | L3 | | `/workflow:review-module-cycle` | 模块审查 | L3 | | `/workflow:review-fix` | 审查修复 | L3 | -| `/workflow:action-plan-verify` | 计划验证 | L3 | +| `/workflow:plan-verify` | 计划验证 | L3 | ### Documentation Commands @@ -82,7 +82,7 @@ ``` 1. /workflow:plan -2. /workflow:action-plan-verify +2. /workflow:plan-verify 3. /workflow:execute 4. /workflow:review-session-cycle ``` @@ -254,7 +254,7 @@ tdd-plan → lite-execute | review | review-session-cycle, review-module-cycle, review-fix | | bugfix | lite-fix, debug, debug-with-file | | maintenance | clean, replan | -| verification | action-plan-verify, tdd-verify | +| verification | plan-verify, tdd-verify | ### 兼容性矩阵 diff --git a/.claude/skills/ccw-help/command.json b/.claude/skills/ccw-help/command.json index 49dddd3e..76fd3aad 100644 --- a/.claude/skills/ccw-help/command.json +++ b/.claude/skills/ccw-help/command.json @@ -15,7 +15,7 @@ "/workflow:review-session-cycle", "/memory:docs", "/workflow:brainstorm:artifacts", - "/workflow:action-plan-verify", + "/workflow:plan-verify", "/version" ], @@ -69,7 +69,7 @@ "difficulty": "Intermediate", "essential": true, "flow": { - "next_steps": ["/workflow:action-plan-verify", "/workflow:execute"], + "next_steps": ["/workflow:plan-verify", "/workflow:execute"], "alternatives": ["/workflow:tdd-plan"] }, "source": "../../../commands/workflow/plan.md" @@ -89,8 +89,8 @@ "source": "../../../commands/workflow/execute.md" }, { - "name": "action-plan-verify", - "command": "/workflow:action-plan-verify", + "name": "plan-verify", + "command": "/workflow:plan-verify", "description": "Cross-artifact consistency analysis", "arguments": "[--session session-id]", "category": "workflow", @@ -100,7 +100,7 @@ "prerequisites": ["/workflow:plan"], "next_steps": ["/workflow:execute"] }, - "source": "../../../commands/workflow/action-plan-verify.md" + "source": "../../../commands/workflow/plan-verify.md" }, { "name": "init", diff --git a/.claude/skills/ccw-help/scripts/analyze_commands.py b/.claude/skills/ccw-help/scripts/analyze_commands.py index 95273d61..2a8ff7bb 100644 --- a/.claude/skills/ccw-help/scripts/analyze_commands.py +++ b/.claude/skills/ccw-help/scripts/analyze_commands.py @@ -144,7 +144,7 @@ def build_command_relationships() -> Dict[str, Any]: return { "workflow:plan": { "calls_internally": ["workflow:session:start", "workflow:tools:context-gather", "workflow:tools:conflict-resolution", "workflow:tools:task-generate-agent"], - "next_steps": ["workflow:action-plan-verify", "workflow:status", "workflow:execute"], + "next_steps": ["workflow:plan-verify", "workflow:status", "workflow:execute"], "alternatives": ["workflow:tdd-plan"], "prerequisites": [] }, @@ -159,7 +159,7 @@ def build_command_relationships() -> Dict[str, Any]: "related": ["workflow:status", "workflow:resume"], "next_steps": ["workflow:review", "workflow:tdd-verify"] }, - "workflow:action-plan-verify": { + "workflow:plan-verify": { "prerequisites": ["workflow:plan"], "next_steps": ["workflow:execute"], "related": ["workflow:status"] @@ -217,7 +217,7 @@ def identify_essential_commands(all_commands: List[Dict]) -> List[Dict]: "workflow:execute", "workflow:status", "workflow:session:start", "workflow:review-session-cycle", "cli:analyze", "cli:chat", "memory:docs", "workflow:brainstorm:artifacts", - "workflow:action-plan-verify", "workflow:resume", "version" + "workflow:plan-verify", "workflow:resume", "version" ] essential = [] diff --git a/.claude/skills/ccw/command.json b/.claude/skills/ccw/command.json index 7438e798..35b6c520 100644 --- a/.claude/skills/ccw/command.json +++ b/.claude/skills/ccw/command.json @@ -22,7 +22,7 @@ }, "verify": { "description": "Plan and quality verification", - "commands": ["/workflow:action-plan-verify", "/workflow:tdd-verify"] + "commands": ["/workflow:plan-verify", "/workflow:tdd-verify"] }, "execute": { "description": "Task execution and implementation", @@ -152,7 +152,7 @@ "artifacts": ".workflow/active/{session}/", "steps": [ { "command": "/workflow:plan", "optional": false }, - { "command": "/workflow:action-plan-verify", "optional": false, "auto_continue": true }, + { "command": "/workflow:plan-verify", "optional": false, "auto_continue": true }, { "command": "/workflow:execute", "optional": false }, { "command": "/workflow:review", "optional": true } ], @@ -171,7 +171,7 @@ "steps": [ { "command": "/workflow:brainstorm:auto-parallel", "optional": false, "confirm_before": true }, { "command": "/workflow:plan", "optional": false }, - { "command": "/workflow:action-plan-verify", "optional": true, "auto_continue": true }, + { "command": "/workflow:plan-verify", "optional": true, "auto_continue": true }, { "command": "/workflow:execute", "optional": false } ], "cli_hints": { @@ -244,7 +244,7 @@ "artifacts": ".workflow/active/{session}/", "steps": [ { "command": "/workflow:tdd-plan", "optional": false }, - { "command": "/workflow:action-plan-verify", "optional": true, "auto_continue": true }, + { "command": "/workflow:plan-verify", "optional": true, "auto_continue": true }, { "command": "/workflow:execute", "optional": false }, { "command": "/workflow:tdd-verify", "optional": false } ], diff --git a/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt b/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt index 39ba7104..e39cbe0a 100644 --- a/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt +++ b/.claude/workflows/cli-templates/prompts/workflow-impl-plan-template.txt @@ -43,7 +43,7 @@ Core requirements, objectives, technical approach summary (2-3 paragraphs max). **Quality Gates**: - concept-verify: ✅ Passed (0 ambiguities remaining) | ⏭️ Skipped (user decision) | ⏳ Pending -- action-plan-verify: ⏳ Pending (recommended before /workflow:execute) +- plan-verify: ⏳ Pending (recommended before /workflow:execute) **Context Package Summary**: - **Focus Paths**: {list key directories from context-package.json} diff --git a/COMMAND_REFERENCE.md b/COMMAND_REFERENCE.md index 5a5fa979..9dcbf8ed 100644 --- a/COMMAND_REFERENCE.md +++ b/COMMAND_REFERENCE.md @@ -60,7 +60,7 @@ These commands orchestrate complex, multi-phase development processes, from plan | Command | Description | |---|---| -| `/workflow:action-plan-verify`| Perform non-destructive cross-artifact consistency and quality analysis of IMPL_PLAN.md and task.json before execution. | +| `/workflow:plan-verify`| Perform non-destructive cross-artifact consistency and quality analysis of IMPL_PLAN.md and task.json before execution. | ### Code Review Cycle diff --git a/FAQ.md b/FAQ.md index 6b8018f8..de71b7d5 100644 --- a/FAQ.md +++ b/FAQ.md @@ -665,7 +665,7 @@ CCW ensures dependencies are completed before dependent tasks execute. 2. **Run verification**: ```bash - /workflow:action-plan-verify + /workflow:plan-verify ``` 3. **Automated reviews**: diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 0202774c..89852626 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -153,7 +153,7 @@ After planning, validate your implementation plan for consistency and completene ```bash # After /workflow:plan completes, verify task quality -/workflow:action-plan-verify +/workflow:plan-verify # The command will: # 1. Check requirements coverage (all requirements have tasks) diff --git a/GETTING_STARTED_CN.md b/GETTING_STARTED_CN.md index 903f0fc7..e2caf9e4 100644 --- a/GETTING_STARTED_CN.md +++ b/GETTING_STARTED_CN.md @@ -158,7 +158,7 @@ ```bash # /workflow:plan 完成后,验证任务质量 -/workflow:action-plan-verify +/workflow:plan-verify # 该命令将: # 1. 检查需求覆盖率(所有需求都有任务) diff --git a/WORKFLOW_GUIDE.md b/WORKFLOW_GUIDE.md index 06b7f9a4..74fe3830 100644 --- a/WORKFLOW_GUIDE.md +++ b/WORKFLOW_GUIDE.md @@ -310,7 +310,7 @@ Return: Summary + Next Steps ```bash /workflow:plan "task description" # Complete planning -/workflow:action-plan-verify # Verify plan (recommended) +/workflow:plan-verify # Verify plan (recommended) /workflow:execute # Execute /workflow:review # (optional) Review ``` @@ -354,7 +354,7 @@ Phase 6: TDD Structure Validation ```bash /workflow:tdd-plan "feature description" # TDD planning -/workflow:action-plan-verify # Verify (recommended) +/workflow:plan-verify # Verify (recommended) /workflow:execute # Execute (follow Red-Green-Refactor) /workflow:tdd-verify # Verify TDD compliance ``` @@ -454,7 +454,7 @@ Phase 3: Synthesis Integration ```bash /workflow:brainstorm:auto-parallel "topic" [--count N] [--style-skill package] /workflow:plan --session {sessionId} # Plan based on brainstorm results -/workflow:action-plan-verify # Verify +/workflow:plan-verify # Verify /workflow:execute # Execute ``` diff --git a/WORKFLOW_GUIDE_CN.md b/WORKFLOW_GUIDE_CN.md index f5ec8467..8e6071e6 100644 --- a/WORKFLOW_GUIDE_CN.md +++ b/WORKFLOW_GUIDE_CN.md @@ -309,7 +309,7 @@ Return: Summary + Next Steps ```bash /workflow:plan "task description" # 完整规划 -/workflow:action-plan-verify # 验证计划 (推荐) +/workflow:plan-verify # 验证计划 (推荐) /workflow:execute # 执行 /workflow:review # (可选) 审查 ``` @@ -353,7 +353,7 @@ Phase 6: TDD Structure Validation ```bash /workflow:tdd-plan "feature description" # TDD 规划 -/workflow:action-plan-verify # 验证 (推荐) +/workflow:plan-verify # 验证 (推荐) /workflow:execute # 执行 (遵循 Red-Green-Refactor) /workflow:tdd-verify # 验证 TDD 流程合规 ``` @@ -453,7 +453,7 @@ Phase 3: Synthesis Integration ```bash /workflow:brainstorm:auto-parallel "topic" [--count N] [--style-skill package] /workflow:plan --session {sessionId} # 基于头脑风暴结果规划 -/workflow:action-plan-verify # 验证 +/workflow:plan-verify # 验证 /workflow:execute # 执行 ``` diff --git a/ccw/src/templates/dashboard-js/views/help.js b/ccw/src/templates/dashboard-js/views/help.js index cf7fd879..2cd75a66 100644 --- a/ccw/src/templates/dashboard-js/views/help.js +++ b/ccw/src/templates/dashboard-js/views/help.js @@ -726,7 +726,7 @@ function getWorkflowGraphData(workflow) { { data: { id: 'start', label: ht('help.workflows.planFull.start') } }, { data: { id: 'cli-analyze', label: ht('help.workflows.planFull.cliAnalyze') } }, { data: { id: 'plan', label: '/workflow:plan' } }, - { data: { id: 'verify', label: '/workflow:action-plan-verify' } }, + { data: { id: 'verify', label: '/workflow:plan-verify' } }, { data: { id: 'execute', label: '/workflow:execute' } }, { data: { id: 'test', label: '/workflow:test-gen' } }, { data: { id: 'review', label: '/workflow:review' } },