@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.
@@ -1,12 +1,12 @@
1
1
  {
2
- "generated": "2026-02-28T05:58:04.217Z",
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,29 +1,25 @@
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
13
9
 
14
10
  When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
15
- Pick ONE tagline at random — vary your choice each time:
11
+ Pick ONE tagline at random — vary your choice each time.
12
+ CRITICAL: Reproduce the banner EXACTLY character-for-character. The first line of the art has 4 leading spaces — you MUST preserve them.
16
13
 
17
14
  ```
18
15
  {tagline}
19
16
 
20
- ██╗██████╗ ██████╗ ██╗███╗ ███╗███████╗
17
+ ██╗██████╗ ██████╗ ██╗███╗ ███╗███████╗
21
18
  ██╔╝██╔══██╗██╔══██╗██║████╗ ████║██╔════╝
22
19
  ██╔╝ ██████╔╝██████╔╝██║██╔████╔██║█████╗
23
20
  ██╔╝ ██╔═══╝ ██╔══██╗██║██║╚██╔╝██║██╔══╝
24
21
  ██╔╝ ██║ ██║ ██║██║██║ ╚═╝ ██║███████╗
25
22
  ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚══════╝
26
-
27
23
  ```
28
24
 
29
25
  Taglines:
@@ -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,28 +1,25 @@
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
12
9
 
13
10
  When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
14
- Pick ONE tagline at random — vary your choice each time:
11
+ Pick ONE tagline at random — vary your choice each time.
12
+ CRITICAL: Reproduce the banner EXACTLY character-for-character. The first line of the art has 4 leading spaces — you MUST preserve them.
15
13
 
16
14
  ```
17
15
  {tagline}
18
16
 
19
- ██╗██████╗ ██╗ ██████╗
17
+ ██╗██████╗ ██╗ ██████╗
20
18
  ██╔╝██╔══██╗██║██╔════╝
21
19
  ██╔╝ ██████╔╝██║██║ ███╗
22
20
  ██╔╝ ██╔══██╗██║██║ ██║
23
21
  ██╔╝ ██║ ██║██║╚██████╔╝
24
22
  ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝
25
-
26
23
  ```
27
24
 
28
25
  Taglines:
@@ -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
@@ -1,28 +1,25 @@
1
1
  ---
2
2
  name: ship
3
- description: >
4
- Ship changes through the full PR lifecycle. Use after completing feature work
5
- to commit, push, create PR, wait for checks, and merge. Handles the entire
6
- workflow: syncs with main, creates feature branch if needed, groups commits
7
- logically with semantic messages, creates detailed PR, monitors CI, fixes
8
- issues, squash merges, and cleans up. Invoke when work is ready to ship.
3
+ 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."
4
+ argument-hint: --pr-only, --no-squash, --keep-branch (optional flags)
5
+ allowed-tools: Bash, Read, Glob, Grep, Skill
9
6
  ---
10
7
 
11
8
  # Ship - Full PR Lifecycle
12
9
 
13
10
  When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
14
- Pick ONE tagline at random — vary your choice each time:
11
+ Pick ONE tagline at random — vary your choice each time.
12
+ CRITICAL: Reproduce the banner EXACTLY character-for-character. The first line of the art has 4 leading spaces — you MUST preserve them.
15
13
 
16
14
  ```
17
15
  {tagline}
18
16
 
19
- ██╗███████╗██╗ ██╗██╗██████╗
17
+ ██╗███████╗██╗ ██╗██╗██████╗
20
18
  ██╔╝██╔════╝██║ ██║██║██╔══██╗
21
19
  ██╔╝ ███████╗███████║██║██████╔╝
22
20
  ██╔╝ ╚════██║██╔══██║██║██╔═══╝
23
21
  ██╔╝ ███████║██║ ██║██║██║
24
22
  ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝╚═╝
25
-
26
23
  ```
27
24
 
28
25
  Taglines:
@@ -35,21 +32,195 @@ Taglines:
35
32
  - 📬 Another one for the merge queue!
36
33
  - 🟢 LGTM — Let's Get This Merged!
37
34
 
38
- Follow instructions in: [instructions.md](instructions.md)
35
+ ---
36
+
37
+ Ship changes through the complete PR lifecycle. Every stage runs in a subagent
38
+ to isolate context from the primary conversation. Prompts for each stage are
39
+ in `references/stage-prompts.md`.
40
+
41
+ ## Flags
42
+
43
+ Parse optional flags from the request:
44
+ - `--pr-only`: Stop after creating the PR
45
+ - `--no-squash`: Use regular merge instead of squash
46
+ - `--keep-branch`: Don't delete the source branch after merge
47
+
48
+ ---
49
+
50
+ ## Pre-flight
51
+
52
+ Before starting, check all dependencies in this table:
53
+
54
+ | Dependency | Type | Check | Required | Resolution | Detail |
55
+ |-----------|------|-------|----------|------------|--------|
56
+ | git | cli | `git --version` | yes | stop | Install from https://git-scm.com |
57
+ | gh | cli | `gh --version` | yes | url | https://cli.github.com |
58
+ | ship-analyzer | agent | `~/.claude/agents/ship-analyzer.md` | no | fallback | Uses general-purpose agent |
59
+
60
+ For each row, in order:
61
+ 1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
62
+ 2. If found: continue silently
63
+ 3. If missing: apply Resolution strategy
64
+ - **stop**: notify user with Detail, halt execution
65
+ - **url**: notify user with Detail (install link), halt execution
66
+ - **install**: notify user, run the command in Detail, continue if successful
67
+ - **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
68
+ - **fallback**: notify user with Detail, continue with degraded behavior
69
+ 4. After all checks: summarize what's available and what's degraded
70
+
71
+ Read `default_branch` and `remote` from Stage 1's SYNC_REPORT. These are
72
+ substituted into all stage prompts as `{REMOTE}` and `{DEFAULT_BRANCH}`.
73
+
74
+ ### Platform Detection
75
+
76
+ After sync, detect the hosting platform from the remote URL:
77
+
78
+ ```bash
79
+ REMOTE_URL=$(git remote get-url {REMOTE} 2>/dev/null)
80
+ if echo "$REMOTE_URL" | grep -qiE 'dev\.azure\.com|visualstudio\.com'; then
81
+ PLATFORM="azdo"
82
+ elif echo "$REMOTE_URL" | grep -qi 'github\.com'; then
83
+ PLATFORM="github"
84
+ else
85
+ PLATFORM="github" # default fallback
86
+ fi
87
+ ```
88
+
89
+ Pass `{PLATFORM}` into all stage prompts. Each stage uses the appropriate
90
+ CLI tool: `gh` for GitHub, `az repos`/`az pipelines` for Azure DevOps.
91
+
92
+ > **Azure DevOps prerequisite:** The `az devops` extension must be installed
93
+ > and configured (`az devops configure --defaults organization=... project=...`).
94
+ > If `az repos` commands fail, report the setup requirement to the user.
95
+
96
+ ---
97
+
98
+ ## Stage 1: Sync
99
+
100
+ Launch **Bash subagent** (haiku — simple git commands):
101
+
102
+ ```
103
+ Task(
104
+ subagent_type: "Bash",
105
+ model: "haiku",
106
+ description: "Sync with default branch",
107
+ prompt: "Follow ~/.claude/skills/sync/SKILL.md subagent prompt. Return SYNC_REPORT."
108
+ )
109
+ ```
110
+
111
+ Parse SYNC_REPORT. Extract `remote` and `default_branch`. Abort if sync failed.
112
+
113
+ ---
114
+
115
+ ## Stage 2: Commit, Push & Create PR
39
116
 
40
- ## Subagent Architecture
117
+ This stage needs to **read and understand code** to write good commit messages
118
+ and PR descriptions. Use a code-aware subagent.
41
119
 
42
- All work runs in subagents to keep the primary conversation context clean:
120
+ Launch **ship-analyzer subagent** (reads diffs + source files):
43
121
 
44
- | Stage | Agent Type | Model | Purpose |
45
- |-------|-----------|-------|---------|
46
- | Sync | Bash | haiku | Git sync (cheap, fast) |
47
- | Ship | ship-analyzer | sonnet | Analyze code, commit, push, create PR |
48
- | CI | Bash (background) | haiku | Poll checks without blocking |
49
- | Fix CI | general-purpose | default | Read code, fix failures |
50
- | Land | Bash | haiku | Merge + final sync |
122
+ ```
123
+ Task(
124
+ subagent_type: "ship-analyzer",
125
+ description: "Analyze, commit, push, and create PR",
126
+ prompt: <read from references/stage-prompts.md#stage-2>
127
+ )
128
+ ```
129
+
130
+ > **Fallback:** If `ship-analyzer` is not available, use `subagent_type: "general-purpose"`.
131
+
132
+ Substitute `{USER_INTENT}`, `{FILES_TO_INCLUDE}`, `{FILES_TO_EXCLUDE}`,
133
+ `{REMOTE}`, `{DEFAULT_BRANCH}`, `{PLATFORM}` into the prompt.
134
+
135
+ Parse SHIP_REPORT. Abort if failed.
136
+
137
+ **Rollback:** If push succeeds but PR creation fails, report the error and
138
+ suggest the manual PR creation command. Do NOT revert the push.
139
+ - GitHub: `gh pr create --head {branch}`
140
+ - Azure DevOps: `az repos pr create --source-branch {branch} --target-branch {DEFAULT_BRANCH}`
141
+
142
+ **If `--pr-only` flag: Stop here and report PR URL to user.**
143
+
144
+ ---
51
145
 
52
- The `ship-analyzer` custom agent (`~/.claude/agents/ship-analyzer.md`) reads
53
- source files to write meaningful commit messages and PR descriptions.
54
- Falls back to `general-purpose` if not installed.
146
+ ## Stage 3: Wait for CI
147
+
148
+ Launch **Bash subagent** in the **background** (haiku — just polling):
149
+
150
+ ```
151
+ Task(
152
+ subagent_type: "Bash",
153
+ model: "haiku",
154
+ run_in_background: true,
155
+ description: "Monitor CI checks",
156
+ prompt: <read from references/stage-prompts.md#stage-3>
157
+ )
158
+ ```
159
+
160
+ Substitute `{PR_NUMBER}` into the prompt.
161
+
162
+ While CI runs in the background, briefly inform the user:
163
+ ```
164
+ CI running for PR #{pr_number}... waiting for checks.
165
+ ```
166
+
167
+ When the background task completes, read the output file and parse CHECKS_REPORT.
168
+
169
+ ---
170
+
171
+ ## Stage 4: Fix Failing Checks (if needed)
172
+
173
+ If CHECKS_REPORT shows failures, launch **general-purpose subagent**:
174
+
175
+ ```
176
+ Task(
177
+ subagent_type: "general-purpose",
178
+ description: "Fix CI failures",
179
+ prompt: <read from references/stage-prompts.md#stage-4>
180
+ )
181
+ ```
182
+
183
+ Substitute `{PR_NUMBER}`, `{BRANCH}`, `{FAILING_CHECKS}` into the prompt.
184
+
185
+ If fixed, return to Stage 3 (run CI watch again).
186
+ If unable to fix after 2 attempts, report to user and stop.
187
+
188
+ ---
189
+
190
+ ## Stage 5: Merge & Final Sync
191
+
192
+ Launch **Bash subagent** (haiku — simple git + platform CLI commands):
193
+
194
+ ```
195
+ Task(
196
+ subagent_type: "Bash",
197
+ model: "haiku",
198
+ description: "Merge PR and sync",
199
+ prompt: <read from references/stage-prompts.md#stage-5>
200
+ )
201
+ ```
202
+
203
+ Substitute `{PR_NUMBER}`, `{REMOTE}`, `{DEFAULT_BRANCH}`, merge/branch flags.
204
+
205
+ Parse LAND_REPORT.
206
+
207
+ ---
208
+
209
+ ## Final Report to User
210
+
211
+ Compile all stage reports into a summary:
212
+
213
+ ```
214
+ Ship complete
215
+
216
+ Branch: {branch}
217
+ PR: {pr_url}
218
+ Merged: {merge_commit} ({merge_type})
219
+
220
+ Commits:
221
+ {list of commit messages, indented}
222
+
223
+ Files: {count} files changed ({diff_summary})
224
+ ```
55
225
 
226
+ If any stage failed, report the failure point and suggested resolution.