@cbartens/bkit 5.4.0 → 5.5.0

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 (111) hide show
  1. package/.bkit/README.md +18 -6
  2. package/.bkit/core/.agents/rules.md +7 -8
  3. package/.bkit/core/.bkit/README.md +17 -5
  4. package/.bkit/core/.bkit/cloud.md +44 -13
  5. package/.bkit/core/.bkit/comparison.md +2 -2
  6. package/.bkit/core/.bkit/install.md +16 -14
  7. package/.bkit/core/.bkit/pipeline.md +3 -1
  8. package/.bkit/core/.bkit/prompts.md +12 -9
  9. package/.bkit/core/.bkit/providers.md +6 -6
  10. package/.bkit/core/.bkit/templates.md +12 -6
  11. package/.bkit/core/.bkit/trackers.md +89 -34
  12. package/.bkit/core/.bkit/workflows.md +42 -38
  13. package/.bkit/core/AGENTS.md +2 -2
  14. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +1 -1
  15. package/.bkit/core/docs/templates/bkit-audit-issues.md +22 -6
  16. package/.bkit/core/engine/checks/after/auth.ts +88 -45
  17. package/.bkit/core/engine/checks/after/github.ts +18 -5
  18. package/.bkit/core/engine/checks/after/index.ts +1 -1
  19. package/.bkit/core/engine/checks/after/tools.ts +1 -1
  20. package/.bkit/core/engine/checks/before/env.ts +28 -18
  21. package/.bkit/core/engine/checks/before/mcp.ts +4 -2
  22. package/.bkit/core/engine/checks/tips/catalogue.ts +15 -2
  23. package/.bkit/core/engine/cli.ts +7 -5
  24. package/.bkit/core/engine/commands/ci/ci.ts +107 -0
  25. package/.bkit/core/engine/commands/install/uninstall.ts +46 -0
  26. package/.bkit/core/engine/commands/workflow/fids.ts +23 -15
  27. package/.bkit/core/engine/commands/workflow/issues.ts +35 -16
  28. package/.bkit/core/engine/commands/workflow/ledgers.ts +28 -11
  29. package/.bkit/core/engine/commands/workflow/prs.ts +3 -1
  30. package/.bkit/core/engine/commands/workflow/repo.ts +6 -0
  31. package/.bkit/core/engine/commands/workflow/roadmap.ts +5 -1
  32. package/.bkit/core/engine/commands/workflow/steps.ts +2 -2
  33. package/.bkit/core/engine/commands/workflow/workflows.ts +9 -4
  34. package/.bkit/core/engine/install/manifest.ts +31 -10
  35. package/.bkit/core/engine/install/modules/cloud.ts +3 -1
  36. package/.bkit/core/engine/install/modules/core.ts +82 -4
  37. package/.bkit/core/engine/install/modules/opencode.ts +5 -0
  38. package/.bkit/core/engine/install/write.ts +37 -1
  39. package/.bkit/core/engine/render/trackers.ts +35 -23
  40. package/.bkit/core/engine/shared/egress.ts +6 -0
  41. package/.bkit/core/engine/shared/settings.ts +88 -1
  42. package/.bkit/core/hooks/guardrails-tiers.js +1 -1
  43. package/.bkit/core/prompts/bkit-audit-generate.md +42 -12
  44. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +1 -1
  45. package/.bkit/core/prompts/bkit-build-challenge-tests.md +1 -1
  46. package/.bkit/core/prompts/bkit-build-plan-execute.md +1 -1
  47. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +1 -1
  48. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +1 -1
  49. package/.bkit/core/prompts/bkit-debug-failure-reproduce.md +1 -1
  50. package/.bkit/core/prompts/bkit-debug-failure-soak.md +1 -1
  51. package/.bkit/core/prompts/bkit-design-generate.md +2 -1
  52. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +1 -1
  53. package/.bkit/core/prompts/bkit-utility-update-decisions.md +3 -1
  54. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +3 -1
  55. package/.bkit/core/prompts/bkit-utility-update-documentation.md +11 -1
  56. package/.bkit/core/prompts/bkit-utility-update-failures.md +3 -1
  57. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +3 -1
  58. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +9 -2
  59. package/.bkit/core/prompts/bkit-utility-update-tracker.md +159 -0
  60. package/.bkit/core/workflows/bkit-auto.md +19 -6
  61. package/.bkit/core/workflows/bkit-build.md +59 -17
  62. package/.bkit/core/workflows/bkit-debug.md +64 -20
  63. package/.bkit/core/workflows/bkit-design.md +83 -28
  64. package/.bkit/core/workflows/bkit-plan.md +61 -20
  65. package/.bkit/core/workflows/bkit-ship.md +48 -18
  66. package/.bkit/shared/.bkit/.env.example +8 -0
  67. package/.bkit/shared/.claude/settings.json +3 -1
  68. package/.bkit/shared/.cursor/bkit-cloud.md +2 -2
  69. package/.bkit/shared/.cursor/mcp.json +11 -4
  70. package/.bkit/shared/.mcp.json +11 -4
  71. package/.bkit/shared/.opencode/opencode.json +2 -0
  72. package/.bkit/shared/docs/deployments.md +15 -4
  73. package/.bkit/shared/docs/security.md +1 -1
  74. package/.bkit/shared/docs/testing.md +3 -3
  75. package/.bkit/templates/.github/renovate.json5 +1 -1
  76. package/.bkit/templates/.github/workflows/bkit-ci.yml +22 -54
  77. package/.bkit/templates/.github/workflows/bkit-cloud.yml +40 -12
  78. package/.bkit/templates/.husky/pre-commit +4 -4
  79. package/.bkit/templates/.husky/pre-push +62 -12
  80. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.mjs +138 -0
  81. package/.bkit/templates/scripts/ci/lanes/check-tree-cache.test.mjs +181 -0
  82. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +1 -1
  83. package/CHANGELOG.md +37 -1
  84. package/README.md +7 -6
  85. package/dist/checks/after/auth.js +81 -45
  86. package/dist/checks/after/github.js +17 -5
  87. package/dist/checks/after/index.js +1 -1
  88. package/dist/checks/after/tools.js +1 -1
  89. package/dist/checks/before/env.js +24 -17
  90. package/dist/checks/before/mcp.js +4 -2
  91. package/dist/checks/tips/catalogue.js +14 -2
  92. package/dist/cli.js +7 -5
  93. package/dist/commands/ci/ci.js +100 -0
  94. package/dist/commands/install/uninstall.js +42 -0
  95. package/dist/commands/workflow/fids.js +22 -15
  96. package/dist/commands/workflow/issues.js +28 -15
  97. package/dist/commands/workflow/ledgers.js +26 -11
  98. package/dist/commands/workflow/prs.js +3 -1
  99. package/dist/commands/workflow/repo.js +5 -0
  100. package/dist/commands/workflow/roadmap.js +3 -1
  101. package/dist/commands/workflow/steps.js +2 -2
  102. package/dist/commands/workflow/workflows.js +9 -4
  103. package/dist/install/manifest.js +30 -10
  104. package/dist/install/modules/cloud.js +3 -1
  105. package/dist/install/modules/core.js +82 -5
  106. package/dist/install/modules/opencode.js +6 -0
  107. package/dist/install/write.js +26 -2
  108. package/dist/render/trackers.js +34 -20
  109. package/dist/shared/egress.js +6 -0
  110. package/dist/shared/settings.js +39 -0
  111. package/package.json +11 -2
