@99x-ai-dlc/idf-installer 0.0.0-stage → 0.2.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 (49) hide show
  1. package/README.md +51 -2
  2. package/bin/idf-installer.js +185 -0
  3. package/package.json +22 -4
  4. package/repository-agents/process-diagnostic-agent/review-guide.md +669 -0
  5. package/repository-agents/process-diagnostic-agent/role-play.md +223 -0
  6. package/repository-agents/process-diagnostic-agent/skills/trend-analysis.md +113 -0
  7. package/repository-agents/process-estimation-agent/estimate.md +69 -0
  8. package/repository-agents/process-estimation-agent/estimation-guide.md +435 -0
  9. package/repository-agents/process-migration-agent/migrate.md +72 -0
  10. package/repository-agents/process-migration-agent/migration-guide.md +490 -0
  11. package/repository-agents/process-onboarding-agent/external-skills/README.md +189 -0
  12. package/repository-agents/process-onboarding-agent/external-skills/ux-os.md +92 -0
  13. package/repository-agents/process-onboarding-agent/onboard.md +214 -0
  14. package/repository-agents/process-onboarding-agent/ops/build/backlog.md +43 -0
  15. package/repository-agents/process-onboarding-agent/ops/build/bolts/_template.md +53 -0
  16. package/repository-agents/process-onboarding-agent/ops/build/units/_template.md +112 -0
  17. package/repository-agents/process-onboarding-agent/ops/inception/codebase-findings/README.md +22 -0
  18. package/repository-agents/process-onboarding-agent/ops/inception/codebase-findings/_template.md +34 -0
  19. package/repository-agents/process-onboarding-agent/ops/inception/dependency-map.md +47 -0
  20. package/repository-agents/process-onboarding-agent/ops/inception/elaborations/_template.md +46 -0
  21. package/repository-agents/process-onboarding-agent/ops/inception/intents/README.md +9 -0
  22. package/repository-agents/process-onboarding-agent/ops/inception/intents/_template.md +92 -0
  23. package/repository-agents/process-onboarding-agent/ops/operate/improvements/_template.md +51 -0
  24. package/repository-agents/process-onboarding-agent/ops/operate/incidents/_template.md +61 -0
  25. package/repository-agents/process-onboarding-agent/ops/operate/retros/_template.md +122 -0
  26. package/repository-agents/process-onboarding-agent/rules/engagement.md +70 -0
  27. package/repository-agents/process-onboarding-agent/setup-guide.md +1409 -0
  28. package/repository-agents/process-onboarding-agent/skills/ai-hub-metrics.md +341 -0
  29. package/repository-agents/process-onboarding-agent/skills/bolt-risk-assessment.md +208 -0
  30. package/repository-agents/process-onboarding-agent/skills/bug-bolt.md +105 -0
  31. package/repository-agents/process-onboarding-agent/skills/compact-docs.md +123 -0
  32. package/repository-agents/process-onboarding-agent/skills/dependency-audit.md +187 -0
  33. package/repository-agents/process-onboarding-agent/skills/design-session.md +230 -0
  34. package/repository-agents/process-onboarding-agent/skills/governance-map.md +212 -0
  35. package/repository-agents/process-onboarding-agent/skills/hotfix-bolt.md +102 -0
  36. package/repository-agents/process-onboarding-agent/skills/knowledge-promotion.md +188 -0
  37. package/repository-agents/process-onboarding-agent/skills/new-engineer-induction.md +303 -0
  38. package/repository-agents/process-onboarding-agent/skills/nfr-bolt.md +117 -0
  39. package/repository-agents/process-onboarding-agent/skills/notifications.md +456 -0
  40. package/repository-agents/process-onboarding-agent/skills/process-health.md +252 -0
  41. package/repository-agents/process-onboarding-agent/skills/process-visualization.md +157 -0
  42. package/repository-agents/process-onboarding-agent/skills/product-engineering-essentials.md +261 -0
  43. package/repository-agents/process-onboarding-agent/skills/progress-digest.md +184 -0
  44. package/repository-agents/process-onboarding-agent/skills/release-readiness-checklist.md +259 -0
  45. package/repository-agents/process-onboarding-agent/skills/root-cause-analysis.md +151 -0
  46. package/repository-agents/process-onboarding-agent/skills/solution-shaping.md +98 -0
  47. package/repository-agents/process-onboarding-agent/skills/uat.md +267 -0
  48. package/repository-agents/process-skills-agent/onboard.md +68 -0
  49. package/repository-agents/process-skills-agent/skills-guide.md +404 -0
