@urielsh/prodify 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/.prodify/AGENTS.md +56 -0
  2. package/.prodify/README.md +10 -0
  3. package/.prodify/artifacts/01-understand.md +28 -0
  4. package/.prodify/artifacts/02-diagnose.md +26 -0
  5. package/.prodify/artifacts/03-architecture.md +30 -0
  6. package/.prodify/artifacts/04-plan.md +35 -0
  7. package/.prodify/artifacts/05-refactor.md +24 -0
  8. package/.prodify/artifacts/06-validate.md +17 -0
  9. package/.prodify/artifacts/README.md +6 -0
  10. package/.prodify/artifacts/architecture_spec.md +29 -0
  11. package/.prodify/artifacts/artifact-validation-design.md +276 -0
  12. package/.prodify/artifacts/cli-command-design.md +299 -0
  13. package/.prodify/artifacts/completed-steps-tracking.md +201 -0
  14. package/.prodify/artifacts/diagnostic_report.md +45 -0
  15. package/.prodify/artifacts/hardening-patch-summary.md +57 -0
  16. package/.prodify/artifacts/hardening-verification-report.md +48 -0
  17. package/.prodify/artifacts/implementation_summary.md +19 -0
  18. package/.prodify/artifacts/improvement-evaluation-spec.md +148 -0
  19. package/.prodify/artifacts/next-step-resolver-design.md +570 -0
  20. package/.prodify/artifacts/orientation_map.md +32 -0
  21. package/.prodify/artifacts/persona-removal-audit.md +106 -0
  22. package/.prodify/artifacts/planning-alignment-report.md +189 -0
  23. package/.prodify/artifacts/refactor-plan-template-hardening.md +83 -0
  24. package/.prodify/artifacts/refactor-validate-loop-design.md +231 -0
  25. package/.prodify/artifacts/refactor_plan.md +21 -0
  26. package/.prodify/artifacts/refactor_plan.strict-example.md +31 -0
  27. package/.prodify/artifacts/run-state-design.md +292 -0
  28. package/.prodify/artifacts/run-summary-spec.md +149 -0
  29. package/.prodify/artifacts/run_state.json +14 -0
  30. package/.prodify/artifacts/sample-repo-test-plan.md +129 -0
  31. package/.prodify/artifacts/status-output-spec.md +349 -0
  32. package/.prodify/artifacts/step-selection-design.md +251 -0
  33. package/.prodify/artifacts/task-dispatcher-design.md +266 -0
  34. package/.prodify/artifacts/task-header-audit.md +42 -0
  35. package/.prodify/artifacts/task-log-enhancement-spec.md +264 -0
  36. package/.prodify/artifacts/task-protocol-hardening-plan.md +68 -0
  37. package/.prodify/artifacts/task-self-validation-spec.md +171 -0
  38. package/.prodify/artifacts/task_log.json +160 -0
  39. package/.prodify/artifacts/template-usage-audit.md +20 -0
  40. package/.prodify/artifacts/validation_report.md +22 -0
  41. package/.prodify/contracts/README.md +3 -0
  42. package/.prodify/contracts/architecture.contract.json +42 -0
  43. package/.prodify/contracts/diagnose.contract.json +42 -0
  44. package/.prodify/contracts/plan.contract.json +42 -0
  45. package/.prodify/contracts/refactor.contract.json +45 -0
  46. package/.prodify/contracts/understand.contract.json +42 -0
  47. package/.prodify/contracts/validate.contract.json +52 -0
  48. package/.prodify/contracts-src/README.md +4 -0
  49. package/.prodify/contracts-src/architecture.contract.md +29 -0
  50. package/.prodify/contracts-src/diagnose.contract.md +29 -0
  51. package/.prodify/contracts-src/plan.contract.md +29 -0
  52. package/.prodify/contracts-src/refactor.contract.md +32 -0
  53. package/.prodify/contracts-src/understand.contract.md +29 -0
  54. package/.prodify/contracts-src/validate.contract.md +35 -0
  55. package/.prodify/metrics/README.md +4 -0
  56. package/.prodify/planning.md +13 -0
  57. package/.prodify/project.md +15 -0
  58. package/.prodify/rules/01-global-operating-rules.md +21 -0
  59. package/.prodify/rules/02-analysis-discipline.md +17 -0
  60. package/.prodify/rules/03-diagnosis-severity-rules.md +42 -0
  61. package/.prodify/rules/04-architecture-rules.md +27 -0
  62. package/.prodify/rules/05-planning-rules.md +23 -0
  63. package/.prodify/rules/06-refactor-rules.md +20 -0
  64. package/.prodify/rules/07-validation-rules.md +25 -0
  65. package/.prodify/rules/08-output-format-rules.md +20 -0
  66. package/.prodify/rules/09-template-usage-rules.md +11 -0
  67. package/.prodify/rules/10-artifact-flow-and-orchestration-rules.md +40 -0
  68. package/.prodify/rules/README.md +3 -0
  69. package/.prodify/rules/example-rule.md +4 -0
  70. package/.prodify/runtime-commands.md +57 -0
  71. package/.prodify/skills/README.md +8 -0
  72. package/.prodify/skills/domain/react-frontend.skill.json +34 -0
  73. package/.prodify/skills/domain/typescript-backend.skill.json +34 -0
  74. package/.prodify/skills/quality-policy/maintainability-review.skill.json +25 -0
  75. package/.prodify/skills/quality-policy/security-hardening.skill.json +32 -0
  76. package/.prodify/skills/quality-policy/test-hardening.skill.json +23 -0
  77. package/.prodify/skills/registry.json +16 -0
  78. package/.prodify/skills/stage-method/architecture-method.skill.json +22 -0
  79. package/.prodify/skills/stage-method/codebase-scanning.skill.json +22 -0
  80. package/.prodify/skills/stage-method/diagnosis-method.skill.json +22 -0
  81. package/.prodify/skills/stage-method/planning-method.skill.json +22 -0
  82. package/.prodify/skills/stage-method/refactoring-method.skill.json +22 -0
  83. package/.prodify/skills/stage-method/validation-method.skill.json +22 -0
  84. package/.prodify/state.json +30 -0
  85. package/.prodify/tasks/01-understand.md +83 -0
  86. package/.prodify/tasks/02-diagnose.md +67 -0
  87. package/.prodify/tasks/03-architecture.md +70 -0
  88. package/.prodify/tasks/04-plan.md +71 -0
  89. package/.prodify/tasks/05-refactor.md +61 -0
  90. package/.prodify/tasks/06-validate.md +69 -0
  91. package/.prodify/tasks/README.md +3 -0
  92. package/.prodify/tasks/example-task.md +13 -0
  93. package/.prodify/templates/01-understand.template.md +18 -0
  94. package/.prodify/templates/02-diagnose.template.md +18 -0
  95. package/.prodify/templates/03-architecture.template.md +18 -0
  96. package/.prodify/templates/04-plan.template.md +22 -0
  97. package/.prodify/templates/05-refactor.template.md +19 -0
  98. package/.prodify/templates/06-validate.template.md +16 -0
  99. package/.prodify/templates/README.md +3 -0
  100. package/.prodify/templates/architecture_spec.template.md +29 -0
  101. package/.prodify/templates/diagnostic_report.template.md +45 -0
  102. package/.prodify/templates/example.template.md +5 -0
  103. package/.prodify/templates/implementation_summary.template.md +19 -0
  104. package/.prodify/templates/orientation_map.template.md +32 -0
  105. package/.prodify/templates/refactor_plan.template.md +24 -0
  106. package/.prodify/templates/validation_report.template.md +22 -0
  107. package/.prodify/version.json +5 -0
  108. package/AGENTS.md +305 -0
  109. package/LICENSE +201 -0
  110. package/README.md +118 -0
  111. package/assets/presets/default/canonical/AGENTS.md +54 -0
  112. package/assets/presets/default/canonical/artifacts/README.md +6 -0
  113. package/assets/presets/default/canonical/contracts-src/README.md +4 -0
  114. package/assets/presets/default/canonical/contracts-src/architecture.contract.md +56 -0
  115. package/assets/presets/default/canonical/contracts-src/diagnose.contract.md +49 -0
  116. package/assets/presets/default/canonical/contracts-src/plan.contract.md +42 -0
  117. package/assets/presets/default/canonical/contracts-src/refactor.contract.md +54 -0
  118. package/assets/presets/default/canonical/contracts-src/understand.contract.md +56 -0
  119. package/assets/presets/default/canonical/contracts-src/validate.contract.md +64 -0
  120. package/assets/presets/default/canonical/metrics/README.md +4 -0
  121. package/assets/presets/default/canonical/planning.md +13 -0
  122. package/assets/presets/default/canonical/project.md +15 -0
  123. package/assets/presets/default/canonical/rules/README.md +3 -0
  124. package/assets/presets/default/canonical/rules/example-rule.md +4 -0
  125. package/assets/presets/default/canonical/runtime-commands.md +57 -0
  126. package/assets/presets/default/canonical/skills/README.md +8 -0
  127. package/assets/presets/default/canonical/skills/domain/react-frontend.skill.json +34 -0
  128. package/assets/presets/default/canonical/skills/domain/typescript-backend.skill.json +34 -0
  129. package/assets/presets/default/canonical/skills/quality-policy/maintainability-review.skill.json +25 -0
  130. package/assets/presets/default/canonical/skills/quality-policy/security-hardening.skill.json +32 -0
  131. package/assets/presets/default/canonical/skills/quality-policy/test-hardening.skill.json +23 -0
  132. package/assets/presets/default/canonical/skills/registry.json +16 -0
  133. package/assets/presets/default/canonical/skills/stage-method/architecture-method.skill.json +22 -0
  134. package/assets/presets/default/canonical/skills/stage-method/codebase-scanning.skill.json +22 -0
  135. package/assets/presets/default/canonical/skills/stage-method/diagnosis-method.skill.json +22 -0
  136. package/assets/presets/default/canonical/skills/stage-method/planning-method.skill.json +22 -0
  137. package/assets/presets/default/canonical/skills/stage-method/refactoring-method.skill.json +22 -0
  138. package/assets/presets/default/canonical/skills/stage-method/validation-method.skill.json +22 -0
  139. package/assets/presets/default/canonical/state.json +30 -0
  140. package/assets/presets/default/canonical/tasks/README.md +3 -0
  141. package/assets/presets/default/canonical/tasks/example-task.md +13 -0
  142. package/assets/presets/default/canonical/templates/README.md +3 -0
  143. package/assets/presets/default/canonical/templates/example.template.md +5 -0
  144. package/assets/presets/default/preset.json +5 -0
  145. package/dist/cli.js +53 -0
  146. package/dist/commands/doctor.js +16 -0
  147. package/dist/commands/init.js +30 -0
  148. package/dist/commands/install.js +27 -0
  149. package/dist/commands/setup-agent.js +23 -0
  150. package/dist/commands/status.js +28 -0
  151. package/dist/commands/sync.js +29 -0
  152. package/dist/commands/update.js +18 -0
  153. package/dist/contracts/compiled-schema.js +37 -0
  154. package/dist/contracts/compiler.js +83 -0
  155. package/dist/contracts/freshness.js +52 -0
  156. package/dist/contracts/index.js +5 -0
  157. package/dist/contracts/parser.js +201 -0
  158. package/dist/contracts/schema.js +138 -0
  159. package/dist/contracts/source-schema.js +111 -0
  160. package/dist/core/agent-runtime.js +36 -0
  161. package/dist/core/agent-setup.js +111 -0
  162. package/dist/core/doctor.js +155 -0
  163. package/dist/core/errors.js +19 -0
  164. package/dist/core/flow-state.js +262 -0
  165. package/dist/core/fs.js +50 -0
  166. package/dist/core/install.js +44 -0
  167. package/dist/core/managed-files.js +106 -0
  168. package/dist/core/paths.js +56 -0
  169. package/dist/core/preset-validation.js +43 -0
  170. package/dist/core/prompt-builder.js +63 -0
  171. package/dist/core/repo-context.js +77 -0
  172. package/dist/core/repo-root.js +55 -0
  173. package/dist/core/skill-resolution.js +123 -0
  174. package/dist/core/state.js +220 -0
  175. package/dist/core/status.js +293 -0
  176. package/dist/core/sync.js +63 -0
  177. package/dist/core/targets.js +48 -0
  178. package/dist/core/upgrade.js +57 -0
  179. package/dist/core/validation.js +138 -0
  180. package/dist/core/version-checks.js +35 -0
  181. package/dist/generators/claude.js +14 -0
  182. package/dist/generators/codex.js +14 -0
  183. package/dist/generators/copilot.js +29 -0
  184. package/dist/generators/header.js +13 -0
  185. package/dist/generators/opencode.js +14 -0
  186. package/dist/generators/shared.js +37 -0
  187. package/dist/index.js +9 -0
  188. package/dist/legacy/targets.js +55 -0
  189. package/dist/presets/default.js +3 -0
  190. package/dist/presets/loader.js +34 -0
  191. package/dist/presets/version.js +18 -0
  192. package/dist/scoring/model.js +262 -0
  193. package/dist/skills/loader.js +40 -0
  194. package/dist/skills/schema.js +159 -0
  195. package/dist/types.js +1 -0
  196. package/docs/canonical-prodify-layout.md +87 -0
  197. package/docs/claude-support.md +22 -0
  198. package/docs/cli-doctor-spec.md +52 -0
  199. package/docs/cli-init-spec.md +70 -0
  200. package/docs/cli-install-agent-spec.md +48 -0
  201. package/docs/cli-sync-spec.md +40 -0
  202. package/docs/codex-support.md +24 -0
  203. package/docs/compatibility-targets.md +59 -0
  204. package/docs/copilot-support.md +30 -0
  205. package/docs/default-preset.md +47 -0
  206. package/docs/generated-file-headers.md +45 -0
  207. package/docs/generation-rules.md +94 -0
  208. package/docs/idempotency-guarantees.md +31 -0
  209. package/docs/managed-file-detection.md +45 -0
  210. package/docs/manual-edit-conflicts.md +37 -0
  211. package/docs/opencode-support.md +27 -0
  212. package/docs/ownership-rules.md +39 -0
  213. package/docs/path-resolution-rules.md +40 -0
  214. package/docs/preset-structure.md +49 -0
  215. package/docs/skill-system.md +67 -0
  216. package/docs/versioning-and-upgrade-strategy.md +40 -0
  217. package/package.json +22 -0
  218. package/src/README.md +11 -0
  219. package/src/cli.ts +61 -0
  220. package/src/commands/doctor.ts +20 -0
  221. package/src/commands/init.ts +37 -0
  222. package/src/commands/setup-agent.ts +28 -0
  223. package/src/commands/status.ts +34 -0
  224. package/src/commands/update.ts +23 -0
  225. package/src/contracts/README.md +10 -0
  226. package/src/contracts/compiled-schema.ts +42 -0
  227. package/src/contracts/compiler.ts +111 -0
  228. package/src/contracts/freshness.ts +58 -0
  229. package/src/contracts/index.ts +11 -0
  230. package/src/contracts/parser.ts +253 -0
  231. package/src/contracts/source-schema.ts +141 -0
  232. package/src/core/agent-runtime.ts +53 -0
  233. package/src/core/agent-setup.ts +147 -0
  234. package/src/core/doctor.ts +171 -0
  235. package/src/core/errors.ts +28 -0
  236. package/src/core/flow-state.ts +333 -0
  237. package/src/core/fs.ts +59 -0
  238. package/src/core/paths.ts +63 -0
  239. package/src/core/preset-validation.ts +47 -0
  240. package/src/core/prompt-builder.ts +73 -0
  241. package/src/core/repo-context.ts +93 -0
  242. package/src/core/repo-root.ts +74 -0
  243. package/src/core/skill-resolution.ts +151 -0
  244. package/src/core/state.ts +264 -0
  245. package/src/core/status.ts +372 -0
  246. package/src/core/targets.ts +53 -0
  247. package/src/core/upgrade.ts +66 -0
  248. package/src/core/validation.ts +233 -0
  249. package/src/core/version-checks.ts +40 -0
  250. package/src/index.ts +13 -0
  251. package/src/presets/default.ts +7 -0
  252. package/src/presets/loader.ts +46 -0
  253. package/src/presets/version.ts +31 -0
  254. package/src/scoring/model.ts +332 -0
  255. package/src/skills/loader.ts +58 -0
  256. package/src/skills/schema.ts +197 -0
  257. package/src/types.ts +329 -0
  258. package/tests/integration/cli-flows.test.js +347 -0
  259. package/tests/unit/agent-setup.test.js +81 -0
  260. package/tests/unit/cli.test.js +28 -0
  261. package/tests/unit/contracts.test.js +61 -0
  262. package/tests/unit/helpers.js +28 -0
  263. package/tests/unit/paths.test.js +52 -0
  264. package/tests/unit/preset-loader.test.js +37 -0
  265. package/tests/unit/scoring.test.js +65 -0
  266. package/tests/unit/self-hosted-workspace.test.js +22 -0
  267. package/tests/unit/skills.test.js +115 -0
  268. package/tests/unit/state-and-flow.test.js +120 -0
  269. package/tests/unit/targets.test.js +13 -0
  270. package/tests/unit/validation.test.js +73 -0
  271. package/tests/unit/version.test.js +24 -0
  272. package/tsconfig.json +23 -0
  273. package/urielsh-prodify-0.1.0.tgz +0 -0
@@ -0,0 +1,32 @@
1
+ # Orientation Map
2
+
3
+ ## Project Summary
4
+ - Project name:
5
+ - Primary tech stack:
6
+ - Project type:
7
+ - Runtime environment:
8
+
9
+ ## Entry Points
10
+ -
11
+
12
+ ## Module Map
13
+ - Module:
14
+ - Path:
15
+ - Role:
16
+ - Confidence:
17
+
18
+ ## Monorepo Metadata
19
+ - Is monorepo:
20
+ - Tooling:
21
+ - Workspace roots:
22
+
23
+ ## Dependency Overview
24
+ - Core dependency flows:
25
+ - High-centrality modules:
26
+ - Tight coupling areas:
27
+
28
+ ## Key Observations
29
+ -
30
+
31
+ ## Uncertainty
32
+ -
@@ -0,0 +1,106 @@
1
+ # Persona Removal Audit
2
+
3
+ Date: 2026-03-29
4
+ Task: `81-remove-persona-language`
5
+
6
+ ## Files Reviewed
7
+ - `./.prodify/tasks/01-understand.md`
8
+ - `./.prodify/tasks/02-diagnose.md`
9
+ - `./.prodify/tasks/03-architecture.md`
10
+ - `./.prodify/tasks/04-plan.md`
11
+ - `./.prodify/tasks/05-refactor.md`
12
+ - `./.prodify/tasks/06-validate.md`
13
+
14
+ ## Exact Persona Or Role Phrases Found
15
+
16
+ ### `01-understand.md`
17
+ - `## Identity & Mandate`
18
+ - `Role: @Repository-Explorer`
19
+ - `Problem: Context rot and attention dilution in large codebases.`
20
+ - `## Data Contract`
21
+
22
+ ### `02-diagnose.md`
23
+ - `## Identity & Mandate`
24
+ - `Role: @Security-Auditor`
25
+ - `Problem: Work slop and rapid unstructured additions destroying integrity.`
26
+ - `## Data Contract`
27
+
28
+ ### `03-architecture.md`
29
+ - `## Identity & Mandate`
30
+ - `Role: @Principal-Architect`
31
+ - `Problem: Lack of structural intent in evolved legacy systems.`
32
+ - `## Data Contract`
33
+
34
+ ### `04-plan.md`
35
+ - `## Identity & Mandate`
36
+ - `Role: @DevOps-Planner`
37
+ - `Problem: Big Bang refactors that break the CI pipeline.`
38
+ - `## Data Contract`
39
+
40
+ ### `05-refactor.md`
41
+ - `## Identity & Mandate`
42
+ - `Role: @Implementation-Specialist`
43
+ - `Problem: Scope creep and unrelated cleanup in pull requests.`
44
+ - `## Data Contract`
45
+
46
+ ### `06-validate.md`
47
+ - `## Identity & Mandate`
48
+ - `Role: @Quality-Gatekeeper`
49
+ - `Problem: Refactoring drift and hidden regressions.`
50
+ - `## Data Contract`
51
+
52
+ ## Exact Replacements Required
53
+
54
+ Apply this structural replacement pattern to every non-compliant task:
55
+
56
+ - Replace `## Identity & Mandate` with:
57
+ - `## Goal`
58
+ - `## Scope`
59
+ - Replace `## Data Contract` with:
60
+ - `## Inputs`
61
+ - Keep `## Execution Instructions`
62
+ - Keep `## Output Specification`
63
+ - Add:
64
+ - `## Failure Conditions`
65
+ - `## Definition of Done`
66
+
67
+ Replacement guidance:
68
+
69
+ - move the existing goal sentence into `## Goal`
70
+ - convert the existing problem framing into execution-relevant scope language only where it adds operational value
71
+ - remove role labels entirely
72
+ - remove narrative identity framing entirely
73
+
74
+ ## Files Already Compliant
75
+ - None of the current `01` through `06` task files are fully compliant yet.
76
+
77
+ ## Replacement Plan
78
+
79
+ ### `01-understand.md`
80
+ - remove persona and role framing
81
+ - replace with operational `Goal`, `Scope`, and `Inputs`
82
+
83
+ ### `02-diagnose.md`
84
+ - remove persona and role framing
85
+ - replace with operational `Goal`, `Scope`, and `Inputs`
86
+
87
+ ### `03-architecture.md`
88
+ - remove persona and role framing
89
+ - replace with operational `Goal`, `Scope`, and `Inputs`
90
+
91
+ ### `04-plan.md`
92
+ - remove persona and role framing
93
+ - replace with operational `Goal`, `Scope`, and `Inputs`
94
+
95
+ ### `05-refactor.md`
96
+ - remove persona and role framing
97
+ - replace with operational `Goal`, `Scope`, and `Inputs`
98
+
99
+ ### `06-validate.md`
100
+ - remove persona and role framing
101
+ - replace with operational `Goal`, `Scope`, and `Inputs`
102
+
103
+ ## Result
104
+ - All persona, role, and identity-framing language has been identified.
105
+ - A file-by-file removal plan exists.
106
+ - No ambiguity remains about what wording must be removed.
@@ -0,0 +1,189 @@
1
+ # Planning Alignment Report
2
+
3
+ Date: 2026-03-28
4
+ Task: `41-map-phases-to-plan`
5
+
6
+ ## Scope
7
+
8
+ This report aligns the repo-level planning tasks with the actual Prodify runtime execution system.
9
+
10
+ Inputs reviewed:
11
+
12
+ - `./.agent/tasks/41-map-phases-to-plan.md`
13
+ - `./.agent/tasks/*.md`
14
+ - `./AGENTS.md`
15
+ - `./.prodify/artifacts/`
16
+ - `./planning.md` (missing)
17
+
18
+ ## Current Planning Model
19
+
20
+ The current planning model is split across two layers:
21
+
22
+ 1. Repo-level roadmap tasks in `./.agent/tasks/`
23
+ 2. Runtime execution rules and runtime task files in `./.prodify/`
24
+
25
+ The roadmap tasks are grouped by task bands (`11-13`, `21-23`, `31-33`, `41-42`, `51-52`, `61-62`, `71-72`) and form a linear next-task chain. The runtime system is currently defined as a fixed six-task execution pipeline in `./AGENTS.md`.
26
+
27
+ ## Phase-To-Task Mapping
28
+
29
+ | Phase Band | Planning Intent | Repo-Level Tasks | Runtime Surface Affected | Current Output |
30
+ | --- | --- | --- | --- | --- |
31
+ | 10 | Normalize task contracts | `11`, `12`, `13` | `./.prodify/tasks/`, `./.prodify/templates/` | audits and validation spec |
32
+ | 20 | Define execution state and dispatch | `21`, `22`, `23` | `run_state.json`, dispatcher behavior, artifact validation | design docs |
33
+ | 30 | Define refactor loop control | `31`, `32`, `33` | step selection, Task `05`/`06` loop, completed-step tracking | design docs |
34
+ | 40 | Align planning to execution and decide next actions | `41`, `42` | planning source, next-step resolution | alignment and resolver design |
35
+ | 50 | Add operator-facing command surface | `51`, `52` | CLI/status interface | not started |
36
+ | 60 | Improve run reporting | `61`, `62` | task log and summary output | not started |
37
+ | 70 | Validate on a real repo | `71`, `72` | end-to-end runtime behavior | not started |
38
+
39
+ ## Execution Model Mapping
40
+
41
+ The actual runtime system is still centered on this execution pipeline from `./AGENTS.md`:
42
+
43
+ `01-understand -> 02-diagnose -> 03-architecture -> 04-plan -> 05-refactor -> 06-validate`
44
+
45
+ Primary runtime artifacts currently expected by that system:
46
+
47
+ - `orientation_map.md`
48
+ - `diagnostic_report.md`
49
+ - `architecture_spec.md`
50
+ - `refactor_plan.md`
51
+ - `implementation_summary.md`
52
+ - `validation_report.md`
53
+ - `run_state.json`
54
+ - `task_log.json`
55
+
56
+ The repo-level planning phases are therefore not runtime phases themselves. They are implementation phases for building or tightening the runtime system.
57
+
58
+ ## Mismatches
59
+
60
+ ### 1. Missing Planning Source
61
+
62
+ Task `41-map-phases-to-plan` declares `planning.md` as a required input, but `./planning.md` does not exist.
63
+
64
+ Impact:
65
+
66
+ - there is no single canonical planning document to align against
67
+ - the effective planning model is being inferred from task files and design artifacts instead
68
+
69
+ ### 2. Ambiguous `.agent` Root
70
+
71
+ The repo-level task brief now points at `.prodify/...` for runtime assets, while the repo-level workflow framework still lives under `./.agent/`.
72
+
73
+ Impact:
74
+
75
+ - the repo still has two different hidden roots with different responsibilities
76
+ - operators need to distinguish meta-workflow files from runtime files clearly
77
+
78
+ ### 3. Roadmap Tasks And Runtime Tasks Are Not Explicitly Linked
79
+
80
+ The repo-level roadmap defines implementation tasks through `72-validate-improvements`, but `./AGENTS.md` only documents the runtime execution pipeline `01` through `06`.
81
+
82
+ Impact:
83
+
84
+ - the plan does not explicitly state that Tasks `11-72` are framework-building tasks and Tasks `01-06` are the runtime tasks the framework will eventually execute
85
+ - future work can blur design-time and run-time responsibilities
86
+
87
+ ### 4. Runtime Contract Lags Behind New Design Artifacts
88
+
89
+ Tasks `21-33` produced design documents for run-state logic, task dispatch, artifact validation, step selection, loop control, and completed-step tracking. Those behaviors are not yet reflected in `./AGENTS.md`.
90
+
91
+ Impact:
92
+
93
+ - the active runtime contract remains underspecified relative to the newer design set
94
+ - later implementation tasks will have to choose between the old runtime contract and the newer design docs unless the planning model names the source of truth
95
+
96
+ ### 5. Loop Semantics Conflict Across Sources
97
+
98
+ `./AGENTS.md` currently says:
99
+
100
+ - FAIL -> next step MUST execute
101
+ - PASS -> STOP
102
+
103
+ But the newer loop and state designs define:
104
+
105
+ - PASS -> select the next remaining step or stop if none remain
106
+ - FAIL -> retry or repair the same selected step before continuing
107
+
108
+ Impact:
109
+
110
+ - next-step resolution is currently ambiguous
111
+ - Task `42-add-next-step-resolver` cannot be implemented cleanly until one loop model is declared canonical
112
+
113
+ ### 6. Artifact Location Assumptions Differ By Layer
114
+
115
+ The repo-level task brief for Task `41` writes to `.prodify/artifacts/planning-alignment-report.md`, and the actual execution/design artifacts for this initiative now also live under `./.prodify/artifacts/`.
116
+
117
+ Impact:
118
+
119
+ - runtime artifact placement is now consistent, but the plan should still distinguish framework artifacts from meta-workflow artifacts
120
+
121
+ ## Exact Recommendations
122
+
123
+ ### Recommendation 1
124
+
125
+ Create `./planning.md` as the canonical roadmap index for this initiative.
126
+
127
+ It should define:
128
+
129
+ - the purpose of the repo-level task bands
130
+ - the intended phase order
131
+ - the distinction between framework-building tasks and runtime execution tasks
132
+ - which artifact tree each phase writes to
133
+
134
+ ### Recommendation 2
135
+
136
+ Document the two-layer model explicitly in `./planning.md`:
137
+
138
+ - `./.agent/` = repo-level workflow, review, verification, and meta-task tracking
139
+ - `./.prodify/` = runtime task system, templates, runtime artifacts, and runtime state
140
+
141
+ This removes the current ambiguity around generic `.agent/...` references.
142
+
143
+ ### Recommendation 3
144
+
145
+ Add an explicit mapping section in `./planning.md` from roadmap task bands to runtime concerns:
146
+
147
+ - `10` = task/header/template contract hardening
148
+ - `20` = run-state, dispatch, and artifact validation
149
+ - `30` = refactor-loop control
150
+ - `40` = planning and next-step resolution
151
+ - `50` = CLI/status surface
152
+ - `60` = reporting
153
+ - `70` = end-to-end validation
154
+
155
+ ### Recommendation 4
156
+
157
+ Before or during Task `42-add-next-step-resolver`, choose and document one canonical loop model.
158
+
159
+ Preferred choice:
160
+
161
+ - PASS advances to the next remaining step or completes the run
162
+ - FAIL retries or blocks on the same selected step
163
+
164
+ That choice matches the newer design artifacts and supports deterministic completed-step tracking.
165
+
166
+ ### Recommendation 5
167
+
168
+ Treat `./AGENTS.md` as the current runtime enforcement document, but do not treat it as complete until its loop/state semantics are reconciled with the design artifacts from Tasks `21-33`.
169
+
170
+ ### Recommendation 6
171
+
172
+ Adopt an explicit artifact-placement rule in the planning document:
173
+
174
+ - repo-level workflow artifacts stay under `./.agent/tasks/<task-name>/`
175
+ - runtime system design and execution artifacts stay under `./.prodify/artifacts/`
176
+
177
+ ## Recommended Source-Of-Truth Model
178
+
179
+ Until the plan is formalized, the least ambiguous source-of-truth stack is:
180
+
181
+ 1. `./.agent/tasks/*.md` for roadmap order and meta-task intent
182
+ 2. `./AGENTS.md` for currently enforced runtime rules
183
+ 3. `./.prodify/artifacts/*-design.md` for planned runtime evolution
184
+
185
+ This is workable, but it is not fully aligned. A root `planning.md` should consolidate the model before more downstream planning tasks depend on it.
186
+
187
+ ## Conclusion
188
+
189
+ The planning and execution model are only partially aligned today. The roadmap order is clear, but the canonical planning document is missing, the `.agent` root is ambiguous across two layers, and the runtime loop semantics conflict between `AGENTS.md` and the newer design artifacts. These gaps should be resolved before implementing next-step resolution and operator-facing execution controls.
@@ -0,0 +1,83 @@
1
+ # Refactor Plan Template Hardening
2
+
3
+ Date: 2026-03-29
4
+ Task: `83-harden-refactor-plan-template`
5
+
6
+ ## Problems In Current Template
7
+
8
+ The current template is too loose for deterministic parsing because:
9
+
10
+ - the step heading is placeholder-style rather than a fixed repeated structure
11
+ - no per-step status field exists
12
+ - the template does not strongly distinguish one step block from the next
13
+ - step IDs are not normalized into an execution-friendly repeated pattern
14
+
15
+ ## Exact Revised Template Structure
16
+
17
+ Use this fixed repeated step structure:
18
+
19
+ ```md
20
+ # Refactor Plan
21
+
22
+ ## Summary
23
+ - Total phases:
24
+ - Total steps:
25
+ - Estimated complexity:
26
+
27
+ ## Phase Breakdown
28
+ - Phase:
29
+ - Goal:
30
+ - Notes:
31
+
32
+ ## Steps
33
+
34
+ ### Step: <ID>
35
+ - Status: pending
36
+ - Description:
37
+ - Files:
38
+ - Risk:
39
+ - Expected outcome:
40
+ - Validation command:
41
+
42
+ ### Step: <ID>
43
+ - Status: pending
44
+ - Description:
45
+ - Files:
46
+ - Risk:
47
+ - Expected outcome:
48
+ - Validation command:
49
+
50
+ ## Notes
51
+ -
52
+ ```
53
+
54
+ ## Parsing Benefits
55
+
56
+ This structure improves parsing because:
57
+
58
+ - every step starts with the exact `### Step:` marker
59
+ - every step includes the same required fields in the same order
60
+ - `Status` gives the runtime an explicit place for step-state tracking
61
+ - automatic selection can key off stable step IDs instead of freeform headings
62
+
63
+ ## Compatibility Notes For Task 04
64
+
65
+ Task `04-plan` should:
66
+
67
+ - emit one repeated step block per planned step
68
+ - assign a stable step ID to every step
69
+ - default every new step to `Status: pending`
70
+ - keep `Files`, `Risk`, `Expected outcome`, and `Validation command` populated for every step
71
+
72
+ ## Compatibility Notes For Task 05
73
+
74
+ Task `05-refactor` should:
75
+
76
+ - resolve the selected step from the fixed `### Step: <ID>` heading
77
+ - require exactly one step block to be active per execution attempt
78
+ - treat missing or malformed repeated fields as a stop condition
79
+
80
+ ## Result
81
+ - A stricter step format is defined.
82
+ - The format supports automatic step resolution and completed-step tracking.
83
+ - The template remains human-readable and markdown-based.
@@ -0,0 +1,231 @@
1
+ # Refactor Validate Loop Design
2
+
3
+ Date: 2026-03-28
4
+ Scope: `./.prodify/`
5
+
6
+ ## Purpose
7
+ Define the iterative execution loop that runs one refactor step through Task `05-refactor`, immediately validates it with Task `06-validate`, and decides whether to continue, retry, pause, or stop.
8
+
9
+ This loop is responsible for:
10
+ - executing exactly one selected refactor step at a time
11
+ - enforcing immediate validation after each Task `05-refactor`
12
+ - deciding loop continuation from validation outcome and remaining-step state
13
+
14
+ This loop is not responsible for:
15
+ - selecting a step without consulting the step-selection layer
16
+ - skipping validation
17
+ - advancing workflow state without successful artifact validation
18
+
19
+ ## Loop Flow
20
+
21
+ ### Entry Conditions
22
+ The loop may start only when:
23
+ - `next_task` is `05-refactor`
24
+ - workflow state is runnable (`ready` or a retryable `failed` state)
25
+ - a valid step-selection result exists
26
+
27
+ If no valid step-selection result exists:
28
+ - do not enter the loop
29
+ - stop in blocked or failed state depending on the cause
30
+
31
+ ### Loop Sequence
32
+ 1. Resolve the active step using the step-selection layer.
33
+ 2. Dispatch and execute Task `05-refactor` for exactly one step.
34
+ 3. Validate the Task 05 output artifact and update state to require Task `06-validate`.
35
+ 4. Dispatch and execute Task `06-validate` for the same selected step.
36
+ 5. Interpret the validation result.
37
+ 6. Choose one of:
38
+ - continue to the next step
39
+ - retry the same step
40
+ - pause/block for repair
41
+ - stop as complete
42
+
43
+ ## Decision Rules
44
+
45
+ ### Rule 1 - Task 05 Must Be Followed Immediately By Task 06
46
+ After a successful Task `05-refactor` execution:
47
+ - set the loop to validation mode immediately
48
+ - do not select or execute another refactor step until Task `06-validate` finishes
49
+
50
+ ### Rule 2 - Validation PASS
51
+ If Task `06-validate` passes:
52
+ - mark the selected step as completed
53
+ - ask the step-selection layer for the next step
54
+ - if another valid step exists:
55
+ - continue the loop with `05-refactor`
56
+ - if no valid steps remain:
57
+ - stop the loop as complete
58
+
59
+ ### Rule 3 - Validation FAIL
60
+ If Task `06-validate` fails with a decisive negative result:
61
+ - do not mark the step as completed
62
+ - keep the same `selected_refactor_step`
63
+ - move the loop into retry-or-repair decision mode
64
+
65
+ Default behavior:
66
+ - retry the same step only after the failure is understood and corrected
67
+ - do not advance to a later step automatically
68
+
69
+ ### Rule 4 - Validation Inconclusive
70
+ If Task `06-validate` cannot reach a trustworthy pass/fail result, treat the outcome as `inconclusive`.
71
+
72
+ Examples:
73
+ - missing validation inputs
74
+ - incomplete validation artifact
75
+ - ambiguous or partial validation output
76
+ - execution interruption during validation
77
+
78
+ Behavior:
79
+ - do not mark the step completed
80
+ - do not select the next step
81
+ - pause the loop in a blocked state
82
+ - require validation repair or rerun before continuing
83
+
84
+ ### Rule 5 - No Remaining Steps
85
+ If the step-selection layer returns `no_steps_remaining` after a successful validation pass:
86
+ - stop the loop
87
+ - signal workflow completion
88
+
89
+ ### Rule 6 - Unpopulated Or Malformed Plan
90
+ If the step-selection layer returns:
91
+ - `plan_unpopulated`
92
+ - `malformed_plan`
93
+ - `invalid_state`
94
+
95
+ Behavior:
96
+ - do not run Task `05-refactor`
97
+ - stop the loop immediately
98
+ - mark the workflow blocked or failed according to the selection result
99
+
100
+ ## Retry Behavior
101
+
102
+ ### Retry Same Step
103
+ Retry the same selected step only when:
104
+ - Task `06-validate` produced a FAIL result
105
+ - the selected step still exists in `refactor_plan.md`
106
+ - the system has not switched into a terminal stop condition
107
+
108
+ Retry rules:
109
+ - keep `selected_refactor_step` unchanged
110
+ - keep `completed_step_ids` unchanged
111
+ - set `next_task` back to `05-refactor`
112
+ - require the next cycle to target the same step
113
+
114
+ ### Do Not Skip Ahead After Failure
115
+ The loop must not automatically choose the next remaining step after a failed validation result.
116
+
117
+ Reason:
118
+ - skipping ahead would hide regressions and violate the one-step-at-a-time repair discipline
119
+
120
+ ## Pause And Block Behavior
121
+
122
+ ### Pause Conditions
123
+ Pause the loop when:
124
+ - validation result is inconclusive
125
+ - required artifacts are missing
126
+ - the refactor plan is unpopulated or malformed
127
+ - the selected step cannot be resolved
128
+ - state contradictions are detected
129
+
130
+ ### Blocked Outcome
131
+ When paused for a structural or recoverable issue:
132
+ - set workflow status to `blocked`
133
+ - leave a precise blocker note
134
+ - require correction before resuming
135
+
136
+ ## Stop Behavior
137
+
138
+ ### Stop As Complete
139
+ Stop the loop as complete only when:
140
+ - the current step has passed validation
141
+ - no remaining valid steps exist
142
+
143
+ ### Stop As Failed
144
+ Stop the loop as failed when:
145
+ - validation fails and no safe retry can proceed
146
+ - state contradictions prevent deterministic continuation
147
+ - selection or validation returns an unrecoverable invalid-state result
148
+
149
+ ### Stop Without Entering The Loop
150
+ Do not start the loop if:
151
+ - there is no selectable step
152
+ - `refactor_plan.md` is still template-only
153
+ - Task 05 cannot be dispatched safely
154
+
155
+ ## Fail-Safe Behavior For Inconclusive Validation
156
+
157
+ ### Inconclusive Result Handling
158
+ Treat inconclusive validation as neither PASS nor FAIL.
159
+
160
+ Required behavior:
161
+ - do not append the step to `completed_step_ids`
162
+ - do not select a next step
163
+ - do not mark the workflow complete
164
+ - do not silently downgrade to PASS
165
+ - do not silently convert to a retry unless the missing validation condition is repaired
166
+
167
+ Recommended state outcome:
168
+ - `status: blocked`
169
+ - `next_task: "06-validate"` or recovery-specific retry path
170
+ - note the exact reason in workflow notes
171
+
172
+ ## Loop Decision Matrix
173
+
174
+ | Current phase | Outcome | Next loop action | State intent |
175
+ | --- | --- | --- | --- |
176
+ | Step selection | `selected` | Run `05-refactor` | runnable |
177
+ | Step selection | `plan_unpopulated` | Stop and block | blocked |
178
+ | Step selection | `malformed_plan` | Stop and fail/block | failed or blocked |
179
+ | Task 05 | output valid | Run `06-validate` immediately | awaiting validation |
180
+ | Task 05 | output invalid | Retry or fail before validation | failed |
181
+ | Task 06 | PASS | Select next remaining step or stop complete | ready or complete |
182
+ | Task 06 | FAIL | Retry same step after correction | failed |
183
+ | Task 06 | inconclusive | Pause for repair/rerun | blocked |
184
+
185
+ ## Integration Notes
186
+
187
+ ### Integration With Step Selection
188
+ - The loop never invents a step ID.
189
+ - It must always consult the step-selection layer before entering `05-refactor` for a new step.
190
+ - After PASS, it must consult step selection again to determine whether another step remains.
191
+
192
+ ### Integration With Task 05
193
+ - Task `05-refactor` must implement exactly one selected step.
194
+ - The loop must reject any attempt to batch multiple steps in one iteration.
195
+
196
+ ### Integration With Task 06
197
+ - Task `06-validate` must run immediately after each successful Task `05-refactor`.
198
+ - Validation governs whether the loop continues, retries, pauses, or stops.
199
+
200
+ ### Integration With Run-State Logic
201
+ - The run-state layer updates:
202
+ - `selected_refactor_step`
203
+ - `completed_step_ids`
204
+ - `next_task`
205
+ - `status`
206
+ - The loop design defines when those updates should happen, not the low-level write mechanics.
207
+
208
+ ### Integration With Dispatcher
209
+ - The dispatcher controls task dispatch sequencing.
210
+ - The loop design controls the high-level decision of whether the dispatcher should schedule `05-refactor`, `06-validate`, or stop.
211
+
212
+ ## Retry/Stop Behavior Summary
213
+ - PASS:
214
+ - complete current step
215
+ - continue if more valid steps remain
216
+ - otherwise stop complete
217
+ - FAIL:
218
+ - keep same step active
219
+ - retry only after correction
220
+ - do not advance to a new step
221
+ - inconclusive:
222
+ - pause/block
223
+ - require validation repair or rerun
224
+ - invalid plan/state:
225
+ - stop before or during loop
226
+ - require repair before any further iteration
227
+
228
+ ## Implementation Notes
229
+ - Prefer explicit state transitions over implicit loop assumptions.
230
+ - Keep refactor and validation tightly paired; do not allow a second refactor before validating the first.
231
+ - Treat inconclusive validation as a safety stop, not a soft pass.
@@ -0,0 +1,21 @@
1
+ # Refactor Plan
2
+
3
+ ## Summary
4
+ - Total phases:
5
+ - Estimated complexity:
6
+
7
+ ## Phase Breakdown
8
+ - Phase:
9
+ - Goal:
10
+ - Notes:
11
+
12
+ ## Steps
13
+ ### Step ID:
14
+ - Description:
15
+ - Files:
16
+ - Risk:
17
+ - Expected outcome:
18
+ - Validation command:
19
+
20
+ ## Notes
21
+ -
@@ -0,0 +1,31 @@
1
+ # Refactor Plan
2
+
3
+ ## Summary
4
+ - Total phases: 0
5
+ - Estimated complexity:
6
+
7
+ ## Phase Breakdown
8
+ - Phase:
9
+ - Goal:
10
+ - Notes:
11
+
12
+ ## Steps
13
+
14
+ ### Step: R01
15
+ - Status: pending
16
+ - Description:
17
+ - Files:
18
+ - Risk: low
19
+ - Expected outcome:
20
+ - Validation command:
21
+
22
+ ### Step: R02
23
+ - Status: pending
24
+ - Description:
25
+ - Files:
26
+ - Risk: med
27
+ - Expected outcome:
28
+ - Validation command:
29
+
30
+ ## Notes
31
+ -