@cbartens/bkit 0.0.0-stage → 5.0.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 (373) hide show
  1. package/.bkit/README.md +421 -0
  2. package/.bkit/core/.agents/context.md +95 -0
  3. package/.bkit/core/.agents/docs.md +62 -0
  4. package/.bkit/core/.agents/rules.md +147 -0
  5. package/.bkit/core/.agents/skills.md +43 -0
  6. package/.bkit/core/.bkit/LICENSE.md +151 -0
  7. package/.bkit/core/.bkit/README.md +421 -0
  8. package/.bkit/core/.bkit/cloud.md +502 -0
  9. package/.bkit/core/.bkit/comparison.md +318 -0
  10. package/.bkit/core/.bkit/install.md +496 -0
  11. package/.bkit/core/.bkit/jsonl.md +497 -0
  12. package/.bkit/core/.bkit/prompts.md +474 -0
  13. package/.bkit/core/.bkit/providers.md +598 -0
  14. package/.bkit/core/.bkit/templates.md +471 -0
  15. package/.bkit/core/.bkit/trackers.md +95 -0
  16. package/.bkit/core/.bkit/workflows.md +1546 -0
  17. package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +82 -0
  18. package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +93 -0
  19. package/.bkit/core/.claude/hooks/bkit-preflight.sh +74 -0
  20. package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +115 -0
  21. package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +135 -0
  22. package/.bkit/core/.cursor/hooks/bkit-gateguard.cjs +111 -0
  23. package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +169 -0
  24. package/.bkit/core/.cursor/hooks/bkit-preflight.sh +63 -0
  25. package/.bkit/core/.opencode/plugin/bkit-gateguard.js +225 -0
  26. package/.bkit/core/AGENTS.md +77 -0
  27. package/.bkit/core/LICENSE.md +149 -0
  28. package/.bkit/core/docs/templates/bkit-audit-accessibility.md +272 -0
  29. package/.bkit/core/docs/templates/bkit-audit-adoption.md +223 -0
  30. package/.bkit/core/docs/templates/bkit-audit-agents.md +230 -0
  31. package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +227 -0
  32. package/.bkit/core/docs/templates/bkit-audit-analytics.md +266 -0
  33. package/.bkit/core/docs/templates/bkit-audit-annotations.md +230 -0
  34. package/.bkit/core/docs/templates/bkit-audit-app-performance.md +270 -0
  35. package/.bkit/core/docs/templates/bkit-audit-app-store.md +254 -0
  36. package/.bkit/core/docs/templates/bkit-audit-architecture.md +221 -0
  37. package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +241 -0
  38. package/.bkit/core/docs/templates/bkit-audit-config.md +230 -0
  39. package/.bkit/core/docs/templates/bkit-audit-cost.md +218 -0
  40. package/.bkit/core/docs/templates/bkit-audit-coverage.md +221 -0
  41. package/.bkit/core/docs/templates/bkit-audit-database.md +229 -0
  42. package/.bkit/core/docs/templates/bkit-audit-dead-code.md +251 -0
  43. package/.bkit/core/docs/templates/bkit-audit-deferrals.md +283 -0
  44. package/.bkit/core/docs/templates/bkit-audit-dependencies.md +268 -0
  45. package/.bkit/core/docs/templates/bkit-audit-documentation.md +280 -0
  46. package/.bkit/core/docs/templates/bkit-audit-duplication.md +253 -0
  47. package/.bkit/core/docs/templates/bkit-audit-failures.md +259 -0
  48. package/.bkit/core/docs/templates/bkit-audit-flakes.md +237 -0
  49. package/.bkit/core/docs/templates/bkit-audit-gates.md +250 -0
  50. package/.bkit/core/docs/templates/bkit-audit-issues.md +273 -0
  51. package/.bkit/core/docs/templates/bkit-audit-llm.md +239 -0
  52. package/.bkit/core/docs/templates/bkit-audit-logs.md +266 -0
  53. package/.bkit/core/docs/templates/bkit-audit-models.md +210 -0
  54. package/.bkit/core/docs/templates/bkit-audit-privacy.md +211 -0
  55. package/.bkit/core/docs/templates/bkit-audit-prompts.md +216 -0
  56. package/.bkit/core/docs/templates/bkit-audit-red-team.md +220 -0
  57. package/.bkit/core/docs/templates/bkit-audit-reliability.md +222 -0
  58. package/.bkit/core/docs/templates/bkit-audit-repo.md +224 -0
  59. package/.bkit/core/docs/templates/bkit-audit-security.md +274 -0
  60. package/.bkit/core/docs/templates/bkit-audit-slop.md +200 -0
  61. package/.bkit/core/docs/templates/bkit-audit-testing.md +270 -0
  62. package/.bkit/core/docs/templates/bkit-audit-usability.md +237 -0
  63. package/.bkit/core/docs/templates/bkit-plan.md +476 -0
  64. package/.bkit/core/engine/checks/after/auth.ts +247 -0
  65. package/.bkit/core/engine/checks/after/ci-yml.ts +739 -0
  66. package/.bkit/core/engine/checks/after/github.ts +424 -0
  67. package/.bkit/core/engine/checks/after/index.ts +556 -0
  68. package/.bkit/core/engine/checks/after/managed.ts +217 -0
  69. package/.bkit/core/engine/checks/after/tools.ts +427 -0
  70. package/.bkit/core/engine/checks/after/vercel.ts +101 -0
  71. package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
  72. package/.bkit/core/engine/checks/before/env.ts +201 -0
  73. package/.bkit/core/engine/checks/before/files.ts +202 -0
  74. package/.bkit/core/engine/checks/before/index.ts +206 -0
  75. package/.bkit/core/engine/checks/before/mcp.ts +127 -0
  76. package/.bkit/core/engine/checks/before/repo.ts +77 -0
  77. package/.bkit/core/engine/checks/before/version.ts +67 -0
  78. package/.bkit/core/engine/checks/status-holes.ts +479 -0
  79. package/.bkit/core/engine/cli.ts +871 -0
  80. package/.bkit/core/engine/commands/analysis.ts +550 -0
  81. package/.bkit/core/engine/commands/ci/ci.ts +483 -0
  82. package/.bkit/core/engine/commands/comply.ts +415 -0
  83. package/.bkit/core/engine/commands/harvest.ts +459 -0
  84. package/.bkit/core/engine/commands/install/check.ts +70 -0
  85. package/.bkit/core/engine/commands/install/doctor.ts +247 -0
  86. package/.bkit/core/engine/commands/install/install.ts +528 -0
  87. package/.bkit/core/engine/commands/install/uninstall.ts +972 -0
  88. package/.bkit/core/engine/commands/install/upgrade.ts +1026 -0
  89. package/.bkit/core/engine/commands/launch.ts +139 -0
  90. package/.bkit/core/engine/commands/lib.ts +494 -0
  91. package/.bkit/core/engine/commands/registry.ts +53 -0
  92. package/.bkit/core/engine/commands/setup/setup.ts +184 -0
  93. package/.bkit/core/engine/commands/telemetry.ts +32 -0
  94. package/.bkit/core/engine/commands/workflow/branches.ts +1514 -0
  95. package/.bkit/core/engine/commands/workflow/context.ts +961 -0
  96. package/.bkit/core/engine/commands/workflow/counters.ts +268 -0
  97. package/.bkit/core/engine/commands/workflow/fids.ts +243 -0
  98. package/.bkit/core/engine/commands/workflow/issues.ts +675 -0
  99. package/.bkit/core/engine/commands/workflow/ledgers.ts +575 -0
  100. package/.bkit/core/engine/commands/workflow/locks.ts +478 -0
  101. package/.bkit/core/engine/commands/workflow/prs.ts +1087 -0
  102. package/.bkit/core/engine/commands/workflow/repo.ts +220 -0
  103. package/.bkit/core/engine/commands/workflow/roadmap.ts +576 -0
  104. package/.bkit/core/engine/commands/workflow/runs.ts +2140 -0
  105. package/.bkit/core/engine/commands/workflow/runtime.ts +300 -0
  106. package/.bkit/core/engine/commands/workflow/skills.ts +118 -0
  107. package/.bkit/core/engine/commands/workflow/status.ts +455 -0
  108. package/.bkit/core/engine/commands/workflow/steps.ts +1300 -0
  109. package/.bkit/core/engine/commands/workflow/tests.ts +161 -0
  110. package/.bkit/core/engine/commands/workflow/workflows.ts +1573 -0
  111. package/.bkit/core/engine/commands/workflow/workstreams.ts +164 -0
  112. package/.bkit/core/engine/commands/workflow/worktrees.ts +534 -0
  113. package/.bkit/core/engine/install/cloud-env.ts +925 -0
  114. package/.bkit/core/engine/install/managed-block.ts +212 -0
  115. package/.bkit/core/engine/install/manifest.ts +448 -0
  116. package/.bkit/core/engine/install/modules/claude.ts +362 -0
  117. package/.bkit/core/engine/install/modules/cloud.ts +174 -0
  118. package/.bkit/core/engine/install/modules/codex.ts +219 -0
  119. package/.bkit/core/engine/install/modules/core.ts +600 -0
  120. package/.bkit/core/engine/install/modules/cursor.ts +231 -0
  121. package/.bkit/core/engine/install/modules/index.ts +242 -0
  122. package/.bkit/core/engine/install/modules/opencode.ts +573 -0
  123. package/.bkit/core/engine/install/placeholders.ts +108 -0
  124. package/.bkit/core/engine/install/template-copies.ts +119 -0
  125. package/.bkit/core/engine/install/version-file.ts +284 -0
  126. package/.bkit/core/engine/install/write.ts +467 -0
  127. package/.bkit/core/engine/ledgers/clamp-log.ts +32 -0
  128. package/.bkit/core/engine/ledgers/status.ts +213 -0
  129. package/.bkit/core/engine/ledgers/telemetry.ts +1143 -0
  130. package/.bkit/core/engine/render/hosts.ts +372 -0
  131. package/.bkit/core/engine/render/models.ts +323 -0
  132. package/.bkit/core/engine/render/parts.ts +38 -0
  133. package/.bkit/core/engine/render/trackers.ts +170 -0
  134. package/.bkit/core/engine/shared/egress.ts +345 -0
  135. package/.bkit/core/engine/shared/json.ts +16 -0
  136. package/.bkit/core/engine/shared/log-prefix.ts +9 -0
  137. package/.bkit/core/engine/shared/package-json.ts +29 -0
  138. package/.bkit/core/engine/shared/package-manager.ts +38 -0
  139. package/.bkit/core/engine/shared/package-roots.ts +163 -0
  140. package/.bkit/core/engine/shared/protected-paths.ts +164 -0
  141. package/.bkit/core/engine/shared/settings.ts +72 -0
  142. package/.bkit/core/engine/shared/timeouts.ts +20 -0
  143. package/.bkit/core/engine/tools/wording.ts +748 -0
  144. package/.bkit/core/hooks/gateguard-edit-payload.js +18 -0
  145. package/.bkit/core/hooks/gateguard-engine.js +193 -0
  146. package/.bkit/core/hooks/guardrails-shell.js +154 -0
  147. package/.bkit/core/hooks/guardrails-tiers.js +68 -0
  148. package/.bkit/core/hooks/preflight-linear.sh +73 -0
  149. package/.bkit/core/prompts/bkit-audit-generate.md +66 -0
  150. package/.bkit/core/prompts/bkit-build-challenge-1.md +79 -0
  151. package/.bkit/core/prompts/bkit-build-challenge-2.md +81 -0
  152. package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +68 -0
  153. package/.bkit/core/prompts/bkit-build-challenge-remediate.md +70 -0
  154. package/.bkit/core/prompts/bkit-build-challenge-tests.md +73 -0
  155. package/.bkit/core/prompts/bkit-build-install-skills.md +67 -0
  156. package/.bkit/core/prompts/bkit-build-plan-current.md +75 -0
  157. package/.bkit/core/prompts/bkit-build-plan-execute.md +72 -0
  158. package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +73 -0
  159. package/.bkit/core/prompts/bkit-build-plan-verify.md +88 -0
  160. package/.bkit/core/prompts/bkit-build-summary.md +93 -0
  161. package/.bkit/core/prompts/bkit-debug-abort-handover.md +90 -0
  162. package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +151 -0
  163. package/.bkit/core/prompts/bkit-debug-failure-remediate.md +78 -0
  164. package/.bkit/core/prompts/bkit-debug-failure-soak.md +73 -0
  165. package/.bkit/core/prompts/bkit-debug-summary.md +95 -0
  166. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +72 -0
  167. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +72 -0
  168. package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +75 -0
  169. package/.bkit/core/prompts/bkit-design-generate.md +110 -0
  170. package/.bkit/core/prompts/bkit-design-organise.md +85 -0
  171. package/.bkit/core/prompts/bkit-design-review-1.md +121 -0
  172. package/.bkit/core/prompts/bkit-design-review-2.md +111 -0
  173. package/.bkit/core/prompts/bkit-design-spike.md +97 -0
  174. package/.bkit/core/prompts/bkit-design-summary.md +106 -0
  175. package/.bkit/core/prompts/bkit-design-update.md +66 -0
  176. package/.bkit/core/prompts/bkit-plan-complexity-check.md +66 -0
  177. package/.bkit/core/prompts/bkit-plan-complexity-split.md +87 -0
  178. package/.bkit/core/prompts/bkit-plan-generate.md +74 -0
  179. package/.bkit/core/prompts/bkit-plan-review-1.md +90 -0
  180. package/.bkit/core/prompts/bkit-plan-review-2.md +80 -0
  181. package/.bkit/core/prompts/bkit-plan-review-3.md +92 -0
  182. package/.bkit/core/prompts/bkit-plan-scope-check-1.md +84 -0
  183. package/.bkit/core/prompts/bkit-plan-scope-check-2.md +84 -0
  184. package/.bkit/core/prompts/bkit-plan-summary.md +106 -0
  185. package/.bkit/core/prompts/bkit-plan-update.md +68 -0
  186. package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +90 -0
  187. package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +94 -0
  188. package/.bkit/core/prompts/bkit-ship-summary.md +77 -0
  189. package/.bkit/core/prompts/bkit-ship-update-docs.md +71 -0
  190. package/.bkit/core/prompts/bkit-utility-compress-markdown.md +91 -0
  191. package/.bkit/core/prompts/bkit-utility-update-decisions.md +75 -0
  192. package/.bkit/core/prompts/bkit-utility-update-deferrals.md +76 -0
  193. package/.bkit/core/prompts/bkit-utility-update-documentation.md +61 -0
  194. package/.bkit/core/prompts/bkit-utility-update-failures.md +76 -0
  195. package/.bkit/core/prompts/bkit-utility-update-knowledge.md +75 -0
  196. package/.bkit/core/prompts/bkit-utility-update-roadmap.md +82 -0
  197. package/.bkit/core/workflows/bkit-auto.md +121 -0
  198. package/.bkit/core/workflows/bkit-build.md +802 -0
  199. package/.bkit/core/workflows/bkit-debug.md +642 -0
  200. package/.bkit/core/workflows/bkit-design.md +495 -0
  201. package/.bkit/core/workflows/bkit-plan.md +510 -0
  202. package/.bkit/core/workflows/bkit-ship.md +650 -0
  203. package/.bkit/shared/.bkit/.env.example +108 -0
  204. package/.bkit/shared/.claude/bkit-cloud.md +117 -0
  205. package/.bkit/shared/.claude/settings.json +88 -0
  206. package/.bkit/shared/.codex/hooks.json +26 -0
  207. package/.bkit/shared/.cursor/bkit-cloud.md +84 -0
  208. package/.bkit/shared/.cursor/hooks.json +26 -0
  209. package/.bkit/shared/.cursor/mcp.json +15 -0
  210. package/.bkit/shared/.cursor/rules/bkit-rules.mdc +12 -0
  211. package/.bkit/shared/.gitattributes +37 -0
  212. package/.bkit/shared/.mcp.json +16 -0
  213. package/.bkit/shared/.opencode/opencode.json +62 -0
  214. package/.bkit/shared/CLAUDE.md +11 -0
  215. package/.bkit/shared/LICENSE.md +22 -0
  216. package/.bkit/shared/docs/architecture.md +19 -0
  217. package/.bkit/shared/docs/data-schema.md +19 -0
  218. package/.bkit/shared/docs/deployments.md +438 -0
  219. package/.bkit/shared/docs/design.md +39 -0
  220. package/.bkit/shared/docs/noise.md +19 -0
  221. package/.bkit/shared/docs/observability.md +25 -0
  222. package/.bkit/shared/docs/security.md +42 -0
  223. package/.bkit/shared/docs/setup.md +30 -0
  224. package/.bkit/shared/docs/technology.md +18 -0
  225. package/.bkit/shared/docs/testing.md +413 -0
  226. package/.bkit/shared/gitignore +92 -0
  227. package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +192 -0
  228. package/.bkit/templates/.cursor/Dockerfile +68 -0
  229. package/.bkit/templates/.cursor/environment.json +6 -0
  230. package/.bkit/templates/.cursor/settings.json +11 -0
  231. package/.bkit/templates/.envrc +7 -0
  232. package/.bkit/templates/.github/dependabot.yml +52 -0
  233. package/.bkit/templates/.github/renovate.json5 +239 -0
  234. package/.bkit/templates/.github/workflows/bkit-ci.yml +1082 -0
  235. package/.bkit/templates/.github/workflows/bkit-cloud.yml +566 -0
  236. package/.bkit/templates/.github/workflows/bkit-renovate.yml +107 -0
  237. package/.bkit/templates/.graphifyignore +108 -0
  238. package/.bkit/templates/.husky/pre-commit +16 -0
  239. package/.bkit/templates/.husky/pre-push +91 -0
  240. package/.bkit/templates/.lintstagedrc.json +3 -0
  241. package/.bkit/templates/.prettierignore +41 -0
  242. package/.bkit/templates/.serena/project.yml +243 -0
  243. package/.bkit/templates/.vale/styles/House/Filler.yml +11 -0
  244. package/.bkit/templates/.vale/styles/House/Hedging.yml +12 -0
  245. package/.bkit/templates/.vale/styles/House/LLMSlop.yml +13 -0
  246. package/.bkit/templates/.vale/styles/House/Verbose.yml +12 -0
  247. package/.bkit/templates/.vale.ini +67 -0
  248. package/.bkit/templates/LICENSE.md +22 -0
  249. package/.bkit/templates/context/bkit-cloudrun.md +84 -0
  250. package/.bkit/templates/context/bkit-expo.md +186 -0
  251. package/.bkit/templates/context/bkit-github.md +79 -0
  252. package/.bkit/templates/context/bkit-inngest.md +45 -0
  253. package/.bkit/templates/context/bkit-maestro.md +76 -0
  254. package/.bkit/templates/context/bkit-playwright.md +62 -0
  255. package/.bkit/templates/context/bkit-resend.md +36 -0
  256. package/.bkit/templates/context/bkit-sentry.md +65 -0
  257. package/.bkit/templates/context/bkit-serena.md +33 -0
  258. package/.bkit/templates/context/bkit-stripe.md +36 -0
  259. package/.bkit/templates/context/bkit-supabase.md +59 -0
  260. package/.bkit/templates/context/bkit-tavily.md +49 -0
  261. package/.bkit/templates/context/bkit-vercel.md +64 -0
  262. package/.bkit/templates/docs/capabilities.md +72 -0
  263. package/.bkit/templates/scripts/ci/accepted-divergences.json +21 -0
  264. package/.bkit/templates/scripts/ci/check-accepted-divergences.mjs +152 -0
  265. package/.bkit/templates/scripts/ci/check-accepted-divergences.test.mjs +130 -0
  266. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +98 -0
  267. package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +86 -0
  268. package/.bkit/templates/scripts/graphify/bkit-graph-drift-rules.json +23 -0
  269. package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +208 -0
  270. package/.bkit/templates/scripts/graphify/bkit-graph-eager-rules.json +35 -0
  271. package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +236 -0
  272. package/.bkit/templates/scripts/graphify/bkit-graph-external-rules.json +17 -0
  273. package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +290 -0
  274. package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +19 -0
  275. package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +120 -0
  276. package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +232 -0
  277. package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +36 -0
  278. package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +927 -0
  279. package/.bkit/templates/scripts/graphify/bkit-graphify.sh +351 -0
  280. package/.bkit/templates/scripts/launchd/ai.bkit.launchd.plist +26 -0
  281. package/.bkit/templates/scripts/launchd/bkit-launchd-env.sh +53 -0
  282. package/.bkit/templates/scripts/launchd/launchd.env.example +13 -0
  283. package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +275 -0
  284. package/.bkit/templates/scripts/secrets/bkit-secrets.config.mjs +66 -0
  285. package/.bkit/templates/scripts/secrets/bkit-secrets.mjs +785 -0
  286. package/.bkit/templates/scripts/serena/bkit-serena-mcp.sh +30 -0
  287. package/.bkit/templates/scripts/serena/bkit-serena.mcp.json +9 -0
  288. package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +286 -0
  289. package/.bkit/templates/slop-scan.config.json +120 -0
  290. package/CHANGELOG.md +1486 -0
  291. package/LICENSE.md +161 -0
  292. package/README.md +185 -2
  293. package/dist/checks/after/auth.js +232 -0
  294. package/dist/checks/after/ci-yml.js +718 -0
  295. package/dist/checks/after/github.js +400 -0
  296. package/dist/checks/after/index.js +447 -0
  297. package/dist/checks/after/managed.js +187 -0
  298. package/dist/checks/after/tools.js +351 -0
  299. package/dist/checks/after/vercel.js +102 -0
  300. package/dist/checks/before/context-fetch.js +426 -0
  301. package/dist/checks/before/env.js +173 -0
  302. package/dist/checks/before/files.js +185 -0
  303. package/dist/checks/before/index.js +162 -0
  304. package/dist/checks/before/mcp.js +111 -0
  305. package/dist/checks/before/repo.js +71 -0
  306. package/dist/checks/before/version.js +60 -0
  307. package/dist/checks/status-holes.js +393 -0
  308. package/dist/cli.js +692 -0
  309. package/dist/commands/analysis.js +325 -0
  310. package/dist/commands/ci/ci.js +438 -0
  311. package/dist/commands/comply.js +310 -0
  312. package/dist/commands/harvest.js +354 -0
  313. package/dist/commands/install/check.js +61 -0
  314. package/dist/commands/install/doctor.js +207 -0
  315. package/dist/commands/install/install.js +461 -0
  316. package/dist/commands/install/uninstall.js +815 -0
  317. package/dist/commands/install/upgrade.js +771 -0
  318. package/dist/commands/launch.js +118 -0
  319. package/dist/commands/lib.js +362 -0
  320. package/dist/commands/registry.js +50 -0
  321. package/dist/commands/setup/setup.js +158 -0
  322. package/dist/commands/telemetry.js +29 -0
  323. package/dist/commands/workflow/branches.js +1265 -0
  324. package/dist/commands/workflow/context.js +846 -0
  325. package/dist/commands/workflow/counters.js +227 -0
  326. package/dist/commands/workflow/fids.js +224 -0
  327. package/dist/commands/workflow/issues.js +585 -0
  328. package/dist/commands/workflow/ledgers.js +472 -0
  329. package/dist/commands/workflow/locks.js +364 -0
  330. package/dist/commands/workflow/prs.js +904 -0
  331. package/dist/commands/workflow/repo.js +199 -0
  332. package/dist/commands/workflow/roadmap.js +495 -0
  333. package/dist/commands/workflow/runs.js +1717 -0
  334. package/dist/commands/workflow/runtime.js +257 -0
  335. package/dist/commands/workflow/skills.js +110 -0
  336. package/dist/commands/workflow/status.js +392 -0
  337. package/dist/commands/workflow/steps.js +1093 -0
  338. package/dist/commands/workflow/tests.js +144 -0
  339. package/dist/commands/workflow/workflows.js +1342 -0
  340. package/dist/commands/workflow/workstreams.js +141 -0
  341. package/dist/commands/workflow/worktrees.js +473 -0
  342. package/dist/install/cloud-env.js +819 -0
  343. package/dist/install/managed-block.js +182 -0
  344. package/dist/install/manifest.js +376 -0
  345. package/dist/install/modules/claude.js +288 -0
  346. package/dist/install/modules/cloud.js +152 -0
  347. package/dist/install/modules/codex.js +193 -0
  348. package/dist/install/modules/core.js +511 -0
  349. package/dist/install/modules/cursor.js +186 -0
  350. package/dist/install/modules/index.js +152 -0
  351. package/dist/install/modules/opencode.js +504 -0
  352. package/dist/install/placeholders.js +87 -0
  353. package/dist/install/template-copies.js +106 -0
  354. package/dist/install/version-file.js +204 -0
  355. package/dist/install/write.js +342 -0
  356. package/dist/ledgers/clamp-log.js +27 -0
  357. package/dist/ledgers/status.js +156 -0
  358. package/dist/ledgers/telemetry.js +637 -0
  359. package/dist/render/hosts.js +339 -0
  360. package/dist/render/models.js +288 -0
  361. package/dist/render/parts.js +33 -0
  362. package/dist/render/trackers.js +135 -0
  363. package/dist/shared/egress.js +299 -0
  364. package/dist/shared/json.js +16 -0
  365. package/dist/shared/log-prefix.js +7 -0
  366. package/dist/shared/package-json.js +22 -0
  367. package/dist/shared/package-manager.js +32 -0
  368. package/dist/shared/package-roots.js +145 -0
  369. package/dist/shared/protected-paths.js +153 -0
  370. package/dist/shared/settings.js +44 -0
  371. package/dist/shared/timeouts.js +19 -0
  372. package/dist/tools/wording.js +680 -0
  373. package/package.json +101 -4