@@ -0,0 +1,341 @@
1
+ # Skill: AI Hub Metrics
2
+
3
+ **Purpose:** Push usage statistics and activity events from repository-agents' delivery work to [99x AI Hub](https://ai-hub.99x.io) — the platform that lets a team observe AI work across a codebase: tokens, cost, model, and who participated (human, agent, or both) for each step. Each push is one **activity event**, correlated to one unit of AI-assisted delivery work (a unit, a bolt, a UAT sign-off) and attributed to the actors who did it. This is a **project-level integration, not a per-engineer one** — one Team, one Workflow, and one set of credentials cover the whole project, unlike the notifications skill.
4
+
5
+ **Trigger:** Fires automatically from the master rule file Section 6 routing line at the lifecycle events listed in Section 11 (unit Done, bolt complete, UAT sign-off, intent Implemented). An engineer can also say "push an AI Hub event for …" to send one ad-hoc; "enable AI Hub metrics" / "disable AI Hub metrics" to flip the project-wide switch (see *Enabling and disabling*); "turn off AI Hub metrics for this session" to suppress sending just for this session; or "show AI Hub status" / "is AI Hub metrics on" to see the status summary (see *Status summary*).
6
+
7
+ **Dependency classification:** Needs config — the send command works as-is once installed, but someone must first model a Workflow in AI Hub and supply four pieces of information (Step 1 below) before anything is sent.
8
+
9
+ ---
10
+
11
+ ## Invariants
12
+
13
+ Anyone editing this file — human or AI — must keep all six of these true:
14
+
15
+ 1. **Credentials never committed.** The API key/PAT and the IDs that name where events land are read from environment variables or a gitignored file, never written into a committed file or the master rule file.
16
+ 2. **The AI never touches the AI Hub console.** It does not create the team, register actors, generate a key, or model the workflow. It presents the setup steps and waits — see *Who does what*.
17
+ 3. **The script escapes, the caller does not.** `scripts/ai-hub-push.sh` builds the JSON payload itself. Never reintroduce hand-escaping rules for the agent to follow.
18
+ 4. **Every send exits 0.** A missing credential, an unreachable host, a non-202 response — all are silent no-ops on stderr. A metrics push must never break the delivery step it reports on.
19
+ 5. **One `correlationId` per usage instance.** Reuse one across unrelated units and AI Hub aggregates them as a single instance in its dashboards — pick an id that names the thing that actually happened (a unit id, a bolt id), not a constant.
20
+ 6. **Never guess the API host or the workflow IDs.** AI Hub's published documentation does not state a fixed API domain, and node/activity ids are generated per workflow. Both are confirmed by the engineer from their own AI Hub instance during setup (Step 1) — do not default or invent them.
21
+
22
+ ---
23
+
24
+ ## Core concepts (from AI Hub's documentation)
25
+
26
+ - **Team** — the ownership boundary for actors, workflows, API keys, and usage. One team per project is normal.
27
+ - **Actors** — team-scoped participants, optionally linked to an AI Hub user, or representing non-user systems (an AI tool counts as an actor). They appear on events for attribution and must be registered on the team before they can be pushed.
28
+ - **Workflow / Nodes / Node Activities** — a workflow models the process on a canvas; each node is a step, and each node can define activities with an actor mode of `human`, `agent`, or `human+agent`. AI-DLC's unit-based delivery loop maps onto this directly: model a workflow with nodes for the stages the team wants visibility into (e.g. "Elaboration", "Build", "UAT"), and give each node an activity in `human+agent` mode, since every unit here is a human+AI collaboration.
29
+ - **Events** — each push creates activity events keyed by a `correlationId`. `actors` records who participated; `dimensions` optionally carries `tokens`, `costUsd`, and `model` for usage totals.
30
+
31
+ ---
32
+
33
+ ## Configuration — the endpoint, credential, and workflow IDs come from environment variables
34
+
35
+ Nothing about *where* events go or *how they authenticate* is ever hardcoded into a framework file. All five pieces below come from `scripts/ai-hub.env` (or the environment) at send time.
36
+
37
+ | Variable | Meaning | Example value |
38
+ |---|---|---|
39
+ | `AI_HUB_BASE_URL` | The AI Hub instance's API host | `https://ai-hub.99x.io` — **confirm this against your own AI Hub console**; the public documentation does not publish it as a fixed value, so do not assume it without the engineer confirming it |
40
+ | `AI_HUB_API_KEY` **or** `AI_HUB_PAT` | Team API key (`ah_tm_…`) or personal access token (`ah_pat_…`) | one of the two — team key is the normal choice for a shared pipeline |
41
+ | `AI_HUB_NODE_ID` | The workflow node's public id | `nd_…` |
42
+ | `AI_HUB_NODE_ACTIVITY_ID` | The node activity's public id (optional — see *Which endpoint*) | `na_…` |
43
+
44
+ Rules:
45
+ - Leave any of these unset and a push becomes a silent no-op — safe by default, same as notifications.
46
+ - Never echo the API key/PAT back to the engineer or into any artifact. Refer to it as "the configured AI Hub credential."
47
+ - The values are normally kept in a gitignored `scripts/ai-hub.env`, read directly by the send script — this is the one setup that behaves identically on macOS, Windows, and Linux. An environment variable takes precedence over the file when both are present, which is how CI supplies it.
48
+ - Unlike the notifications skill, this is **one shared setup for the whole project** — the Team, Workflow, and credential belong to the project, not to an individual engineer. A team API key is the normal choice so any teammate's session can push without minting a personal token.
49
+
50
+ ### Which endpoint
51
+
52
+ The script picks the endpoint from what is configured:
53
+ - **`AI_HUB_NODE_ACTIVITY_ID` set (recommended):** activity-scoped endpoint, `POST {AI_HUB_BASE_URL}/metrics/nodes/{AI_HUB_NODE_ID}/node-activities/{AI_HUB_NODE_ACTIVITY_ID}/events`. Use this when the project routes every event to one node activity (e.g. a single "Delivery" activity covering the whole loop).
54
+ - **`AI_HUB_NODE_ACTIVITY_ID` unset:** node-scoped endpoint, `POST {AI_HUB_BASE_URL}/metrics/nodes/{AI_HUB_NODE_ID}/events`, and every call must pass `--activity <name>` so the event names which activity on that node it belongs to. Use this when the project wants events split across several activities on one node (e.g. "Build" vs "UAT") without maintaining a separate `AI_HUB_NODE_ACTIVITY_ID` per call site.
55
+
56
+ Either way, expected response is `HTTP 202 Accepted`.
57
+
58
+ ---
59
+
60
+ ## Who does what
61
+
62
+ Like notifications, this needs two actions outside the repo that the AI cannot perform:
63
+
64
+ | Task | Who | Why |
65
+ |---|---|---|
66
+ | Create the team, register actors (including one for the AI tool itself), create a team API key, model the workflow with nodes/activities (Step 1) | **Engineer** | A browser flow under their own AI Hub login. The AI has no browser and no AI Hub session. |
67
+ | Write the five values into `scripts/ai-hub.env` (or set the variables — Step 2) | **Engineer** | The AI would have to be told the key to write it, which puts the credential in the conversation. |
68
+ | Verify with a test push (Step 3) | **AI** | Runs the script, which resolves the config itself; the AI never sees the values. |
69
+ | Add `scripts/ai-hub.env`, `.envrc`, and `.claude/settings.local.json` to `.gitignore` | **AI** | Do it up front, before the engineer has a key to put anywhere. |
70
+ | Create `scripts/ai-hub-push.sh`, allowlist it, write Section 11 and the Section 6 routing line | **AI** | Ordinary file work — none of these hold the credential, only a reference to it. |
71
+ | Send events from then on | **AI** | The point of the skill. |
72
+
73
+ **Never ask the engineer to paste the API key or PAT into the conversation.** If they paste it anyway, do not repeat it back, do not write it to any file, and tell them it is now in the session transcript and should be rotated in AI Hub (**Settings → API keys → revoke, then create a new one**).
74
+
75
+ ### Step 1 — Model the workflow and get a credential
76
+
77
+ *The engineer does this.*
78
+
79
+ 1. In AI Hub, open **Teams**, create (or pick) the project's team, and invite teammates.
80
+ 2. Under **Actors**, register one actor per participant type this project wants attributed — at minimum, one for the engineer(s) and one representing the AI tool (e.g. "Claude Code", named per the AI tool actually in use). Assign each to the team.
81
+ 3. In **Teams → API keys**, create a team key (`ah_tm_…`) for the shared pipeline. A personal access token (`ah_pat_…`) from **Settings** works too, but a team key is the better default since this is a project-wide integration, not a per-engineer one.
82
+ 4. From the team's **Workflows** list, create a workflow and open the editor. Add a node for each stage the team wants visibility into. On the node(s) that should receive AI-DLC events, add an activity with actor mode `human+agent`.
83
+ 5. Copy the node's public id (`nd_…`) and, if using the activity-scoped endpoint, the activity's public id (`na_…`).
84
+ 6. Confirm the AI Hub API host for this instance — the documentation does not publish one fixed value, so read it from the console or ask whoever administers the AI Hub instance.
85
+
86
+ **Security note (from AI Hub's own documentation):** "Never commit API keys to version control or share them publicly. Revoke keys you no longer need."
87
+
88
+ ### Step 2 — Tell the script where to send
89
+
90
+ #### Option A (recommended) — `scripts/ai-hub.env`
91
+
92
+ Create a file next to the send script:
93
+
94
+ ```sh
95
+ AI_HUB_BASE_URL="<YOUR_AI_HUB_BASE_URL>"
96
+ AI_HUB_API_KEY="<YOUR_TEAM_API_KEY>"
97
+ AI_HUB_NODE_ID="<YOUR_NODE_ID>"
98
+ AI_HUB_NODE_ACTIVITY_ID="<YOUR_NODE_ACTIVITY_ID>" # omit this line to use the node-scoped endpoint instead
99
+ ```
100
+
101
+ Gitignored (the AI adds it during setup step 2 below), read by the script when the variables are not already in the environment. Same reasoning as the notifications skill applies here — a non-interactive shell (what an AI tool spawns) reads no startup file on bash and a different one on every platform, so a script-adjacent env file is the one setup that behaves identically everywhere.
102
+
103
+ #### Option B — CI / shared runner
104
+
105
+ Store the same four values in the platform's secrets store and expose them as environment variables to the job — never in the repo. A team API key is the right credential here, not a PAT, since a PAT is tied to one person's account.
106
+
107
+ #### Claude Code only — `.claude/settings.local.json`
108
+
109
+ ```json
110
+ { "env": { "AI_HUB_BASE_URL": "<...>", "AI_HUB_API_KEY": "<...>", "AI_HUB_NODE_ID": "<...>", "AI_HUB_NODE_ACTIVITY_ID": "<...>" } }
111
+ ```
112
+
113
+ Gitignored, reaches every shell Claude Code spawns. Do not offer this on Cursor or Copilot projects — `env` there is a Claude Code setting only.
114
+
115
+ ### Step 3 — Verify
116
+
117
+ ```sh
118
+ scripts/ai-hub-push.sh --correlation-id 'ai-hub-metrics-test' --actor 'setup-check' --activity 'setup-check'
119
+ ```
120
+
121
+ The script always exits 0, so **never treat exit 0 as proof of delivery** — it prints what happened on stderr. Confirm the event actually landed by opening the workflow in AI Hub: **Workflows → open the workflow → filterable event list**. Usage appears shortly after a successful push.
122
+
123
+ ---
124
+
125
+ ## The send command
126
+
127
+ Every push goes through one script, `scripts/ai-hub-push.sh` (installed during setup — see *Onboarding setup*). The script builds the JSON payload itself:
128
+
129
+ ```bash
130
+ scripts/ai-hub-push.sh --correlation-id '<id>' --actor '<name>' [--actor '<name2>' ...] \
131
+ [--activity '<activity-name>'] [--tokens <n>] [--cost-usd <n>] [--model '<model-name>']
132
+ ```
133
+
134
+ Run it from the repository root — the permission allowlist matches the bare `scripts/ai-hub-push.sh` form.
135
+
136
+ - `--correlation-id` is required: the id of the usage instance (a unit id, a bolt id, an intent id — see *Lifecycle events* for the mapping).
137
+ - `--actor` is required, repeatable: pass one per participant (the engineer, and the actor representing the AI tool). Use the same names registered in AI Hub's Actors screen so attribution resolves.
138
+ - `--activity` is required only when `AI_HUB_NODE_ACTIVITY_ID` is unset (node-scoped endpoint); omit it when the activity is already fixed by `AI_HUB_NODE_ACTIVITY_ID`.
139
+ - `--tokens`, `--cost-usd`, `--model` are optional usage dimensions. This framework does not track token counts or cost by default — pass them only when the project separately captures that data (e.g. from the AI tool's own session/usage reporting); omit them otherwise. A push with no dimensions is still a valid, useful event — it records that the step happened and who did it.
140
+
141
+ ```bash
142
+ #!/bin/sh
143
+ # Usage: scripts/ai-hub-push.sh --correlation-id '<id>' --actor '<name>' [--actor '<name2>' ...] \
144
+ # [--activity '<name>'] [--tokens <n>] [--cost-usd <n>] [--model '<name>']
145
+ # Pushes one activity event to 99x AI Hub. Best-effort: never blocks the step it reports on.
146
+ #
147
+ # Config resolution, in order:
148
+ # 1. AI_HUB_BASE_URL / AI_HUB_API_KEY (or AI_HUB_PAT) / AI_HUB_NODE_ID / AI_HUB_NODE_ACTIVITY_ID
149
+ # already in the environment (CI, or an engineer who set them there)
150
+ # 2. scripts/ai-hub.env next to this script — gitignored, read the same way on every OS/shell
151
+
152
+ if [ -z "$AI_HUB_BASE_URL$AI_HUB_API_KEY$AI_HUB_PAT$AI_HUB_NODE_ID" ]; then
153
+ env_file="$(dirname "$0")/ai-hub.env"
154
+ [ -f "$env_file" ] && . "$env_file"
155
+ fi
156
+
157
+ api_key="${AI_HUB_API_KEY:-$AI_HUB_PAT}"
158
+
159
+ if [ -z "$AI_HUB_BASE_URL" ] || [ -z "$api_key" ] || [ -z "$AI_HUB_NODE_ID" ]; then
160
+ echo "ai-hub-push.sh: AI Hub not configured (need AI_HUB_BASE_URL, AI_HUB_API_KEY or AI_HUB_PAT, AI_HUB_NODE_ID — env or scripts/ai-hub.env) — push skipped" >&2
161
+ exit 0
162
+ fi
163
+
164
+ correlation_id=""
165
+ activity=""
166
+ tokens=""
167
+ cost_usd=""
168
+ model=""
169
+ actors=""
170
+
171
+ while [ "$#" -gt 0 ]; do
172
+ case "$1" in
173
+ --correlation-id) correlation_id="$2"; shift 2 ;;
174
+ --actor) actors="$actors${actors:+|}$2"; shift 2 ;;
175
+ --activity) activity="$2"; shift 2 ;;
176
+ --tokens) tokens="$2"; shift 2 ;;
177
+ --cost-usd) cost_usd="$2"; shift 2 ;;
178
+ --model) model="$2"; shift 2 ;;
179
+ *) echo "ai-hub-push.sh: unknown argument '$1' — push skipped" >&2; exit 0 ;;
180
+ esac
181
+ done
182
+
183
+ [ -n "$correlation_id" ] && [ -n "$actors" ] || {
184
+ echo "ai-hub-push.sh: --correlation-id and at least one --actor are required — push skipped" >&2
185
+ exit 0
186
+ }
187
+
188
+ if [ -n "$AI_HUB_NODE_ACTIVITY_ID" ]; then
189
+ url="$AI_HUB_BASE_URL/metrics/nodes/$AI_HUB_NODE_ID/node-activities/$AI_HUB_NODE_ACTIVITY_ID/events"
190
+ else
191
+ if [ -z "$activity" ]; then
192
+ echo "ai-hub-push.sh: AI_HUB_NODE_ACTIVITY_ID is unset, so --activity is required — push skipped" >&2
193
+ exit 0
194
+ fi
195
+ url="$AI_HUB_BASE_URL/metrics/nodes/$AI_HUB_NODE_ID/events"
196
+ fi
197
+
198
+ if command -v jq >/dev/null 2>&1; then
199
+ payload="$(
200
+ printf '%s\n' "$actors" | tr '|' '\n' | jq -Rs --arg cid "$correlation_id" --arg act "$activity" \
201
+ --arg tok "$tokens" --arg cost "$cost_usd" --arg model "$model" '
202
+ (split("\n") | map(select(length > 0))) as $actors
203
+ | {
204
+ correlationId: $cid,
205
+ actors: $actors
206
+ }
207
+ + (if $act != "" then {activity: $act} else {} end)
208
+ + (
209
+ ( {}
210
+ + (if $tok != "" then {tokens: ($tok | tonumber)} else {} end)
211
+ + (if $cost != "" then {costUsd: ($cost | tonumber)} else {} end)
212
+ + (if $model != "" then {model: $model} else {} end)
213
+ ) as $dims
214
+ | if ($dims | length) > 0 then {dimensions: $dims} else {} end
215
+ )
216
+ | [.]
217
+ '
218
+ )"
219
+ elif command -v python3 >/dev/null 2>&1; then
220
+ payload="$(python3 - "$correlation_id" "$activity" "$tokens" "$cost_usd" "$model" "$actors" <<'PY'
221
+ import json, sys
222
+ cid, act, tok, cost, model, actors_raw = sys.argv[1:7]
223
+ event = {"correlationId": cid, "actors": [a for a in actors_raw.split("|") if a]}
224
+ if act:
225
+ event["activity"] = act
226
+ dims = {}
227
+ if tok:
228
+ dims["tokens"] = float(tok) if "." in tok else int(tok)
229
+ if cost:
230
+ dims["costUsd"] = float(cost)
231
+ if model:
232
+ dims["model"] = model
233
+ if dims:
234
+ event["dimensions"] = dims
235
+ print(json.dumps([event]))
236
+ PY
237
+ )"
238
+ else
239
+ echo "ai-hub-push.sh needs jq or python3 to build the payload — push skipped" >&2
240
+ exit 0
241
+ fi
242
+
243
+ curl -sf --max-time 5 -X POST \
244
+ -H "Authorization: Bearer $api_key" \
245
+ -H 'Content-Type: application/json' \
246
+ --data "$payload" "$url" >/dev/null \
247
+ || echo "ai-hub-push.sh: push to AI Hub failed or timed out — continuing" >&2
248
+ ```
249
+
250
+ Then `chmod +x scripts/ai-hub-push.sh` and commit it — it contains no secret, only variable references. Design notes worth preserving if the script is edited:
251
+
252
+ - **The script does the JSON encoding, not the caller.** Same reasoning as `notify.sh` — a malformed payload fails on the server side, `curl -f` fails, and the caller learns nothing if it isn't reported. `jq`/`json.dumps` cannot get the escaping wrong.
253
+ - **`--max-time 5`** keeps the promise that pushing never blocks a delivery step.
254
+ - **Missing config or a failed send both exit 0**, but say so on stderr, so an ad-hoc "push an event" request has something truthful to report instead of claiming success.
255
+ - **Plain POSIX shell.** On Windows it needs Git Bash or WSL.
256
+ - **Actors are joined on `|`, not comma**, because an actor name (an email) can't contain `|` but a display name plausibly could contain a comma.
257
+
258
+ ---
259
+
260
+ ## Lifecycle events (the default push set)
261
+
262
+ The agent pushes one event at each of these AI-DLC moments. This set is the default; the project may add or remove events in the master rule file Section 11.
263
+
264
+ | Event | `correlationId` | `--actor` values | Suggested `--activity` |
265
+ |---|---|---|---|
266
+ | Unit marked Done | the unit's id | engineer, AI tool actor | `Build` |
267
+ | Bolt complete (all units Done) | the bolt's id | engineer, AI tool actor | `Build` |
268
+ | UAT sign-off recorded | the intent's id | engineer, AI tool actor | `UAT` |
269
+ | Intent moves to Implemented | the intent's id | engineer, AI tool actor | `Delivery` |
270
+
271
+ Omit `--activity` on any row where `AI_HUB_NODE_ACTIVITY_ID` is configured (activity-scoped endpoint) — the table's `--activity` column applies only to the node-scoped setup, where the project wants events split by activity on one node.
272
+
273
+ Sending is best-effort and must never interrupt the workflow: push the event, then continue the step. Do not wait for or report the push result unless the engineer asked for an ad-hoc send.
274
+
275
+ ---
276
+
277
+ ## Onboarding setup (run once, during installation)
278
+
279
+ Whoever is installing this skill — the onboarding agent as part of full framework setup, or the AI directly when the skill is adopted standalone via the skills catalogue — performs these steps when the engineer opts into AI Hub metrics:
280
+
281
+ **1. Ask whether the project wants AI Hub metrics.**
282
+
283
+ > "Do you want delivery events (units done, bolts complete, UAT sign-off, intents implemented) pushed to 99x AI Hub so the team can see AI-assisted work in one dashboard — tokens, cost, model, and who did it? This is a project-wide setup: one team, one workflow, one shared credential — not per engineer. (You can skip this and add it later.)"
284
+
285
+ If the engineer declines, write Section 11 with **`Status: Disabled`** and stop here.
286
+
287
+ **2. Close the leak paths first, before a credential exists.** Add `scripts/ai-hub.env`, `.envrc`, and `.claude/settings.local.json` to the project's `.gitignore` (create the file if there is none; these three may already be present from the notifications skill — do not duplicate). Confirm with `git check-ignore scripts/ai-hub.env`.
288
+
289
+ **3. Install the send script** at **`scripts/ai-hub-push.sh`** — repository root, not under `{FRAMEWORK_ROOT}`, so it is reachable at a stable relative path and shares no naming collision with `scripts/notify.sh`. Then `chmod +x scripts/ai-hub-push.sh` and commit it.
290
+
291
+ **4. Stop the send prompting for permission.** Add the allow rule alongside any existing ones (merge, never overwrite):
292
+
293
+ - **Claude Code** — `.claude/settings.json`:
294
+ ```json
295
+ { "permissions": { "allow": ["Bash(scripts/ai-hub-push.sh:*)"] } }
296
+ ```
297
+ - **Cursor** — add `scripts/ai-hub-push.sh` to the agent's terminal command allowlist in Cursor Settings.
298
+ - **GitHub Copilot** — allow it in `chat.tools.terminal.autoApprove` (or equivalent) for Copilot agent mode.
299
+
300
+ **5. Hand the engineer Step 1 and Step 2 of *Who does what* above, and wait.** These are theirs, not yours: modeling the workflow and minting a credential is a browser flow under their AI Hub login. Never ask them to paste the API key into the conversation or into a committed file.
301
+
302
+ When they confirm, run *Step 3 — Verify* yourself to check the push reaches AI Hub — the send script exists by now, which is why this step comes after installing it.
303
+
304
+ **6. Populate the master rule file Section 11** (see the setup guide) with `Status: Enabled`, the node/activity id source (env var names, never the values themselves), and the event table.
305
+
306
+ **7. Confirm.** Send one test push (Step 3) and ask the engineer to confirm the event appears in the AI Hub workflow's event list, and that it was sent **without a permission prompt**. If it prompted, step 4 did not take effect.
307
+
308
+ **8. Show the status summary.** Once the test push is confirmed, present the *Status summary* card below to the engineer — this is their record of what was just turned on and how to control it. Do this whether the skill was installed by the full onboarding agent or adopted standalone via the skills catalogue; it is the one moment every setup path shares.
309
+
310
+ ---
311
+
312
+ ## Status summary
313
+
314
+ Show this card at the end of setup (Onboarding setup step 8), and any time the engineer asks "show AI Hub status", "is AI Hub metrics on", or similar — read Section 11 and the configured environment to fill it in:
315
+
316
+ > **AI Hub Metrics: Enabled**
317
+ > - Pushing events for: *[list the events currently in the Section 11 table, e.g. unit Done, bolt complete, UAT sign-off, intent implemented]*
318
+ > - Sending to: `<AI_HUB_BASE_URL>` — open it and go to **Workflows → [your workflow]** to watch events land
319
+ > - Credential: *[team API key / personal access token]*, read from the environment or `scripts/ai-hub.env` — never displayed here
320
+ > - Pause for just this session: *"turn off AI Hub metrics for this session"*
321
+ > - Turn off for the whole project: *"disable AI Hub metrics"*
322
+ > - Turn back on: *"enable AI Hub metrics"*
323
+
324
+ If Section 11 is `Status: Disabled` (or absent), show instead:
325
+
326
+ > **AI Hub Metrics: Disabled** — no events are being pushed to AI Hub. Say "enable AI Hub metrics" to turn it on.
327
+
328
+ Never include the API key/PAT value in this card, even partially — only that a credential is configured and which kind.
329
+
330
+ ---
331
+
332
+ ## Enabling and disabling
333
+
334
+ Three levels, lightest to heaviest — use the lightest one that satisfies what the engineer asked for:
335
+
336
+ 1. **Silence for this session only** — *"turn off AI Hub metrics for this session."* Non-persistent: the agent just skips pushes until the session ends. Section 11 is untouched, so the next session pushes normally again without being asked.
337
+ 2. **Project-wide switch** — *"enable AI Hub metrics"* / *"disable AI Hub metrics"* (also recognize "turn on/off AI Hub integration"). The agent edits Section 11's `Status` field in the master rule file directly, to `Enabled` or `Disabled`, and confirms the new state with the *Status summary* card. Because the master rule file is shared, this takes effect for every engineer's next session immediately — unlike the notifications skill's per-engineer toggle, there is nothing for teammates to individually opt into.
338
+ - **Enabling when nothing is configured yet** (no node/activity id, no credential anywhere): do not just flip the status — that would silently no-op every push. Run the *Onboarding setup* steps above first, then flip Section 11 to `Enabled` as part of step 6.
339
+ - **Enabling when configuration already exists** (Section 11 was previously `Enabled` and only got switched off, or `scripts/ai-hub.env`/the environment already has all required values): flipping `Status` to `Enabled` is enough — verify with one test push (*Step 3 — Verify*) before confirming with the status card.
340
+ - **Disabling** never removes the script, the gitignore entries, or the credential — it only flips the switch. Re-enabling later needs no re-setup as long as the credential is still valid.
341
+ 3. **Revoke the credential** — delete the API key/PAT in AI Hub (**Team → API keys**, or **Settings → Personal access tokens**). Every push then fails closed (silent no-op) regardless of what Section 11 says, until a new credential is configured. Use this — not the Section 11 switch — when the integration must stop working immediately and irreversibly from AI Hub's side: offboarding, or rotating a key that may have leaked.
@@ -0,0 +1,208 @@
1
+ # Skill: Bolt Risk Assessment
2
+
3
+ **Purpose:** Actively interrogate a planned bolt for blast radius, cross-unit sequencing risks, rollback feasibility, and feature flag requirements before the first unit executes. Replaces the passive "Risks and Assumptions" table in the bolt file with structured, AI-driven findings that the engineer signs off on.
4
+
5
+ **Trigger:** Runs after elaboration sign-off and before the first unit in a bolt is executed. Invoked by the mob elaboration protocol automatically after the sign-off summary is confirmed, or directly by the engineer with "run risk assessment for bolt [name]."
6
+
7
+ **Never skip for mature projects.** For projects with existing code, this assessment is mandatory — no unit executes without a signed-off risk assessment in the bolt file. For fresh projects with no existing modules affected, the assessment may be brief but must still be completed.
8
+
9
+ ---
10
+
11
+ ## Step 1 — Read the Bolt and Its Units
12
+
13
+ Read the bolt file and every unit file listed in the bolt's Units table before saying anything.
14
+
15
+ Also read:
16
+ - `process-onboarding-agent/rules/architecture.md` — to understand existing module boundaries and ADRs
17
+ - `process-onboarding-agent/guidelines/forbidden-zones.md` — if it exists, to check whether any unit touches a protected zone
18
+ - The design artifact linked from the intent, if one exists
19
+
20
+ Confirm what you have read:
21
+
22
+ > "I've read the bolt [name] and its [N] units. I'll now assess the blast radius, sequencing risks, rollback approach, and feature flag requirements before execution begins."
23
+
24
+ Do not ask any questions yet — proceed directly to Step 2.
25
+
26
+ ---
27
+
28
+ ## Step 2 — Blast Radius Analysis
29
+
30
+ For each unit in the bolt, work through the following — internally, without asking questions unless something is genuinely ambiguous:
31
+
32
+ **What to assess per unit:**
33
+
34
+ | Question | What to look for |
35
+ |---|---|
36
+ | Which existing files or modules will this unit modify? | Named in the unit's Context or Scope sections |
37
+ | What existing behavior depends on those files? | Cross-references in architecture.md; other units in the bolt or backlog that link to the same modules |
38
+ | What is the worst-case impact if this unit introduces a defect? | Data loss, broken auth, degraded UI, silent failure, cascading failure in downstream modules |
39
+ | Does this unit touch any boundary defined in architecture.md? | API contracts, service boundaries, data ownership rules |
40
+ | Does this unit touch a forbidden zone? | Check forbidden-zones.md if it exists |
41
+
42
+ After assessing all units, produce a blast radius table:
43
+
44
+ ```
45
+ Blast Radius — [Bolt name]
46
+
47
+ | Unit | Modules touched | Existing behavior at risk | Worst-case impact |
48
+ |---|---|---|---|
49
+ | [unit name] | [files/modules] | [behavior description] | [impact level: High / Med / Low] |
50
+ ```
51
+
52
+ Flag any unit rated High immediately before presenting the full table:
53
+
54
+ > "Unit [name] has a high blast radius — it touches [module] which [existing behavior]. I'll highlight this in the assessment."
55
+
56
+ **A mechanical sweep encodes the assumptions that were true of the set it was written for — re-verify them when the set grows.** Where a unit will apply the same scripted edit across many files, its safety rests on a pre-check performed on *those* files: that they all share the shape the script assumes. That premise expires silently. A rebase, a merge, or a concurrent session can add one more file that violates it, and re-running the sweep then damages that file while reporting success. So: re-run the sweep's **pre-checks**, not merely the sweep, after any event that grows the target set; prefer a sweep that **fails loudly on an unexpected shape** over one that transforms whatever it is given; and where the invariant must outlive the sweep, land a **drift-guard test** so the gate enforces it rather than the next author remembering — the sweep fixes today, the guard fixes next week. Damage is proportional to distance from a compile error: an unused import costs one gate run, a wrong behavioural assumption costs a debugging session.
57
+
58
+ ---
59
+
60
+ ## Step 3 — Cross-Unit Sequencing Risks
61
+
62
+ Review the bolt's Execution Order and identify risks that arise specifically from the order units run in — not from individual units in isolation.
63
+
64
+ Look for:
65
+
66
+ - **State dependency risk:** Unit B assumes a state that Unit A creates. If Unit A fails mid-way, what is the system state?
67
+ - **Partial rollout risk:** If the bolt is interrupted after some units are done but before others, is the system in a consistent state?
68
+ - **Shared resource contention:** Two units that modify the same file, table, or config. If run in parallel, do they conflict?
69
+ - **Contract mismatch risk:** A unit that changes an interface that a later unit in the same bolt consumes. If the producer unit changes shape after the consumer unit is written, do they fall out of sync?
70
+
71
+ Produce a sequencing risk table if any risks are found:
72
+
73
+ ```
74
+ Sequencing Risks
75
+
76
+ | Risk | Units involved | Condition | Mitigation |
77
+ |---|---|---|---|
78
+ | [description] | [unit A → unit B] | [when this occurs] | [how to prevent or recover] |
79
+ ```
80
+
81
+ If no sequencing risks exist, state: "No cross-unit sequencing risks identified."
82
+
83
+ ---
84
+
85
+ ## Step 4 — Rollback Assessment
86
+
87
+ For the bolt as a whole, determine the rollback approach. Ask the engineer only if the answer cannot be determined from the unit files and architecture:
88
+
89
+ Assess each of the following:
90
+
91
+ **Code rollback:** Can reverting the commits for this bolt's units restore the previous behavior without side effects? Look for: database migrations in any unit (once applied, may not be reversible), external API calls that mutate state (webhooks sent, emails triggered, records created in third-party systems), or file system changes outside the repo.
92
+
93
+ **Data rollback:** Does any unit write to a database schema or seed data in a way that cannot be undone by reverting the code? If yes, a data rollback script or migration must be part of the unit's Definition of Done.
94
+
95
+ **Partial rollback:** If only some units in the bolt are merged when a problem is found, can those units be reverted independently, or do they form an atomic group that must be reverted together?
96
+
97
+ Produce a rollback summary:
98
+
99
+ ```
100
+ Rollback Assessment
101
+
102
+ Code rollback: [Safe — revert commits restores prior state]
103
+ [Unsafe — [reason]: engineer must [action] before reverting]
104
+
105
+ Data rollback: [Not required — no schema or data changes]
106
+ [Required — migration needed: [description]]
107
+
108
+ Partial rollback:[Each unit is independently revertible]
109
+ [Units [X] and [Y] must be reverted together — [reason]]
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Step 5 — Feature Flag Requirement
115
+
116
+ Determine whether any unit in the bolt changes behavior that an existing user would observe in production — even if the change is intentional. The question is not whether the change is correct, but whether it should be introduced progressively.
117
+
118
+ Assess each unit against these criteria:
119
+
120
+ | Criterion | Feature flag required? |
121
+ |---|---|
122
+ | Changes the behavior of an existing feature visible to end users | Yes |
123
+ | Adds a new capability that replaces or competes with an existing one | Yes |
124
+ | Changes an API response shape consumed by existing clients | Yes |
125
+ | Modifies internal logic with no user-visible effect | No |
126
+ | Adds a new endpoint or screen that does not affect existing flows | No — unless explicitly required by project policy |
127
+
128
+ If a feature flag is required for any unit, state which unit(s) and what behavior the flag gates. If the project has a feature flag convention (in architecture.md or code-standards.md), reference it. If no convention is established, flag this as an open question for the engineer:
129
+
130
+ > "Unit [name] changes [behavior] which existing users will observe. A feature flag is required. Does this project have an established feature flag pattern, or should I log establishing one as an open question?"
131
+
132
+ ---
133
+
134
+ ## Step 6 — Risk Assessment Sign-off
135
+
136
+ Present the full assessment before writing anything to the bolt file:
137
+
138
+ ```
139
+ Risk Assessment — [Bolt name]
140
+
141
+ BLAST RADIUS
142
+ [paste blast radius table from Step 2]
143
+
144
+ SEQUENCING RISKS
145
+ [paste sequencing risk table from Step 3, or "None identified"]
146
+
147
+ ROLLBACK
148
+ [paste rollback summary from Step 4]
149
+
150
+ FEATURE FLAGS
151
+ [list units requiring flags, or "None required"]
152
+
153
+ HIGH-PRIORITY ITEMS (requiring engineer decision before execution):
154
+ [list any High blast radius units, unsafe rollbacks, or open feature flag questions]
155
+ [or "None — assessment is clear to proceed"]
156
+
157
+ Sign off to proceed with unit execution?
158
+ ```
159
+
160
+ If the engineer raises concerns or requests changes to the assessment, revise the relevant section and present the summary again. Do not proceed to Step 7 until the engineer explicitly confirms sign-off.
161
+
162
+ ---
163
+
164
+ ## Step 7 — Write to the Bolt File
165
+
166
+ Replace the bolt file's "Risks and Assumptions" section with the signed-off assessment. Do not keep the original passive table — it is superseded by this output.
167
+
168
+ Write the following structure into the bolt file:
169
+
170
+ ```markdown
171
+ ## Risk Assessment
172
+
173
+ **Assessed:** YYYY-MM-DD
174
+ **Status:** Signed off by engineer before execution
175
+
176
+ ### Blast Radius
177
+
178
+ | Unit | Modules touched | Existing behavior at risk | Impact |
179
+ |---|---|---|---|
180
+ | [unit] | [modules] | [behavior] | High / Med / Low |
181
+
182
+ ### Sequencing Risks
183
+
184
+ | Risk | Units involved | Condition | Mitigation |
185
+ |---|---|---|---|
186
+ | [description] | [units] | [condition] | [mitigation] |
187
+
188
+ _(or: No sequencing risks identified.)_
189
+
190
+ ### Rollback
191
+
192
+ - **Code rollback:** [safe / unsafe — reason and required action]
193
+ - **Data rollback:** [not required / required — description]
194
+ - **Partial rollback:** [independently revertible / must revert together — units and reason]
195
+
196
+ ### Feature Flags
197
+
198
+ - [Unit name]: gates [behavior description]
199
+ _(or: No feature flags required.)_
200
+
201
+ ### Open Items
202
+
203
+ - [Any items the engineer must resolve before or during execution, or "None"]
204
+ ```
205
+
206
+ After writing, confirm:
207
+
208
+ > "Risk assessment written to the bolt file. All [N] open items (if any) must be resolved before the affected units execute. Ready to begin unit execution — say 'execute unit [first unit name]' to start."
@@ -0,0 +1,105 @@
1
+ # Skill: Bug Bolt
2
+
3
+ **Purpose:** A lightweight bolt workflow for fixing a specific, reproducible bug. Replaces the full mob elaboration ceremony with a focused intake, recurrence check, and a single unit — while preserving all quality gates (prompt gate, pre-generation checks, review checklist) and the post-fix retro.
4
+
5
+ **Trigger:** Engineer says "fix a bug in X", "there's a bug in X", or "bug: [description]". Routed from Section 6 of the master rule file. Do not run a full mob elaboration when this trigger is detected — load this skill and follow its steps instead.
6
+
7
+ **Requires:** A fully onboarded AI-DLC project. The master rule file, quality gate (`rules/prompt-quality-gate.md`), review checklist (`skills/review-checklist.md`), unit and bolt templates, and the `ops/` folder structure must all be in place. This skill is a bolt-type variant that operates within the framework — it is not a standalone bug-tracking tool. If AI-DLC is not yet installed, start with `process-onboarding-agent/onboard.md` first.
8
+
9
+ **What this skill does not replace:** intent files, mob elaboration (for new features), UAT, the retro, or the Post-Retro Improvement Workflow. A bug bolt is strictly scoped to fixing a known defect — use the standard feature flow for any work that adds or changes behavior.
10
+
11
+ ---
12
+
13
+ ## Step 1 — Bug Intake
14
+
15
+ Ask the engineer four questions in one message:
16
+
17
+ > "To scope this fix accurately, please tell me:
18
+ > 1. **What is the bug?** Describe the symptom — what the user or system experiences.
19
+ > 2. **Where does it occur?** Name the component, file, function, or user flow.
20
+ > 3. **How is it reproduced?** List the steps or conditions that trigger it.
21
+ > 4. **What is the expected behavior?** What should happen instead?"
22
+
23
+ Record all four answers before proceeding.
24
+
25
+ ---
26
+
27
+ ## Step 2 — Recurrence Check
28
+
29
+ Search the project's retro files and incident files for similar descriptions.
30
+
31
+ - If a similar pattern appears in more than one retro or incident: note it as **recurring**. Root Cause Analysis is mandatory after the fix.
32
+ - If no similar pattern is found: proceed without the RCA flag.
33
+
34
+ State the recurrence finding to the engineer before continuing.
35
+
36
+ ---
37
+
38
+ ## Step 3 — Scope the Fix
39
+
40
+ Identify the minimum set of changes needed to fix the bug without side effects. Ask if unsure:
41
+
42
+ > "Is this fix isolated to [component], or are there other places where the same logic runs?"
43
+
44
+ If multiple components are affected, each becomes a separate unit.
45
+
46
+ ---
47
+
48
+ ## Step 4 — Create the Unit
49
+
50
+ Create a single unit file using the standard unit template with these constraints:
51
+
52
+ **Context:** What is broken and why — a precise technical statement, not a vague description.
53
+
54
+ **Acceptance Criteria:**
55
+ ```
56
+ Given [the conditions that trigger the bug]
57
+ When [the action that exposes it]
58
+ Then [the system behaves correctly — the expected behavior from Step 1]
59
+
60
+ Given [the same triggering conditions]
61
+ When [the fix is NOT present — regression guard]
62
+ Then [the broken behavior is detectable — confirm a test would catch a regression]
63
+ ```
64
+
65
+ At least one unhappy-path AC must be included.
66
+
67
+ **Scope:**
68
+ - In scope: the specific function, query, component, or flow causing the bug
69
+ - Out of scope: refactoring unrelated code, adding features, "while we're here" changes
70
+
71
+ **Pre-generation checks:** Grep for the affected function or component before generating. Confirm no duplicate fix already exists.
72
+
73
+ **Observability:** Define a log entry or metric that confirms the bug no longer occurs in production.
74
+
75
+ ---
76
+
77
+ ## Step 5 — Risk Assessment
78
+
79
+ Before execution, ask one question:
80
+
81
+ > "Does this fix touch any shared component, database schema, or API contract used by other intents or services?"
82
+
83
+ If yes: run `process-onboarding-agent/skills/bolt-risk-assessment.md` and record the blast radius in the bolt file.
84
+ If no: record "Blast radius: isolated to [component]. No shared interfaces affected."
85
+
86
+ ---
87
+
88
+ ## Step 6 — Execute and Verify
89
+
90
+ Execute the unit. Review output using `process-onboarding-agent/skills/review-checklist.md`.
91
+
92
+ After output is accepted, confirm the fix:
93
+
94
+ > "Can you verify the bug is resolved against the reproduction steps from Step 1?"
95
+
96
+ Do not close the unit until the engineer confirms the fix is verified.
97
+
98
+ ---
99
+
100
+ ## Step 7 — Close
101
+
102
+ 1. Mark unit Done. Mark bolt Done. Update the backlog.
103
+ 2. Create a retro file and run the Post-Retro Improvement Workflow.
104
+ 3. If the bug was flagged as **recurring** in Step 2: read `process-onboarding-agent/skills/root-cause-analysis.md` and run it now. Do not skip.
105
+ 4. If the bug caused a production impact: create or update an incident file at `ops/operate/incidents/`.