@bradygaster/squad-cli 0.8.25 → 0.9.1

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 (199) hide show
  1. package/README.md +329 -77
  2. package/dist/cli/commands/aspire.d.ts.map +1 -1
  3. package/dist/cli/commands/aspire.js +3 -0
  4. package/dist/cli/commands/aspire.js.map +1 -1
  5. package/dist/cli/commands/build.js +3 -3
  6. package/dist/cli/commands/build.js.map +1 -1
  7. package/dist/cli/commands/cast.d.ts +13 -0
  8. package/dist/cli/commands/cast.d.ts.map +1 -0
  9. package/dist/cli/commands/cast.js +77 -0
  10. package/dist/cli/commands/cast.js.map +1 -0
  11. package/dist/cli/commands/cost.d.ts +2 -0
  12. package/dist/cli/commands/cost.d.ts.map +1 -0
  13. package/dist/cli/commands/cost.js +170 -0
  14. package/dist/cli/commands/cost.js.map +1 -0
  15. package/dist/cli/commands/cross-squad.d.ts +12 -0
  16. package/dist/cli/commands/cross-squad.d.ts.map +1 -0
  17. package/dist/cli/commands/cross-squad.js +80 -0
  18. package/dist/cli/commands/cross-squad.js.map +1 -0
  19. package/dist/cli/commands/doctor.d.ts +5 -0
  20. package/dist/cli/commands/doctor.d.ts.map +1 -1
  21. package/dist/cli/commands/doctor.js +156 -0
  22. package/dist/cli/commands/doctor.js.map +1 -1
  23. package/dist/cli/commands/economy.d.ts +10 -0
  24. package/dist/cli/commands/economy.d.ts.map +1 -0
  25. package/dist/cli/commands/economy.js +64 -0
  26. package/dist/cli/commands/economy.js.map +1 -0
  27. package/dist/cli/commands/export.d.ts.map +1 -1
  28. package/dist/cli/commands/export.js +11 -4
  29. package/dist/cli/commands/export.js.map +1 -1
  30. package/dist/cli/commands/import.js +2 -2
  31. package/dist/cli/commands/import.js.map +1 -1
  32. package/dist/cli/commands/personal.d.ts +16 -0
  33. package/dist/cli/commands/personal.d.ts.map +1 -0
  34. package/dist/cli/commands/personal.js +213 -0
  35. package/dist/cli/commands/personal.js.map +1 -0
  36. package/dist/cli/commands/roles.d.ts +2 -0
  37. package/dist/cli/commands/roles.d.ts.map +1 -0
  38. package/dist/cli/commands/roles.js +54 -0
  39. package/dist/cli/commands/roles.js.map +1 -0
  40. package/dist/cli/commands/schedule.d.ts +14 -0
  41. package/dist/cli/commands/schedule.d.ts.map +1 -0
  42. package/dist/cli/commands/schedule.js +208 -0
  43. package/dist/cli/commands/schedule.js.map +1 -0
  44. package/dist/cli/commands/watch.d.ts.map +1 -1
  45. package/dist/cli/commands/watch.js +17 -5
  46. package/dist/cli/commands/watch.js.map +1 -1
  47. package/dist/cli/core/cast.d.ts +9 -0
  48. package/dist/cli/core/cast.d.ts.map +1 -1
  49. package/dist/cli/core/cast.js +170 -60
  50. package/dist/cli/core/cast.js.map +1 -1
  51. package/dist/cli/core/detect-squad-dir.d.ts +10 -0
  52. package/dist/cli/core/detect-squad-dir.d.ts.map +1 -1
  53. package/dist/cli/core/detect-squad-dir.js +47 -0
  54. package/dist/cli/core/detect-squad-dir.js.map +1 -1
  55. package/dist/cli/core/init.d.ts +8 -0
  56. package/dist/cli/core/init.d.ts.map +1 -1
  57. package/dist/cli/core/init.js +115 -2
  58. package/dist/cli/core/init.js.map +1 -1
  59. package/dist/cli/core/migrations.d.ts.map +1 -1
  60. package/dist/cli/core/migrations.js +21 -0
  61. package/dist/cli/core/migrations.js.map +1 -1
  62. package/dist/cli/core/team-md.js +34 -34
  63. package/dist/cli/core/templates.d.ts.map +1 -1
  64. package/dist/cli/core/templates.js +8 -1
  65. package/dist/cli/core/templates.js.map +1 -1
  66. package/dist/cli/core/upgrade.d.ts +14 -0
  67. package/dist/cli/core/upgrade.d.ts.map +1 -1
  68. package/dist/cli/core/upgrade.js +182 -48
  69. package/dist/cli/core/upgrade.js.map +1 -1
  70. package/dist/cli/core/version.js +2 -2
  71. package/dist/cli/core/version.js.map +1 -1
  72. package/dist/cli/index.d.ts +2 -0
  73. package/dist/cli/index.d.ts.map +1 -1
  74. package/dist/cli/index.js +2 -0
  75. package/dist/cli/index.js.map +1 -1
  76. package/dist/cli/self-update.d.ts +21 -0
  77. package/dist/cli/self-update.d.ts.map +1 -0
  78. package/dist/cli/self-update.js +113 -0
  79. package/dist/cli/self-update.js.map +1 -0
  80. package/dist/cli/shell/autocomplete.d.ts.map +1 -1
  81. package/dist/cli/shell/autocomplete.js +5 -0
  82. package/dist/cli/shell/autocomplete.js.map +1 -1
  83. package/dist/cli/shell/commands.d.ts.map +1 -1
  84. package/dist/cli/shell/commands.js +55 -24
  85. package/dist/cli/shell/commands.js.map +1 -1
  86. package/dist/cli/shell/components/AgentPanel.d.ts.map +1 -1
  87. package/dist/cli/shell/components/AgentPanel.js +21 -6
  88. package/dist/cli/shell/components/AgentPanel.js.map +1 -1
  89. package/dist/cli/shell/components/App.d.ts.map +1 -1
  90. package/dist/cli/shell/components/App.js +33 -15
  91. package/dist/cli/shell/components/App.js.map +1 -1
  92. package/dist/cli/shell/components/InputPrompt.js +1 -1
  93. package/dist/cli/shell/components/InputPrompt.js.map +1 -1
  94. package/dist/cli/shell/components/MessageStream.d.ts +2 -0
  95. package/dist/cli/shell/components/MessageStream.d.ts.map +1 -1
  96. package/dist/cli/shell/components/MessageStream.js +20 -20
  97. package/dist/cli/shell/components/MessageStream.js.map +1 -1
  98. package/dist/cli/shell/components/ThinkingIndicator.d.ts +4 -0
  99. package/dist/cli/shell/components/ThinkingIndicator.d.ts.map +1 -1
  100. package/dist/cli/shell/components/ThinkingIndicator.js +23 -4
  101. package/dist/cli/shell/components/ThinkingIndicator.js.map +1 -1
  102. package/dist/cli/shell/coordinator.d.ts +7 -0
  103. package/dist/cli/shell/coordinator.d.ts.map +1 -1
  104. package/dist/cli/shell/coordinator.js +206 -88
  105. package/dist/cli/shell/coordinator.js.map +1 -1
  106. package/dist/cli/shell/error-messages.d.ts +14 -0
  107. package/dist/cli/shell/error-messages.d.ts.map +1 -1
  108. package/dist/cli/shell/error-messages.js +65 -1
  109. package/dist/cli/shell/error-messages.js.map +1 -1
  110. package/dist/cli/shell/index.d.ts +1 -1
  111. package/dist/cli/shell/index.d.ts.map +1 -1
  112. package/dist/cli/shell/index.js +83 -12
  113. package/dist/cli/shell/index.js.map +1 -1
  114. package/dist/cli/shell/router.d.ts.map +1 -1
  115. package/dist/cli/shell/router.js +21 -2
  116. package/dist/cli/shell/router.js.map +1 -1
  117. package/dist/cli/shell/stream-bridge.d.ts +2 -0
  118. package/dist/cli/shell/stream-bridge.d.ts.map +1 -1
  119. package/dist/cli/shell/stream-bridge.js +11 -2
  120. package/dist/cli/shell/stream-bridge.js.map +1 -1
  121. package/dist/cli/shell/terminal.d.ts +5 -5
  122. package/dist/cli/shell/terminal.d.ts.map +1 -1
  123. package/dist/cli/shell/terminal.js +35 -26
  124. package/dist/cli/shell/terminal.js.map +1 -1
  125. package/dist/cli-entry.js +124 -42
  126. package/dist/cli-entry.js.map +1 -1
  127. package/package.json +20 -4
  128. package/scripts/patch-esm-imports.mjs +106 -77
  129. package/scripts/patch-ink-rendering.mjs +115 -0
  130. package/templates/casting/Futurama.json +10 -0
  131. package/templates/casting-history.json +4 -4
  132. package/templates/casting-policy.json +37 -35
  133. package/templates/casting-reference.md +104 -0
  134. package/templates/casting-registry.json +3 -3
  135. package/templates/ceremonies.md +41 -41
  136. package/templates/charter.md +53 -53
  137. package/templates/constraint-tracking.md +38 -38
  138. package/templates/cooperative-rate-limiting.md +229 -0
  139. package/templates/copilot-instructions.md +46 -46
  140. package/templates/history.md +10 -10
  141. package/templates/identity/now.md +9 -9
  142. package/templates/identity/wisdom.md +15 -15
  143. package/templates/issue-lifecycle.md +412 -0
  144. package/templates/keda-scaler.md +164 -0
  145. package/templates/machine-capabilities.md +75 -0
  146. package/templates/mcp-config.md +90 -90
  147. package/templates/multi-agent-format.md +28 -28
  148. package/templates/orchestration-log.md +27 -27
  149. package/templates/plugin-marketplace.md +49 -49
  150. package/templates/ralph-circuit-breaker.md +313 -0
  151. package/templates/raw-agent-output.md +37 -37
  152. package/templates/roster.md +60 -60
  153. package/templates/routing.md +39 -54
  154. package/templates/run-output.md +50 -50
  155. package/templates/scribe-charter.md +119 -119
  156. package/templates/skill.md +24 -24
  157. package/templates/skills/agent-collaboration/SKILL.md +42 -0
  158. package/templates/skills/agent-conduct/SKILL.md +24 -0
  159. package/templates/skills/architectural-proposals/SKILL.md +151 -0
  160. package/templates/skills/ci-validation-gates/SKILL.md +84 -0
  161. package/templates/skills/cli-wiring/SKILL.md +47 -0
  162. package/templates/skills/client-compatibility/SKILL.md +89 -0
  163. package/templates/skills/cross-squad/SKILL.md +114 -0
  164. package/templates/skills/distributed-mesh/SKILL.md +287 -0
  165. package/templates/skills/distributed-mesh/mesh.json.example +30 -0
  166. package/templates/skills/distributed-mesh/sync-mesh.ps1 +111 -0
  167. package/templates/skills/distributed-mesh/sync-mesh.sh +104 -0
  168. package/templates/skills/docs-standards/SKILL.md +71 -0
  169. package/templates/skills/economy-mode/SKILL.md +114 -0
  170. package/templates/skills/external-comms/SKILL.md +329 -0
  171. package/templates/skills/gh-auth-isolation/SKILL.md +183 -0
  172. package/templates/skills/git-workflow/SKILL.md +204 -0
  173. package/templates/skills/github-multi-account/SKILL.md +95 -0
  174. package/templates/skills/history-hygiene/SKILL.md +36 -0
  175. package/templates/skills/humanizer/SKILL.md +105 -0
  176. package/templates/skills/init-mode/SKILL.md +102 -0
  177. package/templates/skills/model-selection/SKILL.md +117 -0
  178. package/templates/skills/nap/SKILL.md +24 -0
  179. package/templates/skills/personal-squad/SKILL.md +57 -0
  180. package/templates/skills/release-process/SKILL.md +423 -0
  181. package/templates/skills/reskill/SKILL.md +92 -0
  182. package/templates/skills/reviewer-protocol/SKILL.md +79 -0
  183. package/templates/skills/secret-handling/SKILL.md +200 -0
  184. package/templates/skills/session-recovery/SKILL.md +155 -0
  185. package/templates/skills/squad-conventions/SKILL.md +69 -69
  186. package/templates/skills/test-discipline/SKILL.md +37 -0
  187. package/templates/skills/windows-compatibility/SKILL.md +74 -0
  188. package/templates/squad.agent.md +1287 -1146
  189. package/templates/workflows/squad-ci.yml +24 -24
  190. package/templates/workflows/squad-docs.yml +54 -50
  191. package/templates/workflows/squad-heartbeat.yml +3 -4
  192. package/templates/workflows/squad-insider-release.yml +61 -61
  193. package/templates/workflows/squad-issue-assign.yml +161 -161
  194. package/templates/workflows/squad-label-enforce.yml +181 -181
  195. package/templates/workflows/squad-preview.yml +55 -55
  196. package/templates/workflows/squad-promote.yml +120 -120
  197. package/templates/workflows/squad-release.yml +77 -77
  198. package/templates/workflows/squad-triage.yml +260 -260
  199. package/templates/workflows/sync-squad-labels.yml +169 -169
