@ahmed-g-gad/apothem 0.1.1

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 (674) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/LICENSE +21 -0
  3. package/LICENSES/MIT.txt +18 -0
  4. package/LICENSES/PSF-2.0.txt +47 -0
  5. package/README.md +549 -0
  6. package/bin/README.md +37 -0
  7. package/bin/apothem.mjs +78 -0
  8. package/package.json +75 -0
  9. package/pyproject.toml +347 -0
  10. package/src/apothem/README.md +52 -0
  11. package/src/apothem/__init__.py +66 -0
  12. package/src/apothem/__main__.py +28 -0
  13. package/src/apothem/_vendor/.keep +0 -0
  14. package/src/apothem/_vendor/__init__.py +25 -0
  15. package/src/apothem/_vendor/attr/__init__.py +104 -0
  16. package/src/apothem/_vendor/attr/__init__.pyi +389 -0
  17. package/src/apothem/_vendor/attr/_cmp.py +160 -0
  18. package/src/apothem/_vendor/attr/_cmp.pyi +13 -0
  19. package/src/apothem/_vendor/attr/_compat.py +99 -0
  20. package/src/apothem/_vendor/attr/_config.py +31 -0
  21. package/src/apothem/_vendor/attr/_funcs.py +497 -0
  22. package/src/apothem/_vendor/attr/_make.py +3406 -0
  23. package/src/apothem/_vendor/attr/_next_gen.py +674 -0
  24. package/src/apothem/_vendor/attr/_typing_compat.pyi +15 -0
  25. package/src/apothem/_vendor/attr/_version_info.py +89 -0
  26. package/src/apothem/_vendor/attr/_version_info.pyi +9 -0
  27. package/src/apothem/_vendor/attr/converters.py +162 -0
  28. package/src/apothem/_vendor/attr/converters.pyi +19 -0
  29. package/src/apothem/_vendor/attr/exceptions.py +95 -0
  30. package/src/apothem/_vendor/attr/exceptions.pyi +17 -0
  31. package/src/apothem/_vendor/attr/filters.py +72 -0
  32. package/src/apothem/_vendor/attr/filters.pyi +6 -0
  33. package/src/apothem/_vendor/attr/py.typed +0 -0
  34. package/src/apothem/_vendor/attr/setters.py +79 -0
  35. package/src/apothem/_vendor/attr/setters.pyi +20 -0
  36. package/src/apothem/_vendor/attr/validators.py +750 -0
  37. package/src/apothem/_vendor/attr/validators.pyi +140 -0
  38. package/src/apothem/_vendor/attr.LICENSE +21 -0
  39. package/src/apothem/_vendor/attrs/__init__.py +72 -0
  40. package/src/apothem/_vendor/attrs/__init__.pyi +314 -0
  41. package/src/apothem/_vendor/attrs/converters.py +3 -0
  42. package/src/apothem/_vendor/attrs/exceptions.py +3 -0
  43. package/src/apothem/_vendor/attrs/filters.py +3 -0
  44. package/src/apothem/_vendor/attrs/py.typed +0 -0
  45. package/src/apothem/_vendor/attrs/setters.py +3 -0
  46. package/src/apothem/_vendor/attrs/validators.py +3 -0
  47. package/src/apothem/_vendor/attrs.LICENSE +21 -0
  48. package/src/apothem/_vendor/jsonschema/__init__.py +120 -0
  49. package/src/apothem/_vendor/jsonschema/__main__.py +6 -0
  50. package/src/apothem/_vendor/jsonschema/_format.py +546 -0
  51. package/src/apothem/_vendor/jsonschema/_keywords.py +449 -0
  52. package/src/apothem/_vendor/jsonschema/_legacy_keywords.py +449 -0
  53. package/src/apothem/_vendor/jsonschema/_types.py +204 -0
  54. package/src/apothem/_vendor/jsonschema/_typing.py +29 -0
  55. package/src/apothem/_vendor/jsonschema/_utils.py +355 -0
  56. package/src/apothem/_vendor/jsonschema/benchmarks/__init__.py +5 -0
  57. package/src/apothem/_vendor/jsonschema/benchmarks/const_vs_enum.py +30 -0
  58. package/src/apothem/_vendor/jsonschema/benchmarks/contains.py +28 -0
  59. package/src/apothem/_vendor/jsonschema/benchmarks/import_benchmark.py +31 -0
  60. package/src/apothem/_vendor/jsonschema/benchmarks/issue232/issue.json +2653 -0
  61. package/src/apothem/_vendor/jsonschema/benchmarks/issue232.py +25 -0
  62. package/src/apothem/_vendor/jsonschema/benchmarks/json_schema_test_suite.py +12 -0
  63. package/src/apothem/_vendor/jsonschema/benchmarks/nested_schemas.py +56 -0
  64. package/src/apothem/_vendor/jsonschema/benchmarks/subcomponents.py +42 -0
  65. package/src/apothem/_vendor/jsonschema/benchmarks/unused_registry.py +35 -0
  66. package/src/apothem/_vendor/jsonschema/benchmarks/useless_applicator_schemas.py +106 -0
  67. package/src/apothem/_vendor/jsonschema/benchmarks/useless_keywords.py +32 -0
  68. package/src/apothem/_vendor/jsonschema/benchmarks/validator_creation.py +14 -0
  69. package/src/apothem/_vendor/jsonschema/cli.py +292 -0
  70. package/src/apothem/_vendor/jsonschema/exceptions.py +490 -0
  71. package/src/apothem/_vendor/jsonschema/protocols.py +230 -0
  72. package/src/apothem/_vendor/jsonschema/validators.py +1410 -0
  73. package/src/apothem/_vendor/jsonschema.LICENSE +19 -0
  74. package/src/apothem/_vendor/jsonschema_specifications/__init__.py +12 -0
  75. package/src/apothem/_vendor/jsonschema_specifications/_core.py +38 -0
  76. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/metaschema.json +42 -0
  77. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/applicator +56 -0
  78. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/content +17 -0
  79. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/core +57 -0
  80. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/format +14 -0
  81. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/meta-data +37 -0
  82. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft201909/vocabularies/validation +98 -0
  83. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/metaschema.json +58 -0
  84. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/applicator +48 -0
  85. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/content +17 -0
  86. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/core +51 -0
  87. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-annotation +14 -0
  88. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/format-assertion +14 -0
  89. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/meta-data +37 -0
  90. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/unevaluated +15 -0
  91. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft202012/vocabularies/validation +98 -0
  92. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft3/metaschema.json +172 -0
  93. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft4/metaschema.json +149 -0
  94. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft6/metaschema.json +153 -0
  95. package/src/apothem/_vendor/jsonschema_specifications/schemas/draft7/metaschema.json +166 -0
  96. package/src/apothem/_vendor/jsonschema_specifications.LICENSE +19 -0
  97. package/src/apothem/_vendor/referencing/__init__.py +7 -0
  98. package/src/apothem/_vendor/referencing/_attrs.py +31 -0
  99. package/src/apothem/_vendor/referencing/_attrs.pyi +21 -0
  100. package/src/apothem/_vendor/referencing/_core.py +739 -0
  101. package/src/apothem/_vendor/referencing/exceptions.py +165 -0
  102. package/src/apothem/_vendor/referencing/jsonschema.py +642 -0
  103. package/src/apothem/_vendor/referencing/py.typed +0 -0
  104. package/src/apothem/_vendor/referencing/retrieval.py +94 -0
  105. package/src/apothem/_vendor/referencing/typing.py +61 -0
  106. package/src/apothem/_vendor/referencing.LICENSE +19 -0
  107. package/src/apothem/_vendor/rpds/__init__.py +251 -0
  108. package/src/apothem/_vendor/typing_extensions.LICENSE +279 -0
  109. package/src/apothem/_vendor/typing_extensions.py +4317 -0
  110. package/src/apothem/_vendor/vendor.txt +22 -0
  111. package/src/apothem/_vendor/yaml/__init__.py +389 -0
  112. package/src/apothem/_vendor/yaml/composer.py +138 -0
  113. package/src/apothem/_vendor/yaml/constructor.py +748 -0
  114. package/src/apothem/_vendor/yaml/cyaml.py +100 -0
  115. package/src/apothem/_vendor/yaml/dumper.py +61 -0
  116. package/src/apothem/_vendor/yaml/emitter.py +1137 -0
  117. package/src/apothem/_vendor/yaml/error.py +74 -0
  118. package/src/apothem/_vendor/yaml/events.py +85 -0
  119. package/src/apothem/_vendor/yaml/loader.py +63 -0
  120. package/src/apothem/_vendor/yaml/nodes.py +48 -0
  121. package/src/apothem/_vendor/yaml/parser.py +588 -0
  122. package/src/apothem/_vendor/yaml/reader.py +185 -0
  123. package/src/apothem/_vendor/yaml/representer.py +388 -0
  124. package/src/apothem/_vendor/yaml/resolver.py +226 -0
  125. package/src/apothem/_vendor/yaml/scanner.py +1435 -0
  126. package/src/apothem/_vendor/yaml/serializer.py +110 -0
  127. package/src/apothem/_vendor/yaml/tokens.py +103 -0
  128. package/src/apothem/_vendor/yaml.LICENSE +20 -0
  129. package/src/apothem/agents/README.md +60 -0
  130. package/src/apothem/agents/codebase-explorer.md +91 -0
  131. package/src/apothem/agents/convention-auditor.md +93 -0
  132. package/src/apothem/agents/dependency-auditor.md +97 -0
  133. package/src/apothem/agents/fact-checker.md +84 -0
  134. package/src/apothem/agents/mcp-builder.md +86 -0
  135. package/src/apothem/agents/memory-auditor.md +93 -0
  136. package/src/apothem/agents/prompt-evaluator.md +87 -0
  137. package/src/apothem/agents/quality-gate.md +103 -0
  138. package/src/apothem/agents/refactor-surgeon.md +74 -0
  139. package/src/apothem/agents/research-scout.md +73 -0
  140. package/src/apothem/agents/security-scanner.md +83 -0
  141. package/src/apothem/agents/test-runner.md +84 -0
  142. package/src/apothem/audit/README.md +73 -0
  143. package/src/apothem/audit/_scan_lib.py +182 -0
  144. package/src/apothem/audit/analyze_graph.py +260 -0
  145. package/src/apothem/audit/build_capability_graph.py +607 -0
  146. package/src/apothem/audit/build_inventory.py +657 -0
  147. package/src/apothem/audit/build_plans_provenance.py +997 -0
  148. package/src/apothem/audit/check_links.py +389 -0
  149. package/src/apothem/audit/classify_artifacts.py +381 -0
  150. package/src/apothem/audit/deprecated-tokens.txt +10 -0
  151. package/src/apothem/audit/execute_plans_migration.py +491 -0
  152. package/src/apothem/audit/known-projects.txt +15 -0
  153. package/src/apothem/audit/render_capability_index.py +467 -0
  154. package/src/apothem/audit/render_inventory.py +405 -0
  155. package/src/apothem/audit/scan_ai_surfaces.py +1125 -0
  156. package/src/apothem/audit/scan_ai_surfaces_coarse.py +261 -0
  157. package/src/apothem/audit/scan_drift_features.py +143 -0
  158. package/src/apothem/audit/scan_frontmatter.py +293 -0
  159. package/src/apothem/audit/scan_header_coverage.py +1134 -0
  160. package/src/apothem/audit/scan_plan_leakage.py +540 -0
  161. package/src/apothem/audit/scan_plans_discipline.py +188 -0
  162. package/src/apothem/audit/scan_secrets_pii.py +245 -0
  163. package/src/apothem/audit/scan_stale_tokens.py +296 -0
  164. package/src/apothem/audit/synthesize_drift.py +205 -0
  165. package/src/apothem/benchmarks/README.md +33 -0
  166. package/src/apothem/benchmarks/__init__.py +3 -0
  167. package/src/apothem/benchmarks/bench_agents.py +63 -0
  168. package/src/apothem/benchmarks/bench_hooks.py +93 -0
  169. package/src/apothem/benchmarks/bench_install.py +58 -0
  170. package/src/apothem/benchmarks/bench_tests.py +93 -0
  171. package/src/apothem/benchmarks/bench_validate_ecosystem.py +84 -0
  172. package/src/apothem/cli/README.md +33 -0
  173. package/src/apothem/cli/__init__.py +229 -0
  174. package/src/apothem/cli/_cmd_completion.py +88 -0
  175. package/src/apothem/cli/_cmd_diff.py +181 -0
  176. package/src/apothem/cli/_cmd_doctor.py +143 -0
  177. package/src/apothem/cli/_cmd_harnesses.py +167 -0
  178. package/src/apothem/cli/_cmd_install.py +327 -0
  179. package/src/apothem/cli/_cmd_migrate_workspace.py +143 -0
  180. package/src/apothem/cli/_cmd_profile.py +341 -0
  181. package/src/apothem/cli/_cmd_status.py +180 -0
  182. package/src/apothem/cli/_cmd_uninstall.py +215 -0
  183. package/src/apothem/cli/_cmd_update.py +397 -0
  184. package/src/apothem/cli/_cmd_verify.py +194 -0
  185. package/src/apothem/cli/_common_flags.py +90 -0
  186. package/src/apothem/cli/_epilogs.py +296 -0
  187. package/src/apothem/cli/_helpers.py +857 -0
  188. package/src/apothem/cli/_json_formatter.py +21 -0
  189. package/src/apothem/cli/_materialize.py +376 -0
  190. package/src/apothem/cli/completions/apothem.bash +30 -0
  191. package/src/apothem/cli/completions/apothem.fish +19 -0
  192. package/src/apothem/cli/completions/apothem.ps1 +27 -0
  193. package/src/apothem/cli/completions/apothem.zsh +42 -0
  194. package/src/apothem/cli/reference_export.py +126 -0
  195. package/src/apothem/commands/README.md +125 -0
  196. package/src/apothem/commands/a11y-audit.md +203 -0
  197. package/src/apothem/commands/architecture-review.md +194 -0
  198. package/src/apothem/commands/audit.md +165 -0
  199. package/src/apothem/commands/code-audit.md +218 -0
  200. package/src/apothem/commands/code-review.md +193 -0
  201. package/src/apothem/commands/dependency-audit.md +209 -0
  202. package/src/apothem/commands/docs-review.md +199 -0
  203. package/src/apothem/commands/elevate.md +285 -0
  204. package/src/apothem/commands/eval.md +149 -0
  205. package/src/apothem/commands/fortress.md +172 -0
  206. package/src/apothem/commands/freshify.md +168 -0
  207. package/src/apothem/commands/github-deploy-fresh.md +178 -0
  208. package/src/apothem/commands/github-deploy-next.md +167 -0
  209. package/src/apothem/commands/perf-audit.md +198 -0
  210. package/src/apothem/commands/plan-amend.md +104 -0
  211. package/src/apothem/commands/plan-audit.md +127 -0
  212. package/src/apothem/commands/plan-design.md +257 -0
  213. package/src/apothem/commands/plan-execute.md +495 -0
  214. package/src/apothem/commands/plan-generate.md +351 -0
  215. package/src/apothem/commands/plan-review.md +555 -0
  216. package/src/apothem/commands/plan-spec.md +359 -0
  217. package/src/apothem/commands/plan-status.md +222 -0
  218. package/src/apothem/commands/plan.md +173 -0
  219. package/src/apothem/commands/projectify.md +142 -0
  220. package/src/apothem/commands/release-readiness.md +142 -0
  221. package/src/apothem/commands/research-analysis.md +241 -0
  222. package/src/apothem/commands/research-design.md +231 -0
  223. package/src/apothem/commands/research-disseminate.md +225 -0
  224. package/src/apothem/commands/research-experiment.md +232 -0
  225. package/src/apothem/commands/research-ideate.md +213 -0
  226. package/src/apothem/commands/research-paper.md +252 -0
  227. package/src/apothem/commands/research-proposal.md +220 -0
  228. package/src/apothem/commands/research-publish.md +255 -0
  229. package/src/apothem/commands/research-review.md +251 -0
  230. package/src/apothem/commands/research-sources.md +266 -0
  231. package/src/apothem/commands/research-spec.md +255 -0
  232. package/src/apothem/commands/research-synthesis.md +233 -0
  233. package/src/apothem/commands/research-theory.md +218 -0
  234. package/src/apothem/commands/research.md +181 -0
  235. package/src/apothem/commands/security-audit.md +196 -0
  236. package/src/apothem/commands/supply-chain-audit.md +192 -0
  237. package/src/apothem/commands/test-suite.md +146 -0
  238. package/src/apothem/commands/threat-model-audit.md +199 -0
  239. package/src/apothem/commands/ux-review.md +202 -0
  240. package/src/apothem/commands/workflow.md +162 -0
  241. package/src/apothem/conformity/README.md +173 -0
  242. package/src/apothem/conformity/__init__.py +1 -0
  243. package/src/apothem/conformity/_grep_base.py +93 -0
  244. package/src/apothem/conformity/agent_capability_grep.py +306 -0
  245. package/src/apothem/conformity/agents_md_coverage_grep.py +382 -0
  246. package/src/apothem/conformity/agnosticism_grep.py +311 -0
  247. package/src/apothem/conformity/always_on_budget_grep.py +318 -0
  248. package/src/apothem/conformity/bare_except_grep.py +115 -0
  249. package/src/apothem/conformity/binding_reciprocity_grep.py +151 -0
  250. package/src/apothem/conformity/brand_mark_grep.py +272 -0
  251. package/src/apothem/conformity/commented_out_code_grep.py +176 -0
  252. package/src/apothem/conformity/completion_claim_grep.py +169 -0
  253. package/src/apothem/conformity/conventional_commit_grep.py +319 -0
  254. package/src/apothem/conformity/copilot_instructions_presence_grep.py +324 -0
  255. package/src/apothem/conformity/cross_platform_matrix_grep.py +297 -0
  256. package/src/apothem/conformity/determinism_grep.py +306 -0
  257. package/src/apothem/conformity/diagram_staleness_grep.py +154 -0
  258. package/src/apothem/conformity/dynamism_grep.py +284 -0
  259. package/src/apothem/conformity/editorconfig_presence_grep.py +281 -0
  260. package/src/apothem/conformity/file_header_grep.py +502 -0
  261. package/src/apothem/conformity/freshness_token_grep.py +233 -0
  262. package/src/apothem/conformity/frontmatter_grep.py +274 -0
  263. package/src/apothem/conformity/frontmatter_value_grep.py +386 -0
  264. package/src/apothem/conformity/gate.py +1386 -0
  265. package/src/apothem/conformity/gitattributes_presence_grep.py +238 -0
  266. package/src/apothem/conformity/harden_runner_grep.py +320 -0
  267. package/src/apothem/conformity/hedging_grep.py +129 -0
  268. package/src/apothem/conformity/license_author_consistency_grep.py +204 -0
  269. package/src/apothem/conformity/link_check.py +327 -0
  270. package/src/apothem/conformity/magic_number_grep.py +182 -0
  271. package/src/apothem/conformity/multi_surface_coherence_grep.py +620 -0
  272. package/src/apothem/conformity/naming_grep.py +224 -0
  273. package/src/apothem/conformity/no_global_plans_grep.py +339 -0
  274. package/src/apothem/conformity/no_toplevel_docs_grep.py +120 -0
  275. package/src/apothem/conformity/oidc_trusted_publishing_grep.py +291 -0
  276. package/src/apothem/conformity/option_annotation_grep.py +352 -0
  277. package/src/apothem/conformity/orphan_output_grep.py +206 -0
  278. package/src/apothem/conformity/permissions_minimum_scope_grep.py +299 -0
  279. package/src/apothem/conformity/plain_language_grep.py +559 -0
  280. package/src/apothem/conformity/plan_next_step_consistency_grep.py +450 -0
  281. package/src/apothem/conformity/plan_suite_structure_grep.py +534 -0
  282. package/src/apothem/conformity/plans_discipline_language_grep.py +245 -0
  283. package/src/apothem/conformity/production_ready_pr_grep.py +200 -0
  284. package/src/apothem/conformity/recommend_next_step_grep.py +250 -0
  285. package/src/apothem/conformity/redundancy_grep.py +401 -0
  286. package/src/apothem/conformity/reference_token_grep.py +230 -0
  287. package/src/apothem/conformity/registry_capability_consistency_grep.py +368 -0
  288. package/src/apothem/conformity/secret_leak_grep.py +193 -0
  289. package/src/apothem/conformity/semver_stability_grep.py +358 -0
  290. package/src/apothem/conformity/smoke_install_grep.py +194 -0
  291. package/src/apothem/conformity/static_version_grep.py +284 -0
  292. package/src/apothem/conformity/token_efficiency_grep.py +185 -0
  293. package/src/apothem/conformity/unpinned_action_grep.py +115 -0
  294. package/src/apothem/conformity/user_confirm_grep.py +74 -0
  295. package/src/apothem/conformity/workflow_concurrency_grep.py +283 -0
  296. package/src/apothem/harnesses/README.md +63 -0
  297. package/src/apothem/harnesses/__init__.py +16 -0
  298. package/src/apothem/harnesses/_shared/README.md +36 -0
  299. package/src/apothem/harnesses/_shared/__init__.py +12 -0
  300. package/src/apothem/harnesses/_shared/install_driver.py +281 -0
  301. package/src/apothem/harnesses/_shared/install_driver_apply.py +612 -0
  302. package/src/apothem/harnesses/_shared/install_driver_backup.py +535 -0
  303. package/src/apothem/harnesses/_shared/install_driver_converters.py +310 -0
  304. package/src/apothem/harnesses/_shared/install_driver_lifecycle.py +495 -0
  305. package/src/apothem/harnesses/_shared/install_driver_materialize.py +675 -0
  306. package/src/apothem/harnesses/_shared/install_driver_merge.py +656 -0
  307. package/src/apothem/harnesses/_shared/install_driver_pathsafety.py +137 -0
  308. package/src/apothem/harnesses/_shared/install_driver_planvalidation.py +240 -0
  309. package/src/apothem/harnesses/_shared/install_driver_removal.py +366 -0
  310. package/src/apothem/harnesses/_shared/install_driver_treeops.py +248 -0
  311. package/src/apothem/harnesses/_shared/install_driver_types.py +330 -0
  312. package/src/apothem/harnesses/_shared/wrapper_factories.py +448 -0
  313. package/src/apothem/harnesses/antigravity/STANDARD-CONVENTION-PIN.md +91 -0
  314. package/src/apothem/harnesses/antigravity/__init__.py +70 -0
  315. package/src/apothem/harnesses/antigravity/capabilities.yml +40 -0
  316. package/src/apothem/harnesses/antigravity/install.py +63 -0
  317. package/src/apothem/harnesses/antigravity/templates/GEMINI.md +40 -0
  318. package/src/apothem/harnesses/antigravity/templates/plugin.json +5 -0
  319. package/src/apothem/harnesses/antigravity/uninstall.py +22 -0
  320. package/src/apothem/harnesses/antigravity/update.py +10 -0
  321. package/src/apothem/harnesses/antigravity/verify.py +11 -0
  322. package/src/apothem/harnesses/claude_code/STANDARD-CONVENTION-PIN.md +65 -0
  323. package/src/apothem/harnesses/claude_code/__init__.py +107 -0
  324. package/src/apothem/harnesses/claude_code/capabilities.yml +42 -0
  325. package/src/apothem/harnesses/claude_code/install.py +147 -0
  326. package/src/apothem/harnesses/claude_code/templates/settings.json +351 -0
  327. package/src/apothem/harnesses/claude_code/uninstall.py +23 -0
  328. package/src/apothem/harnesses/claude_code/update.py +10 -0
  329. package/src/apothem/harnesses/claude_code/verify.py +11 -0
  330. package/src/apothem/harnesses/codebuddy/STANDARD-CONVENTION-PIN.md +74 -0
  331. package/src/apothem/harnesses/codebuddy/__init__.py +49 -0
  332. package/src/apothem/harnesses/codebuddy/capabilities.yml +34 -0
  333. package/src/apothem/harnesses/codebuddy/install.py +40 -0
  334. package/src/apothem/harnesses/codebuddy/templates/apothem-rules.md +37 -0
  335. package/src/apothem/harnesses/codebuddy/uninstall.py +25 -0
  336. package/src/apothem/harnesses/codebuddy/update.py +10 -0
  337. package/src/apothem/harnesses/codebuddy/verify.py +11 -0
  338. package/src/apothem/harnesses/codex/STANDARD-CONVENTION-PIN.md +79 -0
  339. package/src/apothem/harnesses/codex/__init__.py +72 -0
  340. package/src/apothem/harnesses/codex/capabilities.yml +40 -0
  341. package/src/apothem/harnesses/codex/install.py +69 -0
  342. package/src/apothem/harnesses/codex/templates/AGENTS.md +40 -0
  343. package/src/apothem/harnesses/codex/templates/hooks.json +127 -0
  344. package/src/apothem/harnesses/codex/uninstall.py +23 -0
  345. package/src/apothem/harnesses/codex/update.py +10 -0
  346. package/src/apothem/harnesses/codex/verify.py +11 -0
  347. package/src/apothem/harnesses/cursor/STANDARD-CONVENTION-PIN.md +79 -0
  348. package/src/apothem/harnesses/cursor/__init__.py +48 -0
  349. package/src/apothem/harnesses/cursor/capabilities.yml +42 -0
  350. package/src/apothem/harnesses/cursor/install.py +38 -0
  351. package/src/apothem/harnesses/cursor/templates/apothem-rules.mdc +40 -0
  352. package/src/apothem/harnesses/cursor/uninstall.py +25 -0
  353. package/src/apothem/harnesses/cursor/update.py +10 -0
  354. package/src/apothem/harnesses/cursor/verify.py +11 -0
  355. package/src/apothem/harnesses/gemini_cli/STANDARD-CONVENTION-PIN.md +102 -0
  356. package/src/apothem/harnesses/gemini_cli/__init__.py +52 -0
  357. package/src/apothem/harnesses/gemini_cli/capabilities.yml +43 -0
  358. package/src/apothem/harnesses/gemini_cli/install.py +43 -0
  359. package/src/apothem/harnesses/gemini_cli/templates/GEMINI.md +38 -0
  360. package/src/apothem/harnesses/gemini_cli/uninstall.py +25 -0
  361. package/src/apothem/harnesses/gemini_cli/update.py +10 -0
  362. package/src/apothem/harnesses/gemini_cli/verify.py +11 -0
  363. package/src/apothem/harnesses/github_copilot/STANDARD-CONVENTION-PIN.md +84 -0
  364. package/src/apothem/harnesses/github_copilot/__init__.py +47 -0
  365. package/src/apothem/harnesses/github_copilot/capabilities.yml +42 -0
  366. package/src/apothem/harnesses/github_copilot/install.py +40 -0
  367. package/src/apothem/harnesses/github_copilot/templates/copilot-instructions.md +33 -0
  368. package/src/apothem/harnesses/github_copilot/uninstall.py +25 -0
  369. package/src/apothem/harnesses/github_copilot/update.py +10 -0
  370. package/src/apothem/harnesses/github_copilot/verify.py +11 -0
  371. package/src/apothem/harnesses/glm/STANDARD-CONVENTION-PIN.md +77 -0
  372. package/src/apothem/harnesses/glm/__init__.py +56 -0
  373. package/src/apothem/harnesses/glm/capabilities.yml +33 -0
  374. package/src/apothem/harnesses/glm/install.py +45 -0
  375. package/src/apothem/harnesses/glm/templates/glm.toml +58 -0
  376. package/src/apothem/harnesses/glm/uninstall.py +25 -0
  377. package/src/apothem/harnesses/glm/update.py +10 -0
  378. package/src/apothem/harnesses/glm/verify.py +11 -0
  379. package/src/apothem/harnesses/hermes/STANDARD-CONVENTION-PIN.md +57 -0
  380. package/src/apothem/harnesses/hermes/__init__.py +33 -0
  381. package/src/apothem/harnesses/hermes/capabilities.yml +36 -0
  382. package/src/apothem/harnesses/hermes/install.py +17 -0
  383. package/src/apothem/harnesses/hermes/materializer.py +35 -0
  384. package/src/apothem/harnesses/hermes/uninstall.py +33 -0
  385. package/src/apothem/harnesses/hermes/update.py +10 -0
  386. package/src/apothem/harnesses/hermes/verify.py +11 -0
  387. package/src/apothem/harnesses/kimi_code/STANDARD-CONVENTION-PIN.md +128 -0
  388. package/src/apothem/harnesses/kimi_code/__init__.py +59 -0
  389. package/src/apothem/harnesses/kimi_code/capabilities.yml +40 -0
  390. package/src/apothem/harnesses/kimi_code/install.py +42 -0
  391. package/src/apothem/harnesses/kimi_code/templates/AGENTS.md +43 -0
  392. package/src/apothem/harnesses/kimi_code/uninstall.py +27 -0
  393. package/src/apothem/harnesses/kimi_code/update.py +10 -0
  394. package/src/apothem/harnesses/kimi_code/verify.py +11 -0
  395. package/src/apothem/harnesses/kiro/STANDARD-CONVENTION-PIN.md +77 -0
  396. package/src/apothem/harnesses/kiro/__init__.py +49 -0
  397. package/src/apothem/harnesses/kiro/capabilities.yml +36 -0
  398. package/src/apothem/harnesses/kiro/install.py +39 -0
  399. package/src/apothem/harnesses/kiro/templates/apothem-rules.md +36 -0
  400. package/src/apothem/harnesses/kiro/uninstall.py +25 -0
  401. package/src/apothem/harnesses/kiro/update.py +10 -0
  402. package/src/apothem/harnesses/kiro/verify.py +11 -0
  403. package/src/apothem/harnesses/open_claw/STANDARD-CONVENTION-PIN.md +62 -0
  404. package/src/apothem/harnesses/open_claw/__init__.py +35 -0
  405. package/src/apothem/harnesses/open_claw/capabilities.yml +35 -0
  406. package/src/apothem/harnesses/open_claw/install.py +17 -0
  407. package/src/apothem/harnesses/open_claw/materializer.py +36 -0
  408. package/src/apothem/harnesses/open_claw/uninstall.py +32 -0
  409. package/src/apothem/harnesses/open_claw/update.py +10 -0
  410. package/src/apothem/harnesses/open_claw/verify.py +11 -0
  411. package/src/apothem/harnesses/opencode/STANDARD-CONVENTION-PIN.md +76 -0
  412. package/src/apothem/harnesses/opencode/__init__.py +35 -0
  413. package/src/apothem/harnesses/opencode/capabilities.yml +43 -0
  414. package/src/apothem/harnesses/opencode/install.py +17 -0
  415. package/src/apothem/harnesses/opencode/materializer.py +31 -0
  416. package/src/apothem/harnesses/opencode/uninstall.py +34 -0
  417. package/src/apothem/harnesses/opencode/update.py +10 -0
  418. package/src/apothem/harnesses/opencode/verify.py +11 -0
  419. package/src/apothem/harnesses/qwen_code/STANDARD-CONVENTION-PIN.md +87 -0
  420. package/src/apothem/harnesses/qwen_code/__init__.py +37 -0
  421. package/src/apothem/harnesses/qwen_code/capabilities.yml +43 -0
  422. package/src/apothem/harnesses/qwen_code/install.py +19 -0
  423. package/src/apothem/harnesses/qwen_code/materializer.py +174 -0
  424. package/src/apothem/harnesses/qwen_code/templates/QWEN.md +30 -0
  425. package/src/apothem/harnesses/qwen_code/uninstall.py +34 -0
  426. package/src/apothem/harnesses/qwen_code/update.py +10 -0
  427. package/src/apothem/harnesses/qwen_code/verify.py +11 -0
  428. package/src/apothem/harnesses/trae/STANDARD-CONVENTION-PIN.md +70 -0
  429. package/src/apothem/harnesses/trae/__init__.py +49 -0
  430. package/src/apothem/harnesses/trae/capabilities.yml +34 -0
  431. package/src/apothem/harnesses/trae/install.py +38 -0
  432. package/src/apothem/harnesses/trae/templates/apothem-rules.md +37 -0
  433. package/src/apothem/harnesses/trae/uninstall.py +25 -0
  434. package/src/apothem/harnesses/trae/update.py +10 -0
  435. package/src/apothem/harnesses/trae/verify.py +11 -0
  436. package/src/apothem/harnesses/windsurf/STANDARD-CONVENTION-PIN.md +91 -0
  437. package/src/apothem/harnesses/windsurf/__init__.py +52 -0
  438. package/src/apothem/harnesses/windsurf/capabilities.yml +40 -0
  439. package/src/apothem/harnesses/windsurf/install.py +41 -0
  440. package/src/apothem/harnesses/windsurf/templates/apothem-rules.md +37 -0
  441. package/src/apothem/harnesses/windsurf/uninstall.py +25 -0
  442. package/src/apothem/harnesses/windsurf/update.py +10 -0
  443. package/src/apothem/harnesses/windsurf/verify.py +11 -0
  444. package/src/apothem/harnesses/zed/STANDARD-CONVENTION-PIN.md +92 -0
  445. package/src/apothem/harnesses/zed/__init__.py +57 -0
  446. package/src/apothem/harnesses/zed/capabilities.yml +38 -0
  447. package/src/apothem/harnesses/zed/install.py +41 -0
  448. package/src/apothem/harnesses/zed/templates/apothem-rules.md +32 -0
  449. package/src/apothem/harnesses/zed/uninstall.py +28 -0
  450. package/src/apothem/harnesses/zed/update.py +10 -0
  451. package/src/apothem/harnesses/zed/verify.py +11 -0
  452. package/src/apothem/hooks/README.md +81 -0
  453. package/src/apothem/hooks/__init__.py +24 -0
  454. package/src/apothem/hooks/askuserquestion_validator.py +380 -0
  455. package/src/apothem/hooks/dispatch.py +296 -0
  456. package/src/apothem/hooks/emit_hook_context.py +444 -0
  457. package/src/apothem/hooks/hooks.json +318 -0
  458. package/src/apothem/hooks/lib/README.md +39 -0
  459. package/src/apothem/hooks/lib/__init__.py +18 -0
  460. package/src/apothem/hooks/lib/bootstrap.ps1 +129 -0
  461. package/src/apothem/hooks/lib/bootstrap.sh +103 -0
  462. package/src/apothem/hooks/lib/events.py +51 -0
  463. package/src/apothem/hooks/lib/find-pwsh.ps1 +78 -0
  464. package/src/apothem/hooks/lib/find-pwsh.sh +76 -0
  465. package/src/apothem/hooks/lib/find-python.ps1 +63 -0
  466. package/src/apothem/hooks/lib/find-python.sh +97 -0
  467. package/src/apothem/hooks/lib/log.py +43 -0
  468. package/src/apothem/hooks/lib/resolve_root.py +264 -0
  469. package/src/apothem/hooks/messages/postcompact.md +14 -0
  470. package/src/apothem/hooks/messages/posttooluse-proactive-compaction.md +46 -0
  471. package/src/apothem/hooks/messages/precompact.md +14 -0
  472. package/src/apothem/hooks/messages/pretooluse-askuserquestion-recommended.md +65 -0
  473. package/src/apothem/hooks/messages/pretooluse-bash-plan-guard.md +97 -0
  474. package/src/apothem/hooks/messages/pretooluse-bash.md +39 -0
  475. package/src/apothem/hooks/messages/pretooluse-conformity.md +70 -0
  476. package/src/apothem/hooks/messages/pretooluse-dependency-guard.md +21 -0
  477. package/src/apothem/hooks/messages/pretooluse-edit-header-guard.md +61 -0
  478. package/src/apothem/hooks/messages/pretooluse-edit.md +21 -0
  479. package/src/apothem/hooks/messages/pretooluse-eval-guard.md +39 -0
  480. package/src/apothem/hooks/messages/pretooluse-notebookedit.md +11 -0
  481. package/src/apothem/hooks/messages/pretooluse-write-header-guard.md +45 -0
  482. package/src/apothem/hooks/messages/pretooluse-write-plan-guard.md +72 -0
  483. package/src/apothem/hooks/messages/pretooluse-write.md +21 -0
  484. package/src/apothem/hooks/messages/sessionstart.md +15 -0
  485. package/src/apothem/hooks/messages/stop.md +27 -0
  486. package/src/apothem/hooks/proactive_compaction_tracker.py +327 -0
  487. package/src/apothem/hooks/session_start_bootstrap.py +472 -0
  488. package/src/apothem/lib/README.md +42 -0
  489. package/src/apothem/lib/__init__.py +13 -0
  490. package/src/apothem/lib/atomic_io.py +189 -0
  491. package/src/apothem/lib/auditor.py +687 -0
  492. package/src/apothem/lib/clean_slate.py +396 -0
  493. package/src/apothem/lib/contexts.py +352 -0
  494. package/src/apothem/lib/data_home.py +255 -0
  495. package/src/apothem/lib/frontmatter.py +101 -0
  496. package/src/apothem/lib/harness_materializer.py +213 -0
  497. package/src/apothem/lib/harness_protocol.py +59 -0
  498. package/src/apothem/lib/harness_registry.py +282 -0
  499. package/src/apothem/lib/harness_registry_data.py +843 -0
  500. package/src/apothem/lib/install_ledger.py +347 -0
  501. package/src/apothem/lib/learning.py +540 -0
  502. package/src/apothem/lib/memory.py +347 -0
  503. package/src/apothem/lib/parallel_sweep.py +234 -0
  504. package/src/apothem/lib/plan_tiers.py +200 -0
  505. package/src/apothem/lib/plugin_bootstrap.py +132 -0
  506. package/src/apothem/lib/plugin_tree.py +599 -0
  507. package/src/apothem/lib/profile.py +755 -0
  508. package/src/apothem/lib/profile_projection.py +198 -0
  509. package/src/apothem/lib/propagation-manifest.yaml +878 -0
  510. package/src/apothem/lib/propagation.py +220 -0
  511. package/src/apothem/lib/python_resolver.py +189 -0
  512. package/src/apothem/lib/reporter.py +62 -0
  513. package/src/apothem/lib/workspace_migration.py +323 -0
  514. package/src/apothem/output-styles/README.md +41 -0
  515. package/src/apothem/output-styles/concise-engineer.md +49 -0
  516. package/src/apothem/output-styles/default-architect.md +52 -0
  517. package/src/apothem/output-styles/default.md +113 -0
  518. package/src/apothem/output-styles/forensic-auditor.md +63 -0
  519. package/src/apothem/py.typed +0 -0
  520. package/src/apothem/rules/README.md +121 -0
  521. package/src/apothem/rules/agent-capability-discipline-matrix.md +89 -0
  522. package/src/apothem/rules/agent-capability-discipline.md +78 -0
  523. package/src/apothem/rules/agent-orchestration-patterns.md +144 -0
  524. package/src/apothem/rules/agent-orchestration.md +65 -0
  525. package/src/apothem/rules/agents-md-convention.md +86 -0
  526. package/src/apothem/rules/agile-sprints-elements.md +135 -0
  527. package/src/apothem/rules/agile-sprints.md +64 -0
  528. package/src/apothem/rules/agnostic-posture-checklist.md +47 -0
  529. package/src/apothem/rules/agnostic-posture.md +48 -0
  530. package/src/apothem/rules/authoritative-referencing-quotation.md +50 -0
  531. package/src/apothem/rules/authoritative-referencing.md +66 -0
  532. package/src/apothem/rules/authority-inquiry-categories.md +58 -0
  533. package/src/apothem/rules/authority-inquiry.md +54 -0
  534. package/src/apothem/rules/auto-memory-topic-files.md +86 -0
  535. package/src/apothem/rules/auto-memory.md +67 -0
  536. package/src/apothem/rules/bidirectional-binding.md +123 -0
  537. package/src/apothem/rules/canonical-layout-reporting-tiers.md +212 -0
  538. package/src/apothem/rules/canonical-layout.md +60 -0
  539. package/src/apothem/rules/clean-architecture-layers.md +186 -0
  540. package/src/apothem/rules/clean-room-generation-protocols.md +124 -0
  541. package/src/apothem/rules/clean-room-generation.md +59 -0
  542. package/src/apothem/rules/code-craft-conventions.md +101 -0
  543. package/src/apothem/rules/code-craft-markdown.md +138 -0
  544. package/src/apothem/rules/code-craft-python.md +154 -0
  545. package/src/apothem/rules/code-craft-shell.md +192 -0
  546. package/src/apothem/rules/cognitive-identity-techniques.md +180 -0
  547. package/src/apothem/rules/cognitive-identity.md +81 -0
  548. package/src/apothem/rules/context-management-budget.md +46 -0
  549. package/src/apothem/rules/context-management-protocol.md +161 -0
  550. package/src/apothem/rules/context-management-scratch.md +128 -0
  551. package/src/apothem/rules/context-management.md +85 -0
  552. package/src/apothem/rules/definitiveness-virtues.md +67 -0
  553. package/src/apothem/rules/definitiveness.md +58 -0
  554. package/src/apothem/rules/determinism.md +81 -0
  555. package/src/apothem/rules/disclosure-ledger-markers.md +58 -0
  556. package/src/apothem/rules/disclosure-ledger.md +52 -0
  557. package/src/apothem/rules/dynamism.md +38 -0
  558. package/src/apothem/rules/etc-extension.md +57 -0
  559. package/src/apothem/rules/expertise-posture-elements.md +68 -0
  560. package/src/apothem/rules/expertise-posture.md +54 -0
  561. package/src/apothem/rules/freshness-facade.md +64 -0
  562. package/src/apothem/rules/harness-adapter-shape-schemas.md +162 -0
  563. package/src/apothem/rules/harness-adapter-shape.md +42 -0
  564. package/src/apothem/rules/host-discovery-manifests.md +50 -0
  565. package/src/apothem/rules/host-discovery.md +56 -0
  566. package/src/apothem/rules/i18n-discipline-locale-cohorts.md +120 -0
  567. package/src/apothem/rules/i18n-discipline.md +70 -0
  568. package/src/apothem/rules/interactive-questions-canonical-shapes.md +590 -0
  569. package/src/apothem/rules/interactive-questions-detail.md +41 -0
  570. package/src/apothem/rules/interactive-questions-sweep-matchers.md +184 -0
  571. package/src/apothem/rules/interactive-questions.md +89 -0
  572. package/src/apothem/rules/large-file-generation.md +112 -0
  573. package/src/apothem/rules/large-file-reading.md +59 -0
  574. package/src/apothem/rules/living-docs.md +85 -0
  575. package/src/apothem/rules/multi-agent-workflow.md +57 -0
  576. package/src/apothem/rules/operational-mandates-expanded.md +78 -0
  577. package/src/apothem/rules/operational-mandates.md +88 -0
  578. package/src/apothem/rules/option-annotation-form.md +60 -0
  579. package/src/apothem/rules/option-annotation.md +45 -0
  580. package/src/apothem/rules/own-voice-reimplementation.md +86 -0
  581. package/src/apothem/rules/performance-discipline.md +91 -0
  582. package/src/apothem/rules/persistent-conventions-vigilance-checklist.md +54 -0
  583. package/src/apothem/rules/persistent-conventions-vigilance.md +61 -0
  584. package/src/apothem/rules/plain-language.md +56 -0
  585. package/src/apothem/rules/planning-techniques.md +130 -0
  586. package/src/apothem/rules/pre-emission-gate-bars.md +86 -0
  587. package/src/apothem/rules/pre-emission-gate.md +54 -0
  588. package/src/apothem/rules/production-ready-prs-surfaces.md +162 -0
  589. package/src/apothem/rules/production-ready-prs.md +83 -0
  590. package/src/apothem/rules/propagation.md +63 -0
  591. package/src/apothem/rules/recommend-next-step.md +106 -0
  592. package/src/apothem/rules/refactoring-discipline.md +76 -0
  593. package/src/apothem/rules/session-closure.md +44 -0
  594. package/src/apothem/rules/sota-elevation-exemplars.md +76 -0
  595. package/src/apothem/rules/sota-elevation.md +52 -0
  596. package/src/apothem/rules/source-accessibility.md +58 -0
  597. package/src/apothem/rules/surgical-manipulation.md +48 -0
  598. package/src/apothem/rules/systemic-participation-relations.md +108 -0
  599. package/src/apothem/rules/systemic-participation.md +70 -0
  600. package/src/apothem/rules/ten-dimension-check-dimensions.md +52 -0
  601. package/src/apothem/rules/ten-dimension-check.md +59 -0
  602. package/src/apothem/rules/token-budget-discipline.md +81 -0
  603. package/src/apothem/rules/token-efficiency-rewrite-protocol.md +79 -0
  604. package/src/apothem/rules/token-efficiency-rewrite.md +77 -0
  605. package/src/apothem/rules/tool-use-discipline.md +48 -0
  606. package/src/apothem/rules/visual-leverage.md +102 -0
  607. package/src/apothem/schemas/NOTICE.md +9 -0
  608. package/src/apothem/schemas/README.md +104 -0
  609. package/src/apothem/schemas/__init__.py +176 -0
  610. package/src/apothem/schemas/advisory-finding.schema.json +111 -0
  611. package/src/apothem/schemas/agent.schema.json +106 -0
  612. package/src/apothem/schemas/authorship-header.txt +1 -0
  613. package/src/apothem/schemas/cohort-manifest.yaml +248 -0
  614. package/src/apothem/schemas/cohort-metadata-vocabulary.yaml +168 -0
  615. package/src/apothem/schemas/cohort.schema.json +113 -0
  616. package/src/apothem/schemas/command.schema.json +68 -0
  617. package/src/apothem/schemas/compatibility-matrix.yaml +432 -0
  618. package/src/apothem/schemas/context-fragment.schema.json +64 -0
  619. package/src/apothem/schemas/freshness-token-denylist.txt +51 -0
  620. package/src/apothem/schemas/handoff-manifest.yaml +353 -0
  621. package/src/apothem/schemas/header-exceptions.txt +141 -0
  622. package/src/apothem/schemas/header-visibility.yaml +39 -0
  623. package/src/apothem/schemas/learning-signal.schema.json +46 -0
  624. package/src/apothem/schemas/memory-record.schema.json +61 -0
  625. package/src/apothem/schemas/output-style.schema.json +40 -0
  626. package/src/apothem/schemas/plan.schema.json +51 -0
  627. package/src/apothem/schemas/plugin.schema.json +83 -0
  628. package/src/apothem/schemas/profile.example.yaml +70 -0
  629. package/src/apothem/schemas/profile.minimal.yaml +6 -0
  630. package/src/apothem/schemas/profile.schema.json +396 -0
  631. package/src/apothem/schemas/reference-token-denylist.txt +25 -0
  632. package/src/apothem/schemas/skill.schema.json +75 -0
  633. package/src/apothem/skills/README.md +93 -0
  634. package/src/apothem/skills/dependency-upgrade/SKILL.md +105 -0
  635. package/src/apothem/skills/dev-toolkit/SKILL.md +120 -0
  636. package/src/apothem/skills/diagram-authoring/SKILL.md +113 -0
  637. package/src/apothem/skills/document-authoring/SKILL.md +118 -0
  638. package/src/apothem/skills/ecosystem-audit/SKILL.md +108 -0
  639. package/src/apothem/skills/ecosystem-audit/references/audit-fortress.md +85 -0
  640. package/src/apothem/skills/ecosystem-audit/references/procedure.md +162 -0
  641. package/src/apothem/skills/eval-harness/SKILL.md +88 -0
  642. package/src/apothem/skills/incident-runbook/SKILL.md +92 -0
  643. package/src/apothem/skills/multi-source-research/SKILL.md +90 -0
  644. package/src/apothem/skills/plan-suite/SKILL.md +118 -0
  645. package/src/apothem/skills/plan-suite/master_template.md +1324 -0
  646. package/src/apothem/skills/projectify/SKILL.md +117 -0
  647. package/src/apothem/skills/prompt-engineering/SKILL.md +122 -0
  648. package/src/apothem/skills/refactor-extract/SKILL.md +85 -0
  649. package/src/apothem/skills/research-suite/SKILL.md +170 -0
  650. package/src/apothem/skills/research-suite/references/directory-structure.md +47 -0
  651. package/src/apothem/skills/research-suite/references/lifecycle.md +67 -0
  652. package/src/apothem/skills/research-suite/references/principal-investigator-framework.md +37 -0
  653. package/src/apothem/skills/research-suite/references/rigor-mandates.md +30 -0
  654. package/src/apothem/skills/research-suite/research_template.md +476 -0
  655. package/src/apothem/skills/secret-rotation/SKILL.md +87 -0
  656. package/src/apothem/skills/source-synthesis/SKILL.md +92 -0
  657. package/src/apothem/skills/surgical-guard/SKILL.md +118 -0
  658. package/src/apothem/skills/test-authoring/SKILL.md +85 -0
  659. package/src/apothem/skills/vuln-triage/SKILL.md +91 -0
  660. package/src/apothem/skills/workflow/SKILL.md +139 -0
  661. package/src/apothem/statuslines/README.md +26 -0
  662. package/src/apothem/statuslines/__init__.py +20 -0
  663. package/src/apothem/statuslines/conformity.json +5 -0
  664. package/src/apothem/statuslines/render.py +334 -0
  665. package/src/apothem/statuslines/statusline.md +50 -0
  666. package/src/apothem/templates/README.md +43 -0
  667. package/src/apothem/templates/agents-md-template.md +80 -0
  668. package/src/apothem/templates/consideration-log.md +39 -0
  669. package/src/apothem/templates/expertise-gap-log.md +56 -0
  670. package/src/apothem/templates/master-index-template.md +93 -0
  671. package/src/apothem/templates/potency-map.md +53 -0
  672. package/src/apothem/templates/preservation-audit.md +60 -0
  673. package/src/apothem/templates/question-resolution-audit.md +52 -0
  674. package/src/apothem/templates/trace-matrix-template.md +77 -0
