/mad-skills:rig --skip-system-check (optional)from mad-skills
Idempotently bootstraps repositories with standard dev tooling: git hooks (lefthook) with secret scanning, commit/PR templates, and GitHub Actions CI. Prompts before changes.
Ships in mad-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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, including the diagonal / glyph before the name.
{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
Idempotently bootstrap repositories with standard development infrastructure.
Prompts and report schemas are in references/. Configuration procedures are
in references/configuration-steps.md.
Key principle: Prompt user before making changes. Report findings first, get approval, then act.
Detect the hosting platform before pre-flight so dependency checks are platform-specific:
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if echo "$REMOTE_URL" | grep -qiE 'dev\.azure\.com|visualstudio\.com'; then
PLATFORM="azdo"
elif echo "$REMOTE_URL" | grep -qi 'github\.com'; then
PLATFORM="github"
else
PLATFORM="github" # default fallback
fi
Pass {PLATFORM} into all phase prompts. Each phase uses the appropriate
CLI tool: gh for GitHub, az repos/az pipelines for Azure DevOps.
Before starting, check all dependencies in this table. The table contains all dependencies — some are platform-conditional (see notes after table).
| Dependency | Type | Check | Required | Resolution | Detail |
|---|---|---|---|---|---|
| git | cli | git --version | yes | stop | Install from https://git-scm.com |
| sync | skill | ls .claude/skills/sync/SKILL.md ~/.claude/skills/sync/SKILL.md ~/.claude/plugins/marketplaces/slamb2k/skills/sync/SKILL.md 2>/dev/null | no | fallback | Repo sync; falls back to manual git pull |
| lefthook | npm | npx lefthook --help | no | fallback | Not found now → Phase 4 installs it as a local devDependency (npm install --save-dev lefthook or the project's package manager), falling back to npm install -g lefthook only if that fails; see references/configuration-steps.md |
| gh | cli | gh --version | yes | url | https://cli.github.com |
| az devops | cli | az devops -h 2>/dev/null | no | fallback | Falls back to REST API with PAT; see AzDO tooling below |
Platform-conditional rules:
gh: Only required when PLATFORM == github. Skip for AzDO repos.az devops: Only checked when PLATFORM == azdo. Skip for GitHub repos.For each applicable row, in order:
{PLATFORM}When PLATFORM == azdo, determine which tooling is available. Set AZDO_MODE
for use in all subsequent phases:
if az devops -h &>/dev/null; then
AZDO_MODE="cli"
else
AZDO_MODE="rest"
fi
cli: Use az repos / az pipelines commands (preferred)rest: Use Azure DevOps REST API via curl. Requires a PAT (personal
access token) in AZURE_DEVOPS_EXT_PAT or AZDO_PAT env var. If no PAT
is found, prompt the user to either install the CLI or set the env var.Report in pre-flight:
az devops cli — version foundaz devops cli — not found → using REST API fallbackaz devops cli — not found, no PAT configured → halt with setup instructionsWhen PLATFORM == azdo, extract organization and project from the remote URL
and validate they are usable. These values are needed by every az repos /
az pipelines command and every REST API call.
# Extract org and project from remote URL patterns:
# https://dev.azure.com/{ORG}/{PROJECT}/_git/{REPO}
# https://{ORG}@dev.azure.com/{ORG}/{PROJECT}/_git/{REPO}
# {ORG}@vs-ssh.visualstudio.com:v3/{ORG}/{PROJECT}/{REPO}
REMOTE_URL=$(git remote get-url origin 2>/dev/null)
if echo "$REMOTE_URL" | grep -q 'dev\.azure\.com'; then
AZDO_ORG=$(echo "$REMOTE_URL" | sed -n 's|.*dev\.azure\.com/\([^/]*\)/.*|\1|p')
AZDO_PROJECT=$(echo "$REMOTE_URL" | sed -n 's|.*dev\.azure\.com/[^/]*/\([^/]*\)/.*|\1|p')
AZDO_ORG_URL="https://dev.azure.com/$AZDO_ORG"
elif echo "$REMOTE_URL" | grep -q 'vs-ssh\.visualstudio\.com'; then
AZDO_ORG=$(echo "$REMOTE_URL" | sed -n 's|.*vs-ssh\.visualstudio\.com:v3/\([^/]*\)/.*|\1|p')
AZDO_PROJECT=$(echo "$REMOTE_URL" | sed -n 's|.*vs-ssh\.visualstudio\.com:v3/[^/]*/\([^/]*\)/.*|\1|p')
AZDO_ORG_URL="https://dev.azure.com/$AZDO_ORG"
elif echo "$REMOTE_URL" | grep -q 'visualstudio\.com'; then
AZDO_ORG=$(echo "$REMOTE_URL" | sed -n 's|.*//\([^.]*\)\.visualstudio\.com.*|\1|p')
AZDO_PROJECT=$(echo "$REMOTE_URL" | sed -n 's|.*/\([^/]*\)/_git/.*|\1|p')
AZDO_ORG_URL="https://${AZDO_ORG}.visualstudio.com"
fi
# URL-decode for CLI/display; keep URL-safe versions for REST API paths
AZDO_PROJECT_URL_SAFE="$AZDO_PROJECT"
AZDO_ORG=$(python3 -c "import urllib.parse; print(urllib.parse.unquote('$AZDO_ORG'))")
AZDO_PROJECT=$(python3 -c "import urllib.parse; print(urllib.parse.unquote('$AZDO_PROJECT_URL_SAFE'))")
if [ -z "$AZDO_ORG" ] || [ -z "$AZDO_PROJECT" ]; then
echo "❌ Could not extract organization/project from remote URL"
echo " Remote: $REMOTE_URL"
echo ""
echo "Ensure the remote URL follows one of these formats:"
echo " https://dev.azure.com/{ORG}/{PROJECT}/_git/{REPO}"
echo " https://{ORG}.visualstudio.com/{PROJECT}/_git/{REPO}"
echo " {ORG}@vs-ssh.visualstudio.com:v3/{ORG}/{PROJECT}/{REPO}"
# HALT — cannot proceed without org/project context
fi
When AZDO_MODE == cli, also configure the defaults so commands work correctly:
az devops configure --defaults organization="$AZDO_ORG_URL" project="$AZDO_PROJECT"
When AZDO_MODE == rest, store these for API calls:
$AZDO_ORG_URL/$AZDO_PROJECT_URL_SAFE/_apisAuthorization: Basic $(printf ":%s" "$PAT" | base64 | tr -d '\n')Report in pre-flight:
azdo context — org: {AZDO_ORG}, project: {AZDO_PROJECT}azdo context — could not parse from remote URL → halt with instructionsPass {AZDO_MODE}, {AZDO_ORG}, {AZDO_PROJECT}, {AZDO_ORG_URL} into
all phase prompts alongside {PLATFORM}.
Invoke /sync to ensure the working tree is up to date with origin/main before
bootstrapping. If /sync is unavailable, run git pull manually. This prevents
rigging against stale repo state.
Launch general-purpose subagent (bash) (haiku — simple checks):
Task(
subagent_type: "general-purpose",
model: "haiku",
description: "Check system requirements",
prompt: <read from references/phase-prompts.md#phase-1>
)
Parse SYSTEM_REPORT. If any requirement fails, use AskUserQuestion:
Options for missing git config:
Stop if user chooses manual. Configure if values provided.
Launch general-purpose subagent (bash) (haiku):
Task(
subagent_type: "general-purpose",
model: "haiku",
description: "Analyze repository",
prompt: <read from references/phase-prompts.md#phase-2>
)
Parse REPO_REPORT.
Present analysis to user with AskUserQuestion:
Repository Analysis Complete
Current State:
Git initialized: {status}
Branch: {branch}
Lefthook: {status}
Commit template: {status}
PR template: {status}
CI workflow: {status}
{if azdo and unregistered_pipelines:}
Azure Pipelines: {N} YAML file(s) found, {M} not yet registered
Detected Stack:
Type: {project_type}
Components: {detected_components}
Available scripts: {available_scripts}
Proposed Changes:
{numbered list of what will be added/configured}
{if azdo and unregistered_pipelines: "Register Azure Pipelines: {list of YAML paths}"}
Options:
If "Let me choose", present individual options as multi-select.
For each approved item, follow the procedures in
references/configuration-steps.md.
Resolve the instructions file per references/instructions-file.md (shared
with /brace and the session guard): AGENTS.md is canonical, CLAUDE.md
should only contain @AGENTS.md.
if [ -f AGENTS.md ]; then TARGET=AGENTS.md
elif [ -f CLAUDE.md ]; then TARGET=CLAUDE.md
else TARGET=""
fi
If TARGET is empty, skip this step (/brace creates the file). If
CLAUDE.md has content and does not import AGENTS.md, offer the migration from
references/instructions-file.md via AskUserQuestion first; on approval merge
it into AGENTS.md, replace CLAUDE.md with @AGENTS.md, and set
TARGET=AGENTS.md. Claude-only notes under an existing @AGENTS.md import
are intentional; leave them alone. Then:
## Branch Discipline already exists:
grep -q "## Branch Discipline" "$TARGET"
## Guardrails:
## Guardrails## Guardrails section exists, append at the end of the fileThe Branch Discipline content to inject is the ## Branch Discipline section
from skills/brace/references/agents-md-template.md. Read that file to get
the exact content — this avoids duplication and ensures both /brace and /rig
inject identical text.
Launch general-purpose subagent (bash) (haiku):
Task(
subagent_type: "general-purpose",
model: "haiku",
description: "Verify configuration",
prompt: <read from references/phase-prompts.md#phase-5>
)
Parse VERIFY_REPORT.
Present summary using the template in references/report-template.md.
After presenting the report, record lifecycle completion and surface the next step:
_R="${CLAUDE_PLUGIN_ROOT:-$HOME/.claude/plugins/marketplaces/slamb2k}"
node "$_R/hooks/session-guard.cjs" lifecycle-complete rig
If the command prints a LIFECYCLE_OFFER_BEGIN…END block, present that offer to
the user via AskUserQuestion as instructed inside the block. If it prints nothing
(or LIFECYCLE_OFFER_NONE), do not mention the lifecycle engine.
If any step fails:
Common issues:
assets/azure-pipelines.yml (opens in a new tab)assets/ci.yml (opens in a new tab)assets/gitmessage (opens in a new tab)assets/lefthook.yml (opens in a new tab)assets/pull_request_template.md (opens in a new tab)references/configuration-steps.md (opens in a new tab)references/phase-prompts.md (opens in a new tab)references/report-template.md (opens in a new tab)tests/evals.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub slamb2k/mad-skills --plugin mad-skills14 skills in this plugin
/braceInitialize any project directory with a standard scaffold for AI-assisted development. Creates specs/ and context/ directories, a project AGENTS.md with development workflow and guardrails (plus a CLAUDE.md that just points at it), .gitignore, and branch protection. Idempotent — safe to run on existing projects. Triggers: "init project", "setup brace", "brace", "initialize", "bootstrap", "scaffold"./buildContext-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./distil