From mad-skills
Initialize any project directory with a standard scaffold for AI-assisted development. Creates specs/ and context/ directories, a project CLAUDE.md with development workflow and guardrails, .gitignore, and branch protection. Recommends claude-mem for persistent memory. Idempotent — safe to run on existing projects. Triggers: "init project", "setup brace", "brace", "initialize", "bootstrap", "scaffold".
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
Initialize any project directory with a standard scaffold for AI-assisted
development. Idempotent — safe to re-run on existing projects. Content
templates and subagent prompts are in references/.
Key principle: Scan first, present plan, get approval, then act.
Phase prompts: references/phase-prompts.md
Scaffold manifest: references/scaffold-manifest.md
Report format: references/report-template.md
Parse optional flags from the request:
--force — Overwrite existing files without prompting--skip-plugin-tuning — Skip Phase 7 plugin performance tuningBefore starting, check all dependencies in this table:
| Dependency | Type | Check | Required | Resolution | Detail |
|---|---|---|---|---|---|
| claude-mem | plugin | — | no | ask | claude plugin install claude-mem |
| oh-my-claudecode | plugin | — | no | ask | claude plugin install oh-my-claudecode |
For each row, in order:
Plugin detection: For plugin dependencies (Type = plugin), check
~/.claude/settings.json → enabledPlugins for a key containing the plugin
name set to true. Store results as PLUGIN_STATE (claude_mem_installed,
omc_installed) for use in Phase 4 and Phase 7.
Launch Bash subagent (haiku):
Task(
subagent_type: "Bash",
model: "haiku",
description: "Scan directory for existing scaffold structure",
prompt: <read from references/phase-prompts.md#phase-1>
)
Parse SCAN_REPORT. Extract:
directory_name (used as default project name)existing_dirs / missing_dirsexisting_files / missing_fileshas_claude_md / has_gitignorehas_atlas (legacy ATLAS naming detected)has_forge (legacy FORGE naming detected)has_legacy_gotcha (legacy GOTCHA/goals structure detected)has_legacy_memory (old tools/memory system detected)Skip if none of has_atlas, has_forge, has_legacy_gotcha, or has_legacy_memory is true.
Build a description of what was found:
has_atlas or has_forge: "Legacy ATLAS/FORGE naming detected"has_legacy_gotcha: "Legacy GOTCHA/BRACE framework detected (goals/ directory)"has_legacy_memory: "Legacy memory system (tools/memory/, memory/) detected"Ask the user via AskUserQuestion:
Question: "Legacy components detected: {description}. Upgrade and clean up?" Options:
Store result as upgrade_legacy: true|false in USER_CONFIG.
Runs on primary thread (user interaction required).
Derive default project name from SCAN_REPORT directory_name
Present via AskUserQuestion:
Question: "Set up project scaffold?" Options:
If not cancelled, ask for project description (one sentence) via AskUserQuestion with free text.
Ask installation level via AskUserQuestion:
Question: "Install universal guidance (preferences, principles) at user level?" Options:
~/.claude/CLAUDE.mdStore as USER_CONFIG:
If cancelled, stop here.
Build the ACTION_PLAN from SCAN_REPORT + USER_CONFIG + FLAGS.
For each item in references/scaffold-manifest.md:
--force → status: "skip"--force → status: "overwrite"If upgrade_legacy is true in USER_CONFIG, set status "upgrade" for:
If upgrade_legacy is true AND has_legacy_gotcha is true, additionally:
goals/ → status: "remove" (only if contains only manifest.md and build_app.md)If upgrade_legacy is true AND has_legacy_memory is true, additionally:
tools/memory/ → status: "remove"memory/ → status: "remove"tools/manifest.md → status: "cleanup" (remove memory tool rows).gitignore → status: "cleanup" (remove memory/*.npy entry)Present plan summary to user via AskUserQuestion:
Project Scaffold for: {project_name}
Will create: {list of items with status "create"}
Will merge: {list of items with status "merge"}
Will upgrade: {list of items with status "upgrade"}
Will remove: {list of items with status "remove" — legacy cleanup}
Will clean: {list of items with status "cleanup" — remove legacy references}
Will skip: {count} existing items
Universal guidance: {install_level description}
Proceed?
Options: "Yes, proceed" / "Cancel"
If cancelled, stop here.
Launch general-purpose subagent:
Task(
subagent_type: "general-purpose",
description: "Create project scaffold structure",
prompt: <read from references/phase-prompts.md#phase-4>
)
Before sending the prompt, substitute these variables:
{ACTION_PLAN} — the action plan from Phase 3{PROJECT_NAME} — from USER_CONFIG{PROJECT_DESCRIPTION} — from USER_CONFIG{INSTALL_LEVEL} — from USER_CONFIG ("global" or "project"){CLAUDE_MD_TEMPLATE} — read from references/claude-md-template.md
(the section between BEGIN TEMPLATE and END TEMPLATE){GITIGNORE_CONTENT} — read from assets/gitignore-template{GLOBAL_PREFERENCES_CONTENT} — read from assets/global-preferences-template.md
(the section between BEGIN TEMPLATE and END TEMPLATE){PLUGIN_ROLE_SEPARATION} — if both claude-mem AND oh-my-claudecode are
detected as enabled (from Phase 7 PLUGIN_REPORT, or by checking
~/.claude/settings.json), substitute with the content from
references/plugin-tuning-steps.md#plugin-role-separation-content.
Otherwise, substitute with an empty string.Parse SCAFFOLD_REPORT. If status is "failed", report to user and stop.
When updating an existing project CLAUDE.md (not creating from template):
## Branch Discipline already exists:
grep -q "## Branch Discipline" CLAUDE.md
## Guardrails:
## Guardrails## Guardrails section exists, append the section at the end of the fileLaunch Bash subagent (haiku):
Task(
subagent_type: "Bash",
model: "haiku",
description: "Verify project scaffold",
prompt: <read from references/phase-prompts.md#phase-5>
)
Parse VERIFY_REPORT. Present the final summary using the format in
references/report-template.md.
Only if the project is a git repo (from SCAN_REPORT git_initialized).
Detect the default branch and hosting platform (GitHub, Azure DevOps, or
unknown). Platform detection and all CLI/REST commands are in
references/branch-protection-steps.md.
git remote get-url origingh api. If unprotected, ask via
AskUserQuestion:
/ship squash-merges without --adminaz repos CLI or REST fallback. If no minimum reviewer
policy, ask via AskUserQuestion:
creator-vote-counts=true so the author's own vote satisfies the gateApply the variant matching the user's choice using the procedures in
references/branch-protection-steps.md (see "Apply protection — team
project" vs "Apply protection — solo project" for each platform).
Include result in the final report under a "🔒 Branch protection" section, labelled with the chosen variant (team / solo / skipped).
Skip this phase if --skip-plugin-tuning flag is set.
Detect companion Claude Code plugins and recommend performance optimisations.
This phase modifies user-level settings files (~/.claude/settings.json,
~/.claude-mem/settings.json) — not repo-level files.
If --force is set, apply all recommendations without prompting.
Plugin presence guards: Only audit plugins detected as installed during
pre-flight (PLUGIN_STATE). Skip M1/M2/M3 if claude-mem is absent. Skip M2
if OMC is absent (M2 requires both). The {PLUGIN_ROLE_SEPARATION} content
in CLAUDE.md is only injected when both claude-mem and OMC are confirmed
enabled.
If no companion plugins are installed at all, output:
━━ 7 · Plugin Performance ━━━━━━━━━━━━━━━━━━━━
⏭️ No companion plugins installed — skipping
and skip to the report.
Launch Bash subagent (haiku):
Task(
subagent_type: "Bash",
model: "haiku",
description: "Detect installed plugins and audit performance",
prompt: <read from references/phase-prompts.md#phase-7>
)
Parse PLUGIN_REPORT.
If PLUGIN_REPORT contains zero findings, output:
━━ 7 · Plugin Performance ━━━━━━━━━━━━━━━━━━━━
⏭️ No plugin optimisations needed
Skip to the report.
Otherwise, present findings with AskUserQuestion:
Options:
If "Let me choose", present individual findings as multi-select.
| Code | Check | Condition | Severity |
|---|---|---|---|
| M1 | claude-mem: read-only tools | SKIP_TOOLS missing Read/Glob/Grep/ToolSearch/Agent/WebSearch/WebFetch | medium |
| M2 | claude-mem: high context | observations > 10 or sessions > 3, AND OMC also enabled | medium |
| M3 | claude-mem: provider=claude | provider is "claude" (SDK spawn known-broken) | low |
For each approved finding, follow the procedures in
references/plugin-tuning-steps.md. Each script is idempotent — re-reads
the target file before writing and checks current value before modifying.
If both claude-mem AND oh-my-claudecode are detected as enabled, also inject
the Plugin Role Separation section into the project CLAUDE.md (see
references/plugin-tuning-steps.md#plugin-role-separation-content).
Skip if section already exists (idempotent).
--force)--force or explicit user approvalStandard escalation pattern:
Common issues: