Skip to main content

workflow-tdd-plan-plan

Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on "workflow-tdd-plan", "workflow-tdd-verify".

Quellinformationen

Repository
catlog22/Claude-Code-Workflow
Letzte Quellaktivitรคt
1. April 2026 um 13:34
Erkannte Sprache von SKILL.md
Englisch
Sterne
2.128
Forks
166

Installationsoptionen

StandardmรครŸig ist der Prompt ausgewรคhlt, der zuerst die Quelle prรผft. Sie kรถnnen zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.

Quelldateien prรผfen

Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich fรผr eine Installation entscheiden.

Datei-Explorer
8 Dateien

SKILL.md wird angezeigt

SKILL.md
Quellanweisungen ยท Schreibgeschรผtzte Vorschau
name
workflow-tdd-plan-plan
description
Unified TDD workflow skill combining 6-phase TDD planning with Red-Green-Refactor task chain generation, and 4-phase TDD verification with compliance reporting. Triggers on "workflow-tdd-plan", "workflow-tdd-verify".
allowed-tools
Skill, Agent, AskUserQuestion, TaskCreate, TaskUpdate, TaskList, Read, Write, Edit, Bash, Glob, Grep
<purpose> Unified TDD workflow skill combining TDD planning (Red-Green-Refactor task chain generation with test-first development structure) and TDD verification (compliance validation with quality gate reporting). Produces IMPL_PLAN.md, task JSONs with internal TDD cycles, and TDD_COMPLIANCE_REPORT.md. Triggers on "workflow-tdd-plan" (plan mode) or "workflow-tdd-verify" (verify mode). </purpose> <process> ## 1. Architecture Overview ``` โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Workflow TDD Orchestrator (SKILL.md) โ”‚ โ”‚ โ†’ Route by mode: plan | verify โ”‚ โ”‚ โ†’ Pure coordinator: Execute phases, parse outputs, pass context โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ†“ โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Plan Mode โ”‚ โ”‚ Verify โ”‚ โ”‚ (default) โ”‚ โ”‚ Mode โ”‚ โ”‚ Phase 1-6 โ”‚ โ”‚ Phase 7 โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ” โ†“ โ†“ โ†“ โ†“ โ†“ โ†“ โ”Œโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ” โ”‚ 1 โ”‚ โ”‚ 2 โ”‚ โ”‚ 3 โ”‚ โ”‚ 4 โ”‚ โ”‚ 5 โ”‚ โ”‚ 6 โ”‚ โ”‚Sesโ”‚ โ”‚Ctxโ”‚ โ”‚Tstโ”‚ โ”‚Conโ”‚ โ”‚Genโ”‚ โ”‚Valโ”‚ โ””โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”˜ โ””โ”€โ”ฌโ”€โ”˜ โ””โ”€โ”€โ”€โ”˜ โ†“ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Confirm โ”‚โ”€โ”€โ”€ Verify โ”€โ”€โ†’ Phase 7 โ”‚ (choice) โ”‚โ”€โ”€โ”€ Execute โ”€โ†’ Skill("workflow-execute") โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”€โ”€โ”€ Review โ”€โ”€โ†’ Display session status inline ``` ## 2. Key Design Principles 1. **Pure Orchestrator**: SKILL.md routes and coordinates only; execution detail lives in phase files 2. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute 3. **Multi-Mode Routing**: Single skill handles plan/verify via mode detection 4. **Task Attachment Model**: Sub-command tasks are ATTACHED, executed sequentially, then COLLAPSED 5. **Auto-Continue**: After each phase completes, automatically execute next pending phase 6. **TDD Iron Law**: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST - enforced in task structure ## 3. Interactive Preference Collection Before dispatching to phase execution, collect workflow preferences via AskUserQuestion: ```javascript // โ˜… ็ปŸไธ€ auto mode ๆฃ€ๆต‹๏ผš-y/--yes ไปŽ $ARGUMENTS ๆˆ– ccw ไผ ๆ’ญ const autoYes = /\b(-y|--yes)\b/.test($ARGUMENTS) if (autoYes) { // ่‡ชๅŠจๆจกๅผ๏ผš่ทณ่ฟ‡ๆ‰€ๆœ‰่ฏข้—ฎ๏ผŒไฝฟ็”จ้ป˜่ฎคๅ€ผ workflowPreferences = { autoYes: true } } else { const prefResponse = AskUserQuestion({ questions: [ { question: "ๆ˜ฏๅฆ่ทณ่ฟ‡ๆ‰€ๆœ‰็กฎ่ฎคๆญฅ้ชค๏ผˆ่‡ชๅŠจๆจกๅผ๏ผ‰๏ผŸ", header: "Auto Mode", multiSelect: false, options: [ { label: "Interactive (Recommended)", description: "ไบคไบ’ๆจกๅผ๏ผŒๅŒ…ๅซ็กฎ่ฎคๆญฅ้ชค" }, { label: "Auto", description: "่ทณ่ฟ‡ๆ‰€ๆœ‰็กฎ่ฎค๏ผŒ่‡ชๅŠจๆ‰ง่กŒ" } ] } ] }) workflowPreferences = { autoYes: prefResponse.autoMode === 'Auto' } } ``` **workflowPreferences** is passed to phase execution as context variable, referenced as `workflowPreferences.autoYes` within phases. ## 4. Mode Detection ```javascript const args = $ARGUMENTS const mode = detectMode(args) function detectMode(args) { // Skill trigger determines mode if (skillName === 'workflow-tdd-verify') return 'verify' return 'plan' // default: workflow-tdd-plan } ``` ## 5. Compact Recovery (Phase Persistence) Multi-phase TDD planning (Phase 1-6/7) spans long conversations. Uses **ๅŒ้‡ไฟ้™ฉ**: TodoWrite ่ทŸ่ธช active phase ไฟๆŠคๅ…ถไธ่ขซๅŽ‹็ผฉ๏ผŒsentinel ไฝœไธบๅ…œๅบ•ใ€‚ > **โš ๏ธ COMPACT DIRECTIVE**: Context compression MUST check TodoWrite phase status. > The phase currently marked `in_progress` is the active execution phase โ€” preserve its FULL content. > Only compress phases marked `completed` or `pending`. ## 6. Execution Flow โ€” Plan Mode (default) ``` Input Parsing: โ””โ”€ Convert user input to TDD structured format (GOAL/SCOPE/CONTEXT/TEST_FOCUS) Phase 1: Session Discovery โ””โ”€ Read("phases/01-session-discovery.md") โ””โ”€ Output: sessionId (WFS-xxx) Phase 2: Context Gathering โ””โ”€ Read("phases/02-context-gathering.md") โ”œโ”€ Tasks attached: Analyze structure โ†’ Identify integration โ†’ Generate package โ””โ”€ Output: contextPath + conflictRisk Phase 3: Test Coverage Analysis โ””โ”€ Read("phases/03-test-coverage-analysis.md") โ”œโ”€ Tasks attached: Detect framework โ†’ Analyze coverage โ†’ Identify gaps โ””โ”€ Output: testContextPath Phase 4: Conflict Resolution (conditional: conflictRisk โ‰ฅ medium) โ””โ”€ Decision (conflictRisk check): โ”œโ”€ conflictRisk โ‰ฅ medium โ†’ Read("phases/04-conflict-resolution.md") โ”‚ โ”œโ”€ Tasks attached: Detect conflicts โ†’ Log analysis โ†’ Apply strategies โ”‚ โ””โ”€ Output: conflict-resolution.json โ””โ”€ conflictRisk < medium โ†’ Skip to Phase 5 Phase 5: TDD Task Generation โ””โ”€ Read("phases/05-tdd-task-generation.md") โ”œโ”€ Tasks attached: Discovery โ†’ Planning โ†’ Output โ””โ”€ Output: IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md Phase 6: TDD Structure Validation โ””โ”€ Read("phases/06-tdd-structure-validation.md") โ””โ”€ Output: Validation report + Plan Confirmation Gate Plan Confirmation (User Decision Gate): โ””โ”€ Decision (user choice): โ”œโ”€ "Verify TDD Compliance" (Recommended) โ†’ Route to Phase 7 (tdd-verify) โ”œโ”€ "Start Execution" โ†’ Skill(skill="workflow-execute") โ””โ”€ "Review Status Only" โ†’ Display session status inline ``` ## 7. Execution Flow โ€” Verify Mode ``` Phase 7: TDD Verification โ””โ”€ Read("phases/07-tdd-verify.md") โ””โ”€ Output: TDD_COMPLIANCE_REPORT.md with quality gate recommendation ``` ## 8. Phase Reference Documents Read on-demand when phase executes using `Read("phases/...")`: | Phase | Document | Purpose | Mode | Compact | |-------|----------|---------|------|---------| | 1 | phases/01-session-discovery.md | Create or discover TDD workflow session | plan | TodoWrite ้ฉฑๅŠจ | | 2 | phases/02-context-gathering.md | Gather project context and analyze codebase | plan | TodoWrite ้ฉฑๅŠจ | | 3 | phases/03-test-coverage-analysis.md | Analyze test coverage and framework detection | plan | TodoWrite ้ฉฑๅŠจ | | 4 | phases/04-conflict-resolution.md | Detect and resolve conflicts (conditional) | plan | TodoWrite ้ฉฑๅŠจ | | 5 | phases/05-tdd-task-generation.md | Generate TDD tasks with Red-Green-Refactor cycles | plan | TodoWrite ้ฉฑๅŠจ + sentinel | | 6 | phases/06-tdd-structure-validation.md | Validate TDD structure and present confirmation gate | plan | TodoWrite ้ฉฑๅŠจ + sentinel | | 7 | phases/07-tdd-verify.md | Full TDD compliance verification with quality gate | verify | TodoWrite ้ฉฑๅŠจ | **Compact Rules**: 1. **TodoWrite `in_progress`** โ†’ ไฟ็•™ๅฎŒๆ•ดๅ†…ๅฎน๏ผŒ็ฆๆญขๅŽ‹็ผฉ 2. **TodoWrite `completed`** โ†’ ๅฏๅŽ‹็ผฉไธบๆ‘˜่ฆ 3. **sentinel fallback** โ†’ Phase 5/6 ๅŒ…ๅซ compact sentinel๏ผ›่‹ฅ compact ๅŽไป…ๅญ˜ sentinel ่€Œๆ— ๅฎŒๆ•ด Step ๅ่ฎฎ๏ผŒๅฟ…้กป็ซ‹ๅณ `Read()` ๆขๅคๅฏนๅบ” phase ๆ–‡ไปถ ## 9. Core Rules 1. **Start Immediately**: First action is mode detection + TaskCreate initialization, second action is phase execution 2. **No Preliminary Analysis**: Do not read files, analyze structure, or gather context before Phase 1 3. **Parse Every Output**: Extract required data from each phase output for next phase 4. **Auto-Continue via TaskList**: Check TaskList status to execute next pending phase automatically 5. **Track Progress**: Update TaskCreate/TaskUpdate dynamically with task attachment/collapse pattern 6. **Task Attachment Model**: Skill execute **attaches** sub-tasks to current workflow. Orchestrator **executes** these attached tasks itself, then **collapses** them after completion 7. **Progressive Phase Loading**: Read phase docs ONLY when that phase is about to execute 8. **DO NOT STOP**: Continuous multi-phase workflow. After executing all attached tasks, immediately collapse them and execute next phase 9. **TDD Context**: All descriptions include "TDD:" prefix ## 10. TDD Compliance Requirements ### The Iron Law ``` NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST ``` **Enforcement Method**: - Phase 5: `implementation` includes test-first steps (Red โ†’ Green โ†’ Refactor) - Green phase: Includes test-fix-cycle configuration (max 3 iterations) - Auto-revert: Triggered when max iterations reached without passing tests **Verification**: Phase 6 validates Red-Green-Refactor structure in all generated tasks ### TDD Compliance Checkpoint | Checkpoint | Validation Phase | Evidence Required | |------------|------------------|-------------------| | Test-first structure | Phase 5 | `implementation` has 3 steps | | Red phase exists | Phase 6 | Step 1: `tdd_phase: "red"` | | Green phase with test-fix | Phase 6 | Step 2: `tdd_phase: "green"` + test-fix-cycle | | Refactor phase exists | Phase 6 | Step 3: `tdd_phase: "refactor"` | ### Core TDD Principles **Red Flags - STOP and Reassess**: - Code written before test - Test passes immediately (no Red phase witnessed) - Cannot explain why test should fail - "Just this once" rationalization - "Tests after achieve same goals" thinking **Why Order Matters**: - Tests written after code pass immediately โ†’ proves nothing - Test-first forces edge case discovery before implementation - Tests-after verify what was built, not what's required ## 11. Input Processing **Convert User Input to TDD Structured Format**: 1. **Simple text** โ†’ Add TDD context: ``` User: "Build authentication system" Structured: TDD: Authentication System GOAL: Build authentication system SCOPE: Core authentication features CONTEXT: New implementation TEST_FOCUS: Authentication scenarios ``` 2. **Detailed text** โ†’ Extract components with TEST_FOCUS: ``` User: "Add JWT authentication with email/password login and token refresh" Structured: TDD: JWT Authentication GOAL: Implement JWT-based authentication SCOPE: Email/password login, token generation, token refresh endpoints CONTEXT: JWT token-based security, refresh token rotation TEST_FOCUS: Login flow, token validation, refresh rotation, error cases ``` 3. **File/Issue** โ†’ Read and structure with TDD ## 12. Data Flow โ€” Plan Mode ``` User Input (task description) โ†“ [Convert to TDD Structured Format] โ†“ Structured Description: โ†“ TDD: [Feature Name] โ†“ GOAL: [objective] โ†“ SCOPE: [boundaries] โ†“ CONTEXT: [background] โ†“ TEST_FOCUS: [test scenarios] โ†“ Phase 1: session:start --auto "TDD: structured-description" โ†“ Output: sessionId โ†“ Phase 2: context-gather --session sessionId "structured-description" โ†“ Input: sessionId + structured description โ†“ Output: contextPath (context-package.json) + conflictRisk โ†“ Phase 3: test-context-gather --session sessionId โ†“ Input: sessionId โ†“ Output: testContextPath (test-context-package.json) โ†“ Phase 4: conflict-resolution [conditional: conflictRisk โ‰ฅ medium] โ†“ Input: sessionId + contextPath + conflictRisk โ†“ Output: conflict-resolution.json โ†“ Skip if conflictRisk is none/low โ†’ proceed directly to Phase 5 โ†“ Phase 5: task-generate-tdd --session sessionId โ†“ Input: sessionId + all accumulated context โ†“ Output: IMPL_PLAN.md, IMPL-*.json, TODO_LIST.md โ†“ Phase 6: TDD Structure Validation (internal) โ†“ Validate Red-Green-Refactor structure โ†“ Present Plan Confirmation Gate โ†“ Plan Confirmation (User Decision Gate): โ”œโ”€ "Verify TDD Compliance" (Recommended) โ†’ Route to Phase 7 โ”œโ”€ "Start Execution" โ†’ Skill(skill="workflow-execute") โ””โ”€ "Review Status Only" โ†’ Display session status inline ``` ## 13. Data Flow โ€” Verify Mode ``` Input: --session sessionId (or auto-detect) โ†“ Phase 7: Session discovery โ†’ Chain validation โ†’ Coverage analysis โ†’ Report โ†“ Output: TDD_COMPLIANCE_REPORT.md with quality gate ``` **Session Memory Flow**: Each phase receives session ID, which provides access to: - Previous task summaries - Existing context and analysis - Session-specific configuration ## 14. TodoWrite Pattern **Core Concept**: Dynamic task attachment and collapse for real-time visibility into TDD workflow execution. > **Implementation Note**: Phase files use `TodoWrite` syntax to describe the conceptual tracking pattern. At runtime, these are implemented via `TaskCreate/TaskUpdate/TaskList` tools. Map as follows: > - Initial list creation โ†’ `TaskCreate` for each item > - Status changes โ†’ `TaskUpdate({ taskId, status })` > - Sub-task attachment โ†’ `TaskCreate` + `TaskUpdate({ addBlockedBy })` > - Sub-task collapse โ†’ `TaskUpdate({ status: "completed" })` + `TaskUpdate({ status: "deleted" })` for collapsed sub-items ### Key Principles 1. **Task Attachment** (when phase executed): - Sub-tasks are **attached** to orchestrator's TodoWrite - **Phase 3, 4, 5**: Multiple sub-tasks attached - **Phase 1, 2, 6**: Single task (atomic) - First attached task marked as `in_progress`, others as `pending` - Orchestrator **executes** these attached tasks sequentially 2. **Task Collapse** (after sub-tasks complete): - **Applies to Phase 3, 4, 5**: Remove detailed sub-tasks from TodoWrite - **Collapse** to high-level phase summary - **Phase 1, 2, 6**: No collapse needed (single task, just mark completed) - Maintains clean orchestrator-level view 3. **Continuous Execution**: After completion, automatically proceed to next pending phase **Lifecycle**: Initial pending โ†’ Phase executed (tasks ATTACHED) โ†’ Sub-tasks executed sequentially โ†’ Phase completed (tasks COLLAPSED for 3/4/5, marked completed for 1/2/6) โ†’ Next phase โ†’ Repeat ### Initial State (Plan Mode): ```json [ {"content": "Phase 1: Session Discovery", "status": "in_progress", "activeForm": "Executing session discovery"}, {"content": "Phase 2: Context Gathering", "status": "pending", "activeForm": "Executing context gathering"}, {"content": "Phase 3: Test Coverage Analysis", "status": "pending", "activeForm": "Executing test coverage analysis"}, {"content": "Phase 5: TDD Task Generation", "status": "pending", "activeForm": "Executing TDD task generation"}, {"content": "Phase 6: TDD Structure Validation", "status": "pending", "activeForm": "Validating TDD structure"} ] ``` **Note**: Phase 4 (Conflict Resolution) is added dynamically after Phase 2 if conflictRisk โ‰ฅ medium. ### Phase 3 (Tasks Attached): ```json [ {"content": "Phase 1: Session Discovery", "status": "completed"}, {"content": "Phase 2: Context Gathering", "status": "completed"}, {"content": "Phase 3: Test Coverage Analysis", "status": "in_progress"}, {"content": " โ†’ Detect test framework and conventions", "status": "in_progress"}, {"content": " โ†’ Analyze existing test coverage", "status": "pending"}, {"content": " โ†’ Identify coverage gaps", "status": "pending"}, {"content": "Phase 5: TDD Task Generation", "status": "pending"}, {"content": "Phase 6: TDD Structure Validation", "status": "pending"} ] ``` ### Phase 3 (Collapsed): ```json [ {"content": "Phase 1: Session Discovery", "status": "completed"}, {"content": "Phase 2: Context Gathering", "status": "completed"}, {"content": "Phase 3: Test Coverage Analysis", "status": "completed"}, {"content": "Phase 5: TDD Task Generation", "status": "pending"}, {"content": "Phase 6: TDD Structure Validation", "status": "pending"} ]
Auf GitHub ansehen
Diese SKILL.md ist sehr gross, daher zeigt SkillsMP hier nur den ersten Abschnitt. Auf GitHub ansehen