From mad-skills
Context-isolated feature development pipeline. Takes a detailed design/plan as argument and executes the full feature-dev lifecycle (explore, question, architect, implement, review, ship) inside subagents so the primary conversation stays compact. Use when you have a well-defined plan and want autonomous execution with minimal context window consumption.
npx claudepluginhub slamb2k/mad-skills --plugin mad-skillsThis skill is limited to using the following tools:
When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
When this skill is invoked, IMMEDIATELY output the banner below before doing anything else. Pick ONE tagline at random — vary your choice each time. CRITICAL: Reproduce the banner EXACTLY character-for-character. The first line of the art has 4 leading spaces — you MUST preserve them.
{tagline}
⠀ ██╗██████╗ ██╗ ██╗██╗██╗ ██████╗
██╔╝██╔══██╗██║ ██║██║██║ ██╔══██╗
██╔╝ ██████╔╝██║ ██║██║██║ ██║ ██║
██╔╝ ██╔══██╗██║ ██║██║██║ ██║ ██║
██╔╝ ██████╔╝╚██████╔╝██║███████╗██████╔╝
╚═╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝
Taglines:
After the banner, display parsed input:
┌─ Input ────────────────────────────────────────
│ {Field}: {value}
│ Flags: {parsed flags or "none"}
└────────────────────────────────────────────────
Pre-flight results:
── Pre-flight ───────────────────────────────────
✅ {dep} {version or "found"}
⚠️ {dep} not found → {fallback detail}
❌ {dep} missing → stopping
──────────────────────────────────────────────────
Stage/phase headers: ━━ {N} · {Name} ━━━━━━━━━━━━━━━━━━━━━━━━━
Status icons: ✅ done · ❌ failed · ⚠️ degraded · ⏳ working · ⏭️ skipped
Execute a detailed design/plan through the full feature-dev lifecycle with maximum context isolation. Every heavy stage runs in a subagent so the primary conversation only accumulates structured reports.
Stage prompts: references/stage-prompts.md
Report budgets: references/report-contracts.md
Agent selection: references/architecture-notes.md
Project detection: references/project-detection.md
Parse optional flags from the request:
--skip-questions: Skip Stage 2 (clarifying questions)--skip-review: Skip Stage 5 (code review)--no-ship: Stop after Stage 8 docs update--parallel-impl: Split implementation into parallel agents when independentBefore starting, check all dependencies in this table:
| Dependency | Type | Check | Required | Resolution | Detail |
|---|---|---|---|---|---|
| ship | skill | ls .claude/skills/ship/SKILL.md ~/.claude/skills/ship/SKILL.md ~/.claude/plugins/marketplaces/slamb2k/skills/ship/SKILL.md 2>/dev/null | yes | stop | Install with: npx skills add slamb2k/mad-skills --skill ship |
| prime | skill | ls .claude/skills/prime/SKILL.md ~/.claude/skills/prime/SKILL.md ~/.claude/plugins/marketplaces/slamb2k/skills/prime/SKILL.md 2>/dev/null | no | fallback | Context loading; falls back to manual CLAUDE.md/goals scan |
| feature-dev:code-explorer | agent | — | no | fallback | Uses general-purpose agent |
| feature-dev:code-architect | agent | — | no | fallback | Uses general-purpose agent |
| feature-dev:code-reviewer | agent | — | no | fallback | Uses general-purpose agent |
For each row, in order:
Run the Check command (for cli/npm) or test file existence (for agent/skill)
If found: continue silently
If missing: apply Resolution strategy
After all checks: summarize what's available and what's degraded
Capture PLAN (the user's argument) and FLAGS
Clear pending-build marker — if a marker was left by /speccy, clear it:
PLUGIN_ROOT="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/slamb2k}"
node -e "require('$PLUGIN_ROOT/hooks/lib/state.cjs').clearPendingBuild(process.cwd())"
Load project context — invoke /prime to load domain-specific context
(CLAUDE.md, specs, memory). If /prime is unavailable, fall back to
manually scanning CLAUDE.md and specs/ directory.
Detect project type using references/project-detection.md to populate
PROJECT_CONFIG (language, test_runner, test_setup)
Create task list — ALWAYS create tasks upfront for all stages using
TaskCreate. This provides visible progress tracking throughout the build:
--skip-questions)--skip-review)--no-ship)
Mark each task in_progress when starting and completed when done.Check for outstanding items from previous work:
TaskList for incomplete itemsIf outstanding items found, present via AskUserQuestion:
"Found {count} outstanding items from previous work:"
{numbered list with summary of each}
"Address any of these before starting the build?"
Options:
Before Stage 1, resolve the PLAN argument into content:
/ or ends with
.md, .yaml, .json, or .txt, treat it as a file path:
specs/{arg}Plan: {file path} ({line count} lines)Plan: inline ({word count} words)Before starting Stage 1, verify the working tree is suitable for building:
Detect current branch and default branch:
CURRENT=$(git branch --show-current)
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')
DEFAULT_BRANCH="${DEFAULT_BRANCH:-main}"
git fetch origin "$DEFAULT_BRANCH" --quiet 2>/dev/null
If on a feature branch (not main/master/default):
BEHIND=$(git rev-list --count HEAD..origin/"$DEFAULT_BRANCH" 2>/dev/null || echo 0)
If BEHIND > 0, warn the user via AskUserQuestion:
"You're on branch '{CURRENT}' which is {BEHIND} commits behind {DEFAULT_BRANCH}.
Starting a new feature here risks divergent branches and complex rebases."
Options:
/sync, then create a new branchIf on the default branch and not up to date:
LOCAL=$(git rev-parse "$DEFAULT_BRANCH")
REMOTE=$(git rev-parse "origin/$DEFAULT_BRANCH")
If LOCAL != REMOTE, run /sync automatically before proceeding.
Launch feature-dev:code-explorer (fallback: general-purpose):
Task(
subagent_type: "feature-dev:code-explorer",
description: "Explore codebase for build plan",
prompt: <read from references/stage-prompts.md#stage-1>
)
Substitute {PLAN} into the prompt.
Parse EXPLORE_REPORT. Extract questions for Stage 2.
Skip if --skip-questions or no questions found.
Runs on the primary thread (requires user interaction).
questions and potential_issuesLaunch feature-dev:code-architect (fallback: general-purpose):
Task(
subagent_type: "feature-dev:code-architect",
description: "Design implementation architecture",
prompt: <read from references/stage-prompts.md#stage-3>
)
Substitute {PLAN}, {EXPLORE_REPORT}, {CLARIFICATIONS}.
Parse ARCH_REPORT. Present approach_summary to user for confirmation.
If rejected, incorporate feedback and re-run.
If ARCH_REPORT identifies independent parallel_groups, launch multiple
general-purpose subagents in parallel — one per group. Do NOT wait for
--parallel-impl flag; parallel execution is the default when the
architecture supports it. The flag is retained only as an explicit override.
If the architecture has no independent groups, launch one general-purpose subagent:
Task(
subagent_type: "general-purpose",
description: "Implement plan",
prompt: <read from references/stage-prompts.md#stage-4>
)
Substitute {PLAN}, {ARCH_REPORT}, conventions, {PROJECT_CONFIG.test_runner}.
Parse IMPL_REPORT(s). If any failed, assess retry or abort.
Skip if --skip-review.
Launch 3 feature-dev:code-reviewer subagents in parallel (fallback: general-purpose):
Prompts in references/stage-prompts.md#stage-5.
Consolidate reports. Present only critical and high severity findings. Ask: "Fix these now, or proceed as-is?"
Only if Stage 5 found issues AND user wants them fixed.
Launch general-purpose subagent:
Task(
subagent_type: "general-purpose",
description: "Fix review findings",
prompt: <read from references/stage-prompts.md#stage-6>
)
Launch Bash subagent (haiku):
Task(
subagent_type: "Bash",
model: "haiku",
description: "Run verification tests",
prompt: <read from references/stage-prompts.md#stage-7>
)
Substitute {PROJECT_CONFIG.test_runner} and {PROJECT_CONFIG.test_setup}.
If tests fail:
Skip if EXPLORE_REPORT has no source_docs.
Launch general-purpose subagent:
Task(
subagent_type: "general-purpose",
description: "Update progress documentation",
prompt: <read from references/stage-prompts.md#stage-8>
)
If --no-ship: Stop here and present final summary.
Invoke the /ship skill:
/ship {approach_summary from ARCH_REPORT}. Files: {files from IMPL_REPORT}
Always runs on the primary thread (requires user interaction).
Scan all stage reports for unresolved items:
potential_issues not addressed by implementationrisks with deferred mitigationsmedium/low findings not fixed in Stage 6docs_skipped itemsissues_encountered that were worked aroundCompile into DEBRIEF_ITEMS (see references/stage-prompts.md#stage-10).
Categorise each as: unresolved_risk, deferred_fix, open_question,
assumption, or tech_debt.
If no items found, skip to Final Report.
Present numbered summary via AskUserQuestion grouped by category.
Each item shows: [category] summary (effort).
Options:
TaskCreate for each
item as a persistent task, with category as prefix and suggested
action as descriptionAfter resolution, include debrief summary in the Final Report.
┌─ Build · Report ───────────────────────────────
│
│ ✅ Build complete
│
│ 📋 Plan: {first line of plan}
│ 🏗️ Approach: {approach_summary}
│
│ 📝 Changes
│ Files modified: {count}
│ Files created: {count}
│ Tests: {passed}/{total} ✅
│ Docs updated: {count or "none"}
│
│ 🔍 Review
│ Findings addressed: {count fixed} / {count found}
│
│ 📊 Debrief: {count resolved} / {count surfaced}
│ {list of created tasks}
│
│ 🔗 Links
│ PR: {pr_url}
│ CI: {merge_commit}
│
│ ⚡ Next steps
│ {debrief items or "none — all clear"}
│
└─────────────────────────────────────────────────
If any stage failed, report the failure point and what was accomplished.
When /build was invoked as part of a chained pipeline (e.g., from /speccy),
emit a concise Pipeline Summary after the Final Report. This gives an
at-a-glance view of the entire end-to-end process:
┌─ Pipeline Summary ─────────────────────────────
│
│ {icon} Spec {spec file or "inline plan"}
│ {icon} Explore {files identified count}
│ {icon} Questions {answered or "skipped"}
│ {icon} Architect {approach one-liner}
│ {icon} Implement {files changed summary}
│ {icon} Review {findings summary}
│ {icon} Verify {test result}
│ {icon} Ship {PR link} → {merge commit}
│
└─────────────────────────────────────────────────
Use ✅ for completed stages, ⏭️ for skipped, ❌ for failed.
Always emit this summary — even when /build was invoked directly (not
from /speccy). It serves as a compact status line for any multi-stage build,
regardless of how it was triggered.
If implementation succeeds but later stages fail: