@slamb2k/mad-skills 2.0.6 → 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.
- package/.claude-plugin/marketplace.json +30 -0
- package/.claude-plugin/plugin.json +18 -0
- package/README.md +101 -25
- package/agents/ship-analyzer.md +91 -0
- package/hooks/hooks.json +18 -0
- package/hooks/session-guard-prompt.sh +59 -0
- package/hooks/session-guard.sh +406 -0
- package/package.json +6 -7
- package/skills/brace/SKILL.md +243 -17
- package/skills/brace/assets/gitignore-template +0 -3
- package/skills/brace/references/phase-prompts.md +37 -0
- package/skills/brace/references/report-template.md +5 -1
- package/skills/build/SKILL.md +295 -16
- package/skills/distil/SKILL.md +261 -10
- package/skills/manifest.json +26 -16
- package/skills/prime/SKILL.md +79 -11
- package/skills/rig/SKILL.md +168 -10
- package/skills/ship/SKILL.md +193 -22
- package/skills/speccy/SKILL.md +165 -0
- package/skills/speccy/references/interview-guide.md +96 -0
- package/skills/speccy/tests/evals.json +34 -0
- package/skills/sync/SKILL.md +178 -20
- package/skills/brace/instructions.md +0 -229
- package/skills/build/instructions.md +0 -293
- package/skills/distil/instructions.md +0 -255
- package/skills/prime/instructions.md +0 -73
- package/skills/rig/instructions.md +0 -162
- package/skills/ship/instructions.md +0 -192
- package/skills/sync/instructions.md +0 -178
- package/src/cli.js +0 -419
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
# Distil Instructions
|
|
2
|
-
|
|
3
|
-
Generate multiple unique, creative web interface designs for any website or
|
|
4
|
-
web application. The primary agent acts as a thin orchestrator — all heavy
|
|
5
|
-
reading and file creation is delegated to subagents to protect the primary
|
|
6
|
-
context window.
|
|
7
|
-
|
|
8
|
-
## Arguments
|
|
9
|
-
|
|
10
|
-
Parse the following from the skill invocation:
|
|
11
|
-
- **count** (required): Number of designs to create (e.g., 5)
|
|
12
|
-
- **--spec** (optional): Path to a file containing site specification
|
|
13
|
-
- **--url** (optional): URL to existing site to review for context
|
|
14
|
-
- **--port** (required): Port for the Vite dev server
|
|
15
|
-
- **--favorites** (optional): Comma-separated list of design numbers for iteration mode
|
|
16
|
-
|
|
17
|
-
### Examples
|
|
18
|
-
```
|
|
19
|
-
/distil 5 --spec ./site-spec.md --port 5173
|
|
20
|
-
/distil 3 --favorites 2,4 --port 5173
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
If `--favorites` is provided, follow `references/iteration-mode.md` instead
|
|
24
|
-
of the steps below.
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## Pre-flight
|
|
29
|
-
|
|
30
|
-
Before starting, check all dependencies in this table:
|
|
31
|
-
|
|
32
|
-
| Dependency | Type | Check | Required | Resolution | Detail |
|
|
33
|
-
|-----------|------|-------|----------|------------|--------|
|
|
34
|
-
| npm | cli | `npm --version` | yes | stop | https://bun.sh or use npm |
|
|
35
|
-
| 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` |
|
|
36
|
-
| web-animation-design | skill | `~/.claude/skills/web-animation-design/SKILL.md` | no | ask | `npx skills add connorads/dotfiles@web-animation-design -g -y` |
|
|
37
|
-
| design-system | skill | `~/.claude/skills/design-system/SKILL.md` | no | ask | `npx skills add lobbi-docs/claude@design-system -g -y` |
|
|
38
|
-
|
|
39
|
-
For each row, in order:
|
|
40
|
-
1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
|
|
41
|
-
2. If found: continue silently
|
|
42
|
-
3. If missing: apply Resolution strategy
|
|
43
|
-
- **stop**: notify user with Detail, halt execution
|
|
44
|
-
- **url**: notify user with Detail (install link), halt execution
|
|
45
|
-
- **install**: notify user, run the command in Detail, continue if successful
|
|
46
|
-
- **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
|
|
47
|
-
- **fallback**: notify user with Detail, continue with degraded behavior
|
|
48
|
-
4. After all checks: summarize what's available and what's degraded
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Site Specification
|
|
53
|
-
|
|
54
|
-
The specification can be provided via:
|
|
55
|
-
|
|
56
|
-
1. **--spec flag**: Read the file at the provided path
|
|
57
|
-
2. **Pasted text**: Check conversation for a description of the site
|
|
58
|
-
3. **--url flag**: Use WebFetch to analyze an existing site
|
|
59
|
-
|
|
60
|
-
**If no specification is found, ask the user before proceeding.**
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Step 1: Load Site Specification
|
|
65
|
-
|
|
66
|
-
Parse and store the site context for use when generating each design.
|
|
67
|
-
This is the only file the primary agent reads directly (specs are typically small).
|
|
68
|
-
|
|
69
|
-
## Step 2: Reconnaissance (launch in parallel)
|
|
70
|
-
|
|
71
|
-
Launch two subagents **in parallel** to gather context without bloating
|
|
72
|
-
the primary agent.
|
|
73
|
-
|
|
74
|
-
### 2a: Verify Design Skills
|
|
75
|
-
|
|
76
|
-
Design skill availability is checked in the Pre-flight section above.
|
|
77
|
-
Use the results from pre-flight to populate SKILL_REPORT:
|
|
78
|
-
- For each design skill: name, installed (yes/no)
|
|
79
|
-
- If any skill was missing and the user declined to install, note it as unavailable
|
|
80
|
-
|
|
81
|
-
### 2b: Scan Existing Project
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
Task(
|
|
85
|
-
subagent_type: "Explore",
|
|
86
|
-
model: "haiku",
|
|
87
|
-
description: "Scan existing design project",
|
|
88
|
-
prompt: "Check if src/designs/ directory exists. If it does:
|
|
89
|
-
1. List all DesignN.tsx files (glob for src/designs/Design*.tsx)
|
|
90
|
-
2. For each file, read ONLY the first 10 lines to extract the
|
|
91
|
-
metadata comment (style name, key traits)
|
|
92
|
-
3. Determine the highest design number
|
|
93
|
-
Return PROJECT_REPORT (max 20 lines):
|
|
94
|
-
- project_exists: true/false
|
|
95
|
-
- package_manager: detected from lockfile (bun.lockb/pnpm-lock/yarn.lock/package-lock)
|
|
96
|
-
- design_count: N
|
|
97
|
-
- highest_number: N
|
|
98
|
-
- designs: list of (number, style_name) pairs
|
|
99
|
-
If no src/designs/ directory, return project_exists: false."
|
|
100
|
-
)
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Parse Recon Results
|
|
104
|
-
|
|
105
|
-
From SKILL_REPORT: Gate on missing skills before proceeding.
|
|
106
|
-
From PROJECT_REPORT:
|
|
107
|
-
- If `project_exists`: set `START_INDEX = highest_number + 1`, skip Step 3
|
|
108
|
-
- If not: set `START_INDEX = 1`, proceed to Step 3
|
|
109
|
-
|
|
110
|
-
## Step 3: Initialize Project
|
|
111
|
-
|
|
112
|
-
**Skip this step if an existing project was detected in Step 2b.**
|
|
113
|
-
|
|
114
|
-
Launch **Bash subagent** (haiku) to set up the project:
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
Task(
|
|
118
|
-
subagent_type: "Bash",
|
|
119
|
-
model: "haiku",
|
|
120
|
-
description: "Initialize distil project",
|
|
121
|
-
prompt: "Follow the project setup instructions:
|
|
122
|
-
1. Detect package manager (bun -> pnpm -> yarn -> npm)
|
|
123
|
-
2. Create Vite React-TS project
|
|
124
|
-
3. Install dependencies: tailwindcss, postcss, autoprefixer,
|
|
125
|
-
react-router-dom, lucide-react
|
|
126
|
-
4. Configure Tailwind (content paths, index.css directives)
|
|
127
|
-
5. Copy {skill_dir}/assets/DesignNav.tsx to src/components/DesignNav.tsx
|
|
128
|
-
Return SETUP_REPORT (max 10 lines): status, package_manager, errors."
|
|
129
|
-
)
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
Parse SETUP_REPORT. If setup fails, fall back through the package manager
|
|
133
|
-
chain (bun -> pnpm -> yarn -> npm).
|
|
134
|
-
|
|
135
|
-
## Step 4: Create Designs via Subagent
|
|
136
|
-
|
|
137
|
-
Launch a **general-purpose subagent** to create all new designs.
|
|
138
|
-
|
|
139
|
-
**CRITICAL**: The subagent reads skill files and design guides directly.
|
|
140
|
-
Do NOT read them in the primary agent — pass file paths only.
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
Task(
|
|
144
|
-
subagent_type: "general-purpose",
|
|
145
|
-
description: "Create design variations",
|
|
146
|
-
prompt: "
|
|
147
|
-
You are creating {COUNT} new web design variations for a distil project.
|
|
148
|
-
|
|
149
|
-
## Site Specification
|
|
150
|
-
{SITE_SPEC from Step 1}
|
|
151
|
-
|
|
152
|
-
## Design Knowledge — Read These Files
|
|
153
|
-
Load design principles and the 50+ style catalog from these skill files:
|
|
154
|
-
- ~/.claude/skills/bencium-innovative-ux-designer/SKILL.md
|
|
155
|
-
- ~/.claude/skills/bencium-innovative-ux-designer/MOTION-SPEC.md
|
|
156
|
-
- ~/.claude/skills/web-animation-design/SKILL.md
|
|
157
|
-
- ~/.claude/skills/design-system/SKILL.md
|
|
158
|
-
- ~/.claude/skills/design-system/references/style-guide.md
|
|
159
|
-
|
|
160
|
-
Also read the project design guide:
|
|
161
|
-
- {skill_dir}/references/design-guide.md
|
|
162
|
-
|
|
163
|
-
## Existing Designs (avoid these styles)
|
|
164
|
-
{Compact list from PROJECT_REPORT: number + style_name pairs,
|
|
165
|
-
or 'None — fresh project'}
|
|
166
|
-
|
|
167
|
-
## Task
|
|
168
|
-
Create designs numbered {START_INDEX} through {START_INDEX + COUNT - 1}.
|
|
169
|
-
|
|
170
|
-
For each design, create `src/designs/Design{N}.tsx`:
|
|
171
|
-
- Pick a DISTINCT style from the 50+ style catalog in the design-system skill
|
|
172
|
-
- Do NOT reuse styles already used by existing designs
|
|
173
|
-
- Apply the site specification to all content and sections
|
|
174
|
-
- Follow anti-AI-slop rules strictly (no Inter, no default blue, no cookie-cutter layouts)
|
|
175
|
-
- Include purposeful animations with proper easing
|
|
176
|
-
- Each design must be self-contained in a single file
|
|
177
|
-
- Import and render DesignNav from '../components/DesignNav'
|
|
178
|
-
|
|
179
|
-
After creating all designs, update:
|
|
180
|
-
1. `src/App.tsx` — Add import and route for EVERY design (existing + new)
|
|
181
|
-
2. Each design file's DesignNav `designs` array — Include ALL designs (existing + new)
|
|
182
|
-
|
|
183
|
-
## Design File Requirements
|
|
184
|
-
Each design file must have:
|
|
185
|
-
- A metadata comment at the top: style name, key visual traits, color palette
|
|
186
|
-
- Import DesignNav from '../components/DesignNav'
|
|
187
|
-
- A `designs` array listing ALL designs (existing + new) with id and name
|
|
188
|
-
- ALL sections from the site specification with realistic content
|
|
189
|
-
- Custom color palette (not default Tailwind)
|
|
190
|
-
- Animations with proper easing (ease-out for entrances, ease-in-out for movement)
|
|
191
|
-
- Responsive layout (mobile-first)
|
|
192
|
-
- Lucide React icons for iconography
|
|
193
|
-
|
|
194
|
-
## App.tsx Requirements
|
|
195
|
-
The App.tsx must:
|
|
196
|
-
- Import ALL design components (existing + new)
|
|
197
|
-
- Have a route for each: <Route path='/{N}' element={<DesignN />} />
|
|
198
|
-
- Default route redirects to /1
|
|
199
|
-
|
|
200
|
-
Return DESIGN_REPORT (max 30 lines):
|
|
201
|
-
- List each design created: number, style name, key visual traits
|
|
202
|
-
- Total design count (existing + new)
|
|
203
|
-
- Files created and modified
|
|
204
|
-
- Any issues encountered
|
|
205
|
-
"
|
|
206
|
-
)
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Parse DESIGN_REPORT. If any design failed, report the error and offer retry.
|
|
210
|
-
|
|
211
|
-
## Step 5: Start Dev Server
|
|
212
|
-
|
|
213
|
-
Launch as a **background Bash** to avoid blocking the primary agent:
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
Task(
|
|
217
|
-
subagent_type: "Bash",
|
|
218
|
-
run_in_background: true,
|
|
219
|
-
description: "Start Vite dev server",
|
|
220
|
-
prompt: "{package_manager} run dev --port {PORT}"
|
|
221
|
-
)
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
If the dev server is already running, HMR should pick up the new files
|
|
225
|
-
automatically — skip this step.
|
|
226
|
-
|
|
227
|
-
## Step 6: Present Designs
|
|
228
|
-
|
|
229
|
-
Inform the user:
|
|
230
|
-
- Dev server is running at `http://localhost:{PORT}`
|
|
231
|
-
- Each design is available at `/1`, `/2`, `/3`, etc.
|
|
232
|
-
- Briefly describe each design's unique approach (from DESIGN_REPORT)
|
|
233
|
-
- Note which designs are new vs existing (if appending)
|
|
234
|
-
- Remind they can iterate with `--favorites` to refine preferred designs
|
|
235
|
-
|
|
236
|
-
## Context Protection Summary
|
|
237
|
-
|
|
238
|
-
| Step | Agent | Model | Why |
|
|
239
|
-
|---|---|---|---|
|
|
240
|
-
| 1: Load spec | Primary | — | Small file, needed for subagent prompt |
|
|
241
|
-
| 2a: Skill check | Explore | haiku | Avoids reading 2000+ lines of skill content |
|
|
242
|
-
| 2b: Project scan | Explore | haiku | Avoids reading existing design files |
|
|
243
|
-
| 3: Init project | Bash | haiku | Shell commands only |
|
|
244
|
-
| 4: Create designs | general-purpose | default | Heavy lifting: reads skills, writes files |
|
|
245
|
-
| 5: Dev server | Bash (background) | — | Non-blocking, no output in primary |
|
|
246
|
-
| 6: Present | Primary | — | User-facing, uses compact DESIGN_REPORT |
|
|
247
|
-
|
|
248
|
-
## Troubleshooting
|
|
249
|
-
|
|
250
|
-
- If package manager commands fail, try the next in the fallback chain
|
|
251
|
-
- If port is in use, suggest killing the process or using a different port
|
|
252
|
-
- If design imports fail, check file naming consistency
|
|
253
|
-
- If no site spec is found, always ask the user before proceeding
|
|
254
|
-
- If a design skill is missing, offer to install it before proceeding
|
|
255
|
-
- If the subagent fails, check error details and retry with adjusted parameters
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Prime Instructions
|
|
2
|
-
|
|
3
|
-
Load project context to inform agent decisions. Raw file contents stay in a
|
|
4
|
-
subagent — the primary thread only sees a structured PRIME_REPORT.
|
|
5
|
-
|
|
6
|
-
## Step 1: Parse Arguments
|
|
7
|
-
|
|
8
|
-
Extract domain hints from the request (comma-separated). Valid domains are
|
|
9
|
-
listed in `references/domains.md`. If no domain specified, load core context only.
|
|
10
|
-
|
|
11
|
-
## Step 2: Load Context via Subagent
|
|
12
|
-
|
|
13
|
-
Launch a **general-purpose subagent** to read files and build the report:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
Task(
|
|
17
|
-
subagent_type: "general-purpose",
|
|
18
|
-
description: "Load and summarise project context",
|
|
19
|
-
prompt: <see below>
|
|
20
|
-
)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Subagent Prompt
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
Load project context and return a structured summary. Raw file contents must
|
|
27
|
-
NOT appear in the report — summarise only.
|
|
28
|
-
|
|
29
|
-
Limit PRIME_REPORT to 30 lines maximum.
|
|
30
|
-
|
|
31
|
-
## Core Files (always load)
|
|
32
|
-
|
|
33
|
-
1. CLAUDE.md — System handbook, operating procedures
|
|
34
|
-
2. goals/manifest.md — Phase status, available goals, project roadmap
|
|
35
|
-
3. tools/manifest.md — Available tools and their locations
|
|
36
|
-
|
|
37
|
-
If CLAUDE.md is missing, record as NOT FOUND and continue.
|
|
38
|
-
|
|
39
|
-
## Domain Files
|
|
40
|
-
|
|
41
|
-
{For each requested domain, list files from references/domains.md}
|
|
42
|
-
|
|
43
|
-
For each file:
|
|
44
|
-
- If it exists: read and summarise (2-3 lines max per domain)
|
|
45
|
-
- If it doesn't exist: record as NOT FOUND and continue
|
|
46
|
-
|
|
47
|
-
## Output Format
|
|
48
|
-
|
|
49
|
-
PRIME_REPORT:
|
|
50
|
-
- core_files_loaded: {count}/{total}
|
|
51
|
-
- missing_files: {list or "none"}
|
|
52
|
-
- domains_loaded: {list}
|
|
53
|
-
- per_domain_summary:
|
|
54
|
-
- {domain}: {2-3 line summary}
|
|
55
|
-
- branch: {current branch from git branch --show-current}
|
|
56
|
-
- ready_for: {inferred from loaded context}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Step 3: Present Summary
|
|
60
|
-
|
|
61
|
-
Parse PRIME_REPORT and present a clean summary to the user:
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
Context loaded:
|
|
65
|
-
- Core: {status from core_files_loaded}
|
|
66
|
-
- {Domain}: {summary from per_domain_summary}
|
|
67
|
-
|
|
68
|
-
Current branch: {branch}
|
|
69
|
-
Ready to assist with: {ready_for}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
If CLAUDE.md was missing, warn the user and note that only domain context
|
|
73
|
-
was loaded.
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# Rig Instructions
|
|
2
|
-
|
|
3
|
-
Idempotently bootstrap repositories with standard development infrastructure.
|
|
4
|
-
Prompts and report schemas are in `references/`. Configuration procedures are
|
|
5
|
-
in `references/configuration-steps.md`.
|
|
6
|
-
|
|
7
|
-
**Key principle:** Prompt user before making changes. Report findings first,
|
|
8
|
-
get approval, then act.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## Pre-flight
|
|
13
|
-
|
|
14
|
-
Before starting, check all dependencies in this table:
|
|
15
|
-
|
|
16
|
-
| Dependency | Type | Check | Required | Resolution | Detail |
|
|
17
|
-
|-----------|------|-------|----------|------------|--------|
|
|
18
|
-
| git | cli | `git --version` | yes | stop | Install from https://git-scm.com |
|
|
19
|
-
| lefthook | npm | `npx lefthook --help` | yes | install | `npm install -g lefthook` |
|
|
20
|
-
| gh | cli | `gh --version` | yes | url | https://cli.github.com |
|
|
21
|
-
|
|
22
|
-
For each row, in order:
|
|
23
|
-
1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
|
|
24
|
-
2. If found: continue silently
|
|
25
|
-
3. If missing: apply Resolution strategy
|
|
26
|
-
- **stop**: notify user with Detail, halt execution
|
|
27
|
-
- **url**: notify user with Detail (install link), halt execution
|
|
28
|
-
- **install**: notify user, run the command in Detail, continue if successful
|
|
29
|
-
- **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
|
|
30
|
-
- **fallback**: notify user with Detail, continue with degraded behavior
|
|
31
|
-
4. After all checks: summarize what's available and what's degraded
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Phase 1: System Requirements Check
|
|
36
|
-
|
|
37
|
-
Launch **Bash subagent** (haiku — simple checks):
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
Task(
|
|
41
|
-
subagent_type: "Bash",
|
|
42
|
-
model: "haiku",
|
|
43
|
-
description: "Check system requirements",
|
|
44
|
-
prompt: <read from references/phase-prompts.md#phase-1>
|
|
45
|
-
)
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Parse SYSTEM_REPORT. If any requirement fails, use **AskUserQuestion**:
|
|
49
|
-
|
|
50
|
-
Options for missing git config:
|
|
51
|
-
- "I'll configure it manually"
|
|
52
|
-
- "Configure for me with: [email] / [name]"
|
|
53
|
-
|
|
54
|
-
**Stop if user chooses manual. Configure if values provided.**
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Phase 2: Repository Analysis
|
|
59
|
-
|
|
60
|
-
Launch **Bash subagent** (haiku):
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
Task(
|
|
64
|
-
subagent_type: "Bash",
|
|
65
|
-
model: "haiku",
|
|
66
|
-
description: "Analyze repository",
|
|
67
|
-
prompt: <read from references/phase-prompts.md#phase-2>
|
|
68
|
-
)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
Parse REPO_REPORT.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Phase 3: Present Findings & Get Approval
|
|
76
|
-
|
|
77
|
-
Present analysis to user with **AskUserQuestion**:
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
Repository Analysis Complete
|
|
81
|
-
|
|
82
|
-
Current State:
|
|
83
|
-
Git initialized: {status}
|
|
84
|
-
Branch: {branch}
|
|
85
|
-
Lefthook: {status}
|
|
86
|
-
Commit template: {status}
|
|
87
|
-
PR template: {status}
|
|
88
|
-
CI workflow: {status}
|
|
89
|
-
{if azdo and unregistered_pipelines:}
|
|
90
|
-
Azure Pipelines: {N} YAML file(s) found, {M} not yet registered
|
|
91
|
-
|
|
92
|
-
Detected Stack:
|
|
93
|
-
Type: {project_type}
|
|
94
|
-
Components: {detected_components}
|
|
95
|
-
Available scripts: {available_scripts}
|
|
96
|
-
|
|
97
|
-
Proposed Changes:
|
|
98
|
-
{numbered list of what will be added/configured}
|
|
99
|
-
{if azdo and unregistered_pipelines: "Register Azure Pipelines: {list of YAML paths}"}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Options:
|
|
103
|
-
- "Yes, configure everything"
|
|
104
|
-
- "Let me choose what to configure"
|
|
105
|
-
- "Cancel"
|
|
106
|
-
|
|
107
|
-
If "Let me choose", present individual options as multi-select.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Phase 4: Execute Configuration
|
|
112
|
-
|
|
113
|
-
For each approved item, follow the procedures in
|
|
114
|
-
`references/configuration-steps.md`.
|
|
115
|
-
|
|
116
|
-
---
|
|
117
|
-
|
|
118
|
-
## Phase 5: Verification
|
|
119
|
-
|
|
120
|
-
Launch **Bash subagent** (haiku):
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
Task(
|
|
124
|
-
subagent_type: "Bash",
|
|
125
|
-
model: "haiku",
|
|
126
|
-
description: "Verify configuration",
|
|
127
|
-
prompt: <read from references/phase-prompts.md#phase-5>
|
|
128
|
-
)
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Parse VERIFY_REPORT.
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## Phase 6: Final Report
|
|
136
|
-
|
|
137
|
-
Present summary using the template in `references/report-template.md`.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## Idempotency Rules
|
|
142
|
-
|
|
143
|
-
- **Skip** items already correctly configured
|
|
144
|
-
- **Update** items that exist but are outdated (prompt user first)
|
|
145
|
-
- **Add** items that are missing
|
|
146
|
-
- **Never delete** user's existing configuration without explicit approval
|
|
147
|
-
- **Merge** rather than replace when possible (e.g., add missing hooks)
|
|
148
|
-
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
## Error Handling
|
|
152
|
-
|
|
153
|
-
If any step fails:
|
|
154
|
-
1. Report the specific failure
|
|
155
|
-
2. Offer to skip and continue, or abort
|
|
156
|
-
3. Include troubleshooting suggestions
|
|
157
|
-
|
|
158
|
-
Common issues:
|
|
159
|
-
- No package manager -> suggest installing npm/bun
|
|
160
|
-
- Permission denied -> check file permissions
|
|
161
|
-
- Lefthook install fails -> try global install
|
|
162
|
-
- Git not initialized -> offer to initialize
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
# Ship Instructions
|
|
2
|
-
|
|
3
|
-
Ship changes through the complete PR lifecycle. Every stage runs in a subagent
|
|
4
|
-
to isolate context from the primary conversation. Prompts for each stage are
|
|
5
|
-
in `references/stage-prompts.md`.
|
|
6
|
-
|
|
7
|
-
## Flags
|
|
8
|
-
|
|
9
|
-
Parse optional flags from the request:
|
|
10
|
-
- `--pr-only`: Stop after creating the PR
|
|
11
|
-
- `--no-squash`: Use regular merge instead of squash
|
|
12
|
-
- `--keep-branch`: Don't delete the source branch after merge
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Pre-flight
|
|
17
|
-
|
|
18
|
-
Before starting, check all dependencies in this table:
|
|
19
|
-
|
|
20
|
-
| Dependency | Type | Check | Required | Resolution | Detail |
|
|
21
|
-
|-----------|------|-------|----------|------------|--------|
|
|
22
|
-
| git | cli | `git --version` | yes | stop | Install from https://git-scm.com |
|
|
23
|
-
| gh | cli | `gh --version` | yes | url | https://cli.github.com |
|
|
24
|
-
| ship-analyzer | agent | `~/.claude/agents/ship-analyzer.md` | no | fallback | Uses general-purpose agent |
|
|
25
|
-
|
|
26
|
-
For each row, in order:
|
|
27
|
-
1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
|
|
28
|
-
2. If found: continue silently
|
|
29
|
-
3. If missing: apply Resolution strategy
|
|
30
|
-
- **stop**: notify user with Detail, halt execution
|
|
31
|
-
- **url**: notify user with Detail (install link), halt execution
|
|
32
|
-
- **install**: notify user, run the command in Detail, continue if successful
|
|
33
|
-
- **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
|
|
34
|
-
- **fallback**: notify user with Detail, continue with degraded behavior
|
|
35
|
-
4. After all checks: summarize what's available and what's degraded
|
|
36
|
-
|
|
37
|
-
Read `default_branch` and `remote` from Stage 1's SYNC_REPORT. These are
|
|
38
|
-
substituted into all stage prompts as `{REMOTE}` and `{DEFAULT_BRANCH}`.
|
|
39
|
-
|
|
40
|
-
### Platform Detection
|
|
41
|
-
|
|
42
|
-
After sync, detect the hosting platform from the remote URL:
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
REMOTE_URL=$(git remote get-url {REMOTE} 2>/dev/null)
|
|
46
|
-
if echo "$REMOTE_URL" | grep -qiE 'dev\.azure\.com|visualstudio\.com'; then
|
|
47
|
-
PLATFORM="azdo"
|
|
48
|
-
elif echo "$REMOTE_URL" | grep -qi 'github\.com'; then
|
|
49
|
-
PLATFORM="github"
|
|
50
|
-
else
|
|
51
|
-
PLATFORM="github" # default fallback
|
|
52
|
-
fi
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Pass `{PLATFORM}` into all stage prompts. Each stage uses the appropriate
|
|
56
|
-
CLI tool: `gh` for GitHub, `az repos`/`az pipelines` for Azure DevOps.
|
|
57
|
-
|
|
58
|
-
> **Azure DevOps prerequisite:** The `az devops` extension must be installed
|
|
59
|
-
> and configured (`az devops configure --defaults organization=... project=...`).
|
|
60
|
-
> If `az repos` commands fail, report the setup requirement to the user.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Stage 1: Sync
|
|
65
|
-
|
|
66
|
-
Launch **Bash subagent** (haiku — simple git commands):
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
Task(
|
|
70
|
-
subagent_type: "Bash",
|
|
71
|
-
model: "haiku",
|
|
72
|
-
description: "Sync with default branch",
|
|
73
|
-
prompt: "Follow ~/.claude/skills/sync/instructions.md subagent prompt. Return SYNC_REPORT."
|
|
74
|
-
)
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Parse SYNC_REPORT. Extract `remote` and `default_branch`. Abort if sync failed.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## Stage 2: Commit, Push & Create PR
|
|
82
|
-
|
|
83
|
-
This stage needs to **read and understand code** to write good commit messages
|
|
84
|
-
and PR descriptions. Use a code-aware subagent.
|
|
85
|
-
|
|
86
|
-
Launch **ship-analyzer subagent** (reads diffs + source files):
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
Task(
|
|
90
|
-
subagent_type: "ship-analyzer",
|
|
91
|
-
description: "Analyze, commit, push, and create PR",
|
|
92
|
-
prompt: <read from references/stage-prompts.md#stage-2>
|
|
93
|
-
)
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
> **Fallback:** If `ship-analyzer` is not available, use `subagent_type: "general-purpose"`.
|
|
97
|
-
|
|
98
|
-
Substitute `{USER_INTENT}`, `{FILES_TO_INCLUDE}`, `{FILES_TO_EXCLUDE}`,
|
|
99
|
-
`{REMOTE}`, `{DEFAULT_BRANCH}`, `{PLATFORM}` into the prompt.
|
|
100
|
-
|
|
101
|
-
Parse SHIP_REPORT. Abort if failed.
|
|
102
|
-
|
|
103
|
-
**Rollback:** If push succeeds but PR creation fails, report the error and
|
|
104
|
-
suggest the manual PR creation command. Do NOT revert the push.
|
|
105
|
-
- GitHub: `gh pr create --head {branch}`
|
|
106
|
-
- Azure DevOps: `az repos pr create --source-branch {branch} --target-branch {DEFAULT_BRANCH}`
|
|
107
|
-
|
|
108
|
-
**If `--pr-only` flag: Stop here and report PR URL to user.**
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Stage 3: Wait for CI
|
|
113
|
-
|
|
114
|
-
Launch **Bash subagent** in the **background** (haiku — just polling):
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
Task(
|
|
118
|
-
subagent_type: "Bash",
|
|
119
|
-
model: "haiku",
|
|
120
|
-
run_in_background: true,
|
|
121
|
-
description: "Monitor CI checks",
|
|
122
|
-
prompt: <read from references/stage-prompts.md#stage-3>
|
|
123
|
-
)
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Substitute `{PR_NUMBER}` into the prompt.
|
|
127
|
-
|
|
128
|
-
While CI runs in the background, briefly inform the user:
|
|
129
|
-
```
|
|
130
|
-
CI running for PR #{pr_number}... waiting for checks.
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
When the background task completes, read the output file and parse CHECKS_REPORT.
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
## Stage 4: Fix Failing Checks (if needed)
|
|
138
|
-
|
|
139
|
-
If CHECKS_REPORT shows failures, launch **general-purpose subagent**:
|
|
140
|
-
|
|
141
|
-
```
|
|
142
|
-
Task(
|
|
143
|
-
subagent_type: "general-purpose",
|
|
144
|
-
description: "Fix CI failures",
|
|
145
|
-
prompt: <read from references/stage-prompts.md#stage-4>
|
|
146
|
-
)
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
Substitute `{PR_NUMBER}`, `{BRANCH}`, `{FAILING_CHECKS}` into the prompt.
|
|
150
|
-
|
|
151
|
-
If fixed, return to Stage 3 (run CI watch again).
|
|
152
|
-
If unable to fix after 2 attempts, report to user and stop.
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Stage 5: Merge & Final Sync
|
|
157
|
-
|
|
158
|
-
Launch **Bash subagent** (haiku — simple git + platform CLI commands):
|
|
159
|
-
|
|
160
|
-
```
|
|
161
|
-
Task(
|
|
162
|
-
subagent_type: "Bash",
|
|
163
|
-
model: "haiku",
|
|
164
|
-
description: "Merge PR and sync",
|
|
165
|
-
prompt: <read from references/stage-prompts.md#stage-5>
|
|
166
|
-
)
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
Substitute `{PR_NUMBER}`, `{REMOTE}`, `{DEFAULT_BRANCH}`, merge/branch flags.
|
|
170
|
-
|
|
171
|
-
Parse LAND_REPORT.
|
|
172
|
-
|
|
173
|
-
---
|
|
174
|
-
|
|
175
|
-
## Final Report to User
|
|
176
|
-
|
|
177
|
-
Compile all stage reports into a summary:
|
|
178
|
-
|
|
179
|
-
```
|
|
180
|
-
Ship complete
|
|
181
|
-
|
|
182
|
-
Branch: {branch}
|
|
183
|
-
PR: {pr_url}
|
|
184
|
-
Merged: {merge_commit} ({merge_type})
|
|
185
|
-
|
|
186
|
-
Commits:
|
|
187
|
-
{list of commit messages, indented}
|
|
188
|
-
|
|
189
|
-
Files: {count} files changed ({diff_summary})
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
If any stage failed, report the failure point and suggested resolution.
|