phase-loop-runtime 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. phase_loop_runtime/__init__.py +20 -0
  2. phase_loop_runtime/_contract_docs/phase-loop/extraction-readiness.md +90 -0
  3. phase_loop_runtime/_contract_docs/phase-loop/granular-execution-policy.md +137 -0
  4. phase_loop_runtime/_contract_docs/phase-loop/harness-capability-matrix.md +510 -0
  5. phase_loop_runtime/_contract_docs/phase-loop/harness-skill-matrix.md +125 -0
  6. phase_loop_runtime/_contract_docs/phase-loop/harness-substrate-manifest.md +232 -0
  7. phase_loop_runtime/_contract_docs/phase-loop/pi-loop-control.md +247 -0
  8. phase_loop_runtime/_contract_docs/phase-loop/protocol.md +2759 -0
  9. phase_loop_runtime/_contract_docs/phase-loop/runtime-boundary.md +289 -0
  10. phase_loop_runtime/_contract_docs/phase-loop/spec-discovery-roots.md +47 -0
  11. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-governed-pipeline.md +42 -0
  12. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-portal-projection.md +34 -0
  13. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-regenesis.md +29 -0
  14. phase_loop_runtime/_contract_docs/phase-loop/substrate-soak-report.md +32 -0
  15. phase_loop_runtime/_contract_docs/runtime/verification-evidence-contract.md +52 -0
  16. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/commands.txt +2 -0
  17. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/manifest.json +16 -0
  18. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-mixed-signals/mixed.json +5 -0
  19. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/manifest.json +16 -0
  20. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-provider-timeout/timeout-note.txt +2 -0
  21. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/manifest.json +16 -0
  22. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-redacted-summary/redacted-summary.json +6 -0
  23. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/manifest.json +16 -0
  24. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-small-sample/sample.json +7 -0
  25. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/edge.txt +2 -0
  26. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/borderline/borderline-threshold-edge/manifest.json +16 -0
  27. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/manifest.json +16 -0
  28. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-a.txt +1 -0
  29. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-b.txt +1 -0
  30. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-duplicate-png/shot-c.txt +1 -0
  31. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/claimed-results.json +5 -0
  32. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-missing-references/manifest.json +16 -0
  33. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/manifest.json +16 -0
  34. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-subtle-low-variance/metrics.json +9 -0
  35. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/findings.md +10 -0
  36. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-templated-prose/manifest.json +16 -0
  37. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/manifest.json +16 -0
  38. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/scores.json +4 -0
  39. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-fake/fake-uniform-scores/summary.txt +1 -0
  40. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/bundle-check.json +8 -0
  41. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/manifest.json +16 -0
  42. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-adoption-bundle/operator-note.txt +2 -0
  43. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/events-sample.jsonl +3 -0
  44. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/manifest.json +16 -0
  45. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-handoff-ledger/receipt.txt +1 -0
  46. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/evidence.json +13 -0
  47. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/manifest.json +16 -0
  48. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-runner-diff/summary.txt +2 -0
  49. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/manifest.json +16 -0
  50. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/matrix.json +9 -0
  51. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-test-matrix/notes.md +4 -0
  52. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/console-summary.txt +2 -0
  53. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/manifest.json +16 -0
  54. phase_loop_runtime/_test_fixtures/evidence-audit-calibration/known-real/real-ui-screenshot-standin/screenshot-standin.ppm +5 -0
  55. phase_loop_runtime/adoption_bundle.py +273 -0
  56. phase_loop_runtime/advisor_board/CONTRACTS.md +257 -0
  57. phase_loop_runtime/advisor_board/__init__.py +288 -0
  58. phase_loop_runtime/advisor_board/backing.py +137 -0
  59. phase_loop_runtime/advisor_board/backing_omnigent.py +498 -0
  60. phase_loop_runtime/advisor_board/config.py +225 -0
  61. phase_loop_runtime/advisor_board/events.py +115 -0
  62. phase_loop_runtime/advisor_board/fixtures/advisor-boards.example.toml +59 -0
  63. phase_loop_runtime/advisor_board/fixtures.py +91 -0
  64. phase_loop_runtime/advisor_board/harness_mapping.py +125 -0
  65. phase_loop_runtime/advisor_board/matrix.py +146 -0
  66. phase_loop_runtime/advisor_board/observability.py +481 -0
  67. phase_loop_runtime/advisor_board/presets.py +188 -0
  68. phase_loop_runtime/advisor_board/registries.py +309 -0
  69. phase_loop_runtime/advisor_board/resolver.py +253 -0
  70. phase_loop_runtime/advisor_board/schema.py +269 -0
  71. phase_loop_runtime/advisor_board/standin.py +166 -0
  72. phase_loop_runtime/advisor_board/validation.py +159 -0
  73. phase_loop_runtime/agent_runtime_provider.py +676 -0
  74. phase_loop_runtime/baml_modular.py +656 -0
  75. phase_loop_runtime/baml_src/dotfiles_adoption_manifest.baml +37 -0
  76. phase_loop_runtime/baml_src/dotfiles_c4_document.baml +14 -0
  77. phase_loop_runtime/baml_src/dotfiles_plan_manifest.baml +50 -0
  78. phase_loop_runtime/baml_src/dotfiles_runtime_projection.baml +16 -0
  79. phase_loop_runtime/baml_src/dotfiles_task_catalog.baml +20 -0
  80. phase_loop_runtime/baml_src/emit_phase_closeout.baml +86 -0
  81. phase_loop_runtime/baml_src/evaluate_suspected_fake_evidence.baml +36 -0
  82. phase_loop_runtime/baml_src/verification_evidence.baml +40 -0
  83. phase_loop_runtime/broker.py +181 -0
  84. phase_loop_runtime/build_bundle.py +294 -0
  85. phase_loop_runtime/capability_registry.py +835 -0
  86. phase_loop_runtime/classifier.py +87 -0
  87. phase_loop_runtime/claude_agent_view.py +625 -0
  88. phase_loop_runtime/claude_channel_sidecar.py +1086 -0
  89. phase_loop_runtime/cli.py +2599 -0
  90. phase_loop_runtime/closeout.py +865 -0
  91. phase_loop_runtime/closeout_classifier.py +120 -0
  92. phase_loop_runtime/closeout_evidence_audit.py +112 -0
  93. phase_loop_runtime/closeout_validation.py +144 -0
  94. phase_loop_runtime/closeout_validators.py +203 -0
  95. phase_loop_runtime/consiliency_gates.py +374 -0
  96. phase_loop_runtime/consiliency_ingest.py +399 -0
  97. phase_loop_runtime/consiliency_layout.py +176 -0
  98. phase_loop_runtime/consiliency_scaffold.py +305 -0
  99. phase_loop_runtime/cross_repo_channel.py +331 -0
  100. phase_loop_runtime/discovery.py +2368 -0
  101. phase_loop_runtime/dispatch_lock.py +167 -0
  102. phase_loop_runtime/doc_delta_validator.py +98 -0
  103. phase_loop_runtime/docs_audit.py +285 -0
  104. phase_loop_runtime/docs_freshness.py +468 -0
  105. phase_loop_runtime/docs_surfaces.py +150 -0
  106. phase_loop_runtime/dotfiles_profile_plugin.py +96 -0
  107. phase_loop_runtime/events.py +154 -0
  108. phase_loop_runtime/events_migration.py +96 -0
  109. phase_loop_runtime/evidence_audit.py +1082 -0
  110. phase_loop_runtime/evidence_audit_config.py +172 -0
  111. phase_loop_runtime/fleet_map.py +426 -0
  112. phase_loop_runtime/fleet_metrics.py +298 -0
  113. phase_loop_runtime/fleet_metrics_export.py +196 -0
  114. phase_loop_runtime/git_discipline.py +479 -0
  115. phase_loop_runtime/git_ops.py +122 -0
  116. phase_loop_runtime/git_topology.py +252 -0
  117. phase_loop_runtime/governed_bundle.py +137 -0
  118. phase_loop_runtime/governed_premerge.py +219 -0
  119. phase_loop_runtime/governed_review.py +264 -0
  120. phase_loop_runtime/handoff.py +932 -0
  121. phase_loop_runtime/handoff_path.py +14 -0
  122. phase_loop_runtime/injection.py +740 -0
  123. phase_loop_runtime/install_status.py +88 -0
  124. phase_loop_runtime/lane_scheduler.py +317 -0
  125. phase_loop_runtime/launcher.py +2760 -0
  126. phase_loop_runtime/lease_store.py +553 -0
  127. phase_loop_runtime/maintenance.py +401 -0
  128. phase_loop_runtime/migrate_handoffs.py +201 -0
  129. phase_loop_runtime/models.py +2144 -0
  130. phase_loop_runtime/observability.py +1290 -0
  131. phase_loop_runtime/panel_invoker.py +1638 -0
  132. phase_loop_runtime/phase_loop_drift_audit.py +388 -0
  133. phase_loop_runtime/phase_worktree_executor.py +433 -0
  134. phase_loop_runtime/pipeline_adapter/__init__.py +12 -0
  135. phase_loop_runtime/pipeline_adapter/branch_ops.py +274 -0
  136. phase_loop_runtime/pipeline_adapter/flag.py +55 -0
  137. phase_loop_runtime/pipeline_adapter/markers.py +13 -0
  138. phase_loop_runtime/pipeline_adapter/merge_policy.py +72 -0
  139. phase_loop_runtime/pipeline_adapter/ratification.py +100 -0
  140. phase_loop_runtime/pipeline_adapter/sibling_matcher.py +123 -0
  141. phase_loop_runtime/plan_ir.py +523 -0
  142. phase_loop_runtime/plan_manifest.py +415 -0
  143. phase_loop_runtime/planner_validation.py +176 -0
  144. phase_loop_runtime/profiles.py +462 -0
  145. phase_loop_runtime/prompts.py +365 -0
  146. phase_loop_runtime/provenance.py +165 -0
  147. phase_loop_runtime/publishing.py +339 -0
  148. phase_loop_runtime/py.typed +1 -0
  149. phase_loop_runtime/reconcile.py +1550 -0
  150. phase_loop_runtime/redaction.py +184 -0
  151. phase_loop_runtime/reflection_sync.py +293 -0
  152. phase_loop_runtime/release_guard.py +186 -0
  153. phase_loop_runtime/render.py +432 -0
  154. phase_loop_runtime/repo_validation.py +427 -0
  155. phase_loop_runtime/review_summary.py +150 -0
  156. phase_loop_runtime/roadmap_lint.py +425 -0
  157. phase_loop_runtime/route_log.py +59 -0
  158. phase_loop_runtime/route_policy/__init__.py +11 -0
  159. phase_loop_runtime/route_policy/fixtures/route_selection.golden.json +263 -0
  160. phase_loop_runtime/runner.py +8400 -0
  161. phase_loop_runtime/runtime_paths.py +225 -0
  162. phase_loop_runtime/runtime_projection.py +113 -0
  163. phase_loop_runtime/runtime_resources.py +36 -0
  164. phase_loop_runtime/schema_export.py +292 -0
  165. phase_loop_runtime/schemas/phase_loop_closeout.schema.json +366 -0
  166. phase_loop_runtime/skill_install.py +176 -0
  167. phase_loop_runtime/skill_inventory.py +662 -0
  168. phase_loop_runtime/skill_paths.py +42 -0
  169. phase_loop_runtime/skill_sources_plugin.py +37 -0
  170. phase_loop_runtime/skills_bundle/claude-advisor-board/README.md +1 -0
  171. phase_loop_runtime/skills_bundle/claude-advisor-board/SKILL.md +38 -0
  172. phase_loop_runtime/skills_bundle/claude-advisor-panel/README.md +1 -0
  173. phase_loop_runtime/skills_bundle/claude-advisor-panel/SKILL.md +38 -0
  174. phase_loop_runtime/skills_bundle/claude-execute-detailed/README.md +1 -0
  175. phase_loop_runtime/skills_bundle/claude-execute-detailed/SKILL.md +152 -0
  176. phase_loop_runtime/skills_bundle/claude-execute-phase/README.md +1 -0
  177. phase_loop_runtime/skills_bundle/claude-execute-phase/SKILL.md +745 -0
  178. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  179. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  180. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  181. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  182. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  183. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  184. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  185. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/state.py +274 -0
  186. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  187. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/team_teardown.sh +32 -0
  188. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/validate_plan_doc.py +642 -0
  189. phase_loop_runtime/skills_bundle/claude-execute-phase/scripts/verify_harness.sh +96 -0
  190. phase_loop_runtime/skills_bundle/claude-phase-loop/README.md +1 -0
  191. phase_loop_runtime/skills_bundle/claude-phase-loop/SKILL.md +115 -0
  192. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/README.md +1 -0
  193. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/SKILL.md +439 -0
  194. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/assets/review_prompt.md +19 -0
  195. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  196. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/references/roadmap-template.md +193 -0
  197. phase_loop_runtime/skills_bundle/claude-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  198. phase_loop_runtime/skills_bundle/claude-plan-detailed/README.md +1 -0
  199. phase_loop_runtime/skills_bundle/claude-plan-detailed/SKILL.md +334 -0
  200. phase_loop_runtime/skills_bundle/claude-plan-detailed/assets/review_prompt.md +25 -0
  201. phase_loop_runtime/skills_bundle/claude-plan-phase/README.md +1 -0
  202. phase_loop_runtime/skills_bundle/claude-plan-phase/SKILL.md +776 -0
  203. phase_loop_runtime/skills_bundle/claude-plan-phase/assets/review_prompt.md +17 -0
  204. phase_loop_runtime/skills_bundle/claude-plan-phase/scripts/validate_plan_doc.py +1092 -0
  205. phase_loop_runtime/skills_bundle/claude-run-train/README.md +1 -0
  206. phase_loop_runtime/skills_bundle/claude-run-train/SKILL.md +75 -0
  207. phase_loop_runtime/skills_bundle/claude-skill-editor/README.md +1 -0
  208. phase_loop_runtime/skills_bundle/claude-skill-editor/SKILL.md +243 -0
  209. phase_loop_runtime/skills_bundle/claude-skill-editor/assets/editor_prompt.md +72 -0
  210. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/README.md +1 -0
  211. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/SKILL.md +249 -0
  212. phase_loop_runtime/skills_bundle/claude-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  213. phase_loop_runtime/skills_bundle/claude-task-contextualizer/README.md +1 -0
  214. phase_loop_runtime/skills_bundle/claude-task-contextualizer/SKILL.md +74 -0
  215. phase_loop_runtime/skills_bundle/claude-task-contextualizer/references/task-templates.md +103 -0
  216. phase_loop_runtime/skills_bundle/codex-advisor-board/README.md +1 -0
  217. phase_loop_runtime/skills_bundle/codex-advisor-board/SKILL.md +38 -0
  218. phase_loop_runtime/skills_bundle/codex-advisor-panel/README.md +1 -0
  219. phase_loop_runtime/skills_bundle/codex-advisor-panel/SKILL.md +38 -0
  220. phase_loop_runtime/skills_bundle/codex-execute-detailed/README.md +1 -0
  221. phase_loop_runtime/skills_bundle/codex-execute-detailed/SKILL.md +154 -0
  222. phase_loop_runtime/skills_bundle/codex-execute-phase/README.md +1 -0
  223. phase_loop_runtime/skills_bundle/codex-execute-phase/SKILL.md +231 -0
  224. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  225. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  226. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  227. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  228. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  229. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  230. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  231. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/state.py +274 -0
  232. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  233. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/team_teardown.sh +32 -0
  234. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/validate_plan_doc.py +642 -0
  235. phase_loop_runtime/skills_bundle/codex-execute-phase/scripts/verify_harness.sh +96 -0
  236. phase_loop_runtime/skills_bundle/codex-phase-loop/README.md +1 -0
  237. phase_loop_runtime/skills_bundle/codex-phase-loop/SKILL.md +248 -0
  238. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/README.md +1 -0
  239. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/SKILL.md +150 -0
  240. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/assets/review_prompt.md +19 -0
  241. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  242. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/references/roadmap-template.md +193 -0
  243. phase_loop_runtime/skills_bundle/codex-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  244. phase_loop_runtime/skills_bundle/codex-plan-detailed/README.md +1 -0
  245. phase_loop_runtime/skills_bundle/codex-plan-detailed/SKILL.md +119 -0
  246. phase_loop_runtime/skills_bundle/codex-plan-detailed/assets/review_prompt.md +25 -0
  247. phase_loop_runtime/skills_bundle/codex-plan-phase/README.md +1 -0
  248. phase_loop_runtime/skills_bundle/codex-plan-phase/SKILL.md +307 -0
  249. phase_loop_runtime/skills_bundle/codex-plan-phase/assets/review_prompt.md +17 -0
  250. phase_loop_runtime/skills_bundle/codex-plan-phase/scripts/validate_plan_doc.py +1092 -0
  251. phase_loop_runtime/skills_bundle/codex-run-train/README.md +1 -0
  252. phase_loop_runtime/skills_bundle/codex-run-train/SKILL.md +75 -0
  253. phase_loop_runtime/skills_bundle/codex-skill-editor/README.md +1 -0
  254. phase_loop_runtime/skills_bundle/codex-skill-editor/SKILL.md +94 -0
  255. phase_loop_runtime/skills_bundle/codex-skill-editor/assets/editor_prompt.md +72 -0
  256. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/README.md +1 -0
  257. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/SKILL.md +114 -0
  258. phase_loop_runtime/skills_bundle/codex-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  259. phase_loop_runtime/skills_bundle/codex-task-contextualizer/README.md +1 -0
  260. phase_loop_runtime/skills_bundle/codex-task-contextualizer/SKILL.md +102 -0
  261. phase_loop_runtime/skills_bundle/codex-task-contextualizer/references/task-templates.md +103 -0
  262. phase_loop_runtime/skills_bundle/gemini-advisor-board/README.md +1 -0
  263. phase_loop_runtime/skills_bundle/gemini-advisor-board/SKILL.md +38 -0
  264. phase_loop_runtime/skills_bundle/gemini-advisor-panel/README.md +1 -0
  265. phase_loop_runtime/skills_bundle/gemini-advisor-panel/SKILL.md +38 -0
  266. phase_loop_runtime/skills_bundle/gemini-execute-detailed/README.md +1 -0
  267. phase_loop_runtime/skills_bundle/gemini-execute-detailed/SKILL.md +144 -0
  268. phase_loop_runtime/skills_bundle/gemini-execute-phase/README.md +1 -0
  269. phase_loop_runtime/skills_bundle/gemini-execute-phase/SKILL.md +198 -0
  270. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  271. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  272. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  273. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  274. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  275. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  276. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  277. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/state.py +274 -0
  278. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  279. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/team_teardown.sh +32 -0
  280. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/validate_plan_doc.py +642 -0
  281. phase_loop_runtime/skills_bundle/gemini-execute-phase/scripts/verify_harness.sh +96 -0
  282. phase_loop_runtime/skills_bundle/gemini-phase-loop/README.md +1 -0
  283. phase_loop_runtime/skills_bundle/gemini-phase-loop/SKILL.md +111 -0
  284. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/README.md +1 -0
  285. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/SKILL.md +147 -0
  286. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/assets/review_prompt.md +19 -0
  287. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  288. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/references/roadmap-template.md +193 -0
  289. phase_loop_runtime/skills_bundle/gemini-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  290. phase_loop_runtime/skills_bundle/gemini-plan-detailed/README.md +1 -0
  291. phase_loop_runtime/skills_bundle/gemini-plan-detailed/SKILL.md +119 -0
  292. phase_loop_runtime/skills_bundle/gemini-plan-detailed/assets/review_prompt.md +25 -0
  293. phase_loop_runtime/skills_bundle/gemini-plan-phase/README.md +1 -0
  294. phase_loop_runtime/skills_bundle/gemini-plan-phase/SKILL.md +217 -0
  295. phase_loop_runtime/skills_bundle/gemini-plan-phase/assets/review_prompt.md +17 -0
  296. phase_loop_runtime/skills_bundle/gemini-plan-phase/scripts/validate_plan_doc.py +1092 -0
  297. phase_loop_runtime/skills_bundle/gemini-run-train/README.md +1 -0
  298. phase_loop_runtime/skills_bundle/gemini-run-train/SKILL.md +75 -0
  299. phase_loop_runtime/skills_bundle/gemini-skill-editor/README.md +1 -0
  300. phase_loop_runtime/skills_bundle/gemini-skill-editor/SKILL.md +87 -0
  301. phase_loop_runtime/skills_bundle/gemini-skill-editor/assets/editor_prompt.md +72 -0
  302. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/README.md +1 -0
  303. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/SKILL.md +109 -0
  304. phase_loop_runtime/skills_bundle/gemini-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  305. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/README.md +1 -0
  306. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/SKILL.md +98 -0
  307. phase_loop_runtime/skills_bundle/gemini-task-contextualizer/references/task-templates.md +103 -0
  308. phase_loop_runtime/skills_bundle/opencode-advisor-board/README.md +1 -0
  309. phase_loop_runtime/skills_bundle/opencode-advisor-board/SKILL.md +38 -0
  310. phase_loop_runtime/skills_bundle/opencode-advisor-panel/README.md +1 -0
  311. phase_loop_runtime/skills_bundle/opencode-advisor-panel/SKILL.md +38 -0
  312. phase_loop_runtime/skills_bundle/opencode-execute-detailed/README.md +1 -0
  313. phase_loop_runtime/skills_bundle/opencode-execute-detailed/SKILL.md +144 -0
  314. phase_loop_runtime/skills_bundle/opencode-execute-phase/README.md +1 -0
  315. phase_loop_runtime/skills_bundle/opencode-execute-phase/SKILL.md +196 -0
  316. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/allocate_worktree_name.sh +33 -0
  317. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/audit_lane_file_touches.py +197 -0
  318. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/cleanup_lane_worktrees.sh +103 -0
  319. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/parent_tree_leakage_check.sh +125 -0
  320. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/post_merge_import_smoke.sh +62 -0
  321. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/pre_merge_destructiveness_check.sh +127 -0
  322. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/resolve_branch_from_sha.sh +51 -0
  323. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/state.py +274 -0
  324. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/sweep_stale_worktrees.sh +62 -0
  325. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/team_teardown.sh +32 -0
  326. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/validate_plan_doc.py +642 -0
  327. phase_loop_runtime/skills_bundle/opencode-execute-phase/scripts/verify_harness.sh +96 -0
  328. phase_loop_runtime/skills_bundle/opencode-phase-loop/README.md +1 -0
  329. phase_loop_runtime/skills_bundle/opencode-phase-loop/SKILL.md +113 -0
  330. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/README.md +1 -0
  331. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/SKILL.md +147 -0
  332. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/assets/review_prompt.md +19 -0
  333. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/parallelization-heuristics.md +111 -0
  334. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/references/roadmap-template.md +193 -0
  335. phase_loop_runtime/skills_bundle/opencode-phase-roadmap-builder/scripts/validate_roadmap.py +32 -0
  336. phase_loop_runtime/skills_bundle/opencode-plan-detailed/README.md +1 -0
  337. phase_loop_runtime/skills_bundle/opencode-plan-detailed/SKILL.md +119 -0
  338. phase_loop_runtime/skills_bundle/opencode-plan-detailed/assets/review_prompt.md +25 -0
  339. phase_loop_runtime/skills_bundle/opencode-plan-phase/README.md +1 -0
  340. phase_loop_runtime/skills_bundle/opencode-plan-phase/SKILL.md +211 -0
  341. phase_loop_runtime/skills_bundle/opencode-plan-phase/assets/review_prompt.md +17 -0
  342. phase_loop_runtime/skills_bundle/opencode-plan-phase/scripts/validate_plan_doc.py +1092 -0
  343. phase_loop_runtime/skills_bundle/opencode-run-train/README.md +1 -0
  344. phase_loop_runtime/skills_bundle/opencode-run-train/SKILL.md +75 -0
  345. phase_loop_runtime/skills_bundle/opencode-skill-editor/README.md +1 -0
  346. phase_loop_runtime/skills_bundle/opencode-skill-editor/SKILL.md +87 -0
  347. phase_loop_runtime/skills_bundle/opencode-skill-editor/assets/editor_prompt.md +72 -0
  348. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/README.md +1 -0
  349. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/SKILL.md +109 -0
  350. phase_loop_runtime/skills_bundle/opencode-skill-improvement-planner/assets/aggregator_prompt.md +79 -0
  351. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/README.md +1 -0
  352. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/SKILL.md +98 -0
  353. phase_loop_runtime/skills_bundle/opencode-task-contextualizer/references/task-templates.md +103 -0
  354. phase_loop_runtime/state.py +156 -0
  355. phase_loop_runtime/state_degradation.py +136 -0
  356. phase_loop_runtime/state_ops.py +676 -0
  357. phase_loop_runtime/train_ledger.py +215 -0
  358. phase_loop_runtime/train_roadmap.py +339 -0
  359. phase_loop_runtime/train_runner.py +1197 -0
  360. phase_loop_runtime/verification_evidence.py +650 -0
  361. phase_loop_runtime/verification_evidence_validator.py +75 -0
  362. phase_loop_runtime/visual_evidence_validator.py +36 -0
  363. phase_loop_runtime/worker_pool.py +123 -0
  364. phase_loop_runtime/worktree_index.py +270 -0
  365. phase_loop_runtime-0.2.0.data/data/share/phase-loop-runtime/protocol/protocol.md +2475 -0
  366. phase_loop_runtime-0.2.0.dist-info/METADATA +106 -0
  367. phase_loop_runtime-0.2.0.dist-info/RECORD +370 -0
  368. phase_loop_runtime-0.2.0.dist-info/WHEEL +5 -0
  369. phase_loop_runtime-0.2.0.dist-info/entry_points.txt +9 -0
  370. phase_loop_runtime-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: gemini-run-train
