Skip to content
story-execution logo

Story Implementation

story-execution

Use when user says "implement plan", "implement story", "run plan for [ID]", "start implementation", or asks to implement a planned story - loads TDD implementation plan from .claude/data/plans/, follows RED-GREEN-COMMIT cycles for each task, updates story status through active->reviewing->implem...

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

Story Implementation

Load plan from story-tree database, review critically, implement TDD tasks, report for review.

Announce: On activation, say: "I'm using the story-execution skill to implement this plan."

Mode Detection

CI Mode activates when:

  • Environment variable CI=true is set, OR
  • Trigger phrase includes "(ci)" like "implement plan (ci)"

Interactive Mode (default): Pause after each batch for human feedback.

CI Mode Constraints

CRITICAL for CI Mode - avoid commands requiring approval:

  1. NEVER read .db files with Read tool - SQLite databases are binary files
  2. NEVER use heredocs (<< 'EOF') - requires shell approval
  3. NEVER use timeout command - requires shell approval
  4. For database operations: Write a .py script file first, then run it with python script.py
  5. For module verification: Use python -c "import module; print('OK')" instead of running modules directly

Pattern - Database Query:

# Step 1: Write the script
Write to .claude/​skills/​story-execution/​temp-query.py

# Step 2: Execute it
python .claude/​skills/​story-execution/​temp-query.py

Pattern - Inline Python (simple one-liners only):

python -c "import sqlite3; print(sqlite3.connect('.claude/​data/​story-tree.db').execute('SELECT id FROM story_nodes LIMIT 1').fetchone())"

Pattern - Module Verification (instead of running module directly):

# WRONG - requires approval:
# timeout 5 python -m syncopaid.tracker

# CORRECT - verifies module loads without running:
export PYTHONPATH=src && python -c "import syncopaid.tracker; print('Module loaded successfully')"

CI Mode Pipeline

The CI pipeline has 5 semantically meaningful stages:

setup-and-plan → review-plan → decompose → implement → finalize
StageModelPurposeOutput
setup-and-planBash/​PythonFind plan, validate depsplan_path, story_id
review-planSonnetReview critically, decide proceed/​pauseci-review-result.json
decomposeOpusAssess complexity, split if neededci-decompose-result.json
implementSonnetFollow plan's TDD steps directlyci-implement-result.json
finalizeBash/​PythonArchive, commit, push, report-

Stage: review-plan

Read the plan and determine if it's ready to implement.

Output: .claude/​skills/​story-execution/​ci-review-result.json

{
  "outcome": "proceed|pause|proceed_with_review",
  "blocking_issues": [],
  "deferrable_issues": [],
  "notes": "Brief summary of review findings"
}

Outcomes:

  • proceed: No issues, implement the plan
  • pause: Blocking issues found, stop and report
  • proceed_with_review: Deferrable issues documented, implement but flag for review

Stage: decompose

Assess plan complexity and split into sub-plans if needed.

Complexity Levels:

  • simple: 1-3 tasks, straightforward changes
  • medium: 4-6 tasks, moderate complexity
  • complex: 7+ tasks OR high integration complexity

Output: .claude/​skills/​story-execution/​ci-decompose-result.json

{
  "complexity": "simple|medium|complex",
  "task_count": 5,
  "implement_plan": ".claude/​data/​plans/​016_configurable-idle-threshold.md",
  "sub_plans_created": [],
  "notes": "Brief explanation"
}

Decomposition Rules:

  1. If complex, split into sub-plans of 3-5 tasks each
  2. Name with letter suffixes: 016A_..., 016B_..., 016C_...
  3. Implement first sub-plan (A) now, save others for future runs
  4. Each sub-plan must be independently implementable

Stage: implement

Read the plan document directly and follow its TDD steps.

Output: .claude/​skills/​story-execution/​ci-implement-result.json

{
  "status": "completed|partial|failed",
  "tasks_completed": 5,
  "tasks_total": 5,
  "commits": ["abc1234", "def5678"],
  "notes": "Brief summary of implementation"
}

TDD Discipline:

  1. Follow the plan's test code EXACTLY
  2. RED: Write failing test, verify it fails
  3. GREEN: Implement code, verify test passes
  4. COMMIT: Stage and commit after each task

Interactive Mode Workflow

Step 1: Select and Load Plan

Scan .claude/​data/​plans/ for earliest sequence-numbered plan file:

python -c "
import os, re, json
plans_dir = '.claude/​data/​plans'
pattern = re.compile(r'^(\d{3})([A-Z])?_(.+)\.md$')
plans = []
for f in os.listdir(plans_dir):
    m = pattern.match(f)
    if m:
        plans.append({'filename': f, 'path': os.path.join(plans_dir, f), 'sequence': int(m.group(1)), 'letter': m.group(2) or ''})
plans.sort(key=lambda x: (x['sequence'], x['letter']))
print(json.dumps(plans[0] if plans else {'selected': None}))
"

If no plans found: Output "No plan files available for implementation" and exit.

Step 2: Review Plan Critically

Load reference: references/​critical-review.md

  • Read the entire plan
  • Identify concerns and classify as blocking or deferrable
  • If concerns: Raise them before starting
  • If no concerns: Create TodoWrite with tasks, proceed to implementation

Step 3: Implement Tasks (3 at a time)

Load reference: references/​tdd-implementation.md

For each task:

  1. Mark as in_progress
  2. Follow TDD cycle: RED -> GREEN -> COMMIT
  3. Mark as completed

Step 4: Report

When batch complete:

  • Show what was implemented
  • Display verification output

Interactive: Say "Ready for feedback." and wait. CI Mode: Continue to next batch immediately.

Step 5: Continue or Adjust

Based on feedback:

  • Apply requested changes
  • Execute next batch
  • Repeat until complete

Step 6: Complete and Verify

Load reference: references/​database-updates.md

  1. Run full test suite
  2. Verify acceptance criteria
  3. Link commits to story
  4. Archive plan file to .claude/​data/​plans/​implemented/
  5. Update story status

Database Integration

Load reference: references/​database-updates.md

Database: .claude/​data/​story-tree.db Critical: Use Python sqlite3 module, NOT sqlite3 CLI.

When to Stop

  • Missing dependencies
  • Failed tests that shouldn't fail
  • RED phase passes (feature already exists)
  • Repeated failures
  • Regression detected

Ask for clarification rather than guessing. Don't force through blockers.

Related Skills

  • story-planning: Creates the plans this skill implements
  • code-verification: Verifies acceptance criteria after implementation
  • story-tree: Manages story hierarchy and status

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View