@@ -0,0 +1,227 @@
1
+ <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # AIO SEO Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Whether search engines and answer engines can find, read, and correctly describe public pages.
11
+ >
12
+ > **Rules:**
13
+ >
14
+ > - Read-only audit; never edit code, config, or data.
15
+ > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
+ > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
+ > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
+ > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
+ > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
+ > - Every claim cites evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - never change search-console, webmaster, robots, sitemap, IndexNow, or firewall settings; record the owner's decision.
23
+ > - Name a personal-data field and its page for `bkit-audit-privacy`; never copy a personal-data value into the report.
24
+
25
+ ## Universal Instructions
26
+
27
+ ### Context & Goals
28
+
29
+ - Search and answer engines read the same public pages; silent failures (`noindex` from preview config, canonical to preview URL, sitemap listing login-gated pages) stop traffic while the site still works.
30
+ - Search engines rank pages; answer engines quote facts → plain factual copy matters.
31
+ - Engine ignores `llms.txt` but shares one index with AI answers → indexing basics cover both.
32
+
33
+ **Applies when:** a web origin crawlers can request. None → one `N/A` row with evidence, never "clean".
34
+
35
+ **Cadence:** quarterly. Extra pass when routing, locales, or the public site change.
36
+
37
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
38
+
39
+ - Search essentials and the search-documentation updates log (e.g. Google Search Essentials, Bing Webmaster Guidelines); record the date of the newest entry read.
40
+ - The engine's AI-features and generative-AI optimisation guides (e.g. Google's AI features and your website); record each page's last-updated date.
41
+ - Search-console help, including the control for generative answers (e.g. Search Console Help); record the date read.
42
+ - Index submission protocol (e.g. IndexNow); record the date read.
43
+ - Structured-data vocabulary release and the engine's supported-type list (e.g. schema.org, Google's structured-data gallery); record release number and date read.
44
+ - Robots Exclusion Protocol (e.g. RFC 9309).
45
+ - Each AI vendor's crawler documentation (e.g. OpenAI, Anthropic, Perplexity, Apple, Google's common crawlers); record each page's date or the date read.
46
+ - Core Web Vitals, owned by `bkit-audit-app-performance`; this audit reads only what the search console reports.
47
+
48
+ ### Scope
49
+
50
+ - Public URLs vs previews (previews not indexable).
51
+ - Crawling / indexing: robots, sitemap, canonicals, locales, status codes, HTML with and without JavaScript.
52
+ - Metadata, structured data, plain answers answer engines quote.
53
+ - AI crawler policy, firewall agreement, engine responses when asked.
54
+ - Site structure, trust pages, search-console reports.
55
+
56
+ ### Out of Scope
57
+
58
+ <!-- prettier-ignore -->
59
+ | Excluded item | Why | Where it belongs |
60
+ | --- | --- | --- |
61
+ | Page speed; Core Web Vitals beyond the search console's report | Speed sweep | `bkit-audit-app-performance` |
62
+ | Heading order, alt text, contrast | Accessibility sweep | `bkit-audit-accessibility` |
63
+ | Whether structure or copy works for people | Usability sweep | `bkit-audit-usability` |
64
+ | Personal data on a public page | Privacy sweep | `bkit-audit-privacy` |
65
+ | Screen a search-to-app link opens | Store sweep | `bkit-audit-app-store` |
66
+ | How AI referral traffic is measured | Tracking sweep | `bkit-audit-analytics` |
67
+ | A doc that describes the site wrongly | Documentation sweep | `bkit-audit-documentation` |
68
+ | Applying fixes / changing robots, consoles, or firewall | Audit reports only | Plan from this report |
69
+
70
+ ### Pre-Flight / Dependencies
71
+
72
+ **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
73
+
74
+ #### Core
75
+
76
+ Always verify.
77
+
78
+ - [ ] **Live Fetch:** Steps 2–9 — request public URLs, headers, and HTML, e.g. `curl`, a browser. Fallback: source read; live claims = hypotheses.
79
+ - [ ] **Web:** Step 10 — fetch anchor standards. Fallback: versions recorded as unread.
80
+
81
+ #### Conditional
82
+
83
+ Verify only when applicable.
84
+
85
+ - [ ] **Search Consoles:** Indexable public pages → Step 9 — e.g. Google Search Console, Bing Webmaster Tools. Fallback: none; consoles missing while indexable pages exist = finding.
86
+ - [ ] **Edge Logs:** Bot firewall or CDN → Step 6 — crawler status codes, e.g. Vercel Firewall, Cloudflare. Fallback: `robots.txt` only; log rows `Not Checked`.
87
+ - [ ] **Schema Validators:** Structured data present → Step 5 — rich-results test and a schema.org validator, e.g. Google Rich Results Test, Schema Markup Validator. Fallback: read required properties from the engine's docs.
88
+ - [ ] **Answer Engines:** Indexable public pages → Step 6 — signed-out prompts, e.g. ChatGPT search, Perplexity, Gemini, Google AI Mode, Copilot, Claude. Fallback: page-text checks only; prompt rows `Not Checked`.
89
+
90
+ ### 🔒 Gate 1: Prerequisites Check
91
+
92
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
93
+
94
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
95
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
96
+
97
+ ### Probe Steps
98
+
99
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
100
+ - [ ] **Step 2 — Public URLs:** List public URLs from sitemap if present, else crawl from home. Record production host and tools available in `Checked`. First: no preview deployment indexable (`X-Robots-Tag: noindex` or host deployment protection); crawled preview competes with production and can expose unreleased pages. Marketing site outside repo → name where; audit from live URL. **Done when:** host, URL list, preview verdict in `Public URLs`. No web origin → `N/A` and STOP. No indexable page → say so; `Indexing` still runs; steps needing indexable page skip with evidence in `Not Checked`.
101
+ - [ ] **Step 3 — Indexing:** `robots.txt` + sitemap: present, valid, public URLs only. `lastmod` only when that page's content changes — trusted only when consistently accurate. Sitemap submitted in each webmaster console. Robots meta + `X-Robots-Tag` per page type: auth/previews `noindex`, public indexable. No `noindex` also `Disallow`ed: blocked crawler never sees `noindex` → URL can stay indexed from links. Canonicals: absolute, production host, one per page. Host canonicalisation: `http`→`https`, apex↔`www`, trailing-slash policy each one hop; HSTS set; sitemap uses canonical form only. Status codes: chain ≤1 hop, no loops, missing →404. Locales: `hreflang` per variant → existing pages; `hreflang="x-default"`; sets reciprocal and include self; canonical same-locale, never another locale; no forced `/` redirect by `Accept-Language` or IP — crawler without `Accept-Language` from one country (e.g. Googlebot) must see other locales. Content in HTML without JavaScript. Rendered HTML: one URL per page type — no-JS view vs engine render after JS (e.g. URL Inspection). Mobile/desktop same content when engine indexes mobile (e.g. Google). **Done when:** `Indexing` row per check: met / finding / not applicable (why).
102
+ - [ ] **Step 4 — Metadata:** Indexable public page → title + description present, unique, right length. Open Graph + Twitter card tags; images exist, right size. `lang`, favicon, web manifest. Store listings → Smart App Banner (`apple-itunes-app`); `apple-app-site-association` + `assetlinks.json` reachable so search opens app. Link target screen → `bkit-audit-app-store`. **Done when:** `Metadata` row per page: tag · verdict, or skip in `Not Checked`.
103
+ - [ ] **Step 5 — Structured Data:** Indexable public page → JSON-LD per page type: `Organization`, `WebSite`, `SoftwareApplication` or `MobileApplication` with store links, `FAQPage` only mirroring on-page Q&A, `BreadcrumbList` where depth exists. Validate each block; must match visible page — disagreeing markup worse than none. Engine rich-results test (supported) + schema.org validator (vocabulary). App types: engine software-app required props + `operatingSystem`, `applicationCategory`. Ratings from real on-page user ratings, never self-assigned. Retired rich-result type (`Project Instructions`) missing ≠ finding. Generative answers need no special markup; structured data earns rich results and states facts plainly. **Done when:** `Structured Data` row per block: type · valid · agrees with page · verdict, or skip in `Not Checked`.
104
+ - [ ] **Step 6 — Answer Engines:**
105
+ - `llms.txt` / `llms-full.txt` optional. Engines ignore or use unevenly → missing file ≠ finding. If present: current, links to existing pages; stale = `LOW`.
106
+ - Indexable page → plain facts in HTML text (not only images/scripts): product, audience, cost, platforms. Direct Q&A near top of owning page. One name for product/company across site, store, social. Off-site description/pricing/platforms match store, reviews, forums, press — answer engines often cite these over product site. List third-party sources prompt pass cited.
107
+ - AI crawler policy: `robots.txt` per group. Allow/block both fine; no recorded decision = finding. Owner decides; report records. Blocking one group ≠ blocking others. Training: GPTBot, ClaudeBot, Google-Extended, Applebot-Extended, CCBot. Search: OAI-SearchBot, Claude-SearchBot, PerplexityBot, Bingbot (feeds some assistants) — block → out of those answers. User-triggered: ChatGPT-User, Claude-User, Perplexity-User; some vendors say may not follow `robots.txt`. "Block training, allow search" common; write per group.
108
+ - Edge/firewall + CDN "block AI bots" agree with `robots.txt`. Firewall `403` to allowed search crawler overrides `robots.txt` silently. Check edge/server logs for each search crawler requests + status codes, not `robots.txt` alone.
109
+ - Search-console control for generative answers inclusion/exclusion. Owner decides; report records. Does not govern training.
110
+ - Indexable page → same questions to same answer engines. Record date, each answer, citations. Answers drift daily → signal not test; wrong answer = finding about these pages, not the engine. Repeatable: fixed prompts (brand, category, named competitor comparison, pricing); fixed engine set from ChatGPT search, Perplexity, Gemini, Google AI Mode, Copilot, Claude; signed out; verbatim answers + cited URLs; mention/citation share vs previous report or baseline.
111
+ - AI referrals from answer-engine hosts + tagged visits per `bkit-audit-analytics`. Unmeasurable → name that audit; do not invent method here.
112
+
113
+ **Done when:** `Answer Engines` holds policy per group, the console control, prompt rows or a skip, and referral status.
114
+
115
+ - [ ] **Step 7 — Structure:** Indexable public page → URL format (lowercase, hyphenated, stable), click depth from home, orphan pages, broken internal links, nav/breadcrumbs reach every public page. Hierarchy for people → `bkit-audit-usability`; flag, do not decide. **Done when:** `Structure` row per check: met / finding, or skip in `Not Checked`.
116
+ - [ ] **Step 8 — Trust:** Indexable public page → about/company, contact, support, pricing, privacy, terms; dated attributed content where published. `Organization` `sameAs` → store + social. Generative-AI guides: unique non-commodity content first → flag pages restating elsewhere only. Copy for people → `bkit-audit-usability`. **Done when:** `Trust` row per required page: present / finding, or skip in `Not Checked`.
117
+ - [ ] **Step 9 — Consoles:** Indexable pages + consoles → indexing errors, indexed vs submitted, top queries + delta vs previous report. Consoles missing while indexable pages exist = finding; else `Indexing` only signal. Search console: generative-AI performance, Core Web Vitals (speed → `bkit-audit-app-performance`), page-indexing reasons per type (soft 404, duplicate without user-selected canonical, crawled not indexed). Other webmaster: AI-performance (citations, grounding queries, cited pages) + delta. IndexNow: public URL add/update/delete submitted; webmaster shows received. **Done when:** `Consoles` row per report: figure · delta · verdict, missing-console finding, or skip in `Not Checked`.
118
+ - [ ] **Step 10 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: one row per anchor + per search-doc or AI-crawler change since previous → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
119
+ - [ ] **Step 11 — Anything Else:** (a) Changes since previous report's commit on public pages + crawl surface (routes, `robots.txt`, sitemap, metadata, structured data, locale routing, redirects, middleware, firewall/bot settings) → one-line verdict each. (b) Bounded ~30 min: senior technical SEO flags no step asks; read since previous run (incidents, new `docs/failures.jsonl`, `bkit-audit-logs` output, vendor status) — what would no step catch? **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
120
+
121
+ ### 🔒 Gate 2: Probes Check
122
+
123
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
124
+
125
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
126
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
127
+ - [ ] **Settings untouched:** no search-console, webmaster, robots, sitemap, IndexNow, or firewall setting changed.
128
+ - [ ] **No values:** no personal-data value anywhere in the report.
129
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
130
+
131
+ ## Findings
132
+
133
+ <!-- prettier-ignore -->
134
+ | Severity | Use |
135
+ | --- | --- |
136
+ | `CRITICAL` | An indexed preview or signed-in page exposes personal or unreleased data; production canonical points at a host that serves the wrong site and there is no workaround |
137
+ | `HIGH` | Production removed from search; a page that should not be indexed is (auth, preview, signed-in), or an indexable page is `noindex`; `noindex` combined with `Disallow` so the URL can stay indexed; firewall blocks a search crawler the recorded policy allows |
138
+ | `MEDIUM` | Wrong or missing metadata; structured data that disagrees with the page; canonical, `hreflang`, or redirect defect; consoles absent while indexable pages exist; an answer engine states a wrong fact taken from these pages; off-site listing disagrees with the site |
139
+ | `LOW` | Stale `llms.txt`; naming drift that does not change which page is indexed. A missing `llms.txt`, or a missing retired rich-result type, is not a finding |
140
+
141
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: indexing first.
142
+
143
+ <!-- prettier-ignore -->
144
+ | ID | Severity | Location | Evidence | Expected |
145
+ | --- | --- | --- | --- | --- |
146
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
147
+
148
+ Empty and clean → one row `None`.
149
+
150
+ ## Report
151
+
152
+ ### Summary
153
+
154
+ PENDING
155
+
156
+ ### Previous Run
157
+
158
+ PENDING
159
+
160
+ ### Public URLs
161
+
162
+ PENDING
163
+
164
+ ### Indexing
165
+
166
+ PENDING
167
+
168
+ ### Metadata
169
+
170
+ PENDING
171
+
172
+ ### Structured Data
173
+
174
+ PENDING
175
+
176
+ ### Answer Engines
177
+
178
+ PENDING
179
+
180
+ ### Structure
181
+
182
+ PENDING
183
+
184
+ ### Trust
185
+
186
+ PENDING
187
+
188
+ ### Consoles
189
+
190
+ PENDING
191
+
192
+ ### Checked
193
+
194
+ PENDING
195
+
196
+ ### Not Checked
197
+
198
+ PENDING
199
+
200
+ ### Standards Coverage
201
+
202
+ PENDING
203
+
204
+ ### Beyond the Steps
205
+
206
+ PENDING
207
+
208
+ ### Process Improvements
209
+
210
+ PENDING
211
+
212
+ ### 🔒 Gate 3: Report Check
213
+
214
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
215
+
216
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
217
+ - [ ] **Summary:** names count per severity, whether any indexable public page exists, and the production host.
218
+ - [ ] **Series:** mention and citation share, and console query deltas, beside the previous report's numbers, or marked baseline.
219
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
220
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
221
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
222
+
223
+ > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
224
+
225
+ <!-- bkit:end -->
226
+
227
+ ## Project Instructions
@@ -0,0 +1,266 @@
1
+ <!-- Note: Reports live at `docs/audits/{YYYYMM}/{slug}.md`. `{YYYYMM}` = UTC month of this run. `{slug}` = template basename without `bkit-audit-` and `.md`. **If** that month already has `{slug}.md` or `{slug}-{TIMESTAMP}.md` → write `{slug}-{TIMESTAMP}.md` (`{TIMESTAMP}` = `date -u +%Y%m%dT%H%M%SZ`). Never overwrite. `@bkit-audit-generate` fills this template. -->
2
+
3
+ <!-- bkit:start -->
4
+
5
+ {{BKIT_MANAGED_MARKER}}
6
+
7
+ # Analytics Audit
8
+
9
+ > [!CAUTION]
10
+ > **Purpose:** Product events — what is tracked, whether it fires, whether names and shapes match across clients, whether consent comes first, and whether any payload carries personal data.
11
+ >
12
+ > **Rules:**
13
+ >
14
+ > - Read-only audit; never edit code, config, or data.
15
+ > - `Universal Instructions` apply to all projects; `Project Instructions` apply only to this project.
16
+ > - Local audit instructions / overrides → `Project Instructions` below the bkit-managed block; universal instructions stay in-block.
17
+ > - Any tools mentioned in `Universal Instructions` are examples only; swap for actual tools in final output; drop inapplicable.
18
+ > - Use dense token-efficient phrasing; no filler / hedging / restating; tables > prose, bullets > paragraphs.
19
+ > - Read `.agents/docs.md` → load docs for workflow / step / task; skip missing; cite docs inline where required.
20
+ > - Every claim cites evidence (`file:line`, or command / query and its output) and tool behind it.
21
+ > - Read this document once at session start; do not trust session memory; do not re-read on every loop iteration.
22
+ > - Name the field and where it lives; never copy a personal-data value into the report.
23
+ > - Vendor consoles are read-only: NEVER publish a container, change a property, or send a live collection hit.
24
+ > - Every container, property, and capture names the environment it ran against.
25
+
26
+ ## Universal Instructions
27
+
28
+ ### Context & Goals
29
+
30
+ Tracking decays quietly: one-sided renames, funnel steps that stop after refactors, tags before consent, personal values in properties. Nothing errors; product still decides on the numbers. Code = tracking plan as implemented. Target failure: **a number the product trusts that the code no longer sends, or a payload that carries a person.** Personal scope, consent requirements, deletion reach → `bkit-audit-privacy`'s rules; this audit applies them to payloads and consent mode.
31
+
32
+ **Applies when:** the product sends analytics events (SDK, tag snippet, or server collection call). None → one `N/A` row with evidence, never "clean".
33
+
34
+ **Cadence:** quarterly. Extra pass after a change to a core flow, and on the run that first finds product tracking (mark baseline).
35
+
36
+ **Anchor Standards:** record version and date read. Newer version → `Standards` step reads what changed.
37
+
38
+ - Product-analytics collection docs (e.g. GA4 developer guides, Analytics Help: collection/config limits, user-id, recommended events, Measurement Protocol, warehouse export). Record date read.
39
+ - Tag-manager docs (e.g. GTM Help: workspaces, environments, preview, tag diagnostics). Record date read.
40
+ - Tag-platform consent (e.g. Google Consent Mode v2 web/app; server-side tagging, first-party tag gateway). Record consent-mode version + date read.
41
+ - Native analytics SDK (e.g. Firebase Analytics). Record SDK version in use.
42
+ - Vendor consent policy (e.g. Google EU user consent policy). Record date read.
43
+ - Privacy regimes for tracking identifiers (e.g. GDPR, ePrivacy Directive; national use/disclosure/cross-border principles). Interpretation → `bkit-audit-privacy`. Record compilation where applicable.
44
+
45
+ ### Scope
46
+
47
+ - Whether product tracking exists, and any doc that claims it does.
48
+ - Event list against the measurement plan.
49
+ - Collection wrapper, data layer, and snippet load order.
50
+ - Tag-manager container: governance, environments, and custom tags.
51
+ - Names, shapes, reserved names, collection limits, and client parity.
52
+ - Core-flow start and completion; double fires.
53
+ - Payloads + consent mode (`bkit-audit-privacy` rules): consent before load/send, defaults/lifecycle, ad-id collection, personal data in payloads/URLs/titles, vendor redaction, analytics purge on account deletion.
54
+ - User id across login, logout, and clients.
55
+ - What actually fires against the code.
56
+ - Dashboards, data quality, alerts, and annotations.
57
+ - Property settings: retention, filters, referrals, key events, custom definitions, automatic collection, and signals.
58
+ - Server-sent events and the collection protocol.
59
+ - Campaigns, attribution, and auth-redirect survival.
60
+ - Integrations: search console, warehouse export, ads, and native-app streams.
61
+
62
+ ### Out of Scope
63
+
64
+ <!-- prettier-ignore -->
65
+ | Excluded item | Why | Where it belongs |
66
+ | --- | --- | --- |
67
+ | Lawful basis, retention periods, processor-list interpretation | Privacy sweep owns the rules; this audit applies them | `bkit-audit-privacy` |
68
+ | Error telemetry and crash reporting | Not product analytics | `bkit-audit-logs` |
69
+ | Third-party scripts as an attack surface; container and property access review | Security sweep | `bkit-audit-security` |
70
+ | Store privacy answers in depth, including advertising-id answers | Store sweep | `bkit-audit-app-store` |
71
+ | Main-thread cost of tags | Performance sweep; payloads and consent stay here | `bkit-audit-app-performance` |
72
+ | Rewriting a doc that describes tracking wrongly | Docs sweep; naming the claim stays here | `bkit-audit-documentation` |
73
+ | Turning a check into a test or gate | Gates sweep | `bkit-audit-gates` |
74
+ | Changing tracking code or analytics settings | Audit reports only | Plan from this report |
75
+
76
+ ### Pre-Flight / Dependencies
77
+
78
+ **Checkpoint:** Check off all core items. Check conditional items only when applicable. Each item: available → tool and version; missing → fallback, gap in `Not Checked`, fix in `Process Improvements`. Unnamed gap reads as passed. never abort for a missing capability.
79
+
80
+ #### Core
81
+
82
+ Always verify.
83
+
84
+ - [ ] **Web:** Step 18 — fetch anchor standards. Fallback: versions recorded as unread.
85
+
86
+ #### Conditional
87
+
88
+ Verify only when applicable.
89
+
90
+ - [ ] **Request Capture:** Product tracking in code → Step 12 — browser network panel or a test-runner intercept, e.g. Playwright `page.route`, Cypress `intercept`. Fallback: code only; firing claims = hypotheses in `Not Checked`.
91
+ - [ ] **Tag Manager:** A tag manager sits between app and vendor → Steps 5, 6, 10, 12 — container export, preview, and diagnostics, e.g. GTM JSON export, Tag Assistant. Fallback: code and network only; container diff `Not Checked`.
92
+ - [ ] **Analytics Admin:** A hosted property exists → Steps 9, 11, 13, 14 — retention, filters, redaction, and user-deletion, e.g. GA4 Admin API, Firebase console, Amplitude settings. Fallback: none; settings `Not Checked`.
93
+ - [ ] **Native Debug:** A native analytics SDK exists → Steps 10–12 — debug view, e.g. Firebase DebugView. Fallback: `Not Checked`. Confirm debug flags never ship in a release build.
94
+ - [ ] **Warehouse:** An export is linked → Step 17 — row counts, e.g. BigQuery, Snowflake. Fallback: vendor-UI counts only; reconciliation `Not Checked`.
95
+
96
+ ### 🔒 Gate 1: Prerequisites Check
97
+
98
+ **Checkpoint.** Verify and check `[x]` all applicable boxes above, then continue to `Probe Steps` without asking.
99
+
100
+ - [ ] **Gaps named:** every missing item names its fallback and `Not Checked` entry.
101
+ - [ ] **Gate 1 - Verified:** All Core items checked. All applicable Conditional items checked.
102
+
103
+ ### Probe Steps
104
+
105
+ - [ ] **Step 1 — Previous Run:** Record `git rev-parse HEAD`. Read newest prior report for this slug under `docs/audits/`. Count findings fixed / still open; age of oldest open. Open after 2 runs → re-raise with age. **Done when:** closure rate in `Previous Run`, or run marked baseline.
106
+ - [ ] **Step 2 — Detect:** Find every analytics SDK, tag-manager snippet, and event call on web, native, and server — vendor packages, hosts, wrapper. Error-tracker SDKs are not product analytics. None → docs claiming tracking; unmet claim = finding → `bkit-audit-documentation`; then `N/A` and STOP. Record tools in `Checked`. **Done when:** surfaces in `Checked`, or `N/A` and STOP.
107
+ - [ ] **Step 3 — Events:** Every code-sent event: name, fire site, property types = tracking plan as implemented. No written intended plan = finding (Step 4). **Done when:** `Events` lists every event and change since the previous run, or marked baseline.
108
+ - [ ] **Step 4 — Plan:** Each business question: owner + map to named events, key events, custom dimensions. Event without question wastes limits = finding; question without event = gap. Intended plan `Events` compares to. **Done when:** `Plan` row per question: owner · events · verdict against `Events`.
109
+ - [ ] **Step 5 — Data Layer:** Tag manager between app and vendor (e.g. GA4 through GTM) → (a) Push to data layer only via one typed wrapper; tag manager picks destinations. Direct vendor calls (e.g. `gtag(`), in-component SDK calls, bypass pushes = finding. (b) Layer retains keys across pushes → leak without reset; clear prior object before each commerce push (e.g. `ecommerce: null`). (c) One page view per navigation: non-full-load router sends `page_view` from history auto **or** manual virtual, never both; preview five routes → five hits with new location/title. (d) Snippet once from root layout, after Step 10 consent defaults, only after grant; each deploy loads `Container` environment expected. No tag manager → skip with evidence. **Done when:** `Data Layer` holds the five-route count and each breach = finding.
110
+ - [ ] **Step 6 — Container:** Tag manager in use → (a) Export live container JSON each run → attach (or commit per owner) → diff vs previous export. (b) One naming convention (e.g. `GA4 – Event – sign_up`), folders; no unused/paused tags, triggers, variables; named published versions + notes; one workspace per change set; publish rights to named people only. (c) Each custom HTML/template: author, loads what, consent check, `unsafe-inline` CSP need; script risk → `bkit-audit-security`. (d) Non-prod: non-live snippet or none, never live container. (e) Diagnostics + coverage: untagged pages, silent tags, CSP blocks. (f) Container + property on company account; least privilege; leavers removed; access → `bkit-audit-security`. No tag manager → skip with evidence. **Done when:** `Container` holds the diff, governance, diagnostics, and ownership, or the skip.
111
+ - [ ] **Step 7 — Names:** One convention (e.g. `object_action`, one case); same event + properties every client; no always-empty/same properties; consistent id types; rename/version changes, not silent reshapes. Prefer vendor recommended events (e.g. GA4 `sign_up`, `login`, `purchase`, `begin_checkout`, `share`, `generate_lead`). No reserved events or reserved-prefix params (e.g. `_`, `firebase_`, `ga_`, `google_`, `gtag.`). Record vendor collection limits (name length, params/event, value length, distinct names); silent over-limit drop → check longest name, widest event, longest values. **Done when:** convention and recorded limits in `Events`; each breach = finding.
112
+ - [ ] **Step 8 — Coverage:** Each core flow: start + completion for drop-off; conversions defined; no double fires (re-renders, strict mode, client + server same action). De-duplication → `Server Events`; key events → `Property`. **Done when:** each core flow's start and completion are in `Events`; each double fire = finding.
113
+ - [ ] **Step 9 — Consent:** Apply `bkit-audit-privacy`'s rules. (a) No tag/SDK load or send before consent where required; cross-app permission (e.g. iOS App Tracking Transparency) only when tracking crosses apps. (b) Native: advertising-id off unless app shows ads — no ad-id module/framework, vendor ad-id flag false; store answers must match → `bkit-audit-app-store`. (c) No personal data in properties, URLs, titles (email, name, free text, precise location). (d) Web streams: vendor redaction (e.g. GA4 data redaction) on for email + query params (auth codes, tokens, email); test redaction preview; without it auth/invite URLs leak location/referrer. Fields redaction skips (e.g. GA4: `Server Events` + page titles) → check dynamic titles (person/household/item names). Gap → `bkit-audit-privacy`. (e) Vendor IP handling + retention. (f) Vendor on processor list + privacy policy; list → `bkit-audit-privacy`. (g) Account deletion removes user analytics via vendor user-deletion API (user id + client/app instance id when known). Gap → `bkit-audit-privacy`. **Done when:** `Consent` row per item: met / finding / not applicable.
114
+ - [ ] **Step 10 — Consent Mode:** Consent-mode tag platform (e.g. Google tags) → (a) Signals (e.g. `analytics_storage`, `ad_storage`, `ad_user_data`, `ad_personalization`) default denied before snippet runs; update on choice; regional defaults → record regions, check each. (b) Basic mode only: no vendor load/send before grant. Capture + preview: no choice → no vendor host request; deny → same. Advanced mode (preload + cookieless pings while denied) = finding; any pre-consent vendor request = finding. (c) No vendor cookies pre-choice; deny/withdraw clears/stops; choice survives reload, consistent across clients — preview consent tab + cookie jar dump per stage; names only, never identifying values. (d) Native defaults denied in platform config; native call matches web banner choice. (e) Ads/remarketing linked → CMP integrates consent mode (prefer vendor-certified); `ad_user_data` gates user-id/enhanced-conversion sharing. Wrong default/signal/lifecycle → `bkit-audit-privacy`. No consent mode → skip with evidence. **Done when:** `Consent` holds defaults, the no-choice capture, and the lifecycle, or the skip.
115
+ - [ ] **Step 11 — Identity:** Login → internal user id only (never email/personal), via vendor's user-id mechanism only (e.g. GA4 `user_id` config parameter) — never event param, user property, or registered custom dimension; sent every page load while signed in. Logout → null, not `""`, `" "`, or `"null"`; never-signed-in → no user id. Native mirrors login/logout. One property stitches web+app (e.g. Blended/Observed); household model documented (e.g. low-cardinality user property). Never register per-household/per-user id as custom dimension. Verify sign-in/nav/sign-out in preview (web) + debug view (native); record user-id presence/shape, never value. Personal id or post-logout survival → plan from this report + `bkit-audit-privacy` if personal data left. **Done when:** `Identity` row per stage: signed out · signed in · after logout · never signed in.
116
+ - [ ] **Step 12 — Firing:** Run each core flow (E2E or manual) → capture requests vs `Events`. Events in code that never fire = dead tracking; fire-not-in-code = auto-collection decision; payload mismatch = bug. Web: tag-manager preview + network. Per flow: tags + consent state, data layer per push, outgoing hits. Native: debug view; debug flags never in release. One screen view per screen (name/class match web routes) + auto events (e.g. `first_open`, `session_start`, Android `app_remove`). **Done when:** `Firing` row per core flow: expected · captured · verdict.
117
+ - [ ] **Step 13 — Dashboards:** Vendor reports/conversions use existing events; internal/test filtered. Each run: unset page/landing shares, collapsed high-cardinality size, unassigned channel, self-referrals + delta vs previous run. Alert on core-flow key event → zero between runs. Tracking-changing releases annotated. Dashboard on dead event → owner with report + event. **Done when:** `Dashboards` holds quality shares, alerts, and annotations.
118
+ - [ ] **Step 14 — Property:** Hosted property (e.g. GA4) → screenshot or admin API dump per setting; name property. (a) Deliberate retention (past short default) + reset-on-new-activity vs `bkit-audit-privacy` rules. (b) Internal/dev traffic filters active (not testing); permanent exclusions; app streams exclude at source (CI/synthetic/test). (c) Unwanted referrals: checkout, OAuth, auth hosts — else sign-in/purchase credit lost. (d) Each `Coverage` completion = key event (non-trivial); counting method chosen; within doc limit (record limit). (e) Report params registered as custom dims/metrics within limits; no high-cardinality ids. (f) Auto-collection toggles: SPA form noise; site-search param names; downloads may leak filenames (personal). (g) Signals/demographics threshold risk — record decision; off or device identity if core data hidden. (h) Granular location/device + user-provided data per region; user-provided off unless enhanced conversions. (i) TZ/currency match business; session/engaged timers; cross-domain if marketing ≠ app domain. Other vendor → equivalent settings or skip. Undecided drift → owner + diff/screenshot. **Done when:** `Property` row per setting: value · decided · verdict.
119
+ - [ ] **Step 15 — Server Events:** List server-protocol sends (e.g. webhook subscription lifecycle, inbound message, job outcomes). Reuse client id (web) or app instance id (native); session id only in vendor window. Validate via vendor debug endpoint; API secret in secrets store, rotated. No client twin or shared dedup key (e.g. `transaction_id`); subscription revenue from webhook, not client success page. Server strips personal data (redaction N/A). Document first-party script + same-origin path (e.g. `/metrics`) via host/CDN + server container strip; no decision = finding; if adopted check domain, prod instance count vs vendor guidance, strip rules. **Done when:** `Server Events` row per event: client id reused · deduped · personal data stripped · verdict.
120
+ - [ ] **Step 16 — Campaigns:** Written UTM taxonomy: lowercase fixed source/medium vocabulary + campaign id matching vendor channel groups; no internal UTMs; invite/reply/reset links carry UTMs. Auth redirects preserve params (e.g. `utm_*`, `gclid`, `gbraid`, `wbraid`) through sign-up → confirm → callback → first landing; test tagged sign-up + first page view/sign-up hit. Record attribution model, key-event lookbacks, custom channel groups (incl. assistant-referrer for `bkit-audit-aio-seo`). Installs: store referrer, campaign links, deferred invite deep links → first open. Lost params/untagged email → plan, name flow. **Done when:** `Campaigns` row per item: written · tested · verdict.
121
+ - [ ] **Step 17 — Integrations:** Search Console when public pages exist. Warehouse export → project observability stack, daily (+ streaming if needed), all streams; record region/expiry/cost; daily volume vs export limit (record limit; chronic exceed → pause risk). One processed day: vendor UI count vs warehouse rows (device id identity, matched TZ); doc gap (e.g. 2–5%) OK, more = finding. Ads + auto-tagging/enhanced conversions only if paid acquisition else "not linked". Link native projects + store billing if IAP. Missing link → owner. **Done when:** `Integrations` row per link: linked / not linked / not applicable.
122
+ - [ ] **Step 18 — Standards:** Confirm current version per anchor standard; read changes since previous report's version. `Standards Coverage`: row per consent signal, collection/config limit, user-id rule, tag-manager governance, server-protocol requirement → checked (name step) / not applicable (why) / finding. Unapplied recommended practice → adopt (propose step) / reject (why) / not applicable. **Done when:** no empty row.
123
+ - [ ] **Step 19 — Anything Else:** (a) Since previous commit, every tracking touch (events, data-layer wrapper, container, property/stream, consent banner/mode, native config, server events, auth redirects) → one-line verdict. (b) ~30 min senior pass + incidents/`bkit-audit-logs`/`docs/failures.jsonl`/vendor status since last run — gaps no step covers. **Done when:** `Beyond the Steps` holds both passes, or `none`. Class seen on 2 runs → propose step in `Process Improvements`.
124
+
125
+ ### 🔒 Gate 2: Probes Check
126
+
127
+ **Checkpoint.** Verify and check `[x]` all boxes below, then continue to `Findings` without asking.
128
+
129
+ - [ ] **Steps complete:** every step `[x]`, or explicit skip with evidence the surface is absent.
130
+ - [ ] **Evidence:** every finding cites re-checkable evidence and the tool behind it.
131
+ - [ ] **No values:** no personal-data value anywhere in the report.
132
+ - [ ] **Consoles untouched:** no container published, no property setting changed, no live collection hit sent.
133
+ - [ ] **Gate 2 - Verified:** Every checkbox above independently verified and checked off.
134
+
135
+ ## Findings
136
+
137
+ <!-- prettier-ignore -->
138
+ | Severity | Use |
139
+ | --- | --- |
140
+ | `CRITICAL` | Personal data already sent in an event, URL, or title; vendor request before any consent choice and no way to stop collection |
141
+ | `HIGH` | Consent default not denied before the snippet; advanced consent mode; user id that is personal or survives logout; account deletion leaves analytics data; over-limit data dropped with no error; live container on a non-production deploy |
142
+ | `MEDIUM` | Dead, duplicate, or misshapen event; client mismatch; no measurement plan; key event missing or trivial; filter left in testing; campaign parameters stripped; dashboard on a dead event |
143
+ | `LOW` | Naming drift that changes no report; missing annotation; unused paused tag |
144
+
145
+ Scale per `.bkit/jsonl.md` § Severity. Within a severity: personal data / consent first. Personal data in an event, a tag that loads before consent, consent defaults that are not denied before the snippet, and a user id that is personal data are each at least `HIGH`. `Expected` names where it goes.
146
+
147
+ <!-- prettier-ignore -->
148
+ | Finding | Goes to |
149
+ | --- | --- |
150
+ | Personal data in an event, tracking before consent, or consent mode in advanced mode | `bkit-audit-privacy`; `bkit-audit-security` if data already left |
151
+ | A consent-mode default, signal, or lifecycle step that is wrong | `bkit-audit-privacy` |
152
+ | A user id that is personal data, or that survives logout | Plan from this report; `bkit-audit-privacy` if personal data left |
153
+ | Account deletion that leaves analytics data behind | `bkit-audit-privacy` |
154
+ | A missing, dead, duplicated, or misshapen event | Plan from this report |
155
+ | A difference between clients | Plan from this report |
156
+ | Campaign parameters lost in a redirect, or untagged email links | Plan from this report |
157
+ | A dashboard that uses an event that no longer exists | The owner, with the report and the event |
158
+ | Property or container drift nobody decided | The owner, with the diff or screenshot |
159
+ | A missing integration link | The owner |
160
+ | A third-party script as a risk | `bkit-audit-security` |
161
+ | Container or property access and ownership gaps | `bkit-audit-security` |
162
+ | Advertising-id collection the store privacy answers do not match | `bkit-audit-app-store` |
163
+ | A doc that describes tracking wrongly | `bkit-audit-documentation` |
164
+ | A check that could become a test | `bkit-audit-gates` |
165
+
166
+ <!-- prettier-ignore -->
167
+ | ID | Severity | Location | Evidence | Expected |
168
+ | --- | --- | --- | --- | --- |
169
+ | PENDING | PENDING | PENDING | PENDING | PENDING |
170
+
171
+ Empty and clean → one row `None`.
172
+
173
+ ## Report
174
+
175
+ ### Summary
176
+
177
+ PENDING
178
+
179
+ ### Previous Run
180
+
181
+ PENDING
182
+
183
+ ### Events
184
+
185
+ PENDING
186
+
187
+ ### Plan
188
+
189
+ PENDING
190
+
191
+ ### Data Layer
192
+
193
+ PENDING
194
+
195
+ ### Container
196
+
197
+ PENDING
198
+
199
+ ### Consent
200
+
201
+ PENDING
202
+
203
+ ### Identity
204
+
205
+ PENDING
206
+
207
+ ### Firing
208
+
209
+ PENDING
210
+
211
+ ### Dashboards
212
+
213
+ PENDING
214
+
215
+ ### Property
216
+
217
+ PENDING
218
+
219
+ ### Server Events
220
+
221
+ PENDING
222
+
223
+ ### Campaigns
224
+
225
+ PENDING
226
+
227
+ ### Integrations
228
+
229
+ PENDING
230
+
231
+ ### Checked
232
+
233
+ PENDING
234
+
235
+ ### Not Checked
236
+
237
+ PENDING
238
+
239
+ ### Standards Coverage
240
+
241
+ PENDING
242
+
243
+ ### Beyond the Steps
244
+
245
+ PENDING
246
+
247
+ ### Process Improvements
248
+
249
+ PENDING
250
+
251
+ ### 🔒 Gate 3: Report Check
252
+
253
+ **Checkpoint.** Verify and check `[x]` all boxes below, then stop.
254
+
255
+ - [ ] **No placeholders:** Findings table and every `Report` section have no `PENDING`.
256
+ - [ ] **Summary:** names count per severity, whether the audit applied, and the event-list change vs the previous run (or baseline).
257
+ - [ ] **Series:** `Dashboards` shares and the `Container` diff beside previous report's, or marked baseline.
258
+ - [ ] **Writes:** only this report and template `Project Instructions` changed; throwaway worktrees / remote targets removed.
259
+ - [ ] **Process Improvements:** `Universal` = proposed step changes, template untouched; `Project` = edits applied below `bkit:end`; each `none` if empty.
260
+ - [ ] **Gate 3 - Verified:** Every checkbox above independently verified and checked off.
261
+
262
+ > `Project Instructions` below `bkit:end` are consumer-owned — `bkit install` never overwrites them, `bkit check` drift stays clean. Add project-specific tools, paths, commands, and checks there, keyed by section or step title; never results.
263
+
264
+ <!-- bkit:end -->
265
+
266
+ ## Project Instructions