3
+ description: "Harness CLI entry point for the cross-repo release-train coordinator. Use when the user wants to run, resume, or inspect a multi-repo train roadmap: draft PRs across all nodes in topo order, gather train-level review, then merge sequentially with downstream re-verification."
4
+ ---
5
+
6
+ # Harness Run Train
7
+
8
+ Thin bridge for the `phase-loop run-train` coordinator. All preflight,
9
+ draft-PR sequencing, train-level review, sequential merge, and downstream
10
+ re-verify logic lives in the runtime; this skill is the human entry point only.
11
+ Do NOT re-implement or contradict runtime guarantees here.
12
+
13
+ ## Core Rules
14
+
15
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
16
+
17
+ - Use the repo-local CLI: `phase-loop run-train --train <train-roadmap-file>`.
18
+ - Pass `--governed` to enable the merge phase (train-level review + sequential
19
+ merge + downstream re-verify). Omitting `--governed` stops at `drafts_open`.
20
+ - Do NOT invoke `phase-loop run` on the train roadmap file — that is the
21
+ per-repo loop and will not orchestrate a multi-repo train.
22
+ - Do NOT merge, force-push, or close PRs outside the coordinator; the runtime
23
+ enforces the partial-merge and false-green guards.
24
+ - Inspect `phase-loop train-status --train <file>` to check the ledger without
25
+ modifying state.
26
+
27
+ ## Inputs
28
+
29
+ - Train roadmap path: a Markdown file with `## Nodes` listing
30
+ `### Node: <repo> / <plan>` entries with `**Depends on:**` and
31
+ `**Channel:**` fields.
32
+ - Optional `--governed` flag: activates train-level review → sequential merge →
33
+ downstream re-verify.
34
+ - Optional `--ledger <path>`: explicit ledger path for crash-resume.
35
+
36
+ ## Workflow
37
+
38
+ 1. Resolve the train roadmap path (explicit arg or the user-supplied path).
39
+ 2. Run preflight:
40
+ `phase-loop run-train --train <file> --dry-run` (or inspect logs for
41
+ preflight errors before the first real run).
42
+ 3. Open draft PRs across all nodes in topo order:
43
+ `phase-loop run-train --train <file>`
44
+ The coordinator runs each repo's `run_loop` in series; a preflight failure
45
+ stops before any PR is opened.
46
+ 4. After all draft PRs are open (`status=drafts_open`), gather review:
47
+ `phase-loop run-train --train <file> --governed`
48
+ The train-level panel reviews the full set of draft changes.
49
+ 5. On approval, the coordinator merges upstream nodes first, then re-verifies
50
+ each downstream node against the upstream MERGED SHA before merging it.
51
+ A re-verify failure halts the merge at that node; upstream merges are
52
+ forward-only (never reverted).
53
+ 6. Inspect the outcome: `phase-loop train-status --train <file>`.
54
+
55
+ ## Failure Diagnostics
56
+
57
+ - `preflight_failed`: one or more nodes failed preflight checks; zero PRs were
58
+ opened. Fix the reported issues and re-run.
59
+ - `drafts_open`: draft PRs opened; merge phase not yet run. Pass `--governed`
60
+ to continue to review and merge.
61
+ - `review_halted`: the train-level panel did not approve; `terminal_blocker`
62
+ carries `human_required=False` (the block is a non-human review terminal).
63
+ No nodes were merged. Re-run after addressing review findings.
64
+ - `merge_halted`: upstream node(s) merged but a downstream re-verify failed;
65
+ the failed node and all its dependents are blocked. The forward-only guard
66
+ means already-merged nodes stay merged. Fix the integration issue and resume.
67
+ - `merge_failed`: a merge call returned an error (e.g. conflict, branch
68
+ protection). The ledger records the failed node as `blocked`. Fix and resume.
69
+
70
+ ## Resume
71
+
72
+ The coordinator is crash-resumable. If a run is interrupted, re-invoke the
73
+ same command with `--governed`; the ledger state drives which nodes are skipped
74
+ (already merged), re-verified (upstream merged but downstream not yet merged),
75
+ or retried (blocked).
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: gemini-skill-editor
3
+ description: "Harness skill editor. Use when the user wants to apply an improvement plan produced by <harness>-skill-improvement-planner to Harness skill files. Edits only targeted `<harness>-*` skills by default, archives consumed reflections after successful edits, and uses structured file-editing tools for manual changes."
4
+ ---
5
+
6
+ # Harness Skill Editor
7
+
8
+ Applies a structured improvement plan to Harness skill files. It is deliberately narrower than arbitrary skill editing: it consumes plans from `<harness>-skill-improvement-planner` and updates the named target skills.
9
+
10
+ ## Core Rules
11
+
12
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
13
+
14
+ - Harness meta-skill source changes move through three tiers: canonical source at `<harness>-config/skills/<harness>-<skill>/SKILL.md`, harness-neutral bundle at `vendor/phase-loop-skills/<bare-skill>/SKILL.md`, and installed runtime roots at `~/.claude/skills/`, `~/.codex/skills/`, `~/.gemini/skills/`, and `~/.opencode/skills/`.
15
+ - The harness-neutral bundle is currently bundle-derived-from-codex. Leave `vendor/phase-loop-skills/` and installed runtime roots stale until the end-of-v36 cutover; after edits, report bundle regeneration from the codex-derived source path plus `./bootstrap.sh` as the required follow-up. `./bootstrap.sh` installs the bundle with `python3 -m phase_loop_runtime.cli install --source vendor/phase-loop-skills --symlink --apply`.
16
+ - Read the improvement plan and target `SKILL.md` before editing.
17
+ - Use the active session's file-editing tool for manual edits.
18
+ - Edit only skills named by the plan.
19
+ - Default target set is `<harness>-*` skills. Do not edit the original Claude-oriented skills unless the plan explicitly names them and the user confirms that scope.
20
+ - Preserve skill frontmatter validity.
21
+ - Do not push or commit unless the user explicitly requests it.
22
+ - Archive consumed reflections only after all recommendations citing them succeeded.
23
+
24
+ ## Pipeline
25
+
26
+ The three-tier pipeline is canonical source -> harness-neutral bundle -> installed runtime roots. Edit only `<harness>-config/skills/<harness>-<skill>/SKILL.md` during this skill-editor workflow; bundle regeneration plus `./bootstrap.sh` is the explicit cutover trigger after approved canonical edits.
27
+
28
+ ## Inputs
29
+
30
+ - Plan path: explicit path, or latest `resolve_skill_bundle_root("gemini")/<harness>-skill-improvement-planner/plans/plan-v*.md`.
31
+ - `--dry-run`: parse and report intended edits without changing files.
32
+
33
+ If no plan path is explicit, first check the current repo and branch handoff from `<harness>-skill-improvement-planner` using `<harness>-config/shared/runtime-state.md`: read the repo-local handoff resolver target `.dev-skills/handoffs/<harness>-skill-improvement-planner/latest.md`, validate `from`, `repo`, `repo_root`, `branch`, `branch_slug`, `commit`, and `artifact`, then use the artifact only if it exists under the current repo root. Ignore missing or mismatched handoffs unless the user explicitly asks to reuse cross-branch state.
34
+
35
+ ## Workflow
36
+
37
+ 1. Resolve and read the plan.
38
+ 2. Parse:
39
+ - `reflections_consumed`;
40
+ - recommendations by skill;
41
+ - cross-cutting recommendations;
42
+ - contradictions.
43
+ 3. If contradictions exist, stop and ask the user how to resolve them unless the plan already contains a resolution.
44
+ 4. Validate target skills:
45
+ - source path under `<harness>-config/skills/<harness>-<skill>/SKILL.md` when working in this dotfiles repo;
46
+ - symlink/runtime path under `resolve_skill_bundle_root("gemini")/<skill>/SKILL.md` only when no source path exists.
47
+ 5. For `--dry-run`, report the target files and recommendation summaries, then stop.
48
+ 6. Apply recommendations:
49
+ - group changes per target skill to avoid conflicting edits;
50
+ - keep `SKILL.md` concise;
51
+ - move lengthy examples into `references/`;
52
+ - update `agents/openai.yaml` when display metadata becomes stale.
53
+ 7. Validate:
54
+ - YAML frontmatter parses;
55
+ - `name` matches the skill directory intent;
56
+ - `description` clearly states trigger scope and non-scope;
57
+ - referenced files exist.
58
+ 8. Archive reflections:
59
+ - move successfully consumed reflection files to an `archive/` directory under the same repo and branch subtree;
60
+ - leave reflections in place for failed recommendations.
61
+
62
+ ## Failure Policy
63
+
64
+ - Malformed plan: stop and report exact parse failure.
65
+ - Missing target skill: mark that recommendation failed; continue only if other independent targets remain.
66
+ - Patch conflict: re-read the file, adjust once, then report if still blocked.
67
+ - Validation failure: fix if local to the edit; otherwise roll forward with a clear report and do not archive affected reflections.
68
+
69
+ ## Closeout
70
+
71
+ Closeout payload shape is defined by `EmitPhaseCloseout` in `phase_loop_runtime/baml_src/emit_phase_closeout.baml` (if that path is absent in the checkout, use the operator/prompt-supplied field contract or the installed `phase_loop_runtime` package — the missing vendored BAML source is not a blocker); keep skill text focused on value selection and handoff routing, not duplicated field ceremony.
72
+
73
+ Report:
74
+
75
+ - applied recommendations;
76
+ - skipped or failed recommendations;
77
+ - files changed;
78
+ - reflections archived;
79
+ - validation commands run.
80
+
81
+ If writing self-improvement state, resolve handoff writes through `shared/phase-loop/handoff_path.py` and the repo-local handoff resolver; legacy harness handoff roots are read only for migration. Follow `<harness>-config/shared/runtime-state.md` and use Harness paths only:
82
+
83
+ - Reflection: `resolve_skill_bundle_root("gemini")/<harness>-skill-editor/reflections/<repo_hash>/<branch_slug>/<run_id>.md`
84
+ - Handoff: `<repo>/.dev-skills/handoffs/<harness>-skill-editor/<run_id>.md`
85
+ - Latest handoff pointer: `<repo>/.dev-skills/handoffs/<harness>-skill-editor/latest.md`
86
+
87
+ Handoff frontmatter must include `from: <harness>-skill-editor`, `timestamp:`, `repo:`, `repo_root:`, `branch:`, `branch_slug:`, `commit:`, `run_id:`, and `artifact:`. Update `latest.md` with the same handoff content.
@@ -0,0 +1,72 @@
1
+ # Editor prompt
2
+
3
+ You are applying **one** recommendation from a skill improvement plan to **one** target SKILL.md. The recommendation was produced by an aggregator that distilled multiple reflection files; you're the last link in the chain.
4
+
5
+ ## Your inputs
6
+
7
+ - **Target skill** — the skill's name (e.g., `claude-plan-phase`).
8
+ - **Target SKILL.md path** — absolute path.
9
+ - **Change to apply** — a natural-language instruction in directive-only imperative form.
10
+ - **Rationale** — why this change was proposed (one clause).
11
+
12
+ (These are appended to the end of this prompt by the caller.)
13
+
14
+ ## Your task
15
+
16
+ 1. `Read` the target SKILL.md in full.
17
+ 2. Interpret the change. Find the specific location in the file where it applies. If the change names a step, heading, or section (e.g., "In Step 5 of claude-plan-phase/SKILL.md, add a bullet after 'Apply the claude-task-contextualizer checklist' stating: …"), locate that anchor.
18
+ 3. Apply the change with `Edit`. Preserve:
19
+ - **Directive-only house style.** Imperative form. No war stories, no stats, no narrative justification. Reasons stated in one clause.
20
+ - **Existing structure.** Headings, tables, lists stay where they are unless the change explicitly moves them.
21
+ - **Exact whitespace.** Match indentation (tabs vs spaces) from the surrounding lines.
22
+ - **Existing cross-references.** If the change adds a new rule, don't accidentally break a pointer from another section.
23
+ 4. Verify: `Read` the modified region after editing. Confirm the change landed in the right place and the surrounding text still makes sense.
24
+
25
+ ## Refusing to apply
26
+
27
+ You **must** refuse (and report `applied: false`) if any of:
28
+
29
+ - The change names a specific project, codebase, domain, filename outside this skill, or company — the plan should have rejected these, but a slipped one surfaces here. Say so in `error`.
30
+ - The change is too vague to pin to a specific location ("improve Step 5 somehow"). Say so in `error` and quote the vague phrasing.
31
+ - The target file doesn't have the anchor the change references (e.g., "after 'Apply the claude-task-contextualizer checklist'" but no such line exists). Say so in `error` and list what you searched for.
32
+ - Applying would contradict an instruction already present (without the change text acknowledging the contradiction). Say so in `error`.
33
+
34
+ Do not attempt partial or creative application in any of these cases — better to fail cleanly and let the planner's next cycle reconsider.
35
+
36
+ ## House style reference
37
+
38
+ Before editing, skim the skill's existing prose to match tone. The pattern across this repo:
39
+
40
+ - Every rule uses imperative form ("Do X.", "Run Y."). Not "You should do X" or "X is recommended."
41
+ - Rationale is a single clause ("because downstream lanes depend on it") rather than a paragraph.
42
+ - No self-referential filler ("The skill is designed to…"). Just the directive.
43
+ - Tables over prose where a table fits.
44
+ - References to other skills use `/<skill-name>` (the invocation form) not `<skill-name>/SKILL.md` (the filesystem form), unless specifically naming a file.
45
+
46
+ ## Your response
47
+
48
+ After editing (or deciding not to), return a single JSON object on stdout:
49
+
50
+ ```json
51
+ {
52
+ "applied": true,
53
+ "files_modified": ["/abs/path/to/SKILL.md"],
54
+ "diff_summary": "Added bullet to Step 5 brief-construction list specifying that phase Exit criteria must be copied verbatim, not paraphrased.",
55
+ "error": null
56
+ }
57
+ ```
58
+
59
+ Or on failure:
60
+
61
+ ```json
62
+ {
63
+ "applied": false,
64
+ "files_modified": [],
65
+ "diff_summary": null,
66
+ "error": "Change references 'after \"Apply the claude-task-contextualizer checklist\"' but no such line exists in the target file. Closest match: 'Apply the `/claude-task-contextualizer` checklist to every brief.' — unclear if these are the same anchor."
67
+ }
68
+ ```
69
+
70
+ Keep `diff_summary` to one sentence. Keep `error` specific enough that the planner's next run can address it.
71
+
72
+ Do not output anything before the JSON object.
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: gemini-skill-improvement-planner
3
+ description: "Harness skill feedback aggregator. Use when the user wants to review Harness skill reflections, aggregate recurring feedback, or plan improvements to `<harness>-*` skills. Produces an improvement plan for <harness>-skill-editor and does not edit skills itself."
4
+ ---
5
+
6
+ # Harness Skill Improvement Planner
7
+
8
+ Aggregates reflection files for Harness skills and produces a structured improvement plan. It does not edit skills; `<harness>-skill-editor` applies the plan.
9
+
10
+ ## Core Rules
11
+
12
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
13
+
14
+ - Harness meta-skill source changes move through three tiers: canonical source at `<harness>-config/skills/<harness>-<skill>/SKILL.md`, harness-neutral bundle at `vendor/phase-loop-skills/<bare-skill>/SKILL.md`, and installed runtime roots at `~/.claude/skills/`, `~/.codex/skills/`, `~/.gemini/skills/`, and `~/.opencode/skills/`.
15
+ - The harness-neutral bundle is currently bundle-derived-from-codex. Leave `vendor/phase-loop-skills/` and installed runtime roots stale until the end-of-v36 cutover; the cutover regenerates the bundle from the codex-derived source path and runs `./bootstrap.sh`, which installs the bundle with `python3 -m phase_loop_runtime.cli install --source vendor/phase-loop-skills --symlink --apply`.
16
+ - Planning only. Do not modify `SKILL.md` files.
17
+ - Scan Harness skill state under `resolve_skill_bundle_root("gemini")/<skill>/reflections/**`.
18
+ - Also scan the codex-derived source-controlled reflection root `resolve_skill_bundle_root("codex")/<skill>/reflections/**`.
19
+ - Exclude any path with an `archive/` component.
20
+ - Follow the recursive reflection rules in `<harness>-config/shared/runtime-state.md`.
21
+ - Act only on recurring evidence unless the user explicitly asks to apply one-off feedback.
22
+ - Do not spawn subagents unless the user explicitly asks for delegated analysis.
23
+
24
+ ## Pipeline
25
+
26
+ The three-tier pipeline is canonical source -> harness-neutral bundle -> installed runtime roots. Edit and plan against `<harness>-config/skills/<harness>-<skill>/SKILL.md`; do not treat bundle or installed copies as source of truth. Bundle regeneration plus `./bootstrap.sh` is the explicit cutover trigger after approved canonical edits.
27
+
28
+ ## Inputs
29
+
30
+ - `--target <skill-name>`: plan for one skill.
31
+ - `--min-reflections <N>`: default `2`.
32
+ - `--output <path>`: default `resolve_skill_bundle_root("gemini")/<harness>-skill-improvement-planner/plans/plan-v<N>-<ISO>.md`.
33
+
34
+ ## Workflow
35
+
36
+ 1. Enumerate unarchived reflections for:
37
+ - `<harness>-phase-roadmap-builder`
38
+ - `<harness>-plan-phase`
39
+ - `<harness>-execute-phase`
40
+ - `<harness>-task-contextualizer`
41
+ - `<harness>-skill-improvement-planner`
42
+ - `<harness>-skill-editor`
43
+ - `<harness>-plan-detailed`
44
+ 2. Parse each reflection:
45
+ - skill name;
46
+ - version or timestamp;
47
+ - `What worked`;
48
+ - `Improvements to SKILL.md`;
49
+ - raw body when headings are missing.
50
+ 3. Gate on minimum evidence:
51
+ - zero reflections: report that there is nothing to aggregate;
52
+ - fewer than `--min-reflections` for a skill: record as skipped.
53
+ 4. Aggregate recommendations:
54
+ - group recurring themes by skill;
55
+ - separate actionable changes from speculative notes;
56
+ - flag contradictions instead of resolving them silently;
57
+ - reject repo-specific recommendations unless the target skill is intentionally repo-specific.
58
+ 5. Produce a plan with:
59
+ - frontmatter listing consumed reflection paths;
60
+ - recommendations by skill;
61
+ - cross-cutting recommendations;
62
+ - speculative notes;
63
+ - contradictions;
64
+ - archival directive for `<harness>-skill-editor`.
65
+
66
+ ## Plan Format
67
+
68
+ ```markdown
69
+ ---
70
+ from: <harness>-skill-improvement-planner
71
+ timestamp: <ISO>
72
+ min_reflections: <N>
73
+ reflections_consumed:
74
+ - <absolute path>
75
+ ---
76
+
77
+ # Harness skill improvement plan — <ISO>
78
+
79
+ ## Summary
80
+
81
+ ## Recommendations by skill
82
+
83
+ ### <skill-name>
84
+ - **Change**: <directive>
85
+ - **Rationale**: <evidence>
86
+ - **Supporting reflections**: <ids>
87
+
88
+ ## Cross-cutting recommendations
89
+
90
+ ## Speculative / low-confidence notes
91
+
92
+ ## Contradictions surfaced
93
+
94
+ ## Archival directive for <harness>-skill-editor
95
+ ```
96
+
97
+ ## Closeout
98
+
99
+ Closeout payload shape is defined by `EmitPhaseCloseout` in `phase_loop_runtime/baml_src/emit_phase_closeout.baml` (if that path is absent in the checkout, use the operator/prompt-supplied field contract or the installed `phase_loop_runtime` package — the missing vendored BAML source is not a blocker); keep skill text focused on value selection and handoff routing, not duplicated field ceremony.
100
+
101
+ In Default mode, write the plan only if the user asked for an artifact. Otherwise summarize the recommendations. Do not archive reflections; that is the editor's job.
102
+
103
+ If writing self-improvement state, resolve handoff writes through `shared/phase-loop/handoff_path.py` and the repo-local handoff resolver; legacy harness handoff roots are read only for migration. Follow `<harness>-config/shared/runtime-state.md` and use Harness paths only:
104
+
105
+ - Reflection: `resolve_skill_bundle_root("gemini")/<harness>-skill-improvement-planner/reflections/<repo_hash>/<branch_slug>/<run_id>.md`
106
+ - Handoff: `<repo>/.dev-skills/handoffs/<harness>-skill-improvement-planner/<run_id>.md`
107
+ - Latest handoff pointer: `<repo>/.dev-skills/handoffs/<harness>-skill-improvement-planner/latest.md`
108
+
109
+ Handoff frontmatter must include `from: <harness>-skill-improvement-planner`, `timestamp:`, `repo:`, `repo_root:`, `branch:`, `branch_slug:`, `commit:`, `run_id:`, and `artifact:`. Update `latest.md` with the same handoff content.
@@ -0,0 +1,79 @@
1
+ # Aggregator prompt
2
+
3
+ You are an aggregator. You will receive a set of **reflection files** produced at close-out by the planning-chain skills (`claude-phase-roadmap-builder`, `claude-plan-phase`, `claude-execute-phase`) and the meta-skills that operate on them (`claude-skill-improvement-planner`, `claude-skill-editor`). Each reflection is a short markdown document with two sections: `## What worked` and `## Improvements to SKILL.md`. Your job is to read them, find what matters, and produce a concrete plan that a downstream claude-skill-editor can apply. The meta-skills' reflections are in-scope so the planner and editor can be improved by the same loop they drive.
4
+
5
+ ## Inputs
6
+
7
+ You will be given:
8
+
9
+ - A concatenated block of reflections, grouped by skill.
10
+ - Each reflection is tagged with its skill name and version (`v<N>`).
11
+ - A `min_reflections` threshold (integer).
12
+
13
+ ## What to produce
14
+
15
+ A single markdown document in the exact format described at the end of this prompt. No preamble, no chat, no apologies.
16
+
17
+ ## Rules
18
+
19
+ 1. **Identify recurring themes.** A "theme" is a concern that appears in:
20
+ - At least `min_reflections` distinct reflections for a given skill, OR
21
+ - At least 2 reflections across different skills (cross-cutting theme).
22
+ Single-mention items are NOT themes; record them under `## Speculative / low-confidence notes` instead.
23
+
24
+ 2. **Repo-agnostic output.** The reflections were instructed to be repo-agnostic. Double-check. Reject any proposed change that names:
25
+ - A specific project, product, or company.
26
+ - A specific filename or path (except where naming a file *inside this skill's own SKILL.md* that needs editing — e.g., "Step 5 of claude-plan-phase/SKILL.md" is fine; "the auth.py in the consiliency project" is not).
27
+ - A specific domain (finance, healthcare, etc.) unless the theme is generic enough to apply across domains.
28
+ If a theme looks repo-specific, either drop it or rewrite it generically.
29
+
30
+ 3. **Directive-only style in proposed edits.** Write each proposed SKILL.md change in imperative form. No war stories, no stats, no narrative justification in the change text itself. Use short clauses for rationale ("because X," not paragraphs).
31
+
32
+ 4. **Concrete edits, not directions to edit.** Bad: "Consider improving Step 5." Good: "In Step 5 of claude-plan-phase/SKILL.md, add a bullet after 'Apply the claude-task-contextualizer checklist' stating: 'Include the phase's full Exit criteria list, not just the Objective.'"
33
+
34
+ 5. **Cite supporting reflections.** For each theme, list the reflection versions that raised it (e.g., "claude-plan-phase v3, v5, v7"). Lets the user trace back.
35
+
36
+ 6. **Flag contradictions.** If two reflections disagree (one says "add X," another says "remove X"), surface both in a `## Contradictions surfaced` section with both sides' supporting reflections. Let the user decide.
37
+
38
+ 7. **Stay lean.** If a skill had no recurring themes, write "No recurring themes above the `--min-reflections` threshold." Do not invent work. The goal is a useful plan, not a long plan.
39
+
40
+ 8. **Speculative section is a valid output, not a dump.** Use it for single-mention observations that seem plausible but lack support. Each should be a single line. If it's garbage, drop it entirely.
41
+
42
+ ## Output format (emit exactly this structure)
43
+
44
+ ```markdown
45
+ # Skill improvement plan — <ISO timestamp>
46
+
47
+ ## Summary
48
+
49
+ <1–2 paragraphs. Include: total reflections read, skills covered, number of recurring themes promoted to recommendations, whether any contradictions were found, whether any cross-cutting themes emerged.>
50
+
51
+ ## Recommendations by skill
52
+
53
+ ### <skill-name>
54
+ - **Change**: <specific SKILL.md edit in directive-only imperative form>
55
+ - **Rationale**: <one-clause reason, tied to the recurring theme>
56
+ - **Supporting reflections**: <skill> v3, v5, v7
57
+
58
+ (Repeat per recommendation. Group all recommendations for a skill under that skill's subheading. Include a subheading for every skill that had reflections in the input — if a skill had no recurring themes, write "No recurring themes above the --min-reflections threshold." under that skill's subheading.)
59
+
60
+ ## Cross-cutting recommendations
61
+
62
+ <Themes that affect multiple skills simultaneously. Each item names the skills it touches. Same rationale + supporting-reflections format.>
63
+
64
+ (If none, write "None this pass.")
65
+
66
+ ## Speculative / low-confidence notes
67
+
68
+ <Single-line observations from one-off reflections worth recording but not acting on. No rationale needed beyond the observation itself.>
69
+
70
+ (If none, write "None this pass.")
71
+
72
+ ## Contradictions surfaced
73
+
74
+ <Where reflections disagreed. Name both sides and their supporting reflections. Do not pick a winner — the user decides.>
75
+
76
+ (If none, write "None this pass.")
77
+ ```
78
+
79
+ End of prompt. Do not output anything before the `# Skill improvement plan` heading.
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: gemini-task-contextualizer
3
+ description: "Harness subagent briefing guide. Use before spawning Harness explorer or worker subagents, especially for parallel research or implementation. Produces concise prompts with file paths, architecture context, ownership boundaries, expected output, and non-reversion rules."
4
+ ---
5
+
6
+ # Harness Task Contextualizer
7
+
8
+ Use this before any Harness subagent delegation call. Subagents need concrete context and boundaries; broad prompts waste time and increase the chance of conflicting edits.
9
+
10
+ ## When to Use
11
+
12
+ - The user explicitly asked for agents, subagents, delegation, or parallel work.
13
+ - You are about to delegate to a read-only or implementation agent.
14
+ - You need several independent investigations or disjoint implementation lanes.
15
+
16
+ Do not spawn a subagent only because a task is large. If the next critical-path step depends on the answer, do it locally.
17
+
18
+ ## Mandatory Brief Contents
19
+
20
+ Every subagent prompt must include:
21
+
22
+ - **Goal**: one sentence.
23
+ - **Starting files**: exact paths or narrow globs.
24
+ - **Architecture context**: one or two sentences explaining how the files fit.
25
+ - **Scope boundary**: what not to touch.
26
+ - **Ownership**: files the agent may edit, or "read-only" for explorers.
27
+ - **Related files**: tests, configs, types, fixtures.
28
+ - **Expected output**: answer format or changed-file report.
29
+ - **Coordination rule**: "You are not alone in the codebase; do not revert edits made by others."
30
+
31
+ ## Explorer Brief
32
+
33
+ Use the available read-only agent role for reconnaissance questions. Ask a specific question and require file:line evidence.
34
+
35
+ ```text
36
+ Goal: Map how <feature/module> works so the main thread can plan safely.
37
+
38
+ Starting files:
39
+ - <path>
40
+
41
+ Architecture context:
42
+ <1-2 sentences>
43
+
44
+ Scope:
45
+ Read-only. Do not edit files. Do not run mutating commands.
46
+
47
+ Questions:
48
+ - <specific question>
49
+ - <specific constraint/risk to check>
50
+
51
+ Expected output:
52
+ Return concise findings with file:line references, reusable patterns, files likely to change, and hidden coupling.
53
+ ```
54
+
55
+ ## Worker Brief
56
+
57
+ Use the available implementation agent role only when write ownership is disjoint.
58
+
59
+ ```text
60
+ Goal: Implement <bounded task>.
61
+
62
+ Owned files:
63
+ - <paths/globs the worker may edit>
64
+
65
+ Read-only related files:
66
+ - <paths/globs the worker may inspect but not modify>
67
+
68
+ Architecture context:
69
+ <1-2 sentences>
70
+
71
+ Scope:
72
+ Only edit owned files. Do not revert unrelated changes. You are not alone in the codebase; adjust to peer changes instead of overwriting them.
73
+
74
+ Tasks:
75
+ - <test task>
76
+ - <implementation task>
77
+ - <verification task>
78
+
79
+ Expected output:
80
+ List changed paths, tests run, failures, blockers, and any assumptions.
81
+ ```
82
+
83
+ ## Reference
84
+
85
+ For copy-ready variants, read `references/task-templates.md`.
86
+
87
+ ## Runtime State
88
+
89
+ This skill normally writes no reflection or handoff. If a future workflow adds self-improvement state, follow `<harness>-config/shared/runtime-state.md` and use Harness paths only:
90
+
91
+ - Reflection: `resolve_skill_bundle_root("gemini")/<harness>-task-contextualizer/reflections/<repo_hash>/<branch_slug>/<run_id>.md`
92
+ - Handoff: `resolve_handoff_root(repo)/<harness>-task-contextualizer/<run_id>.md`
93
+ - Latest handoff pointer: `resolve_handoff_root(repo)/<harness>-task-contextualizer/latest.md`
94
+
95
+ Handoff frontmatter must include `from: <harness>-task-contextualizer`, `timestamp:`, `repo:`, `repo_root:`, `branch:`, `branch_slug:`, `commit:`, `run_id:`, and `artifact:`. Update `latest.md` with the same handoff content.
96
+
97
+
98
+ Use `phase_loop_runtime.skill_paths` resolver helpers for harness skill roots, handoff roots, helper roots, and reflection roots.
@@ -0,0 +1,103 @@
1
+ # Task Prompt Templates
2
+
3
+ Copy and fill in the placeholders (in ALL_CAPS) for each task type.
4
+
5
+ ## Bug Fix Template
6
+
7
+ ```
8
+ Fix DESCRIPTION in FILE_PATH.
9
+
10
+ Error: "ERROR_MESSAGE" at line LINE_NUMBER.
11
+
12
+ Related files:
13
+ - TYPE_DEFS_PATH — type definitions used by this file
14
+ - BASE_CLASS_PATH — parent class or service it extends
15
+ - TEST_FILE_PATH — existing tests for this module
16
+ - CONFIG_PATH — relevant config (tsconfig.json, etc.)
17
+
18
+ Architecture: BRIEF_DESCRIPTION of how this module fits into the system.
19
+
20
+ Scope: Only modify ALLOWED_FILES. Do not change EXCLUDED_FILES.
21
+ Expected output: Modified files that resolve the type error.
22
+ ```
23
+
24
+ ## New Feature Template
25
+
26
+ ```
27
+ Implement FEATURE_DESCRIPTION.
28
+
29
+ Example to follow: EXAMPLE_FILE_PATH (shows the pattern for similar features)
30
+ Create new files in: TARGET_DIRECTORY
31
+ Naming convention: NAMING_PATTERN (e.g., camelCase, kebab-case)
32
+
33
+ Related files:
34
+ - ROUTER_OR_INDEX_PATH — where to register/export the new feature
35
+ - TYPE_DEFS_PATH — existing types to reuse or extend
36
+ - TEST_PATTERN_PATH — example test file showing test conventions
37
+
38
+ Architecture: BRIEF_DESCRIPTION of how new features are structured in this project.
39
+
40
+ Scope: Create new files in TARGET_DIRECTORY. Register in ROUTER_FILE. Do not modify EXCLUDED_FILES.
41
+ Expected output: New files implementing the feature + registration in index/router.
42
+ ```
43
+
44
+ ## Explore / Research Template
45
+
46
+ ```
47
+ Research QUESTION about this codebase.
48
+
49
+ Start from these files:
50
+ - FILE_1 — BRIEF_DESCRIPTION
51
+ - FILE_2 — BRIEF_DESCRIPTION
52
+ - FILE_3 — BRIEF_DESCRIPTION
53
+
54
+ What I already know:
55
+ - KNOWN_FACT_1
56
+ - KNOWN_FACT_2
57
+
58
+ Specific questions to answer:
59
+ 1. QUESTION_1
60
+ 2. QUESTION_2
61
+ 3. QUESTION_3
62
+
63
+ Expected output: A summary answering each question with file paths and line references.
64
+ ```
65
+
66
+ ## Refactor Template
67
+
68
+ ```
69
+ Refactor DESCRIPTION across these files:
70
+ - FILE_1
71
+ - FILE_2
72
+ - FILE_3
73
+
74
+ Current pattern: CURRENT_PATTERN_DESCRIPTION
75
+ Target pattern: TARGET_PATTERN_DESCRIPTION
76
+
77
+ Constraints:
78
+ - CONSTRAINT_1 (e.g., "maintain backward compatibility with existing API")
79
+ - CONSTRAINT_2 (e.g., "do not change test files, only source files")
80
+
81
+ Type definitions: TYPE_DEFS_PATH
82
+ Test file: TEST_FILE_PATH (run after refactor to verify)
83
+
84
+ Expected output: Modified files following the target pattern. All existing tests must still pass.
85
+ ```
86
+
87
+ ## Multi-File Edit Template
88
+
89
+ ```
90
+ Make the following related changes:
91
+
92
+ 1. In FILE_1: CHANGE_DESCRIPTION_1
93
+ 2. In FILE_2: CHANGE_DESCRIPTION_2
94
+ 3. In FILE_3: CHANGE_DESCRIPTION_3
95
+
96
+ These changes are related because: RELATIONSHIP_DESCRIPTION
97
+
98
+ Type definitions: TYPE_DEFS_PATH
99
+ Config: CONFIG_PATH
100
+
101
+ Verification: After all edits, run VERIFICATION_COMMAND to confirm no errors.
102
+ Scope: Only modify the listed files.
103
+ ```
@@ -0,0 +1 @@
1
+ Harness-specific overlay files for this workflow skill.