@@ -0,0 +1,495 @@
1
+ ---
2
+ name: "plan-execute"
3
+ version: "0.1.0"
4
+ updated: "2026-06-22"
5
+ description: "Executes a specific phase from a Master Plan Suite — ingests the phase's `PHASE.md` plus the suite's PROGRESS/PLAN-NOTES context, verifies prerequisites and review scorecards, implements every task with per-task commits, runs quality gates, and emits the phase `REPORT.md` before transitioning to the next phase (granular or continuous) — all under conformity checking, the fifteen-bar pre-emission gate, and a per-file destructive-op floor. The terminal `/plan` stage that turns a reviewed suite into landed, verified work."
6
+ argument-hint: "[path/to/plan-suite/] [phase-id] [--dry-run]"
7
+ disable-model-invocation: false
8
+ portability: "universal"
9
+ allowed-tools: "*"
10
+ ---
11
+
12
+ <!-- SPDX-License-Identifier: MIT -->
13
+
14
+ # /plan-execute — Execute a Specific Phase
15
+
16
+ ---
17
+
18
+ ## Role
19
+
20
+ You are the user's **Technical Co-Founder** and **Cognitive Insurgent** (`rules/cognitive-identity.md`) executing a phase of work — a world-class practitioner delivering expert-grade work with structural novelty across whatever domain the phase serves (software implementation, research, writing, documentation, analysis). Apply Deep Problem-Solving (Preamble §10.1) to every non-trivial decision. The **Obvious Purge** (Filter 1) is always active for non-trivial decisions: discard the obvious approach; find the structurally superior one. The **Aesthetic Demand** (Filter 5) governs the final form — does this artifact have conceptual elegance? Verify everything.
21
+
22
+ ---
23
+
24
+ ## Instructions
25
+
26
+ Execute `/plan-execute`. Implement all tasks in a phase, run quality gates, write the report, and update progress.
27
+
28
+ **Reference Template:** Check `CLAUDE.md` for template path. **Requires template v0.1.0+.** Governance scales with seriousness per `CLAUDE.md` Section 4; creative architecture (`rules/cognitive-identity.md`, CM-21) is active during implementation decisions.
29
+
30
+ ---
31
+
32
+ ## Pipeline Contract
33
+
34
+ **Pipeline position.** **Terminal.** This command sits at the tail of the `/plan` pipeline. The canonical sequence is `/plan-spec → /plan-generate → /plan-review → /plan-design (CONDITIONAL — architecture-bearing suites only) → /plan-execute`; `/plan-status` is orthogonal read-only at any point. When `/plan-design` participates upstream (architecture-bearing suites), this command additionally consumes the design artifact and its design-gate attestation from the manifest. It consumes the generated suite plus its review-augmented Handoff Manifest and emits per-phase reports (`phases/NN-topic/REPORT.md`), the final completion summary (`COMPLETION.md` at the suite root), and codebase artifacts at canonical host-project locations.
35
+
36
+ **Handoff Manifest.**
37
+
38
+ - **Consumed.** `{suite}/_inputs/handoff-manifest.yml` per the schema at `src/apothem/schemas/handoff-manifest.yaml`. The upstream manifest carries the suite-generation outcome from `/plan-generate` and the review-augmented Review Scorecards from `/plan-review`. The Step 2 Review Gate at SHARED+ reads the scorecards as the prerequisite evidence for execution; FAIL scorecards block until resolved or overridden via the Step 2 inquiry surface.
39
+ - **Emitted.** Per-phase REPORT.md files at the canonical layout (`phases/NN-topic/REPORT.md`) and operator-facing mirrors at `{suite}/_outputs/<phase-name>/REPORT.md`; Phase Output Registry rows in PROGRESS.md (verified outputs with on-disk paths); the Resumption Contract at every phase exit (next-action prose, active-task pointer, critical-files manifest); and the final COMPLETION.md at the suite root when the last phase exits clean. The Handoff Manifest at `{suite}/_inputs/handoff-manifest.yml` is updated at every phase exit with the phase's verified-output set, gate-attestation block, and watch items.
40
+
41
+ **Pre-flight inquiry set.** Step 2 (Verify Prerequisites and Conformity) and Step 3 (Execute Tasks) emit the per-phase pre-flight inquiry set. Every prerequisite gap, missing input, scorecard FAIL, quality-gate exhaustion, and partial-task resumption surfaces via the structured-inquiry channel per `rules/interactive-questions.md` with the three-segment option annotation. The inquiry surface fires at the phase boundary so authoritative-data gaps are resolved before tasks execute, not mid-execution.
42
+
43
+ **Pre-emission gate.** Step 6.7 (Plan-Internal Isolation Check) and Step 6.9 (End-of-Phase Commit Gate) operate inline; the canonicalized fifteen-bar pre-emission gate per `rules/pre-emission-gate.md` runs as the penultimate verification before Step 7 REPORT.md emission. The phase-level gate attestation is recorded in REPORT.md and surfaced in the updated Handoff Manifest. Failure on any bar marks the phase BLOCKED via the Step 4 / 6.8 BLOCKED path, and the dependency graph is walked to mark transitively-blocked phases SKIPPED.
44
+
45
+ ---
46
+
47
+ ## Foundational Stanzas
48
+
49
+ The four standing surfaces every operator inherits per the canonical project voice at `AGENTS.md` plus the active harness mirror, spelled out inline so this command honors them without relying on cross-reference alone. Of all five `/plan` pipeline stages, this one carries the strictest destructive-op floor — execution is the surface where irreversible filesystem mutations land.
50
+
51
+ ### Refusal & Escalation
52
+
53
+ REFUSE any task whose scope exceeds this command's stated mission (executing the next pending phase of a generated, reviewed plan suite). Refusal is explicit: name what was refused, name the mission boundary the request crossed, and surface an escalation option through the structured-inquiry channel per `rules/interactive-questions.md` (canonical channel; three-segment option annotation; never free-form prose as primary input). REFUSE forced execution of a BLOCKED phase without operator-supplied rationale; REFUSE override of a FAIL scorecard at PUBLIC_LAUNCH (hard block, no override path). When a quality-gate failure exhausts the 2-cycle retry budget, halt and surface — never silently degrade.
54
+
55
+ ### Output Surface
56
+
57
+ Plan-suite-internal updates (per-phase `phases/NN-topic/REPORT.md`, `PROGRESS.md`, `PLAN-NOTES.md`, the Handoff Manifest, the final `COMPLETION.md`) land at `<project-root>/.apothem/plans/{suite}/` per the suite-locality invariant at `rules/context-management.md` §2.6.1. Codebase artifacts (source, tests, configs, schemas, build scripts, data, assets) go to their domain-natural locations under the host project per host-discovery (`rules/host-discovery.md`); the canonical layout is host-ratified, not invented. NEVER write a plan-suite artifact outside the suite folder, NEVER write a plan suite to a global plans directory under any harness's config root from a downstream-project context, and NEVER write to any other global-ecosystem location. Per `rules/operational-mandates.md` CM-7, codebase artifacts contain ZERO plan-internal references — natural domain language only.
58
+
59
+ ### File-Authoring Contract
60
+
61
+ Every NEW codebase file the executor creates routes through `scripts/inject-header.{sh,py}` so the canonical authorship-header banner per `site/content/docs/reference/authorship-header.mdx` is injected at the head; the injector is idempotent and detects the filetype variant automatically from the byte-exact fixture at `src/apothem/schemas/authorship-header.txt`. The exempt classes (LICENSE, JSON configuration files, lockfiles, generated assets, vendored trees, `.audit/` ephemera, `<project-root>/.apothem/plans/` ephemera, `.keep` / `.gitkeep` markers, binary files) are enumerated at `src/apothem/schemas/header-exceptions.txt`. Plan-suite artifacts (REPORT.md, PROGRESS.md updates, PLAN-NOTES.md updates) are banner-exempt under the `.plans/**` exception class. Edits to existing files preserve any existing banner; the header-inject-guard hook at `hooks/messages/pretooluse-{write,edit}-header-guard.md` enforces the contract at every Write / Edit invocation.
62
+
63
+ ### Structured Inquiry on Ambiguity
64
+
65
+ When uncertain about identity / scope / preference / security / naming / infrastructure / version data — or about any branch-point, deletion decision, or judgment call that materially affects the outcome — route the resolution through the structured-inquiry channel with the three-segment option annotation per `rules/interactive-questions.md` §3 (rationale / recommendation / default-pointer). Free-form prose questions as primary input are forbidden. NEVER fabricate authoritative data. **Per-file destructive-op floor.** Every delete / rename / move / overwrite-without-retention / revert-uncommitted operation routes through the structured-inquiry channel on a per-file basis per `rules/interactive-questions.md` §6 — one invocation per file, every time, no `multiSelect` batching across files, every option's `default-pointer:` carries the verbatim `no-default: user decision required` marker. Confirmation fatigue is an accepted cost; silent destruction is not. The §6.4 Delete / §6.5 Rename / §6.6 Move / §6.7 Revert canonical option sets are the floor.
66
+
67
+ ---
68
+
69
+ ## Inputs
70
+
71
+ | Argument | Type | Required | Description |
72
+ | -------- | ---- | -------- | ----------- |
73
+ | `path/to/plan-suite/` | Path | Yes | Root directory of the plan suite (must contain `PREAMBLE.md`, `MASTER-PLAN.md`, `PROGRESS.md`, `PLAN-NOTES.md`, `phases/`). |
74
+ | `phase-id` | String | No | Specific phase or sub-phase to execute (e.g., `03`, `02A`). Omit to auto-select the next pending phase per `PROGRESS.md`. |
75
+ | `--dry-run` | Flag | No | Analyze what would be executed and report — no files modified, no commits made. |
76
+ | `--no-pause` | Flag | No | Opt into `continuous` mode for this invocation and suppress the granular per-phase amendment loop. Continuous advancement is opt-in — the shipped default halts at each phase boundary — so this flag (or the profile `enforcement.continuous_execution` flag) is how the operator opts in. With it set, execution advances phase-to-phase inside the same session: each boundary runs the Phase Exit Protocol, compacts, bootstraps, and continues to the next unblocked phase. |
77
+
78
+ ---
79
+
80
+ ## Sequence Gate
81
+
82
+ `/plan-execute` is the terminal stage; it MUST NOT run out of order. Before Step 1, verify the predecessor preconditions on disk:
83
+
84
+ - A reviewed suite — Review Scorecards recorded in PLAN-NOTES.md under `## Review Scorecards`.
85
+ - When the suite is architecture-bearing, a design artifact at the suite's `_inputs/design.md`.
86
+
87
+ When the Review Scorecards are absent, the stage REFUSES to run and emits the single definitive line `Blocked: run /plan-review first (and /plan-design for architecture-bearing suites)` — `/plan-review` is the predecessor that records the scorecards, and `/plan-design` is the predecessor that emits `_inputs/design.md` for architecture-bearing suites. A non-architecture-bearing suite requires only the reviewed scorecards; it consumes them directly without a design artifact.
88
+
89
+ An explicit `--override` flag bypasses this gate. When `--override` is used, the bypass MUST be recorded as a finding in the suite's PLAN-NOTES.md (and the suite's findings surface) with the rationale and the missing precondition named, so the out-of-order run is auditable.
90
+
91
+ ---
92
+
93
+ ## Workflow
94
+
95
+ ### Step 1: Load Context
96
+
97
+ Deploy a Research Team (CM-25A) for parallel context loading. Return contract: structured summaries, max 500 tokens per agent (CM-25C), required fields (`status`, `summary`, `evidence`, `gaps`), and explicit failure behavior (`status=failed` + reason + partial coverage). Lean ingestion — execution-relevant data only (CM-12a, CM-24).
98
+
99
+ 1. Verify mandatory files exist (PREAMBLE.md, MASTER-PLAN.md, PROGRESS.md, PLAN-NOTES.md, `phases/` directory). If missing: STOP → recommend `/plan-generate`.
100
+ 2. **Classify the phase (code-bearing vs non-code).** Read the target phase file's Scope and deliverables: a phase is **code-bearing** when it produces or modifies source, tests, configs, schemas, build scripts, or any version-controlled software artifact; it is **non-code** when its deliverables are research, writing, documentation-only prose, analysis, or other non-software artifacts. Record the classification in the PROGRESS.md Resumption Contract under `**Phase class (this phase):** code-bearing | non-code`. For a **code-bearing** phase, verify a git repository — if not present: STOP → recommend `git init`. A **non-code** phase proceeds without the git gate (no STOP); its deliverables are recorded in the phase report rather than committed.
101
+ 3. **Phase resolution:** If no phase number is specified, read PROGRESS.md to determine the next pending phase (skipping SKIPPED phases) and scan `phases/` for phase folders. If `phases/` exists but holds zero phase folders: STOP → inform the user the phases directory is empty and recommend `/plan-generate`. If all phases are complete or skipped, invoke the structured-inquiry channel: question `All phases are complete or skipped; how should execution proceed?`; header `Phase done`; options:
102
+ - `Abort (Recommended)`:
103
+ rationale: Halts execution; the pipeline state remains terminal until the operator explicitly invokes a re-run.
104
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-1 (Critical Evaluation — do not re-execute completed work without explicit operator intent) and class 6 observed-state: zero pending phases means no substantive dispatch target exists.
105
+ default-pointer: Abort — safe because halting preserves the completed state without overwriting prior phase outputs.
106
+ - `Re-execute a specific phase`:
107
+ rationale: User names the phase via Other-text; the named phase is re-executed from its first task, overwriting prior outputs at that phase's scope.
108
+ recommendation: acceptable
109
+ default-pointer: Abort — re-execution overwrites completed phase outputs and is appropriate only when the operator explicitly intends to re-run prior work.
110
+ `multiSelect: false`. If multiple phases are pending with no dependency ordering preference, present them via the structured-inquiry channel with one option per pending phase (up to 4 options; if more exist, list the first four by readiness and use Other-text for the rest); each option's body carries the three-segment annotation per `rules/interactive-questions.md` §3 (`rationale:` describing what the phase produces · `recommendation:` from the closed taxonomy citing a concrete-driver class per `rules/interactive-questions-canonical-shapes.md` §3.2.1 · `default-pointer:` naming the dependency-graph-earliest pending phase as the safe default).
111
+ 4. Load rules (`rules/*.md`) and relevant skills.
112
+ 5. Read `PREAMBLE.md` — sections relevant to this phase.
113
+ 6. Read `PROGRESS.md` — current state; verify prerequisites. If resuming: run the Session Start Protocol (CM-14), including rules from `rules/*.md`.
114
+ 7. Read `PLAN-NOTES.md` — resolved decisions (DO NOT re-ask). Check the User Preferences section for communication style.
115
+ 8. Read `MASTER-PLAN.md` Section 3 (Dependency Graph) — needed for BLOCKED transition handling in Step 10 and sub-phase ordering.
116
+ 9. Read the target phase file (`phases/NN-kebab-topic/PHASE.md`). For sub-phases, read from nested folders (e.g., `phases/NN-kebab-topic/NNA-subtopic/PHASE.md`).
117
+ 10. **Per-phase effort calibration (D3 / CM-12d):** Effort is operator-invoked — `/plan-execute` ships no effort preset (agnostic posture); the *recommended* tier for mechanical implementation is the middle one. Inspect the target PHASE.md frontmatter for an operator-authored `effort:` field. If present, it sets the effort tier for the duration of the phase, on the harness's own effort scale; record it in the PROGRESS.md Resumption Contract under a new line: `**Effort override (this phase):** <value> (recommended: the mechanical-implementation tier)`. If the field is absent, no Resumption Contract line is emitted. The calibration is per-phase scoped — it never persists across the granular-pause boundary into the next phase. See CM-12d.
118
+
119
+ **1A — Mode Selection:** Once per operator-driven session, resolve the execute-session pause cadence. Continuous advancement is opt-in, never the shipped default. Resolution order: (a) if the `--no-pause` invocation flag is set, OR the shared profile's `enforcement.continuous_execution` flag is `true`, mode is `continuous` and the question is skipped (the operator has opted in); (b) otherwise, read the persisted `**Execution mode (this session):**` line from PROGRESS.md Resumption Contract — if present and the value is one of the closed taxonomy `{continuous, granular, granular-phase-only, granular-sub-phase-only}`, adopt it without re-asking; (c) if no persisted mode exists, set mode to `granular-phase-only` — halt at each phase boundary by default — persist it, and proceed; (d) when the operator explicitly asks to change the pause cadence, fire the structured inquiry below and persist the selected override. The persisted value is consumed at every phase + sub-phase boundary by Step 10A.
120
+
121
+ structured inquiry:
122
+
123
+ - `question:` `How should this execute session proceed?`
124
+ - `header:` `Exec mode`
125
+ - `multiSelect:` `false`
126
+ - Option `Granular at phase only (Recommended)`:
127
+ - `rationale:` Pause at every parent-phase boundary so you confirm each advance; sub-phase transitions auto-continue.
128
+ - `recommendation:` recommended — cites class 5 rule citation: `rules/agnostic-posture.md` (continuous multi-step advancement ships default-off / opt-in) and class 6 observed-state: a clean install carries no continuous opt-in, so halting at each natural boundary is the default-off posture.
129
+ - `default-pointer:` Granular at phase only — the default when no mode is persisted and no continuous opt-in is set.
130
+ - Option `Continuous autonomous`:
131
+ - `rationale:` No pauses between phases or sub-phases; each boundary still externalizes, compacts, and re-bootstraps from durable state before the next dispatch.
132
+ - `recommendation:` acceptable — opt-in advancement; runs only when you set the profile `enforcement.continuous_execution` flag, pass `--no-pause`, or request it here.
133
+ - `default-pointer:` Granular at phase only — continuous advancement is an explicit opt-in, never the shipped default.
134
+ - Option `Granular`:
135
+ - `rationale:` Pause at every phase boundary AND every sub-phase boundary; you confirm continue at each pause; full operator-control posture.
136
+ - `recommendation:` acceptable
137
+ - `default-pointer:` Granular at phase only — full-granular is an explicit pause-cadence override.
138
+ - Option `Granular at sub-phase only`:
139
+ - `rationale:` Pause at every sub-phase boundary; parent-phase transitions auto-continue (relevant for phases that decompose into sub-phase chains).
140
+ - `recommendation:` acceptable
141
+ - `default-pointer:` Granular at phase only — sub-phase-only pausing is an explicit pause-cadence override.
142
+
143
+ **1B — Blind Bootstrap Validation (CM-24 §6):** Ensures the session can execute the target phase with zero prior conversation history.
144
+
145
+ (a) Read PROGRESS.md Resumption Contract — adopt convention anchors, active decisions, and the critical-files manifest.
146
+ (b) Read PROGRESS.md Phase Output Registry — for every Input declared in the target phase file, verify the producing phase's output exists in the registry as ✅ Verified. If any input is ❌ MISSING: before reporting, check whether the declared output file actually exists on disk at its expected path. If the file exists but the registry entry is absent or unverified, report a "stale registry" condition. In `--dry-run`, report-only and modify no files. Outside `--dry-run`, offer to update the registry entry to Verified and proceed. Only report "prerequisite output absent" when the file genuinely does not exist on disk.
147
+ (c) If the Resumption Contract lists "Critical Files for Next Phase", read those files (and only those files) in the listed order.
148
+ (d) Confirm: all information needed for this phase exists in durable files that have been loaded. No residual conversation context from a prior session is required.
149
+
150
+ ### Step 2: Verify Prerequisites and Conformity
151
+
152
+ Deploy an Audit Team (CM-25A) for parallel conformity checks. Return pass/fail verdicts only (CM-25C return contract: max 200 tokens per agent).
153
+
154
+ - Confirm prerequisites complete in PROGRESS.md. If prerequisites are incomplete (a dependent phase is still Pending/In Progress/Blocked): STOP. Invoke the structured-inquiry channel: question `Prerequisite phases are incomplete; how should execution proceed?`; header `Prereq stop`; options:
155
+ - `Execute prerequisite first (Recommended)`:
156
+ rationale: Runs the blocking phase's tasks before resuming this one, satisfying the dependency edge and preserving the dependency-graph order.
157
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (Plan Integrity — dependencies must match the graph) and class 6 observed-state: a downstream phase consuming an upstream phase's outputs cannot operate correctly when those outputs are absent.
158
+ default-pointer: Execute prerequisite first — safe because completing the prerequisite is reversible (the prerequisite's outputs are produced once and consumed by the dependent phase).
159
+ - `Override`:
160
+ rationale: Proceeds despite the incomplete prerequisite; the rationale is logged in PLAN-NOTES.md alongside a watch item in PROGRESS.md.
161
+ recommendation: discouraged — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (a dependency violation propagates risk to every downstream phase that consumes the missing output) and class 6 observed-state: overriding without satisfying the dependency leaves the consuming phase to operate on unverified inputs.
162
+ default-pointer: Execute prerequisite first — overriding is a documented escape hatch, not the safe default; the prerequisite-first path produces verified inputs.
163
+ - `Abort`:
164
+ rationale: Halts the pipeline; the next session can resume after the prerequisite is satisfied independently.
165
+ recommendation: acceptable
166
+ default-pointer: Execute prerequisite first — aborting forces a full re-bootstrap, while satisfying the prerequisite preserves the in-progress state and resumes cleanly.
167
+ `multiSelect: false`. Name the incomplete prerequisite phases in the question body.
168
+ - **Target phase status:** If the target phase is not Pending, STOP and inform the user of the recorded state, then offer the options below (record rationale in PLAN-NOTES.md for any override/re-execute path):
169
+
170
+ | Status | Inform user of | Option (a) | Option (b) | Option (c) |
171
+ | ------ | -------------- | ---------- | ---------- | ---------- |
172
+ | COMPLETE | phase already complete | re-execute | resume from a specific task | abort |
173
+ | BLOCKED | recorded blocker | resolve blocker and re-execute | force-execute | abort |
174
+ | SKIPPED | upstream blocker that caused the skip | resolve upstream blocker first | force-execute | abort |
175
+ | IN PROGRESS | last-completed task (per Resumption Contract) | resume from next incomplete task (default) | re-execute from phase start | abort |
176
+
177
+ - Confirm inputs exist. If inputs are missing and not caught by the prerequisite check: STOP and invoke the structured-inquiry channel: question `A declared input is missing from the producing phase's outputs; how should the phase proceed?`; header `Missing input`; options:
178
+ - `Execute producing phase first (Recommended)`:
179
+ rationale: Runs the phase that was to produce the missing output, restoring the dependency chain before the dependent phase resumes.
180
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (Plan Integrity — inputs must resolve to outputs) and class 6 observed-state: a missing declared input means the producing phase has not yet emitted its deliverable.
181
+ default-pointer: Execute producing phase first — safe because producing the input through the declared producer preserves the dependency-graph contract.
182
+ - `Provide manually`:
183
+ rationale: User supplies the missing input via Other-text or an external placement; the phase resumes with the manually provided artifact.
184
+ recommendation: acceptable
185
+ default-pointer: Execute producing phase first — manual provision bypasses the producing phase's verification, which the dependency-graph contract relies on.
186
+ - `Abort`:
187
+ rationale: Halts the pipeline; the next session can resume after the input is produced.
188
+ recommendation: acceptable
189
+ default-pointer: Execute producing phase first — aborting forces a re-bootstrap; producing the input directly resumes execution cleanly.
190
+ `multiSelect: false`. Name the absent inputs in the question body.
191
+ - Read Scope — IN vs. OUT. Do not exceed scope.
192
+ - Identify the phase's success metric. If no success metric is defined in the phase file, use the Scope's "Success looks like" statement; if that is also absent, log it as a watch item and proceed.
193
+ - **Pre-Execution Conformity (CM-11):** Dependencies match the graph, inputs resolve to outputs, decisions match records, tasks align with the preamble. Fail → STOP, recommend `/plan-review`. Near-misses → log as watch items.
194
+ - **Review Gate:** At EXPLORING: no scorecard check. At SHARED+ seriousness, verify scorecards exist in PLAN-NOTES.md — check `## Review Scorecards` first; if absent, fall back to `## Generation Scorecards`. Review scorecards take precedence when both exist. If Review Scorecards include a `Review Scope:` field with unaudited dimensions: at PUBLIC_LAUNCH → STOP, require full `/plan-review` before execution; at SHARED → notify the user that unaudited dimensions exist and recommend full `/plan-review` before proceeding. If no scorecards are found at PUBLIC_LAUNCH → STOP, recommend `/plan-review` before execution. If no scorecards are found at SHARED → invoke the structured-inquiry channel: question `No review scorecards were found; should execution proceed without a prior review?`; header `No review`; options:
195
+ - `Run /plan-review first (Recommended)`:
196
+ rationale: Defers execution until the review completes and scorecards are generated, satisfying the SHARED+ Review Gate's evidence requirement.
197
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (Plan Integrity — review scorecards are the prerequisite evidence for execution at SHARED+) and class 6 observed-state: missing scorecards mean the plan's prose-fidelity and internal-consistency status is unknown.
198
+ default-pointer: Run /plan-review first — safe because review is non-destructive and produces the evidence the gate requires.
199
+ - `Proceed without review`:
200
+ rationale: Execution continues; the operator's rationale is logged in PLAN-NOTES.md alongside a watch item flag.
201
+ recommendation: discouraged — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (proceeding without review evidence weakens downstream conformity checks) and class 6 observed-state: the absence of scorecards leaves prose fidelity and internal consistency unverified.
202
+ default-pointer: Run /plan-review first — proceeding without review is a documented escape hatch, not the safe default.
203
+ - `Abort`:
204
+ rationale: Halts execution; the next session can resume after the review is run independently.
205
+ recommendation: acceptable
206
+ default-pointer: Run /plan-review first — aborting forces a full re-bootstrap; running the review preserves the in-progress state cleanly.
207
+ `multiSelect: false`. If either scorecard is FAIL: at PUBLIC_LAUNCH → hard block, no override — STOP, recommend `/plan-review`; at SHARED → STOP and invoke the structured-inquiry channel: question `A review scorecard failed; the override path requires rationale. How should execution proceed?`; header `Scorecard fail`; options:
208
+ - `Run /plan-review and resolve failures (Recommended)`:
209
+ rationale: Fixes the failing dimensions before proceeding so the gate's evidence is restored to PASS.
210
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (a FAIL scorecard surfaces a structural defect; resolving the failure addresses the root cause) and class 6 observed-state: a FAIL scorecard is direct evidence of a plan-integrity defect.
211
+ default-pointer: Run /plan-review and resolve failures — safe because resolution restores the gate to PASS and unblocks execution cleanly.
212
+ - `Product Owner override`:
213
+ rationale: Proceeds with the failing scorecard in force; the operator's rationale captured via Other-text is logged in PLAN-NOTES.md and a watch-item note is added to PROGRESS.md.
214
+ recommendation: discouraged — cites class 5 rule citation: `rules/operational-mandates.md` CM-11 (overriding a FAIL scorecard propagates the underlying defect into execution artifacts) and class 6 observed-state: known plan defects compound during execution.
215
+ default-pointer: Run /plan-review and resolve failures — Product Owner override is a documented escape hatch, not the safe default.
216
+ - `Abort`:
217
+ rationale: Halts execution; the next session can resume after the failing dimensions are resolved independently.
218
+ recommendation: acceptable
219
+ default-pointer: Run /plan-review and resolve failures — aborting forces a full re-bootstrap; resolving the failure preserves the work and unblocks execution.
220
+ `multiSelect: false`. At PERSONAL_USE: if scorecards exist (from either source) and either is FAIL, notify the user (advisory only — do not block).
221
+ - If `--dry-run`: analyze and report what would be done. **STOP.**
222
+
223
+ ### Step 3: Execute Tasks
224
+
225
+ Per-task externalization (CM-24B): commit + compact summary before the next task. Deploy an Implementation Team (CM-25A) for independent subtasks — non-overlapping files only (CM-25E).
226
+
227
+ **Resume checkpoint:** If the Resumption Contract indicates this phase was previously IN PROGRESS (task in progress is not "none"), skip all completed tasks and begin at the task named in the Contract's "Next action" field. If task status is "partial", re-execute the indicated task from scratch (partial work may be inconsistent) — run `git status` to identify uncommitted modifications in the task's file scope, show the exact candidate file list and `git diff -- <files>` summary, then for each file in the list invoke the structured-inquiry channel once per file (per the §6 per-file floor of `rules/interactive-questions.md` — no `multiSelect`, no cross-file batching) with the §6.7 canonical Revert-Uncommitted option set; per invocation:
228
+ - `Discard`:
229
+ rationale: Executes `git restore --source=HEAD --worktree -- <file>`; uncommitted edits are dropped from the working tree and the revert is logged to PLAN-NOTES.md Recovery Log.
230
+ recommendation: destructive-no-default — cites class 5 rule citation: `rules/context-management.md` §6 Blind Execution Protocol (clean re-execute is the documented recovery path for partial task state) and class 6 observed-state: the resumption pointer's task-status field marks this task `partial`, indicating inconsistent intermediate state.
231
+ default-pointer: no-default: user decision required
232
+ - `Keep`:
233
+ rationale: Retains the uncommitted edits at their current paths for operator triage; the file scope remains as the operator left it.
234
+ recommendation: acceptable
235
+ default-pointer: no-default: user decision required
236
+ - `Stash-for-later`:
237
+ rationale: Stashes the uncommitted edits via `git stash push -- <file>` for later retrieval via `git stash pop`.
238
+ recommendation: acceptable
239
+ default-pointer: no-default: user decision required
240
+ - `Defer`:
241
+ rationale: Halts and re-invokes the destructive-op decision wave once the operator re-engages; no filesystem change now.
242
+ recommendation: acceptable
243
+ default-pointer: no-default: user decision required
244
+ `multiSelect: false` (per §6.8 of the canonical-channel rule — destructive-op invocations forbid `multiSelect: true`).
245
+ Verify each skipped task's declared outputs exist on disk before proceeding.
246
+
247
+ **Sub-phase iteration:** If the target phase contains sub-phase folders (e.g., `phases/02-topic/02A-subtopic/`), iterate sub-phases in lexicographic order, executing Steps 3.1–3.7 for each sub-phase's tasks. Compact between sub-phases at PERSONAL_USE+. Steps 4–8 execute once after all sub-phases complete (quality gates and verification cover the full parent phase scope). Sub-phases marked parallelizable in the dependency graph may execute via an Implementation Team (one agent per sub-phase, non-overlapping file scopes).
248
+
249
+ **3.1 — Clarify:** Purpose, acceptance criteria, expected output. Check PLAN-NOTES.md. For any ambiguity, invoke the structured-inquiry channel per `rules/interactive-questions.md` (up to 4 questions per invocation; option-framed answers with the implicit Other escape for free-text). If tests exist, use them as the behavioral specification; if absent, write behavioral assertions before implementing.
250
+
251
+ **3.2 — Search Before Implement:** Find reusable components. Flag existing similar logic.
252
+
253
+ **3.3 — Implement:** Per phase specs + preamble standards. Best solution with rationale. Strict logical rigor. All values configurable. **Plan-internal isolation (CM-7):** enforce per the canonical forbidden-terms and protected-artifacts lists in `CLAUDE.md` CM-7. Every artifact reads as natural domain-language with zero trace of planning structure. **Cognitive-filter application:** Filters 1+5 always-on; the full suite for non-trivial decisions. Seriousness scaling per `rules/cognitive-identity.md` Section 2.
254
+
255
+ **3.4 — Verify Integration:** Imports resolve, interfaces match, types align, no regressions. Run tests immediately. If unfixable without design changes beyond scope → STOP and consult the user.
256
+
257
+ **3.5 — Agent Offloading:** Follow phase hints (per the phase file's Agent Offloading Hints table). Return contracts: compact deliverables only.
258
+
259
+ **3.6 — Commit (CM-13A) — code-bearing phases:** After each task that modifies codebase files, commit immediately. Conventional commits in natural domain terms — CM-7 plan-internal isolation applies to all git artifacts. Valid, buildable, testable state. Plan-suite files are NOT auto-committed. When subtasks execute in parallel via an Implementation Team, serialize git commits — parallel agents return completed file changes to the orchestrating context, which stages and commits each task's changes sequentially (or use `isolation: "worktree"` per CM-25 §5.1 for independent staging areas). If a commit fails (pre-commit hook, merge conflict): diagnose the output, fix, retry; if a structural git issue → consult the user. At PERSONAL_USE: if per-task commits were deferred, all codebase changes for the phase MUST be committed as a single per-phase commit at the end of Step 3 before Step 4. At EXPLORING: commits are optional during tasks but recommended — if any codebase changes exist, offer to commit at the end of Step 3. **Non-code phases** carry no per-task commit obligation: each task's deliverable (a research finding, a written section, a documentation-only artifact) is recorded in the phase report (Step 7) rather than committed. When a non-code task nonetheless emits a version-controlled artifact the host tracks (e.g., a Markdown document under the repo), commit it under the same conventional-commit discipline; the exemption removes the per-task code-commit cadence, not the duty to commit artifacts the host version-controls.
260
+
261
+ **3.7 — Track:** Update the PROGRESS.md Resumption Contract with the current task number after each task commit. Update the full PROGRESS.md tracker after every 3 tasks or at least once mid-phase, whichever comes first. (PROGRESS.md updates are independent of the per-task compaction summaries in the Step 3 header.)
262
+
263
+ ### Step 4: Quality Gates
264
+
265
+ Deploy a Quality Team (CM-25A) — parallel gates: linting, formatting, type-checking, testing, security scanning, dead-code detection, import validation. Scope scales with seriousness (`CLAUDE.md` Section 4). Each agent returns pass/fail + failure details (CM-25C).
266
+
267
+ If a gate fails: diagnose, fix, re-run (up to 2 cycles — one cycle is one pass of: run all gates, diagnose all failures, fix all root causes, re-run all gates). If diagnosis reveals a root cause outside phase scope, STOP and invoke the structured-inquiry channel per `rules/interactive-questions.md` to confirm disposition — log the out-of-scope dependency in PLAN-NOTES.md. If failures persist after 2 cycles → STOP, record failure details in PLAN-NOTES.md, then invoke the structured-inquiry channel: question `Quality gates remain failing after the retry budget is exhausted; how should the phase proceed?`; header `Gate fail`; options:
268
+ - `Mark phase BLOCKED (Recommended)`:
269
+ rationale: Emits the BLOCKED phase report via Step 7's BLOCKED path, skipping Steps 5 and 6 so downstream phases can proceed around the blocker once it is resolved.
270
+ recommendation: recommended — cites class 5 rule citation: `rules/operational-mandates.md` CM-18 (Error Recovery — escalate after 3 failures) and class 6 observed-state: the 2-cycle retry budget is exhausted, indicating the failure is not transient.
271
+ default-pointer: Mark phase BLOCKED — safe because the BLOCKED state is reversible via blocker resolution and a re-execute pass per Step 2's status table.
272
+ - `Override and proceed`:
273
+ rationale: Accepts the known gate failures, logs them as watch items in PROGRESS.md, and continues execution.
274
+ recommendation: discouraged — cites class 5 rule citation: `rules/operational-mandates.md` CM-1 (Critical Evaluation — push back when suboptimal) and class 6 observed-state: known failing gates compound into systemic defects across downstream phases.
275
+ default-pointer: Mark phase BLOCKED — overriding is a documented escape hatch, not the safe default.
276
+ - `Abort execution`:
277
+ rationale: Halts the pipeline; the next session resumes from the same task per the resumption pointer.
278
+ recommendation: acceptable
279
+ default-pointer: Mark phase BLOCKED — aborting forces a full re-bootstrap, while BLOCKED preserves the work-in-progress state and unblocks the dependency graph cleanly.
280
+ `multiSelect: false`.
281
+
282
+ **Commit fixes immediately (CM-13B).**
283
+
284
+ ### Step 5: Maintenance
285
+
286
+ Deploy a Documentation Team (CM-25A) for parallel updates — one agent per file, non-overlapping (CM-25E).
287
+
288
+ **5.1** **Code-bearing phases:** Developer-guide updates — project-level guides (README, CONTRIBUTING, API docs) scoped per seriousness level. **Non-code phases** have no developer guide to update; skip 5.1.
289
+
290
+ **5.2** **Code-bearing phases:** Dependency audit — fix codebase defects, commit under CM-13B. **Non-code phases** carry no dependency tree; skip 5.2.
291
+
292
+ **5.3** CHANGELOG update (at SHARED+) — append a row to the project's `CHANGELOG.md` describing the user-facing changes from this phase. Follow Keep-A-Changelog conventions when the project ships its CHANGELOG in that format. (Applies to any phase whose deliverables are user-facing; for a non-code phase, the row describes the research/writing/documentation deliverable rather than a code change.)
293
+
294
+ ### Step 6: Verification
295
+
296
+ Deploy a Quality Team (CM-25A) for parallel verification items.
297
+
298
+ **6.1 — Universal Baseline:** Per-Phase Checklist (Preamble §8).
299
+
300
+ **6.2 — Phase-Specific:** Execute each verification assertion.
301
+
302
+ **6.3 — Outputs Check:** All deliverables complete and working.
303
+
304
+ **6.4 — Success Metric:** Confirmed. "Success looks like" matches reality.
305
+
306
+ **6.5 — Self-Review:** "Would a domain expert approve?"
307
+
308
+ **6.6 — Coherence Check (CM-15):** Implementation matches specs. Update plan files if a spec error is found.
309
+
310
+ **6.7 — Plan-Internal Isolation Check (CM-7):** Scan ALL codebase deliverables and development artifacts (per the protected-artifacts list in `CLAUDE.md` CM-7) for leaked plan-internal references (per the forbidden-terms list in `CLAUDE.md` CM-7). Any occurrence is a finding: remove and replace with natural domain-appropriate language. The entire codebase and its git history must read as if no plan ever existed.
311
+
312
+ **6.8 — Failure Remediation:** Diagnose, fix, re-run, commit (CM-13B). If unresolvable → mark BLOCKED, inform the user.
313
+
314
+ **6.9 — End-of-Phase Commit Gate (CM-13C) — code-bearing phases:** Verify ALL codebase changes from this phase have been committed. Run `git status` — if any uncommitted codebase modifications exist (source, tests, configs, schemas, build scripts, data, assets), commit them now with a domain-descriptive commit message. This gate ensures no codebase changes leak uncommitted across phase boundaries. Plan-suite files (PROGRESS.md, phase reports, PLAN-NOTES.md) remain at user discretion per CM-13 scope exclusion. **Non-code phases** carry no commit obligation: the phase's deliverables (research, writing, documentation-only artifacts) are recorded in the phase report (Step 7) rather than committed. When a non-code phase nonetheless produced version-controlled artifacts (e.g., a Markdown document checked into the repo), those artifacts ARE committed under this gate — the exemption covers the absence of a code deliverable, not the avoidance of committing artifacts the host tracks in version control.
315
+
316
+ ### Step 7: Report
317
+
318
+ > If the phase was marked BLOCKED during Step 4 (Quality Gates) or Step 6.8 (Failure Remediation), skip normal report generation. Instead, write an abbreviated BLOCKED report to the phase folder (`phases/NN-kebab-topic/REPORT.md`) documenting: which tasks completed, which task/verification failed, why it is blocked, and what must be resolved. Then proceed to Step 8 (which will mark the phase BLOCKED, not COMPLETE).
319
+
320
+ Write `phases/NN-kebab-topic/REPORT.md` per template Section 3.6 and seriousness level: at EXPLORING, skip the report (update PROGRESS.md Phase Tracker — use the Report column for a one-line summary, e.g., `Summary: [one-line]`); at PERSONAL_USE, Lightweight format only; at SHARED, Standard format; at PUBLIC_LAUNCH, Standard format with a Reflection section. Use the Lightweight-format override for non-source-code-only phases at PERSONAL_USE+. This IS the permanent externalization of the phase's work (CM-24B). Assess report size before generation (CM-23A) — use incremental appends for Standard+ format reports that may exceed 500 lines.
321
+
322
+ If this is the final phase: generate `COMPLETION.md` per seriousness level (EXPLORING: skip; PERSONAL_USE: summary only; SHARED: full template without follow-on recommendations; PUBLIC_LAUNCH: full template with follow-on recommendations). Scope per template Section 3.7.
323
+
324
+ ### Step 8: Phase Exit Protocol
325
+
326
+ **8.1 — Phase Output Registry:** For every Output declared in the phase file, verify the artifact exists on disk. Write each to the PROGRESS.md Phase Output Registry with verified status and actual path.
327
+
328
+ **8.2 — Resumption Contract:** Write a structured Resumption Contract to PROGRESS.md:
329
+
330
+ - Phase in progress / Task in progress / Task status (use "none" if the phase is fully complete).
331
+ - Next action (precise imperative for the next phase or next task; if the final phase is complete, use "Pipeline complete — see COMPLETION.md").
332
+ - Active decisions relevant to the next phase (extract from PLAN-NOTES.md).
333
+ - Convention anchors (naming, formatting, architectural patterns established or maintained).
334
+ - Critical files for the next phase (ordered list — the blind-bootstrap manifest).
335
+ - Watch items, blockers.
336
+
337
+ **8.3 — Progress Tracker:** Mark the phase COMPLETE (or BLOCKED if unresolvable issues surfaced in Step 6), update counts, set next steps. If BLOCKED: record the blocker, the blocking task/verification, and what must be resolved. If the phase contains sub-phases, verify all sub-phase tracker rows are COMPLETE before marking the parent phase COMPLETE. If any sub-phase is BLOCKED, mark the parent phase BLOCKED with a reference to the blocked sub-phase.
338
+
339
+ **8.4 — Phase Report Cross-Reference:** Ensure the phase report (Step 7) path (`phases/NN-kebab-topic/REPORT.md`) is referenced in the Phase Tracker's Report column.
340
+
341
+ ### Step 9: Create or Evolve Artifacts
342
+
343
+ Per `CLAUDE.md` Section 7.6 (including CM-22 §4: ecosystem gap detection). SHARED+: mandatory evaluation; create/evolve when the detection trigger is met (CM-22 §2). PERSONAL_USE: on corrections. EXPLORING: optional.
344
+
345
+ ### Step 10: Continuous Execution Transition (CM-16)
346
+
347
+ **10A — Granular Amendment Loop (D5 / Q-021):** Consumed at every phase boundary AND every sub-phase boundary. Read the persisted `**Execution mode (this session):**` value from the PROGRESS.md Resumption Contract (set at Step 1A). Skip the amendment-loop question — and proceed silently to the compaction + next-phase-dispatch logic below — when mode is `continuous` OR when the `--no-pause` invocation flag is set (wrapper-driven). Skip at parent-phase boundaries only when mode is `granular-sub-phase-only`. Skip at sub-phase boundaries only when mode is `granular-phase-only`. In every other combination, fire the structured inquiry below and iterate until the operator selects Continue (per D5 verbatim: `again and again until user select to end the phase/sub-phase`):
348
+
349
+ - `question:` `Phase <NN-topic> sub-phase <NNL-subtopic> complete; amendments before continuing?` (omit the sub-phase clause at parent-phase boundaries)
350
+ - `header:` `Phase amend`
351
+ - `multiSelect:` `false`
352
+ - Option `Continue (Recommended)`:
353
+ - `rationale:` Phase verification PASS; advance to the next phase or sub-phase per the dependency graph.
354
+ - `recommendation:` recommended — cites class 6 observed-state: phase Verification section completed clean and the per-phase commit-task mapping is satisfied at PUBLIC_LAUNCH.
355
+ - `default-pointer:` no-default: user decision required (the boundary gate is the operator's per-phase control point; silent advance bypasses the granular pause Q-021 ratifies).
356
+ - Option `Amend`:
357
+ - `rationale:` Operator surfaces an amendment to the just-completed phase's outputs; the agent loops back to apply the amendment, re-runs verification, then re-fires the boundary question (looping until the operator selects Continue).
358
+ - `recommendation:` acceptable
359
+ - `default-pointer:` no-default: user decision required.
360
+ - Option `Stop session`:
361
+ - `rationale:` Halts the execute session; the PROGRESS.md Resumption Contract preserves current state; the operator resumes in a later session via a fresh `/plan-execute` invocation.
362
+ - `recommendation:` destructive-no-default — cites class 5 rule citation: `rules/interactive-questions.md` §6.2 + §7.3 (destructive-irreversible class — once a session halts, intra-session active-context state is lost; the Resumption Contract is the only recovery surface and only captures externalised state) and class 6 observed-state: at PUBLIC_LAUNCH, a session halt mid-phase forfeits intra-session decisions not yet externalised to PROGRESS.md per CM-24 §2.5.
363
+ - `default-pointer:` no-default: user decision required (per the §6 destructive-op floor — the verbatim marker is required because the Stop-session leg is the destructive option of the set).
364
+
365
+ After Continue is selected (or the question is skipped under continuous / `--no-pause`):
366
+
367
+ **Mandatory compaction** between phases. Externalize all state first (CM-24B — verify no unexternalized decisions, observations, or state exist only in active context). Before compaction: verify the Phase Exit Protocol (Step 8) is fully satisfied — Resumption Contract written, Phase Output Registry updated. After compaction: execute Blind Bootstrap (Step 1B) for the next phase as if this were a fresh session.
368
+
369
+ If any context-health signal from `rules/context-management.md` §1 or any regression-detection mismatch from `rules/context-management-protocol.md` §3.4 fires before the next phase starts, execute the recovery cycle first: externalize, compact or restart the harness session, re-run Blind Bootstrap, and rerun the relevant output/input validation. Continue when the signal clears; mark BLOCKED only when durable state remains contradictory or a validation gate still fails after that cycle.
370
+
371
+ - **Single-phase invocation:** If the user specified a specific phase number (e.g., `/plan-execute my-plan/ 05`), STOP after completing that phase — do not trigger continuous execution. Continuous execution applies only to full-suite invocations (no phase number specified).
372
+ - **Next phase exists (full-suite):** Immediately proceed to Step 1 for the next phase. No user confirmation (at SHARED+). Sub-phases within a phase execute in lexicographic order (per Step 3's sub-phase iteration construct) before the next top-level phase begins.
373
+ - **Final phase:** Present COMPLETION.md (generated in Step 7). **Pipeline handoff (CM-20):** recommend `/code-review` as the canonical audit-fortress entry point (audit-fortress linear sequence: `/code-review → /code-audit → /security-audit → /perf-audit → /architecture-review → /ux-review → /a11y-audit → /docs-review → /dependency-audit → /supply-chain-audit → /threat-model-audit`). For an orthogonal read-only health snapshot, `/plan-status --verbose` is also recommended. Halt.
374
+ - **BLOCKED phase:** Log in PROGRESS.md. Walk the dependency graph transitively — mark every phase that depends on the BLOCKED phase (directly or transitively) as SKIPPED with reason "blocked upstream: Phase NN." Skip to the next phase with no dependency on the BLOCKED phase or any transitively blocked phase. If no such phase exists, inform the user that the remaining plan is fully blocked and halt.
375
+
376
+ ---
377
+
378
+ ## Critical Rules
379
+
380
+ - **NEVER assume.** Invoke the structured-inquiry channel for any ambiguity (canonical channel per `rules/interactive-questions.md`).
381
+ - **NEVER embed plan-internal references** in codebase deliverables or development artifacts — enforce the CM-7 forbidden-terms and protected-artifacts lists (`CLAUDE.md` CM-7).
382
+ - **NEVER mark complete** without all verifications passing.
383
+ - **NEVER skip** quality gates. On a **code-bearing** phase, also never skip developer-guide updates or the dependency audit (scope per seriousness); a **non-code** phase has neither, so those two are not applicable (Step 5 skips them).
384
+ - **NEVER defer commits** on a code-bearing phase — per-task at SHARED+, per-phase at PERSONAL_USE. End-of-phase commit gate (CM-13C). A non-code phase carries no commit obligation beyond committing any version-controlled artifacts the host tracks (Step 6.9).
385
+ - **NEVER exceed scope** — log out-of-scope needs in PLAN-NOTES.md.
386
+ - **NEVER stop between phases** once continuous execution is opted in (CM-16).
387
+ - **NEVER proceed** without template v0.1.0+.
388
+ - **Root-cause fixes only** — no band-aids.
389
+ - **Base protocol:** Agent Teams (CM-25) with return contracts — deployment scales with seriousness per `rules/agent-orchestration.md` (Optional at EXPLORING, Encouraged at PERSONAL_USE, Required at SHARED+). Default token budgets per CM-25C: Research 500, Audit/Quality 200, Implementation/Documentation 500, Generation 1000. Error recovery (CM-18), 3-failure escalation. Session resilience (CM-24/CM-14). Always-on rules (CM-22–28) enforced at all steps.
390
+
391
+ ---
392
+
393
+ ## Mandates
394
+
395
+ All template and config mandates are in effect. Governance scales with seriousness.
396
+
397
+ | Mandate | Enforcement Point |
398
+ | ------- | ----------------- |
399
+ | CM-7 | Step 3.3, Step 6.7: plan-internal isolation |
400
+ | CM-12d | Step 1 item 10: per-phase effort calibration (D3 stratified). Effort is operator-invoked (no shipped preset, per the agnostic posture); the recommended tier for `/plan-execute`'s mechanical implementation is the middle one, and the operator may author a PHASE.md `effort:` field to calibrate per-phase (e.g. an upper tier for a high-volume rebuild phase). Calibration scope is single-phase only and never persists. |
401
+ | CM-11 | Step 2: conformity check |
402
+ | CM-12 | All steps: lean context management |
403
+ | CM-13A | Step 3.6: per-task commits |
404
+ | CM-13B | Steps 4, 5.2, 6.8: quality/remediation commits |
405
+ | CM-13C | Step 6.9: end-of-phase commit gate |
406
+ | CM-14 | Step 1/1B: Session Start, Blind Bootstrap; pressure: Session End |
407
+ | CM-15 | Step 6.6: coherence check |
408
+ | CM-16 | Step 10: continuous-execution transition (opt-in at all seriousness levels) |
409
+ | CM-17 | Steps 1–6: Agent Teams |
410
+ | CM-18 | Critical Rules: 3-failure escalation |
411
+ | CM-19 | Step 10: mandatory; Steps 1, 3, 4, 5: proactive |
412
+ | CM-20 | Step 10: final-phase handoff |
413
+ | CM-21 | Step 3.3: creative quality in implementation decisions |
414
+ | CM-22 | Step 9: artifact evolution |
415
+ | CM-23 | Step 7: report-size assessment |
416
+ | CM-24 §6 | Step 1B: Blind Bootstrap Validation; Step 8: Phase Exit Protocol; Step 10: post-compaction bootstrap |
417
+
418
+ ---
419
+
420
+ ## Output
421
+
422
+ - Per-task codebase commits (CM-13A) — code-bearing phases.
423
+ - Quality-gate fix commits (CM-13B) — code-bearing phases.
424
+ - Execution report at the phase folder (`phases/NN-kebab-topic/REPORT.md`).
425
+ - Updated PROGRESS.md with Resumption Contract and Phase Output Registry.
426
+ - Updated PLAN-NOTES.md (if decisions made or issues logged).
427
+ - Updated developer guides (code-bearing phases) and CHANGELOG (per seriousness).
428
+ - Skills created or evolved (if applicable).
429
+ - If final phase: COMPLETION.md.
430
+ - Continuous execution: auto-transition to the next phase (CM-16, opt-in).
431
+
432
+ ---
433
+
434
+ ## Decision Tree
435
+
436
+ The command's branching logic at a glance — every decision either resolves
437
+ deterministically against state on disk or surfaces a structured-inquiry
438
+ invocation.
439
+
440
+ ```mermaid
441
+ %%{ init: { "theme": "neutral" } }%%
442
+ %% verified: 2026-06-16 %%
443
+ %% provenance: commands/plan-execute.md §Workflow %%
444
+ %% cross-reference: src/apothem/commands/ (slash-command cohort) %%
445
+ flowchart TD
446
+ Start[/plan-execute invoked/] --> Suite{Suite files present?}
447
+ Suite -->|no| Recommend[STOP — recommend /plan-generate]
448
+ Suite -->|yes| Resolve{Phase argument given?}
449
+ Resolve -->|yes| Target[Target = named phase]
450
+ Resolve -->|no| Next{All phases complete?}
451
+ Next -->|yes| AskDone[structured inquiry: phase done]
452
+ Next -->|no| Target2[Target = next pending phase]
453
+ Target --> Status{Target phase status}
454
+ Target2 --> Status
455
+ Status -->|Pending| Prereq{Prerequisites satisfied?}
456
+ Status -->|Complete| AskRedo[structured inquiry: re-execute · resume · abort]
457
+ Status -->|Blocked| AskBlock[structured inquiry: resolve · force · abort]
458
+ Status -->|Skipped| AskSkip[structured inquiry: resolve upstream · force · abort]
459
+ Status -->|InProgress| Resume[Resume from Resumption Contract pointer]
460
+ Prereq -->|no| AskPrereq[structured inquiry: run prereq · override · abort]
461
+ Prereq -->|yes| Run[Step 3: execute tasks · per-task commits]
462
+ Resume --> Run
463
+ Run --> QG{Quality gates pass?}
464
+ QG -->|no, retry budget remaining| Fix[Diagnose · fix · re-run]
465
+ Fix --> QG
466
+ QG -->|no, budget exhausted| AskGate[structured inquiry: BLOCKED · override · abort]
467
+ QG -->|yes| Verify[Step 6: verification · CM-7 isolation check]
468
+ Verify -->|fail| AskGate
469
+ Verify -->|pass| Report[Step 7: write REPORT.md]
470
+ Report --> Exit[Step 8: Phase Exit Protocol]
471
+ Exit --> Final{Final phase?}
472
+ Final -->|yes| Complete[Emit COMPLETION.md · halt]
473
+ Final -->|no| ContExec{Continuous mode opted in?}
474
+ ContExec -->|yes| Compact[Compact · bootstrap next phase]
475
+ ContExec -->|no| AskCont[structured inquiry: next phase · specific · stop]
476
+ Compact --> Resolve
477
+ ```
478
+
479
+ The tree distinguishes three fork classes: **deterministic forks** resolved
480
+ against state on disk (file presence, dependency-graph order, prerequisite
481
+ satisfaction), **structured-inquiry forks** where the operator's decision is
482
+ material and surfaces through the canonical channel, and **retry forks** where a
483
+ budget governs how many cycles attempt resolution before escalation.
484
+
485
+ ## Recommended Next Step
486
+
487
+ After the suite's phases execute, **invoke `/fortress`** to harden the executed work to a release-gated state in a single closed-loop call (detect → verify → remediate → re-audit → gate), **or invoke `/code-review`** to walk the audit-fortress chain stage-by-stage; `/code-review` is the canonical entry point of the 11-command audit-fortress sequence. `/fortress` is the wrapped hardening pipeline — plan → harden → ship — that consumes the executed phases as the surface it hardens.
488
+
489
+ ## Bindings (§0.j five-direction)
490
+
491
+ - **Drives →** ● Every phase execution across every active plan suite (the workflow's twelve-step protocol governs implementation, quality gates, verification, reporting, and continuous-execution transition). ● Per-task and per-phase commits per the cadence at Critical Rules. ● Plan-suite Phase Output Registry updates at Step 8.1. ● Continuous-execution transition between phases at Step 10 (opt-in at all seriousness levels). ● `commands/fortress.md` (the downstream hardening entry — the executed phases are the surface `/fortress` hardens to a release-gated state). ◐ The four-cycle agent-team protocol (Research / Audit / Implementation / Quality / Documentation / Generation per the Mandates table).
492
+ - **Satisfies →** ● the commands registry row "/plan-execute". ● CM-7 / CM-11 / CM-12 / CM-13 / CM-14 / CM-15 / CM-16 / CM-17 / CM-18 / CM-19 / CM-20 / CM-21 / CM-22 / CM-23 / CM-24 (the Mandates table at the workflow tail enumerates the binding mandates). ● `skills/plan-suite/master_template.md` (template v0.1.0+ requirement at the Instructions block).
493
+ - **Established by ↑** ● the `/plan` pipeline (the `/plan` pipeline-stages declaration). ● the commands registry. ● `skills/plan-suite/master_template.md` (the template this command consumes).
494
+ - **Gated by ←** ● The plan suite's mandatory file presence (PREAMBLE.md + MASTER-PLAN.md + PROGRESS.md + PLAN-NOTES.md + phases/ at Step 1). ● A git repository (Step 1.2) for code-bearing phases; a non-code phase proceeds without the git gate. ● The harness's Agent + structured-inquiry + Edit + Write tool surface.
495
+ - **Cross-bound with ↔** ↔ `commands/plan-generate.md` (generate produces the plan-suite this command executes). ↔ `commands/plan-review.md` (review's scorecards gate execution at Step 2 SHARED+). ↔ `commands/plan-status.md` (final-phase handoff at Step 10 invokes `/plan-status --verbose`). ↔ `commands/plan-spec.md` (prose refinement is the antecedent of /plan-generate). ↔ `commands/fortress.md` (the hardening pipeline the executed work flows into — plan → harden → ship; `/fortress` hardens the phases this command executes, while `/code-review` enters the same hardening as the stage-by-stage chain). ↔ `rules/context-management.md` (Step 1B Blind Bootstrap; Step 8 Phase Exit Protocol; Step 10 post-compaction bootstrap). ↔ `rules/agent-orchestration.md` (Steps 1–6 dispatch agent teams). ↔ `rules/interactive-questions.md` (every structured-inquiry invocation in the workflow).