@slamb2k/mad-skills 2.0.7 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,8 @@
1
1
  ---
2
2
  name: distil
3
- description: >
4
- Generate multiple unique web design variations for any website or web application.
5
- Accepts site specifications from a file (--spec path) or pasted text block.
6
- Creates a Vite + React + TypeScript + Tailwind project with Bun and produces N different
7
- creative designs accessible at /1, /2, /3, etc. Use when prototyping or exploring
8
- design directions for any web interface.
3
+ description: Generate multiple unique web design variations for any website or web application. Accepts site specifications from a file (--spec path) or pasted text block. Creates a Vite + React + TypeScript + Tailwind project with Bun and produces N different creative designs accessible at /1, /2, /3, etc. Use when prototyping or exploring design directions for any web interface.
4
+ argument-hint: <count> --port <port> [--spec <path>] [--favorites <1,2,3>]
5
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, AskUserQuestion
9
6
  ---
10
7
 
11
8
  # Distil - Design Variation Generator
@@ -35,4 +32,258 @@ Taglines:
35
32
  - Distilling N variations of brilliance!
36
33
  - From crude concept to pure design!
37
34
 
38
- Follow instructions in: [instructions.md](instructions.md)
35
+ ---
36
+
37
+ Generate multiple unique, creative web interface designs for any website or
38
+ web application. The primary agent acts as a thin orchestrator — all heavy
39
+ reading and file creation is delegated to subagents to protect the primary
40
+ context window.
41
+
42
+ ## Arguments
43
+
44
+ Parse the following from the skill invocation:
45
+ - **count** (required): Number of designs to create (e.g., 5)
46
+ - **--spec** (optional): Path to a file containing site specification
47
+ - **--url** (optional): URL to existing site to review for context
48
+ - **--port** (required): Port for the Vite dev server
49
+ - **--favorites** (optional): Comma-separated list of design numbers for iteration mode
50
+
51
+ ### Examples
52
+ ```
53
+ /distil 5 --spec ./site-spec.md --port 5173
54
+ /distil 3 --favorites 2,4 --port 5173
55
+ ```
56
+
57
+ If `--favorites` is provided, follow `references/iteration-mode.md` instead
58
+ of the steps below.
59
+
60
+ ---
61
+
62
+ ## Pre-flight
63
+
64
+ Before starting, check all dependencies in this table:
65
+
66
+ | Dependency | Type | Check | Required | Resolution | Detail |
67
+ |-----------|------|-------|----------|------------|--------|
68
+ | npm | cli | `npm --version` | yes | stop | https://bun.sh or use npm |
69
+ | bencium-innovative-ux-designer | skill | `~/.claude/skills/bencium-innovative-ux-designer/SKILL.md` | no | ask | `npx skills add bencium/bencium-claude-code-design-skill@bencium-innovative-ux-designer -g -y` |
70
+ | web-animation-design | skill | `~/.claude/skills/web-animation-design/SKILL.md` | no | ask | `npx skills add connorads/dotfiles@web-animation-design -g -y` |
71
+ | design-system | skill | `~/.claude/skills/design-system/SKILL.md` | no | ask | `npx skills add lobbi-docs/claude@design-system -g -y` |
72
+
73
+ For each row, in order:
74
+ 1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
75
+ 2. If found: continue silently
76
+ 3. If missing: apply Resolution strategy
77
+ - **stop**: notify user with Detail, halt execution
78
+ - **url**: notify user with Detail (install link), halt execution
79
+ - **install**: notify user, run the command in Detail, continue if successful
80
+ - **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
81
+ - **fallback**: notify user with Detail, continue with degraded behavior
82
+ 4. After all checks: summarize what's available and what's degraded
83
+
84
+ ---
85
+
86
+ ## Site Specification
87
+
88
+ The specification can be provided via:
89
+
90
+ 1. **--spec flag**: Read the file at the provided path
91
+ 2. **Pasted text**: Check conversation for a description of the site
92
+ 3. **--url flag**: Use WebFetch to analyze an existing site
93
+
94
+ **If no specification is found, ask the user before proceeding.**
95
+
96
+ ---
97
+
98
+ ## Step 1: Load Site Specification
99
+
100
+ Parse and store the site context for use when generating each design.
101
+ This is the only file the primary agent reads directly (specs are typically small).
102
+
103
+ ## Step 2: Reconnaissance (launch in parallel)
104
+
105
+ Launch two subagents **in parallel** to gather context without bloating
106
+ the primary agent.
107
+
108
+ ### 2a: Verify Design Skills
109
+
110
+ Design skill availability is checked in the Pre-flight section above.
111
+ Use the results from pre-flight to populate SKILL_REPORT:
112
+ - For each design skill: name, installed (yes/no)
113
+ - If any skill was missing and the user declined to install, note it as unavailable
114
+
115
+ ### 2b: Scan Existing Project
116
+
117
+ ```
118
+ Task(
119
+ subagent_type: "Explore",
120
+ model: "haiku",
121
+ description: "Scan existing design project",
122
+ prompt: "Check if src/designs/ directory exists. If it does:
123
+ 1. List all DesignN.tsx files (glob for src/designs/Design*.tsx)
124
+ 2. For each file, read ONLY the first 10 lines to extract the
125
+ metadata comment (style name, key traits)
126
+ 3. Determine the highest design number
127
+ Return PROJECT_REPORT (max 20 lines):
128
+ - project_exists: true/false
129
+ - package_manager: detected from lockfile (bun.lockb/pnpm-lock/yarn.lock/package-lock)
130
+ - design_count: N
131
+ - highest_number: N
132
+ - designs: list of (number, style_name) pairs
133
+ If no src/designs/ directory, return project_exists: false."
134
+ )
135
+ ```
136
+
137
+ ### Parse Recon Results
138
+
139
+ From SKILL_REPORT: Gate on missing skills before proceeding.
140
+ From PROJECT_REPORT:
141
+ - If `project_exists`: set `START_INDEX = highest_number + 1`, skip Step 3
142
+ - If not: set `START_INDEX = 1`, proceed to Step 3
143
+
144
+ ## Step 3: Initialize Project
145
+
146
+ **Skip this step if an existing project was detected in Step 2b.**
147
+
148
+ Launch **Bash subagent** (haiku) to set up the project:
149
+
150
+ ```
151
+ Task(
152
+ subagent_type: "Bash",
153
+ model: "haiku",
154
+ description: "Initialize distil project",
155
+ prompt: "Follow the project setup instructions:
156
+ 1. Detect package manager (bun -> pnpm -> yarn -> npm)
157
+ 2. Create Vite React-TS project
158
+ 3. Install dependencies: tailwindcss, postcss, autoprefixer,
159
+ react-router-dom, lucide-react
160
+ 4. Configure Tailwind (content paths, index.css directives)
161
+ 5. Copy {skill_dir}/assets/DesignNav.tsx to src/components/DesignNav.tsx
162
+ Return SETUP_REPORT (max 10 lines): status, package_manager, errors."
163
+ )
164
+ ```
165
+
166
+ Parse SETUP_REPORT. If setup fails, fall back through the package manager
167
+ chain (bun -> pnpm -> yarn -> npm).
168
+
169
+ ## Step 4: Create Designs via Subagent
170
+
171
+ Launch a **general-purpose subagent** to create all new designs.
172
+
173
+ **CRITICAL**: The subagent reads skill files and design guides directly.
174
+ Do NOT read them in the primary agent — pass file paths only.
175
+
176
+ ```
177
+ Task(
178
+ subagent_type: "general-purpose",
179
+ description: "Create design variations",
180
+ prompt: "
181
+ You are creating {COUNT} new web design variations for a distil project.
182
+
183
+ ## Site Specification
184
+ {SITE_SPEC from Step 1}
185
+
186
+ ## Design Knowledge — Read These Files
187
+ Load design principles and the 50+ style catalog from these skill files:
188
+ - ~/.claude/skills/bencium-innovative-ux-designer/SKILL.md
189
+ - ~/.claude/skills/bencium-innovative-ux-designer/MOTION-SPEC.md
190
+ - ~/.claude/skills/web-animation-design/SKILL.md
191
+ - ~/.claude/skills/design-system/SKILL.md
192
+ - ~/.claude/skills/design-system/references/style-guide.md
193
+
194
+ Also read the project design guide:
195
+ - {skill_dir}/references/design-guide.md
196
+
197
+ ## Existing Designs (avoid these styles)
198
+ {Compact list from PROJECT_REPORT: number + style_name pairs,
199
+ or 'None — fresh project'}
200
+
201
+ ## Task
202
+ Create designs numbered {START_INDEX} through {START_INDEX + COUNT - 1}.
203
+
204
+ For each design, create `src/designs/Design{N}.tsx`:
205
+ - Pick a DISTINCT style from the 50+ style catalog in the design-system skill
206
+ - Do NOT reuse styles already used by existing designs
207
+ - Apply the site specification to all content and sections
208
+ - Follow anti-AI-slop rules strictly (no Inter, no default blue, no cookie-cutter layouts)
209
+ - Include purposeful animations with proper easing
210
+ - Each design must be self-contained in a single file
211
+ - Import and render DesignNav from '../components/DesignNav'
212
+
213
+ After creating all designs, update:
214
+ 1. `src/App.tsx` — Add import and route for EVERY design (existing + new)
215
+ 2. Each design file's DesignNav `designs` array — Include ALL designs (existing + new)
216
+
217
+ ## Design File Requirements
218
+ Each design file must have:
219
+ - A metadata comment at the top: style name, key visual traits, color palette
220
+ - Import DesignNav from '../components/DesignNav'
221
+ - A `designs` array listing ALL designs (existing + new) with id and name
222
+ - ALL sections from the site specification with realistic content
223
+ - Custom color palette (not default Tailwind)
224
+ - Animations with proper easing (ease-out for entrances, ease-in-out for movement)
225
+ - Responsive layout (mobile-first)
226
+ - Lucide React icons for iconography
227
+
228
+ ## App.tsx Requirements
229
+ The App.tsx must:
230
+ - Import ALL design components (existing + new)
231
+ - Have a route for each: <Route path='/{N}' element={<DesignN />} />
232
+ - Default route redirects to /1
233
+
234
+ Return DESIGN_REPORT (max 30 lines):
235
+ - List each design created: number, style name, key visual traits
236
+ - Total design count (existing + new)
237
+ - Files created and modified
238
+ - Any issues encountered
239
+ "
240
+ )
241
+ ```
242
+
243
+ Parse DESIGN_REPORT. If any design failed, report the error and offer retry.
244
+
245
+ ## Step 5: Start Dev Server
246
+
247
+ Launch as a **background Bash** to avoid blocking the primary agent:
248
+
249
+ ```
250
+ Task(
251
+ subagent_type: "Bash",
252
+ run_in_background: true,
253
+ description: "Start Vite dev server",
254
+ prompt: "{package_manager} run dev --port {PORT}"
255
+ )
256
+ ```
257
+
258
+ If the dev server is already running, HMR should pick up the new files
259
+ automatically — skip this step.
260
+
261
+ ## Step 6: Present Designs
262
+
263
+ Inform the user:
264
+ - Dev server is running at `http://localhost:{PORT}`
265
+ - Each design is available at `/1`, `/2`, `/3`, etc.
266
+ - Briefly describe each design's unique approach (from DESIGN_REPORT)
267
+ - Note which designs are new vs existing (if appending)
268
+ - Remind they can iterate with `--favorites` to refine preferred designs
269
+
270
+ ## Context Protection Summary
271
+
272
+ | Step | Agent | Model | Why |
273
+ |---|---|---|---|
274
+ | 1: Load spec | Primary | — | Small file, needed for subagent prompt |
275
+ | 2a: Skill check | Explore | haiku | Avoids reading 2000+ lines of skill content |
276
+ | 2b: Project scan | Explore | haiku | Avoids reading existing design files |
277
+ | 3: Init project | Bash | haiku | Shell commands only |
278
+ | 4: Create designs | general-purpose | default | Heavy lifting: reads skills, writes files |
279
+ | 5: Dev server | Bash (background) | — | Non-blocking, no output in primary |
280
+ | 6: Present | Primary | — | User-facing, uses compact DESIGN_REPORT |
281
+
282
+ ## Troubleshooting
283
+
284
+ - If package manager commands fail, try the next in the fallback chain
285
+ - If port is in use, suggest killing the process or using a different port
286
+ - If design imports fail, check file naming consistency
287
+ - If no site spec is found, always ask the user before proceeding
288
+ - If a design skill is missing, offer to install it before proceeding
289
+ - If the subagent fails, check error details and retry with adjusted parameters
@@ -1,12 +1,12 @@
1
1
  {
2
- "generated": "2026-03-03T01:58:15.572Z",
3
- "count": 7,
2
+ "generated": "2026-03-08T22:06:12.122Z",
3
+ "count": 8,
4
4
  "skills": [
5
5
  {
6
6
  "name": "brace",
7
7
  "directory": "brace",
8
- "description": "> Initialize any project directory with the GOTCHA/BRACE framework for agentic AI systems. Creates the 6-layer structure (Goals, Orchestration, Tools, Context, Hard prompts, Args), BRACE build methodology, and a project CLAUDE.md. Recommends claude-mem for persistent memory. Idempotent — safe to run on existing projects. Triggers: \"init gotcha\", \"setup brace\", \"brace\", \"initialize framework\", \"bootstrap gotcha\".",
9
- "lines": 52,
8
+ "description": "'Initialize any project directory with the GOTCHA/BRACE framework for agentic AI systems. Creates the 6-layer structure (Goals, Orchestration, Tools, Context, Hard prompts, Args), BRACE build methodology, and a project CLAUDE.md. Recommends claude-mem for persistent memory. Idempotent — safe to run on existing projects. Triggers: \"init gotcha\", \"setup brace\", \"brace\", \"initialize framework\", \"bootstrap gotcha\".'",
9
+ "lines": 278,
10
10
  "hasScripts": false,
11
11
  "hasReferences": true,
12
12
  "hasAssets": true,
@@ -15,8 +15,8 @@
15
15
  {
16
16
  "name": "build",
17
17
  "directory": "build",
18
- "description": "> 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.",
19
- "lines": 49,
18
+ "description": "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.",
19
+ "lines": 328,
20
20
  "hasScripts": false,
21
21
  "hasReferences": true,
22
22
  "hasAssets": false,
@@ -25,8 +25,8 @@
25
25
  {
26
26
  "name": "distil",
27
27
  "directory": "distil",
28
- "description": "> Generate multiple unique web design variations for any website or web application. Accepts site specifications from a file (--spec path) or pasted text block. Creates a Vite + React + TypeScript + Tailwind project with Bun and produces N different creative designs accessible at /1, /2, /3, etc. Use when prototyping or exploring design directions for any web interface.",
29
- "lines": 39,
28
+ "description": "Generate multiple unique web design variations for any website or web application. Accepts site specifications from a file (--spec path) or pasted text block. Creates a Vite + React + TypeScript + Tailwind project with Bun and produces N different creative designs accessible at /1, /2, /3, etc. Use when prototyping or exploring design directions for any web interface.",
29
+ "lines": 290,
30
30
  "hasScripts": false,
31
31
  "hasReferences": true,
32
32
  "hasAssets": true,
@@ -35,8 +35,8 @@
35
35
  {
36
36
  "name": "prime",
37
37
  "directory": "prime",
38
- "description": "> Load project context before implementing features or making architectural decisions. Invoke proactively when starting significant work on DexAI. Supports domain-specific context loading: security (vault, RBAC, audit), routing (OpenRouter, model selection), adhd (design principles, RSD-safe), dashboard (frontend, backend, API), office (OAuth, email, calendar), memory (context capture, commitments), tasks (decomposition, friction-solving), channels (Telegram, Discord, Slack).",
39
- "lines": 40,
38
+ "description": "\"Load project context before implementing features or making architectural decisions. Invoke proactively when starting significant work on DexAI. Supports domain-specific context loading: security (vault, RBAC, audit), routing (OpenRouter, model selection), adhd (design principles, RSD-safe), dashboard (frontend, backend, API), office (OAuth, email, calendar), memory (context capture, commitments), tasks (decomposition, friction-solving), channels (Telegram, Discord, Slack).\"",
39
+ "lines": 108,
40
40
  "hasScripts": false,
41
41
  "hasReferences": true,
42
42
  "hasAssets": false,
@@ -45,8 +45,8 @@
45
45
  {
46
46
  "name": "rig",
47
47
  "directory": "rig",
48
- "description": "> Idempotently bootstrap any repository with standard development tools, hooks, and workflows. Use when starting work on a new repo, onboarding to an existing project, or ensuring a repo has proper CI/CD setup. Configures: git hooks (lefthook), commit message templates, PR templates, and GitHub Actions for lint/format/type-check/build. Prompts for user confirmation before changes. Triggers: \"bootstrap repo\", \"setup hooks\", \"configure CI\", \"rig\", \"standardize repo\".",
49
- "lines": 39,
48
+ "description": "'Idempotently bootstrap any repository with standard development tools, hooks, and workflows. Use when starting work on a new repo, onboarding to an existing project, or ensuring a repo has proper CI/CD setup. Configures: git hooks (lefthook), commit message templates, PR templates, and GitHub Actions for lint/format/type-check/build. Prompts for user confirmation before changes. Triggers: \"bootstrap repo\", \"setup hooks\", \"configure CI\", \"rig\", \"standardize repo\".'",
49
+ "lines": 197,
50
50
  "hasScripts": false,
51
51
  "hasReferences": true,
52
52
  "hasAssets": true,
@@ -55,8 +55,18 @@
55
55
  {
56
56
  "name": "ship",
57
57
  "directory": "ship",
58
- "description": "> Ship changes through the full PR lifecycle. Use after completing feature work to commit, push, create PR, wait for checks, and merge. Handles the entire workflow: syncs with main, creates feature branch if needed, groups commits logically with semantic messages, creates detailed PR, monitors CI, fixes issues, squash merges, and cleans up. Invoke when work is ready to ship.",
59
- "lines": 56,
58
+ "description": "\"Ship changes through the full PR lifecycle. Use after completing feature work to commit, push, create PR, wait for checks, and merge. Handles the entire workflow: syncs with main, creates feature branch if needed, groups commits logically with semantic messages, creates detailed PR, monitors CI, fixes issues, squash merges, and cleans up. Invoke when work is ready to ship.\"",
59
+ "lines": 227,
60
+ "hasScripts": false,
61
+ "hasReferences": true,
62
+ "hasAssets": false,
63
+ "hasTests": true
64
+ },
65
+ {
66
+ "name": "speccy",
67
+ "directory": "speccy",
68
+ "description": "Deep-dive interview skill for creating comprehensive specifications. Reviews existing code and docs, then interviews the user through multiple rounds of targeted questions covering technical implementation, UI/UX, concerns, and tradeoffs. Produces a structured spec via create-specification. Use when starting a new feature, system, or major change that needs a spec.",
69
+ "lines": 166,
60
70
  "hasScripts": false,
61
71
  "hasReferences": true,
62
72
  "hasAssets": false,
@@ -65,8 +75,8 @@
65
75
  {
66
76
  "name": "sync",
67
77
  "directory": "sync",
68
- "description": "> Sync local repository with origin/main. Use before starting new work, after completing a PR, or when needing latest upstream changes. Safely stashes uncommitted changes, fetches and pulls origin/main, restores stash, and cleans up stale local branches (merged or with deleted remotes). Invoke when switching contexts or preparing for new feature work.",
69
- "lines": 55,
78
+ "description": "Sync local repository with origin/main. Use before starting new work, after completing a PR, or when needing latest upstream changes. Safely stashes uncommitted changes, fetches and pulls origin/main, restores stash, and cleans up stale local branches (merged or with deleted remotes). Invoke when switching contexts or preparing for new feature work.",
79
+ "lines": 213,
70
80
  "hasScripts": false,
71
81
  "hasReferences": false,
72
82
  "hasAssets": false,
@@ -1,12 +1,8 @@
1
1
  ---
2
2
  name: prime
3
- description: >
4
- Load project context before implementing features or making architectural decisions.
5
- Invoke proactively when starting significant work on DexAI. Supports domain-specific
6
- context loading: security (vault, RBAC, audit), routing (OpenRouter, model selection),
7
- adhd (design principles, RSD-safe), dashboard (frontend, backend, API), office (OAuth,
8
- email, calendar), memory (context capture, commitments), tasks (decomposition,
9
- friction-solving), channels (Telegram, Discord, Slack).
3
+ description: "Load project context before implementing features or making architectural decisions. Invoke proactively when starting significant work on DexAI. Supports domain-specific context loading: security (vault, RBAC, audit), routing (OpenRouter, model selection), adhd (design principles, RSD-safe), dashboard (frontend, backend, API), office (OAuth, email, calendar), memory (context capture, commitments), tasks (decomposition, friction-solving), channels (Telegram, Discord, Slack)."
4
+ argument-hint: security, routing, adhd, dashboard, office, memory, tasks, channels (comma-separated)
5
+ allowed-tools: Read, Glob, Grep, LS
10
6
  ---
11
7
 
12
8
  # Prime - Project Context Loader
@@ -36,4 +32,76 @@ Taglines:
36
32
  - 📜 Downloading the lore...
37
33
  - 🧠 Brain cells: ACTIVATING
38
34
 
39
- Follow instructions in: [instructions.md](instructions.md)
35
+ ---
36
+
37
+ Load project context to inform agent decisions. Raw file contents stay in a
38
+ subagent — the primary thread only sees a structured PRIME_REPORT.
39
+
40
+ ## Step 1: Parse Arguments
41
+
42
+ Extract domain hints from the request (comma-separated). Valid domains are
43
+ listed in `references/domains.md`. If no domain specified, load core context only.
44
+
45
+ ## Step 2: Load Context via Subagent
46
+
47
+ Launch a **general-purpose subagent** to read files and build the report:
48
+
49
+ ```
50
+ Task(
51
+ subagent_type: "general-purpose",
52
+ description: "Load and summarise project context",
53
+ prompt: <see below>
54
+ )
55
+ ```
56
+
57
+ ### Subagent Prompt
58
+
59
+ ```
60
+ Load project context and return a structured summary. Raw file contents must
61
+ NOT appear in the report — summarise only.
62
+
63
+ Limit PRIME_REPORT to 30 lines maximum.
64
+
65
+ ## Core Files (always load)
66
+
67
+ 1. CLAUDE.md — System handbook, operating procedures
68
+ 2. goals/manifest.md — Phase status, available goals, project roadmap
69
+ 3. tools/manifest.md — Available tools and their locations
70
+
71
+ If CLAUDE.md is missing, record as NOT FOUND and continue.
72
+
73
+ ## Domain Files
74
+
75
+ {For each requested domain, list files from references/domains.md}
76
+
77
+ For each file:
78
+ - If it exists: read and summarise (2-3 lines max per domain)
79
+ - If it doesn't exist: record as NOT FOUND and continue
80
+
81
+ ## Output Format
82
+
83
+ PRIME_REPORT:
84
+ - core_files_loaded: {count}/{total}
85
+ - missing_files: {list or "none"}
86
+ - domains_loaded: {list}
87
+ - per_domain_summary:
88
+ - {domain}: {2-3 line summary}
89
+ - branch: {current branch from git branch --show-current}
90
+ - ready_for: {inferred from loaded context}
91
+ ```
92
+
93
+ ## Step 3: Present Summary
94
+
95
+ Parse PRIME_REPORT and present a clean summary to the user:
96
+
97
+ ```
98
+ Context loaded:
99
+ - Core: {status from core_files_loaded}
100
+ - {Domain}: {summary from per_domain_summary}
101
+
102
+ Current branch: {branch}
103
+ Ready to assist with: {ready_for}
104
+ ```
105
+
106
+ If CLAUDE.md was missing, warn the user and note that only domain context
107
+ was loaded.
@@ -1,11 +1,8 @@
1
1
  ---
2
2
  name: rig
3
- description: >
4
- Idempotently bootstrap any repository with standard development tools, hooks, and workflows.
5
- Use when starting work on a new repo, onboarding to an existing project, or ensuring a repo
6
- has proper CI/CD setup. Configures: git hooks (lefthook), commit message templates, PR templates,
7
- and GitHub Actions for lint/format/type-check/build. Prompts for user confirmation before changes.
8
- Triggers: "bootstrap repo", "setup hooks", "configure CI", "rig", "standardize repo".
3
+ description: 'Idempotently bootstrap any repository with standard development tools, hooks, and workflows. Use when starting work on a new repo, onboarding to an existing project, or ensuring a repo has proper CI/CD setup. Configures: git hooks (lefthook), commit message templates, PR templates, and GitHub Actions for lint/format/type-check/build. Prompts for user confirmation before changes. Triggers: "bootstrap repo", "setup hooks", "configure CI", "rig", "standardize repo".'
4
+ argument-hint: --skip-system-check (optional)
5
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep, AskUserQuestion
9
6
  ---
10
7
 
11
8
  # Rig - Repository Bootstrap
@@ -35,4 +32,165 @@ Taglines:
35
32
  - Setting up the drill floor!
36
33
  - From blueprint to build-ready!
37
34
 
38
- Follow instructions in: [instructions.md](instructions.md)
35
+ ---
36
+
37
+ Idempotently bootstrap repositories with standard development infrastructure.
38
+ Prompts and report schemas are in `references/`. Configuration procedures are
39
+ in `references/configuration-steps.md`.
40
+
41
+ **Key principle:** Prompt user before making changes. Report findings first,
42
+ get approval, then act.
43
+
44
+ ---
45
+
46
+ ## Pre-flight
47
+
48
+ Before starting, check all dependencies in this table:
49
+
50
+ | Dependency | Type | Check | Required | Resolution | Detail |
51
+ |-----------|------|-------|----------|------------|--------|
52
+ | git | cli | `git --version` | yes | stop | Install from https://git-scm.com |
53
+ | lefthook | npm | `npx lefthook --help` | yes | install | `npm install -g lefthook` |
54
+ | gh | cli | `gh --version` | yes | url | https://cli.github.com |
55
+
56
+ For each row, in order:
57
+ 1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
58
+ 2. If found: continue silently
59
+ 3. If missing: apply Resolution strategy
60
+ - **stop**: notify user with Detail, halt execution
61
+ - **url**: notify user with Detail (install link), halt execution
62
+ - **install**: notify user, run the command in Detail, continue if successful
63
+ - **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
64
+ - **fallback**: notify user with Detail, continue with degraded behavior
65
+ 4. After all checks: summarize what's available and what's degraded
66
+
67
+ ---
68
+
69
+ ## Phase 1: System Requirements Check
70
+
71
+ Launch **Bash subagent** (haiku — simple checks):
72
+
73
+ ```
74
+ Task(
75
+ subagent_type: "Bash",
76
+ model: "haiku",
77
+ description: "Check system requirements",
78
+ prompt: <read from references/phase-prompts.md#phase-1>
79
+ )
80
+ ```
81
+
82
+ Parse SYSTEM_REPORT. If any requirement fails, use **AskUserQuestion**:
83
+
84
+ Options for missing git config:
85
+ - "I'll configure it manually"
86
+ - "Configure for me with: [email] / [name]"
87
+
88
+ **Stop if user chooses manual. Configure if values provided.**
89
+
90
+ ---
91
+
92
+ ## Phase 2: Repository Analysis
93
+
94
+ Launch **Bash subagent** (haiku):
95
+
96
+ ```
97
+ Task(
98
+ subagent_type: "Bash",
99
+ model: "haiku",
100
+ description: "Analyze repository",
101
+ prompt: <read from references/phase-prompts.md#phase-2>
102
+ )
103
+ ```
104
+
105
+ Parse REPO_REPORT.
106
+
107
+ ---
108
+
109
+ ## Phase 3: Present Findings & Get Approval
110
+
111
+ Present analysis to user with **AskUserQuestion**:
112
+
113
+ ```
114
+ Repository Analysis Complete
115
+
116
+ Current State:
117
+ Git initialized: {status}
118
+ Branch: {branch}
119
+ Lefthook: {status}
120
+ Commit template: {status}
121
+ PR template: {status}
122
+ CI workflow: {status}
123
+ {if azdo and unregistered_pipelines:}
124
+ Azure Pipelines: {N} YAML file(s) found, {M} not yet registered
125
+
126
+ Detected Stack:
127
+ Type: {project_type}
128
+ Components: {detected_components}
129
+ Available scripts: {available_scripts}
130
+
131
+ Proposed Changes:
132
+ {numbered list of what will be added/configured}
133
+ {if azdo and unregistered_pipelines: "Register Azure Pipelines: {list of YAML paths}"}
134
+ ```
135
+
136
+ Options:
137
+ - "Yes, configure everything"
138
+ - "Let me choose what to configure"
139
+ - "Cancel"
140
+
141
+ If "Let me choose", present individual options as multi-select.
142
+
143
+ ---
144
+
145
+ ## Phase 4: Execute Configuration
146
+
147
+ For each approved item, follow the procedures in
148
+ `references/configuration-steps.md`.
149
+
150
+ ---
151
+
152
+ ## Phase 5: Verification
153
+
154
+ Launch **Bash subagent** (haiku):
155
+
156
+ ```
157
+ Task(
158
+ subagent_type: "Bash",
159
+ model: "haiku",
160
+ description: "Verify configuration",
161
+ prompt: <read from references/phase-prompts.md#phase-5>
162
+ )
163
+ ```
164
+
165
+ Parse VERIFY_REPORT.
166
+
167
+ ---
168
+
169
+ ## Phase 6: Final Report
170
+
171
+ Present summary using the template in `references/report-template.md`.
172
+
173
+ ---
174
+
175
+ ## Idempotency Rules
176
+
177
+ - **Skip** items already correctly configured
178
+ - **Update** items that exist but are outdated (prompt user first)
179
+ - **Add** items that are missing
180
+ - **Never delete** user's existing configuration without explicit approval
181
+ - **Merge** rather than replace when possible (e.g., add missing hooks)
182
+
183
+ ---
184
+
185
+ ## Error Handling
186
+
187
+ If any step fails:
188
+ 1. Report the specific failure
189
+ 2. Offer to skip and continue, or abort
190
+ 3. Include troubleshooting suggestions
191
+
192
+ Common issues:
193
+ - No package manager -> suggest installing npm/bun
194
+ - Permission denied -> check file permissions
195
+ - Lefthook install fails -> try global install
196
+ - Git not initialized -> offer to initialize