package/README.md CHANGED
@@ -32,7 +32,7 @@
32
32
 
33
33
  AI coding agents are fast, but on their own they skip what makes software safe to ship: a design someone challenged, a plan someone checked, a second pair of eyes on every change, tests that actually ran. **Vibe coding gets you a demo. Production takes a process.**
34
34
 
35
- **bkit is that process, ready-made.** Describe a feature in a GitHub or Linear issue and type one command:
35
+ **bkit is that process, ready-made.** Describe a feature in a GitHub, Linear or Jira issue and type one command:
36
36
 
37
37
  ```text
38
38
  /bkit-design ISSUE-123
@@ -167,7 +167,7 @@ What that gets you:
167
167
  - **The fences grow with every feature.** Each build adds tests every later change has to pass. A prompt-only framework is as strict on your fiftieth feature as on your first; bkit gets stricter.
168
168
  - **What's sent back is evidence, not a verdict.** A red lane hands debug the failing logs and what changed since the last green run, so the fix starts from the actual error, not a guess.
169
169
  - **Agents look before they change anything.** Code search ([Serena](https://github.com/oraios/serena)) shows every definition and caller of the code about to change, not just lines with matching words, and [graphify](https://github.com/Graphify-Labs/graphify)'s code map shows what already exists. Fewer bad changes reach the fences at all.
170
- - **Problems are caught at the nearest fence.** Agent hooks nudge on every edit: read a file before changing it, fix the code rather than loosen a check. The pre-commit hook formats in seconds. The pre-push hook runs type checks, unit tests, the prose checker and the junk-code scanner before anything leaves your laptop. CI keeps only what can't run there: integration, end-to-end and live-site tests. Hooks, agents and CI's quick-checks lane all run the same `bkit:gate:*` scripts, so most failures show up on your machine first.
170
+ - **Problems are caught at the nearest fence.** Agent hooks nudge on every edit: read a file before changing it, fix the code rather than loosen a check. The pre-commit hook formats in seconds. The pre-push hook runs type checks, unit tests, integration tests (once you declare that gate), the prose checker and the junk-code scanner before anything leaves your laptop. CI keeps only what can't run there: end-to-end and live-site tests. Hooks, agents and CI's quick-checks lane all run the same `bkit:gate:*` scripts, so most failures show up on your machine first.
171
171
 
172
172
  The agent hooks come with install. Serena, graphify and the git hooks are [templates](#templates) you adopt. Compared with other frameworks: [agents and CI](.bkit/comparison.md#agents-and-ci).
173
173
 
@@ -199,7 +199,7 @@ How the lanes join into the one final check, and what happens on green or red: [
199
199
  <p align="center">
200
200
  <picture>
201
201
  <source media="(prefers-color-scheme: dark)" srcset=".github/assets/bkit-context-dark.svg">
202
- <img alt="What it knows: right context, right step, written back as it learns. In your repo, bkit reads project docs at every step and updates them at ship; reads and writes lessons, decisions, postponed work and known bugs; writes designs and plans that later steps read; reads audit reports at plan and a code map at every step; keeps run state and stats at every step; adds skills at build and removes them at ship. Outside your repo, it reads and updates the GitHub or Linear issue at every step, searches related issues at design, plan and debug, searches the web at design and debug, reads CI runs and test reports at debug and ship, reads runtime platforms such as Sentry, Vercel, Supabase and Stripe at debug, and opens, fixes and merges the pull request." src=".github/assets/bkit-context-light.svg" width="100%">
202
+ <img alt="What it knows: right context, right step, written back as it learns. In your repo, bkit reads project docs at every step and updates them at ship; reads and writes lessons, decisions, postponed work and known bugs; writes designs and plans that later steps read; reads audit reports at plan and a code map at every step; keeps run state and stats at every step; adds skills at build and removes them at ship. Outside your repo, it reads and updates the GitHub, Linear or Jira issue at every step, searches related issues at design, plan and debug, searches the web at design and debug, reads CI runs and test reports at debug and ship, reads runtime platforms such as Sentry, Vercel, Supabase and Stripe at debug, and opens, fixes and merges the pull request." src=".github/assets/bkit-context-light.svg" width="100%">
203
203
  </picture>
204
204
  </p>
205
205
 
@@ -207,7 +207,7 @@ How the lanes join into the one final check, and what happens on green or red: [
207
207
 
208
208
  - **Docs that keep themselves current.** Install sets up the docs a professional project keeps: architecture, data schema, deployments, testing, security, monitoring, design system, tech stack and local setup. Agents fill them in as they work, `/bkit-ship` updates them after every feature, and [an index](.agents/docs.md) tells each agent which docs to read at each step. They stay current because the agents depend on them.
209
209
  - **Project memory agents actually read.** Four ledgers record lessons from every fix (`docs/knowledge.jsonl`), decisions and their reasons (`docs/decisions.jsonl`), work consciously postponed (`docs/deferrals.jsonl`) and known bugs (`docs/failures.jsonl`). Plan reviewers see the past bugs and postponed work closest to the new feature, debug reads the lessons first, and `/bkit-ship` checks nothing postponed was quietly dropped. Four utility agents keep them honest: they correct lessons and decisions the code has since contradicted, and close postponed work and known bugs that have already been fixed.
210
- - **Tracker issues are memory too.** Every step reads the whole tracker issue (e.g. GitHub, Linear), comments included, and adds what it did as a new comment without editing earlier ones, so the issue becomes the feature's running record. bkit skips its own comments when it reads, so agents act on what people wrote. Design, plan and debug also search your other tracker issues, closed ones included, for earlier designs, duplicate work and past incidents.
210
+ - **Tracker issues are memory too.** Every step reads the whole tracker issue (e.g. GitHub, Linear, Jira), comments included, and adds what it did as a new comment without editing earlier ones, so the issue becomes the feature's running record. bkit skips its own comments when it reads, so agents act on what people wrote. Design, plan and debug also search your other tracker issues, closed ones included, for earlier designs, duplicate work and past incidents.
211
211
  - **Outside evidence, when it's needed.** Design searches the web for feasibility. Debug pulls failed CI logs, the diff since the last green run, end-to-end reports and runtime errors. 10+ ready-made connectors cover GitHub, Sentry, Vercel, Supabase, Stripe, Expo, Playwright, Maestro, Inngest, Resend, Cloud Run, Tavily web search and Serena, each easy to customise, extend or leave out. A connector that isn't set up is reported as such, never read as "all clear".
212
212
  - **Progress lives in your repo, not a chat window.** Run state is saved after every step, so a crashed run resumes where it stopped, on any tool.
213
213
 
@@ -287,9 +287,10 @@ All templates, what each is for, and how to install them: [`.bkit/templates.md`]
287
287
 
288
288
  ### Your tracker is the control panel
289
289
 
290
- - **Every run lives on the tracker issue.** bkit reads the tracker issue (e.g. GitHub, Linear), posts progress as it goes, moves the issue along and links the pull request.
290
+ - **Every run lives on the tracker issue.** bkit reads the tracker issue (e.g. GitHub, Linear, Jira), posts progress as it goes, moves the issue along and links the pull request.
291
291
  - **Issues that start the right step.** Optional issue forms for a new idea, a well-defined change or a bug ask for what the agents read first, and each names the command to run next. A well-defined change can be the plan itself: what done looks like, the tests and the tasks.
292
292
  - **It tells you what to work on next.** `@bkit-utility-update-roadmap` reads your board and the open known bugs and postponed work from the ledgers, then writes a ranked shortlist into `docs/roadmap.md`.
293
+ - **It keeps the tracker tidy.** `@bkit-utility-update-tracker` brings open issues in line with the tracker rules: short titles, the right labels, board status, priority, size, milestone, parent and blocked-by links. It takes priorities from the latest issue prioritisation audit and suggests new milestones and parent issues, but never creates or closes an issue.
293
294
  - **See it live:** [bkit's own board](https://github.com/users/cbartens/projects/1/views/1), and the shortlist bkit ranked from it in [`docs/roadmap.md`](docs/roadmap.md).
294
295
 
295
296
  ### You stay in control
@@ -372,7 +373,7 @@ No full run, from design to merge, has taken longer than a day. Each run posts i
372
373
  **Not without your sign-off.** In the full workflows, work happens in a separate copy of the repo, goes through a pull request, must pass every test, and merges into `dev`, never `main`. Lite workflows skip the pull request and CI, which is why they're only for small, clearly safe changes.
373
374
 
374
375
  **Which issue tracker, and which code host?**
375
- GitHub Issues or Linear for the tracker. The code has to live on GitHub: pull requests, CI and cloud mode run there.
376
+ GitHub Issues, Linear or Jira for the tracker. The code has to live on GitHub: pull requests, CI and cloud mode run there.
376
377
 
377
378
  **Is this the bkit Vibecoding Kit?**
378
379
  No. [bkit Vibecoding Kit](https://github.com/popup-studio-ai/bkit-claude-code) is a separate project that shares the name. This bkit is `@cbartens/bkit` on npm, at [github.com/cbartens/bkit](https://github.com/cbartens/bkit).
@@ -2,7 +2,7 @@
2
2
  // the cloud router's), and the cloud-dashboard secrets checklist.
3
3
  import * as fs from "node:fs";
4
4
  import * as path from "node:path";
5
- import { execSync } from "node:child_process";
5
+ import { spawnSync } from "node:child_process";
6
6
  import { readJsonFile } from "../../shared/json.js";
7
7
  import { readBkitConfig } from "../../shared/settings.js";
8
8
  /**
@@ -68,27 +68,33 @@ export function detectGhMcpToken(cwd) {
68
68
  }
69
69
  return null;
70
70
  }
71
+ /**
72
+ * Names of the consumer repo's GitHub Actions secrets or variables (repo level only).
73
+ * `null` if gh CLI unavailable, unauthenticated, or not a GitHub repo.
74
+ */
75
+ function listGhNames(kind) {
76
+ const res = spawnSync("gh", [kind, "list", "--json", "name", "-q", ".[].name"], {
77
+ encoding: "utf-8",
78
+ stdio: ["ignore", "pipe", "ignore"],
79
+ timeout: 5000,
80
+ });
81
+ if (res.status !== 0 || typeof res.stdout !== "string")
82
+ return null;
83
+ return res.stdout
84
+ .split("\n")
85
+ .map((s) => s.trim())
86
+ .filter(Boolean);
87
+ }
71
88
  /**
72
89
  * Detect whether a named secret is set on the consumer's GitHub repo.
73
90
  * Returns "present" | "missing" | "unknown".
74
91
  * "unknown" if gh CLI unavailable, unauthenticated, or not a GitHub repo.
75
92
  */
76
93
  export function detectGhSecret(secretName) {
77
- try {
78
- const out = execSync(`gh secret list --json name -q '.[].name'`, {
79
- encoding: "utf-8",
80
- stdio: ["ignore", "pipe", "ignore"],
81
- timeout: 5000,
82
- });
83
- const names = out
84
- .split("\n")
85
- .map((s) => s.trim())
86
- .filter(Boolean);
87
- return names.includes(secretName) ? "present" : "missing";
88
- }
89
- catch {
94
+ const names = listGhNames("secret");
95
+ if (names === null)
90
96
  return "unknown";
91
- }
97
+ return names.includes(secretName) ? "present" : "missing";
92
98
  }
93
99
  /**
94
100
  * Build the consolidated "three locations to sync secrets" advisory. Fires when
@@ -105,17 +111,19 @@ export function buildCloudDashboardsAdvisory(cwd) {
105
111
  const hasCursor = fs.existsSync(path.join(cwd, ".cursor"));
106
112
  if (!hasRouter && !hasClaude && !hasCursor)
107
113
  return null;
108
- // cloud=claude path (bkit-cloud.yml): GitHub-tracker only, ANTHROPIC_API_KEY only.
109
- // cloud=cursor path (.cursor/): BKIT_LINEAR_API_KEY for Cursor dashboard.
110
- // Distinguish by recorded variant; fall back to presence-based detection.
111
- const recordedVariant = readBkitConfig(cwd).cloudAgents;
112
- const isCursorCloud = recordedVariant === "cursor" || (!hasRouter && hasCursor);
114
+ // cloud=claude path (bkit-cloud.yml): GitHub-tracker only, ANTHROPIC_API_KEY or federation.
115
+ // cloud=cursor path (.cursor/): BKIT_LINEAR_API_KEY for Cursor dashboard; Linear-tracker only.
116
+ // Distinguish by recorded variant; fall back to presence-based detection under linear.
117
+ const config = readBkitConfig(cwd);
118
+ const isCursorCloud = config.cloudAgents === "cursor" ||
119
+ (!hasRouter && hasCursor && config.issueTracker === "linear");
113
120
  const secretList = isCursorCloud ? "`BKIT_LINEAR_API_KEY`" : "`ANTHROPIC_API_KEY`";
114
121
  const ghSetLines = isCursorCloud
115
122
  ? " gh secret set BKIT_LINEAR_API_KEY --body='<value>'\n\n" +
116
123
  " Verify: `gh secret list | grep -E 'BKIT_LINEAR_API_KEY'`\n\n"
117
124
  : " gh secret set ANTHROPIC_API_KEY --body='<value>'\n\n" +
118
- " Verify: `gh secret list | grep -E 'ANTHROPIC_API_KEY'`\n\n";
125
+ " Verify: `gh secret list | grep -E 'ANTHROPIC_API_KEY'`\n\n" +
126
+ " Keyless alternative for bkit-cloud.yml (workload identity federation): leave the secret unset and set the `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` repo variables (`gh variable set`) from a Claude Console federation rule.\n\n";
119
127
  const vendorNote = isCursorCloud
120
128
  ? "BKIT_LINEAR_API_KEY is read from the Linear dashboard (https://linear.app/settings/api)."
121
129
  : "ANTHROPIC_API_KEY is read from the Anthropic dashboard (https://console.anthropic.com/settings/keys); `.bkit/.env` holds the same value as BKIT_ANTHROPIC_API_KEY. The Claude GitHub App (`/install-github-app`) is also required for `cloud=claude`.";
@@ -133,35 +141,63 @@ export function buildCloudDashboardsAdvisory(cwd) {
133
141
  vendorNote,
134
142
  };
135
143
  }
144
+ /** Repo variables that, both set, switch bkit-cloud.yml's claude job to workload identity federation. */
145
+ const FEDERATION_VARIABLES = ["ANTHROPIC_FEDERATION_RULE_ID", "ANTHROPIC_ORGANIZATION_ID"];
136
146
  /**
137
- * Detect whether the GitHub Actions secrets `bkit-cloud.yml` needs are set.
138
- * Only fires when `.github/workflows/bkit-cloud.yml` exists. `ANTHROPIC_API_KEY` is
139
- * always required (claude-code-action) for the cloud=claude path. The workflow is
140
- * GitHub-tracker only — no `BKIT_LINEAR_API_KEY` dependency. Returns one finding per
141
- * missing secret.
147
+ * Detect whether `bkit-cloud.yml`'s claude job has a credential. Only fires when
148
+ * `.github/workflows/bkit-cloud.yml` exists. The claude job (claude-code-action) takes the
149
+ * `ANTHROPIC_API_KEY` repo secret OR workload identity federation (both
150
+ * `FEDERATION_VARIABLES` repo variables). The workflow is GitHub-tracker only — no
151
+ * `BKIT_LINEAR_API_KEY` dependency. Silent when gh cannot list secrets; when only the
152
+ * variables are unlistable, a missing key still raises the missing-credential finding.
142
153
  */
143
154
  export function detectCiRouterSecrets(cwd) {
144
- const findings = [];
145
155
  const routerPath = path.join(cwd, ".github", "workflows", "bkit-cloud.yml");
146
156
  if (!fs.existsSync(routerPath))
147
- return findings;
148
- // bkit-cloud.yml is cloud=claude / GitHub-tracker only — ANTHROPIC_API_KEY (GHA secret
149
- // name claude-code-action reads). Local `.bkit/.env` stores the same value as
150
- // BKIT_ANTHROPIC_API_KEY. No BKIT_LINEAR_API_KEY dependency.
151
- const required = ["ANTHROPIC_API_KEY"];
152
- for (const name of required) {
153
- const status = detectGhSecret(name);
154
- if (status === "missing") {
155
- findings.push({
156
- id: `${name.toLowerCase().replace(/_/g, "-")}-secret-missing`,
157
+ return [];
158
+ const key = detectGhSecret("ANTHROPIC_API_KEY");
159
+ if (key === "unknown")
160
+ return [];
161
+ const variables = listGhNames("variable");
162
+ const federated = variables !== null && FEDERATION_VARIABLES.every((v) => variables.includes(v));
163
+ if (key === "present" && federated) {
164
+ return [
165
+ {
166
+ id: "anthropic-api-key-shadows-federation",
167
+ severity: "advisory",
168
+ detect: "The `ANTHROPIC_API_KEY` repo secret and the `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` repo variables are all set. claude-code-action uses the key and skips workload identity federation.",
169
+ action: "To run keyless, delete the secret: `gh secret delete ANTHROPIC_API_KEY`. To stay on the key, delete the variables: `gh variable delete ANTHROPIC_FEDERATION_RULE_ID` and `gh variable delete ANTHROPIC_ORGANIZATION_ID`.",
170
+ },
171
+ ];
172
+ }
173
+ if (key === "present")
174
+ return [];
175
+ if (federated) {
176
+ if (fs.readFileSync(routerPath, "utf-8").includes("anthropic_federation_rule_id:"))
177
+ return [];
178
+ return [
179
+ {
180
+ id: "anthropic-federation-template-stale",
157
181
  severity: "advisory",
158
- detect: `gh secret list confirms ${name} secret is NOT set on this GitHub repo.`,
159
- action: `\`.github/workflows/bkit-cloud.yml\` requires ${name} to invoke its Claude Code action. Without it, the workflow exits no-op.\n\nSet the secret:\n\n` +
160
- ` gh secret set ${name} --body='<paste-value-here>'\n\n` +
161
- `Then verify: \`gh secret list | grep ${name}\`. The workflow itself does not need redeploying — secrets are read at run time.`,
162
- });
163
- }
164
- // "unknown" → silent skip (CLI absent / unauthenticated).
182
+ detect: "The `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` repo variables are set, but `.github/workflows/bkit-cloud.yml` does not pass `anthropic_federation_rule_id` to claude-code-action — the claude job exits no-op.",
183
+ action: "Re-copy the template: `cp .bkit/templates/.github/workflows/bkit-cloud.yml .github/workflows/bkit-cloud.yml`, then re-apply your own edits (the `runs-on` runner at minimum).",
184
+ },
185
+ ];
165
186
  }
