@skitterbyte/skitterspec-github 0.0.0-stage → 1.0.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.
- package/MIGRATION.md +1126 -0
- package/README.md +53 -2
- package/assets/claude-md-section.md +85 -0
- package/assets/commands/allow-main.md +33 -0
- package/assets/commands/spec-connect.md +13 -0
- package/assets/commands/spec-live.md +14 -0
- package/assets/commands/spec-remote-review.md +37 -0
- package/assets/commands/spec-skip.md +24 -0
- package/assets/core/SETUP.md +112 -0
- package/assets/core/env.config.json.example +56 -0
- package/assets/core/env.config.md +557 -0
- package/assets/core/gating.config.json.example +4 -0
- package/assets/core/gating.config.md +81 -0
- package/assets/core/github.config.json.example +18 -0
- package/assets/core/github.config.md +66 -0
- package/assets/hooks/main-guard.cjs +162 -0
- package/assets/hooks/review-gate.cjs +146 -0
- package/assets/review/page.html +3384 -0
- package/assets/rules/commit-trailers.md +103 -0
- package/assets/rules/negative-checks.md +69 -0
- package/assets/rules/offered-unblocks.md +100 -0
- package/assets/rules/spec-planning.md +692 -0
- package/assets/rules/spec-reports.md +557 -0
- package/assets/skills/no-spec/SKILL.md +246 -0
- package/assets/skills/spec/SKILL.md +718 -0
- package/assets/skills/spec-bug/SKILL.md +646 -0
- package/assets/skills/spec-cancel/SKILL.md +263 -0
- package/assets/skills/spec-claim/SKILL.md +122 -0
- package/assets/skills/spec-complete/SKILL.md +450 -0
- package/assets/skills/spec-diff/SKILL.md +870 -0
- package/assets/skills/spec-github-setup/SKILL.md +236 -0
- package/assets/skills/spec-hotfix/SKILL.md +668 -0
- package/assets/skills/spec-init/SKILL.md +178 -0
- package/assets/skills/spec-list/SKILL.md +172 -0
- package/assets/skills/spec-next/SKILL.md +685 -0
- package/assets/skills/spec-push/SKILL.md +307 -0
- package/assets/skills/spec-review/SKILL.md +258 -0
- package/assets/skills/spec-reviewed/SKILL.md +284 -0
- package/assets/skills/spec-start/SKILL.md +554 -0
- package/assets/skills/spec-status/SKILL.md +112 -0
- package/assets/skills/spec-sync/SKILL.md +226 -0
- package/assets/skills/spec-to-main/SKILL.md +139 -0
- package/bin/skitterspec-github.js +61 -0
- package/package.json +41 -4
- package/src/cli.js +5907 -0
- package/src/deprecate.js +138 -0
- package/src/env/bootstrap.js +188 -0
- package/src/env/building.js +143 -0
- package/src/env/classify.js +176 -0
- package/src/env/commitcmd.js +108 -0
- package/src/env/config.js +753 -0
- package/src/env/dev.js +63 -0
- package/src/env/hooks.js +226 -0
- package/src/env/hotfix.js +411 -0
- package/src/env/hotfixland.js +302 -0
- package/src/env/integrate.js +126 -0
- package/src/env/live.js +504 -0
- package/src/env/mainguard.js +299 -0
- package/src/env/provision.js +466 -0
- package/src/env/proxy.js +225 -0
- package/src/env/prune.js +119 -0
- package/src/env/registry.js +159 -0
- package/src/env/render.js +17 -0
- package/src/env/resolve.js +716 -0
- package/src/env/review.js +2577 -0
- package/src/env/reviewers/coderabbit.js +228 -0
- package/src/env/reviewers.js +517 -0
- package/src/env/serve.js +1044 -0
- package/src/env/supervise.js +157 -0
- package/src/env/teardown.js +248 -0
- package/src/env/trust.js +87 -0
- package/src/gating.js +155 -0
- package/src/init.js +1150 -0
- package/src/lines-diff.js +114 -0
- package/src/prompts.js +129 -0
- package/src/vendor/github/api.js +800 -0
- package/src/vendor/github/cli-sync.js +1530 -0
- package/src/vendor/github/commands.js +44 -0
- package/src/vendor/github/config.js +414 -0
- package/src/vendor/github/credentials.js +109 -0
- package/src/vendor/github/dialect.js +62 -0
- package/src/vendor/github/identity.js +38 -0
- package/src/vendor/github/mcp.js +85 -0
- package/src/vendor/provider-kit/index.js +41 -0
- package/src/vendor/provider-kit/src/adapter.js +23 -0
- package/src/vendor/provider-kit/src/apply.js +207 -0
- package/src/vendor/provider-kit/src/args.js +68 -0
- package/src/vendor/provider-kit/src/assignment.js +277 -0
- package/src/vendor/provider-kit/src/config.js +198 -0
- package/src/vendor/provider-kit/src/credentials.js +404 -0
- package/src/vendor/provider-kit/src/doctor.js +35 -0
- package/src/vendor/provider-kit/src/http.js +63 -0
- package/src/vendor/provider-kit/src/identity.js +93 -0
- package/src/vendor/provider-kit/src/md-compare.js +39 -0
- package/src/vendor/provider-kit/src/md-tables.js +94 -0
- package/src/vendor/provider-kit/src/prompt.js +50 -0
- package/src/vendor/provider-kit/src/released.js +269 -0
- package/src/vendor/provider-kit/src/releases.js +380 -0
- package/src/vendor/provider-kit/src/specs.js +166 -0
- package/src/vendor/provider-kit/src/transport.js +22 -0
- package/src/vendor/sync-core/index.js +93 -0
- package/src/vendor/sync-core/src/base.js +81 -0
- package/src/vendor/sync-core/src/compare.js +338 -0
- package/src/vendor/sync-core/src/dialect.js +51 -0
- package/src/vendor/sync-core/src/fields.js +36 -0
- package/src/vendor/sync-core/src/legacy.js +100 -0
- package/src/vendor/sync-core/src/normalize.js +998 -0
- package/src/vendor/sync-core/src/push.js +85 -0
- package/src/vendor/sync-core/src/retarget.js +278 -0
- package/src/vendor/sync-core/src/task-block.js +308 -0
- package/src/vendor/sync-core/src/verify.js +67 -0
- package/src/vendor/sync-core/src/write.js +191 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-github-setup
|
|
3
|
+
description: Configure GitHub sync for this repo by interview rather than by hand — asks for the repo, the board and its Status options, validates the answers against GitHub, then writes specs/.core/github.config.json. Safe to re-run; an existing config is reviewed, never overwritten without consent. Use when the user says "/spec-github-setup", "set up GitHub sync", "connect this repo to GitHub", "configure github.config.json", or "check my GitHub setup".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-github-setup — configure GitHub sync by interview
|
|
7
|
+
|
|
8
|
+
> Stay silent while this runs — speak only to ask something you cannot answer
|
|
9
|
+
> yourself, or to report a failure at the moment it happens. Read
|
|
10
|
+
> `.claude/rules/spec-reports.md` before reporting; it defines the block this
|
|
11
|
+
> skill ends with.
|
|
12
|
+
|
|
13
|
+
Writes `specs/.core/github.config.json`, the file that switches one-way GitHub
|
|
14
|
+
sync on for this repo. You **interview**; the engine
|
|
15
|
+
(`spec-sync init-config`) **validates and writes**. Keep that split: composing
|
|
16
|
+
the JSON yourself is how a malformed config gets committed, and the engine
|
|
17
|
+
already rejects everything the loader would later reject.
|
|
18
|
+
|
|
19
|
+
The gap this closes is not "I can't remember my repo name" — it's that nothing
|
|
20
|
+
ever asks which board this repo's work lives on and which Status options its
|
|
21
|
+
lifecycle maps to, so the config ends up describing a shape nobody confirmed.
|
|
22
|
+
Ask about structure first; the values fall out of the answers.
|
|
23
|
+
|
|
24
|
+
## 1. Check what already exists
|
|
25
|
+
|
|
26
|
+
Read `specs/.core/github.config.json`.
|
|
27
|
+
|
|
28
|
+
- **Absent** — this is a first-time setup. Carry on.
|
|
29
|
+
- **Present** — say so and default to **reviewing** it, not replacing it: run
|
|
30
|
+
the checks in steps 2 and 5 and report where the live config disagrees with
|
|
31
|
+
GitHub (a board number that no longer resolves, a Status option that was
|
|
32
|
+
renamed).
|
|
33
|
+
That is the most useful thing a re-run can do. Only write when the user asks
|
|
34
|
+
for it, and then pass `--force`.
|
|
35
|
+
|
|
36
|
+
## 2. Credentials first
|
|
37
|
+
|
|
38
|
+
The interview validates its answers against GitHub, so settle authentication
|
|
39
|
+
before asking anything:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
skitterspec spec-sync credentials status
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If nothing is set, tell the user to run this **themselves**, in their own
|
|
46
|
+
terminal:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
skitterspec spec-sync credentials set
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
It prompts for a token (hidden): a **classic** personal access token with the
|
|
53
|
+
`repo` and `project` scopes, created at https://github.com/settings/tokens.
|
|
54
|
+
Fine-grained tokens are documented only for **org-owned** boards, so on a
|
|
55
|
+
personal account's board a classic one is what works. With `GITHUB_TOKEN` or
|
|
56
|
+
`GH_TOKEN` already exported — `gh` users often have one — nothing needs storing.
|
|
57
|
+
|
|
58
|
+
**Do not ask the user to paste a token into this conversation, and do not offer to store one for them.**
|
|
59
|
+
A credential pasted into a chat enters the transcript, is sent to the model,
|
|
60
|
+
and may be logged — moving where it is stored is pointless if it travels
|
|
61
|
+
through the conversation to get there. Your job is to confirm the setup is
|
|
62
|
+
ready and name the command; the values are theirs alone.
|
|
63
|
+
|
|
64
|
+
**Degrade, never block:** with no credentials and no MCP connection the answers
|
|
65
|
+
cannot be validated. Say so in one line —
|
|
66
|
+
*"GitHub not reachable — can't validate the answers"* — point at the manual path
|
|
67
|
+
(`github.config.md`, the field reference beside the example config), and
|
|
68
|
+
**stop without writing anything**. A half-written config is worse than none:
|
|
69
|
+
every other command switches on the moment the file exists.
|
|
70
|
+
|
|
71
|
+
## 3. Which repo, and which board?
|
|
72
|
+
|
|
73
|
+
- **Owner and repo** — read them off `git remote get-url origin` and offer them;
|
|
74
|
+
they are where spec issues are created. The owner also keys the stored token.
|
|
75
|
+
- **Board** — the Projects v2 board's **number**, the one in its URL
|
|
76
|
+
(`github.com/users/<owner>/projects/7` → `7`). It must be owned by the same
|
|
77
|
+
owner.
|
|
78
|
+
|
|
79
|
+
**The board is required, and it is one per repo.** An issue is only open or
|
|
80
|
+
closed; the states a spec moves through are the options of a single-select
|
|
81
|
+
field on the board, so an issue off the board has no state at all. Say that
|
|
82
|
+
plainly. If the user has no board yet, tell them to create one on GitHub — a
|
|
83
|
+
**Board** layout is the natural view — and come back with its number. **Never
|
|
84
|
+
create the board yourself**: it is the user's surface, and its layout and
|
|
85
|
+
automations are theirs to choose.
|
|
86
|
+
|
|
87
|
+
## 4. Which field carries state?
|
|
88
|
+
|
|
89
|
+
- **`github.statusField`** — default **Status**, the field every new board
|
|
90
|
+
starts with. Take the default unless the user keeps state in another
|
|
91
|
+
single-select.
|
|
92
|
+
- **Turn off the board's built-in "Item closed → Done" and "Pull request
|
|
93
|
+
merged → Done" workflows**, or leave them knowingly: the engine sets Status
|
|
94
|
+
itself, and a board automation moving it too is a second writer the next push
|
|
95
|
+
overrides.
|
|
96
|
+
- **A second single-select, `Deployed`**, is where release stages belong
|
|
97
|
+
(Test, Demo, Prod) — never as Status options, or a finished phase reads as
|
|
98
|
+
deployed. Mention it; releases set it, and setup does not need it.
|
|
99
|
+
|
|
100
|
+
## 5. Check the Status options
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
skitterspec spec-sync states --json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
It prints the board's options, exactly as GitHub spells them — and reaching
|
|
107
|
+
them is the setup's first real end-to-end check: a wrong owner, repo, board
|
|
108
|
+
number or token fails here, while the user is still in the setup conversation.
|
|
109
|
+
Relay a failure with its fix rather than pressing on.
|
|
110
|
+
|
|
111
|
+
Then settle the four bucket→option names against that list:
|
|
112
|
+
|
|
113
|
+
- `backlog` → `Backlog` · `in-progress` → `In Progress` · `complete` → `Done` ·
|
|
114
|
+
`cancelled` → `Cancelled` by default. A new board's Status field carries
|
|
115
|
+
`Todo`, `In Progress` and `Done`, so a fresh board usually needs `Backlog`
|
|
116
|
+
and `Cancelled` **added on the board** — or `backlog` mapped to `Todo`.
|
|
117
|
+
Offer both; it is the user's call.
|
|
118
|
+
- `complete` also closes the issue as `completed`, and `cancelled` as
|
|
119
|
+
`not_planned`, whatever the options are called.
|
|
120
|
+
- **Validate every answer against the `states` output** before writing. An
|
|
121
|
+
option the board lacks is refused at push time, after the body has landed —
|
|
122
|
+
catching it here is the whole reason this step exists.
|
|
123
|
+
- Where a configured or offered name is not in the list, show the real names
|
|
124
|
+
and ask which one means that bucket here — the mapping is the user's call,
|
|
125
|
+
never a guess.
|
|
126
|
+
|
|
127
|
+
Each answer that differs from the defaults becomes a `--state <bucket>=<name>`
|
|
128
|
+
flag in step 6.
|
|
129
|
+
|
|
130
|
+
**Labels.** Spec issues are labelled `spec` and phases `phase` (configurable in
|
|
131
|
+
`github.labels`). GitHub creates a label on first use, so nothing is required —
|
|
132
|
+
but offer to create them now with a colour, since a label made on first use is
|
|
133
|
+
grey and undescribed. Create them only on a yes.
|
|
134
|
+
|
|
135
|
+
## 6. Write it
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
skitterspec spec-sync init-config \
|
|
139
|
+
--owner <owner> --repo <repo> --project <N> \
|
|
140
|
+
[--status-field Status] [--state <bucket>=<name> …] [--force]
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The engine writes **only the keys that were given**, so the file shows this
|
|
144
|
+
repo's choices and keeps inheriting everything else. `--force` is required to
|
|
145
|
+
replace an existing config — never pass it without the user having asked for a
|
|
146
|
+
rewrite in step 1.
|
|
147
|
+
|
|
148
|
+
**Relay the engine's report as printed.** It names what it wrote and whether
|
|
149
|
+
the state map was checked against the board — that report is the evidence the
|
|
150
|
+
setup is right, so don't paraphrase it into "done". It also says to commit the
|
|
151
|
+
file: a spec worktree forks from a commit, and sync is off wherever the file is
|
|
152
|
+
absent.
|
|
153
|
+
|
|
154
|
+
## 6b. Let `/spec-start` commit the snapshot with its spec
|
|
155
|
+
|
|
156
|
+
**Only when `specs/.core/env.config.json` exists** (per-spec isolation is on).
|
|
157
|
+
If it is absent, skip this — there is nothing to configure.
|
|
158
|
+
|
|
159
|
+
**Check before you write — a fresh install may already have this.** When this
|
|
160
|
+
superset's `init --isolation` wrote the `env.config.json`, both keys below are
|
|
161
|
+
seeded; this step is the **retrofit** for a project that adopted isolation
|
|
162
|
+
before installing the GitHub provider, or ran `/spec-github-setup` before adopting
|
|
163
|
+
it.
|
|
164
|
+
|
|
165
|
+
`/spec-start` commits an uncommitted spec for you, but only the paths it can
|
|
166
|
+
prove belong to that spec. Its own folder always does; this repo's per-spec
|
|
167
|
+
GitHub snapshot (`sync.baseDir`, `specs/.core/github-base/<ID>.base.json`) does
|
|
168
|
+
not, because the base engine is deliberately tracker-free and cannot know that
|
|
169
|
+
path exists. Declare it once, in `env.config.json`:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
"spec": {
|
|
173
|
+
"companionPaths": ["specs/.core/github-base/{identifier}.base.json"]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`{identifier}` resolves through `branch.identifierField`, so **set that too** if
|
|
178
|
+
it is still empty — `"github_identifier"` is the field `/spec` stamps. Without
|
|
179
|
+
it the pattern expands to nothing and the snapshot is treated as another spec's
|
|
180
|
+
file: `/spec-start` then refuses the tree instead of committing it, which is the
|
|
181
|
+
safe failure but a needless one.
|
|
182
|
+
|
|
183
|
+
Leave both alone if the user has already set them.
|
|
184
|
+
|
|
185
|
+
## 7. Report and hand off
|
|
186
|
+
|
|
187
|
+
**Finish by checking, not by describing.** Run:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
skitterspec spec-sync doctor
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
and relay its table. That is the difference between a summary of what setup
|
|
194
|
+
*meant* to do and a check of what is actually true — including the layers this
|
|
195
|
+
skill never touched (the scaffold, isolation). Every row that needs attention
|
|
196
|
+
names its own fix, so there is nothing to paraphrase.
|
|
197
|
+
|
|
198
|
+
It exits non-zero only when a layer is **broken** — configured but wrong. A
|
|
199
|
+
`missing` row is an opt-in nobody took, which is fine; report it, don't treat
|
|
200
|
+
it as a failure.
|
|
201
|
+
|
|
202
|
+
Then name the next step:
|
|
203
|
+
|
|
204
|
+
- `/spec` — write a spec; with GitHub configured it creates the linked issue in
|
|
205
|
+
the configured repo, puts it on the board and stamps its number.
|
|
206
|
+
- `/spec-status` — read-only drift report, the safe way to prove the link works.
|
|
207
|
+
- `/spec-push` — send a spec up.
|
|
208
|
+
|
|
209
|
+
Mention what setup did **not** configure, so the defaults aren't mistaken for
|
|
210
|
+
decisions: phase mapping (`mapping.phases` — sub-issue per phase by default) and
|
|
211
|
+
field ownership, and intake (`intake.label`, `bugLabels`, `hotfixLabels`).
|
|
212
|
+
Point at `github.config.md` for those. Assignment is on by default
|
|
213
|
+
(`sync.fieldOwnership.assignee: push`): `/spec-start` assigns the issue to the
|
|
214
|
+
token's login, and `spec-sync whoami` shows who that is.
|
|
215
|
+
|
|
216
|
+
End with the block defined in `.claude/rules/spec-reports.md`. That file carries
|
|
217
|
+
the shape; this section carries only what is specific here.
|
|
218
|
+
|
|
219
|
+
**The `doctor` table goes above the block, verbatim.** It is a check rather than
|
|
220
|
+
a summary, and every row that needs attention names its own fix — paraphrasing
|
|
221
|
+
it into fields would lose exactly that.
|
|
222
|
+
|
|
223
|
+
**Verdicts**
|
|
224
|
+
|
|
225
|
+
- `✅` — every layer `doctor` checked is configured and working.
|
|
226
|
+
- `⚠️` — configured, with a `missing` row: an opt-in nobody took, which is fine.
|
|
227
|
+
Report it; do not treat it as a failure.
|
|
228
|
+
- `❌` — a `broken` row: configured but wrong. Relay the row and its fix.
|
|
229
|
+
- `⏸` — an existing config was reviewed and left alone, or GitHub could not be
|
|
230
|
+
reached. Nothing was written.
|
|
231
|
+
|
|
232
|
+
**Fields:** `Built` · `Follow-ups` · `Next`
|
|
233
|
+
|
|
234
|
+
`Built` is the config written or reviewed, plus what was deliberately left
|
|
235
|
+
unset. **The credentials are never a field** — `doctor` already reports whether
|
|
236
|
+
they are set, masked, and the values are the user's alone.
|