src/skills/x-internal-decompose-task/SKILL.md
Decomposes an implementation plan into TDD tasks (Red/Green/Refactor) from test scenarios.
npx skillsauth add edercnj/claude-environment x-internal-decompose-taskInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Decomposes an implementation plan into granular tasks. When a test plan exists (from x-plan-tests), derives tasks from test scenarios using TDD structure (RED/GREEN/REFACTOR) with a per-task Parallel flag. Falls back to the Layer Task Catalog (G1-G7) when no test plan is available, where tasks are additionally assigned to parallelism groups. Each task is assigned a model tier (Junior/Mid/Senior) and context budget.
| Caller Skill | Phase | Context |
|-------------|-------|---------|
| x-implement-story | Phase 1C | After the Architect produces the plan, BEFORE implementation |
| (standalone) | N/A | When breaking down a plan into implementable tasks |
| Input | Path | Required |
|-------|------|----------|
| Architect's plan | .aikittools/features/feature-XXXX/plans/plan-story-XXXX-YYYY.md | Yes |
| Story requirements | Story file | Yes |
| Test plan (from x-plan-tests) | .aikittools/features/feature-XXXX/plans/tests-story-XXXX-YYYY.md | No |
| Artifact | Path |
|----------|------|
| Task breakdown | .aikittools/features/feature-XXXX/plans/tasks-story-XXXX-YYYY.md |
| Structure (template available) | Header / Summary / Dependency Graph / Tasks Table / Escalation Notes |
| Structure (template fallback — RULE-012) | TDD inline format (Step 2A) or Layer Catalog inline format (Step 2B) |
Idempotent on staleness: when mtime(tasks) >= mtime(story), returns the existing breakdown without regeneration (RULE-002).
0. IDEMPOTENCY -> mtime(story) vs mtime(tasks); skip generation if fresh
0.5. ARCH_CONTEXT -> Read src/patterns/backend/software-architecture/hexagonal/patterns.md (layer structure, folder structure, and dependency direction)
1. READ_STORY -> Read Architect plan + story + _TEMPLATE-TASK-BREAKDOWN.md (RULE-007)
1.5. MODE_DETECT -> Test plan with TPP markers? → 2A (TDD); else → 2B (Layer)
2A. TDD_TASKS -> One task per UT/IT/AT scenario; RED/GREEN/REFACTOR + tier + budget + parallel + depends-on
2B. LAYER_TASKS -> Layer Task Catalog G1-G7; one task per active layer
3B. CATALOG_APPLY -> (layer mode) fixed Junior/Mid/Senior tier per layer
4B. TIER_TUNE -> (layer mode) escalate complex domain logic Mid→Senior
5. WRITE_OUTPUT -> .aikittools/features/feature-XXXX/plans/tasks-story-XXXX-YYYY.md
Each step's detailed bash, TDD field tables, parallelism detection rules, layer-task catalog (21 task types × tier × budget × group), G1-G7 dependency graph, context budget sizing, review tier assignment, and escalation rules live in references/full-protocol.md:
src/patterns/backend/software-architecture/hexagonal/patterns.md for layer structure, folder structure, and dependency direction)._TEMPLATE-TASK-BREAKDOWN.md absent).| Scenario | Action |
|----------|--------|
| Architect's plan not found | Abort: "Plan file not found at expected path. Run planning phase first." |
| Story requirements file not found | Abort: "Story file not found. Verify story ID and feature directory." |
| Template _TEMPLATE-TASK-BREAKDOWN.md missing | Log warning, use inline format as fallback (RULE-012) |
| Test plan has no structured TPP markers | Fall back to layer-based decomposition (G1-G7) with warning |
| Escalation threshold exceeded (>15% tasks escalate) | Flag in output report for manual review |
| Skill | Relationship | Context |
|-------|-------------|---------|
| x-implement-story | called-by | Invoked during Phase 1C |
| x-plan-tests | reads | Consumes test plan (Phase 1B output) when available |
| x-implement-story Phase 2 | produces-for | Output consumed by group-based or TDD-based implementation |
.aikittools/features/feature-XXXX/plans/tasks-story-XXXX-YYYY.md existence and staleness before regenerating. Second invocation with unchanged story reuses existing breakdown.src/templates/_TEMPLATE-TASK-BREAKDOWN.md for standardized output format.| Pack | File | Purpose |
|------|------|---------|
| architecture | src/patterns/backend/software-architecture/hexagonal/patterns.md | Layer structure, dependency direction, package organization, and style folder structure |
Minimum viable contract above. Detailed Steps 0–5 with bash, TDD task field tables, parallelism detection, ordering rules, full Layer Task Catalog (21 task types × tier × budget × G1-G7), Layer Dependency Graph, Context Budget Sizes, Review Tier Assignment, and Escalation Rules live in references/full-protocol.md per ADR-0012 (skill body slim-by-default).
development
Documentation freshness gate: validates 6 dimensions (readme, api, adr, etc.) per PR.
testing
Conditional dep-policy gate: CVEs, licenses, versions, freshness; SARIF + report.
documentation
Incrementally updates the service or system architecture document; never regenerative.
development
Scans code and git history for leaked credentials, API keys, and tokens; SARIF output.