166
- return findings;
187
+ return [
188
+ {
189
+ id: "anthropic-api-key-secret-missing",
190
+ severity: "advisory",
191
+ detect: variables === null
192
+ ? "gh confirms the `ANTHROPIC_API_KEY` repo secret is not set on this GitHub repo, and could not list repo variables to check for the `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` federation variables."
193
+ : "gh confirms neither the `ANTHROPIC_API_KEY` repo secret nor both `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` repo variables are set on this GitHub repo.",
194
+ action: "`.github/workflows/bkit-cloud.yml`'s claude job needs one claude credential; without it, the job exits no-op. Set ONE of:\n\n" +
195
+ "- API key:\n\n gh secret set ANTHROPIC_API_KEY --body='<paste-value-here>'\n\n" +
196
+ "- Workload identity federation (keyless): Claude Console → Settings → Workload identity → Connect workload → GitHub Actions creates the issuer, service account and federation rule. Then:\n\n" +
197
+ " gh variable set ANTHROPIC_FEDERATION_RULE_ID --body='fdrl_...'\n" +
198
+ " gh variable set ANTHROPIC_ORGANIZATION_ID --body='<organization-uuid>'\n\n" +
199
+ " Optional: `ANTHROPIC_SERVICE_ACCOUNT_ID` (`svac_...`) and `ANTHROPIC_WORKSPACE_ID` (`wrkspc_...`, needed when the rule covers more than one workspace).\n\n" +
200
+ "Then verify: `gh secret list` / `gh variable list`. The workflow itself does not need redeploying — both are read at run time.",
201
+ },
202
+ ];
167
203
  }
