@bradygaster/squad-cli 0.9.0 → 0.9.2-insider.5

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.
Files changed (213) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +10 -10
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/config.d.ts +12 -0
  6. package/dist/cli/commands/config.d.ts.map +1 -0
  7. package/dist/cli/commands/config.js +157 -0
  8. package/dist/cli/commands/config.js.map +1 -0
  9. package/dist/cli/commands/consult.d.ts.map +1 -1
  10. package/dist/cli/commands/consult.js +9 -4
  11. package/dist/cli/commands/consult.js.map +1 -1
  12. package/dist/cli/commands/copilot.d.ts.map +1 -1
  13. package/dist/cli/commands/copilot.js +8 -7
  14. package/dist/cli/commands/copilot.js.map +1 -1
  15. package/dist/cli/commands/doctor.d.ts.map +1 -1
  16. package/dist/cli/commands/doctor.js +50 -17
  17. package/dist/cli/commands/doctor.js.map +1 -1
  18. package/dist/cli/commands/economy.d.ts.map +1 -1
  19. package/dist/cli/commands/economy.js +3 -2
  20. package/dist/cli/commands/economy.js.map +1 -1
  21. package/dist/cli/commands/export.d.ts.map +1 -1
  22. package/dist/cli/commands/export.js +22 -16
  23. package/dist/cli/commands/export.js.map +1 -1
  24. package/dist/cli/commands/extract.d.ts.map +1 -1
  25. package/dist/cli/commands/extract.js +14 -10
  26. package/dist/cli/commands/extract.js.map +1 -1
  27. package/dist/cli/commands/import.d.ts.map +1 -1
  28. package/dist/cli/commands/import.js +21 -18
  29. package/dist/cli/commands/import.js.map +1 -1
  30. package/dist/cli/commands/init-remote.d.ts.map +1 -1
  31. package/dist/cli/commands/init-remote.js +7 -6
  32. package/dist/cli/commands/init-remote.js.map +1 -1
  33. package/dist/cli/commands/link.d.ts.map +1 -1
  34. package/dist/cli/commands/link.js +11 -10
  35. package/dist/cli/commands/link.js.map +1 -1
  36. package/dist/cli/commands/migrate.d.ts.map +1 -1
  37. package/dist/cli/commands/migrate.js +19 -18
  38. package/dist/cli/commands/migrate.js.map +1 -1
  39. package/dist/cli/commands/personal.d.ts.map +1 -1
  40. package/dist/cli/commands/personal.js +12 -20
  41. package/dist/cli/commands/personal.js.map +1 -1
  42. package/dist/cli/commands/plugin.d.ts.map +1 -1
  43. package/dist/cli/commands/plugin.js +8 -7
  44. package/dist/cli/commands/plugin.js.map +1 -1
  45. package/dist/cli/commands/rc.d.ts.map +1 -1
  46. package/dist/cli/commands/rc.js +19 -12
  47. package/dist/cli/commands/rc.js.map +1 -1
  48. package/dist/cli/commands/schedule.d.ts.map +1 -1
  49. package/dist/cli/commands/schedule.js +6 -5
  50. package/dist/cli/commands/schedule.js.map +1 -1
  51. package/dist/cli/commands/start.d.ts.map +1 -1
  52. package/dist/cli/commands/start.js +18 -11
  53. package/dist/cli/commands/start.js.map +1 -1
  54. package/dist/cli/commands/streams.d.ts.map +1 -1
  55. package/dist/cli/commands/streams.js +3 -2
  56. package/dist/cli/commands/streams.js.map +1 -1
  57. package/dist/cli/commands/upstream.d.ts.map +1 -1
  58. package/dist/cli/commands/upstream.js +23 -19
  59. package/dist/cli/commands/upstream.js.map +1 -1
  60. package/dist/cli/commands/watch/capabilities/board.d.ts +22 -0
  61. package/dist/cli/commands/watch/capabilities/board.d.ts.map +1 -0
  62. package/dist/cli/commands/watch/capabilities/board.js +121 -0
  63. package/dist/cli/commands/watch/capabilities/board.js.map +1 -0
  64. package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts +14 -0
  65. package/dist/cli/commands/watch/capabilities/decision-hygiene.d.ts.map +1 -0
  66. package/dist/cli/commands/watch/capabilities/decision-hygiene.js +72 -0
  67. package/dist/cli/commands/watch/capabilities/decision-hygiene.js.map +1 -0
  68. package/dist/cli/commands/watch/capabilities/execute.d.ts +33 -0
  69. package/dist/cli/commands/watch/capabilities/execute.d.ts.map +1 -0
  70. package/dist/cli/commands/watch/capabilities/execute.js +119 -0
  71. package/dist/cli/commands/watch/capabilities/execute.js.map +1 -0
  72. package/dist/cli/commands/watch/capabilities/index.d.ts +7 -0
  73. package/dist/cli/commands/watch/capabilities/index.d.ts.map +1 -0
  74. package/dist/cli/commands/watch/capabilities/index.js +28 -0
  75. package/dist/cli/commands/watch/capabilities/index.js.map +1 -0
  76. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts +14 -0
  77. package/dist/cli/commands/watch/capabilities/monitor-email.d.ts.map +1 -0
  78. package/dist/cli/commands/watch/capabilities/monitor-email.js +54 -0
  79. package/dist/cli/commands/watch/capabilities/monitor-email.js.map +1 -0
  80. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts +14 -0
  81. package/dist/cli/commands/watch/capabilities/monitor-teams.d.ts.map +1 -0
  82. package/dist/cli/commands/watch/capabilities/monitor-teams.js +55 -0
  83. package/dist/cli/commands/watch/capabilities/monitor-teams.js.map +1 -0
  84. package/dist/cli/commands/watch/capabilities/retro.d.ts +14 -0
  85. package/dist/cli/commands/watch/capabilities/retro.d.ts.map +1 -0
  86. package/dist/cli/commands/watch/capabilities/retro.js +81 -0
  87. package/dist/cli/commands/watch/capabilities/retro.js.map +1 -0
  88. package/dist/cli/commands/watch/capabilities/self-pull.d.ts +14 -0
  89. package/dist/cli/commands/watch/capabilities/self-pull.d.ts.map +1 -0
  90. package/dist/cli/commands/watch/capabilities/self-pull.js +33 -0
  91. package/dist/cli/commands/watch/capabilities/self-pull.js.map +1 -0
  92. package/dist/cli/commands/watch/capabilities/two-pass.d.ts +14 -0
  93. package/dist/cli/commands/watch/capabilities/two-pass.d.ts.map +1 -0
  94. package/dist/cli/commands/watch/capabilities/two-pass.js +66 -0
  95. package/dist/cli/commands/watch/capabilities/two-pass.js.map +1 -0
  96. package/dist/cli/commands/watch/capabilities/wave-dispatch.d.ts +14 -0
  97. package/dist/cli/commands/watch/capabilities/wave-dispatch.d.ts.map +1 -0
  98. package/dist/cli/commands/watch/capabilities/wave-dispatch.js +117 -0
  99. package/dist/cli/commands/watch/capabilities/wave-dispatch.js.map +1 -0
  100. package/dist/cli/commands/watch/config.d.ts +25 -0
  101. package/dist/cli/commands/watch/config.d.ts.map +1 -0
  102. package/dist/cli/commands/watch/config.js +82 -0
  103. package/dist/cli/commands/watch/config.js.map +1 -0
  104. package/dist/cli/commands/watch/index.d.ts +95 -0
  105. package/dist/cli/commands/watch/index.d.ts.map +1 -0
  106. package/dist/cli/commands/watch/index.js +704 -0
  107. package/dist/cli/commands/watch/index.js.map +1 -0
  108. package/dist/cli/commands/watch/registry.d.ts +19 -0
  109. package/dist/cli/commands/watch/registry.d.ts.map +1 -0
  110. package/dist/cli/commands/watch/registry.js +28 -0
  111. package/dist/cli/commands/watch/registry.js.map +1 -0
  112. package/dist/cli/commands/watch/types.d.ts +57 -0
  113. package/dist/cli/commands/watch/types.d.ts.map +1 -0
  114. package/dist/cli/commands/watch/types.js +8 -0
  115. package/dist/cli/commands/watch/types.js.map +1 -0
  116. package/dist/cli/core/cast.d.ts.map +1 -1
  117. package/dist/cli/core/cast.js +15 -19
  118. package/dist/cli/core/cast.js.map +1 -1
  119. package/dist/cli/core/detect-squad-dir.d.ts.map +1 -1
  120. package/dist/cli/core/detect-squad-dir.js +12 -10
  121. package/dist/cli/core/detect-squad-dir.js.map +1 -1
  122. package/dist/cli/core/email-scrub.d.ts.map +1 -1
  123. package/dist/cli/core/email-scrub.js +12 -11
  124. package/dist/cli/core/email-scrub.js.map +1 -1
  125. package/dist/cli/core/gh-cli.d.ts +13 -0
  126. package/dist/cli/core/gh-cli.d.ts.map +1 -1
  127. package/dist/cli/core/gh-cli.js +24 -0
  128. package/dist/cli/core/gh-cli.js.map +1 -1
  129. package/dist/cli/core/init.d.ts +2 -0
  130. package/dist/cli/core/init.d.ts.map +1 -1
  131. package/dist/cli/core/init.js +22 -5
  132. package/dist/cli/core/init.js.map +1 -1
  133. package/dist/cli/core/migrate-directory.d.ts.map +1 -1
  134. package/dist/cli/core/migrate-directory.js +14 -13
  135. package/dist/cli/core/migrate-directory.js.map +1 -1
  136. package/dist/cli/core/migrations.d.ts.map +1 -1
  137. package/dist/cli/core/migrations.js +22 -8
  138. package/dist/cli/core/migrations.js.map +1 -1
  139. package/dist/cli/core/nap.d.ts.map +1 -1
  140. package/dist/cli/core/nap.js +111 -49
  141. package/dist/cli/core/nap.js.map +1 -1
  142. package/dist/cli/core/project-type.d.ts.map +1 -1
  143. package/dist/cli/core/project-type.js +11 -10
  144. package/dist/cli/core/project-type.js.map +1 -1
  145. package/dist/cli/core/team-md.d.ts.map +1 -1
  146. package/dist/cli/core/team-md.js +9 -4
  147. package/dist/cli/core/team-md.js.map +1 -1
  148. package/dist/cli/core/templates.d.ts.map +1 -1
  149. package/dist/cli/core/templates.js +4 -3
  150. package/dist/cli/core/templates.js.map +1 -1
  151. package/dist/cli/core/upgrade.d.ts.map +1 -1
  152. package/dist/cli/core/upgrade.js +68 -55
  153. package/dist/cli/core/upgrade.js.map +1 -1
  154. package/dist/cli/core/version.d.ts.map +1 -1
  155. package/dist/cli/core/version.js +8 -7
  156. package/dist/cli/core/version.js.map +1 -1
  157. package/dist/cli/index.d.ts +1 -1
  158. package/dist/cli/index.d.ts.map +1 -1
  159. package/dist/cli/index.js +1 -1
  160. package/dist/cli/index.js.map +1 -1
  161. package/dist/cli/self-update.d.ts.map +1 -1
  162. package/dist/cli/self-update.js +7 -4
  163. package/dist/cli/self-update.js.map +1 -1
  164. package/dist/cli/shell/agent-name-parser.d.ts +16 -0
  165. package/dist/cli/shell/agent-name-parser.d.ts.map +1 -0
  166. package/dist/cli/shell/agent-name-parser.js +54 -0
  167. package/dist/cli/shell/agent-name-parser.js.map +1 -0
  168. package/dist/cli/shell/commands.d.ts.map +1 -1
  169. package/dist/cli/shell/commands.js +4 -3
  170. package/dist/cli/shell/commands.js.map +1 -1
  171. package/dist/cli/shell/coordinator.d.ts +4 -1
  172. package/dist/cli/shell/coordinator.d.ts.map +1 -1
  173. package/dist/cli/shell/coordinator.js +29 -26
  174. package/dist/cli/shell/coordinator.js.map +1 -1
  175. package/dist/cli/shell/index.d.ts.map +1 -1
  176. package/dist/cli/shell/index.js +33 -35
  177. package/dist/cli/shell/index.js.map +1 -1
  178. package/dist/cli/shell/lifecycle.d.ts +13 -2
  179. package/dist/cli/shell/lifecycle.d.ts.map +1 -1
  180. package/dist/cli/shell/lifecycle.js +26 -13
  181. package/dist/cli/shell/lifecycle.js.map +1 -1
  182. package/dist/cli/shell/session-store.d.ts.map +1 -1
  183. package/dist/cli/shell/session-store.js +16 -12
  184. package/dist/cli/shell/session-store.js.map +1 -1
  185. package/dist/cli/shell/spawn.d.ts +4 -1
  186. package/dist/cli/shell/spawn.d.ts.map +1 -1
  187. package/dist/cli/shell/spawn.js +28 -10
  188. package/dist/cli/shell/spawn.js.map +1 -1
  189. package/dist/cli-entry.js +83 -12
  190. package/dist/cli-entry.js.map +1 -1
  191. package/package.json +8 -4
  192. package/templates/scribe-charter.md +4 -0
  193. package/templates/skills/cross-machine-coordination/SKILL.md +434 -0
  194. package/templates/skills/error-recovery/SKILL.md +99 -0
  195. package/templates/skills/iterative-retrieval/SKILL.md +165 -0
  196. package/templates/skills/notification-routing/SKILL.md +105 -0
  197. package/templates/skills/pr-screenshots/SKILL.md +149 -0
  198. package/templates/skills/ralph-two-pass-scan/SKILL.md +35 -0
  199. package/templates/skills/reflect/SKILL.md +229 -0
  200. package/templates/skills/release-process/SKILL.md +84 -376
  201. package/templates/skills/retro-enforcement/SKILL.md +148 -0
  202. package/templates/skills/tiered-memory/SKILL.md +234 -0
  203. package/templates/skills/windows-compatibility/SKILL.md +24 -0
  204. package/templates/{squad.agent.md → squad.agent.md.template} +1316 -1287
  205. package/templates/workflows/squad-ci.yml +1 -1
  206. package/templates/workflows/squad-heartbeat.yml +0 -4
  207. package/templates/workflows/squad-insider-release.yml +1 -1
  208. package/templates/workflows/squad-preview.yml +1 -1
  209. package/templates/workflows/squad-release.yml +1 -1
  210. package/dist/cli/commands/watch.d.ts +0 -18
  211. package/dist/cli/commands/watch.d.ts.map +0 -1
  212. package/dist/cli/commands/watch.js +0 -306
  213. package/dist/cli/commands/watch.js.map +0 -1
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: "notification-routing"
3
+ description: "Route agent notifications to specific channels by type — prevent alert fatigue from single-channel flooding"
4
+ domain: "communication"
5
+ confidence: "high"
6
+ source: "earned"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ When a Squad grows beyond a few agents, notifications flood a single channel — failure alerts drown in daily
12
+ briefings, tech news buries security findings, and everything gets ignored. This is the pub-sub problem:
13
+ a single message queue for everything is a recipe for missed alerts.
14
+
15
+ The fix is **topic-based routing**: agents tag notifications with a channel type, and a routing function
16
+ sends them to the appropriate destination.
17
+
18
+ **Trigger symptoms:**
19
+ - Important alerts missed because they're buried in routine notifications
20
+ - Team members turning off notifications entirely (signal overwhelm)
21
+ - Onboarding friction: "where do I look for X?"
22
+
23
+ ## Patterns
24
+
25
+ ### Channel Config Schema
26
+
27
+ Define a `.squad/teams-channels.json` (or equivalent) mapping notification types to channel identifiers:
28
+
29
+ ```json
30
+ {
31
+ "teamId": "your-team-id",
32
+ "channels": {
33
+ "notifications": "squad-alerts",
34
+ "tech-news": "tech-news",
35
+ "security": "security-findings",
36
+ "releases": "release-announcements",
37
+ "daily-digest": "daily-digest"
38
+ }
39
+ }
40
+ ```
41
+
42
+ Place this in `.squad/` (git-tracked, shared across the team). For platforms that use channel IDs instead of
43
+ names (Teams, Slack), store the resolved ID alongside the name to avoid name-collision bugs:
44
+
45
+ ```json
46
+ {
47
+ "channels": {
48
+ "notifications": { "name": "squad-alerts", "id": "channel-id-opaque-string" }
49
+ }
50
+ }
51
+ ```
52
+
53
+ ### CHANNEL: Tag Convention
54
+
55
+ Agents prefix their output with `CHANNEL:<type>` to signal where the notification should go:
56
+
57
+ ```
58
+ CHANNEL:security
59
+ Worf found 3 new CVEs in dependency scan: lodash@4.17.15, minimist@1.2.5
60
+ ```
61
+
62
+ ### Routing Dispatcher (shell pseudocode)
63
+
64
+ ```bash
65
+ dispatch_notification() {
66
+ local raw_output="$1"
67
+ local channel="notifications" # default
68
+
69
+ if echo "$raw_output" | grep -qE '^CHANNEL:[a-z][a-z0-9-]*'; then
70
+ channel=$(echo "$raw_output" | head -1 | cut -d: -f2)
71
+ raw_output=$(echo "$raw_output" | tail -n +2)
72
+ fi
73
+
74
+ send_notification --channel "$channel" --message "$raw_output"
75
+ }
76
+ ```
77
+
78
+ ### Provider-Agnostic Adapter
79
+
80
+ The routing layer is provider-agnostic. Plug in your platform adapter:
81
+
82
+ ```
83
+ .squad/notify-adapter.sh # Teams / Slack / Discord / webhook -- swappable
84
+ ```
85
+
86
+ The routing config and CHANNEL: tags never change. Only the adapter changes per deployment.
87
+
88
+ ## Anti-Patterns
89
+
90
+ **Never send all notification types to one channel:**
91
+ ```
92
+ send_notification --channel "general" --message "$anything"
93
+ ```
94
+
95
+ **Never use display names as identifiers (name collision risk):**
96
+ ```
97
+ send_to_team --name "Squad" --channel "notifications"
98
+ ```
99
+
100
+ Resolve channel IDs once at setup. Use IDs at runtime.
101
+
102
+ ## Distributed Systems Pattern
103
+
104
+ This is **pub-sub with topic routing** -- the same principle as Kafka topics, RabbitMQ routing keys, and
105
+ AWS SNS topic filtering. Route by type. Each consumer subscribes to the topics it cares about.
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: "pr-screenshots"
3
+ description: "Capture Playwright screenshots and embed them in GitHub PR descriptions"
4
+ domain: "pull-requests, visual-review, docs, testing"
5
+ confidence: "high"
6
+ source: "earned (multiple sessions establishing the pattern for PR #11 TypeDoc API reference)"
7
+ ---
8
+
9
+ ## Context
10
+
11
+ When a PR includes visual changes (docs sites, UI components, generated pages), reviewers
12
+ need to see what the PR delivers without checking out the branch. Screenshots belong in
13
+ the **PR description body**, not as committed files and not as text descriptions.
14
+
15
+ Use this skill whenever:
16
+ - A PR touches docs site pages (Astro, Starlight, etc.)
17
+ - A PR adds or changes UI components
18
+ - A PR generates visual artifacts (TypeDoc, Storybook, diagrams)
19
+ - Playwright tests already capture screenshots as part of testing
20
+
21
+ ## Patterns
22
+
23
+ ### 1. Capture screenshots with Playwright
24
+
25
+ If Playwright tests already exist and produce screenshots, reuse those. Otherwise,
26
+ write a minimal capture script:
27
+
28
+ ```javascript
29
+ // scripts/capture-pr-screenshots.mjs
30
+ import { chromium } from 'playwright';
31
+
32
+ const browser = await chromium.launch();
33
+ const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
34
+
35
+ const screenshots = [
36
+ { url: 'http://localhost:4321/path/to/page', name: 'feature-landing' },
37
+ { url: 'http://localhost:4321/path/to/detail', name: 'feature-detail' },
38
+ ];
39
+
40
+ for (const { url, name } of screenshots) {
41
+ await page.goto(url, { waitUntil: 'networkidle' });
42
+ await page.screenshot({ path: `screenshots/${name}.png`, fullPage: false });
43
+ }
44
+
45
+ await browser.close();
46
+ ```
47
+
48
+ ### 2. Host screenshots on a temporary branch
49
+
50
+ GitHub PR descriptions render images via URLs. The `gh` CLI cannot upload binary
51
+ images directly. Use a temporary orphan branch to host the images:
52
+
53
+ ```powershell
54
+ # Save current branch
55
+ $currentBranch = git branch --show-current
56
+
57
+ # Create orphan branch with only screenshot files
58
+ git checkout --orphan screenshots-temp
59
+ git reset
60
+ git add screenshots/*.png
61
+ git commit -m "screenshots for PR review"
62
+ git push origin screenshots-temp --force
63
+
64
+ # Build raw URLs
65
+ $base = "https://raw.githubusercontent.com/{owner}/{repo}/screenshots-temp/screenshots"
66
+ # Each image: $base/{name}.png
67
+
68
+ # Return to working branch
69
+ git checkout -f $currentBranch
70
+ ```
71
+
72
+ ### 3. Embed in PR description
73
+
74
+ Use `gh pr edit` with the raw URLs embedded as markdown images:
75
+
76
+ ```powershell
77
+ $base = "https://raw.githubusercontent.com/{owner}/{repo}/screenshots-temp/screenshots"
78
+
79
+ gh pr edit {PR_NUMBER} --repo {owner}/{repo} --body @"
80
+ ## {PR Title}
81
+
82
+ ### What this PR delivers
83
+ - {bullet points of changes}
84
+
85
+ ---
86
+
87
+ ### Screenshots
88
+
89
+ #### {Page/Feature Name}
90
+ ![{alt text}]($base/{name}.png)
91
+
92
+ #### {Another Page}
93
+ ![{alt text}]($base/{another-name}.png)
94
+
95
+ ---
96
+
97
+ ### To verify locally
98
+ ```bash
99
+ {commands to run locally}
100
+ ```
101
+ "@
102
+ ```
103
+
104
+ ### 4. Cleanup after merge
105
+
106
+ After the PR is merged, delete the temporary branch:
107
+
108
+ ```bash
109
+ git push origin --delete screenshots-temp
110
+ ```
111
+
112
+ ### 5. Gitignore screenshots locally
113
+
114
+ Screenshots are build artifacts — never commit them to feature branches:
115
+
116
+ ```gitignore
117
+ # PR screenshots (hosted on temp branch, not committed to features)
118
+ screenshots/
119
+ docs/tests/screenshots/
120
+ ```
121
+
122
+ ## Examples
123
+
124
+ ### Example: Docs site PR with 3 pages
125
+
126
+ 1. Start dev server: `cd docs && npm run dev`
127
+ 2. Run Playwright tests (they capture screenshots as a side effect)
128
+ 3. Push screenshots to `screenshots-temp` branch
129
+ 4. Update PR body with embedded `![...]()` image references
130
+ 5. Reviewer sees the pages inline without checking out the branch
131
+
132
+ ### Example: Reusing existing Playwright test screenshots
133
+
134
+ If tests at `docs/tests/*.spec.mjs` already save to `docs/tests/screenshots/`:
135
+
136
+ ```powershell
137
+ cd docs && npx playwright test tests/api-reference.spec.mjs
138
+ # Screenshots now at docs/tests/screenshots/*.png
139
+ # Push those to screenshots-temp and embed in PR
140
+ ```
141
+
142
+ ## Anti-Patterns
143
+
144
+ - ❌ **Committing screenshots to feature branches** — they bloat the repo and go stale
145
+ - ❌ **Posting text descriptions instead of actual images** — reviewers can't see what they're getting
146
+ - ❌ **Using `gh` CLI to "upload" images** — `gh issue comment` and `gh pr edit` don't support binary uploads
147
+ - ❌ **Asking the user to manually drag-drop images** — automate it with the temp branch pattern
148
+ - ❌ **Skipping screenshots for visual PRs** — if the PR changes what users see, show what users see
149
+ - ❌ **Leaving the screenshots-temp branch around forever** — clean up after merge
@@ -0,0 +1,35 @@
1
+ # Skill: Ralph — Two-Pass Issue Scanning
2
+ **Confidence:** high
3
+ **Domain:** work-monitoring
4
+ **Last validated:** 2026-03-24
5
+
6
+ ## Context
7
+ Cuts GitHub API calls from N+1 to ~7 per round (~72% reduction) by separating list scanning from full hydration.
8
+ Addresses the scanning inefficiency described in issue #596.
9
+
10
+ ## Pattern
11
+
12
+ ### Pass 1 — Lightweight Scan
13
+
14
+ ```
15
+ gh issue list --state open --json number,title,labels,assignees --limit 100
16
+ ```
17
+
18
+ **Skip hydration if ANY of these match:**
19
+
20
+ | Condition | Skip reason |
21
+ |-----------|-------------|
22
+ | `assignees` non-empty AND no `status:needs-review` | Already owned |
23
+ | Labels contain `status:blocked` or `status:waiting-external` | Externally gated |
24
+ | Labels contain `status:done` or `status:postponed` | Closed loop |
25
+ | Title matches stale/noisy pattern (`[chore]`, `[auto]`) | Low-signal |
26
+
27
+ ### Pass 2 — Selective Hydration
28
+
29
+ For each issue surviving Pass 1:
30
+
31
+ ```
32
+ gh issue view <number> --json number,title,body,labels,assignees,comments,state
33
+ ```
34
+
35
+ Then apply normal Ralph triage logic. Rule of thumb: hydrate ≤ 30% of scanned list. If more than 30% survive Pass 1, tighten filter rules.
@@ -0,0 +1,229 @@
1
+ ---
2
+ name: reflect
3
+ description: Learning capture system that extracts HIGH/MED/LOW confidence patterns from conversations to prevent repeating mistakes. Use after user corrections ("no", "wrong"), praise ("perfect", "exactly"), or when discovering edge cases. Complements .squad/agents/{agent}/history.md and .squad/decisions.md.
4
+ license: MIT
5
+ version: 1.0.0-squad
6
+ domain: team-memory, learning
7
+ confidence: high
8
+ ---
9
+
10
+ # Reflect Skill
11
+
12
+ **Critical learning capture system** for Squad. Prevents repeating mistakes and preserves successful patterns across sessions.
13
+
14
+ Analyze conversations and propose improvements to squad knowledge based on what worked, what didn't, and edge cases discovered. **Every correction is a learning opportunity.**
15
+
16
+ ---
17
+
18
+ ## Integration with Squad Architecture
19
+
20
+ **Reflect complements existing Squad knowledge systems:**
21
+
22
+ 1. **`.squad/agents/{agent}/history.md`** — Permanent learnings from completed work (append-only; each agent updates their own file; Scribe propagates cross-agent updates)
23
+ 2. **`.squad/decisions.md`** — Team-wide decisions that all agents respect
24
+ 3. **`reflect` skill** — Captures in-flight learnings from conversations that may graduate to history.md or decisions.md
25
+
26
+ **Workflow:**
27
+ - Use `reflect` during work to capture learnings
28
+ - At session end, review captured learnings
29
+ - Promote HIGH confidence patterns → lead agent for decision.md review
30
+ - Promote agent-specific patterns → `{agent}/history.md` updates
31
+
32
+ ---
33
+
34
+ ## Triggers
35
+
36
+ ### 🔴 HIGH Priority (Invoke Immediately)
37
+
38
+ | Trigger | Example | Why Critical |
39
+ |---------|---------|--------------|
40
+ | User correction | "no", "wrong", "not like that", "never do" | Captures mistakes to prevent repetition |
41
+ | Architectural insight | "you removed that without understanding why" | Documents design decisions (Chesterton's Fence) |
42
+ | Immediate fixes | "debug", "root cause", "fix all" | Learns from errors in real-time |
43
+
44
+ ### 🟡 MEDIUM Priority (Invoke After Multiple)
45
+
46
+ | Trigger | Example | Why Important |
47
+ |---------|---------|---------------|
48
+ | User praise | "perfect", "exactly", "great" | Reinforces successful patterns |
49
+ | Tool preferences | "use X instead of Y", "prefer" | Builds workflow preferences |
50
+ | Edge cases | "what if X happens?", "don't forget", "ensure" | Captures scenarios to handle |
51
+
52
+ ### 🟢 LOW Priority (Invoke at Session End)
53
+
54
+ | Trigger | Example | Why Useful |
55
+ |---------|---------|------------|
56
+ | Repeated patterns | Frequent use of specific commands/tools | Identifies workflow preferences |
57
+ | Session end | After complex work | Consolidates all session learnings |
58
+
59
+ ---
60
+
61
+ ## Process
62
+
63
+ ### Phase 1: Identify Learning Target
64
+
65
+ Determine what knowledge system should be updated:
66
+
67
+ 1. **Agent-specific learning** → `.squad/agents/{agent}/history.md`
68
+ 2. **Team-wide decision** → `.squad/decisions/inbox/{agent}-{topic}.md`
69
+ 3. **Skill-specific improvement** → Document in session, recommend to skill owner
70
+
71
+ ### Phase 2: Analyze Conversation
72
+
73
+ Scan for learning signals with confidence levels:
74
+
75
+ #### HIGH Confidence: Corrections
76
+
77
+ User actively steered or corrected output.
78
+
79
+ **Detection patterns:**
80
+ - Explicit rejection: "no", "not like that", "that's wrong"
81
+ - Strong directives: "never do", "always do", "don't ever"
82
+ - User provided alternative implementation
83
+
84
+ **Example:**
85
+ ```text
86
+ User: "No, use the azure-devops MCP tool instead of raw API calls"
87
+ → [HIGH] + Add constraint: "Prefer azure-devops MCP tools over REST API"
88
+ ```
89
+
90
+ #### MEDIUM Confidence: Success Patterns
91
+
92
+ Output was accepted or praised.
93
+
94
+ **Detection patterns:**
95
+ - Explicit praise: "perfect", "great", "yes", "exactly"
96
+ - User built on output without modification
97
+ - Output was committed without changes
98
+
99
+ **Example:**
100
+ ```text
101
+ User: "Perfect, that's exactly what I needed"
102
+ → [MED] + Add preference: "Include usage examples in documentation"
103
+ ```
104
+
105
+ #### MEDIUM Confidence: Edge Cases
106
+
107
+ Scenarios not anticipated.
108
+
109
+ **Detection patterns:**
110
+ - Questions not answered
111
+ - Workarounds user had to apply
112
+ - Error handling gaps discovered
113
+
114
+ #### LOW Confidence: Preferences
115
+
116
+ Accumulated patterns over time.
117
+
118
+ ---
119
+
120
+ ### Phase 3: Propose Learnings
121
+
122
+ Present findings:
123
+
124
+ ```text
125
+ ┌─────────────────────────────────────────────────────────────┐
126
+ │ REFLECTION: {target (agent/decision/skill)} │
127
+ ├─────────────────────────────────────────────────────────────┤
128
+ │ │
129
+ │ [HIGH] + Add constraint: "{specific constraint}" │
130
+ │ Source: "{quoted user correction}" │
131
+ │ Target: .squad/decisions/inbox/{agent}-{topic}.md │
132
+ │ │
133
+ │ [MED] + Add preference: "{specific preference}" │
134
+ │ Source: "{evidence from conversation}" │
135
+ │ Target: .squad/agents/{agent}/history.md │
136
+ │ │
137
+ │ [LOW] ~ Note for review: "{observation}" │
138
+ │ Source: "{pattern observed}" │
139
+ │ Target: Session notes only │
140
+ │ │
141
+ ├─────────────────────────────────────────────────────────────┤
142
+ │ Apply changes? [Y/n/edit] │
143
+ └─────────────────────────────────────────────────────────────┘
144
+ ```
145
+
146
+ **Confidence Threshold:**
147
+
148
+ | Threshold | Action |
149
+ |-----------|--------|
150
+ | ≥1 HIGH signal | Always propose (user explicitly corrected) |
151
+ | ≥2 MED signals | Propose (sufficient pattern) |
152
+ | ≥3 LOW signals | Propose (accumulated evidence) |
153
+ | 1-2 LOW only | Skip (insufficient evidence) |
154
+
155
+ ### Phase 4: Persist Learnings
156
+
157
+ **ALWAYS show changes before applying.**
158
+
159
+ After user approval:
160
+
161
+ 1. **For Agent History:**
162
+ - Append to `.squad/agents/{agent}/history.md` under `## Learnings` section
163
+ - Format: Date, assignment context, key learning
164
+
165
+ 2. **For Team Decisions:**
166
+ - Create `.squad/decisions/inbox/{agent}-{topic}.md`
167
+ - Lead agent reviews and merges to `decisions.md` if appropriate
168
+
169
+ 3. **For Skills:**
170
+ - Document recommendation in session notes
171
+ - Squad lead reviews and routes to skill owner
172
+
173
+ ---
174
+
175
+ ## Usage Examples
176
+
177
+ ### Example 1: User Correction
178
+
179
+ **Conversation:**
180
+ ```
181
+ Agent: "I'll use grep to search the repository"
182
+ User: "No, use the code search tools first, grep is too slow"
183
+ ```
184
+
185
+ **Reflection Output:**
186
+ ```
187
+ [HIGH] + Add constraint: "Use code intelligence tools before grep"
188
+ Source: "No, use the code search tools first, grep is too slow"
189
+ Target: .squad/agents/{agent}/history.md
190
+ ```
191
+
192
+ ### Example 2: Success Pattern
193
+
194
+ **Conversation:**
195
+ ```
196
+ Agent: [Creates PR with detailed description and test plan]
197
+ User: "Perfect! This is exactly the format I want for all PRs"
198
+ ```
199
+
200
+ **Reflection Output:**
201
+ ```
202
+ [MED] + Add preference: "Include test plan in PR descriptions"
203
+ Source: User praised detailed PR format
204
+ Target: .squad/decisions/inbox/pr-format.md (for team adoption)
205
+ ```
206
+
207
+ ---
208
+
209
+ ## When to Use
210
+
211
+ ✅ **Use reflect when:**
212
+ - User says "no", "wrong", "not like that" (HIGH priority)
213
+ - User says "perfect", "exactly", "great" (MED priority)
214
+ - You discover edge cases or gaps
215
+ - Complex work session with multiple learnings
216
+ - At end of sprint/milestone to consolidate patterns
217
+
218
+ ❌ **Don't use reflect when:**
219
+ - Simple one-off questions with no pattern
220
+ - User is just exploring ideas (no concrete decisions)
221
+ - Learning is already captured in history.md/decisions.md
222
+
223
+ ---
224
+
225
+ ## See Also
226
+
227
+ - `.squad/decisions.md` — Team-wide decisions
228
+ - `.squad/agents/*/history.md` — Agent-specific learnings
229
+ - `.squad/routing.md` — Work assignment patterns