@tyroneross/build-loop 0.30.3

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 (389) hide show
  1. package/.agents/plugins/marketplace.json +10 -0
  2. package/.claude-plugin/marketplace.json +38 -0
  3. package/.claude-plugin/plugin.json +30 -0
  4. package/.codex-plugin/plugin.json +41 -0
  5. package/.cursor/rules/build-loop-surface.mdc +22 -0
  6. package/AGENTS.md +498 -0
  7. package/LICENSE +202 -0
  8. package/README.md +403 -0
  9. package/agents/alignment-checker.md +124 -0
  10. package/agents/api-assessor.md +136 -0
  11. package/agents/architecture-scout.md +185 -0
  12. package/agents/assessment-orchestrator.md +163 -0
  13. package/agents/build-orchestrator.md +198 -0
  14. package/agents/database-assessor.md +133 -0
  15. package/agents/design-contract-specialist.md +239 -0
  16. package/agents/fact-checker.md +69 -0
  17. package/agents/fix-critique.md +161 -0
  18. package/agents/frontend-assessor.md +136 -0
  19. package/agents/implementer.md +185 -0
  20. package/agents/independent-auditor.md +143 -0
  21. package/agents/mock-scanner.md +78 -0
  22. package/agents/optimize-runner.md +112 -0
  23. package/agents/overfitting-reviewer.md +96 -0
  24. package/agents/performance-assessor.md +159 -0
  25. package/agents/plan-critic.md +85 -0
  26. package/agents/promotion-reviewer.md +121 -0
  27. package/agents/recurring-pattern-detector.md +248 -0
  28. package/agents/retrospective-synthesizer.md +109 -0
  29. package/agents/root-cause-investigator.md +285 -0
  30. package/agents/scope-auditor.md +121 -0
  31. package/agents/security-reviewer.md +151 -0
  32. package/agents/self-improvement-architect.md +125 -0
  33. package/agents/synthesis-critic.md +99 -0
  34. package/agents/transcript-pattern-miner.md +165 -0
  35. package/agents/ui-validator.md +193 -0
  36. package/codex-skills/build-loop/SKILL.md +20 -0
  37. package/codex-skills/debug-loop/SKILL.md +18 -0
  38. package/codex-skills/handoff/SKILL.md +22 -0
  39. package/codex-skills/knowledge/SKILL.md +21 -0
  40. package/codex-skills/optimize/SKILL.md +18 -0
  41. package/codex-skills/research/SKILL.md +18 -0
  42. package/commands/agent-rally-point.md +301 -0
  43. package/commands/assess.md +41 -0
  44. package/commands/debug.md +20 -0
  45. package/commands/debugger-detail.md +34 -0
  46. package/commands/debugger-scan.md +15 -0
  47. package/commands/debugger-status.md +20 -0
  48. package/commands/debugger.md +32 -0
  49. package/commands/handoff.md +113 -0
  50. package/commands/knowledge-review.md +16 -0
  51. package/commands/optimize.md +31 -0
  52. package/commands/plan-verify.md +39 -0
  53. package/commands/promote-experiment.md +129 -0
  54. package/commands/research.md +22 -0
  55. package/commands/run.md +12 -0
  56. package/commands/self-review.md +51 -0
  57. package/commands/start-prd.md +57 -0
  58. package/commands/test.md +34 -0
  59. package/dist/src/assessment-orchestrator.d.ts +78 -0
  60. package/dist/src/assessment-orchestrator.d.ts.map +1 -0
  61. package/dist/src/assessment-orchestrator.js +304 -0
  62. package/dist/src/assessment-orchestrator.js.map +1 -0
  63. package/dist/src/audit-miner.d.ts +21 -0
  64. package/dist/src/audit-miner.d.ts.map +1 -0
  65. package/dist/src/audit-miner.js +421 -0
  66. package/dist/src/audit-miner.js.map +1 -0
  67. package/dist/src/batch-operations.d.ts +30 -0
  68. package/dist/src/batch-operations.d.ts.map +1 -0
  69. package/dist/src/batch-operations.js +339 -0
  70. package/dist/src/batch-operations.js.map +1 -0
  71. package/dist/src/config.d.ts +83 -0
  72. package/dist/src/config.d.ts.map +1 -0
  73. package/dist/src/config.js +176 -0
  74. package/dist/src/config.js.map +1 -0
  75. package/dist/src/context-engine.d.ts +45 -0
  76. package/dist/src/context-engine.d.ts.map +1 -0
  77. package/dist/src/context-engine.js +135 -0
  78. package/dist/src/context-engine.js.map +1 -0
  79. package/dist/src/debug-wrapper.d.ts +58 -0
  80. package/dist/src/debug-wrapper.d.ts.map +1 -0
  81. package/dist/src/debug-wrapper.js +285 -0
  82. package/dist/src/debug-wrapper.js.map +1 -0
  83. package/dist/src/index.d.ts +31 -0
  84. package/dist/src/index.d.ts.map +1 -0
  85. package/dist/src/index.js +149 -0
  86. package/dist/src/index.js.map +1 -0
  87. package/dist/src/interactive-verifier.d.ts +26 -0
  88. package/dist/src/interactive-verifier.d.ts.map +1 -0
  89. package/dist/src/interactive-verifier.js +435 -0
  90. package/dist/src/interactive-verifier.js.map +1 -0
  91. package/dist/src/lessons.d.ts +59 -0
  92. package/dist/src/lessons.d.ts.map +1 -0
  93. package/dist/src/lessons.js +172 -0
  94. package/dist/src/lessons.js.map +1 -0
  95. package/dist/src/log-reader.d.ts +39 -0
  96. package/dist/src/log-reader.d.ts.map +1 -0
  97. package/dist/src/log-reader.js +291 -0
  98. package/dist/src/log-reader.js.map +1 -0
  99. package/dist/src/logger.d.ts +59 -0
  100. package/dist/src/logger.d.ts.map +1 -0
  101. package/dist/src/logger.js +328 -0
  102. package/dist/src/logger.js.map +1 -0
  103. package/dist/src/parallel-retrieval.d.ts +52 -0
  104. package/dist/src/parallel-retrieval.d.ts.map +1 -0
  105. package/dist/src/parallel-retrieval.js +309 -0
  106. package/dist/src/parallel-retrieval.js.map +1 -0
  107. package/dist/src/pattern-extractor.d.ts +30 -0
  108. package/dist/src/pattern-extractor.d.ts.map +1 -0
  109. package/dist/src/pattern-extractor.js +386 -0
  110. package/dist/src/pattern-extractor.js.map +1 -0
  111. package/dist/src/result-aggregator.d.ts +44 -0
  112. package/dist/src/result-aggregator.d.ts.map +1 -0
  113. package/dist/src/result-aggregator.js +315 -0
  114. package/dist/src/result-aggregator.js.map +1 -0
  115. package/dist/src/retrieval.d.ts +139 -0
  116. package/dist/src/retrieval.d.ts.map +1 -0
  117. package/dist/src/retrieval.js +724 -0
  118. package/dist/src/retrieval.js.map +1 -0
  119. package/dist/src/setup/auto-setup.d.ts +15 -0
  120. package/dist/src/setup/auto-setup.d.ts.map +1 -0
  121. package/dist/src/setup/auto-setup.js +157 -0
  122. package/dist/src/setup/auto-setup.js.map +1 -0
  123. package/dist/src/setup/configure-hooks.d.ts +8 -0
  124. package/dist/src/setup/configure-hooks.d.ts.map +1 -0
  125. package/dist/src/setup/configure-hooks.js +16 -0
  126. package/dist/src/setup/configure-hooks.js.map +1 -0
  127. package/dist/src/setup/create-slash-commands.d.ts +8 -0
  128. package/dist/src/setup/create-slash-commands.d.ts.map +1 -0
  129. package/dist/src/setup/create-slash-commands.js +101 -0
  130. package/dist/src/setup/create-slash-commands.js.map +1 -0
  131. package/dist/src/setup/index.d.ts +8 -0
  132. package/dist/src/setup/index.d.ts.map +1 -0
  133. package/dist/src/setup/index.js +17 -0
  134. package/dist/src/setup/index.js.map +1 -0
  135. package/dist/src/setup/inject-claude-md.d.ts +10 -0
  136. package/dist/src/setup/inject-claude-md.d.ts.map +1 -0
  137. package/dist/src/setup/inject-claude-md.js +150 -0
  138. package/dist/src/setup/inject-claude-md.js.map +1 -0
  139. package/dist/src/setup/uninstall.d.ts +22 -0
  140. package/dist/src/setup/uninstall.d.ts.map +1 -0
  141. package/dist/src/setup/uninstall.js +235 -0
  142. package/dist/src/setup/uninstall.js.map +1 -0
  143. package/dist/src/storage.d.ts +192 -0
  144. package/dist/src/storage.d.ts.map +1 -0
  145. package/dist/src/storage.js +1037 -0
  146. package/dist/src/storage.js.map +1 -0
  147. package/dist/src/string-similarity.d.ts +8 -0
  148. package/dist/src/string-similarity.d.ts.map +1 -0
  149. package/dist/src/string-similarity.js +57 -0
  150. package/dist/src/string-similarity.js.map +1 -0
  151. package/dist/src/traces/adapters/browser.d.ts +69 -0
  152. package/dist/src/traces/adapters/browser.d.ts.map +1 -0
  153. package/dist/src/traces/adapters/browser.js +280 -0
  154. package/dist/src/traces/adapters/browser.js.map +1 -0
  155. package/dist/src/traces/adapters/index.d.ts +23 -0
  156. package/dist/src/traces/adapters/index.d.ts.map +1 -0
  157. package/dist/src/traces/adapters/index.js +67 -0
  158. package/dist/src/traces/adapters/index.js.map +1 -0
  159. package/dist/src/traces/adapters/langchain.d.ts +42 -0
  160. package/dist/src/traces/adapters/langchain.d.ts.map +1 -0
  161. package/dist/src/traces/adapters/langchain.js +151 -0
  162. package/dist/src/traces/adapters/langchain.js.map +1 -0
  163. package/dist/src/traces/adapters/opentelemetry.d.ts +46 -0
  164. package/dist/src/traces/adapters/opentelemetry.d.ts.map +1 -0
  165. package/dist/src/traces/adapters/opentelemetry.js +164 -0
  166. package/dist/src/traces/adapters/opentelemetry.js.map +1 -0
  167. package/dist/src/traces/adapters/sentry.d.ts +58 -0
  168. package/dist/src/traces/adapters/sentry.d.ts.map +1 -0
  169. package/dist/src/traces/adapters/sentry.js +212 -0
  170. package/dist/src/traces/adapters/sentry.js.map +1 -0
  171. package/dist/src/traces/index.d.ts +10 -0
  172. package/dist/src/traces/index.d.ts.map +1 -0
  173. package/dist/src/traces/index.js +45 -0
  174. package/dist/src/traces/index.js.map +1 -0
  175. package/dist/src/traces/storage.d.ts +78 -0
  176. package/dist/src/traces/storage.d.ts.map +1 -0
  177. package/dist/src/traces/storage.js +399 -0
  178. package/dist/src/traces/storage.js.map +1 -0
  179. package/dist/src/traces/summarizer.d.ts +83 -0
  180. package/dist/src/traces/summarizer.d.ts.map +1 -0
  181. package/dist/src/traces/summarizer.js +247 -0
  182. package/dist/src/traces/summarizer.js.map +1 -0
  183. package/dist/src/traces/types.d.ts +365 -0
  184. package/dist/src/traces/types.d.ts.map +1 -0
  185. package/dist/src/traces/types.js +14 -0
  186. package/dist/src/traces/types.js.map +1 -0
  187. package/dist/src/types.d.ts +495 -0
  188. package/dist/src/types.d.ts.map +1 -0
  189. package/dist/src/types.js +27 -0
  190. package/dist/src/types.js.map +1 -0
  191. package/docs/agent-surface-policy.md +45 -0
  192. package/docs/memory-setup.md +226 -0
  193. package/hooks/_arch_scan_bg.py +88 -0
  194. package/hooks/_plugin_drift_check_bg.py +85 -0
  195. package/hooks/_session_start_lib.sh +42 -0
  196. package/hooks/git/pre-push +141 -0
  197. package/hooks/hooks.json +126 -0
  198. package/hooks/post-commit +30 -0
  199. package/hooks/pre-commit +29 -0
  200. package/hooks/pre-edit-apppulse.sh +6 -0
  201. package/hooks/pre-edit-architecture.sh +106 -0
  202. package/hooks/pre-edit-rally-point.sh +92 -0
  203. package/hooks/session-start-apppulse.sh +6 -0
  204. package/hooks/session-start-architecture.sh +10 -0
  205. package/hooks/session-start-git-hooks.sh +12 -0
  206. package/hooks/session-start-plugin-drift.sh +27 -0
  207. package/hooks/session-start-rally-point.sh +44 -0
  208. package/hooks/session-start-retrieval.sh +24 -0
  209. package/hooks/session-start-worktree-gc.sh +105 -0
  210. package/hooks/test_apppulse_hooks.sh +6 -0
  211. package/hooks/test_rally_point_hooks.sh +388 -0
  212. package/hooks/test_sec008_hooks.sh +66 -0
  213. package/package.json +111 -0
  214. package/scripts/README.md +301 -0
  215. package/scripts/_db_url.py +61 -0
  216. package/scripts/_paths.py +445 -0
  217. package/scripts/blm.py +162 -0
  218. package/scripts/blm_api.py +263 -0
  219. package/scripts/check_cache_sync.py +490 -0
  220. package/scripts/embed_backend.py +475 -0
  221. package/scripts/install_memory.py +556 -0
  222. package/scripts/lessons_index/__init__.py +77 -0
  223. package/scripts/lessons_index/__main__.py +135 -0
  224. package/scripts/lessons_index/ingest.py +288 -0
  225. package/scripts/lessons_index/query.py +285 -0
  226. package/scripts/lessons_index/schema.py +114 -0
  227. package/scripts/memory_context/__init__.py +610 -0
  228. package/scripts/memory_graph/__init__.py +393 -0
  229. package/scripts/project_resolver.py +172 -0
  230. package/scripts/prune_codex_plugin_cache.py +23 -0
  231. package/scripts/prune_plugin_cache.py +359 -0
  232. package/scripts/semantic_index/__init__.py +482 -0
  233. package/scripts/semantic_index/_bench_hybrid.py +175 -0
  234. package/scripts/semantic_index/backfill.py +263 -0
  235. package/scripts/semantic_index/hybrid.py +174 -0
  236. package/scripts/semantic_index/test_backfill.py +292 -0
  237. package/scripts/semantic_index/test_hybrid.py +541 -0
  238. package/scripts/sync_navgator_lessons.py +666 -0
  239. package/scripts/sync_plugin_cache.py +388 -0
  240. package/skills/agent-rally-point/SKILL.md +165 -0
  241. package/skills/agent-rally-watcher/SKILL.md +83 -0
  242. package/skills/api-registry-bridge/SKILL.md +59 -0
  243. package/skills/architecture/dead/SKILL.md +56 -0
  244. package/skills/architecture/impact/SKILL.md +88 -0
  245. package/skills/architecture/review/SKILL.md +227 -0
  246. package/skills/architecture/rules/SKILL.md +72 -0
  247. package/skills/architecture/scan/SKILL.md +79 -0
  248. package/skills/architecture/trace/SKILL.md +65 -0
  249. package/skills/attribution-standard/SKILL.md +122 -0
  250. package/skills/authentication/SKILL.md +81 -0
  251. package/skills/authentication/references/better-auth-magic-link.md +135 -0
  252. package/skills/authentication/references/better-auth-setup.md +224 -0
  253. package/skills/authentication/references/google-calendar-sync.md +278 -0
  254. package/skills/authentication/references/google-cloud-console.md +159 -0
  255. package/skills/authentication/references/google-geocoding-directions.md +126 -0
  256. package/skills/authentication/references/google-lessons-example-web-app.md +177 -0
  257. package/skills/authentication/references/google-maps.md +162 -0
  258. package/skills/authentication/references/google-oauth-setup.md +343 -0
  259. package/skills/authentication/references/google-places.md +173 -0
  260. package/skills/authentication/references/lessons-example-web-app-better-auth.md +126 -0
  261. package/skills/authentication/references/resend-email.md +227 -0
  262. package/skills/authentication/references/resend-otp-magic-link.md +153 -0
  263. package/skills/authentication/references/supabase-auth.md +172 -0
  264. package/skills/auto-decision-capture/SKILL.md +419 -0
  265. package/skills/build-loop/SKILL.md +516 -0
  266. package/skills/build-loop/detect-plugins.mjs +82 -0
  267. package/skills/build-loop/eval-guide.md +65 -0
  268. package/skills/build-loop/fallbacks.md +549 -0
  269. package/skills/build-loop/phases/fact-check.md +42 -0
  270. package/skills/build-loop/phases/ui-validation.md +267 -0
  271. package/skills/build-loop/references/apple-native-planning.md +439 -0
  272. package/skills/build-loop/references/capability-routing.md +181 -0
  273. package/skills/build-loop/references/codex-subagents.md +98 -0
  274. package/skills/build-loop/references/coordination.md +161 -0
  275. package/skills/build-loop/references/correction-aware-capture.md +177 -0
  276. package/skills/build-loop/references/independent-auditor.md +72 -0
  277. package/skills/build-loop/references/intent-capability-pack.md +170 -0
  278. package/skills/build-loop/references/intent-exploration-prompts.md +96 -0
  279. package/skills/build-loop/references/leadership.md +72 -0
  280. package/skills/build-loop/references/memory.md +284 -0
  281. package/skills/build-loop/references/modular-systems-pack.md +96 -0
  282. package/skills/build-loop/references/output-style.md +129 -0
  283. package/skills/build-loop/references/pay-it-forward-arch.md +98 -0
  284. package/skills/build-loop/references/phase-1-assess.md +218 -0
  285. package/skills/build-loop/references/phase-2-plan.md +77 -0
  286. package/skills/build-loop/references/phase-3-execute.md +47 -0
  287. package/skills/build-loop/references/phase-4-review.md +310 -0
  288. package/skills/build-loop/references/phase-5-iterate.md +71 -0
  289. package/skills/build-loop/references/phase-6-learn.md +56 -0
  290. package/skills/build-loop/references/recent-design-structures.md +274 -0
  291. package/skills/build-loop/references/refactor-history/ASSESSMENT.md +85 -0
  292. package/skills/build-loop/references/refactor-history/STANDALONE_TEST_RUN.md +149 -0
  293. package/skills/build-loop/references/refactor-history/scenarios/01-simple-bugfix.md +32 -0
  294. package/skills/build-loop/references/refactor-history/scenarios/02-ui-build-with-iteration.md +48 -0
  295. package/skills/build-loop/references/refactor-history/scenarios/03-multi-failure-escalation.md +60 -0
  296. package/skills/build-loop/references/refactor-history/scenarios/04-ui-build-ibr-absent.md +51 -0
  297. package/skills/build-loop/references/refactor-history/scenarios/05-refactor-navgator-absent.md +71 -0
  298. package/skills/build-loop/references/refactor-history/scenarios/06-recurring-bug-debugger-absent.md +52 -0
  299. package/skills/build-loop/references/refactor-history/trace-comparison.md +202 -0
  300. package/skills/build-loop/references/self-recursive-dev.md +77 -0
  301. package/skills/build-loop/references/self-review.md +232 -0
  302. package/skills/build-loop/references/ui-io-contract.md +116 -0
  303. package/skills/build-loop/scanners/audit-design-rules.mjs +476 -0
  304. package/skills/build-loop/scanners/require-visual-evidence.mjs +239 -0
  305. package/skills/build-loop/templates/backlog-item.md +35 -0
  306. package/skills/build-loop/templates/codex-worker-prompt.md +89 -0
  307. package/skills/build-loop/templates/ui-subagent-prompt.md +179 -0
  308. package/skills/build-loop/templates/ux-fix-plan.md +40 -0
  309. package/skills/building-with-deepagents/SKILL.md +195 -0
  310. package/skills/building-with-deepagents/references/anti-patterns.md +141 -0
  311. package/skills/building-with-deepagents/references/api-quick-reference.md +184 -0
  312. package/skills/capabilities/SKILL.md +91 -0
  313. package/skills/debug-loop/SKILL.md +278 -0
  314. package/skills/debug-loop/references/convergence-rules.md +145 -0
  315. package/skills/debug-loop/references/swiftui-macos-clunky-ui-debugger.html +823 -0
  316. package/skills/debugging/assess/SKILL.md +111 -0
  317. package/skills/debugging/debug-loop/SKILL.md +231 -0
  318. package/skills/debugging/memory/SKILL.md +147 -0
  319. package/skills/debugging/store/SKILL.md +153 -0
  320. package/skills/debugging-memory/SKILL.md +440 -0
  321. package/skills/debugging-memory/examples/incident-example.json +67 -0
  322. package/skills/debugging-memory/references/incident-documentation.md +280 -0
  323. package/skills/debugging-memory/references/ios-notification-alarm-playbook.md +300 -0
  324. package/skills/debugging-memory/references/pattern-extraction.md +163 -0
  325. package/skills/debugging-memory/references/subagent-integration.md +312 -0
  326. package/skills/defenseclaw-bridge/SKILL.md +156 -0
  327. package/skills/defenseclaw-bridge/references/dc-config-mapping.md +162 -0
  328. package/skills/defenseclaw-bridge/references/output-format.md +108 -0
  329. package/skills/handoff/SKILL.md +94 -0
  330. package/skills/ibr-bridge/SKILL.md +68 -0
  331. package/skills/knowledge/SKILL.md +127 -0
  332. package/skills/knowledge/references/recall-integration.md +83 -0
  333. package/skills/knowledge/templates/madr-minimal.md +56 -0
  334. package/skills/knowledge-review/SKILL.md +112 -0
  335. package/skills/logging-tracer/SKILL.md +202 -0
  336. package/skills/logging-tracer/references/log-analysis.md +128 -0
  337. package/skills/logging-tracer/references/stack-templates.md +274 -0
  338. package/skills/logging-tracer-bridge/SKILL.md +70 -0
  339. package/skills/mcp-builder/SKILL.md +278 -0
  340. package/skills/mcp-builder/references/mcp-security.md +106 -0
  341. package/skills/model-tiering/SKILL.md +216 -0
  342. package/skills/native-ax-driver/SKILL.md +220 -0
  343. package/skills/native-ax-driver/scripts/layout_fill.py +222 -0
  344. package/skills/native-ax-driver/scripts/native_driver.py +495 -0
  345. package/skills/native-ax-driver/swift/bl-ax-driver/Package.swift +20 -0
  346. package/skills/native-ax-driver/swift/bl-ax-driver/Sources/main.swift +542 -0
  347. package/skills/optimize/SKILL.md +202 -0
  348. package/skills/optimize/profiles.md +61 -0
  349. package/skills/plan-verify/SKILL.md +115 -0
  350. package/skills/plan-verify/test-fixtures/example-app-v20-findings.json +27 -0
  351. package/skills/plan-verify/test-fixtures/example-app-v20.md +42 -0
  352. package/skills/plan-verify/test-fixtures/example-app-v22-findings.json +15 -0
  353. package/skills/plan-verify/test-fixtures/example-app-v22.md +1608 -0
  354. package/skills/plan-verify/test-fixtures/unrelated-good-plan-findings.json +15 -0
  355. package/skills/plan-verify/test-fixtures/unrelated-good-plan.md +55 -0
  356. package/skills/plugin-builder/SKILL.md +329 -0
  357. package/skills/plugin-builder/references/authoritative-sources.md +104 -0
  358. package/skills/plugin-builder/references/build-loop-phase-guidance.md +94 -0
  359. package/skills/plugin-builder/references/components-guide.md +221 -0
  360. package/skills/plugin-builder/references/distribution.md +317 -0
  361. package/skills/plugin-builder/references/dual-host-claude-codex.md +220 -0
  362. package/skills/plugin-builder/references/hooks-reference.md +210 -0
  363. package/skills/plugin-builder/references/manifest-schema.md +111 -0
  364. package/skills/plugin-builder/references/plugin-hygiene-lessons.md +307 -0
  365. package/skills/plugin-tests/SKILL.md +94 -0
  366. package/skills/prd-bridge/SKILL.md +135 -0
  367. package/skills/research/SKILL.md +80 -0
  368. package/skills/security-methodology/SKILL.md +105 -0
  369. package/skills/security-methodology/references/cross-source-matrix.md +77 -0
  370. package/skills/security-methodology/references/mitre-atlas-starter.md +83 -0
  371. package/skills/security-methodology/references/nist-600-1-mapping.md +119 -0
  372. package/skills/security-methodology/references/owasp-agentic-top-10.md +157 -0
  373. package/skills/security-methodology/references/owasp-llm-top-10.md +144 -0
  374. package/skills/security-methodology/references/owasp-web-top-10.md +65 -0
  375. package/skills/self-improve/SKILL.md +298 -0
  376. package/skills/spec-writing/SKILL.md +548 -0
  377. package/skills/spec-writing/scripts/check_checklist.py +478 -0
  378. package/skills/sync-skills/SKILL.md +132 -0
  379. package/skills/telemetry/SKILL.md +66 -0
  380. package/skills/ui-design/SKILL.md +75 -0
  381. package/skills/ui-design/references/design-patterns-multi.md +165 -0
  382. package/skills/ui-design/references/design-preferences-from-owned-apps.md +150 -0
  383. package/skills/ui-design/references/evidence-capture-policy.md +55 -0
  384. package/skills/ui-design/references/ui-guidance-sources.md +330 -0
  385. package/skills/ui-design/references/universal-design-principles.alt.md +182 -0
  386. package/skills/ui-design/references/universal-design-principles.md +419 -0
  387. package/templates/memory/MEMORY.md.template +55 -0
  388. package/templates/memory/constitution.md.template +64 -0
  389. package/templates/memory/manifest.json +47 -0