@@ -64,7 +64,8 @@ export function detectActionsWritePermissions() {
64
64
  *
65
65
  * - `github` → GitHub tracker: the GitHub MCP server authenticates with `BKIT_GH_TOKEN`; `gh` uses `gh auth login`.
66
66
  * - `linear` → existing Linear setup message (BKIT_LINEAR_API_KEY + LINEAR_ISSUE_ID).
67
- * - `none` → prompt to run `bkit install --tracker=github` or `--tracker=linear`.
67
+ * - `jira` → admin switch, BKIT_JIRA_API_TOKEN and `bkit.jira` in package.json.
68
+ * - `none` → prompt to run `bkit install --tracker=github`, `--tracker=linear` or `--tracker=jira`.
68
69
  *
69
70
  * Only fires when bkit workflows are installed (.claude/ or .cursor/ present).
70
71
  */
@@ -90,6 +91,14 @@ export function buildTrackerSetupAdvisory(cwd) {
90
91
  action: "Linear tracker: set `BKIT_LINEAR_API_KEY` in `.bkit/.env` (generate at https://linear.app/settings/api). `LINEAR_ISSUE_ID` is injected per-session by the Linear integration — do not hardcode. Run `direnv allow` after setting the key so MCP servers and the preflight hook can authenticate.",
91
92
  };
92
93
  }