@@ -1,24 +1,24 @@
1
- name: Squad CI
2
-
3
- on:
4
- pull_request:
5
- branches: [dev, preview, main, insider]
6
- types: [opened, synchronize, reopened]
7
- push:
8
- branches: [dev, insider]
9
-
10
- permissions:
11
- contents: read
12
-
13
- jobs:
14
- test:
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - uses: actions/setup-node@v4
20
- with:
21
- node-version: 22
22
-
23
- - name: Run tests
24
- run: node --test test/*.test.js
1
+ name: Squad CI
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [dev, preview, main, insider]
6
+ types: [opened, synchronize, reopened]
7
+ push:
8
+ branches: [dev, insider]
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: actions/setup-node@v4
20
+ with:
21
+ node-version: 22
22
+
23
+ - name: Run tests
24
+ run: node --test test/*.test.js
@@ -1,50 +1,54 @@
1
- name: Squad Docs — Build & Deploy
2
-
3
- on:
4
- workflow_dispatch:
5
- push:
6
- branches: [preview]
7
- paths:
8
- - 'docs/**'
9
- - '.github/workflows/squad-docs.yml'
10
-
11
- permissions:
12
- contents: read
13
- pages: write
14
- id-token: write
15
-
16
- concurrency:
17
- group: pages
18
- cancel-in-progress: true
19
-
20
- jobs:
21
- build:
22
- runs-on: ubuntu-latest
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- - uses: actions/setup-node@v4
27
- with:
28
- node-version: '22'
29
-
30
- - name: Install build dependencies
31
- run: npm install --no-save markdown-it markdown-it-anchor
32
-
33
- - name: Build docs site
34
- run: node docs/build.js --out _site --base /squad
35
-
36
- - name: Upload Pages artifact
37
- uses: actions/upload-pages-artifact@v3
38
- with:
39
- path: _site
40
-
41
- deploy:
42
- needs: build
43
- runs-on: ubuntu-latest
44
- environment:
45
- name: github-pages
46
- url: ${{ steps.deployment.outputs.page_url }}
47
- steps:
48
- - name: Deploy to GitHub Pages
49
- id: deployment
50
- uses: actions/deploy-pages@v4
1
+ name: Squad Docs — Build & Deploy
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ push:
6
+ branches: [preview]
7
+ paths:
8
+ - 'docs/**'
9
+ - '.github/workflows/squad-docs.yml'
10
+
11
+ permissions:
12
+ contents: read
13
+ pages: write
14
+ id-token: write
15
+
16
+ concurrency:
17
+ group: pages
18
+ cancel-in-progress: true
19
+
20
+ jobs:
21
+ build:
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - uses: actions/setup-node@v4
27
+ with:
28
+ node-version: '22'
29
+ cache: npm
30
+ cache-dependency-path: docs/package-lock.json
31
+
32
+ - name: Install docs dependencies
33
+ working-directory: docs
34
+ run: npm ci
35
+
36
+ - name: Build docs site
37
+ working-directory: docs
38
+ run: npm run build
39
+
40
+ - name: Upload Pages artifact
41
+ uses: actions/upload-pages-artifact@v3
42
+ with:
43
+ path: docs/dist
44
+
45
+ deploy:
46
+ needs: build
47
+ runs-on: ubuntu-latest
48
+ environment:
49
+ name: github-pages
50
+ url: ${{ steps.deployment.outputs.page_url }}
51
+ steps:
52
+ - name: Deploy to GitHub Pages
53
+ id: deployment
54
+ uses: actions/deploy-pages@v4
@@ -7,10 +7,9 @@ name: Squad Heartbeat (Ralph)
7
7
  # Run 'squad upgrade' to sync installed copies from source templates.
8
8
 
9
9
  on:
10
- # DISABLED: Cron heartbeat commented out pre-migration — re-enable when ready
11
- # schedule:
12
- # # Every 30 minutes adjust or remove if not needed
13
- # - cron: '*/30 * * * *'
10
+ schedule:
11
+ # Every 30 minutes — adjust via cron expression as needed
12
+ - cron: '*/30 * * * *'
14
13
 