@@ -0,0 +1,439 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Apple Native Planning Reference
4
+
5
+ Phase 2 (Plan) guidance for native iOS / macOS / watchOS work. Surfaces the upfront decisions that, when skipped, become Phase 5 (Iterate) emergencies.
6
+
7
+ Source: build-loop run on a sample timer app alarm-not-firing fix (2026-04-26). Generalized from the specific failure modes that bit that build.
8
+
9
+ ## When this reference fires
10
+
11
+ `state.json.platform == "apple"` and the goal touches any of:
12
+ - A timed notification, alarm, reminder, or scheduled local push
13
+ - Background session continuity (Pomodoro, fasting, sleep, meditation)
14
+ - Multi-target shared engine (iOS + watchOS, iOS + macOS)
15
+ - Audio + haptic completion routing
16
+ - Focus mode, DND, Time Sensitive, or Critical Alerts behavior
17
+ - Live Activity / Dynamic Island
18
+
19
+ If ANY apply, the planner MUST resolve every required decision below before dispatching Execute subagents.
20
+
21
+ ## Required upfront decisions
22
+
23
+ ### 1. Targets
24
+
25
+ State the exact list. Do not assume.
26
+
27
+ - iOS app
28
+ - watchOS companion (paired? standalone? complication?)
29
+ - macOS Catalyst, native macOS, or no Mac
30
+ - Live Activity / Dynamic Island widget
31
+ - Home Screen widget (iOS), watchOS widget, macOS menu bar item
32
+
33
+ For each target chosen, the planner adds: deployment target, entitlements list, INFOPLIST keys, code-signing path.
34
+
35
+ Common trap: the "shared" Swift file is included in only one target's source list (XcodeGen `project.yml`). Build error surfaces only when that target rebuilds.
36
+
37
+ ### 2. Notification strategy
38
+
39
+ Pick exactly one per use case. Mixing without intent is the root cause of "alarm doesn't fire."
40
+
41
+ | Strategy | When | Cost |
42
+ |---|---|---|
43
+ | Scheduled `UNTimeIntervalNotificationTrigger` armed at session START | Pomodoro, fasting, meditation — known duration | Need persisted `endDate`, idempotent re-arm on lifecycle events |
44
+ | Scheduled, armed at background only | Foreground-only apps where backgrounding implies "user left" | High failure rate in the source timer-app incident |
45
+ | Reactive (`willPresent` while running) | Foreground-only flows; prefers in-app modal over banner | Doesn't survive force-quit |
46
+ | `interruptionLevel = .timeSensitive` | Most timer apps | Free; user opts in via Focus settings |
47
+ | `interruptionLevel = .critical` | Genuine alarms with Apple-approved Critical Alerts entitlement | Must apply to Apple |
48
+ | BGAppRefreshTask / silent push | Server-driven reminders | Out of scope for local timers |
49
+
50
+ The planner names the strategy in the Plan output. "Scheduled at session start with idempotent re-arm on resume + cancel on pause/reset/skip/completion" is the canonical safe answer for Pomodoro-style timers.
51
+
52
+ ### 3. Background modes — what NOT to add
53
+
54
+ Do NOT add `UIBackgroundModes: [audio]` to keep a timer running. App Store rejection is near-certain unless the app is a media player, navigation app, or VOIP. Use scheduled notifications instead. State this constraint explicitly in the plan so Execute subagents don't "fix" silence by adding the mode.
55
+
56
+ ### 4. Haptic strategy
57
+
58
+ Haptics are platform-split. Each surface gets its own decision.
59
+
60
+ | Surface | API | Plays through |
61
+ |---|---|---|
62
+ | iPhone | `CHHapticEngine` (rich patterns), `UINotificationFeedbackGenerator` (simple), `UIImpactFeedbackGenerator` | Taptic Engine, bypasses ringer switch |
63
+ | Apple Watch | `WKInterfaceDevice.play(_:)` | Watch haptic motor |
64
+ | iPad | `UINotificationFeedbackGenerator` only on supported models | Limited |
65
+ | macOS | None (no haptic hardware on Mac) | n/a |
66
+
67
+ CoreHaptics requires a fallback to `UINotificationFeedbackGenerator` for older devices. Audio and haptic paths must be independent — silenced audio should still haptic.
68
+
69
+ ### 5. Audio routing
70
+
71
+ For chime / alarm sounds:
72
+
73
+ - `AVAudioSession` category `.playback` with `mixWithOthers` option to bypass the silent switch (still respects ringer volume). Set in app launch BEFORE any AVAudioPlayer creation.
74
+ - Bundled asset in `Bundle.main` with explicit `forResource:withExtension:` lookup.
75
+ - Always provide `UNNotificationSound.default` as fallback when the bundled asset can't resolve. Silent failure at delivery is the worst outcome.
76
+ - Do NOT use `AVAudioSession.Category.ambient` for alarms — it respects the silent switch.
77
+ - For notification sounds: `UNNotificationSound(named:)` looks up files in the app bundle automatically, NOT the Documents directory.
78
+
79
+ ### 6. WatchConnectivity bridge
80
+
81
+ If iOS + watchOS, pick exactly one transport per message type, with rationale.
82
+
83
+ | Transport | Use for |
84
+ |---|---|
85
+ | `sendMessage(_:replyHandler:)` | Live, foreground-to-foreground, expects reply |
86
+ | `transferUserInfo` | FIFO queue, delivers when reachable |
87
+ | `updateApplicationContext` | Latest-state-only, replaces prior pending |
88
+ | `transferFile` | Large blobs |
89
+ | `transferCurrentComplicationUserInfo` | Complication-targeted |
90
+
91
+ Pomodoro state usually wants `updateApplicationContext` (latest state wins) for the timer status, plus `sendMessage` for explicit user actions (start/pause/stop).
92
+
93
+ ### 7. Persistence for active session recovery
94
+
95
+ When the app is force-killed or crashes mid-session, recovery must work. Pick one:
96
+
97
+ - `UserDefaults` — simple state (mode, startDate, elapsed, intention). Fits Pomodoro.
98
+ - `SwiftData` / Core Data — complex relational state. Overkill for a single active session.
99
+ - File-based JSON in `Documents/` — when state is JSON-shaped and you want an audit trail.
100
+
101
+ The persisted record MUST include a wall-clock start time (not relative seconds). Recovery code computes age via `Date().timeIntervalSince(startDate)`. Add a hard cap (e.g., 90 min) past which the recovery prompt is suppressed.
102
+
103
+ ### 8. Authorization timing (notifications)
104
+
105
+ Three points to choose between:
106
+
107
+ | When | Pros | Cons |
108
+ |---|---|---|
109
+ | App launch | Simple | Apple HIG discourages; users decline unexplained prompts |
110
+ | First Start tap | Best context: user committed to a session | Need pre-permission UI sheet (HIG: explain value first) |
111
+ | First completion | Worst — first session runs unauthorized and silently fails | Don't do this |
112
+
113
+ Use the first-Start pattern with a pre-permission sheet that explains why you need it.
114
+
115
+ ## Test matrix templates
116
+
117
+ ### iPhone (15 states)
118
+
119
+ Reuse the matrix from `build-loop:debugging-memory/references/ios-notification-alarm-playbook.md`. Phase 4 (Review) Validate sub-step references this matrix. Mark every row that requires a real device as `⚠️ device-only` in the scorecard; never claim ✅ on a sim-only verification.
120
+
121
+ ### Apple Watch (11 states)
122
+
123
+ | # | Scenario | Expected |
124
+ |---|---|---|
125
+ | 1 | Foreground tick to zero | Watch haptic + sound (if not silent) |
126
+ | 2 | Wrist down, watch dimmed | Haptic delivers on wake |
127
+ | 3 | Watch app force-quit | Notification still fires (if scheduled) |
128
+ | 4 | Phone unreachable, watch standalone | Local schedule fires |
129
+ | 5 | Phone reachable, watch+phone both foreground | Single chime, no double |
130
+ | 6 | Mode switch via Watch | iPhone reflects state via WatchConnectivity |
131
+ | 7 | Pause via Watch crown | iPhone pauses, notification cancelled |
132
+ | 8 | Workout running concurrently | Watch app coexists; HRV capture ok |
133
+ | 9 | Always-on display | Tick continues, complication updates |
134
+ | 10 | Charging | Foreground completion still fires |
135
+ | 11 | watchOS Focus mode on | Banner suppressed (expected) |
136
+
137
+ ## Common Apple pitfalls
138
+
139
+ | Pitfall | Symptom | Fix |
140
+ |---|---|---|
141
+ | Time Sensitive vs Critical Alerts | "Alarm suppressed in Focus / DND" | Time Sensitive entitlement + `interruptionLevel = .timeSensitive`. Critical Alerts requires Apple approval |
142
+ | Silent switch silences alarm | "Alarm doesn't sound" on iPhone | `AVAudioSession.Category.playback` with explicit activate |
143
+ | AVAudioSession `.ambient` for alarms | Same as above | Use `.playback` |
144
+ | Single-target Swift file in multi-target project | `cannot find 'Foo' in scope` in watchOS only | Add to project.yml watchOS sources, or use `#if !os(watchOS)` |
145
+ | `UNNotificationSetting.badgeSetting` on watchOS | Compile error | `#if os(watchOS)` guard |
146
+ | `UIImpactFeedbackGenerator` on macOS | Compile error | `#if !os(macOS)` guard |
147
+ | Shared iOS/macOS SwiftUI sheet uses `.confirmationAction` for dismissal | iOS shows a top Done button, but macOS can render it in a bottom action area or detach it from scroll content | Split chrome by platform: keep iOS toolbar actions; on macOS use an in-content top header with reserved space for Done/Close and put scrollable content below it |
148
+ | Notification scheduled with stale `timeInterval` after recovery | Alarm fires immediately or never | Recompute `endDate - now`, re-arm, cancel if `<= 0` |
149
+ | Live Activity stale endDate | Lock-screen countdown jumps | Update with authoritative `endDate = phaseStartDate + totalTime + pauseAccumulatedDuration` |
150
+ | TestFlight build with new entitlement but no Apple-approved Critical Alerts | Crash on launch on TestFlight | Apply for entitlement before shipping |
151
+
152
+ ## Plan-output checklist
153
+
154
+ Phase 2 Plan output for an Apple-native goal should include, in order:
155
+
156
+ 1. **Targets**: explicit list with deployment targets
157
+ 2. **Notification strategy**: which row from §2, with rationale
158
+ 3. **Background modes added**: explicit "none" if no audio/voip; otherwise list with App Store risk note
159
+ 4. **Authorization moment**: which from §8
160
+ 5. **Audio + haptic split**: per-surface API choice
161
+ 6. **WatchConnectivity transports** (if applicable): per-message-type
162
+ 7. **Persistence layer**: one of §7
163
+ 8. **Test matrix subset**: which rows are sim-verified vs device-deferred
164
+ 9. **Diagnostic logging**: what subsystem/category, what events
165
+ 10. **Anti-pattern guard**: explicit "do NOT add UIBackgroundModes audio" if relevant
166
+ 11. **Shared SwiftUI modal chrome**: for iOS + macOS sheets, state which controls stay in iOS toolbars and which macOS controls move into persistent top content headers. Verify Done/Close remains visible when content scrolls.
167
+
168
+ ## When to escalate
169
+
170
+ If Plan can't resolve any of §1-§8 from the goal text + existing repo state, escalate to the user before Execute. These are not safe to assume; the wrong choice becomes a Phase 5 firefight.
171
+
172
+ ## watchOS modernization checklist
173
+
174
+ Captured from sample timer app build 73 (2026-04-26). Use during Phase 2 Plan when the goal touches a watchOS target — `*.appiconset` decisions, navigation refactors, or Smart Stack work. Each item is a concrete check, not a recommendation.
175
+
176
+ ### Navigation
177
+
178
+ 1. **Vertical `TabView(.verticalPage)` is the post-watchOS-10 canonical root.** Three peers max; first tab gets the large title. `NavigationStack` only inside a tab that drills down (e.g. a Customize tab opening a detail form). Crown rotates between tabs.
179
+ 2. **Anti-pattern: horizontal page-based TabView.** Apple deprecated the visual model. If the existing root uses it, refactor before any other UI work — every other change inherits the old chrome.
180
+ 3. **Anti-pattern: modal sheets stacked >1 deep.** Replace with NavigationStack push or vertical-tab swap. A watch sheet stacked on a sheet is unnavigable on a 41–49mm screen.
181
+ 4. **Tab content can resize on watchOS 10+.** Useful for a "running session" tab that should expand to full-screen during an active timer — opt in by giving the running view a larger ideal size and letting the tab grow.
182
+
183
+ ### Always-On Display (AOD)
184
+
185
+ 5. **Read `\.isLuminanceReduced` in every view that renders accent color, filled shapes, or live private data.** Do not branch on `\.scenePhase` — AOD is a luminance state, not a lifecycle state. UI continues updating at ≤1 Hz under dim.
186
+ 6. **Three required AOD adaptations:**
187
+ - Accent → `.foregroundStyle(.secondary)` (or `HierarchicalShapeStyle.secondary` when binding to a `ShapeStyle` slot).
188
+ - Filled `Capsule()`/`Circle()`/`RoundedRectangle().fill(...)` → `.stroke(...)` outline.
189
+ - Hide live biometric or private readouts (heart rate, intention text, anything wrist-down strangers shouldn't see).
190
+ 7. **Keep the running countdown legible under AOD.** It's the entire reason a user glances. Lower contrast is fine; hiding it is not.
191
+ 8. **Type system note:** ternary across heterogeneous shape styles fails — `ShapeStyle` is not a uniform existential. Wrap with `AnyShapeStyle(HierarchicalShapeStyle.secondary)` vs `AnyShapeStyle(Color.accent)` so Swift can pick a common type.
192
+
193
+ ### Liquid Glass (watchOS 26+)
194
+
195
+ 9. **Use `#available(watchOS 26.0, *)` conditional, never bump deployment target.** Bumping locks out users on watchOS 11–25, which is most of the install base for ~12 months post-release.
196
+ 10. **Wrap as a `ViewModifier`** so call sites stay terse:
197
+ ```swift
198
+ private struct GlassPrimaryStyle: ViewModifier {
199
+ func body(content: Content) -> some View {
200
+ if #available(watchOS 26.0, *) {
201
+ content.buttonStyle(.glassProminent)
202
+ } else {
203
+ content.buttonStyle(.borderedProminent)
204
+ }
205
+ }
206
+ }
207
+ ```
208
+ 11. **Only the primary action per screen gets `.glassProminent`.** Secondary actions use `.glass` (or `.bordered` on fallback). Anti-pattern: glass on every button — defeats the focal weight the material is designed to carry.
209
+ 12. **Performance:** if frame drops show on Series 6/7-class hardware under glass, fall back to `.background(.ultraThinMaterial)` (available watchOS 9+) which approximates the look without the blur cost.
210
+
211
+ ### Smart Stack + complications
212
+
213
+ 13. **Compute `var relevance: TimelineEntryRelevance?` on every `TimelineEntry`.** Smart Stack ranks by `score` (Float, 0–100). Idle/stale → 0. Running primary state → 100. Paused → 10. Secondary phase running → 60. Without `relevance`, the system assumes 0 and the complication never surfaces.
214
+ 14. **Set `duration:` to the remaining session window** (e.g. `TimeInterval(timeLeft)`). The system ages the entry out automatically when duration elapses; otherwise the stack pins a stale entry.
215
+ 15. **Live Activity auto-pickup on watchOS 26+.** If iOS already starts a Live Activity via `Activity.request(...)`, no Watch-side code needed — Smart Stack surfaces it. This is the highest-leverage Watch feature for any session-based app.
216
+ 16. **`supportedFamilies` checklist:** `accessoryCircular`, `accessoryCorner`, `accessoryInline`, `accessoryRectangular`. Skipping any reduces the watch faces a user can pin the complication to.
217
+ 17. **ClockKit migration check:** `import ClockKit` should appear nowhere. If users had a ClockKit complication pre-watchOS-9, implement `CLKComplicationWidgetMigrator` so they auto-migrate without re-pinning. Fresh apps skip this.
218
+
219
+ ### App icon
220
+
221
+ 18. **Single-size 1024×1024 PNG, sRGB, no alpha.** Xcode 14+ generates per-device sizes at build. The runtime applies the circular mask — design with the center 50%-radius circle in mind, ship a square master.
222
+ 19. **Separate watchOS catalog when the iOS catalog already has watch entries.** Keeps the modern `idiom: watch` 1024 entry isolated from the legacy iOS-bundled watch icon roles, and lets the watch art evolve independently.
223
+ 20. **Override `ASSETCATALOG_COMPILER_APPICON_NAME` per target.** When iOS uses `AppIcon` and watchOS uses `AppIcon-Watch`, the catalogs can both ship without name collision. Set the watchOS-target setting in `project.yml` (XcodeGen) or per-target build settings.
224
+ 21. **Verify post-build with `xcrun assetutil`:**
225
+ ```bash
226
+ xcrun assetutil --info path/to/SampleTimer.app/Assets.car | grep -i icon
227
+ ```
228
+ Expect to see the icon name you supplied. If not, the catalog isn't being picked up by the target.
229
+
230
+ ### Anti-patterns (Apple-explicit)
231
+
232
+ - ❌ Horizontal page-based TabView (deprecated visual)
233
+ - ❌ Modal sheets stacked >1 deep
234
+ - ❌ Tables with >5 visible rows (use `ScrollView` + `LazyVStack` or paginate)
235
+ - ❌ Two-finger gestures, long-press menus expecting precision
236
+ - ❌ Bright filled shapes during AOD
237
+ - ❌ ClockKit-only complications (won't ship on new face setups; deprecated watchOS 9)
238
+ - ❌ Group borders on watch — the screen edge is the border
239
+ - ❌ Custom haptic loops outside `WKInterfaceDevice.play(_:)` types
240
+ - ❌ Bumping `WATCHOS_DEPLOYMENT_TARGET` to gain Liquid Glass instead of `#available` conditional
241
+ - ❌ Two `AppIcon.appiconset` directories with the same name — Xcode picks one unpredictably; rename one and override `ASSETCATALOG_COMPILER_APPICON_NAME`
242
+
243
+ ### Verification matrix (should run before claiming done)
244
+
245
+ | Check | Command | Pass signal |
246
+ |------|---------|-------------|
247
+ | watchOS builds | `xcodebuild -scheme SampleTimer-watchOS build CODE_SIGNING_ALLOWED=NO` | `BUILD SUCCEEDED` |
248
+ | Widget builds | (deps from watchOS scheme) | no widget-specific errors in log |
249
+ | Icon compiled | `xcrun assetutil --info <app>/Assets.car \| grep -i icon` | watch icon name appears |
250
+ | All schemes | iterate iOS/macOS/iOSWidget/watchOS | each `BUILD SUCCEEDED` |
251
+ | Quality | `./quality-check.sh` | pass count unchanged or improved |
252
+
253
+ Real-device-only (mark ⚠️ in scorecard, never ✅):
254
+ - Liquid Glass rendering at runtime
255
+ - AOD visual under wrist-down
256
+ - Smart Stack relevance ranking on the actual stack
257
+ - Live Activity Smart Stack pickup
258
+ - Home-grid icon appearance
259
+
260
+ ---
261
+
262
+ ## Tab-vs-drill-in path discipline on watchOS
263
+
264
+ When designing watch IA, every action should have exactly one canonical path.
265
+
266
+ ### Tab vs navigation push — when to choose which
267
+
268
+ - **Tab** when the destination is a peer top-level surface that users want to reach from any state. Vertical TabView pages on watchOS feel like rooms, not screens.
269
+ - **Navigation push** when the destination is a hierarchical sub-screen of one parent (e.g. editing a single object's properties).
270
+
271
+ ### Redundancy elimination rule
272
+
273
+ If a feature is reachable as both a tab AND an in-screen drill-in, delete the drill-in. Two paths to the same place fragment muscle memory and violate Calm Precision path-discipline.
274
+
275
+ Symptom: user discovers feature A via Tab; later discovers same feature A via Push from inside Tab B; now wonders if they're different.
276
+
277
+ ### Worked example — sample timer app WatchModePicker consolidation (build 74)
278
+
279
+ Build 73 introduced a vertical TabView with a Customize tab listing all modes. The pre-existing `WatchModePicker` view (reachable from Timer idle via "Change mode" navigation push) became redundant. Consolidation steps:
280
+
281
+ 1. Confirm the drill-in's behavior is fully covered by the tab. If not, port the missing behavior first.
282
+ 2. Delete the drill-in's source file. Glob-based target sources (xcodegen `path: watchOS`) make this a one-step removal — no manifest edit needed.
283
+ 3. Remove the entry-point link from the parent screen. Replace with a small text hint ("swipe up for modes") so the affordance stays discoverable without a competing nav path.
284
+ 4. Grep for zero references in `*.swift`, `*.yml`, `*.pbxproj`.
285
+
286
+ ### Tap directness on list items
287
+
288
+ A tap on a list item that has only one logical follow-action should auto-flow into that action. Don't force tap → tap-edit-button.
289
+
290
+ - Preset row: single tap = select + return to invoking surface (set tab selection state).
291
+ - Configurable row (e.g. "Custom"): single tap = push the editor directly. Set the selection state in `simultaneousGesture` so when the user finishes editing and pops, the upstream surface already reflects the choice.
292
+
293
+ The intermediate "select, then tap an Edit button to configure" flow is two-tap UX where one will do.
294
+
295
+ ## Visual delta audit pattern
296
+
297
+ For native iOS/macOS modernization passes scoped from a prior audit, run a three-pass workflow before opening any file:
298
+
299
+ 1. **Source-code extraction** is load-bearing. The audit must cite `file:line` for every delta with a concrete suggested replacement. Vague reports ("inconsistent typography") force re-extraction during execute and double the cost. The audit doc becomes the spec.
300
+ 2. **Canonical reference identification**. Name 2–3 modern reference views in the same repo (e.g. `AlertSettingsView`, `SettingsView`, `ProfileSettingsView`) so the audit's "good" target is in-tree, not abstract HIG.
301
+ 3. **Structured delta report**. Group by category (color hardcodes / Dynamic Type / spacing / card pattern / interaction / chart hex), count, and rank by user-impact severity.
302
+
303
+ ### Native visual evidence
304
+
305
+ Use built-in simulator screenshots and native AX evidence for visual regression after a redesign that changes layout. Those tools do not extract computed SwiftUI font/color/spacing values, so source-code extraction remains load-bearing for metric audits. Use grep + Read for typography, color, spacing, and token claims. IBR native scans are explicit-only auxiliary evidence when the user asks for IBR.
306
+
307
+ ### Three-tier ROI ordering
308
+
309
+ Sequence fixes by descending impact:
310
+
311
+ 1. **Colors + dark-mode safety** (highest ROI). Replacing `.foregroundColor(.white.opacity(N))` with `.foregroundStyle(.primary/.secondary/.tertiary)` simultaneously fixes dark-mode adaptation, WCAG contrast, and future-proofs against light-mode variants. Small line count, broad effect.
312
+ 2. **Typography Dynamic Type**. Replacing `.font(.system(size: N))` with `.font(.caption / .footnote / .subheadline / .body / .headline / .title3)` enables accessibility text-size scaling. Keep hero anchors (28pt+ ultraLight KPIs) fixed and add `// Hero anchor: intentional fixed size` comments so future audits don't re-flag them.
313
+ 3. **Tokens + spacing rhythm**. Hex literals → named Theme tokens; off-grid `padding(.vertical, 6/10/14)` → `Spacing.sm/md/lg`. Lowest individual impact, cumulative polish.
314
+
315
+ ### WCAG body-text math for `.white.opacity(N)`
316
+
317
+ Against the LiquidGradientBackground core `#3A4878` (focus mode steel-blue) — a representative dark gradient core — alpha-composited approximations:
318
+
319
+ | Foreground | Approx contrast vs `#3A4878` | WCAG 4.5:1 (body) |
320
+ |---|---|---|
321
+ | `.white.opacity(0.9)` | ~10.6:1 | ✅ pass |
322
+ | `.white.opacity(0.7)` | ~5.7:1 | ✅ pass |
323
+ | `.white.opacity(0.5)` | ~3.8:1 | ⚠️ fails |
324
+ | `.white.opacity(0.35)` | ~2.4:1 | ❌ fails |
325
+ | `.white.opacity(0.3)` | ~2.1:1 | ❌ fails |
326
+
327
+ Anything at or below 0.5 on a dark gradient fails AA body. `.foregroundStyle(.secondary)` resolves to a SwiftUI-managed semantic color that is guaranteed ≥4.5:1 against the backing material in both light and dark color schemes — switch to it instead of tuning opacity by eye.
328
+
329
+ ---
330
+
331
+ ## WatchConnectivity callback wiring — avoiding dead-signal bugs
332
+
333
+ **Pattern.** When watch sends a signal via `WCSession.sendMessage(_:)`, iPhone's delegate `WCSessionDelegate.session(_:didReceiveMessage:)` decodes the payload and exposes a closure-based published callback on the connectivity manager:
334
+
335
+ ```swift
336
+ var onBiometricBreakSignalReceived: ((BiometricBreakSignal) -> Void)?
337
+ ```
338
+
339
+ A closure variable like this is useless unless something on the iPhone side assigns into it during app launch. The compiler will not catch a missing assignment because optional closures default to `nil` and silently no-op.
340
+
341
+ **Audit checkpoint.** For every published callback variable on a connectivity manager, grep for at least one assignment site somewhere in iOS code:
342
+
343
+ ```bash
344
+ grep -rn "onMyCallback = " iOS/ Shared/
345
+ ```
346
+
347
+ If grep returns zero hits, the entire feature path is dead — watch detection runs, the message arrives, and nothing happens on iPhone.
348
+
349
+ **Sample timer app example.** `onBiometricBreakSignalReceived` was declared in build 73 but inspection during build 78 found two related symptoms:
350
+ 1. Build 73 wired the closure to `TimerEngine.handleBiometricBreakSignal`, which surfaces an in-app `CheckInData` sheet — but only when the iPhone app is foreground AND a flow session is running ≥15 minutes. In every other state (app backgrounded, no active session, app closed), the signal was effectively dropped.
351
+ 2. Build 78 added a second path on the same closure: an opt-in time-sensitive `UNUserNotification` so the signal produces user-visible behavior even when the iPhone app is not in front. Default off; toggle in `AlertSettingsView`.
352
+
353
+ **Recommended patterns.**
354
+ - Prefer `NotificationCenter` for fan-out when more than one subscriber may need the signal — avoids closure-stomping where a later assignment overwrites an earlier one.
355
+ - Or use Combine `PassthroughSubject<Signal, Never>` for typed reactive flow with multi-subscriber semantics.
356
+ - Or make callback assignment a constructor parameter (`init(onSignal: @escaping (Signal) -> Void)`) so the compiler enforces wiring at instantiation.
357
+ - For closure-variable APIs that intentionally allow only one subscriber, add a unit test that calls `connectivityManager.simulateMessage(...)` and asserts a side effect — this catches dead-signal regressions before TestFlight.
358
+
359
+ **Coexisting paths.** When extending an existing closure with a second path (e.g. notification + in-app sheet), put both under the same closure body and gate each independently. Don't reassign the closure — the previous path will be silently lost.
360
+
361
+
362
+ ## Test target wiring on XcodeGen Apple projects
363
+
364
+ A test target that exists in `project.yml` is only invokable by `xcodebuild test` if it is also a member of a scheme's `test.targets` array. Membership in `targets:` alone makes the bundle compile-clean but unreachable from the test action.
365
+
366
+ **Symptom.** `xcodebuild test -scheme SampleTimer-iOS -only-testing:SampleTimer-UnitTests` returns:
367
+
368
+ ```
369
+ Cannot test target "SampleTimer-UnitTests"... isn't a member of the specified test plan or scheme
370
+ ```
371
+
372
+ **Fix.** In `project.yml`, the scheme's `test.targets` array must include the test bundle by name:
373
+
374
+ ```yaml
375
+ schemes:
376
+ SampleTimer-iOS:
377
+ test:
378
+ config: Debug
379
+ targets:
380
+ - SampleTimer-UnitTests
381
+ - SampleTimer-UITests
382
+ ```
383
+
384
+ Then regenerate (`xcodegen generate --spec project.yml`).
385
+
386
+ **Platform alignment is part of the wiring.** The test target's `platform:` must match the scheme's runnable destinations. A `bundle.unit-test` declared `platform: macOS` cannot be run from an `SampleTimer-iOS` scheme via `-destination 'platform=iOS Simulator'` — xcodebuild surfaces:
387
+
388
+ ```
389
+ Cannot test target "SampleTimer-UnitTests" on "iPhone 17 Pro": ... does not support iphonesimulator
390
+ ```
391
+
392
+ If the wiring goal is "iOS scheme runs the unit tests on iPhone simulator," the test target itself must be `platform: iOS` (and any source files it pulls from `Shared/` need to compile cleanly for iOS — which is usually free since the iOS app target already compiles them). When you switch a previously-macOS test target to iOS, audit every scheme that referenced it: the macOS scheme's `test.targets` will silently break unless updated to drop the now-iOS test target or replaced with a separate macOS-platform test bundle.
393
+
394
+ **Audit checkpoint.** Before TestFlight, run a quick grep over `project.yml` to catch test targets not wired anywhere:
395
+
396
+ ```bash
397
+ # every test target name should appear in at least one scheme's test action
398
+ yq '.targets | to_entries | map(select(.value.type | test("bundle"))) | .[].key' project.yml
399
+ yq '.schemes | to_entries | map(.value.test.targets // []) | flatten' project.yml
400
+ ```
401
+
402
+ If a target name appears in the first list but not the second, the test bundle exists but no scheme can run it.
403
+
404
+ **Sample timer app example (build 79).** `SampleTimer-UnitTests` had been a `bundle.unit-test` on `platform: macOS`, wired into the macOS scheme's `test.targets` only. Builds 71-78 shipped without exercising any of the new code paths in CI. Build 79 added five test files covering AlertConfig codable, pomodoro notification identifier generation, Local Network permission classification, keychain-cache stability, and biometric break-signal default-off wiring. The test target was migrated to `platform: iOS`, added to `SampleTimer-iOS.schemes.test.targets`, and removed from the macOS scheme (which can no longer host an iOS-platform bundle). Net: `xcodebuild test -scheme SampleTimer-iOS -destination 'platform=iOS Simulator,name=iPhone 17 Pro' -only-testing:SampleTimer-UnitTests` runs 51 tests in ~7 seconds.
405
+
406
+ **When test isolation must round-trip through `UserDefaults.standard`.** A common pattern in app-level singletons: `init(defaults: UserDefaults = .standard)` reads from injected defaults, but property `didSet` writes target `UserDefaults.standard` unconditionally. Tests that assert "value persists across two store instances" cannot rely on injected defaults for the write path — they have to either snapshot/restore `.standard` in `setUp`/`tearDown`, or refactor production to plumb the same defaults through both read and write. For a test-only access change this is heavier than a simple `private → internal` flip; document the constraint in the test file rather than push a deeper production change.
407
+
408
+ ## SourceKit ghost diagnostics on Xcode 26.x
409
+
410
+ Discovered: Example-iOS-App Run A + Run A.1 (2026-05-20). Generalized so every Apple-platform build-loop run starts inoculated.
411
+
412
+ ### Pattern
413
+
414
+ On Xcode 26.x XcodeGen projects, editing `.swift` files and running `xcodegen generate` produces false-positive `<new-diagnostics>` SourceKit errors of the form `Cannot find type 'X' in scope` for types defined in sibling files within the same module. The diagnostics arrive AFTER `xcodebuild` ships `** BUILD SUCCEEDED **`. They are stale index output, not real errors. Upstream tracking: [anthropics/claude-code#46651](https://github.com/anthropics/claude-code/issues/46651).
415
+
416
+ ### Two distinct causes, same symptom
417
+
418
+ 1. **New file not registered in `.pbxproj`** — file exists on disk, `xcodegen generate` not yet run. Both SourceKit and `xcodebuild` fail. Fix by running `xcodegen generate`.
419
+ 2. **Xcode 26.x SourceKit cross-file index lag** — `xcodegen generate` has run, `xcodebuild` succeeds, SourceKit's index is 5–30s behind. Fix is wait or ⌘⇧K in Xcode; do not edit code.
420
+
421
+ Cause 1 is a real problem with a real fix. Cause 2 is a harness/IDE bug; touching code makes things worse.
422
+
423
+ ### What the orchestrator must do
424
+
425
+ When `state.json.platform == "apple"` and the goal touches existing `.swift` files, the Phase 2 plan output must include this preamble before any Execute dispatch:
426
+
427
+ > SourceKit `<new-diagnostics>` arriving within ~30s of `xcodegen generate` are presumed stale until `xcodebuild` disagrees. Do not panic-edit a file because the diagnostic stream cannot find a type that grep can.
428
+
429
+ The same preamble belongs in subagent prompts that touch Swift files, per `feedback_subagent_skill_reactivity` (knowledge in CLAUDE.md alone doesn't reach subagents).
430
+
431
+ ### When to actually act
432
+
433
+ A SourceKit "Cannot find type" diagnostic is real (not a ghost) when ANY apply:
434
+ - `xcodebuild` produces the same error
435
+ - The named type does not exist anywhere in the module (`grep -rn "<type>" --include="*.swift"` returns nothing)
436
+ - The named type is defined in a different module that is not imported
437
+ - The file was just created and `xcodegen generate` has not been run
438
+
439
+ Otherwise it's a ghost and the fix is patience.
@@ -0,0 +1,181 @@
1
+ <!-- SPDX-FileCopyrightText: 2025-2026 Tyrone Ross, Jr <46267523+tyroneross@users.noreply.github.com> | SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Capability Routing (full protocol)
4
+
5
+ > Loaded from `skills/build-loop/SKILL.md` summary. Contains the full capability routing table, trigger conditions, and plugin/hook/skill/agent mandatory routing rules.
6
+
7
+ ## Capability Routing
8
+
9
+ Build-loop prefers repo-owned agents and bundled skills for core loop decisions. External plugins are accelerators only when explicitly requested or when a row below names them as secondary. Each capability has three tiers: **preferred** (build-loop-owned surface) → **secondary** (another installed plugin or skill that can partially cover) → **inline fallback** (guidance text from `fallbacks.md`, injected verbatim into subagent prompts).
10
+
11
+ Phase 1 runs `node ${CLAUDE_PLUGIN_ROOT}/skills/build-loop/detect-plugins.mjs` and writes the result to `.build-loop/state.json` under `availablePlugins`. All routing consults that object.
12
+
13
+ ### Core loop skills/assets (always check)
14
+
15
+ | Skill | Used In | Fallback |
16
+ |-------|---------|----------|
17
+ | `writing-plans` | Phase 2 (Plan) | Write a structured plan directly: goal, tasks with exact file paths, dependency order, test commands |
18
+ | `subagent-driven-development` | Phase 3 (Execute) | Dispatch parallel agents manually using the host's available delegation tool for independent file groups |
19
+ | `verification-before-completion` | Phase 4 sub-step G (Report) | Run all test/build/lint commands and confirm output before claiming completion |
20
+ | `simplify` (slash: `/simplify`) | Phase 4 sub-step E (Simplify) | Self-review the diff: remove scaffolding, inline single-use helpers, delete dead branches |
21
+ | `complexity_detector.py` (accelerator, not a gate) | Phase 4 sub-step E (Simplify) | Diff-scoped stdlib-AST hotspot detector for changed Python; surfaces high-severity hotspots for a simpler rewrite, apply-vs-advise via existing Review-B + independent-auditor. Optional Python aid — the default Simplify pass reasons over the diff language-agnostically (see `phase-4-review.md` §"Sub-step E: Simplify") |
22
+ | `build-loop:self-improve` | Phase 6 (Learn) | Scan recent runs for recurring patterns, auto-draft experimental skills/agents with A/B tracking, notify user for keep/remove decisions |
23
+ | Intent capability pack | Phases 1-4 | Read `references/intent-capability-pack.md`; write `.build-loop/intent.md`; pass the intent packet to every subagent |
24
+ | Modular systems pack | Phases 1-4 | Read `references/modular-systems-pack.md`; partition files/tasks MECE; prefer modular scalable boundaries unless an exception is documented |
25
+ | Codex subagent adapter | Phase 3 (Execute, Codex only) | Read `references/codex-subagents.md`; use `templates/codex-worker-prompt.md` for authorized Codex workers |
26
+
27
+ ### Phase quick reference
28
+
29
+ | # | Phase | Purpose | Sub-steps / key actions |
30
+ |---|---|---|---|
31
+ | 1 | **Assess** | Understand state + define goal & criteria | detect tools, map architecture, load memory, write `intent.md` + `goal.md` |
32
+ | 2 | **Plan** | Break work, identify parallel-safe, optimize | writing-plans skill → dependency graph |
33
+ | 3 | **Execute** | Build per plan | parallel subagents, Sonnet default, Opus escalation |
34
+ | 4 | **Review** | Critic → Validate → Optimize (opt-in) → Fact-Check → Simplify → Auto-Resolve → Report | sub-steps A-G; B-D can route to Iterate; F drains non-destructive items via autonomy_gate; G runs only on final pass |
35
+ | 5 | **Iterate** | Fix Review failures, loop back to Review | max 5x; orchestrator stuck-iteration cascade (evidence-gap repair → memory re-check → parallel assess at 2 fails → causal-tree at 3 fails) |
36
+ | 6 | **Learn** | Cross-build pattern detection + experimental skill drafting | optional; requires `runs[] >= 3`; auto-promote opt-in |
37
+
38
+ ### Capability routing table
39
+
40
+ | Capability | Preferred | Secondary | Inline fallback section |
41
+ |---|---|---|---|
42
+ | Web UI build | `build-loop:ui-design` + `build-loop:design-contract-specialist` (`trigger_point: phase2-design-direction`) + `calm-precision` + `templates/ui-subagent-prompt.md` | `frontend-design:frontend-design` only when explicitly requested | `fallbacks.md#web-ui` |
43
+ | Web UI validation | `ui-validator` agent + `audit-design-rules.mjs` + browser/screenshot artifact | `showcase:capture` for visual evidence | `fallbacks.md#web-ui` |
44
+ | Orchestrated UI build | `build-loop:ui-design` → build-loop-owned design direction → implementer fan-out → ui-validator/design-contract reconciliation | explicit user-invoked design tool artifacts passed to `design-contract-specialist` | `fallbacks.md#web-ui` |
45
+ | Mobile UI build (`uiTarget: "mobile"` — iOS/watchOS sim) | `build-loop:ui-design` + `build-loop:design-contract-specialist` + `calm-precision` + `apple-dev` | — | `fallbacks.md#mobile-ui` + `fallbacks.md#apple-dev` |
46
+ | Mobile UI validation (iOS sim) | `xcrun simctl io booted screenshot` for static; `idb ui tap` for interaction | `showcase:capture` | `fallbacks.md#mobile-ui` |
47
+ | macOS desktop UI build (`uiTarget: "macos"`) | `build-loop:ui-design` + `build-loop:design-contract-specialist` + `calm-precision` + `apple-dev` | — | `fallbacks.md#mobile-ui` + `fallbacks.md#apple-dev` |
48
+ | macOS desktop UI validation | IBR `scan_macos` when `availablePlugins.ibr == true`; else `native-ax-driver` against the running `.app` (pid-anchored). NEVER `xcrun simctl` (no macOS simulator). NEVER `nm`/`strings` as substitute. | `showcase:capture` for screenshot evidence | `fallbacks.md#mobile-ui` |
49
+ | Design system tokens | `design-contract-specialist` reads project token/theme/component files and records the source in `.build-loop/app-contract/ui.md` | — | `fallbacks.md#design-tokens` (reads consumer project's token files — never hardcodes) |
50
+ | Recent design structures | `design-contract-specialist` reads `references/recent-design-structures.md` and selects by product/workflow/data fit | explicit design-tool artifacts passed as evidence | `fallbacks.md#web-ui` |
51
+ | Screenshot / visual evidence | `showcase:capture`, `showcase:record` | `screenshot` MCP tool | `fallbacks.md#screenshot` |
52
+ | Web content fetching (low LLM) | `scraper-app:web-scraper` SDK | — | `fallbacks.md#web-fetch` (flags LLM cost in report) |
53
+ | Deep debugging | `build-loop:debug-loop` + `build-loop:debugging-memory` native search/store | standalone Coding Debugger only when explicitly installed for cross-project memory | `fallbacks.md#debug` |
54
+ | Bug-pattern memory | `build-loop:debugging-memory` | — | `fallbacks.md#bug-memory` (greps `.build-loop/issues/` + `.bookmark/`) |
55
+ | Agent authoring | `agent-builder:agent-builder-anthropic` | `plugin-dev:agent-development` (if plugin work) | `fallbacks.md#agent-authoring` |
56
+ | DeepAgents / local-LLM agent work | `build-loop:building-with-deepagents` (SubAgent API, middleware stack, per-agent tool scoping, anti-patterns) | — | Read installed `deepagents` source: `python3 -c 'import deepagents, os; print(os.path.dirname(deepagents.__file__))'` then `graph.py` + `middleware/subagents.py` |
57
+ | Structured reports / handoffs | `pyramid-principle:pyramid-short-form` (Review-F reports), `pyramid-long-form` (design docs) | — | `fallbacks.md#structured-writing` (SCQA + MECE skeleton) |
58
+ | Hosted-IDE migration (Replit / Lovable / Bolt / v0) | `replit-migrate:migration-scan`, `migrate-web`, `migrate-ios`; MCP tools `migrate_scan`, `migrate_plan_web`, `migrate_plan_native`, `migrate_map_apis`, `migrate_map_models`, `migrate_check_progress` | — | `fallbacks.md#migration` (manual inventory + stack-translation) |
59
+ | Prompt authoring / review / audit (system prompts, agent prompts, eval judges) | `prompt-builder:prompt-builder` skill; slash commands `/prompt-builder:optimize`, `/score`, `/compare`, `/save`, `/list`. Calibrates to model tier (T1/T2/T3) and deployment (interactive, backend, rag_pipeline, agent, plugin, eval_judge, personal_mobile). Returns 6-Part-Stack prompt + 5-dim score + diagnosis + `[ASSUMED:]` tags + `TEMPERATURE_HINT` | `prompt-builder` (personal skill, same name, loaded via Skill tool) | `fallbacks.md#prompt` |
60
+ | iOS / watchOS / macOS dev + deploy | `apple-dev` personal skill (via `Skill("apple-dev")`) | `replit-migrate:migrate-ios` (when migrating *to* native) | `fallbacks.md#apple-dev` |
61
+ | Web deploy verification (Vercel) | Vercel MCP (`mcp.vercel.com` remote OAuth, only if user adds it to `.mcp.json`) | Vercel CLI via `scripts/verify_deploy.py` | `fallbacks.md#web-deploy-verify` |
62
+ | Strategic frame / PRD grounding (Assess + Review) | `build-loop:prd-bridge` — reads `docs/prd-*.md` frontmatter (`core_principles`, `load_when`) + Navigation Map + Section Index in Phase 1; verifies diff doesn't violate principles in Phase 5 Fact-Check; recommends `prd-builder` skill if no PRD exists. Falls back to grep on principle keywords if frontmatter parser unavailable. | `prd-builder` skill direct invocation | Phase 1 captures north-star + intent fresh into `intent.md` (existing fallback) |
63
+ | Architecture scan / impact trace (Assess + Review) | `build-loop:architecture-scan` (Assess refresh), `build-loop:architecture-impact` (blast-radius), `build-loop:architecture-rules` (Review violation check), `build-loop:architecture-dead` (orphan scan) — read `.navgator/architecture/` JSON; native skills sourced from NavGator with provenance and drift-detection via `build-loop:sync-skills` | `gator:*` commands if installed | Read component → edit → re-read downstream |
64
+ | Debugger memory-first gate (Review + Iterate) | `build-loop:debugging-memory` — verdict gate (`KNOWN_FIX` / `LIKELY_MATCH` / `WEAK_SIGNAL` / `NO_MATCH`) with strict direct-apply triple-gate (file + version + secondary signal) and Review-F outcome feedback. Orchestrator owns the when-to-fire policy (Review-B + every Iterate attempt) and routes to this skill. | `build-loop:debug-loop` direct (when memory says enter the loop or 3 same-criterion failures) | `fallbacks.md#debug` |
65
+ | Runtime visibility / observability (Assess + reactive Review/Iterate) | `build-loop:logging-tracer` — generates stack-appropriate structured logging / OTel with ephemeral-by-default policy (Mechanism A: `DEBUG_TRACE=1` runtime gate; Mechanism B: `git-stash` throwaway). Invoked reactively when an Iterate attempt flags `evidence_gap: true`. Orchestrator runs the passive Assess scan inline (no skill call needed) and only loads this skill when instrumentation is actually being added. | — | `fallbacks.md#logging-fallback` (inline Tier-1 zero-dep JSON logger per stack) |
66
+ | Self-improvement / recurring pattern detection (Phase 6 Learn) | `build-loop:self-improve` — runs after every build; detects recurring failures and manual interventions; drafts experimental skills/agents to `.build-loop/skills/experimental/`. Auto-promote to `.build-loop/skills/active/` requires opt-in (`autoPromote: true`) plus effective non-confounded sample ≥ 8; regressions and inconclusive results write proposals to `.build-loop/proposals/` for user confirmation — never auto-remove. Cross-project promotion via `/build-loop:promote-experiment <name>` | — | Manual review of `.build-loop/state.json.runs[]` |
67
+ | Context recovery after compaction | `bookmark:*` commands | — | Re-read last plan file in `.build-loop/` |
68
+ | Claude Code plugin authoring / review | `plugin-builder` (personal skill), `plugin-dev:*` family | `build-loop:plugin-hygiene-lessons.md` enforces manifest/hook/marketplace rules in Review-D | Read `plugin-hygiene-lessons.md` verbatim |
69
+
70
+ ### Sub-routers (set during Phase 1)
71
+
72
+ **UI target**: prefer the most specific match — order matters.
73
+
74
+ 1. **macOS desktop (`uiTarget: "macos"`, `platform: "apple"`)** — `*.xcodeproj` or `Package.swift` is present AND any of: (a) project has NO `ios/` directory AND has `Sources/` / `App/` with `*.swift`; (b) Xcode project's `SUPPORTED_PLATFORMS` / deployment target indicates macOS; (c) repo grep shows `import AppKit` or `import SwiftUI` paired with `WindowGroup`/`Window` (macOS scene types) and no `UIKit` import. macOS has no simulator; validation routes to `native-ax-driver` or IBR `scan_macos`, never to `xcrun simctl`.
75
+ 2. **iOS/watchOS mobile (`uiTarget: "mobile"`, `platform: "apple"`)** — `ios/` directory present, OR `*.xcodeproj`/`Package.swift` with `UIKit` import / `iOS` deployment target. Validation uses the iOS simulator screenshot path.
76
+ 3. **React Native mobile (`uiTarget: "mobile"`, `platform: "react-native"`)** — `app.json` (Expo) or `App.tsx` with `react-native` import.
77
+ 4. **Web (`uiTarget: "web"`, `platform: "web"`)** — fallback for everything else with a UI surface.
78
+
79
+ Tie-breaker: if signals are mixed (an Apple project with both `ios/` and a macOS target), set `uiTarget: "mobile"` and surface a one-line note in Assess; the build can override via `state.json.uiTarget` if the goal targets the macOS surface.
80
+
81
+ **Migration source**: if `.replit` / `replit.nix` present → `migrationSource: "replit"`. Lovable / Bolt / v0 export markers (e.g. `lovable.config`, `bolt.config`, `v0.dev` in comments) → corresponding source. `replit-migrate` skills generalize — load `migration-scan` for any of the above, override hints as needed.
82
+
83
+ **Apple deploy**: when `platform: "apple"` AND goal includes "deploy", "TestFlight", or "App Store" → Phase 7/8 invoke `apple-dev` deploy flow using ASC creds per `~/.claude/projects/-Users-tyroneross/memory/reference_asc_credentials.md`. Apply deployment policy first: TestFlight/App Store Connect upload/export defaults to `auto`; App Store production release/submission defaults to `confirm`.
84
+
85
+ **Web deploy verify**: fires when `.vercel/project.json` or `vercel.json` is present AND the build performed a push/deploy → Phase 4 Review-B invokes `scripts/verify_deploy.py` (preferred-tier upgrade: Vercel MCP only if the user has added it to `.mcp.json`). Infra failures return `skipped`, never block the build.
86
+
87
+ ## Trigger Conditions
88
+
89
+ Some capabilities should fire proactively based on goal phrasing or files touched. Phase 1 ASSESS sets these flags in `.build-loop/state.json.triggers`, and Phase 4 EXECUTE consults them before dispatching each subagent.
90
+
91
+ **pyramid-principle** (structured writing)
92
+
93
+ Fires whenever the build produces user-visible prose or professional writing. Even small text should follow pyramid structure, and the logical ordering principle applies to design flow too.
94
+
95
+ Trigger if any of:
96
+
97
+ - Task touches user-visible text inside the app: copy, microcopy, empty-state messages, error messages, onboarding flow, help content, tooltips, toasts, form labels, email templates, notification text.
98
+ - Task creates or edits: `README.md`, `CHANGELOG.md`, `docs/**/*.md`, PR descriptions, release notes, design docs, status updates, exec summaries, handoff documents.
99
+ - Goal contains: "write", "draft", "summarize", "document", "one-pager", "brief", "memo", "deck", "slides", "presentation", "status update".
100
+ - Designing information architecture or section ordering: use the pyramid logic for top-down flow (governing thought, then MECE key lines, then support).
101
+
102
+ Action: load `pyramid-principle:pyramid-principle-core` first for ground rules, then the specific skill matching length and format. If absent, use `fallbacks.md#structured-writing`.
103
+
104
+ **prompt-builder** (prompt authoring or audit)
105
+
106
+ Fires when prompts are a core part of the product, not when prompts appear incidentally in code comments or test fixtures.
107
+
108
+ Trigger if any of:
109
+
110
+ - Building or editing prompts that the app sends to an LLM at runtime: document-generation prompts (Example App style), chat-with-user system prompts, voice-interaction prompts (example app style), reranker prompts, eval-judge prompts.
111
+ - Robust agent or prompt pipeline present in the product: multi-step prompts, RAG, tool-use flows.
112
+ - Semantic search over user queries: use `prompt-builder` to revise the query before embedding or retrieval.
113
+ - Authoring a new agent's instructions (the body of an `agents/*.md` file serving as LLM guidance).
114
+ - File signals: `prompts/`, `system-prompt.*`, strings passed to `messages[{role:"system"}]`, `anthropic.messages.create`, `openai.chat.completions.create`, prompt templates in `.prompt` or `.txt` held as product assets.
115
+ - Goal contains: "system prompt", "agent prompt", "prompt engineering", "rewrite this prompt", "improve this prompt", "audit prompts", "eval judge".
116
+
117
+ Existing prompt guardrail: if the task touches an **existing** in-product prompt (not a new one), pause and ask the user before running `prompt-builder`. Prompts are often tuned against real evals; silent rewrites can regress quality. Offer the option, do not auto-apply.
118
+
119
+ Action: load `prompt-builder:prompt-builder` (plugin) if installed, else the personal `prompt-builder` skill, else `fallbacks.md#prompt`. For existing-prompt edits, capture before-and-after in `.build-loop/prompts/` with version suffixes so regressions are detectable.
120
+
121
+ **building-with-deepagents** (DeepAgents / local-LLM agent work)
122
+
123
+ Fires whenever the project uses the open-source `deepagents` package. DeepAgents has subtle API shape (SubAgent dict, middleware stack, per-agent tool scoping) that makes hand-rolled focus modes and flat-tool-list designs silently wrong — small local models exhibit tool-call hallucinations in ways that scoping fixes and prompt injection doesn't.
124
+
125
+ Trigger if any of:
126
+
127
+ - Repo grep: `from deepagents` or `import deepagents` in any Python source file
128
+ - `deepagents` in `pyproject.toml`, `requirements*.txt`, `uv.lock`, or `poetry.lock`
129
+ - Goal mentions: "agent", "sub-agent", "subagent", "planner/researcher/writer", "focus mode", "tool-call hallucination", "LangGraph agent", "ChatOllama", "local LLM agent"
130
+ - File signals: `create_deep_agent`, `SubAgent`, `AGENT_ROLES`, `agent_focus_prompt`
131
+ - Pain symptoms in the conversation: "`<namespace>.<tool>` is not a valid tool", "silent thinking", "model loaded forever", "threads vanish on restart"
132
+
133
+ Existing-agent guardrail: treat agent definitions like existing prompts — pause before rewriting, capture before-and-after in `.build-loop/agents/` with version suffixes. Tool scoping changes downstream behavior for every query; regressions are expensive to spot.
134
+
135
+ Action: load `build-loop:building-with-deepagents` before any code edit involving agent construction, tool binding, or streaming. The skill's `references/anti-patterns.md` lists 12 concrete bugs we've hit — verify none of your planned changes reintroduce them.
136
+
137
+ **Judgment: prompt-builder vs inline prompt**
138
+
139
+ Not every prompt needs the full engine. Use `prompt-builder` when the prompt is load-bearing. Craft a simple inline prompt when it is throwaway.
140
+
141
+ Use `prompt-builder` when any of these are true:
142
+
143
+ - The prompt ships in the product and runs at scale.
144
+ - The prompt is sent to end users or generates user-visible output.
145
+ - The prompt is part of an agent, eval judge, RAG pipeline, or semantic-search query rewriter.
146
+ - Output correctness is measured (evals exist or are planned).
147
+ - The prompt will be reused across features, or maintained over time.
148
+ - Token cost matters because it runs millions of times.
149
+
150
+ Roll your own inline prompt when all of these are true:
151
+
152
+ - One-shot usage inside the current build loop (dispatching a subagent, asking Claude to transform a file, generating a migration script).
153
+ - Not persisted to the product codebase.
154
+ - Output is checked once by the orchestrator, not by an eval.
155
+ - A short direct instruction is clearer than a 6-Part Stack.
156
+
157
+ Default when uncertain: if the prompt text will exist in the repo after the build, use `prompt-builder`. If it only exists as a line in an orchestrator message during this build, inline is fine.
158
+
159
+ ### Plugin / hook / skill / agent work — mandatory
160
+
161
+ If Phase 1 detects that the task touches plugin components, Phase 3 must map each task to the authoritative skill below and Phase 4 must load that skill. **Do not infer plugin formats from memory or by reading another plugin's config.**
162
+
163
+ | Task surface | Skill (authoritative) | Fallback |
164
+ |---|---|---|
165
+ | `.claude-plugin/plugin.json` | `plugin-dev:plugin-structure` | Read `RossLabs-AI-Toolkit/LESSONS-LEARNED.md` — paths must start with `./` |
166
+ | `hooks/hooks.json` or hook scripts | `plugin-dev:hook-development` + run `plugin-dev/scripts/hook-linter.sh` | Command hooks default; Stop stdout must be valid JSON; advisory/non-blocking unless an explicit safety/security/integrity gate opts into blocking; NO prompt hooks on PostToolUse/Stop/SessionStart |
167
+ | Slash commands (`commands/*.md`) | `plugin-dev:command-development` | — |
168
+ | Subagents (`agents/*.md`) | `plugin-dev:agent-development` + `RossLabs-AI-Toolkit/agents/` | `fallbacks.md#agent-authoring` |
169
+ | MCP servers (`.mcp.json`) | `plugin-dev:mcp-integration` | `.mcp.json` must NOT wrap with `mcpServers` key (Method 1) |
170
+ | `~/.claude/settings.json` | `plugin-dev:plugin-settings` | — |
171
+ | New skill (SKILL.md) | `plugin-dev:skill-development` + `skill-builder` (personal) | Official skill format; SKILL.md ≤200 lines |
172
+ | New plugin end-to-end | `plugin-builder` (personal) → delegates into `plugin-dev:*` | — |
173
+
174
+ ### External knowledge — check before coding
175
+
176
+ | Source | When | How |
177
+ |---|---|---|
178
+ | `/cookbook` | Claude API patterns: tool calling, PTC, code execution, Agent SDK, RAG, thinking, structured output, batch, caching | Invoke `/cookbook` or read `~/.claude/projects/-Users-tyroneross/memory/reference_claude_cookbook.md` |
179
+ | `RossLabs-AI-Toolkit/LESSONS-LEARNED.md` | Any plugin work | Read during Phase 1 ASSESS |
180
+ | `context7` MCP | Any library/framework use | `query-docs` / `resolve-library-id` — do NOT code from training data |
181
+ | `research` skill | Factual claims, pricing, versions | Run `scripts/research_trigger.py` first; T1 official docs → T4 forums; 2-source minimum |