94
+ if (tracker === "jira") {
95
+ return {
96
+ id: "tracker-setup-jira",
97
+ severity: "advisory",
98
+ detect: "bkit tracker is configured as `jira`. Jira Cloud is the active tracker.",
99
+ action: 'Jira tracker: (1) an org admin turns on API-token sign-in for the Rovo MCP server (admin.atlassian.com → Rovo → Rovo MCP server → Authentication → "Allow API token authentication"); (2) create an API token with scopes for the app "Atlassian MCP V2" at https://id.atlassian.com/manage-profile/security/api-tokens and set it as `BKIT_JIRA_API_TOKEN` in `.bkit/.env`, then `direnv allow`; (3) set `bkit.jira.site` (e.g. `https://acme.atlassian.net`) and `bkit.jira.project` (the project key) in package.json. Full steps: `.bkit/trackers.md` § jira.',
100
+ };
101
+ }
93
102
  // tracker === "none". Distinguish opt-out (explicit `bkit.issueTracker: "none"`)
94
103
  // from undecided (field absent). An explicit `none` silences the nudge, as with the
95
104
  // dep-updater advisory.
@@ -99,7 +108,7 @@ export function buildTrackerSetupAdvisory(cwd) {
99
108
  id: "tracker-setup-none",
100
109
  severity: "advisory",
101
110
  detect: "bkit tracker is not configured (`bkit.issueTracker` absent). Workflows run but every tracker call is a no-op.",
102
- action: 'Optional post-install decision. Run `bkit install --tracker=github` (recommended) or `bkit install --tracker=linear` to enable tracker integration. GitHub tracker requires `BKIT_GH_TOKEN` in `.bkit/.env` (fine-grained PAT for one owner, classic PAT across owners). Linear tracker requires `BKIT_LINEAR_API_KEY` in `.bkit/.env`. To opt out and silence this advisory, set `bkit.issueTracker` to `"none"` in package.json.',
111
+ action: 'Optional post-install decision. Run `bkit install --tracker=github` (recommended), `--tracker=linear` or `--tracker=jira` to enable tracker integration. GitHub tracker requires `BKIT_GH_TOKEN` in `.bkit/.env` (fine-grained PAT for one owner, classic PAT across owners). Linear tracker requires `BKIT_LINEAR_API_KEY` in `.bkit/.env`. Jira tracker requires `BKIT_JIRA_API_TOKEN` in `.bkit/.env` and `bkit.jira` in package.json. To opt out and silence this advisory, set `bkit.issueTracker` to `"none"` in package.json.',
103
112
  };
104
113
  }
