@spec-wave/cli 0.35.0 → 1.0.2
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/package.json +2 -2
- package/src/agent/anthropic-agent.mjs +35 -2
- package/src/api/github-rest.mjs +23 -0
- package/src/cli.mjs +42 -0
- package/src/commands/code-review.mjs +31 -17
- package/src/commands/decompose.mjs +75 -4
- package/src/commands/doctor.mjs +43 -3
- package/src/commands/implement.mjs +39 -6
- package/src/commands/init.mjs +147 -29
- package/src/commands/merge.mjs +11 -8
- package/src/commands/move.mjs +4 -7
- package/src/commands/order.mjs +2 -2
- package/src/commands/qa.mjs +22 -21
- package/src/commands/repair-stage.mjs +2 -5
- package/src/commands/repo.mjs +103 -0
- package/src/commands/story.mjs +2 -2
- package/src/commands/task.mjs +2 -2
- package/src/commands/triage.mjs +2 -5
- package/src/commands/update.mjs +31 -8
- package/src/commands/validate.mjs +2 -5
- package/src/commands/workspace.mjs +112 -0
- package/src/config.mjs +19 -0
- package/src/lib/artifact-pr.mjs +1 -1
- package/src/lib/claude.mjs +4 -0
- package/src/lib/decomposition-doc.mjs +56 -3
- package/src/lib/dependency-map.mjs +3 -0
- package/src/lib/flow-run.mjs +14 -3
- package/src/lib/pr-link.mjs +65 -10
- package/src/lib/pr-ready.mjs +6 -2
- package/src/lib/project-root.mjs +51 -0
- package/src/lib/repo-role.mjs +169 -0
- package/src/lib/workspace.mjs +151 -0
- package/src/plugin/.claude-plugin/plugin.json +1 -1
- package/src/plugin/skills/decompose/SKILL.md +1 -0
- package/src/plugin/skills/decompose/model-prompt.feature.md +4 -2
- package/src/plugin/skills/implement/SKILL.md +1 -1
- package/src/plugin/skills/setup/SKILL.md +19 -0
- package/src/setup/files.mjs +35 -13
- package/src/templates/skill/SKILL.md +21 -1
- package/src/templates/workflows/code/code-review.yml +60 -0
- package/src/templates/workflows/code/qa.yml +59 -0
- package/src/templates/workflows/pr-events.yml +116 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
name: PR Events
|
|
2
|
+
|
|
3
|
+
# Recebe, de um repositório de CÓDIGO do mesmo Project, o aviso de que um PR
|
|
4
|
+
# foi aberto, aprovado ou mergeado lá (RFC-005 §7.1). O despachante de lá
|
|
5
|
+
# manda um repository_dispatch com { event, pr_repo, pr_number }; tudo que
|
|
6
|
+
# toca o board roda AQUI, no hub, dentro do namespace spec-wave-item-<feature>
|
|
7
|
+
# que serializa com o decompose. Num hub sem repos de código este workflow
|
|
8
|
+
# nunca dispara e não custa nada.
|
|
9
|
+
#
|
|
10
|
+
# Tokens: GITHUB_TOKEN só enxerga este repositório, e o PR está noutro. Por
|
|
11
|
+
# isso a CLI recebe o GH_PROJECT_TOKEN (PAT com repo + project) também como
|
|
12
|
+
# GITHUB_TOKEN — é ele que lê o PR e comenta nele. Sem o secret, cai no
|
|
13
|
+
# GITHUB_TOKEN, que ainda lê PR de repo público mas não comenta.
|
|
14
|
+
on:
|
|
15
|
+
repository_dispatch:
|
|
16
|
+
types: [spec-wave-pr]
|
|
17
|
+
|
|
18
|
+
# Trava por PR de origem: o mesmo PR do mesmo repo não é processado duas
|
|
19
|
+
# vezes ao mesmo tempo. A trava que importa é a do job `move`, por ITEM.
|
|
20
|
+
concurrency:
|
|
21
|
+
group: spec-wave-pr-${{ github.event.client_payload.pr_repo }}-${{ github.event.client_payload.pr_number }}
|
|
22
|
+
cancel-in-progress: false
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
# Descobre a Feature-alvo ANTES de tocar no board, para dar a chave de
|
|
26
|
+
# concurrency ao job seguinte — mesmo desenho do code-review.yml local.
|
|
27
|
+
resolve:
|
|
28
|
+
# Modo de execução: `spec-wave mode local` cria a variável de repositório
|
|
29
|
+
# SPEC_WAVE_EXECUTION=local e este job passa a ser PULADO.
|
|
30
|
+
if: vars.SPEC_WAVE_EXECUTION != 'local' && github.event.client_payload.event == 'opened'
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
permissions:
|
|
33
|
+
issues: read
|
|
34
|
+
pull-requests: read
|
|
35
|
+
contents: read
|
|
36
|
+
outputs:
|
|
37
|
+
feature: ${{ steps.resolve.outputs.feature }}
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v5
|
|
40
|
+
- uses: actions/setup-node@v5
|
|
41
|
+
with:
|
|
42
|
+
node-version: '24'
|
|
43
|
+
|
|
44
|
+
- name: Instala a CLI
|
|
45
|
+
run: npm install -g @spec-wave/cli@{{CLI_VERSION}}
|
|
46
|
+
|
|
47
|
+
- id: resolve
|
|
48
|
+
run: >
|
|
49
|
+
spec-wave code-review
|
|
50
|
+
--pr-number ${{ github.event.client_payload.pr_number }}
|
|
51
|
+
--pr-repo ${{ github.event.client_payload.pr_repo }}
|
|
52
|
+
--resolve-only
|
|
53
|
+
env:
|
|
54
|
+
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
55
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
56
|
+
|
|
57
|
+
move:
|
|
58
|
+
needs: resolve
|
|
59
|
+
if: >
|
|
60
|
+
vars.SPEC_WAVE_EXECUTION != 'local' &&
|
|
61
|
+
needs.resolve.outputs.feature != ''
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
# MESMO namespace do decompose.yml e do code-review.yml: um decompose-apply
|
|
64
|
+
# em curso na Feature segura este job na fila em vez de disputar a
|
|
65
|
+
# subárvore com ele.
|
|
66
|
+
concurrency:
|
|
67
|
+
group: spec-wave-item-${{ needs.resolve.outputs.feature }}
|
|
68
|
+
cancel-in-progress: false
|
|
69
|
+
permissions:
|
|
70
|
+
issues: write
|
|
71
|
+
pull-requests: write
|
|
72
|
+
contents: read
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v5
|
|
75
|
+
- uses: actions/setup-node@v5
|
|
76
|
+
with:
|
|
77
|
+
node-version: '24'
|
|
78
|
+
|
|
79
|
+
- name: Instala a CLI
|
|
80
|
+
run: npm install -g @spec-wave/cli@{{CLI_VERSION}}
|
|
81
|
+
|
|
82
|
+
- name: Move Feature to Code Review
|
|
83
|
+
run: >
|
|
84
|
+
spec-wave code-review
|
|
85
|
+
--pr-number ${{ github.event.client_payload.pr_number }}
|
|
86
|
+
--pr-repo ${{ github.event.client_payload.pr_repo }}
|
|
87
|
+
env:
|
|
88
|
+
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
89
|
+
PROJECT_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }}
|
|
90
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|
|
91
|
+
|
|
92
|
+
qa:
|
|
93
|
+
if: vars.SPEC_WAVE_EXECUTION != 'local' && github.event.client_payload.event == 'qa'
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
permissions:
|
|
96
|
+
issues: write
|
|
97
|
+
pull-requests: write
|
|
98
|
+
contents: read
|
|
99
|
+
steps:
|
|
100
|
+
- uses: actions/checkout@v5
|
|
101
|
+
- uses: actions/setup-node@v5
|
|
102
|
+
with:
|
|
103
|
+
node-version: '24'
|
|
104
|
+
|
|
105
|
+
- name: Instala a CLI
|
|
106
|
+
run: npm install -g @spec-wave/cli@{{CLI_VERSION}}
|
|
107
|
+
|
|
108
|
+
- name: Move Feature to QA
|
|
109
|
+
run: >
|
|
110
|
+
spec-wave qa
|
|
111
|
+
--pr-number ${{ github.event.client_payload.pr_number }}
|
|
112
|
+
--pr-repo ${{ github.event.client_payload.pr_repo }}
|
|
113
|
+
env:
|
|
114
|
+
GITHUB_TOKEN: ${{ secrets.GH_PROJECT_TOKEN || secrets.GITHUB_TOKEN }}
|
|
115
|
+
PROJECT_TOKEN: ${{ secrets.GH_PROJECT_TOKEN }}
|
|
116
|
+
GITHUB_REPOSITORY: ${{ github.repository }}
|