coding-os 0.3.2__py3-none-any.whl

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 (1304) hide show
  1. adapters/claude/README.md +6 -0
  2. adapters/claude/_install_helpers/extract_stacks.py +43 -0
  3. adapters/claude/_install_helpers/update_mcp_json.py +75 -0
  4. adapters/claude/adapter.yaml +164 -0
  5. adapters/claude/hooks/README.md +40 -0
  6. adapters/claude/hooks/agent_memory_sync.py +131 -0
  7. adapters/claude/hooks/ensure-agent-memory-link.sh +36 -0
  8. adapters/claude/hooks/sync-agent-memory.sh +21 -0
  9. adapters/claude/install.sh +86 -0
  10. adapters/claude/sdk_dispatcher.py +871 -0
  11. adapters/claude/settings.local.template.json +31 -0
  12. adapters/claude/settings.template.json +808 -0
  13. adapters/claude/update_mcp_json.py +85 -0
  14. adapters/codex/adapter.yaml +254 -0
  15. adapters/codex/chat_provider.py +230 -0
  16. adapters/codex/commands/formula-f1.md +129 -0
  17. adapters/codex/commands/formula-f10.md +100 -0
  18. adapters/codex/commands/formula-f11.md +123 -0
  19. adapters/codex/commands/formula-f2.md +139 -0
  20. adapters/codex/commands/formula-f3.md +127 -0
  21. adapters/codex/commands/formula-f4.md +101 -0
  22. adapters/codex/commands/formula-f5.md +135 -0
  23. adapters/codex/commands/formula-f6.md +147 -0
  24. adapters/codex/commands/formula-f7.md +111 -0
  25. adapters/codex/commands/formula-f8.md +133 -0
  26. adapters/codex/commands/formula-f9.md +112 -0
  27. adapters/codex/enable_codex_hooks.py +94 -0
  28. adapters/codex/ensure_codex_mcp.py +124 -0
  29. adapters/codex/hooks/codex-merge-hook-output.py +72 -0
  30. adapters/codex/hooks/codex-normalize-edit.py +96 -0
  31. adapters/codex/hooks/codex-postedit-dispatch.sh +75 -0
  32. adapters/codex/hooks/codex-posttool-dispatch.sh +70 -0
  33. adapters/codex/hooks/codex-preedit-dispatch.sh +83 -0
  34. adapters/codex/hooks/codex-pretool-dispatch.sh +82 -0
  35. adapters/codex/hooks/codex-sessionend-dispatch.sh +20 -0
  36. adapters/codex/hooks/codex-sessionstart-dispatch.sh +68 -0
  37. adapters/codex/hooks/codex-stop-dispatch.sh +73 -0
  38. adapters/codex/hooks/codex-userpromptsubmit-dispatch.sh +74 -0
  39. adapters/codex/hooks.template.json +208 -0
  40. adapters/codex/install.sh +83 -0
  41. adapters/codex/sdk_dispatcher.py +449 -0
  42. board_os/__init__.py +39 -0
  43. board_os/_agent_runtime.py +256 -0
  44. board_os/config.py +421 -0
  45. board_os/git_coherence.py +107 -0
  46. board_os/hub_adapter_manifest.py +140 -0
  47. board_os/mcp_tools.py +3228 -0
  48. board_os/migration.py +166 -0
  49. board_os/parser.py +317 -0
  50. board_os/presence.py +156 -0
  51. board_os/sync.py +320 -0
  52. board_os/transition_gates.py +224 -0
  53. board_os/transition_gates_cli.py +272 -0
  54. board_os/transition_gates_validator.py +551 -0
  55. board_os/verify_suites.py +126 -0
  56. board_os/verify_suites_cli.py +328 -0
  57. board_os/workflow.py +967 -0
  58. cli/__init__.py +0 -0
  59. cli/_data_types.py +248 -0
  60. cli/_init_helpers.py +587 -0
  61. cli/_resources.py +100 -0
  62. cli/adapter_registry.py +239 -0
  63. cli/add_stack.py +315 -0
  64. cli/aggregator.py +438 -0
  65. cli/board_commands.py +1218 -0
  66. cli/brain_commands.py +255 -0
  67. cli/cognition.py +345 -0
  68. cli/config_composer.py +349 -0
  69. cli/core_version.py +41 -0
  70. cli/cron_commands.py +278 -0
  71. cli/db_reset.py +298 -0
  72. cli/doc_commands.py +111 -0
  73. cli/doctor.py +2953 -0
  74. cli/doctor_board.py +365 -0
  75. cli/doctor_extras.py +1121 -0
  76. cli/doctor_graph.py +608 -0
  77. cli/doctor_tokens.py +254 -0
  78. cli/graph_commands.py +1265 -0
  79. cli/hook_renderer.py +393 -0
  80. cli/hub_commands.py +580 -0
  81. cli/list_adapters.py +79 -0
  82. cli/list_stacks.py +105 -0
  83. cli/logs_commands.py +89 -0
  84. cli/main.py +3070 -0
  85. cli/materialize_file.py +65 -0
  86. cli/mcp_start.py +153 -0
  87. cli/module_commands.py +513 -0
  88. cli/pr_commands.py +2024 -0
  89. cli/preset_commands.py +126 -0
  90. cli/preset_registry.py +171 -0
  91. cli/project_overrides.py +119 -0
  92. cli/registry.py +365 -0
  93. cli/remove_stack.py +492 -0
  94. cli/renderer.py +620 -0
  95. cli/setup.py +464 -0
  96. cli/skill_commands.py +689 -0
  97. cli/skill_registry.py +235 -0
  98. cli/skills_list.py +332 -0
  99. cli/stack_lint.py +351 -0
  100. cli/stack_registry.py +688 -0
  101. cli/subsystems.py +335 -0
  102. cli/sync_all.py +310 -0
  103. cli/tail_command.py +410 -0
  104. cli/update.py +608 -0
  105. cli/verify_since_edit.py +439 -0
  106. coding_os-0.3.2.dist-info/METADATA +508 -0
  107. coding_os-0.3.2.dist-info/RECORD +1304 -0
  108. coding_os-0.3.2.dist-info/WHEEL +5 -0
  109. coding_os-0.3.2.dist-info/entry_points.txt +5 -0
  110. coding_os-0.3.2.dist-info/licenses/LICENSE +201 -0
  111. coding_os-0.3.2.dist-info/top_level.txt +10 -0
  112. core/__init__.py +0 -0
  113. core/board_os/__init__.py +39 -0
  114. core/board_os/_agent_runtime.py +256 -0
  115. core/board_os/config.py +421 -0
  116. core/board_os/git_coherence.py +107 -0
  117. core/board_os/hub_adapter_manifest.py +140 -0
  118. core/board_os/mcp_tools.py +3228 -0
  119. core/board_os/migration.py +166 -0
  120. core/board_os/parser.py +317 -0
  121. core/board_os/presence.py +156 -0
  122. core/board_os/sync.py +320 -0
  123. core/board_os/transition-gates.yaml +176 -0
  124. core/board_os/transition_gates.py +224 -0
  125. core/board_os/transition_gates_cli.py +272 -0
  126. core/board_os/transition_gates_validator.py +551 -0
  127. core/board_os/verify-suites.yaml +113 -0
  128. core/board_os/verify_suites.py +126 -0
  129. core/board_os/verify_suites_cli.py +328 -0
  130. core/board_os/workflow.py +967 -0
  131. core/commands/board.md +27 -0
  132. core/commands/classify.md +23 -0
  133. core/commands/compose.md +23 -0
  134. core/commands/daily.md +31 -0
  135. core/commands/diagnose.md +7 -0
  136. core/commands/memory-search.md +23 -0
  137. core/commands/new-project.md +33 -0
  138. core/commands/retro.md +38 -0
  139. core/commands/review.md +14 -0
  140. core/commands/task.md +17 -0
  141. core/commands/verify.md +34 -0
  142. core/docs/thinking_os-final-edition.md +1449 -0
  143. core/doctor-config.yaml +74 -0
  144. core/graph_os/__init__.py +29 -0
  145. core/graph_os/backend.py +233 -0
  146. core/graph_os/backends/__init__.py +13 -0
  147. core/graph_os/backends/sqlite_backend.py +1053 -0
  148. core/graph_os/bench/__init__.py +17 -0
  149. core/graph_os/bench/fixtures.py +56 -0
  150. core/graph_os/bench/harness.py +95 -0
  151. core/graph_os/bench/persian_precision.py +142 -0
  152. core/graph_os/bench/scale_500k.py +120 -0
  153. core/graph_os/bench/token_cost.py +170 -0
  154. core/graph_os/bench/viewer_fps.py +110 -0
  155. core/graph_os/communities.py +410 -0
  156. core/graph_os/enterprise.py +218 -0
  157. core/graph_os/entry_points.py +226 -0
  158. core/graph_os/extractors/__init__.py +25 -0
  159. core/graph_os/extractors/code_generic.py +914 -0
  160. core/graph_os/extractors/code_go.py +1422 -0
  161. core/graph_os/extractors/code_json.py +340 -0
  162. core/graph_os/extractors/code_php.py +979 -0
  163. core/graph_os/extractors/code_python.py +1454 -0
  164. core/graph_os/extractors/code_shell.py +538 -0
  165. core/graph_os/extractors/code_toml.py +302 -0
  166. core/graph_os/extractors/code_ts.py +1665 -0
  167. core/graph_os/extractors/code_yaml.py +394 -0
  168. core/graph_os/extractors/contracts.py +1592 -0
  169. core/graph_os/extractors/md_links.py +890 -0
  170. core/graph_os/extractors/task_deps.py +345 -0
  171. core/graph_os/groups/__init__.py +22 -0
  172. core/graph_os/groups/cross_repo.py +156 -0
  173. core/graph_os/groups/manifest.py +141 -0
  174. core/graph_os/ingest/__init__.py +19 -0
  175. core/graph_os/ingest/base.py +306 -0
  176. core/graph_os/ingest/github.py +112 -0
  177. core/graph_os/ingest/zip.py +95 -0
  178. core/graph_os/toolchain.py +393 -0
  179. core/graph_os/tools/__init__.py +9 -0
  180. core/graph_os/tools/graph.py +5573 -0
  181. core/graph_os/tools/reindex_dispatch.py +730 -0
  182. core/graph_os/tree_sitter_overlay.py +235 -0
  183. core/graph_os/types.py +252 -0
  184. core/graph_os/vec_index.py +277 -0
  185. core/graph_os/viewer/__init__.py +12 -0
  186. core/graph_os/viewer/exporter.py +93 -0
  187. core/graph_os/viewer/template.py +189 -0
  188. core/hooks/_helpers/_paths.py +40 -0
  189. core/hooks/_helpers/advance_role.py +72 -0
  190. core/hooks/_helpers/auto_compose.py +228 -0
  191. core/hooks/_helpers/auto_validate_lessons.py +55 -0
  192. core/hooks/_helpers/branch_guard_check.py +796 -0
  193. core/hooks/_helpers/check_commit_message.py +108 -0
  194. core/hooks/_helpers/check_dangerous_rm.py +80 -0
  195. core/hooks/_helpers/check_git_bypass.py +154 -0
  196. core/hooks/_helpers/check_git_destructive.py +77 -0
  197. core/hooks/_helpers/check_settings_write.py +97 -0
  198. core/hooks/_helpers/consume_override.py +51 -0
  199. core/hooks/_helpers/context_budget.py +77 -0
  200. core/hooks/_helpers/cos_say_json.py +103 -0
  201. core/hooks/_helpers/destructive_edit_check.py +163 -0
  202. core/hooks/_helpers/detect_status_transition.py +82 -0
  203. core/hooks/_helpers/digest_regen.py +56 -0
  204. core/hooks/_helpers/doc_sync_check.py +498 -0
  205. core/hooks/_helpers/drain_embedding_outbox.py +52 -0
  206. core/hooks/_helpers/extract_additional_context.py +51 -0
  207. core/hooks/_helpers/extract_commit_msg_arg.py +74 -0
  208. core/hooks/_helpers/git_command_parse.py +424 -0
  209. core/hooks/_helpers/git_settings_fields.py +47 -0
  210. core/hooks/_helpers/graph_context_match.py +37 -0
  211. core/hooks/_helpers/graph_marker_check.py +70 -0
  212. core/hooks/_helpers/jit_recall.py +56 -0
  213. core/hooks/_helpers/json_field.py +41 -0
  214. core/hooks/_helpers/narrative_signal.py +59 -0
  215. core/hooks/_helpers/observation_count.py +31 -0
  216. core/hooks/_helpers/pre_commit_batch.py +177 -0
  217. core/hooks/_helpers/pre_commit_fake_input.py +42 -0
  218. core/hooks/_helpers/presence_gc.py +102 -0
  219. core/hooks/_helpers/presence_write.py +167 -0
  220. core/hooks/_helpers/recover_indirect.py +35 -0
  221. core/hooks/_helpers/routing_evolution.py +104 -0
  222. core/hooks/_helpers/session_recap.py +72 -0
  223. core/hooks/_helpers/skill_primer.py +229 -0
  224. core/hooks/_helpers/task_sync.py +59 -0
  225. core/hooks/_helpers/tool_failure_capture.py +147 -0
  226. core/hooks/_helpers/trajectory_autosnap.py +278 -0
  227. core/hooks/_helpers/trajectory_startup.py +62 -0
  228. core/hooks/_helpers/turn_summary.py +82 -0
  229. core/hooks/_helpers/validate_task_frontmatter.py +98 -0
  230. core/hooks/_helpers/wip_limit_check.py +103 -0
  231. core/hooks/_helpers/wip_lines.py +53 -0
  232. core/hooks/_helpers/work_log_append.py +89 -0
  233. core/hooks/_helpers/wrap_dispatch_output.py +82 -0
  234. core/hooks/advance-role.sh +48 -0
  235. core/hooks/agent-presence.sh +179 -0
  236. core/hooks/auto-brain-decay.sh +184 -0
  237. core/hooks/auto-compose-roles.sh +83 -0
  238. core/hooks/auto-graph-reconcile-shell.sh +119 -0
  239. core/hooks/auto-regen-doc-index.sh +120 -0
  240. core/hooks/auto-reindex-docs.sh +130 -0
  241. core/hooks/auto-task-sync.sh +56 -0
  242. core/hooks/auto-trace-rotate.sh +88 -0
  243. core/hooks/block-bad-patterns.sh +212 -0
  244. core/hooks/block-dangerous-commands.sh +182 -0
  245. core/hooks/block-hardcoded-literals.sh +90 -0
  246. core/hooks/block-migration-conflict.sh +114 -0
  247. core/hooks/block-protected-files.sh +129 -0
  248. core/hooks/block-secrets.sh +185 -0
  249. core/hooks/block-shared-tree-edit.sh +75 -0
  250. core/hooks/block-uv-heredoc.sh +78 -0
  251. core/hooks/branch-guard.sh +122 -0
  252. core/hooks/capture-observation.sh +76 -0
  253. core/hooks/capture-tool-failure.sh +24 -0
  254. core/hooks/capture-work-log.sh +89 -0
  255. core/hooks/check-agents-md-refs.sh +75 -0
  256. core/hooks/check-agents-md-size.sh +49 -0
  257. core/hooks/check-capture-worked.sh +148 -0
  258. core/hooks/check-doc-size.sh +61 -0
  259. core/hooks/check-mcp-extras.sh +92 -0
  260. core/hooks/check-state.sh +87 -0
  261. core/hooks/classify-task-mode.sh +103 -0
  262. core/hooks/cos-env.sh +1301 -0
  263. core/hooks/drain-embedding-outbox.sh +24 -0
  264. core/hooks/enforce-anti-ambiguity.sh +74 -0
  265. core/hooks/enforce-commit-message.sh +73 -0
  266. core/hooks/enforce-doc-anchor.sh +224 -0
  267. core/hooks/enforce-doc-sync.sh +206 -0
  268. core/hooks/enforce-graph-context.sh +89 -0
  269. core/hooks/enforce-graph-first-read.sh +94 -0
  270. core/hooks/enforce-memory-check.sh +128 -0
  271. core/hooks/enforce-rename-plan.sh +78 -0
  272. core/hooks/enforce-scaffold-boundary.sh +68 -0
  273. core/hooks/enforce-skill.sh +125 -0
  274. core/hooks/enforce-task-body.sh +52 -0
  275. core/hooks/enforce-task-start.sh +81 -0
  276. core/hooks/enforce-task-transition.sh +75 -0
  277. core/hooks/enforce-template.sh +143 -0
  278. core/hooks/enforce-verify.sh +112 -0
  279. core/hooks/enforce-wip-limit.sh +43 -0
  280. core/hooks/enforce-zoom.sh +69 -0
  281. core/hooks/ensure-hub-up.sh +67 -0
  282. core/hooks/inject-mcp-caller-session.sh +70 -0
  283. core/hooks/jit-recall.sh +65 -0
  284. core/hooks/link-commit-to-task.sh +143 -0
  285. core/hooks/lint-task.sh +40 -0
  286. core/hooks/nudge-docs-first.sh +71 -0
  287. core/hooks/nudge-git-mode.sh +29 -0
  288. core/hooks/nudge-graph-os.sh +118 -0
  289. core/hooks/nudge-learn-narrative.sh +36 -0
  290. core/hooks/nudge-model-routing.sh +32 -0
  291. core/hooks/nudge-reentry.sh +101 -0
  292. core/hooks/nudge-reuse-first.sh +68 -0
  293. core/hooks/nudge-task-discovery.sh +81 -0
  294. core/hooks/nudge-thinking-os.sh +109 -0
  295. core/hooks/pr-reap.sh +23 -0
  296. core/hooks/reclaim-sweep.sh +58 -0
  297. core/hooks/record-verify-auto.sh +77 -0
  298. core/hooks/record-verify.sh +74 -0
  299. core/hooks/regen-reminder.sh +104 -0
  300. core/hooks/registry.yaml +1262 -0
  301. core/hooks/remind-daily.sh +27 -0
  302. core/hooks/remind-dogfood.sh +70 -0
  303. core/hooks/remind-learn-validate.sh +94 -0
  304. core/hooks/rules-primer.sh +50 -0
  305. core/hooks/search-enforce-inventory.sh +108 -0
  306. core/hooks/search-verify-remaining.sh +132 -0
  307. core/hooks/session-context.sh +729 -0
  308. core/hooks/session-end.sh +145 -0
  309. core/hooks/session-skill-primer.sh +43 -0
  310. core/hooks/snapshot-transcript.sh +56 -0
  311. core/hooks/sync-task-current.sh +85 -0
  312. core/hooks/test-first-reminder.sh +120 -0
  313. core/hooks/test-governor.sh +173 -0
  314. core/hooks/thinking_os-gate.sh +52 -0
  315. core/hooks/track-backtrack.sh +35 -0
  316. core/hooks/track-discovery.sh +121 -0
  317. core/hooks/track-skill.sh +53 -0
  318. core/hooks/validate-task-frontmatter.sh +49 -0
  319. core/hooks/verify-rename-callers.sh +119 -0
  320. core/hooks/warn-abandoned-task.sh +99 -0
  321. core/hooks/warn-destructive-edit.sh +64 -0
  322. core/hooks/warn-diff-size.sh +43 -0
  323. core/hooks/warn-graph-empty.sh +81 -0
  324. core/hooks/warn-mcp-down.sh +190 -0
  325. core/hooks/write-state.sh +55 -0
  326. core/logging_os/__init__.py +33 -0
  327. core/logging_os/api.py +127 -0
  328. core/logging_os/bridge.py +80 -0
  329. core/logging_os/config.py +172 -0
  330. core/logging_os/fingerprint.py +25 -0
  331. core/logging_os/redact.py +53 -0
  332. core/logging_os/render.py +83 -0
  333. core/logging_os/sinks.py +164 -0
  334. core/rules/anti-overengineering.md +44 -0
  335. core/rules/api-contract-discipline.md +41 -0
  336. core/rules/dimension-registry.md +155 -0
  337. core/rules/git-workflow.md +57 -0
  338. core/rules/memory.md +46 -0
  339. core/rules/model-routing.md +22 -0
  340. core/rules/skill-enforcement.md +75 -0
  341. core/rules/test-discipline.md +38 -0
  342. core/rules/thinking_os.md +48 -0
  343. core/rules/transparency-banner.md +37 -0
  344. core/runtime_paths.yaml +36 -0
  345. core/scaffold_manifest.json +14430 -0
  346. core/scheduled/__init__.py +0 -0
  347. core/scheduled/_activity.py +126 -0
  348. core/scheduled/_state.py +113 -0
  349. core/scheduled/config.py +86 -0
  350. core/scheduled/dep_reconcile.py +135 -0
  351. core/scheduled/error_sweep.py +137 -0
  352. core/scheduled/nightly.py +930 -0
  353. core/scheduled/responsive_extract.py +65 -0
  354. core/schemas/adapter.schema.json +269 -0
  355. core/schemas/preset.schema.json +50 -0
  356. core/schemas/skill.schema.json +81 -0
  357. core/schemas/stack.schema.json +404 -0
  358. core/scripts/_lib.sh +9 -0
  359. core/scripts/docs-lint.sh +228 -0
  360. core/scripts/docs-nav-fix.sh +133 -0
  361. core/scripts/docs-staleness-check.sh +154 -0
  362. core/scripts/install-adapter.sh +266 -0
  363. core/scripts/link-stack-skills.sh +52 -0
  364. core/scripts/log-latest.sh +106 -0
  365. core/scripts/log-search.sh +89 -0
  366. core/scripts/log-write.sh +134 -0
  367. core/scripts/ref-resolve.sh +71 -0
  368. core/skills/a11y/SKILL.md +305 -0
  369. core/skills/a11y/assets/a11y-checklist.md +137 -0
  370. core/skills/a11y/references/aria-and-focus.md +247 -0
  371. core/skills/a11y/references/rn-accessibility.md +343 -0
  372. core/skills/a11y/references/screen-reader-testing.md +190 -0
  373. core/skills/agent-memory/SKILL.md +191 -0
  374. core/skills/agent-memory/assets/memory-checklist.md +21 -0
  375. core/skills/agent-memory/references/memory-recipes.md +57 -0
  376. core/skills/api-design/SKILL.md +232 -0
  377. core/skills/api-design/assets/api-design-checklist.md +110 -0
  378. core/skills/api-design/references/error-envelope.md +381 -0
  379. core/skills/api-design/references/idempotency-pagination.md +312 -0
  380. core/skills/api-design/references/rest-contracts.md +426 -0
  381. core/skills/auth-patterns/SKILL.md +352 -0
  382. core/skills/auth-patterns/assets/auth-checklist.md +118 -0
  383. core/skills/auth-patterns/references/jwt-and-service-tokens.md +343 -0
  384. core/skills/auth-patterns/references/passkeys-2fa.md +289 -0
  385. core/skills/auth-patterns/references/sessions-vs-jwt.md +230 -0
  386. core/skills/auth-patterns/scripts/cookie-flag-check.py +146 -0
  387. core/skills/backend-fundamentals/SKILL.md +238 -0
  388. core/skills/backend-fundamentals/assets/backend-checklist.md +27 -0
  389. core/skills/backend-fundamentals/references/backend-patterns.md +56 -0
  390. core/skills/backend-fundamentals/scripts/check_layering.py +83 -0
  391. core/skills/clean-code/SKILL.md +642 -0
  392. core/skills/clean-code/scripts/audit-fail-closed.py +167 -0
  393. core/skills/codebase-explorer/SKILL.md +89 -0
  394. core/skills/codebase-explorer/assets/reading-checklist.md +24 -0
  395. core/skills/codebase-explorer/references/reading-strategies.md +52 -0
  396. core/skills/codebase-explorer/scripts/outline.py +99 -0
  397. core/skills/db-design/SKILL.md +327 -0
  398. core/skills/db-design/assets/migration-template.sql +49 -0
  399. core/skills/db-design/references/migration-discipline.md +290 -0
  400. core/skills/db-design/references/postgres-patterns.md +340 -0
  401. core/skills/db-design/scripts/migration-safety.sh +150 -0
  402. core/skills/deployment-cicd/SKILL.md +260 -0
  403. core/skills/deployment-cicd/assets/deploy-checklist.md +26 -0
  404. core/skills/deployment-cicd/references/pipeline-and-release.md +54 -0
  405. core/skills/deployment-cicd/scripts/lint_workflow.py +79 -0
  406. core/skills/docker/SKILL.md +114 -0
  407. core/skills/docker/assets/dockerfile-checklist.md +31 -0
  408. core/skills/docker/references/compose-patterns.md +66 -0
  409. core/skills/docker/references/dockerfile-optimization.md +64 -0
  410. core/skills/docker/scripts/lint_dockerfile.sh +48 -0
  411. core/skills/docker/versions.json +16 -0
  412. core/skills/end-to-end-testing/SKILL.md +101 -0
  413. core/skills/end-to-end-testing/assets/e2e-checklist.md +23 -0
  414. core/skills/end-to-end-testing/references/maestro.md +63 -0
  415. core/skills/end-to-end-testing/references/playwright.md +68 -0
  416. core/skills/end-to-end-testing/scripts/lint_e2e.py +88 -0
  417. core/skills/end-to-end-testing/versions.json +16 -0
  418. core/skills/frontend-design/SKILL.md +76 -0
  419. core/skills/frontend-design/assets/design-checklist.md +29 -0
  420. core/skills/frontend-design/references/design-principles.md +65 -0
  421. core/skills/frontend-design/scripts/check_contrast.py +89 -0
  422. core/skills/frontend-fundamentals/SKILL.md +213 -0
  423. core/skills/frontend-fundamentals/assets/frontend-checklist.md +25 -0
  424. core/skills/frontend-fundamentals/references/rendering-and-state.md +66 -0
  425. core/skills/frontend-fundamentals/scripts/check_frontend.py +86 -0
  426. core/skills/graph-explorer/SKILL.md +215 -0
  427. core/skills/graph-explorer/scripts/explain-impact.sh +64 -0
  428. core/skills/graphql/SKILL.md +187 -0
  429. core/skills/grpc-microservices/SKILL.md +174 -0
  430. core/skills/hexagonal-architecture/SKILL.md +199 -0
  431. core/skills/hexagonal-architecture/assets/folder-scaffold.md +233 -0
  432. core/skills/hexagonal-architecture/references/anti-patterns.md +129 -0
  433. core/skills/hexagonal-architecture/references/go-fiber-layout.md +429 -0
  434. core/skills/hexagonal-architecture/references/python-fastapi-layout.md +453 -0
  435. core/skills/hexagonal-architecture/references/react-native-layout.md +428 -0
  436. core/skills/i18n/SKILL.md +126 -0
  437. core/skills/incident-response/SKILL.md +225 -0
  438. core/skills/incident-response/assets/incident-checklist.md +29 -0
  439. core/skills/incident-response/references/severity-and-runbook.md +53 -0
  440. core/skills/incident-response/scripts/classify_severity.py +86 -0
  441. core/skills/linux-sysadmin/SKILL.md +115 -0
  442. core/skills/linux-sysadmin/assets/hardening-checklist.md +29 -0
  443. core/skills/linux-sysadmin/references/ssh-hardening.md +62 -0
  444. core/skills/linux-sysadmin/references/systemd-and-services.md +77 -0
  445. core/skills/linux-sysadmin/scripts/triage.sh +50 -0
  446. core/skills/linux-sysadmin/versions.json +17 -0
  447. core/skills/llm-patterns/SKILL.md +410 -0
  448. core/skills/llm-patterns/assets/llm-feature-checklist.md +26 -0
  449. core/skills/llm-patterns/references/rag-and-evals.md +59 -0
  450. core/skills/llm-patterns/scripts/estimate_tokens.py +75 -0
  451. core/skills/messaging-queues/SKILL.md +142 -0
  452. core/skills/mobile-fundamentals/SKILL.md +406 -0
  453. core/skills/mobile-fundamentals/assets/mobile-launch-checklist.md +130 -0
  454. core/skills/mobile-fundamentals/references/navigation-and-deep-links.md +337 -0
  455. core/skills/mobile-fundamentals/references/offline-sync.md +339 -0
  456. core/skills/node-backend/SKILL.md +114 -0
  457. core/skills/node-backend/assets/node-checklist.md +25 -0
  458. core/skills/node-backend/references/async-and-errors.md +67 -0
  459. core/skills/node-backend/references/event-loop.md +65 -0
  460. core/skills/node-backend/scripts/check_package.py +78 -0
  461. core/skills/node-backend/versions.json +17 -0
  462. core/skills/observability/SKILL.md +289 -0
  463. core/skills/observability/assets/observability-checklist.md +27 -0
  464. core/skills/observability/references/instrumentation.md +57 -0
  465. core/skills/observability/scripts/lint_logging.py +77 -0
  466. core/skills/payments/SKILL.md +102 -0
  467. core/skills/performance/SKILL.md +305 -0
  468. core/skills/performance/assets/perf-checklist.md +143 -0
  469. core/skills/performance/references/mobile-performance.md +249 -0
  470. core/skills/performance/references/web-vitals.md +209 -0
  471. core/skills/php/SKILL.md +116 -0
  472. core/skills/php/assets/php-checklist.md +26 -0
  473. core/skills/php/references/modern-php.md +64 -0
  474. core/skills/php/references/security.md +72 -0
  475. core/skills/php/scripts/scan_php_smells.py +99 -0
  476. core/skills/php/versions.json +9 -0
  477. core/skills/pr-mode-driver/SKILL.md +65 -0
  478. core/skills/realtime-websockets/SKILL.md +152 -0
  479. core/skills/redis/SKILL.md +105 -0
  480. core/skills/redis/assets/redis-checklist.md +27 -0
  481. core/skills/redis/references/operations.md +66 -0
  482. core/skills/redis/references/patterns.md +62 -0
  483. core/skills/redis/scripts/analyze_info.py +101 -0
  484. core/skills/redis/versions.json +9 -0
  485. core/skills/search/SKILL.md +91 -0
  486. core/skills/search/references/grep.md +76 -0
  487. core/skills/search/scripts/verify-count.sh +73 -0
  488. core/skills/search-infra/SKILL.md +109 -0
  489. core/skills/security-mobile/SKILL.md +394 -0
  490. core/skills/security-mobile/assets/mobile-security-checklist.md +117 -0
  491. core/skills/security-mobile/references/masvs-l1-checklist.md +127 -0
  492. core/skills/security-web/SKILL.md +217 -0
  493. core/skills/security-web/assets/security-web-checklist.md +167 -0
  494. core/skills/security-web/references/owasp-top-10.md +551 -0
  495. core/skills/security-web/references/supply-chain.md +179 -0
  496. core/skills/security-web/scripts/csp-check.sh +153 -0
  497. core/skills/shell-scripting/SKILL.md +128 -0
  498. core/skills/shell-scripting/assets/script-checklist.md +33 -0
  499. core/skills/shell-scripting/references/argument-parsing.md +84 -0
  500. core/skills/shell-scripting/references/bash-robustness.md +78 -0
  501. core/skills/shell-scripting/scripts/lint_script.sh +53 -0
  502. core/skills/shell-scripting/scripts/new_script.py +131 -0
  503. core/skills/shell-scripting/versions.json +23 -0
  504. core/skills/sql-authoring/SKILL.md +104 -0
  505. core/skills/sql-authoring/assets/query-review-checklist.md +26 -0
  506. core/skills/sql-authoring/references/query-patterns.md +89 -0
  507. core/skills/sql-authoring/references/reading-explain.md +52 -0
  508. core/skills/sql-authoring/scripts/analyze_plan.py +100 -0
  509. core/skills/sql-authoring/versions.json +17 -0
  510. core/skills/state-management/SKILL.md +428 -0
  511. core/skills/state-management/references/tanstack-query-recipes.md +301 -0
  512. core/skills/state-management/references/zustand-recipes.md +364 -0
  513. core/skills/supabase/SKILL.md +108 -0
  514. core/skills/supabase/assets/supabase-checklist.md +26 -0
  515. core/skills/supabase/references/realtime-and-storage.md +55 -0
  516. core/skills/supabase/references/rls-and-auth.md +65 -0
  517. core/skills/supabase/scripts/check_rls.py +88 -0
  518. core/skills/supabase/versions.json +9 -0
  519. core/skills/task-driver/SKILL.md +272 -0
  520. core/skills/task-driver/scripts/task-lint.sh +163 -0
  521. core/skills/technical-writing/SKILL.md +85 -0
  522. core/skills/technical-writing/assets/doc-checklist.md +29 -0
  523. core/skills/technical-writing/references/doc-anatomy.md +53 -0
  524. core/skills/technical-writing/references/writing-craft.md +59 -0
  525. core/skills/technical-writing/scripts/new_doc.py +81 -0
  526. core/skills/terraform-k8s/SKILL.md +133 -0
  527. core/skills/testing-strategy/SKILL.md +266 -0
  528. core/skills/testing-strategy/assets/test-review-checklist.md +25 -0
  529. core/skills/testing-strategy/references/test-types.md +52 -0
  530. core/skills/testing-strategy/scripts/coverage_gate.py +79 -0
  531. core/skills/thinking_os/SKILL.md +288 -0
  532. core/skills/thinking_os/scripts/classify.sh +122 -0
  533. core/skills/typescript/SKILL.md +110 -0
  534. core/skills/typescript/assets/typescript-checklist.md +24 -0
  535. core/skills/typescript/references/strictness.md +53 -0
  536. core/skills/typescript/references/type-system.md +86 -0
  537. core/skills/typescript/scripts/check_tsconfig.py +92 -0
  538. core/skills/typescript/versions.json +9 -0
  539. core/subsystems.yaml +202 -0
  540. core/thinking_os/__init__.py +1 -0
  541. core/thinking_os/_agent_markers.py +32 -0
  542. core/thinking_os/agents/README.md +71 -0
  543. core/thinking_os/agents/analyst.md +139 -0
  544. core/thinking_os/agents/architect.md +127 -0
  545. core/thinking_os/agents/debugger.md +111 -0
  546. core/thinking_os/agents/deployer.md +112 -0
  547. core/thinking_os/agents/distiller.md +28 -0
  548. core/thinking_os/agents/documenter.md +101 -0
  549. core/thinking_os/agents/implementer.md +135 -0
  550. core/thinking_os/agents/internal/session_observer.md +39 -0
  551. core/thinking_os/agents/observer.md +100 -0
  552. core/thinking_os/agents/onboarder.md +81 -0
  553. core/thinking_os/agents/refactorer.md +123 -0
  554. core/thinking_os/agents/repairer.md +47 -0
  555. core/thinking_os/agents/researcher.md +129 -0
  556. core/thinking_os/agents/reviewer.md +147 -0
  557. core/thinking_os/agents/security_auditor.md +133 -0
  558. core/thinking_os/background.py +405 -0
  559. core/thinking_os/bootstrap_outcomes.py +200 -0
  560. core/thinking_os/budget.py +302 -0
  561. core/thinking_os/capture.py +495 -0
  562. core/thinking_os/cognition.py +516 -0
  563. core/thinking_os/cognition_schemas.py +517 -0
  564. core/thinking_os/compress.py +192 -0
  565. core/thinking_os/concepts.py +233 -0
  566. core/thinking_os/dashboard.py +159 -0
  567. core/thinking_os/database.py +2883 -0
  568. core/thinking_os/decay.py +393 -0
  569. core/thinking_os/digest.py +295 -0
  570. core/thinking_os/dispatcher.py +192 -0
  571. core/thinking_os/dispatcher_helpers.py +48 -0
  572. core/thinking_os/dispatchers/__init__.py +3 -0
  573. core/thinking_os/dispatchers/default.py +47 -0
  574. core/thinking_os/distill.py +192 -0
  575. core/thinking_os/doc_indexer.py +905 -0
  576. core/thinking_os/embeddings.py +943 -0
  577. core/thinking_os/formula_composer.py +556 -0
  578. core/thinking_os/gate_marker.py +75 -0
  579. core/thinking_os/graph.py +296 -0
  580. core/thinking_os/graph_indexer.py +360 -0
  581. core/thinking_os/health_check.py +517 -0
  582. core/thinking_os/impact.py +119 -0
  583. core/thinking_os/memory_gc.py +356 -0
  584. core/thinking_os/migrator_embeddings.py +318 -0
  585. core/thinking_os/precision.py +194 -0
  586. core/thinking_os/presets/registry.yaml +127 -0
  587. core/thinking_os/record_outcome.py +399 -0
  588. core/thinking_os/repair.py +105 -0
  589. core/thinking_os/retrieval_quality.py +239 -0
  590. core/thinking_os/roles/analyst.yaml +83 -0
  591. core/thinking_os/roles/architect.yaml +88 -0
  592. core/thinking_os/roles/debugger.yaml +71 -0
  593. core/thinking_os/roles/deployer.yaml +71 -0
  594. core/thinking_os/roles/documenter.yaml +72 -0
  595. core/thinking_os/roles/implementer.yaml +83 -0
  596. core/thinking_os/roles/observer.yaml +70 -0
  597. core/thinking_os/roles/refactorer.yaml +71 -0
  598. core/thinking_os/roles/researcher.yaml +72 -0
  599. core/thinking_os/roles/reviewer.yaml +79 -0
  600. core/thinking_os/roles/security_auditor.yaml +83 -0
  601. core/thinking_os/roles_state.py +168 -0
  602. core/thinking_os/sanitizer.py +320 -0
  603. core/thinking_os/server.py +3160 -0
  604. core/thinking_os/session_enrich.py +272 -0
  605. core/thinking_os/session_observe_worker.py +111 -0
  606. core/thinking_os/session_startup.py +74 -0
  607. core/thinking_os/session_summary.py +245 -0
  608. core/thinking_os/situations/registry.yaml +99 -0
  609. core/thinking_os/task_analyzer.py +462 -0
  610. core/thinking_os/task_parser.py +342 -0
  611. core/thinking_os/task_sync.py +73 -0
  612. core/thinking_os/tools/__init__.py +6 -0
  613. core/thinking_os/tools/_shared.py +947 -0
  614. core/thinking_os/tools/cognition.py +1867 -0
  615. core/thinking_os/tools/docs.py +770 -0
  616. core/thinking_os/tools/learning.py +2078 -0
  617. core/thinking_os/tools/logs.py +79 -0
  618. core/thinking_os/tools/memory.py +840 -0
  619. core/thinking_os/tools/metrics.py +200 -0
  620. core/thinking_os/tools/retrieve.py +415 -0
  621. core/thinking_os/tools/routing.py +658 -0
  622. core/thinking_os/tools/tasks.py +449 -0
  623. core/thinking_os/tools/trajectory.py +181 -0
  624. core/thinking_os/tracing.py +235 -0
  625. core/web/__init__.py +5 -0
  626. core/web/_cache.py +118 -0
  627. core/web/_deps.py +56 -0
  628. core/web/_envelope.py +85 -0
  629. core/web/_project_context.py +140 -0
  630. core/web/chat_providers.py +108 -0
  631. core/web/init_jobs.py +216 -0
  632. core/web/routes/__init__.py +25 -0
  633. core/web/routes/_bounded_read.py +76 -0
  634. core/web/routes/board.py +1089 -0
  635. core/web/routes/cognition.py +1838 -0
  636. core/web/routes/config.py +635 -0
  637. core/web/routes/graph.py +513 -0
  638. core/web/routes/health.py +180 -0
  639. core/web/routes/hooks.py +288 -0
  640. core/web/routes/hub.py +1219 -0
  641. core/web/routes/logs.py +374 -0
  642. core/web/routes/metrics.py +43 -0
  643. core/web/routes/observability.py +400 -0
  644. core/web/routes/patterns.py +227 -0
  645. core/web/routes/presence.py +609 -0
  646. core/web/routes/roles.py +446 -0
  647. core/web/routes/scheduled.py +261 -0
  648. core/web/routes/search.py +238 -0
  649. core/web/routes/sessions.py +220 -0
  650. core/web/routes/settings.py +363 -0
  651. core/web/routes/stream.py +547 -0
  652. core/web/security.py +157 -0
  653. core/web/server.py +283 -0
  654. graph_os/__init__.py +29 -0
  655. graph_os/backend.py +233 -0
  656. graph_os/backends/__init__.py +13 -0
  657. graph_os/backends/sqlite_backend.py +1053 -0
  658. graph_os/communities.py +410 -0
  659. graph_os/enterprise.py +218 -0
  660. graph_os/entry_points.py +226 -0
  661. graph_os/extractors/__init__.py +25 -0
  662. graph_os/extractors/code_generic.py +914 -0
  663. graph_os/extractors/code_go.py +1422 -0
  664. graph_os/extractors/code_json.py +340 -0
  665. graph_os/extractors/code_php.py +979 -0
  666. graph_os/extractors/code_python.py +1454 -0
  667. graph_os/extractors/code_shell.py +538 -0
  668. graph_os/extractors/code_toml.py +302 -0
  669. graph_os/extractors/code_ts.py +1665 -0
  670. graph_os/extractors/code_yaml.py +394 -0
  671. graph_os/extractors/contracts.py +1592 -0
  672. graph_os/extractors/md_links.py +890 -0
  673. graph_os/extractors/task_deps.py +345 -0
  674. graph_os/groups/__init__.py +22 -0
  675. graph_os/groups/cross_repo.py +156 -0
  676. graph_os/groups/manifest.py +141 -0
  677. graph_os/ingest/__init__.py +19 -0
  678. graph_os/ingest/base.py +306 -0
  679. graph_os/ingest/github.py +112 -0
  680. graph_os/ingest/zip.py +95 -0
  681. graph_os/toolchain.py +393 -0
  682. graph_os/tools/__init__.py +9 -0
  683. graph_os/tools/graph.py +5573 -0
  684. graph_os/tools/reindex_dispatch.py +730 -0
  685. graph_os/tree_sitter_overlay.py +235 -0
  686. graph_os/types.py +252 -0
  687. graph_os/vec_index.py +277 -0
  688. graph_os/viewer/__init__.py +12 -0
  689. graph_os/viewer/exporter.py +93 -0
  690. graph_os/viewer/template.py +189 -0
  691. scheduled/__init__.py +0 -0
  692. scheduled/_activity.py +126 -0
  693. scheduled/_state.py +113 -0
  694. scheduled/config.py +86 -0
  695. scheduled/dep_reconcile.py +135 -0
  696. scheduled/error_sweep.py +137 -0
  697. scheduled/nightly.py +930 -0
  698. scheduled/responsive_extract.py +65 -0
  699. scripts/__init__.py +4 -0
  700. scripts/_commit_msg_body.sh +31 -0
  701. scripts/_post_commit_body.sh +49 -0
  702. scripts/_pre_commit_body.sh +121 -0
  703. scripts/_prepare_commit_msg_body.sh +53 -0
  704. scripts/audit_mcp_tools.py +693 -0
  705. scripts/bench_sdk_dispatcher.py +177 -0
  706. scripts/capture_golden.py +169 -0
  707. scripts/check_graph_phantoms.py +75 -0
  708. scripts/dev/audit_doc_links.py +359 -0
  709. scripts/dev/audit_scaffold_module_tags.py +107 -0
  710. scripts/dev/backfill_doc_headers.py +328 -0
  711. scripts/dev/backfill_nav_lines.py +119 -0
  712. scripts/dev/fix_nav_placement.py +106 -0
  713. scripts/dev/inspect_sdk_options.py +45 -0
  714. scripts/dev/migrate_check_ids.py +170 -0
  715. scripts/dev/strip_purpose_blocks.py +154 -0
  716. scripts/dump_openapi.py +66 -0
  717. scripts/e2e_dispatch_tool.py +195 -0
  718. scripts/generate_manifest.py +166 -0
  719. scripts/golden_sections.py +20 -0
  720. scripts/graph_demo.py +161 -0
  721. scripts/install-git-hooks.sh +47 -0
  722. scripts/migrate_embeddings_minilm_to_bge_m3.py +84 -0
  723. scripts/operational_eval.py +445 -0
  724. scripts/probe_agent_session_resolver.py +59 -0
  725. scripts/prune_deleted_path.py +127 -0
  726. scripts/refactor_agent_dual_mode.py +171 -0
  727. scripts/refresh_skill_versions.py +302 -0
  728. scripts/regen_doc_index.py +209 -0
  729. scripts/regen_doctor_schema.py +62 -0
  730. scripts/regen_rules.py +94 -0
  731. scripts/rename_formulas_to_semantic.py +241 -0
  732. scripts/smoke_db_connections.py +183 -0
  733. scripts/smoke_doc_header.py +72 -0
  734. scripts/smoke_graph_e2e.py +374 -0
  735. scripts/smoke_sdk_dispatch.py +84 -0
  736. scripts/smoke_uid_resolver.py +164 -0
  737. scripts/verify_dispatchers.py +244 -0
  738. scripts/verify_phase_c_e2e.py +436 -0
  739. templates/__init__.py +6 -0
  740. templates/_base/Makefile.base +353 -0
  741. templates/_base/base.yaml +59 -0
  742. templates/_base/coding-os.yaml.template +39 -0
  743. templates/_base/dimension-registry.template.md +68 -0
  744. templates/_base/domain-config.template.json +46 -0
  745. templates/_base/fragments/anatomy-map.md.tmpl +11 -0
  746. templates/_base/fragments/context-discipline.md.tmpl +3 -0
  747. templates/_base/fragments/core-loop.md.tmpl +52 -0
  748. templates/_base/fragments/engineering-routing.md.tmpl +3 -0
  749. templates/_base/fragments/header.md.tmpl +6 -0
  750. templates/_base/fragments/identity.md.tmpl +3 -0
  751. templates/_base/fragments/principles.md.tmpl +3 -0
  752. templates/_base/fragments/retrieval-routing.md.tmpl +23 -0
  753. templates/_base/fragments/session-handoff.md.tmpl +3 -0
  754. templates/_base/fragments/skills.md.tmpl +3 -0
  755. templates/_base/fragments/ssot-map.md.tmpl +3 -0
  756. templates/_base/fragments/stop-conditions.md.tmpl +3 -0
  757. templates/_base/fragments/subagent-dispatch.md.tmpl +3 -0
  758. templates/_base/fragments/task-authoring.md.tmpl +69 -0
  759. templates/_base/fragments/task-logging.md.tmpl +8 -0
  760. templates/_base/fragments/tool-routing.md.tmpl +9 -0
  761. templates/_base/fragments/verification-matrix.md.tmpl +12 -0
  762. templates/_base/lang/dart/analysis_options.yaml +7 -0
  763. templates/_base/lang/php/phpcs.xml.dist +10 -0
  764. templates/_base/lang/python/pyproject.toml +19 -0
  765. templates/_base/lang/rust/clippy.toml +5 -0
  766. templates/_base/lang/rust/rustfmt.toml +3 -0
  767. templates/_base/lang/typescript/eslint.config.js +26 -0
  768. templates/_base/lang/typescript/tsconfig.json +15 -0
  769. templates/_base/lang/typescript/vitest.config.ts +10 -0
  770. templates/_base/scaffold/changes.log +1 -0
  771. templates/_base/scaffold/docs/00-index.md +55 -0
  772. templates/_base/scaffold/docs/_meta/feature-dependency-tree.md +30 -0
  773. templates/_base/scaffold/docs/_meta/foundation-map.md +56 -0
  774. templates/_base/scaffold/docs/_meta/questions.md +8 -0
  775. templates/_base/scaffold/docs/_meta/roadmap.md +33 -0
  776. templates/_base/scaffold/docs/api-contracts/00-index.md +58 -0
  777. templates/_base/scaffold/docs/api-contracts/error-format.md +58 -0
  778. templates/_base/scaffold/docs/architecture/00-index.md +42 -0
  779. templates/_base/scaffold/docs/architecture/adr/00-index.md +39 -0
  780. templates/_base/scaffold/docs/engineering/00-index.md +9 -0
  781. templates/_base/scaffold/docs/governance/00-index.md +55 -0
  782. templates/_base/scaffold/docs/governance/_templates/doc-cheat-sheet.md +202 -0
  783. templates/_base/scaffold/docs/governance/_templates/playbook-template.md +81 -0
  784. templates/_base/scaffold/docs/governance/_templates/post-mortem-template.md +85 -0
  785. templates/_base/scaffold/docs/governance/_templates/runbook-template.md +88 -0
  786. templates/_base/scaffold/docs/governance/_templates/security-review-template.md +111 -0
  787. templates/_base/scaffold/docs/governance/_templates/task-detail.md +61 -0
  788. templates/_base/scaffold/docs/governance/agent-workflow.md +101 -0
  789. templates/_base/scaffold/docs/governance/anatomy-contract.md +150 -0
  790. templates/_base/scaffold/docs/governance/critical-rules.md +224 -0
  791. templates/_base/scaffold/docs/governance/decision-records.md +58 -0
  792. templates/_base/scaffold/docs/governance/docs-first-protocol.md +157 -0
  793. templates/_base/scaffold/docs/governance/docs-system.md +151 -0
  794. templates/_base/scaffold/docs/governance/gdpr-compliance.md +66 -0
  795. templates/_base/scaffold/docs/governance/mcp-tool-inventory.md +112 -0
  796. templates/_base/scaffold/docs/governance/risk-register.md +26 -0
  797. templates/_base/scaffold/docs/governance/scaffold-boundary-contract.md +161 -0
  798. templates/_base/scaffold/docs/governance/task-lifecycle.md +125 -0
  799. templates/_base/scaffold/docs/governance/wrapper-derivation.md +50 -0
  800. templates/_base/scaffold/docs/insights/00-index.md +17 -0
  801. templates/_base/scaffold/docs/ops/00-index.md +59 -0
  802. templates/_base/scaffold/docs/ops/runbooks/00-index.md +9 -0
  803. templates/_base/scaffold/docs/playbooks/00-index.md +12 -0
  804. templates/_base/scaffold/docs/playbooks/research-validation.md +29 -0
  805. templates/_base/scaffold/docs/playbooks/security-review.md +41 -0
  806. templates/_base/scaffold/docs/prd/00-index.md +43 -0
  807. templates/_base/scaffold/docs/prd/01-snapshot-vision.md +56 -0
  808. templates/_base/scaffold/docs/workflow/workflow-guide.md +138 -0
  809. templates/_base/scaffold/src/shared/README.md +23 -0
  810. templates/_base/skill-enforcement.template.md +14 -0
  811. templates/_base/task-detail.template.md +61 -0
  812. templates/_presets/ai-saas.yaml +9 -0
  813. templates/_presets/django-next.yaml +8 -0
  814. templates/_presets/dotnet-react.yaml +8 -0
  815. templates/_presets/flutter-baas.yaml +8 -0
  816. templates/_presets/go-react.yaml +8 -0
  817. templates/_presets/hexagonal-product.yaml +16 -0
  818. templates/_presets/jamstack.yaml +8 -0
  819. templates/_presets/laravel-vue.yaml +8 -0
  820. templates/_presets/mean.yaml +8 -0
  821. templates/_presets/mern.yaml +9 -0
  822. templates/_presets/nest-angular.yaml +8 -0
  823. templates/_presets/nextjs-fastapi.yaml +10 -0
  824. templates/_presets/nuxt-fullstack.yaml +9 -0
  825. templates/_presets/pern.yaml +9 -0
  826. templates/_presets/rails-react.yaml +8 -0
  827. templates/_presets/rn-api.yaml +8 -0
  828. templates/_presets/rust-svelte.yaml +8 -0
  829. templates/_presets/spring-react.yaml +8 -0
  830. templates/_presets/t3-style.yaml +9 -0
  831. templates/_presets/tall.yaml +8 -0
  832. templates/_presets/wordpress-cms.yaml +8 -0
  833. templates/angular/rules/frontend.md +19 -0
  834. templates/angular/scaffold/docs/engineering/accessibility.md +46 -0
  835. templates/angular/scaffold/docs/engineering/angular-rules.md +35 -0
  836. templates/angular/scaffold/docs/playbooks/angular-app.md +42 -0
  837. templates/angular/scaffold/src/frontend/angular.json +52 -0
  838. templates/angular/scaffold/src/frontend/package.json +28 -0
  839. templates/angular/scaffold/src/frontend/src/app/app.component.ts +19 -0
  840. templates/angular/scaffold/src/frontend/src/app/app.config.ts +22 -0
  841. templates/angular/scaffold/src/frontend/src/app/app.routes.ts +8 -0
  842. templates/angular/scaffold/src/frontend/src/app/core/global-error-handler.ts +12 -0
  843. templates/angular/scaffold/src/frontend/src/app/health/health.component.ts +14 -0
  844. templates/angular/scaffold/src/frontend/src/app/health/health.service.spec.ts +16 -0
  845. templates/angular/scaffold/src/frontend/src/app/health/health.service.ts +10 -0
  846. templates/angular/scaffold/src/frontend/src/index.html +11 -0
  847. templates/angular/scaffold/src/frontend/src/main.ts +9 -0
  848. templates/angular/scaffold/src/frontend/src/styles.css +14 -0
  849. templates/angular/scaffold/src/frontend/tsconfig.app.json +8 -0
  850. templates/angular/scaffold/src/frontend/tsconfig.json +27 -0
  851. templates/angular/scaffold/src/frontend/tsconfig.spec.json +8 -0
  852. templates/angular/scaffold-boundary.yaml +27 -0
  853. templates/angular/skills/angular/SKILL.md +79 -0
  854. templates/angular/skills/angular/references/anatomy.md +69 -0
  855. templates/angular/stack.yaml +75 -0
  856. templates/aspnet-core/rules/backend.md +20 -0
  857. templates/aspnet-core/scaffold/docs/engineering/aspnet-core-rules.md +36 -0
  858. templates/aspnet-core/scaffold/docs/playbooks/aspnet-core-service.md +40 -0
  859. templates/aspnet-core/scaffold/src/backend/Backend.csproj +11 -0
  860. templates/aspnet-core/scaffold/src/backend/Backend.sln +27 -0
  861. templates/aspnet-core/scaffold/src/backend/Common/ExceptionHandlingMiddleware.cs +35 -0
  862. templates/aspnet-core/scaffold/src/backend/Features/Health/HealthEndpoints.cs +10 -0
  863. templates/aspnet-core/scaffold/src/backend/Features/Health/HealthService.cs +9 -0
  864. templates/aspnet-core/scaffold/src/backend/Program.cs +22 -0
  865. templates/aspnet-core/scaffold/src/backend/tests/Backend.Tests/Backend.Tests.csproj +22 -0
  866. templates/aspnet-core/scaffold/src/backend/tests/Backend.Tests/HealthServiceTests.cs +15 -0
  867. templates/aspnet-core/scaffold-boundary.yaml +24 -0
  868. templates/aspnet-core/skills/aspnet-core/SKILL.md +80 -0
  869. templates/aspnet-core/skills/aspnet-core/references/anatomy.md +65 -0
  870. templates/aspnet-core/stack.yaml +68 -0
  871. templates/astro/rules/frontend.md +20 -0
  872. templates/astro/scaffold/docs/engineering/astro-rules.md +40 -0
  873. templates/astro/scaffold/docs/playbooks/astro-app.md +57 -0
  874. templates/astro/scaffold/docs/playbooks/content-seo.md +37 -0
  875. templates/astro/scaffold/src/frontend/astro.config.mjs +10 -0
  876. templates/astro/scaffold/src/frontend/package.json +23 -0
  877. templates/astro/scaffold/src/frontend/src/components/Greeting.astro +13 -0
  878. templates/astro/scaffold/src/frontend/src/content/posts/hello.md +10 -0
  879. templates/astro/scaffold/src/frontend/src/content.config.ts +19 -0
  880. templates/astro/scaffold/src/frontend/src/lib/problem.test.ts +39 -0
  881. templates/astro/scaffold/src/frontend/src/lib/problem.ts +30 -0
  882. templates/astro/scaffold/src/frontend/src/pages/api/health.ts +13 -0
  883. templates/astro/scaffold/src/frontend/src/pages/index.astro +21 -0
  884. templates/astro/scaffold/src/frontend/tsconfig.json +9 -0
  885. templates/astro/scaffold/src/frontend/vitest.config.ts +10 -0
  886. templates/astro/scaffold-boundary.yaml +28 -0
  887. templates/astro/skills/astro/SKILL.md +71 -0
  888. templates/astro/skills/astro/references/anatomy.md +66 -0
  889. templates/astro/stack.yaml +75 -0
  890. templates/csharp-plain/scaffold/src/backend/Backend.csproj +12 -0
  891. templates/csharp-plain/scaffold/src/backend/Program.cs +1 -0
  892. templates/csharp-plain/scaffold-boundary.yaml +23 -0
  893. templates/csharp-plain/stack.yaml +50 -0
  894. templates/django/rules/backend.md +18 -0
  895. templates/django/scaffold/docs/engineering/anti-ambiguity.md +74 -0
  896. templates/django/scaffold/docs/engineering/backend-rules.md +133 -0
  897. templates/django/scaffold/docs/engineering/glossary.md +51 -0
  898. templates/django/scaffold/docs/engineering/logging-standards.md +107 -0
  899. templates/django/scaffold/docs/engineering/naming-conventions.md +68 -0
  900. templates/django/scaffold/docs/engineering/secrets-rotation-runbook.md +142 -0
  901. templates/django/scaffold/docs/playbooks/backend-api.md +119 -0
  902. templates/django/scaffold/src/backend/config/__init__.py +0 -0
  903. templates/django/scaffold/src/backend/config/settings.py +31 -0
  904. templates/django/scaffold/src/backend/config/urls.py +11 -0
  905. templates/django/scaffold/src/backend/config/wsgi.py +6 -0
  906. templates/django/scaffold/src/backend/manage.py +14 -0
  907. templates/django/scaffold/src/backend/pyproject.toml +37 -0
  908. templates/django/scaffold/src/backend/tests/test_health.py +4 -0
  909. templates/django/scaffold-boundary.yaml +25 -0
  910. templates/django/skills/python-django/SKILL.md +450 -0
  911. templates/django/skills/python-django/references/anatomy.md +117 -0
  912. templates/django/skills/python-django/scripts/new_endpoint.py +89 -0
  913. templates/django/stack.yaml +73 -0
  914. templates/fastapi/rules/backend.md +18 -0
  915. templates/fastapi/scaffold/docs/engineering/fastapi-rules.md +37 -0
  916. templates/fastapi/scaffold/docs/playbooks/fastapi-service.md +30 -0
  917. templates/fastapi/scaffold/src/backend/app/__init__.py +0 -0
  918. templates/fastapi/scaffold/src/backend/app/main.py +8 -0
  919. templates/fastapi/scaffold/src/backend/pyproject.toml +39 -0
  920. templates/fastapi/scaffold/src/backend/tests/test_health.py +11 -0
  921. templates/fastapi/scaffold-boundary.yaml +25 -0
  922. templates/fastapi/skills/python-fastapi/SKILL.md +75 -0
  923. templates/fastapi/skills/python-fastapi/references/anatomy.md +117 -0
  924. templates/fastapi/skills/python-fastapi/scripts/new_endpoint.py +101 -0
  925. templates/fastapi/stack.yaml +57 -0
  926. templates/flutter/rules/mobile.md +26 -0
  927. templates/flutter/scaffold/docs/engineering/flutter-rules.md +35 -0
  928. templates/flutter/scaffold/docs/playbooks/flutter-app.md +45 -0
  929. templates/flutter/scaffold/src/mobile/lib/core/error_mapper.dart +17 -0
  930. templates/flutter/scaffold/src/mobile/lib/core/router.dart +13 -0
  931. templates/flutter/scaffold/src/mobile/lib/main.dart +22 -0
  932. templates/flutter/scaffold/src/mobile/lib/screens/health_screen.dart +32 -0
  933. templates/flutter/scaffold/src/mobile/lib/services/health_service.dart +11 -0
  934. templates/flutter/scaffold/src/mobile/lib/state/health_provider.dart +13 -0
  935. templates/flutter/scaffold/src/mobile/pubspec.yaml +22 -0
  936. templates/flutter/scaffold/src/mobile/test/health_provider_test.dart +90 -0
  937. templates/flutter/scaffold-boundary.yaml +28 -0
  938. templates/flutter/skills/flutter/SKILL.md +76 -0
  939. templates/flutter/skills/flutter/references/anatomy.md +64 -0
  940. templates/flutter/stack.yaml +70 -0
  941. templates/go/rules/backend.md +19 -0
  942. templates/go/scaffold/docs/engineering/go-rules.md +45 -0
  943. templates/go/scaffold/docs/playbooks/go-service.md +30 -0
  944. templates/go/scaffold/src/backend/cmd/api/main.go +22 -0
  945. templates/go/scaffold/src/backend/cmd/api/main_test.go +20 -0
  946. templates/go/scaffold/src/backend/go.mod +3 -0
  947. templates/go/scaffold-boundary.yaml +25 -0
  948. templates/go/skills/go-patterns/SKILL.md +68 -0
  949. templates/go/skills/go-patterns/assets/go-checklist.md +29 -0
  950. templates/go/skills/go-patterns/references/anatomy.md +115 -0
  951. templates/go/skills/go-patterns/references/go-2026-idioms.md +92 -0
  952. templates/go/skills/go-patterns/scripts/new_endpoint.py +117 -0
  953. templates/go/skills/go-patterns/versions.json +16 -0
  954. templates/go/stack.yaml +54 -0
  955. templates/go-fiber/rules/backend.md +20 -0
  956. templates/go-fiber/scaffold/docs/engineering/fiber-rules.md +97 -0
  957. templates/go-fiber/scaffold/docs/playbooks/fiber-service.md +149 -0
  958. templates/go-fiber/scaffold/src/backend/cmd/api/main.go +21 -0
  959. templates/go-fiber/scaffold/src/backend/cmd/api/main_test.go +17 -0
  960. templates/go-fiber/scaffold/src/backend/go.mod +23 -0
  961. templates/go-fiber/scaffold/src/backend/go.sum +49 -0
  962. templates/go-fiber/scaffold-boundary.yaml +26 -0
  963. templates/go-fiber/skills/go-fiber/SKILL.md +203 -0
  964. templates/go-fiber/skills/go-fiber/assets/fiber-checklist.md +26 -0
  965. templates/go-fiber/skills/go-fiber/references/anatomy.md +116 -0
  966. templates/go-fiber/skills/go-fiber/references/fiber-v3-patterns.md +89 -0
  967. templates/go-fiber/skills/go-fiber/scripts/new_endpoint.py +107 -0
  968. templates/go-fiber/skills/go-fiber/versions.json +16 -0
  969. templates/go-fiber/stack.yaml +59 -0
  970. templates/go-plain/scaffold/src/backend/go.mod +3 -0
  971. templates/go-plain/scaffold/src/backend/main.go +7 -0
  972. templates/go-plain/scaffold-boundary.yaml +22 -0
  973. templates/go-plain/stack.yaml +51 -0
  974. templates/java-plain/scaffold/src/backend/mvnw +302 -0
  975. templates/java-plain/scaffold/src/backend/pom.xml +41 -0
  976. templates/java-plain/scaffold/src/backend/src/main/java/com/example/app/Main.java +10 -0
  977. templates/java-plain/scaffold-boundary.yaml +23 -0
  978. templates/java-plain/stack.yaml +51 -0
  979. templates/laravel/rules/backend.md +20 -0
  980. templates/laravel/scaffold/docs/engineering/laravel-rules.md +28 -0
  981. templates/laravel/scaffold/docs/playbooks/laravel-service.md +28 -0
  982. templates/laravel/scaffold/src/backend/app/Exceptions/Handler.php +27 -0
  983. templates/laravel/scaffold/src/backend/app/Http/Controllers/HealthController.php +15 -0
  984. templates/laravel/scaffold/src/backend/app/Support/HealthStatus.php +14 -0
  985. templates/laravel/scaffold/src/backend/composer.json +24 -0
  986. templates/laravel/scaffold/src/backend/phpunit.xml +10 -0
  987. templates/laravel/scaffold/src/backend/public/index.php +8 -0
  988. templates/laravel/scaffold/src/backend/routes/api.php +7 -0
  989. templates/laravel/scaffold/src/backend/tests/Unit/HealthStatusTest.php +16 -0
  990. templates/laravel/scaffold-boundary.yaml +23 -0
  991. templates/laravel/skills/laravel/SKILL.md +56 -0
  992. templates/laravel/skills/laravel/references/anatomy.md +65 -0
  993. templates/laravel/stack.yaml +66 -0
  994. templates/meta/rules/graph-first.md +27 -0
  995. templates/meta/rules/hook-author.md +19 -0
  996. templates/meta/rules/mcp-tool-author.md +18 -0
  997. templates/meta/rules/meta-engineering.md +17 -0
  998. templates/meta/scaffold-boundary.yaml +55 -0
  999. templates/meta/skills/claude-sdk-integration/SKILL.md +163 -0
  1000. templates/meta/skills/claude-sdk-integration/assets/sdk-checklist.md +27 -0
  1001. templates/meta/skills/claude-sdk-integration/scripts/check_model_ids.py +97 -0
  1002. templates/meta/skills/graph-os-authoring/SKILL.md +278 -0
  1003. templates/meta/skills/graph-os-authoring/assets/graph-os-checklist.md +25 -0
  1004. templates/meta/skills/graph-os-authoring/scripts/new_extractor.py +76 -0
  1005. templates/meta/skills/hook-authoring/SKILL.md +292 -0
  1006. templates/meta/skills/hook-authoring/assets/hook-checklist.md +30 -0
  1007. templates/meta/skills/hook-authoring/scripts/new_hook.sh +75 -0
  1008. templates/meta/skills/mcp-tool-authoring/SKILL.md +301 -0
  1009. templates/meta/skills/mcp-tool-authoring/assets/mcp-tool-checklist.md +29 -0
  1010. templates/meta/skills/mcp-tool-authoring/scripts/new_tool.py +74 -0
  1011. templates/meta/skills/meta-engineering/SKILL.md +151 -0
  1012. templates/meta/skills/meta-engineering/assets/meta-edit-checklist.md +28 -0
  1013. templates/meta/skills/meta-engineering/scripts/which_layer.py +61 -0
  1014. templates/meta/skills/python-meta-server/SKILL.md +162 -0
  1015. templates/meta/skills/python-meta-server/assets/meta-server-checklist.md +28 -0
  1016. templates/meta/skills/python-meta-server/scripts/check_envelope.py +91 -0
  1017. templates/meta/skills/react-vite-hub/SKILL.md +140 -0
  1018. templates/meta/skills/react-vite-hub/assets/hub-ui-checklist.md +23 -0
  1019. templates/meta/skills/react-vite-hub/scripts/check_vite_env.py +73 -0
  1020. templates/meta/stack.yaml +119 -0
  1021. templates/nestjs/rules/backend.md +20 -0
  1022. templates/nestjs/scaffold/docs/engineering/nestjs-rules.md +33 -0
  1023. templates/nestjs/scaffold/docs/playbooks/nestjs-service.md +39 -0
  1024. templates/nestjs/scaffold/src/backend/nest-cli.json +5 -0
  1025. templates/nestjs/scaffold/src/backend/package.json +28 -0
  1026. templates/nestjs/scaffold/src/backend/src/app.module.ts +9 -0
  1027. templates/nestjs/scaffold/src/backend/src/common/all-exceptions.filter.ts +59 -0
  1028. templates/nestjs/scaffold/src/backend/src/health/health.controller.ts +14 -0
  1029. templates/nestjs/scaffold/src/backend/src/health/health.module.ts +10 -0
  1030. templates/nestjs/scaffold/src/backend/src/health/health.service.spec.ts +21 -0
  1031. templates/nestjs/scaffold/src/backend/src/health/health.service.ts +9 -0
  1032. templates/nestjs/scaffold/src/backend/src/main.ts +26 -0
  1033. templates/nestjs/scaffold/src/backend/tsconfig.json +16 -0
  1034. templates/nestjs/scaffold/src/backend/vitest.config.ts +9 -0
  1035. templates/nestjs/scaffold-boundary.yaml +25 -0
  1036. templates/nestjs/skills/nestjs/SKILL.md +67 -0
  1037. templates/nestjs/skills/nestjs/references/anatomy.md +65 -0
  1038. templates/nestjs/stack.yaml +68 -0
  1039. templates/nextjs/rules/frontend.md +18 -0
  1040. templates/nextjs/scaffold/docs/design/00-index.md +23 -0
  1041. templates/nextjs/scaffold/docs/design/colors-tokens.md +141 -0
  1042. templates/nextjs/scaffold/docs/design/components-patterns.md +159 -0
  1043. templates/nextjs/scaffold/docs/design/motion-accessibility.md +137 -0
  1044. templates/nextjs/scaffold/docs/design/typography-spacing.md +107 -0
  1045. templates/nextjs/scaffold/docs/engineering/accessibility-web.md +56 -0
  1046. templates/nextjs/scaffold/docs/engineering/copywriting-standard.md +102 -0
  1047. templates/nextjs/scaffold/docs/engineering/formatting-rules.md +89 -0
  1048. templates/nextjs/scaffold/docs/engineering/frontend-rendering-rules.md +80 -0
  1049. templates/nextjs/scaffold/docs/engineering/frontend-rules.md +183 -0
  1050. templates/nextjs/scaffold/docs/engineering/i18n-policy.md +99 -0
  1051. templates/nextjs/scaffold/docs/pages-content-spec/00-index.md +78 -0
  1052. templates/nextjs/scaffold/docs/playbooks/content-seo.md +55 -0
  1053. templates/nextjs/scaffold/docs/playbooks/docs-governance.md +51 -0
  1054. templates/nextjs/scaffold/docs/playbooks/frontend-ui.md +63 -0
  1055. templates/nextjs/scaffold/src/frontend/app/layout.tsx +14 -0
  1056. templates/nextjs/scaffold/src/frontend/app/page.tsx +3 -0
  1057. templates/nextjs/scaffold/src/frontend/eslint.config.js +17 -0
  1058. templates/nextjs/scaffold/src/frontend/lib/greeting.test.ts +9 -0
  1059. templates/nextjs/scaffold/src/frontend/lib/greeting.ts +3 -0
  1060. templates/nextjs/scaffold/src/frontend/package.json +28 -0
  1061. templates/nextjs/scaffold/src/frontend/tsconfig.json +18 -0
  1062. templates/nextjs/scaffold/src/frontend/vitest.config.ts +10 -0
  1063. templates/nextjs/scaffold-boundary.yaml +30 -0
  1064. templates/nextjs/skills/nextjs-react/SKILL.md +485 -0
  1065. templates/nextjs/skills/nextjs-react/references/anatomy.md +116 -0
  1066. templates/nextjs/skills/nextjs-react/scripts/new_component.py +72 -0
  1067. templates/nextjs/stack.yaml +81 -0
  1068. templates/node-express/rules/backend.md +20 -0
  1069. templates/node-express/scaffold/docs/engineering/express-rules.md +30 -0
  1070. templates/node-express/scaffold/docs/playbooks/express-service.md +35 -0
  1071. templates/node-express/scaffold/src/backend/package.json +24 -0
  1072. templates/node-express/scaffold/src/backend/src/index.ts +17 -0
  1073. templates/node-express/scaffold/src/backend/src/middleware/error-handler.ts +12 -0
  1074. templates/node-express/scaffold/src/backend/src/routes/health.test.ts +33 -0
  1075. templates/node-express/scaffold/src/backend/src/routes/health.ts +7 -0
  1076. templates/node-express/scaffold/src/backend/tsconfig.json +15 -0
  1077. templates/node-express/scaffold/src/backend/types/express-bootstrap.d.ts +21 -0
  1078. templates/node-express/scaffold-boundary.yaml +25 -0
  1079. templates/node-express/skills/node-express/SKILL.md +70 -0
  1080. templates/node-express/skills/node-express/references/anatomy.md +63 -0
  1081. templates/node-express/stack.yaml +63 -0
  1082. templates/python/scaffold/docs/engineering/python-rules.md +27 -0
  1083. templates/python/scaffold/docs/playbooks/python-library.md +35 -0
  1084. templates/python/stack.yaml +60 -0
  1085. templates/rails/rules/backend.md +10 -0
  1086. templates/rails/scaffold/docs/engineering/rails-rules.md +33 -0
  1087. templates/rails/scaffold/docs/playbooks/rails-service.md +42 -0
  1088. templates/rails/scaffold/src/backend/Gemfile +12 -0
  1089. templates/rails/scaffold/src/backend/app/controllers/application_controller.rb +26 -0
  1090. templates/rails/scaffold/src/backend/app/controllers/health_controller.rb +6 -0
  1091. templates/rails/scaffold/src/backend/app/models/health.rb +6 -0
  1092. templates/rails/scaffold/src/backend/config/application.rb +12 -0
  1093. templates/rails/scaffold/src/backend/config/boot.rb +3 -0
  1094. templates/rails/scaffold/src/backend/config/routes.rb +4 -0
  1095. templates/rails/scaffold/src/backend/config.ru +5 -0
  1096. templates/rails/scaffold/src/backend/spec/rails_helper.rb +18 -0
  1097. templates/rails/scaffold/src/backend/spec/requests/health_spec.rb +24 -0
  1098. templates/rails/scaffold-boundary.yaml +25 -0
  1099. templates/rails/skills/rails/SKILL.md +62 -0
  1100. templates/rails/skills/rails/references/anatomy.md +71 -0
  1101. templates/rails/stack.yaml +72 -0
  1102. templates/react-native/rules/mobile.md +26 -0
  1103. templates/react-native/scaffold/docs/engineering/accessibility-mobile.md +95 -0
  1104. templates/react-native/scaffold/docs/engineering/mobile-rules.md +56 -0
  1105. templates/react-native/scaffold/docs/engineering/offline-first.md +61 -0
  1106. templates/react-native/scaffold/docs/playbooks/mobile-app.md +49 -0
  1107. templates/react-native/scaffold/src/mobile/App.tsx +9 -0
  1108. templates/react-native/scaffold/src/mobile/eslint.config.js +17 -0
  1109. templates/react-native/scaffold/src/mobile/package.json +23 -0
  1110. templates/react-native/scaffold/src/mobile/src/greeting.test.ts +9 -0
  1111. templates/react-native/scaffold/src/mobile/src/greeting.ts +3 -0
  1112. templates/react-native/scaffold/src/mobile/tsconfig.json +17 -0
  1113. templates/react-native/scaffold/src/mobile/vitest.config.ts +10 -0
  1114. templates/react-native/scaffold-boundary.yaml +30 -0
  1115. templates/react-native/skills/react-native-mobile/SKILL.md +119 -0
  1116. templates/react-native/skills/react-native-mobile/assets/rn-mobile-checklist.md +28 -0
  1117. templates/react-native/skills/react-native-mobile/references/anatomy.md +140 -0
  1118. templates/react-native/skills/react-native-mobile/references/rn-2026-practices.md +54 -0
  1119. templates/react-native/skills/react-native-mobile/scripts/new_screen.py +73 -0
  1120. templates/react-native/skills/react-native-mobile/versions.json +16 -0
  1121. templates/react-native/skills/react-native-patterns/SKILL.md +512 -0
  1122. templates/react-native/skills/react-native-patterns/assets/rn-review-checklist.md +26 -0
  1123. templates/react-native/skills/react-native-patterns/references/anatomy.md +62 -0
  1124. templates/react-native/skills/react-native-patterns/references/list-performance.md +70 -0
  1125. templates/react-native/skills/react-native-patterns/scripts/scan_rn_perf.py +77 -0
  1126. templates/react-native/stack.yaml +70 -0
  1127. templates/ruby-plain/scaffold/src/backend/Gemfile +8 -0
  1128. templates/ruby-plain/scaffold/src/backend/main.rb +3 -0
  1129. templates/ruby-plain/scaffold-boundary.yaml +23 -0
  1130. templates/ruby-plain/stack.yaml +50 -0
  1131. templates/rust-axum/rules/backend.md +20 -0
  1132. templates/rust-axum/scaffold/docs/engineering/rust-axum-rules.md +35 -0
  1133. templates/rust-axum/scaffold/docs/playbooks/rust-axum-service.md +43 -0
  1134. templates/rust-axum/scaffold/src/backend/Cargo.toml +20 -0
  1135. templates/rust-axum/scaffold/src/backend/src/app.rs +12 -0
  1136. templates/rust-axum/scaffold/src/backend/src/error.rs +48 -0
  1137. templates/rust-axum/scaffold/src/backend/src/main.rs +24 -0
  1138. templates/rust-axum/scaffold/src/backend/src/routes/health.rs +37 -0
  1139. templates/rust-axum/scaffold/src/backend/src/routes/mod.rs +2 -0
  1140. templates/rust-axum/scaffold-boundary.yaml +25 -0
  1141. templates/rust-axum/skills/rust/SKILL.md +73 -0
  1142. templates/rust-axum/skills/rust/references/anatomy.md +63 -0
  1143. templates/rust-axum/stack.yaml +65 -0
  1144. templates/rust-plain/scaffold/src/backend/Cargo.toml +6 -0
  1145. templates/rust-plain/scaffold/src/backend/src/main.rs +3 -0
  1146. templates/rust-plain/scaffold-boundary.yaml +23 -0
  1147. templates/rust-plain/stack.yaml +51 -0
  1148. templates/spring-boot/rules/backend.md +20 -0
  1149. templates/spring-boot/scaffold/docs/engineering/spring-boot-rules.md +35 -0
  1150. templates/spring-boot/scaffold/docs/playbooks/spring-boot-service.md +45 -0
  1151. templates/spring-boot/scaffold/src/backend/mvnw +302 -0
  1152. templates/spring-boot/scaffold/src/backend/pom.xml +69 -0
  1153. templates/spring-boot/scaffold/src/backend/src/main/java/com/example/app/Application.java +16 -0
  1154. templates/spring-boot/scaffold/src/backend/src/main/java/com/example/app/common/GlobalExceptionHandler.java +31 -0
  1155. templates/spring-boot/scaffold/src/backend/src/main/java/com/example/app/health/HealthController.java +22 -0
  1156. templates/spring-boot/scaffold/src/backend/src/main/java/com/example/app/health/HealthService.java +12 -0
  1157. templates/spring-boot/scaffold/src/backend/src/main/java/com/example/app/health/HealthStatus.java +4 -0
  1158. templates/spring-boot/scaffold/src/backend/src/test/java/com/example/app/health/HealthServiceTest.java +15 -0
  1159. templates/spring-boot/scaffold-boundary.yaml +26 -0
  1160. templates/spring-boot/skills/spring-boot/SKILL.md +84 -0
  1161. templates/spring-boot/skills/spring-boot/references/anatomy.md +63 -0
  1162. templates/spring-boot/stack.yaml +65 -0
  1163. templates/svelte-sveltekit/rules/frontend.md +20 -0
  1164. templates/svelte-sveltekit/scaffold/docs/engineering/svelte-sveltekit-rules.md +37 -0
  1165. templates/svelte-sveltekit/scaffold/docs/playbooks/svelte-sveltekit-app.md +36 -0
  1166. templates/svelte-sveltekit/scaffold/src/frontend/package.json +22 -0
  1167. templates/svelte-sveltekit/scaffold/src/frontend/src/app.html +12 -0
  1168. templates/svelte-sveltekit/scaffold/src/frontend/src/hooks.server.ts +14 -0
  1169. templates/svelte-sveltekit/scaffold/src/frontend/src/lib/components/Greeting.svelte +6 -0
  1170. templates/svelte-sveltekit/scaffold/src/frontend/src/lib/stores/count.test.ts +26 -0
  1171. templates/svelte-sveltekit/scaffold/src/frontend/src/lib/stores/count.ts +4 -0
  1172. templates/svelte-sveltekit/scaffold/src/frontend/src/routes/+layout.svelte +24 -0
  1173. templates/svelte-sveltekit/scaffold/src/frontend/src/routes/+page.svelte +9 -0
  1174. templates/svelte-sveltekit/scaffold/src/frontend/src/routes/+page.ts +7 -0
  1175. templates/svelte-sveltekit/scaffold/src/frontend/src/routes/health/+server.ts +7 -0
  1176. templates/svelte-sveltekit/scaffold/src/frontend/svelte.config.js +10 -0
  1177. templates/svelte-sveltekit/scaffold/src/frontend/tsconfig.json +7 -0
  1178. templates/svelte-sveltekit/scaffold/src/frontend/vite.config.ts +7 -0
  1179. templates/svelte-sveltekit/scaffold/src/frontend/vitest.config.ts +11 -0
  1180. templates/svelte-sveltekit/scaffold-boundary.yaml +29 -0
  1181. templates/svelte-sveltekit/skills/svelte/SKILL.md +90 -0
  1182. templates/svelte-sveltekit/skills/svelte/references/anatomy.md +62 -0
  1183. templates/svelte-sveltekit/stack.yaml +70 -0
  1184. templates/typescript-plain/scaffold/src/index.ts +3 -0
  1185. templates/typescript-plain/scaffold/tsconfig.json +13 -0
  1186. templates/typescript-plain/scaffold-boundary.yaml +22 -0
  1187. templates/typescript-plain/stack.yaml +44 -0
  1188. templates/vue-nuxt/rules/frontend.md +19 -0
  1189. templates/vue-nuxt/scaffold/docs/engineering/nuxt-rules.md +30 -0
  1190. templates/vue-nuxt/scaffold/docs/playbooks/nuxt-app.md +29 -0
  1191. templates/vue-nuxt/scaffold/src/frontend/app.vue +3 -0
  1192. templates/vue-nuxt/scaffold/src/frontend/nuxt.config.ts +11 -0
  1193. templates/vue-nuxt/scaffold/src/frontend/package.json +20 -0
  1194. templates/vue-nuxt/scaffold/src/frontend/pages/index.test.ts +19 -0
  1195. templates/vue-nuxt/scaffold/src/frontend/pages/index.vue +11 -0
  1196. templates/vue-nuxt/scaffold/src/frontend/vitest.config.ts +12 -0
  1197. templates/vue-nuxt/scaffold-boundary.yaml +26 -0
  1198. templates/vue-nuxt/skills/vue-nuxt/SKILL.md +57 -0
  1199. templates/vue-nuxt/skills/vue-nuxt/references/anatomy.md +60 -0
  1200. templates/vue-nuxt/stack.yaml +61 -0
  1201. templates/wordpress/rules/backend.md +19 -0
  1202. templates/wordpress/scaffold/docs/engineering/wordpress-rules.md +28 -0
  1203. templates/wordpress/scaffold/docs/playbooks/wordpress-service.md +29 -0
  1204. templates/wordpress/scaffold/src/backend/composer.json +17 -0
  1205. templates/wordpress/scaffold/src/backend/phpcs.xml.dist +11 -0
  1206. templates/wordpress/scaffold/src/backend/phpunit.xml +10 -0
  1207. templates/wordpress/scaffold/src/backend/plugin/inc/health.php +8 -0
  1208. templates/wordpress/scaffold/src/backend/plugin/plugin.php +28 -0
  1209. templates/wordpress/scaffold/src/backend/tests/HealthStatusTest.php +15 -0
  1210. templates/wordpress/scaffold/src/backend/theme/functions.php +18 -0
  1211. templates/wordpress/scaffold/src/backend/theme/style.css +11 -0
  1212. templates/wordpress/scaffold-boundary.yaml +23 -0
  1213. templates/wordpress/skills/wordpress/SKILL.md +110 -0
  1214. templates/wordpress/skills/wordpress/assets/wp-checklist.md +28 -0
  1215. templates/wordpress/skills/wordpress/references/wp-development.md +75 -0
  1216. templates/wordpress/skills/wordpress/references/wp-security.md +68 -0
  1217. templates/wordpress/skills/wordpress/scripts/scan_wp_smells.py +91 -0
  1218. templates/wordpress/skills/wordpress/versions.json +16 -0
  1219. templates/wordpress/stack.yaml +60 -0
  1220. thinking_os/__init__.py +1 -0
  1221. thinking_os/_agent_markers.py +32 -0
  1222. thinking_os/background.py +405 -0
  1223. thinking_os/bootstrap_outcomes.py +200 -0
  1224. thinking_os/budget.py +302 -0
  1225. thinking_os/capture.py +495 -0
  1226. thinking_os/cognition.py +516 -0
  1227. thinking_os/cognition_schemas.py +517 -0
  1228. thinking_os/compress.py +192 -0
  1229. thinking_os/concepts.py +233 -0
  1230. thinking_os/dashboard.py +159 -0
  1231. thinking_os/database.py +2883 -0
  1232. thinking_os/decay.py +393 -0
  1233. thinking_os/digest.py +295 -0
  1234. thinking_os/dispatcher.py +192 -0
  1235. thinking_os/dispatcher_helpers.py +48 -0
  1236. thinking_os/dispatchers/__init__.py +3 -0
  1237. thinking_os/dispatchers/default.py +47 -0
  1238. thinking_os/distill.py +192 -0
  1239. thinking_os/doc_indexer.py +905 -0
  1240. thinking_os/embeddings.py +943 -0
  1241. thinking_os/formula_composer.py +556 -0
  1242. thinking_os/gate_marker.py +75 -0
  1243. thinking_os/graph.py +296 -0
  1244. thinking_os/graph_indexer.py +360 -0
  1245. thinking_os/health_check.py +517 -0
  1246. thinking_os/impact.py +119 -0
  1247. thinking_os/memory_gc.py +356 -0
  1248. thinking_os/migrator_embeddings.py +318 -0
  1249. thinking_os/precision.py +194 -0
  1250. thinking_os/record_outcome.py +399 -0
  1251. thinking_os/repair.py +105 -0
  1252. thinking_os/retrieval_quality.py +239 -0
  1253. thinking_os/roles_state.py +168 -0
  1254. thinking_os/sanitizer.py +320 -0
  1255. thinking_os/server.py +3160 -0
  1256. thinking_os/session_enrich.py +272 -0
  1257. thinking_os/session_observe_worker.py +111 -0
  1258. thinking_os/session_startup.py +74 -0
  1259. thinking_os/session_summary.py +245 -0
  1260. thinking_os/task_analyzer.py +462 -0
  1261. thinking_os/task_parser.py +342 -0
  1262. thinking_os/task_sync.py +73 -0
  1263. thinking_os/tools/__init__.py +6 -0
  1264. thinking_os/tools/_shared.py +947 -0
  1265. thinking_os/tools/cognition.py +1867 -0
  1266. thinking_os/tools/docs.py +770 -0
  1267. thinking_os/tools/learning.py +2078 -0
  1268. thinking_os/tools/logs.py +79 -0
  1269. thinking_os/tools/memory.py +840 -0
  1270. thinking_os/tools/metrics.py +200 -0
  1271. thinking_os/tools/retrieve.py +415 -0
  1272. thinking_os/tools/routing.py +658 -0
  1273. thinking_os/tools/tasks.py +449 -0
  1274. thinking_os/tools/trajectory.py +181 -0
  1275. thinking_os/tracing.py +235 -0
  1276. web/__init__.py +5 -0
  1277. web/_cache.py +118 -0
  1278. web/_deps.py +56 -0
  1279. web/_envelope.py +85 -0
  1280. web/_project_context.py +140 -0
  1281. web/chat_providers.py +108 -0
  1282. web/init_jobs.py +216 -0
  1283. web/routes/__init__.py +25 -0
  1284. web/routes/_bounded_read.py +76 -0
  1285. web/routes/board.py +1089 -0
  1286. web/routes/cognition.py +1838 -0
  1287. web/routes/config.py +635 -0
  1288. web/routes/graph.py +513 -0
  1289. web/routes/health.py +180 -0
  1290. web/routes/hooks.py +288 -0
  1291. web/routes/hub.py +1219 -0
  1292. web/routes/logs.py +374 -0
  1293. web/routes/metrics.py +43 -0
  1294. web/routes/observability.py +400 -0
  1295. web/routes/patterns.py +227 -0
  1296. web/routes/presence.py +609 -0
  1297. web/routes/roles.py +446 -0
  1298. web/routes/scheduled.py +261 -0
  1299. web/routes/search.py +238 -0
  1300. web/routes/sessions.py +220 -0
  1301. web/routes/settings.py +363 -0
  1302. web/routes/stream.py +547 -0
  1303. web/security.py +157 -0
  1304. web/server.py +283 -0