105
114
  /**
@@ -259,6 +268,7 @@ export function detectGithubProjectFieldIdFormat(cwd) {
259
268
  * opt-out):
260
269
  * - `.github/workflows/bkit-cloud.yml` present → `cloud-router` (informational; active)
261
270
  * - `bkit.cloudAgents === "none"` → null (opt-out — stay quiet)
271
+ * - `bkit.issueTracker === "jira"` → null (Jira runs locally only)
262
272
  * - otherwise (undecided) → `cloud-router-none` (nudge to choose)
263
273
  *
264
274
  * Only fires when there is a `.github/workflows/` dir (the router wakes on a CI
@@ -285,14 +295,16 @@ export function buildCloudSetupAdvisory(cwd) {
285
295
  id: "cloud-router",
286
296
  severity: "advisory",
287
297
  detect: "Cloud agents: post-CI auto-routing is active (`.github/workflows/bkit-cloud.yml` present). The Claude GitHub App is required — run `/install-github-app` (Claude Code CLI) once if not already done.",
288
- action: `The workflow requires: the \`ANTHROPIC_API_KEY\` repo secret, the Claude GitHub App (\`/install-github-app\`), and GitHub Actions write permissions (org AND repo). See the \`bkit-auto-setup\` advisory (emitted by \`bkit install --auto=claude\`) and bkit's \`cloud.md\` § Post-CI auto-routing for the full checklist.\n\nbkit's agents comment as you, so every workflow those comments trigger notifies you, even ones that skip. To see only failures: GitHub → Settings → Notifications → System → Actions → "Only notify for failed workflows".`,
298
+ action: `The workflow requires: the \`ANTHROPIC_API_KEY\` repo secret OR the \`ANTHROPIC_FEDERATION_RULE_ID\` + \`ANTHROPIC_ORGANIZATION_ID\` repo variables (keyless workload identity federation), the Claude GitHub App (\`/install-github-app\`), and GitHub Actions write permissions (org AND repo). See the \`bkit-auto-setup\` advisory (emitted by \`bkit install --auto=claude\`) and bkit's \`cloud.md\` § Post-CI auto-routing for the full checklist.\n\nbkit's agents comment as you, so every workflow those comments trigger notifies you, even ones that skip. To see only failures: GitHub → Settings → Notifications → System → Actions → "Only notify for failed workflows".`,
289
299
  };
290
300
  }
291
301
  // No router present — distinguish opt-out from undecided.
292
- const { cloudAgents, cloudAgentsExplicit } = readBkitConfig(cwd);
302
+ const { cloudAgents, cloudAgentsExplicit, issueTracker } = readBkitConfig(cwd);
293
303
  if (cloudAgents === "none" && cloudAgentsExplicit) {
294
304
  return null; // consumer explicitly chose `none` — stay quiet
295
305
  }
306
+ if (issueTracker === "jira")
307
+ return null; // no cloud setup exists for a Jira tracker
296
308
  // Only nudge if there's a workflows dir for the router to wake on.
297
309
  if (!fs.existsSync(path.join(cwd, ".github", "workflows")))
298
310
  return null;
@@ -301,7 +313,7 @@ export function buildCloudSetupAdvisory(cwd) {
301
313
  severity: "advisory",
302
314
  detect: "Cloud agents: post-CI auto-routing is not configured. `.github/workflows/` exists but no `bkit-cloud.yml` — CI pass/fail does not auto-dispatch bkit-ship / bkit-debug.",
303
315
  action: "Optional post-install decision. For a GitHub-tracker repo: `pnpm bkit install --auto=claude --tracker=github`. For a Linear-tracker repo: `pnpm bkit install --auto=cursor --tracker=linear`.\n\n" +
304
- "Prerequisites for `--auto=claude`: `ANTHROPIC_API_KEY` repo secret + Claude GitHub App (`/install-github-app`) + GitHub Actions write permissions.\n\n" +
316
+ "Prerequisites for `--auto=claude`: `ANTHROPIC_API_KEY` repo secret (or the `ANTHROPIC_FEDERATION_RULE_ID` + `ANTHROPIC_ORGANIZATION_ID` repo variables for keyless workload identity federation) + Claude GitHub App (`/install-github-app`) + GitHub Actions write permissions.\n\n" +
305
317
  'To opt out and silence this advisory, set `bkit.cloudAgents` to `"none"` in package.json.',
306
318
  };
307
319
  }
@@ -308,7 +308,7 @@ export function runPostInstallCheck(preflightAdvisories, cwd = process.cwd(), su
308
308
  const cloudSetup = buildCloudSetupAdvisory(cwd);
309
309
  if (cloudSetup)
310
310
  phase3.push(cloudSetup);
311
- // bkit-cloud.yml needs the ANTHROPIC_API_KEY repo secret.
311
+ // bkit-cloud.yml's claude job needs the ANTHROPIC_API_KEY repo secret or federation variables.
312
312
  for (const f of detectCiRouterSecrets(cwd))
313
313
  phase3.push(f);
314
314
  // bkit-cloud.yml also needs repo Actions write permissions + PR-creation
@@ -106,7 +106,7 @@ const BKIT_STUBS = [
106
106
  {
107
107
  id: "coverage",
108
108
  file: ".github/workflows/bkit-ci.yml",
109
- description: "Report vitest coverage on PRs and in every run's job summary via davelosert/vitest-coverage-report-action (free, runs inside Actions with GITHUB_TOKEN — no third-party service, safe for private repos). PER-TIER: unit and integration are measured and commented SEPARATELY (a single merged number lets integration mask a hollow unit suite — coverage is a union). Report-only by default: nothing fails the build until a threshold is set. Enabling (documented in the stub header): (1) add `@vitest/coverage-v8` (pinned to your vitest major) plus a vitest.config coverage block with `reporter: ['text','json-summary','json']` and `reportOnFailure: true` — json-summary + json are load-bearing (the action reads coverage-summary.json and coverage-final.json); (2) run coverage TWICE into separate dirs — unit → coverage/unit (exclude integration files), integration → coverage/integration — so each tier gets its own honest number (avoids the last-writer-wins clobber a second same-dir run would cause); (3) add a JOB-LEVEL permissions block to bkit-tests-unit with `actions: read` + `contents: read` + `pull-requests: write` — job-level REPLACES the workflow-level block (not additive) and the Check SHA Cache step needs `actions: read`, so omitting it breaks the cache step; (4) two report steps with distinct `name:` (unit / integration) pointing at each dir's coverage-summary.json + coverage-final.json; the unit step runs on every event (`if: !cancelled()` plus a `hashFiles` guard on its summary), sets `vite-config-path: vitest.unit.config.ts` so the job summary and PR comment show the floor as the target, and comments only on same-repo PRs (`comment-on: pr`, else `none`). SEPARATE LANES (one job per tier): put the integration run + report + its OWN pull-requests: write block in bkit-tests-integration, not bkit-tests-unit — each lane posts its own comment. Thresholds are opt-in and PER TIER: UNIT is the gate — put `coverage.thresholds.branches` in a `vitest.unit.config.ts` (`mergeConfig` over vitest.config) that ONLY the unit run loads via `-c` (vitest coverage is per-RUN/root config, NOT per-project — `projects` does not scope it and a `thresholds` block in vitest.config reds BOTH runs; the report action reads the same file as raw text, so keep the floor on one unquoted `branches: <n>` line and no other metric name + colon + number in it; branches is the meaningful floor, set to current and ratchet up). INTEGRATION is REPORT-ONLY — gate it on EXECUTION (the capstone's integration_ran > 0), not a %: a whole-repo integration % is denominator-noise (it covers boundaries/flows, not pure logic). For a real integration %, add `--coverage.include=src/server/**` on the integration run (same CLI-flag idiom as --exclude) then set a floor, or ratchet from current — never a picked number. Fork PRs: GITHUB_TOKEN is read-only, so the unit step sets `comment-on: none` there (its job summary still lands) and the integration step keeps the `head.repo == repo` guard (or use the action's workflow_run two-workflow pattern). Guard the integration report on `hashFiles('coverage/integration/coverage-summary.json') != ''` so a repo with no integration tier skips it cleanly.",
109
+ description: "Report vitest coverage on PRs and in every run's job summary via davelosert/vitest-coverage-report-action (free, runs inside Actions with GITHUB_TOKEN — no third-party service, safe for private repos). PER-TIER: unit and integration are measured and commented SEPARATELY (a single merged number lets integration mask a hollow unit suite — coverage is a union). Report-only by default: nothing fails the build until a threshold is set. Enabling (documented in the stub header): (1) add `@vitest/coverage-v8` (pinned to your vitest major) plus a vitest.config coverage block with `reporter: ['text','json-summary','json']` and `reportOnFailure: true` — json-summary + json are load-bearing (the action reads coverage-summary.json and coverage-final.json); (2) run coverage TWICE into separate dirs — unit → coverage/unit (exclude integration files), integration → coverage/integration — so each tier gets its own honest number (avoids the last-writer-wins clobber a second same-dir run would cause); (3) add a JOB-LEVEL permissions block to bkit-tests-unit with `actions: read` + `contents: read` + `pull-requests: write` — job-level REPLACES the workflow-level block (not additive) and the Check Tree Cache step needs `actions: read`, so omitting it breaks the cache step; (4) two report steps with distinct `name:` (unit / integration) pointing at each dir's coverage-summary.json + coverage-final.json; the unit step runs on every event (`if: !cancelled()` plus a `hashFiles` guard on its summary), sets `vite-config-path: vitest.unit.config.ts` so the job summary and PR comment show the floor as the target, and comments only on same-repo PRs (`comment-on: pr`, else `none`). SEPARATE LANES (one job per tier): put the integration run + report + its OWN pull-requests: write block in bkit-tests-integration, not bkit-tests-unit — each lane posts its own comment. Thresholds are opt-in and PER TIER: UNIT is the gate — put `coverage.thresholds.branches` in a `vitest.unit.config.ts` (`mergeConfig` over vitest.config) that ONLY the unit run loads via `-c` (vitest coverage is per-RUN/root config, NOT per-project — `projects` does not scope it and a `thresholds` block in vitest.config reds BOTH runs; the report action reads the same file as raw text, so keep the floor on one unquoted `branches: <n>` line and no other metric name + colon + number in it; branches is the meaningful floor, set to current and ratchet up). INTEGRATION is REPORT-ONLY — gate it on EXECUTION (the capstone's integration_ran > 0), not a %: a whole-repo integration % is denominator-noise (it covers boundaries/flows, not pure logic). For a real integration %, add `--coverage.include=src/server/**` on the integration run (same CLI-flag idiom as --exclude) then set a floor, or ratchet from current — never a picked number. Fork PRs: GITHUB_TOKEN is read-only, so the unit step sets `comment-on: none` there (its job summary still lands) and the integration step keeps the `head.repo == repo` guard (or use the action's workflow_run two-workflow pattern). Guard the integration report on `hashFiles('coverage/integration/coverage-summary.json') != ''` so a repo with no integration tier skips it cleanly.",
110
110
  },
111
111
  {
112
112
  id: "e2e-coverage",
@@ -6,14 +6,29 @@ import { spawnSync } from "node:child_process";
6
6
  // ---------------------------------------------------------------------------
7
7
  // [mcp-env] advisories — direnv + .bkit/.env setup (BAR-260)
8
8
  // ---------------------------------------------------------------------------
9
+ /** The token a tracker's MCP server reads from `.bkit/.env`, beside `BKIT_GH_TOKEN`. */
10
+ const TRACKER_TOKENS = {
11
+ linear: {
12
+ key: "BKIT_LINEAR_API_KEY",
13
+ description: "Linear personal API key for the Linear MCP server and the Linear preflight hook (generate at https://linear.app/settings/api)",
14
+ },
15
+ jira: {
16
+ key: "BKIT_JIRA_API_TOKEN",
17
+ description: 'Atlassian API token with scopes for the app "Atlassian MCP V2", sent as Bearer to the Jira MCP server (create at https://id.atlassian.com/manage-profile/security/api-tokens; see .bkit/trackers.md § jira)',
18
+ },
19
+ };
20
+ /** The token names `tracker` needs, `BKIT_GH_TOKEN` first. */
21
+ function tokenKeys(tracker) {
22
+ const own = TRACKER_TOKENS[tracker];
23
+ return own ? ["BKIT_GH_TOKEN", own.key] : ["BKIT_GH_TOKEN"];
24
+ }
9
25
  /**
10
26
  * Advisory: .bkit/.env.example exists but .bkit/.env does not.
11
27
  * Consumer ran `bkit install` (which seeds .env.example) but has not yet
12
28
  * copied it to .bkit/.env and filled in their tokens.
13
29
  */
