Skip to content

tstrachota/test-driven-code-generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Claude Code commands for managing AI-driven development workflows

They provide a structured approach to planning and executing development tasks using an ai_plan.md file as the central planning document.

Overview

The commands follow a TDD (Test-Driven Development) workflow where coding tasks are broken down into three steps:

  1. Spec skeleton - Create empty test structure
  2. Spec implementation - Fill in the actual tests (which should fail)
  3. Code implementation - Write code to make tests pass

Workflow

┌─────────────────────────────────────────────────────────────────────────┐
│                           PLANNING PHASE                                │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│                         /t:init-ai-plan                                 │
│              [problem description or linear_ticket_url]                 │
│                               │                                         │
│                               ▼                                         │
│                       ai_plan.md created                                │
│                       (with description)                                │
│                               │                                         │
│                               ▼                                         │
│                      /t:explore-solution                                │
│                 (interactive solution design)                           │
│                               │                                         │
│                               ▼                                         │
│                Implementation details documented                        │
│                               │                                         │
│                               ▼                                         │
│                        /t:plan-tasks                                    │
│                      (creates TODO list)                                │
│                               │                                         │
│                               ▼                                         │
│              ┌────────────────────────────────┐                         │
│              │  Need to modify the plan?      │◄────────────────┐       │
│              └────────────────────────────────┘                 │       │
│                               │                                 │       │
│                           yes │                                 │       │
│                               ▼                                 │       │
│                     /t:extend-ai-plan                           │       │
│                     [change description]  ──────────────────────┘       │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘
                                 │
                                 │ no
                                 ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                          EXECUTION PHASE                                │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│          /t:next-step                    /t:brave-execution             │
│          (one task at a time)            (all tasks at once)            │
│                  │                               │                      │
│                  │                               │                      │
│                  ▼                               ▼                      │
│         ┌───────────────┐               ┌───────────────┐               │
│         │ Execute task  │               │ Execute ALL   │               │
│         │ Commit code   │               │ remaining     │               │
│         │ Commit plan   │               │ tasks in loop │               │
│         └───────┬───────┘               └───────────────┘               │
│                 │                                                       │
│                 ▼                                                       │
│         More tasks? ──yes──► Run /t:next-step again                     │
│                 │                                                       │
│                no                                                       │
│                 │                                                       │
│                 ▼                                                       │
│              DONE                                                       │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

Commands

/t:init-ai-plan [problem description or linear_ticket_url]

Initializes a new ai_plan.md file with either a problem description or a Linear ticket URL. If a Linear ticket URL is provided, fetches the ticket details and includes a link to the ticket. Creates the basic structure with Title, Description, TODO, and Implementation details sections (leaves TODO empty). Commits with message "AI plan: init".

/t:explore-solution

Interactive command that designs the solution for the problem described in ai_plan.md. Explores the codebase, asks clarifying questions, and compares different approaches. For refactoring tasks, identifies all files and line numbers that need changes. Updates the Implementation details section with design decisions, file locations, and reasoning. Iterates with the user until the design is confirmed. Commits with message "AI plan: solution designed".

/t:plan-tasks

Reads the description and implementation details from an existing ai_plan.md and creates a detailed TODO list. For coding tasks, breaks them into the three TDD sub-tasks. Commits with message "AI plan: tasks planned".

/t:extend-ai-plan [description of changes]

Extends an existing plan with new tasks based on changed requirements. Preserves completed tasks and adds new TODO items. Updates the Implementation details section as needed. Commits with message "AI plan: updated".

/t:next-step

Executes the first unfinished sub-task from the TODO list. For grouped implementation tasks (spec skeleton → spec implementation → code implementation), executes all three steps with separate commits for code and plan updates.

/t:brave-execution

Executes ALL remaining tasks in one continuous session. Follows the same rules as /t:next-step but loops until all tasks are complete. Use with caution for larger plans.

ai_plan.md Structure

# Title

## Description
[Problem/feature description]

## TODO
- Task 1
  - spec skeleton
  - spec implementation
  - code implementation
- Task 2
+ Completed task (marked with +)

## Implementation details
[Research findings and notes]

Commit Conventions

  • Plan initialization: "AI plan: init"
  • Plan design: "AI plan: solution designed"
  • Plan task breakdown: "AI plan: tasks planned"
  • Plan updates: "AI plan: updated"
  • Task completion: "AI plan: completed ''"
  • Code commits: " - spec skeleton/filled specs/implementation"
  • Final commit: "AI plan: all tasks completed"

About

Claude code commands for managing AI assisted TDD

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published