@@ -0,0 +1,1449 @@
1
+ <!-- domain:ALL | layer:reference | ssot:true | updated:2026-04-06 -->
2
+ # Thinking OS — Final Edition
3
+
4
+ > Nav: [Docs Index](../../docs/00-index.md)
5
+
6
+ Purpose: Comprehensive reference for the Thinking OS cognitive methodology — Cynefin Complexity Gate, Zoom cycles, dimension mapping, and 10 thinking tools.
7
+ Read when: Onboarding to Thinking OS, designing the methodology, or studying the full theoretical framework.
8
+ Skip when: Already familiar — use the kernel rule in `src/core/rules/thinking_os.md` instead.
9
+ Read next: `src/core/skills/thinking_os/SKILL.md` for the executable workflow.
10
+
11
+ ### A Cognitive Operating System for Genius-Level Problem Solving
12
+
13
+ ---
14
+
15
+ > **This is not a formula. It's a mind.**
16
+ >
17
+ > A formula says "do step 1, then step 2."
18
+ > A mind sees the whole, decides where to go deep,
19
+ > goes deep, comes back, checks what changed, adapts.
20
+ >
21
+ > That's the difference between a junior and a genius.
22
+
23
+ ---
24
+
25
+ ## Architecture
26
+
27
+ ```
28
+ ┌─────────────────────────────────────────────────────┐
29
+ │ KERNEL — The Decision-Making Mind │
30
+ │ Classifies problems, assigns depth, routes tools, │
31
+ │ runs the Zoom cycle, triggers reframes │
32
+ ├─────────────────────────────────────────────────────┤
33
+ │ PROCESS MANAGER — The Coverage Guardian │
34
+ │ Maintains Dimension Map, tracks progress, │
35
+ │ enforces consistency, logs assumptions │
36
+ │ (data provider to Kernel — Kernel decides, │
37
+ │ Process Manager informs) │
38
+ ├─────────────────────────────────────────────────────┤
39
+ │ MEMORY — Experience & Knowledge (future layer) │
40
+ │ Patterns, lessons, past mistakes, project context │
41
+ │ Searched automatically before every Kernel decision │
42
+ ├─────────────────────────────────────────────────────┤
43
+ │ APPS — 10 Thinking Tools │
44
+ │ Called by Kernel on whichever dimension, │
45
+ │ at whatever depth, in whatever order needed │
46
+ └─────────────────────────────────────────────────────┘
47
+ ```
48
+
49
+ **Key boundary:** Kernel is the decision-maker. Process Manager is the
50
+ data provider. Kernel asks "what should I do next?" Process Manager
51
+ answers "here's what's done, pending, and inconsistent." Kernel decides.
52
+
53
+ **Memory (Designed, implementation in v4):** Three types planned —
54
+ Procedural (how I did it), Semantic (what I know), Episodic (what I
55
+ experienced). SQLite + embedding search. Confidence scores: validated /
56
+ observed / assumed. Orient step already has Memory Check placeholder —
57
+ when Memory layer is implemented, Orient will auto-search before
58
+ every Zoom In. Thinking OS works without Memory; Memory makes it wiser.
59
+
60
+ ---
61
+
62
+ ## The Kernel
63
+
64
+ The Kernel runs a continuous **Zoom cycle** with **System Sketch**,
65
+ **Orient** step (from John Boyd's OODA Loop), and **Stakeholder
66
+ Checkpoint**, and makes six types of decisions:
67
+
68
+ ```
69
+ ┌──────────────┐
70
+ │ ZOOM OUT │ → See the whole picture
71
+ │ │ Classify, decompose, prioritize
72
+ └──────┬───────┘
73
+
74
+
75
+ ┌──────────────┐
76
+ │ SYSTEM SKETCH│ → Quick breadth-first pass (first cycle only) ← NEW
77
+ │ │ "What does the whole system look like?"
78
+ │ │ Rough map of ALL dimensions before going deep
79
+ └──────┬───────┘
80
+
81
+
82
+ ┌──────────────┐
83
+ │ ORIENT │ → Update your mental model
84
+ │ │ "Has my understanding changed?"
85
+ │ │ "What do I know now that I didn't before?"
86
+ │ │ This is where experience/intuition speaks
87
+ └──────┬───────┘
88
+
89
+
90
+ ┌──────────────────┐
91
+ │ STAKEHOLDER CHECK│ → Confirm plan before going deep ← NEW
92
+ │ (first cycle) │ "Here's my plan. Does this match
93
+ │ │ what you need?"
94
+ └──────┬───────────┘
95
+
96
+
97
+ ┌──────────────┐
98
+ │ ZOOM IN │ → Go deep on ONE dimension
99
+ │ │ Select tools, set depth, execute
100
+ └──────┬───────┘
101
+
102
+
103
+ ┌──────────────┐
104
+ │ ZOOM OUT │ → Come back up and check
105
+ │ │ Coverage, consistency, what's next
106
+ └──────┬───────┘
107
+
108
+
109
+ ┌──────────────┐
110
+ │ ORIENT │ → Update mental model again
111
+ └──────┬───────┘
112
+
113
+
114
+ (repeat Zoom In → Zoom Out → Orient
115
+ until all dimensions covered
116
+ or max 3 full cycles reached)
117
+ ```
118
+
119
+ **Why Orient matters (from OODA Loop, John Boyd 1960s):**
120
+ Boyd argued that Orient is the most critical step — not Observe
121
+ or Decide. Orient is the moment where you UPDATE YOUR UNDERSTANDING
122
+ of the situation based on what you've learned. Without it, you keep
123
+ acting on stale mental models. In Thinking OS, Orient happens twice:
124
+ between Zoom Out and Zoom In (before going deep), and as part of
125
+ Zoom Out (after coming back up). It's the "flash" where accumulated
126
+ knowledge reshapes how you see the problem.
127
+
128
+ ---
129
+
130
+ ### Kernel Decision 1: Complexity Gate
131
+
132
+ Before anything else, classify the problem using two questions.
133
+
134
+ **Question 1 — What is the nature of this problem?**
135
+
136
+ Adapted from the Cynefin framework (Dave Snowden, 1999; Harvard
137
+ Business Review, 2007). Cynefin classifies problems by the relationship
138
+ between cause and effect:
139
+
140
+ ```
141
+ CLEAR
142
+ I know the input, I know the output, I know how to get there.
143
+ → Just do it. No Zoom cycle needed.
144
+
145
+ Signal words: "standard", "CRUD", "same as before", "boilerplate"
146
+ Example: "Write an endpoint that returns a list of blog posts."
147
+ Response: Sense → Categorize → Respond (apply best practice)
148
+
149
+ COMPLICATED
150
+ I know the TYPE of answer needed, but details require analysis.
151
+ → Zoom cycle: light to medium.
152
+
153
+ Signal words: "design", "architect", "implement", "integrate"
154
+ Example: "Design the JWT authentication system with refresh tokens."
155
+ Response: Sense → Analyze → Respond (apply good practice with expertise)
156
+
157
+ COMPLEX
158
+ I don't know the right answer until I test and learn.
159
+ → Zoom cycle: full, with emphasis on Scenarios and prototyping.
160
+ → Activate Experiment Protocol (see below).
161
+
162
+ Signal words: "best way to", "optimize", "user experience", "strategy"
163
+ Example: "What's the best onboarding UX for new blog subscribers?"
164
+ Response: Probe → Sense → Respond (experiment with safe-to-fail probes)
165
+
166
+ EXPERIMENT PROTOCOL (from Scientific Method — activated for Complex):
167
+ When Complexity Gate returns Complex, before full Zoom In:
168
+ 1. HYPOTHESIS: "I believe [X] will work because [Y]."
169
+ 2. SMALLEST TEST: "What's the cheapest/fastest way to test this?"
170
+ (prototype, A/B test, paper mockup, spike, proof-of-concept)
171
+ 3. SUCCESS SIGNAL: "If hypothesis is right, I will see [metric]."
172
+ 4. FAILURE SIGNAL: "If hypothesis is wrong, I will see [metric]."
173
+ 5. TIMEBOX: "I will spend max [time] testing before deciding."
174
+ 6. LEARN: "What did I learn? Update Orient and continue."
175
+
176
+ This prevents spending weeks designing something that could have
177
+ been validated (or killed) in a day with a quick experiment.
178
+
179
+ CHAOTIC
180
+ No time to analyze. Something is broken NOW.
181
+ → Act first, then Zoom cycle afterward to prevent recurrence.
182
+
183
+ Signal words: "down", "broken", "crash", "emergency", "data loss"
184
+ Example: "Production server is down and users can't log in."
185
+ Response: Act → Sense → Respond (stabilize, then analyze)
186
+
187
+ CONFUSION
188
+ I don't know which of the above applies.
189
+ → Break the problem into smaller pieces and classify each piece.
190
+
191
+ Signal: you can't clearly place it in any domain above.
192
+ Response: Decompose → Classify each piece → Proceed per piece.
193
+ ```
194
+
195
+ **Question 2 — How many independent dimensions does this have?**
196
+
197
+ ```
198
+ 1 dimension → Single Zoom In is enough
199
+ Example: "Write a database migration"
200
+
201
+ 2-4 dimensions → Standard Zoom cycle
202
+ Example: "Build a new API endpoint" (Backend + API + maybe Frontend)
203
+
204
+ 5+ dimensions → Full Zoom cycle with Dimension Map
205
+ Example: "Build user system" (Backend + DB + API + Frontend +
206
+ Mobile + Security + SEO + Code Standards)
207
+
208
+ 8+ dimensions → Problem is probably too big. Break into 2+ separate problems
209
+ first, then Thinking OS each one.
210
+ ```
211
+
212
+ **Combined decision matrix:**
213
+
214
+ ```
215
+ │ 1 dim │ 2-4 dim │ 5+ dim
216
+ ────────────────┼───────────────┼─────────────────┼─────────────────
217
+ CLEAR │ Just do it │ Do it, quick │ Rare. If truly
218
+ │ │ checklist │ clear, batch it.
219
+ ────────────────┼───────────────┼─────────────────┼─────────────────
220
+ COMPLICATED │ Single │ Light Zoom │ Full Zoom
221
+ │ Zoom In │ cycle │ cycle
222
+ ────────────────┼───────────────┼─────────────────┼─────────────────
223
+ COMPLEX │ Probe + test │ Zoom cycle │ Full Zoom +
224
+ │ │ + test per dim │ prototype
225
+ ────────────────┼───────────────┼─────────────────┼─────────────────
226
+ CHAOTIC │ Act now │ Act now, Zoom │ Act now, Zoom
227
+ │ │ later │ later
228
+ ────────────────┼───────────────┼─────────────────┼─────────────────
229
+ CONFUSION │ Break it │ Break it │ Break it into
230
+ │ down │ down │ separate problems
231
+ ```
232
+
233
+ ---
234
+
235
+ ### Kernel Decision 2: Zoom Out (See the Whole)
236
+
237
+ **First Zoom Out (before any work):**
238
+
239
+ ```
240
+ 1. IDENTIFY DIMENSIONS
241
+ What are the independent aspects of this problem?
242
+ Each dimension may need different tools at different depths.
243
+
244
+ 2. PRIORITY HEURISTIC — which dimension first?
245
+
246
+ a) DEPENDENCY: Which dimension creates the most dependencies?
247
+ → Build it first. (Usually: data model / core business logic)
248
+
249
+ b) UNCERTAINTY: Which dimension has the most unknowns?
250
+ → Validate it early. (Usually: UX, third-party integrations)
251
+
252
+ c) BOTTLENECK: Which dimension blocks others?
253
+ → Unblock it. (Whatever other dimensions are waiting for)
254
+
255
+ d) EVOLUTION (from Wardley Mapping): Is this dimension novel or commodity?
256
+ → Novel = needs more time and deeper analysis
257
+ → Commodity = use standard solution, don't reinvent
258
+ (Example: JWT auth = commodity, use best practice.
259
+ AI Agent access control = novel, needs deep thinking.)
260
+
261
+ If (a), (b), (c), (d) point to different dimensions,
262
+ prioritize (c) > (a) > (b) > (d).
263
+
264
+ 3. ASSIGN DEPTH per dimension:
265
+
266
+ Deep → Core business logic, security, primary user flows
267
+ Medium → Database schema, API contract, secondary flows
268
+ Light → Code standards, peripheral features, v2 items
269
+
270
+ 4. ASSIGN PHASE per dimension:
271
+
272
+ MVP → "If I removed this, would the system be broken or unsafe?"
273
+ v1 → "Users would complain but survive without this."
274
+ v2 → "Driven by future speculation, not current demand."
275
+
276
+ 5. FLAG UNKNOWNS
277
+ What don't I know? Can I ask? If not, state assumptions
278
+ explicitly and take the ambitious path (cover more),
279
+ then phase into MVP/v1/v2.
280
+ ```
281
+
282
+ **Subsequent Zoom Outs (between dimensions):**
283
+
284
+ ```
285
+ 1. ASK PROCESS MANAGER:
286
+ "What's done? What's pending? What needs revisit?"
287
+ (Process Manager provides data, Kernel decides action)
288
+
289
+ 2. CONSISTENCY CHECK:
290
+ "Does dimension A's output work with dimension B's output?"
291
+ Use the Dependency Matrix to know which pairs to check.
292
+
293
+ 3. CROSS-DIMENSION INSIGHTS:
294
+ "Patterns I should unify? Shared components I'm duplicating?"
295
+
296
+ 4. REFRAME TRIGGER — check if the whole problem needs re-definition:
297
+ "Did I discover that...
298
+ - the original problem was defined wrong?
299
+ - a critical actor was missing from the start?
300
+ - the system boundary needs to change?
301
+ - a fundamental constraint changed?"
302
+ If ANY of these → STOP. Go back to Problem Framing (Tool 1).
303
+ Restart Zoom cycle from scratch with new framing.
304
+
305
+ 5. MAX ITERATION CHECK:
306
+ "Is this my 3rd full Zoom cycle?"
307
+ If yes → deliver output with caveats listing remaining
308
+ uncertainties. Don't loop forever.
309
+
310
+ 6. ROUTE:
311
+ "Which pending dimension is highest priority?"
312
+ → Zoom In on that dimension.
313
+ ```
314
+
315
+ ---
316
+
317
+ ### Kernel Decision 2: System Sketch (First Cycle Only)
318
+
319
+ **Runs once, between first Zoom Out and first Orient.**
320
+
321
+ Before going deep on ANY dimension, draw a rough map of the
322
+ whole system. This prevents the #1 failure mode discovered in
323
+ testing: spending 80% of effort on 1 dimension while 7 others
324
+ get nothing.
325
+
326
+ ```
327
+ WHAT TO SKETCH (keep it rough — 1-2 sentences per dimension):
328
+
329
+ For each dimension identified in Zoom Out:
330
+ 1. PURPOSE: What does this dimension do in the system?
331
+ 2. KEY ENTITIES: What are the main things in this dimension?
332
+ 3. CONNECTIONS: How does it connect to other dimensions?
333
+ 4. RISK SMELL: What's the one thing most likely to go wrong here?
334
+
335
+ FORMAT: A simple map showing all dimensions and their connections.
336
+ Can be text, diagram, or table. Must fit on one page / one screen.
337
+ ```
338
+
339
+ **Example for NakoAI (Content Platform):**
340
+
341
+ ```
342
+ ┌─────────────┐ ┌──────────────┐ ┌────────────┐
343
+ │ Auth & │────→│ Backend Core │────→│ API │
344
+ │ Dual-Actor │ │ (content, │ │ Contract │
345
+ │ (novel!) │ │ voting, │ │ (2 flows: │
346
+ │ │ │ reviews) │ │ human+agent)
347
+ └──────┬───────┘ └──────┬───────┘ └─────┬──────┘
348
+ │ │ │
349
+ ↓ ↓ ↓
350
+ ┌──────────────┐ ┌──────────────┐ ┌────────────┐
351
+ │ Database │ │ Moderation │ │ Frontend │
352
+ │ (states map │ │ (trust-based │ │ (dual-actor│
353
+ │ to fields) │ │ workflow) │ │ UI badges)│
354
+ └──────────────┘ └──────────────┘ └────────────┘
355
+ ```
356
+
357
+ **Why this matters:** The Sketch reveals connections that pure
358
+ dimension listing misses. You see that API Contract needs two
359
+ flows (human + agent) BEFORE you deep-dive into Backend.
360
+ You see that Moderation is connected to Auth (trust system)
361
+ BEFORE you design them separately and discover the overlap later.
362
+
363
+ **Time budget:** Max 10% of total effort on Sketch.
364
+ If you're spending more, you're going too deep — that's Zoom In's job.
365
+
366
+ ---
367
+
368
+ ### Kernel Decision 3: Orient (Update Mental Model)
369
+
370
+ **Runs between every Zoom Out and Zoom In.**
371
+
372
+ Adapted from John Boyd's OODA Loop. Boyd insisted Orient is the
373
+ most important step because "you will always have an understanding
374
+ of the world that is some distance from reality due to bias,
375
+ out-of-date info, and lack of data."
376
+
377
+ ```
378
+ Before each Zoom In, ask:
379
+
380
+ 1. MODEL UPDATE
381
+ "Based on what I just saw in Zoom Out, has my understanding
382
+ of the problem changed?"
383
+ "Do I need to adjust the Dimension Map, priorities, or phases?"
384
+
385
+ 2. EVOLUTION CHECK (from Wardley Mapping)
386
+ "The dimension I'm about to Zoom Into — is it:
387
+ - Novel (never solved before → needs deep original thinking)
388
+ - Emerging (solved by some, no standard → needs research + adaptation)
389
+ - Good Practice (well-known solutions exist → apply with adaptation)
390
+ - Commodity (completely standardized → use off-the-shelf, don't reinvent)"
391
+
392
+ Novel/Emerging → Deep analysis, possibly Experiment Protocol
393
+ Good Practice → Medium analysis, adapt known patterns
394
+ Commodity → Light analysis, use best practice directly
395
+
396
+ 3. MEMORY CHECK (when Memory layer is active)
397
+ "Have I seen a similar dimension/problem before?"
398
+ "What happened last time? What worked? What failed?"
399
+ "What confidence level does that memory have?"
400
+
401
+ 4. BIAS CHECK
402
+ "Am I anchored to my first idea?"
403
+ "Am I avoiding a dimension because it's uncomfortable?"
404
+ "Am I over-engineering because it's interesting?"
405
+ ```
406
+
407
+ **Why this matters:** Without Orient, you Zoom Out (see the picture)
408
+ and immediately Zoom In (start solving). That skips the crucial moment
409
+ where your understanding crystallizes and priorities shift. Orient is
410
+ where the "flash of insight" happens — where accumulated knowledge
411
+ reshapes how you see the next problem.
412
+
413
+ ---
414
+
415
+ ### Kernel Decision 4: Stakeholder Checkpoint (First Cycle Only)
416
+
417
+ **Runs once, after first Orient, before first Zoom In.**
418
+
419
+ Before diving deep, present your plan and get confirmation:
420
+
421
+ ```
422
+ PRESENT TO STAKEHOLDER:
423
+
424
+ 1. "Here's how I understand the problem: [1-2 sentences]"
425
+ 2. "I've identified these dimensions: [list]"
426
+ 3. "My plan is to go deep on [X] first because [reason]"
427
+ 4. "The final deliverable will be: [output format from Q7]"
428
+ 5. "I'm assuming [key assumptions]. Are these correct?"
429
+ 6. "Anything I'm missing or should prioritize differently?"
430
+ ```
431
+
432
+ **Why this matters:** In the NakoAI test, the Agent assumed Backend
433
+ should go first based on dependency analysis. But the stakeholder
434
+ might have said "Agent Orchestration is the core of this product,
435
+ start there." This single checkpoint could redirect the entire analysis.
436
+
437
+ **When to skip:** If stakeholder is unavailable or explicitly said
438
+ "just do it," proceed with stated assumptions and flag them clearly.
439
+
440
+ **For AI Agents:** If the user's prompt is ambiguous about priorities,
441
+ ASK before proceeding. If the prompt is clear and detailed, a brief
442
+ "Here's my plan, proceeding unless you say otherwise" is sufficient.
443
+
444
+ ---
445
+
446
+ ### Kernel Decision 5: Zoom In (Go Deep)
447
+
448
+ ```
449
+ 1. SCOPE THIS DIMENSION
450
+ "What exactly am I solving in THIS dimension?"
451
+ Run Tool 1 (Problem Framing) scoped to this dimension.
452
+
453
+ 2. SELECT TOOLS
454
+ Use the Tool Selection Guide to pick which of the 10 tools
455
+ this dimension needs. If the dimension spans multiple types
456
+ (e.g. Payment Gateway = Core Logic + Security + Interface),
457
+ take the UNION of tools for all applicable types.
458
+
459
+ 3. SELECT DEPTH
460
+ Deep / Medium / Light — assigned during Zoom Out.
461
+
462
+ 4. EXECUTE
463
+ Run selected tools at selected depth.
464
+
465
+ 5. VALIDATE BEFORE ZOOM OUT
466
+ "Did I discover anything that affects other dimensions?
467
+ If yes → flag it for Process Manager."
468
+ "Am I guessing anywhere? Flag it with confidence level."
469
+ "Is my output testable and concrete?"
470
+ ```
471
+
472
+ ---
473
+
474
+ ### Kernel Decision 6: Dimension Dependency Awareness
475
+
476
+ The Kernel uses a dependency matrix to know which dimensions
477
+ affect each other. Without this, consistency checks are guesswork.
478
+
479
+ **Template (filled per project):**
480
+
481
+ ```
482
+ Backend Database API Frontend Mobile Security
483
+ Backend - → → → → ↔
484
+ Database ← - ↑ - - ↑
485
+ API ← ↓ - → → ↔
486
+ Frontend ← - ← - - ↑
487
+ Mobile ← - ← - - ↑
488
+ Security ↔ ↓ ↔ ↓ ↓ -
489
+
490
+ → = outputs to ← = depends on ↔ = bidirectional ↑↓ = constrains
491
+ ```
492
+
493
+ **How it's used:**
494
+ When Backend is completed or changed, Process Manager checks the matrix
495
+ and flags: "API, Frontend, Mobile, Security may need revisit."
496
+ Kernel then decides whether to revisit immediately or defer.
497
+
498
+ ---
499
+
500
+ ## The Process Manager
501
+
502
+ The Process Manager prevents the most dangerous failure:
503
+ **thinking you're done when you're not.**
504
+
505
+ ### It maintains:
506
+
507
+ **1. Dimension Map**
508
+
509
+ ```
510
+ Dimension │ Status │ Depth │ Phase │ Revisit? │ Blocked by
511
+ ─────────────────┼───────────┼────────┼───────┼──────────┼───────────
512
+ Backend Logic │ ✓ Done │ Deep │ MVP │ No │ -
513
+ Database Schema │ ○ Pending │ Medium │ MVP │ - │ Backend
514
+ API Contract │ ○ Pending │ Medium │ MVP │ - │ Backend
515
+ Frontend UX │ ○ Pending │ Deep │ MVP │ - │ API
516
+ Mobile UX │ ○ Pending │ Medium │ v1 │ - │ API
517
+ Security │ ◐ Partial │ Deep │ MVP │ Yes │ Frontend
518
+ SEO │ ○ Pending │ Light │ v1 │ - │ Frontend
519
+ Code Standards │ ○ Pending │ Light │ MVP │ - │ -
520
+ ```
521
+
522
+ **2. Assumption Registry**
523
+
524
+ ```
525
+ # │ Assumption │ Source │ Confidence │ Validated?
526
+ ───┼─────────────────────────────────────────┼────────────┼────────────┼───────────
527
+ 1 │ Email is primary identifier │ Decision │ High │ Yes
528
+ 2 │ All users have valid email │ Assumption │ Medium │ No — test!
529
+ 3 │ Stripe uptime > 99.9% │ External │ High │ Accepted
530
+ 4 │ Mobile and Web share same auth flow │ Assumption │ Medium │ No — verify
531
+ ```
532
+
533
+ **3. Cross-Dimension Conflict Log**
534
+
535
+ ```
536
+ Conflict │ Dim A │ Dim B │ Issue │ Resolved?
537
+ ─────────┼───────────┼──────────┼──────────────────────────────┼──────────
538
+ 1 │ Backend │ Frontend │ Token storage strategy │ No
539
+ │ │ │ Backend says JWT, Frontend │
540
+ │ │ │ needs to decide memory vs │
541
+ │ │ │ HttpOnly cookie │
542
+ ```
543
+
544
+ ### Process Manager Rules:
545
+
546
+ ```
547
+ Rule 1: NO PREMATURE COMPLETION
548
+ Never say "done" while any MVP dimension is ○ Pending.
549
+
550
+ Rule 2: REVISIT ENFORCEMENT
551
+ If a dimension is marked "Needs Revisit" → must be revisited
552
+ before declaring completion.
553
+
554
+ Rule 3: CONSISTENCY GATE
555
+ Before final output, for each pair in Dependency Matrix that
556
+ has → or ↔, verify outputs are compatible.
557
+
558
+ Rule 4: PHASE DISCIPLINE
559
+ All MVP dimensions complete before v1 dimensions start.
560
+ Exception: if a v1 dimension blocks an MVP dimension, pull forward.
561
+
562
+ Rule 5: ASSUMPTION REVIEW
563
+ Before final output, review all assumptions with confidence < High.
564
+ Either validate, ask, or explicitly accept the risk.
565
+
566
+ Rule 6: CONFLICT RESOLUTION
567
+ All items in Conflict Log must be resolved before completion.
568
+
569
+ Rule 7: MANDATORY DOCUMENTATION
570
+ Tool 10 (Record) MUST run before declaring completion.
571
+ Raw analysis is not a deliverable. The output must be
572
+ structured per Q7 (Output Format) from Problem Framing.
573
+ ```
574
+
575
+ ---
576
+
577
+ ## The 10 Thinking Tools (Apps)
578
+
579
+ These are called BY the Kernel, not in fixed order.
580
+
581
+ ---
582
+
583
+ ### Tool 1 — Problem Framing
584
+
585
+ **When:** Starting any new problem or dimension.
586
+
587
+ ```
588
+ 1. PROBLEM: What exactly am I solving? (testable, not vague)
589
+ 2. ACTORS/GOALS: Who is involved, what does each want?
590
+ 3. BOUNDARY: What's inside my control? What's outside?
591
+ Who owns the truth of each piece of data?
592
+ 4. CONSTRAINTS: Time, money, energy, rules, dependencies
593
+ 5. SUCCESS: How do I measure it? (concrete, measurable)
594
+ 6. ASSUMPTIONS: Where am I guessing? Write each one down.
595
+ Hidden assumption = future bug.
596
+ 7. OUTPUT: What should the final deliverable look like?
597
+ (Architecture doc? PRD? Technical spec? Task board?
598
+ API contract? Diagram? Code?)
599
+ This determines how wide and how deep the analysis goes.
600
+ ```
601
+
602
+ First Principles Thinking is embedded here:
603
+ - Q3 prevents naive oversimplification ("user = identity + permission" is wrong;
604
+ user/account/identity/auth/profile/session/consent are separate concepts)
605
+ - Q6 separates fact from belief
606
+
607
+ **Practical First Principles — ask:**
608
+ - "What is the source of truth for this data?"
609
+ - "What events change the state of this thing?"
610
+ - "Am I copying a pattern or solving MY problem?"
611
+
612
+ NOT: "What is a user?" (philosophy)
613
+ BUT: "Who owns the truth of user identity — our DB or the OAuth provider?" (engineering)
614
+
615
+ ---
616
+
617
+ ### Tool 2 — Decompose
618
+
619
+ **When:** A problem or dimension is too big to tackle whole.
620
+
621
+ Break into parts that **don't overlap** and **together cover everything.**
622
+ Can apply at any level — whole problem into dimensions, or one dimension
623
+ into sub-problems.
624
+
625
+ **Two types of decomposition (both needed for complex systems):**
626
+
627
+ ```
628
+ TECHNICAL DECOMPOSITION (how it's built):
629
+ ├── Backend
630
+ ├── Database
631
+ ├── API
632
+ ├── Frontend
633
+ ├── Mobile
634
+ └── Infrastructure
635
+
636
+ DOMAIN DECOMPOSITION (what it's about — from Domain-Driven Design):
637
+ ├── Identity & Auth (user accounts, login, sessions)
638
+ ├── Content Management (posts, comments, media)
639
+ ├── Subscription & Billing (plans, payments, invoices)
640
+ └── Notification (email, push, in-app)
641
+ ```
642
+
643
+ **Why both?** Technical decomposition tells you WHERE code lives.
644
+ Domain decomposition tells you WHERE business logic lives.
645
+ They cross-cut each other: "Subscription" has Backend code AND Frontend
646
+ code AND Database schema. Without domain decomposition, you miss
647
+ business boundaries. Without technical decomposition, you miss
648
+ implementation boundaries.
649
+
650
+ **Domain Decomposition principles (from Eric Evans, DDD 2003):**
651
+ - Each domain boundary (Bounded Context) has its own language and rules
652
+ - "User" in Identity means something different from "User" in Billing
653
+ - Don't force one model to serve all domains
654
+ - Identify which domain owns the truth of each piece of data
655
+
656
+ **Rules:**
657
+ - Each part has a clear membership criterion
658
+ - No item belongs in two parts
659
+ - Nothing important is missing
660
+ - If parts are technical but problem is business-facing → add domain decomposition
661
+ - If parts are domain but problem is implementation → add technical decomposition
662
+
663
+ **This tool does NOT discover behavior, rules, or risks.**
664
+ Those come from Tools 3-6.
665
+
666
+ **Validation:** "Is any item in two buckets? Is any bucket empty?
667
+ Is there a bucket I haven't thought of?
668
+ Do I have BOTH technical AND domain decomposition for complex systems?"
669
+
670
+ ---
671
+
672
+ ### Tool 3 — Behavior Modeling
673
+
674
+ **When:** Something changes over time and has distinct states.
675
+
676
+ **First ask: does this system have independent behavioral dimensions?**
677
+
678
+ ```
679
+ NO independent dimensions → flat state machine is fine (2-4 states, linear)
680
+
681
+ YES independent dimensions → use orthogonal regions
682
+ Example: Subscription has billing_state AND access_state AND user_intent
683
+ Without orthogonal regions: 4×3×3 = 36 flat states (unmanageable)
684
+ With orthogonal regions: 4+3+3 = 10 states in 3 tracks (clear)
685
+
686
+ States share common behavior? → use hierarchical nesting
687
+ Example: "active" and "past_due" both respond to "cancel_requested"
688
+ → make them substates of "subscribed" superstate
689
+ ```
690
+
691
+ **For each transition, record:**
692
+
693
+ ```
694
+ [source_state] → [target_state]
695
+ Event: what triggers it
696
+ Guard: what conditions must be true
697
+ Side Effect: what happens alongside the transition
698
+ Timeout: if time-based, how long
699
+ ```
700
+
701
+ **Validation:**
702
+ - "Is there an impossible state combination?" (e.g. deleted + authenticated)
703
+ - "Is there an event that no state handles?"
704
+ - "Is there a state with no exit transition?" (dead end)
705
+
706
+ Based on David Harel's Statecharts (1987): "A complex system cannot be
707
+ beneficially described in a flat, unstratified fashion."
708
+
709
+ ---
710
+
711
+ ### Tool 4 — Rules Modeling
712
+
713
+ **When:** Multiple conditions combine to produce an outcome.
714
+
715
+ **When to use Decision Table:** 2-5 combinable conditions.
716
+ **When NOT to use:** 6+ binary conditions (2⁶ = 64 rows → table explodes).
717
+ → Split into smaller tables, or use rule engine / policy pattern in code.
718
+
719
+ **Build the table:**
720
+
721
+ ```
722
+ | Condition A | Condition B | Condition C | → Outcome |
723
+ |-------------|-------------|-------------|---------------|
724
+ | Yes | Yes | Yes | → Action 1 |
725
+ | Yes | Yes | No | → Action 2 |
726
+ | Yes | No | * | → Action 3 |
727
+ | No | * | * | → Default |
728
+ ```
729
+
730
+ **Every table must specify:**
731
+ - Default behavior (when no rule matches)
732
+ - Conflict resolution (when two rules match)
733
+
734
+ **Collapse technique:**
735
+ - Remove impossible combinations
736
+ - Merge rows with identical outcomes
737
+ - Use * for "don't care" conditions
738
+
739
+ **Validation:** "Is any combination missing? Are any two rules contradictory?"
740
+
741
+ ---
742
+
743
+ ### Tool 5 — Scenario Modeling
744
+
745
+ **When:** Verifying how real usage flows through the system.
746
+
747
+ **Recommended order:** First Behavior (Tool 3) → then Rules (Tool 4) →
748
+ then Scenarios (here). Each validates the previous.
749
+
750
+ **Three types:**
751
+
752
+ ```
753
+ HAPPY PATH: Everything goes as planned
754
+ ALTERNATE PATH: Valid but non-standard route
755
+ EXCEPTION PATH: Error, edge case, failure
756
+ ```
757
+
758
+ **For each scenario:**
759
+
760
+ ```
761
+ Scenario: [name]
762
+ Trigger: what starts it
763
+ Preconditions: what must be true
764
+ Steps: what happens, in order
765
+ Postconditions: system state after
766
+ User sees: what the human experiences
767
+ System sees: what's logged / stored / changed
768
+ ```
769
+
770
+ **CRITICAL: Run scenarios PER RELEVANT DIMENSION.**
771
+ A Backend scenario is different from a Frontend scenario.
772
+ If the Kernel identified multiple platform dimensions,
773
+ run key scenarios for each one.
774
+
775
+ Example of a cross-dimension scenario most people miss:
776
+ "User's access token expires while they're writing a comment.
777
+ Frontend needs to silently refresh and retry. What does the user see?"
778
+ This scenario only emerges when you run scenarios from the Frontend dimension.
779
+
780
+ **Validation:** "Does every state from Tool 3 appear in at least one scenario?
781
+ Are there exception paths I haven't covered?"
782
+
783
+ ---
784
+
785
+ ### Tool 6 — Risk Pass
786
+
787
+ **When:** Finding what could go wrong before it does.
788
+
789
+ **Four lenses:**
790
+
791
+ ```
792
+ INVERSION: "How would I build the worst version of this?"
793
+ PRE-MORTEM: "It's 6 months later and this failed. Why?"
794
+ THREAT MODELING: "Where would an attacker strike?"
795
+ ABUSE CASES: "How would a bad actor exploit this?"
796
+ ```
797
+
798
+ **Risk categories:**
799
+ Security · Data Integrity · UX Failure · Operational ·
800
+ Legal/Compliance · Abuse/Fraud · Performance/Scaling · Dependency/Vendor
801
+
802
+ **Output: Risk Register**
803
+
804
+ ```
805
+ # │ Risk │ Category │ Severity │ Mitigation │ Phase
806
+ ──┼───────────────────┼───────────┼──────────┼──────────────────────┼──────
807
+ 1 │ JWT secret leaked │ Security │ Critical │ Secret rotation + │ MVP
808
+ │ │ │ │ token blacklist │
809
+ 2 │ Webhook replayed │ Security │ High │ Signature verify + │ MVP
810
+ │ │ │ │ timestamp check │
811
+ ```
812
+
813
+ **This tool discovers risks. It does NOT redesign the system.**
814
+ If a risk reveals a new state, rule, or actor → flag it.
815
+ Kernel will schedule a revisit via Process Manager.
816
+
817
+ ---
818
+
819
+ ### Tool 7 — Second-Order Thinking
820
+
821
+ **When:** Making an important decision with lasting consequences.
822
+
823
+ Ask "And then what?" at least 2 layers deep:
824
+
825
+ ```
826
+ Decision → 1st order → 2nd order → 3rd order
827
+ ```
828
+
829
+ **Don't confuse with Tool 3 (Behavior):**
830
+ - "What happens if we delete an account?" → consequences (here)
831
+ - "From which states is deletion allowed?" → behavior (Tool 3)
832
+
833
+ ---
834
+
835
+ ### Tool 8 — Simplify Without Lying
836
+
837
+ **When:** After divergent thinking (Tools 2-7), before output.
838
+
839
+ **Remove:** Fake complexity, unrealistic scenarios, premature abstractions,
840
+ duplicated concepts, features nobody asked for.
841
+
842
+ **Keep:** Real risks, legal constraints, genuine edge cases,
843
+ domain distinctions that matter.
844
+
845
+ **Phase explicitly:**
846
+
847
+ ```
848
+ MVP: "If removed, system is broken or unsafe"
849
+ v1: "Users complain but survive"
850
+ v2: "Future speculation, not current demand"
851
+ ```
852
+
853
+ **Mark removed items "Deferred" not "Deleted."**
854
+ Deferred = wisdom. Deleted = negligence.
855
+
856
+ **Correct Occam's Razor:** Not "always pick simplest."
857
+ But "when two options are equal in every other way, prefer simpler."
858
+ Simpler today may be technical debt tomorrow — evaluate honestly.
859
+
860
+ **Validation:** "Is there anything I deferred that could cause a
861
+ real problem in MVP? If unsure → keep it."
862
+
863
+ ---
864
+
865
+ ### Tool 9 — Convert to Action
866
+
867
+ **When:** Thinking is done. Time to make it executable.
868
+
869
+ ```
870
+ Action: what to do
871
+ Due: when
872
+ Depends on: what must happen first
873
+ Done when: testable acceptance criteria
874
+ Linked risks: from Tool 6
875
+ Linked states: from Tool 3
876
+ Phase: MVP / v1 / v2
877
+ ```
878
+
879
+ **Without this tool, brilliant analysis produces zero results.**
880
+
881
+ ---
882
+
883
+ ### Tool 10 — Record and Communicate
884
+
885
+ **When:** Output needs to be captured or shared.
886
+
887
+ **Structure (Pyramid Principle):**
888
+ 1. Conclusion first (one sentence)
889
+ 2. Main supporting branches (2-4)
890
+ 3. Details and evidence
891
+
892
+ **Document type (Diátaxis as a lens, not a rigid template):**
893
+ Ask "What need does this serve?"
894
+ - Learning → Tutorial (step-by-step, guided)
895
+ - Doing a task → How-to (practical, problem-oriented)
896
+ - Looking up facts → Reference (dry, complete, structured like the code)
897
+ - Understanding why → Explanation (conceptual, discussion-oriented)
898
+
899
+ Don't mix types. Don't force all 4 for every feature.
900
+ Not every feature needs a tutorial.
901
+
902
+ **Architecture docs (only when documenting system architecture):**
903
+ C4 model: Context → Container → Component → Code.
904
+ If not writing architecture docs → skip.
905
+
906
+ ---
907
+
908
+ ## Tool Selection Guide
909
+
910
+ The Kernel uses this to decide which tools each dimension needs.
911
+ If a dimension spans multiple types, take the **union** of all applicable tools.
912
+
913
+ ```
914
+ Dimension Type │ Essential Tools │ Notes
915
+ ────────────────────────┼─────────────────────────┼──────────────────────
916
+ Core Logic │ 1, 2, 3, 4, 5, 6, 7, 8 │ Full analysis
917
+ (backend, business) │ 9 │
918
+ │ │
919
+ Data / Schema │ 1, 2, 3, 4, 8, 9 │ Behavior = verify
920
+ (database, models) │ │ states map to fields
921
+ │ │
922
+ Interface Contract │ 1, 2, 4, 5, 8, 9 │ Scenarios matter
923
+ (API, protocols) │ │ for contract design
924
+ │ │
925
+ User Experience │ 1, 2, 5, 6, 7, 8, 9 │ Scenarios are king
926
+ (frontend, mobile) │ │ Run per platform!
927
+ │ │
928
+ Security │ 1, 3, 4, 6, 8, 9 │ Risk Pass is king
929
+ (auth, crypto, trust) │ │
930
+ │ │
931
+ Infrastructure │ 1, 2, 6, 8, 9 │ Risk = what breaks
932
+ (deploy, CI/CD, env) │ │ in production
933
+ │ │
934
+ Standards / Style │ 1, 2, 8, 9 │ Lightweight pass
935
+ (naming, patterns) │ │
936
+ │ │
937
+ Content / Marketing │ 1, 2, 5, 7, 8, 9, 10 │ Scenarios + Record
938
+ (SEO, copy, brand) │ │
939
+ ```
940
+
941
+ **Golden Rule scope clarification:**
942
+ "Never start acting before you've separated problem, behavior, rules,
943
+ and risk" applies to **Deep** dimensions. Light dimensions may skip
944
+ behavior and risk if the Complexity Gate confirms low complexity.
945
+
946
+ ---
947
+
948
+ ## Depth Levels
949
+
950
+ ### Deep — Full analysis
951
+
952
+ All selected tools run completely. Every state modeled.
953
+ Every scenario written. Risk pass thorough.
954
+
955
+ **Use for:** Core business logic, security, primary user flows.
956
+
957
+ ### Medium — Focused analysis
958
+
959
+ Tools run on critical paths only. Key states modeled.
960
+ Main scenarios (happy + top 2 exceptions). Quick risk scan.
961
+
962
+ **Use for:** Database schema, API contract, secondary flows.
963
+
964
+ ### Light — Sanity check
965
+
966
+ Problem Framing + Decompose + Simplify only.
967
+ No detailed modeling. Just ensure nothing critical is missed.
968
+
969
+ **Use for:** Code standards, peripheral features, v2 items.
970
+
971
+ ---
972
+
973
+ ## Phase Discipline
974
+
975
+ ```
976
+ MVP — "If removed, system is broken or unsafe"
977
+ All MVP dimensions must complete before v1 starts.
978
+
979
+ v1 — "Users complain but survive"
980
+ Exception: pull v1 forward if it blocks an MVP dimension.
981
+
982
+ v2 — "Future speculation, not current demand"
983
+ Only plan, don't build yet.
984
+ ```
985
+
986
+ ---
987
+
988
+ ## Safety Mechanisms
989
+
990
+ ### Max Iteration Limit
991
+
992
+ Maximum 3 full Zoom cycles. After that, deliver output with
993
+ caveats listing remaining uncertainties. Don't loop forever.
994
+
995
+ ### Max MVP Dimensions
996
+
997
+ If more than 8 MVP dimensions identified, the problem is
998
+ probably too big. Break into 2+ separate problems first.
999
+
1000
+ ### Reframe Trigger
1001
+
1002
+ If during ANY Zoom In, you discover that:
1003
+ - The original problem was defined wrong
1004
+ - A critical actor was missing entirely
1005
+ - The system boundary needs to change
1006
+ - A fundamental constraint changed
1007
+
1008
+ → STOP. Go back to Tool 1. Re-frame the problem. Restart.
1009
+ This is expensive but less expensive than building the wrong thing.
1010
+
1011
+ ---
1012
+
1013
+ ## Complete Zoom Cycle Example
1014
+
1015
+ **Problem: "Build a user system for a blog"**
1016
+
1017
+ ### Complexity Gate
1018
+
1019
+ ```
1020
+ Q1 (Nature): COMPLICATED — I know the type of answer (auth system
1021
+ with roles) but details require analysis.
1022
+ Q2 (Dimensions): 5+ — Backend, Database, API, Frontend, Mobile,
1023
+ Security, SEO, Code Standards = 8 dimensions.
1024
+ → Full Zoom cycle with Dimension Map.
1025
+ ```
1026
+
1027
+ ### Zoom Out #1
1028
+
1029
+ ```
1030
+ Dimensions + Priority + Depth + Phase:
1031
+
1032
+ ├── Backend Logic (MVP, Deep) ← most dependencies, first
1033
+ ├── Database Schema (MVP, Medium) ← depends on Backend
1034
+ ├── API Contract (MVP, Medium) ← depends on Backend
1035
+ ├── Frontend UX (MVP, Deep) ← depends on API
1036
+ ├── Mobile UX (v1, Medium) ← depends on API
1037
+ ├── Security (MVP, Deep) ← bidirectional with Backend
1038
+ ├── SEO (v1, Light) ← depends on Frontend
1039
+ └── Code Standards (MVP, Light) ← no dependencies
1040
+
1041
+ Dependency Matrix built. Assumption Registry initialized.
1042
+ ```
1043
+
1044
+ ### System Sketch
1045
+
1046
+ ```
1047
+ ┌──────────┐ ┌──────────┐ ┌──────────┐
1048
+ │ Auth │────→│ Backend │────→│ API │
1049
+ │ (JWT+ │ │ (content,│ │ (REST, │
1050
+ │ roles) │ │ votes, │ │ OpenAPI)│
1051
+ └────┬─────┘ │ reviews)│ └────┬─────┘
1052
+ │ └────┬─────┘ │
1053
+ ↓ ↓ ┌────┴─────┐
1054
+ ┌──────────┐ ┌──────────┐ │ Frontend │
1055
+ │ Database │ │ Security │ │ (Next.js │
1056
+ │ (PG, │ │ (tokens, │ │ SSR,SEO)│
1057
+ │ states) │ │ limits) │ └──────────┘
1058
+ └──────────┘ └──────────┘
1059
+
1060
+ Risk smells: Auth=commodity, Backend=commodity,
1061
+ API=needs dual format (human+agent), Security=agent rate limits
1062
+ ```
1063
+
1064
+ ### Stakeholder Checkpoint
1065
+
1066
+ ```
1067
+ "Here's my plan:
1068
+ - Problem has 8 dimensions, 6 MVP
1069
+ - Starting with Backend Logic (most dependencies)
1070
+ - Final deliverable: Architecture doc + task breakdown
1071
+ - Assuming standard blog, multi-author, production-grade
1072
+ - Proceed?"
1073
+ → (stakeholder confirms or redirects)
1074
+ ```
1075
+
1076
+ ### Orient #1 (before first Zoom In)
1077
+
1078
+ ```
1079
+ MODEL UPDATE: First time — no prior understanding to update.
1080
+ EVOLUTION CHECK:
1081
+ Backend Logic (auth + roles) → Good Practice (well-known patterns)
1082
+ BUT: AI Agent access control → Emerging (few standard solutions)
1083
+ → Split Backend into two: standard auth (Good Practice, Medium)
1084
+ + AI Agent access (Emerging, Deep)
1085
+ MEMORY CHECK: (Memory not yet active)
1086
+ BIAS CHECK: Am I defaulting to Backend first because I'm comfortable
1087
+ there? → No, Dependency Heuristic confirms it genuinely has most deps.
1088
+
1089
+ → Start with Backend Logic (standard auth part first).
1090
+ ```
1091
+
1092
+ ### Zoom In #1 — Backend Logic (Deep)
1093
+
1094
+ ```
1095
+ Tools selected: 1,2,3,4,5,6,7,8,9
1096
+
1097
+ Tool 1: Frame — actors, boundary, constraints, success metrics
1098
+ Tool 2: Decompose — Registration, Auth, Authorization, Profile, Lifecycle
1099
+ Tool 3: Behavior — Statechart with 3 orthogonal regions
1100
+ (account_state, session_state, role)
1101
+ Hierarchical: active contains {normal, password_reset_pending}
1102
+ Tool 4: Rules — Authorization matrix, registration rules, login rules
1103
+ Tool 5: Scenarios — 5 scenarios (happy + alternate + 3 exceptions)
1104
+ Tool 6: Risk — JWT expiry, email enumeration, IDOR, brute force
1105
+ Tool 7: Consequences — email as identifier, soft delete, grace period
1106
+ Tool 8: Simplify — Social login → Deferred v2. MFA → Deferred v2.
1107
+ Tool 9: Actions — 15+ tasks with acceptance criteria
1108
+
1109
+ Validation: impossible states identified ✓
1110
+ event coverage verified ✓
1111
+ all states appear in scenarios ✓
1112
+ ```
1113
+
1114
+ ### Zoom Out #2
1115
+
1116
+ ```
1117
+ Process Manager reports:
1118
+ ✓ Backend Logic complete
1119
+ ○ Database Schema pending ← next (depends on Backend)
1120
+ ○ API Contract pending
1121
+ ○ Frontend UX pending
1122
+ ○ Mobile UX pending (v1, defer)
1123
+ ◐ Security partial (token storage needs Frontend input)
1124
+ ○ SEO pending (v1, defer)
1125
+ ○ Code Standards pending
1126
+
1127
+ Consistency check:
1128
+ Backend defined 5 roles → all downstream must know about them ✓
1129
+ Backend uses JWT → Frontend needs token lifecycle details → flagged
1130
+
1131
+ Reframe Trigger check: no fundamental changes → continue
1132
+ ```
1133
+
1134
+ ### Orient #2 (before next Zoom In)
1135
+
1136
+ ```
1137
+ MODEL UPDATE: Backend taught me that account lifecycle is more
1138
+ complex than expected (3 orthogonal regions). This means Database
1139
+ Schema needs more careful state mapping than I initially thought.
1140
+ → Upgrade Database Schema from Medium to Deep? No — Medium is
1141
+ sufficient if I verify state mapping as part of Tool 3 in DB.
1142
+ EVOLUTION CHECK: Database Schema → Commodity (standard Django models).
1143
+ → Use best practice patterns, don't overthink.
1144
+ BIAS CHECK: Am I tempted to skip DB and jump to Frontend (more fun)?
1145
+ → Yes. Resist. DB depends on Backend and API depends on DB.
1146
+
1147
+ → Next: Database Schema
1148
+ ```
1149
+
1150
+ ### Zoom In #2 — Database Schema (Medium)
1151
+
1152
+ ```
1153
+ Tools: 1,2,3,4,8,9
1154
+ Verify all Statechart states map to DB fields.
1155
+ Define tables, constraints, indexes, cascade rules.
1156
+ ```
1157
+
1158
+ ### Zoom Out #3
1159
+
1160
+ ```
1161
+ Cross-check: DB cascade on delete = SET NULL on posts.
1162
+ Matches Backend Scenario 4 (GDPR deletion)? ✓
1163
+ → Next: API Contract
1164
+ ```
1165
+
1166
+ ### ...cycle continues...
1167
+
1168
+ ### Final Zoom Out
1169
+
1170
+ ```
1171
+ Process Manager final report:
1172
+
1173
+ All MVP dimensions: ✓ Complete
1174
+ All v1 dimensions: ✓ Planned (not built)
1175
+ Assumptions reviewed: 4 total, 2 validated, 2 accepted with risk
1176
+ Cross-dimension consistency: all checks passed
1177
+ Conflict Log: 0 unresolved
1178
+ Deferred items: 7 items with rationale
1179
+
1180
+ → Ready for implementation.
1181
+ ```
1182
+
1183
+ ---
1184
+
1185
+ ## Quick Reference Card
1186
+
1187
+ ### The Zoom Cycle
1188
+
1189
+ ```
1190
+ CLASSIFY → ZOOM OUT → SKETCH → ORIENT → CHECKPOINT → ZOOM IN → ZOOM OUT → ORIENT → ZOOM IN → ... → DONE
1191
+ (gate) (see) (map) (update) (confirm) (solve) (check) (update) (solve) (verify)
1192
+ ↑ first cycle only ↑ first cycle only
1193
+ ```
1194
+
1195
+ ### Kernel Questions
1196
+
1197
+ ```
1198
+ COMPLEXITY GATE: ZOOM OUT:
1199
+ ├── Nature? (Clear/Complicated/ ├── What dimensions exist?
1200
+ │ Complex/Chaotic/Confusion) ├── What's done, pending, blocked?
1201
+ └── How many dimensions? ├── Any cross-dimension conflicts?
1202
+ ├── Reframe needed?
1203
+ SYSTEM SKETCH (first cycle): ├── Max iterations reached?
1204
+ ├── What does the whole look like? └── What's highest priority next?
1205
+ ├── How do dimensions connect?
1206
+ ├── Where are the risk smells? ZOOM IN:
1207
+ ├── Scope of this dimension?
1208
+ ORIENT: ├── Which tools needed?
1209
+ ├── Has my understanding changed? ├── What depth?
1210
+ ├── Is this dimension novel or ├── Execute tools
1211
+ │ commodity? (Wardley) └── Anything that changes
1212
+ ├── Have I seen this before? other dimensions?
1213
+ │ (Memory, when active)
1214
+ ├── Am I biased toward/against STAKEHOLDER CHECK (first cycle):
1215
+ │ something? (Bias Check) ├── Here's my plan. Correct?
1216
+ └── If Complex → run ├── Right priorities?
1217
+ Experiment Protocol? └── Missing anything?
1218
+ ```
1219
+
1220
+ ### The 10 Tools
1221
+
1222
+ ```
1223
+ 1. Frame — What am I solving? For whom? Limits? Assumptions?
1224
+ 2. Decompose — Break into independent parts, full coverage
1225
+ 3. Behavior — States, events, transitions (orthogonal + hierarchical)
1226
+ 4. Rules — Condition combinations → outcomes (2-5 conditions)
1227
+ 5. Scenarios — Happy, alternate, exception (per dimension!)
1228
+ 6. Risk — Inversion, pre-mortem, threats, abuse
1229
+ 7. Consequences — And then what? 2+ layers deep
1230
+ 8. Simplify — Remove fake complexity. Phase: MVP/v1/v2
1231
+ 9. Act — Tasks with acceptance criteria
1232
+ 10. Record — Conclusion first. Document type: tutorial/howto/ref/explanation
1233
+ ```
1234
+
1235
+ ### Four Laws
1236
+
1237
+ ```
1238
+ GOLDEN RULE:
1239
+ Never start acting (Tool 9) before separating
1240
+ problem, behavior, rules, and risk (Tools 1-6).
1241
+ Applies to Deep dimensions. Light dimensions may skip
1242
+ behavior and risk after Complexity Gate confirms low complexity.
1243
+
1244
+ SEQUENCE RULE:
1245
+ First DIVERGE (Tools 2-7: see everything).
1246
+ Then CONVERGE (Tools 8-10: filter and build).
1247
+ If you converge too early, blind spots survive.
1248
+
1249
+ ZOOM RULE:
1250
+ Zoom Out before first Zoom In.
1251
+ Orient before every Zoom In.
1252
+ Zoom Out between every Zoom In.
1253
+ Never finish without a final Zoom Out.
1254
+
1255
+ EVOLUTION RULE:
1256
+ Don't reinvent what's commodity. Don't shortcut what's novel.
1257
+ Commodity = use best practice, save time for what matters.
1258
+ Novel = go deep, experiment, expect uncertainty.
1259
+ ```
1260
+
1261
+ ### Universal ↔ Engineering Translation
1262
+
1263
+ ```
1264
+ Universal │ Engineering Tool │ Source
1265
+ ─────────────────────────────────┼─────────────────────────────┼──────────────
1266
+ "How does it change?" │ Harel Statechart │ Harel 1987
1267
+ "What conditions → what result?" │ Decision Table │ ISTQB
1268
+ "Independent parts, full cover" │ MECE Issue Tree │ Minto/McKinsey
1269
+ "Business boundaries inside" │ Bounded Contexts │ DDD / Eric Evans
1270
+ "How would I make this fail?" │ Inversion + Pre-Mortem │ Munger/Kahneman
1271
+ "And then what?" │ Second-Order Thinking │ Howard Marks
1272
+ "Remove fake complexity" │ Simplify Without Lying │ Occam (corrected)
1273
+ "Conclusion first" │ Pyramid + Diátaxis │ Minto/Procida
1274
+ "What type of problem?" │ Cynefin Framework │ Snowden 1999
1275
+ "Update my understanding" │ Orient (OODA Loop) │ John Boyd
1276
+ "Is this novel or commodity?" │ Evolution Stage │ Wardley Mapping
1277
+ "I don't know until I test" │ Experiment Protocol │ Scientific Method
1278
+ ```
1279
+
1280
+ ---
1281
+
1282
+ ## Final Edition — All Fixes Applied
1283
+
1284
+ ### From v2 (foundation):
1285
+
1286
+ ```
1287
+ Fix │ Issue │ Solution
1288
+ ────┼────────────────────────────────┼──────────────────────────────
1289
+ 1 │ Kernel/PM role overlap │ PM = data provider, Kernel = decider
1290
+ 2 │ No Complexity Gate │ Cynefin × dimensions matrix
1291
+ 3 │ No Priority Heuristic │ Dependency > Uncertainty > Bottleneck
1292
+ 4 │ No Dependency Matrix │ Template + usage rules
1293
+ 5 │ No Reframe Trigger │ 4 conditions → restart if any true
1294
+ 6 │ Multi-type dimensions │ Tool union for multi-type dims
1295
+ 7 │ No Max Iteration │ 3 cycles max, then deliver with caveats
1296
+ 8 │ No Max MVP dimensions │ 8+ → break into separate problems
1297
+ 9 │ Golden Rule scope unclear │ Applies to Deep, not Light
1298
+ ```
1299
+
1300
+ ### From v3 (new frameworks):
1301
+
1302
+ ```
1303
+ # │ Addition │ Source
1304
+ ───┼──────────────────────────────────┼─────────────────────
1305
+ 10 │ Orient step in Zoom cycle │ OODA Loop (John Boyd)
1306
+ 11 │ Evolution awareness │ Wardley Mapping
1307
+ 12 │ Domain Decomposition │ DDD (Eric Evans)
1308
+ 13 │ Experiment Protocol for Complex │ Scientific Method
1309
+ 14 │ Bias Check in Orient │ Cognitive Psychology
1310
+ ```
1311
+
1312
+ ### Final Edition (from live testing):
1313
+
1314
+ ```
1315
+ # │ Addition │ Why it was missing
1316
+ ───┼──────────────────────────────────┼──────────────────────────────
1317
+ 15 │ System Sketch (breadth-first) │ Without it, 80% effort on 1 dim
1318
+ 16 │ Stakeholder Checkpoint │ Without it, wrong priority path
1319
+ 17 │ Output Format (Q7 in Framing) │ Without it, depth ≠ deliverable need
1320
+ 18 │ Mandatory Tool 10 rule │ Without it, raw analysis not doc
1321
+ ```
1322
+
1323
+ ---
1324
+
1325
+ ## One Sentence
1326
+
1327
+ **Classify the problem, see the whole picture, sketch the system,
1328
+ orient your understanding, confirm the plan, go deep on one part,
1329
+ come back and check, repeat — using the right tools at the right
1330
+ depth, with domain AND technical decomposition, and experiment
1331
+ when the answer isn't knowable in advance.**
1332
+
1333
+ ---
1334
+
1335
+ ## Self-Learning Pipeline (Phase 15 — Implemented)
1336
+
1337
+ The Memory layer is now active. The pipeline is fully wired into hooks — no manual
1338
+ invocation required. Every session automatically contributes to the learning DB.
1339
+
1340
+ ```
1341
+ PIPELINE FLOW (automated):
1342
+
1343
+ Write/Edit tool
1344
+ └─► PostToolUse: capture.py
1345
+ ├─ observations table (file, tool, narrative, impact_score, concepts)
1346
+ └─ concept_graph table (co_edit edges between files edited in same session)
1347
+
1348
+ Session end (Stop hook: session-end.sh)
1349
+ ├─ session_summaries (request from gate, completed from obs, learned from graph)
1350
+ ├─ agent_metrics (domain, complexity, duration — auto-inferred)
1351
+ └─ concept_graph (concept_link edges from concept co-occurrence in obs)
1352
+ └─ decay.py (runs if last decay >7 days — prunes stale learned_patterns)
1353
+
1354
+ cos task-done
1355
+ └─► record_outcome.py → task_outcomes
1356
+ └─ every 10 tasks: cos_learn_extract → learned_patterns + routing_weights
1357
+ ```
1358
+
1359
+ **Narrative generation** (`capture.py`): Each Write/Edit automatically generates a
1360
+ rule-based narrative from the file path — free, instant, no API call:
1361
+
1362
+ - `backend/apps/commerce/models/order.py` → "Modified commerce order model (schema change)"
1363
+ - `frontend/src/app/products/page.tsx` → "Modified frontend app component"
1364
+
1365
+ **Diagnostic tools:**
1366
+
1367
+ ```bash
1368
+ make thinking_os-health # Full health report (DB, hooks, gates, pipeline)
1369
+ python3 .claude/thinking_os/health_check.py --json # JSON output for programmatic use
1370
+ ```
1371
+
1372
+ **Bootstrap tool** (one-time cold-start):
1373
+
1374
+ ```bash
1375
+ python3 .claude/thinking_os/bootstrap_outcomes.py # populate from docs/tasks/
1376
+ python3 .claude/thinking_os/bootstrap_outcomes.py --dry-run # preview only
1377
+ ```
1378
+
1379
+ **10 SQLite tables** (`.claude/thinking_os/coding-os.db`):
1380
+
1381
+ | Table | Populated by | When |
1382
+ | ----------------- | ----------------------------- | ----------------------------- |
1383
+ | observations | capture.py (PostToolUse) | Every Write/Edit |
1384
+ | concept_graph | capture.py + session-end.sh | Every Write/Edit + session end|
1385
+ | session_summaries | session-end.sh | Session end |
1386
+ | agent_metrics | session-end.sh | Session end |
1387
+ | task_outcomes | cos task-done | Task completion |
1388
+ | learned_patterns | cos_learn_extract | Every 10 task_outcomes |
1389
+ | routing_weights | recalculate_weights | Every ~10 outcomes / on drift |
1390
+ | outcome_history | decay.py | Periodic (>7 days) |
1391
+ | schema_version | migrations | Schema upgrades |
1392
+
1393
+ > `routing_weights` is rebuilt from `task_outcomes` but is **not yet read** by `route_model`/`route_skill` — they rank `task_outcomes` directly. Its intended consumer is the multi-model cost-aware ranker (deferred); until that lands the table is a warm pre-aggregation, not a live decision input.
1394
+
1395
+ **MCP tools** (available in Orient Memory Check):
1396
+
1397
+ - `cos_search` — similarity search across observations
1398
+ - `cos_learn_suggest` — route task to best agent/model based on learned patterns
1399
+ - `cos_learn_extract` — extract patterns from recent task_outcomes
1400
+ - `cos_metric_record` — manual metric recording (auto-recorded at session end)
1401
+ - `cos_health` — live health status via MCP
1402
+
1403
+ ---
1404
+
1405
+ ## Future Roadmap
1406
+
1407
+ ```
1408
+ MULTI-AGENT SUPPORT:
1409
+ Shared Dimension Map across agents
1410
+ Merge protocol for parallel work on different dimensions
1411
+ Conflict resolution when two agents' outputs contradict
1412
+
1413
+ MEMORY ENRICHMENT (next):
1414
+ Claude API narrative enrichment via compress.py (batch job, not per-edit)
1415
+ Embedding search: sqlite-vec integration for semantic similarity
1416
+ Cross-session pattern linking: connect patterns across domains
1417
+ ```
1418
+
1419
+ ---
1420
+
1421
+ ## Intellectual Heritage
1422
+
1423
+ ```
1424
+ Framework / Source │ What we took from it
1425
+ ────────────────────────────────┼──────────────────────────────────
1426
+ Metacognition (Cambridge) │ Layer 0 — thinking about thinking
1427
+ Cynefin (Dave Snowden, 1999) │ Complexity Gate — problem classification
1428
+ OODA Loop (John Boyd, 1960s) │ Orient step — mental model update
1429
+ MECE (Barbara Minto, McKinsey) │ Tool 2 — non-overlapping decomposition
1430
+ Pyramid Principle (Minto) │ Tool 10 — conclusion-first writing
1431
+ Domain-Driven Design (Evans) │ Tool 2 — domain decomposition
1432
+ Harel Statecharts (Harel, 1987) │ Tool 3 — behavior with hierarchy/orthogonal
1433
+ Decision Tables (ISTQB) │ Tool 4 — combinatorial rules
1434
+ Use-Case Modeling (IBM/UML) │ Tool 5 — actor-goal scenarios
1435
+ Inversion (Charlie Munger) │ Tool 6 — reverse thinking
1436
+ Pre-Mortem (Daniel Kahneman) │ Tool 6 — failure imagination
1437
+ Threat Modeling (Microsoft SDL) │ Tool 6 — security risk discovery
1438
+ FMEA (ASQ) │ Tool 6 — failure mode analysis
1439
+ Second-Order Thinking (Marks) │ Tool 7 — consequence chains
1440
+ Wardley Mapping (Wardley) │ Orient + Priority — evolution awareness
1441
+ Scientific Method │ Experiment Protocol for Complex problems
1442
+ Diátaxis (Procida) │ Tool 10 — document type classification
1443
+ C4 Model (Simon Brown) │ Tool 10 — architecture documentation
1444
+ ```
1445
+
1446
+ ---
1447
+
1448
+ *"The measure of intelligence is the ability to change."*
1449
+ — Albert Einstein