14
- // `tracker` controls whether `BKIT_LINEAR_API_KEY` appears in the token prose (Linear
15
- // tracker only). Defaults to `linear` (the superset: every token); the real Phase-3
16
- // caller passes the consumer's resolved `bkit.issueTracker`.
30
+ // `tracker` adds its own token to the token prose (`TRACKER_TOKENS`). Defaults to
31
+ // `linear`; the real Phase-3 caller passes the consumer's resolved `bkit.issueTracker`.
17
32
  export function detectMissingDotenv(cwd, tracker = "linear") {
18
33
  const examplePath = path.join(cwd, ".bkit", ".env.example");
19
34
  const envPath = path.join(cwd, ".bkit", ".env");
@@ -21,7 +36,7 @@ export function detectMissingDotenv(cwd, tracker = "linear") {
21
36
  return null;
22
37
  if (fs.existsSync(envPath))
23
38
  return null;
24
- const tokens = tracker === "linear" ? "BKIT_GH_TOKEN, BKIT_LINEAR_API_KEY" : "BKIT_GH_TOKEN";
39
+ const tokens = tokenKeys(tracker).join(", ");
25
40
  return {
26
41
  id: "mcp-env-missing-dotenv",
27
42
  severity: "advisory",
@@ -57,15 +72,8 @@ export function detectBlankDotenvKeys(cwd, tracker = "linear") {
57
72
  key: "BKIT_GH_TOKEN",
58
73
  description: "fine-grained PAT for the GitHub MCP server (Contents, Pull requests, Issues, Actions, Workflows, Metadata — read/write), or a classic PAT when one token must span owners",
59
74
  },
60
- // BKIT_LINEAR_API_KEY is required only under the Linear tracker.
61
- ...(tracker === "linear"
62
- ? [
63
- {
64
- key: "BKIT_LINEAR_API_KEY",
65
- description: "Linear personal API key for the Linear MCP server and the Linear preflight hook (generate at https://linear.app/settings/api)",
66
- },
67
- ]
68
- : []),
75
+ // A tracker token is required only under its tracker.
76
+ ...(TRACKER_TOKENS[tracker] ? [TRACKER_TOKENS[tracker]] : []),
69
77
  ];
70
78
  const findings = [];
71
79
  for (const { key, description } of REQUIRED_KEYS) {
@@ -105,9 +113,8 @@ export function detectDirenvMissing(cwd, tracker = "linear") {
105
113
  const result = spawnSync("which", ["direnv"], { encoding: "utf-8" });
106
114
  if (result.status === 0 && result.stdout.trim())
107
115
  return null;
108
- // BKIT_LINEAR_API_KEY is required only under the Linear tracker.
109
- const editKeys = tracker === "linear" ? "BKIT_GH_TOKEN, BKIT_LINEAR_API_KEY" : "BKIT_GH_TOKEN";
110
- const exportKeys = tracker === "linear" ? "BKIT_GH_TOKEN / BKIT_LINEAR_API_KEY" : "BKIT_GH_TOKEN";
116
+ const editKeys = tokenKeys(tracker).join(", ");
117
+ const exportKeys = tokenKeys(tracker).join(" / ");
111
118
  return {
112
119
  id: "mcp-env-direnv-missing",
113
120
  severity: "advisory",
@@ -156,7 +163,7 @@ export function detectDirenvNotAllowed(cwd, tracker = "linear") {
156
163
  id: "mcp-env-direnv-not-allowed",
157
164
  severity: "advisory",
158
165
  detect: "direnv is installed but the .envrc in this repo is blocked. .bkit/.env is not being auto-loaded.",
159
- action: `[mcp-env] Run \`direnv allow\` in this repo to trust the .envrc and enable auto-load of .bkit/.env. direnv will then export ${tracker === "linear" ? "BKIT_GH_TOKEN and BKIT_LINEAR_API_KEY" : "BKIT_GH_TOKEN"} into your shell whenever you cd into the repo.`,
166
+ action: `[mcp-env] Run \`direnv allow\` in this repo to trust the .envrc and enable auto-load of .bkit/.env. direnv will then export ${tokenKeys(tracker).join(" and ")} into your shell whenever you cd into the repo.`,
160
167
  };
161
168
  }
162
169
  return null;
@@ -3,7 +3,7 @@ import * as fs from "node:fs";
3
3
  import * as path from "node:path";
4
4
  import { parseJson } from "../../shared/json.js";
5
5
  /** Every MCP server key bkit writes; `requiredMcpServersForTracker` picks the required subset. */
6
- const BKIT_MCP_SERVERS = ["linear", "github"];
6
+ const BKIT_MCP_SERVERS = ["linear", "github", "jira"];
7
7
  /**
8
8
  * bkit-written servers a workflow step calls under every tracker, so never flagged as extra:
9
9
  * the workflows' gh MCP fallback (PR / CI / merge when `gh` is unavailable) calls `github`.
@@ -60,7 +60,9 @@ export function detectMissingMcpServers(cwd, relPath, issueTracker) {
60
60
  ? `"url": "https://mcp.linear.app/mcp"`
61
61
  : key === "github"
62
62
  ? `"url": "https://api.githubcopilot.com/mcp/"`
63
- : `"url": "<server-url>"`;
63
+ : key === "jira"
64
+ ? `"url": "https://mcp.atlassian.com/v2/mcp"`
65
+ : `"url": "<server-url>"`;
64
66
  findings.push({
65
67
  id: `mcp-missing-server-${key}-${advisoryPathSlug(relPath)}`,
66
68
  severity: "advisory",
@@ -21,6 +21,7 @@
21
21
  // names its ids, so the tip and the advisory can never disagree and one
22
22
  // `bkit.ignoreAdvisories` entry silences both.
23
23
  import * as fs from "node:fs";
24
+ import * as path from "node:path";
24
25
  import { machineStepsPath, REPO_STEPS } from "../../commands/workflow/disk.js";
25
26
  import { detectContextFetchMissing } from "../before/context-fetch.js";
26
27
  import { detectBlankDotenvKeys, detectDirenvMissing, detectDirenvNotAllowed, detectMissingDotenv, isCloudOrCi, } from "../before/env.js";
@@ -41,7 +42,7 @@ export const SETUP_TIPS = [
41
42
  id: "tracker",
42
43
  workflows: EVERY_CONTEXT,
43
44
  title: "Connect an issue tracker",
44
- line: "bkit isn't connected to an issue tracker, so it can't read the task it's working on or record what it did. Connect GitHub or Linear, or switch this tip off if you don't want one.",
45
+ line: "bkit isn't connected to an issue tracker, so it can't read the task it's working on or record what it did. Connect GitHub, Linear or Jira, or switch this tip off if you don't want one.",
45
46
  why: "Every workflow starts by reading the issue it's working on and reports progress back to it as it goes. Without a tracker, you have to paste in what the agent should look at each time, and nothing records what changed or why.",
46
47
  ask: 'Connect bkit to GitHub Issues: re-run `bkit install` with the tool flags I use plus `--tracker=github` (it records `bkit.issueTracker` in package.json and adds the tracker server to .mcp.json). If I don\'t want a tracker, set `"issueTracker": "none"` under `bkit` in package.json instead.',
47
48
  steps: '`.bkit/install.md` § Optional post-install decisions. Opt out: `"bkit": { "issueTracker": "none" }` in `package.json`.',
@@ -182,7 +183,7 @@ export const SETUP_TIPS = [
182
183
  title: "Finish cloud setup",
183
184
  line: "You've turned on cloud agents, but setup isn't finished, so cloud runs will stop partway. Finish the remaining steps.",
184
185
  why: "With cloud agents, bkit runs on its own: a change that passes its checks gets shipped and one that fails gets investigated, with nobody at the keyboard. That only works once every piece is in place.",
185
- ask: "Check my cloud-agent setup against .bkit/cloud.md: copy .bkit/templates/.github/workflows/bkit-cloud.yml to .github/workflows/bkit-cloud.yml and .bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh to .claude/hooks/ (for Cursor: .bkit/templates/.cursor/environment.json and .bkit/templates/.cursor/Dockerfile to .cursor/), run `gh secret set ANTHROPIC_API_KEY`, then tell me which dashboard settings are left.",
186
+ ask: "Check my cloud-agent setup against .bkit/cloud.md: copy .bkit/templates/.github/workflows/bkit-cloud.yml to .github/workflows/bkit-cloud.yml and .bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh to .claude/hooks/ (for Cursor: .bkit/templates/.cursor/environment.json and .bkit/templates/.cursor/Dockerfile to .cursor/), run `gh secret set ANTHROPIC_API_KEY` (or, keyless, `gh variable set` ANTHROPIC_FEDERATION_RULE_ID and ANTHROPIC_ORGANIZATION_ID from a Claude Console federation rule), then tell me which dashboard settings are left.",
186
187
  steps: "`.bkit/cloud.md`; `.bkit/templates.md` § Cloud-agent workflow and § Cursor.",
187
188
  fires: (cwd) => {
188
189
  const cloud = readBkitConfig(cwd).cloudAgents;
@@ -314,6 +315,17 @@ export const SETUP_TIPS = [
314
315
  steps: "`.bkit/templates.md` § tmp/ prune.",
315
316
  fires: (cwd) => exists(cwd, ".husky/pre-push") && !exists(cwd, "scripts/cleanup/bkit-tmp-prune.mjs"),
316
317
  },
318
+ {
319
+ id: "min-push",
320
+ workflows: ["plan", "ship"],
321
+ title: "Quick pushes for logs and records",
322
+ line: "Pushing only plan logs and records still runs every test. Add the quick path for those pushes.",
323
+ why: "A workflow's last push is often just its logs and records. The quick path checks only formatting and wording on such a push, so it takes seconds and never waits on anything another session is using. Any other file still runs everything.",
324
+ ask: 'Copy the min-push parts of .bkit/templates/.husky/pre-push into .husky/pre-push: PUSH_SHAS / PUSH_SHARED_SHAS in the stdin loop, the `Min push` and `CI-suppressor guard on dev / main` blocks, and the `bkit:gate:min` branch. Wrap slow checks below the gates in `if [ "$MIN_PUSH" != "1" ]`.',
325
+ steps: "`.bkit/templates.md` § Git hooks.",
326
+ fires: (cwd) => exists(cwd, ".husky/pre-push") &&
327
+ !fs.readFileSync(path.join(cwd, ".husky/pre-push"), "utf-8").includes("bkit ci min-push"),
328
+ },
317
329
  {
318
330
  id: "disk-prune",
319
331
  workflows: ALL_WORKFLOWS,
package/dist/cli.js CHANGED
@@ -230,7 +230,7 @@ export function parseArgs(argv) {
230
230
  }
231
231
  if (arg.startsWith("--")) {
232
232
  const flag = arg.slice(2);
233
- // Value-bearing flag: --tracker=<github|linear|none>
233
+ // Value-bearing flag: --tracker=<github|linear|jira|none>
234
234
  if (flag.startsWith("tracker=")) {
235
235
  const value = flag.slice("tracker=".length);
236
236
  const parsed = parseIssueTracker(value);
@@ -570,18 +570,20 @@ Dependency updaters (copy an example and own it):
570
570
 
571
571
  --auto=<claude|cursor|opencode>
572
572
  Cloud-agent (auto-dispatch) integration (opt-in). --auto=claude needs
573
- tracker=github + the ANTHROPIC_API_KEY repo secret + the Claude GitHub App; --auto=cursor
573
+ tracker=github + the ANTHROPIC_API_KEY repo secret (or the
574
+ ANTHROPIC_FEDERATION_RULE_ID + ANTHROPIC_ORGANIZATION_ID repo variables
575
+ for keyless federation) + the Claude GitHub App; --auto=cursor
574
576
  needs tracker=linear; --auto=opencode needs tracker=github + a remote
575
577
  opencode provider (OPENCODE_PROVIDER_KEY). Bare --auto is accepted on
576
578
  uninstall only.
577
579
 
578
580
  Cross-cutting / modifiers:
579
- --tracker=<name> Wire issue tracker integration. Values: github, linear, none
581
+ --tracker=<name> Wire issue tracker integration. Values: github, linear, jira, none
580
582
  (default). Records bkit.issueTracker in package.json and substitutes
581
583
  tracker snippets into command mirrors. Re-renders every installed
582
584
  host, and works alone (bkit install --tracker=github). Switching is
583
- free; a switch removes the old linear MCP entry unless you edited it
584
- (github always stays). Does NOT own AGENTS.md (tracker-agnostic).
585
+ free; a switch removes the old linear or jira MCP entry unless you
586
+ edited it (github always stays). Does NOT own AGENTS.md (tracker-agnostic).
585
587
 
586
588
  Install flags:
587
589
  --auto-revert On a Phase 3 blocker, automatically run uninstall and exit 1.