15
14
  # React to completed work or new squad work
16
15
  issues:
@@ -1,61 +1,61 @@
1
- name: Squad Insider Release
2
-
3
- on:
4
- push:
5
- branches: [insider]
6
-
7
- permissions:
8
- contents: write
9
-
10
- jobs:
11
- release:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- with:
16
- fetch-depth: 0
17
-
18
- - uses: actions/setup-node@v4
19
- with:
20
- node-version: 22
21
-
22
- - name: Run tests
23
- run: node --test test/*.test.js
24
-
25
- - name: Read version from package.json
26
- id: version
27
- run: |
28
- VERSION=$(node -e "console.log(require('./package.json').version)")
29
- SHORT_SHA=$(git rev-parse --short HEAD)
30
- INSIDER_VERSION="${VERSION}-insider+${SHORT_SHA}"
31
- INSIDER_TAG="v${INSIDER_VERSION}"
32
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33
- echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
34
- echo "insider_version=$INSIDER_VERSION" >> "$GITHUB_OUTPUT"
35
- echo "insider_tag=$INSIDER_TAG" >> "$GITHUB_OUTPUT"
36
- echo "📦 Base Version: $VERSION (Short SHA: $SHORT_SHA)"
37
- echo "🏷️ Insider Version: $INSIDER_VERSION"
38
- echo "🔖 Insider Tag: $INSIDER_TAG"
39
-
40
- - name: Create git tag
41
- run: |
42
- git config user.name "github-actions[bot]"
43
- git config user.email "github-actions[bot]@users.noreply.github.com"
44
- git tag -a "${{ steps.version.outputs.insider_tag }}" -m "Insider Release ${{ steps.version.outputs.insider_tag }}"
45
- git push origin "${{ steps.version.outputs.insider_tag }}"
46
-
47
- - name: Create GitHub Release
48
- env:
49
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
- run: |
51
- gh release create "${{ steps.version.outputs.insider_tag }}" \
52
- --title "${{ steps.version.outputs.insider_tag }}" \
53
- --notes "This is an insider/development build of Squad. Install with:\`\`\`bash\nnpm install -g @bradygaster/squad-cli@${{ steps.version.outputs.insider_tag }}\n\`\`\`\n\n**Note:** Insider builds may be unstable and are intended for early adopters and testing only." \
54
- --prerelease
55
-
56
- - name: Verify release
57
- env:
58
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59
- run: |
60
- gh release view "${{ steps.version.outputs.insider_tag }}"
61
- echo "✅ Insider Release ${{ steps.version.outputs.insider_tag }} created and verified."
1
+ name: Squad Insider Release
2
+
3
+ on:
4
+ push:
5
+ branches: [insider]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ release:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 22
21
+
22
+ - name: Run tests
23
+ run: node --test test/*.test.js
24
+
25
+ - name: Read version from package.json
26
+ id: version
27
+ run: |
28
+ VERSION=$(node -e "console.log(require('./package.json').version)")
29
+ SHORT_SHA=$(git rev-parse --short HEAD)
30
+ INSIDER_VERSION="${VERSION}-insider+${SHORT_SHA}"
31
+ INSIDER_TAG="v${INSIDER_VERSION}"
32
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
33
+ echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
34
+ echo "insider_version=$INSIDER_VERSION" >> "$GITHUB_OUTPUT"
35
+ echo "insider_tag=$INSIDER_TAG" >> "$GITHUB_OUTPUT"
36
+ echo "📦 Base Version: $VERSION (Short SHA: $SHORT_SHA)"
37
+ echo "🏷️ Insider Version: $INSIDER_VERSION"
38
+ echo "🔖 Insider Tag: $INSIDER_TAG"
39
+
40
+ - name: Create git tag
41
+ run: |
42
+ git config user.name "github-actions[bot]"
43
+ git config user.email "github-actions[bot]@users.noreply.github.com"
44
+ git tag -a "${{ steps.version.outputs.insider_tag }}" -m "Insider Release ${{ steps.version.outputs.insider_tag }}"
45
+ git push origin "${{ steps.version.outputs.insider_tag }}"
46
+
47
+ - name: Create GitHub Release
48
+ env:
49
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50
+ run: |
51
+ gh release create "${{ steps.version.outputs.insider_tag }}" \
52
+ --title "${{ steps.version.outputs.insider_tag }}" \
53
+ --notes "This is an insider/development build of Squad. Install with:\`\`\`bash\nnpm install -g @bradygaster/squad-cli@${{ steps.version.outputs.insider_tag }}\n\`\`\`\n\n**Note:** Insider builds may be unstable and are intended for early adopters and testing only." \
54
+ --prerelease
55
+
56
+ - name: Verify release
57
+ env:
58
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59
+ run: |
60
+ gh release view "${{ steps.version.outputs.insider_tag }}"
61
+ echo "✅ Insider Release ${{ steps.version.outputs.insider_tag }} created and verified."
@@ -1,161 +1,161 @@
1
- name: Squad Issue Assign
2
-
3
- on:
4
- issues:
5
- types: [labeled]
6
-
7
- permissions:
8
- issues: write
9
- contents: read
10
-
11
- jobs:
12
- assign-work:
13
- # Only trigger on squad:{member} labels (not the base "squad" label)
14
- if: startsWith(github.event.label.name, 'squad:')
15
- runs-on: ubuntu-latest
16
- steps:
17
- - uses: actions/checkout@v4
18
-
19
- - name: Identify assigned member and trigger work
20
- uses: actions/github-script@v7
21
- with:
22
- script: |
23
- const fs = require('fs');
24
- const issue = context.payload.issue;
25
- const label = context.payload.label.name;
26
-
27
- // Extract member name from label (e.g., "squad:ripley" → "ripley")
28
- const memberName = label.replace('squad:', '').toLowerCase();
29
-
30
- // Read team roster — check .squad/ first, fall back to .ai-team/
31
- let teamFile = '.squad/team.md';
32
- if (!fs.existsSync(teamFile)) {
33
- teamFile = '.ai-team/team.md';
34
- }
35
- if (!fs.existsSync(teamFile)) {
36
- core.warning('No .squad/team.md or .ai-team/team.md found — cannot assign work');
37
- return;
38
- }
39
-
40
- const content = fs.readFileSync(teamFile, 'utf8');
41
- const lines = content.split('\n');
42
-
43
- // Check if this is a coding agent assignment
44
- const isCopilotAssignment = memberName === 'copilot';
45
-
46
- let assignedMember = null;
47
- if (isCopilotAssignment) {
48
- assignedMember = { name: '@copilot', role: 'Coding Agent' };
49
- } else {
50
- let inMembersTable = false;
51
- for (const line of lines) {
52
- if (line.match(/^##\s+(Members|Team Roster)/i)) {
53
- inMembersTable = true;
54
- continue;
55
- }
56
- if (inMembersTable && line.startsWith('## ')) {
57
- break;
58
- }
59
- if (inMembersTable && line.startsWith('|') && !line.includes('---') && !line.includes('Name')) {
60
- const cells = line.split('|').map(c => c.trim()).filter(Boolean);
61
- if (cells.length >= 2 && cells[0].toLowerCase() === memberName) {
62
- assignedMember = { name: cells[0], role: cells[1] };
63
- break;
64
- }
65
- }
66
- }
67
- }
68
-
69
- if (!assignedMember) {
70
- core.warning(`No member found matching label "${label}"`);
71
- await github.rest.issues.createComment({
72
- owner: context.repo.owner,
73
- repo: context.repo.repo,
74
- issue_number: issue.number,
75
- body: `⚠️ No squad member found matching label \`${label}\`. Check \`.squad/team.md\` (or \`.ai-team/team.md\`) for valid member names.`
76
- });
77
- return;
78
- }
79
-
80
- // Post assignment acknowledgment
81
- let comment;
82
- if (isCopilotAssignment) {
83
- comment = [
84
- `### 🤖 Routed to @copilot (Coding Agent)`,
85
- '',
86
- `**Issue:** #${issue.number} — ${issue.title}`,
87
- '',
88
- `@copilot has been assigned and will pick this up automatically.`,
89
- '',
90
- `> The coding agent will create a \`copilot/*\` branch and open a draft PR.`,
91
- `> Review the PR as you would any team member's work.`,
92
- ].join('\n');
93
- } else {
94
- comment = [
95
- `### 📋 Assigned to ${assignedMember.name} (${assignedMember.role})`,
96
- '',
97
- `**Issue:** #${issue.number} — ${issue.title}`,
98
- '',
99
- `${assignedMember.name} will pick this up in the next Copilot session.`,
100
- '',
101
- `> **For Copilot coding agent:** If enabled, this issue will be worked automatically.`,
102
- `> Otherwise, start a Copilot session and say:`,
103
- `> \`${assignedMember.name}, work on issue #${issue.number}\``,
104
- ].join('\n');
105
- }
106
-
107
- await github.rest.issues.createComment({
108
- owner: context.repo.owner,
109
- repo: context.repo.repo,
110
- issue_number: issue.number,
111
- body: comment
112
- });
113
-
114
- core.info(`Issue #${issue.number} assigned to ${assignedMember.name} (${assignedMember.role})`);
115
-
116
- # Separate step: assign @copilot using PAT (required for coding agent)
117
- - name: Assign @copilot coding agent
118
- if: github.event.label.name == 'squad:copilot'
119
- uses: actions/github-script@v7
120
- with:
121
- github-token: ${{ secrets.COPILOT_ASSIGN_TOKEN }}
122
- script: |
123
- const owner = context.repo.owner;
124
- const repo = context.repo.repo;
125
- const issue_number = context.payload.issue.number;
126
-
127
- // Get the default branch name (main, master, etc.)
128
- const { data: repoData } = await github.rest.repos.get({ owner, repo });
129
- const baseBranch = repoData.default_branch;
130
-
131
- try {
132
- await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/assignees', {
133
- owner,
134
- repo,
135
- issue_number,
136
- assignees: ['copilot-swe-agent[bot]'],
137
- agent_assignment: {
138
- target_repo: `${owner}/${repo}`,
139
- base_branch: baseBranch,
140
- custom_instructions: '',
141
- custom_agent: '',
142
- model: ''
143
- },
144
- headers: {
145
- 'X-GitHub-Api-Version': '2022-11-28'
146
- }
147
- });
148
- core.info(`Assigned copilot-swe-agent to issue #${issue_number} (base: ${baseBranch})`);
149
- } catch (err) {
150
- core.warning(`Assignment with agent_assignment failed: ${err.message}`);
151
- // Fallback: try without agent_assignment
152
- try {
153
- await github.rest.issues.addAssignees({
154
- owner, repo, issue_number,
155
- assignees: ['copilot-swe-agent']
156
- });
157
- core.info(`Fallback assigned copilot-swe-agent to issue #${issue_number}`);
158
- } catch (err2) {
159
- core.warning(`Fallback also failed: ${err2.message}`);
160
- }
161
- }
1
+ name: Squad Issue Assign
2
+
3
+ on:
4
+ issues:
5
+ types: [labeled]
6
+
7
+ permissions:
8
+ issues: write
9
+ contents: read
10
+
11
+ jobs:
12
+ assign-work:
13
+ # Only trigger on squad:{member} labels (not the base "squad" label)
14
+ if: startsWith(github.event.label.name, 'squad:')
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Identify assigned member and trigger work
20
+ uses: actions/github-script@v7
21
+ with:
22
+ script: |
23
+ const fs = require('fs');
24
+ const issue = context.payload.issue;
25
+ const label = context.payload.label.name;
26
+
27
+ // Extract member name from label (e.g., "squad:ripley" → "ripley")
28
+ const memberName = label.replace('squad:', '').toLowerCase();
29
+
30
+ // Read team roster — check .squad/ first, fall back to .ai-team/
31
+ let teamFile = '.squad/team.md';
32
+ if (!fs.existsSync(teamFile)) {
33
+ teamFile = '.ai-team/team.md';
34
+ }
35
+ if (!fs.existsSync(teamFile)) {
36
+ core.warning('No .squad/team.md or .ai-team/team.md found — cannot assign work');
37
+ return;
38
+ }
39
+
40
+ const content = fs.readFileSync(teamFile, 'utf8');
41
+ const lines = content.split('\n');
42
+
43
+ // Check if this is a coding agent assignment
44
+ const isCopilotAssignment = memberName === 'copilot';
45
+
46
+ let assignedMember = null;
47
+ if (isCopilotAssignment) {
48
+ assignedMember = { name: '@copilot', role: 'Coding Agent' };
49
+ } else {
50
+ let inMembersTable = false;
51
+ for (const line of lines) {
52
+ if (line.match(/^##\s+(Members|Team Roster)/i)) {
53
+ inMembersTable = true;
54
+ continue;
55
+ }
56
+ if (inMembersTable && line.startsWith('## ')) {
57
+ break;
58
+ }
59
+ if (inMembersTable && line.startsWith('|') && !line.includes('---') && !line.includes('Name')) {
60
+ const cells = line.split('|').map(c => c.trim()).filter(Boolean);
61
+ if (cells.length >= 2 && cells[0].toLowerCase() === memberName) {
62
+ assignedMember = { name: cells[0], role: cells[1] };
63
+ break;
64
+ }
65
+ }
66
+ }
67
+ }
68
+
69
+ if (!assignedMember) {
70
+ core.warning(`No member found matching label "${label}"`);
71
+ await github.rest.issues.createComment({
72
+ owner: context.repo.owner,
73
+ repo: context.repo.repo,
74
+ issue_number: issue.number,
75
+ body: `⚠️ No squad member found matching label \`${label}\`. Check \`.squad/team.md\` (or \`.ai-team/team.md\`) for valid member names.`
76
+ });
77
+ return;
78
+ }
79
+
80
+ // Post assignment acknowledgment
81
+ let comment;
82
+ if (isCopilotAssignment) {
83
+ comment = [
84
+ `### 🤖 Routed to @copilot (Coding Agent)`,
85
+ '',
86
+ `**Issue:** #${issue.number} — ${issue.title}`,
87
+ '',
88
+ `@copilot has been assigned and will pick this up automatically.`,
89
+ '',
90
+ `> The coding agent will create a \`copilot/*\` branch and open a draft PR.`,
91
+ `> Review the PR as you would any team member's work.`,
92
+ ].join('\n');
93
+ } else {
94
+ comment = [
95
+ `### 📋 Assigned to ${assignedMember.name} (${assignedMember.role})`,
96
+ '',
97
+ `**Issue:** #${issue.number} — ${issue.title}`,
98
+ '',
99
+ `${assignedMember.name} will pick this up in the next Copilot session.`,
100
+ '',
101
+ `> **For Copilot coding agent:** If enabled, this issue will be worked automatically.`,
102
+ `> Otherwise, start a Copilot session and say:`,
103
+ `> \`${assignedMember.name}, work on issue #${issue.number}\``,
104
+ ].join('\n');
105
+ }
106
+
107
+ await github.rest.issues.createComment({
108
+ owner: context.repo.owner,
109
+ repo: context.repo.repo,
110
+ issue_number: issue.number,
111
+ body: comment
112
+ });
113
+
114
+ core.info(`Issue #${issue.number} assigned to ${assignedMember.name} (${assignedMember.role})`);
115
+
116
+ # Separate step: assign @copilot using PAT (required for coding agent)
117
+ - name: Assign @copilot coding agent
118
+ if: github.event.label.name == 'squad:copilot'
119
+ uses: actions/github-script@v7
120
+ with:
121
+ github-token: ${{ secrets.COPILOT_ASSIGN_TOKEN }}
122
+ script: |
123
+ const owner = context.repo.owner;
124
+ const repo = context.repo.repo;
125
+ const issue_number = context.payload.issue.number;
126
+
127
+ // Get the default branch name (main, master, etc.)
128
+ const { data: repoData } = await github.rest.repos.get({ owner, repo });
129
+ const baseBranch = repoData.default_branch;
130
+
131
+ try {
132
+ await github.request('POST /repos/{owner}/{repo}/issues/{issue_number}/assignees', {
133
+ owner,
134
+ repo,
135
+ issue_number,
136
+ assignees: ['copilot-swe-agent[bot]'],
137
+ agent_assignment: {
138
+ target_repo: `${owner}/${repo}`,
139
+ base_branch: baseBranch,
140
+ custom_instructions: '',
141
+ custom_agent: '',
142
+ model: ''
143
+ },
144
+ headers: {
145
+ 'X-GitHub-Api-Version': '2022-11-28'
146
+ }
147
+ });
148
+ core.info(`Assigned copilot-swe-agent to issue #${issue_number} (base: ${baseBranch})`);
149
+ } catch (err) {
150
+ core.warning(`Assignment with agent_assignment failed: ${err.message}`);
151
+ // Fallback: try without agent_assignment
152
+ try {
153
+ await github.rest.issues.addAssignees({
154
+ owner, repo, issue_number,
155
+ assignees: ['copilot-swe-agent']
156
+ });
157
+ core.info(`Fallback assigned copilot-swe-agent to issue #${issue_number}`);
158
+ } catch (err2) {
159
+ core.warning(`Fallback also failed: ${err2.message}`);
160
+ }
161
+ }