agentic-forge 0.0.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 (110) hide show
  1. package/.gitattributes +24 -0
  2. package/.github/workflows/ci.yml +70 -0
  3. package/.markdownlint-cli2.jsonc +16 -0
  4. package/.prettierignore +3 -0
  5. package/.prettierrc +6 -0
  6. package/.vscode/agentic-forge.code-workspace +26 -0
  7. package/CHANGELOG.md +100 -0
  8. package/CLAUDE.md +158 -0
  9. package/CONTRIBUTING.md +152 -0
  10. package/LICENSE +21 -0
  11. package/README.md +145 -0
  12. package/agentic-forge-banner.png +0 -0
  13. package/biome.json +21 -0
  14. package/package.json +5 -0
  15. package/scripts/copy-assets.js +21 -0
  16. package/src/agents/explorer.md +97 -0
  17. package/src/agents/reviewer.md +137 -0
  18. package/src/checkpoints/manager.ts +119 -0
  19. package/src/claude/.claude/skills/analyze/SKILL.md +241 -0
  20. package/src/claude/.claude/skills/analyze/references/bug.md +62 -0
  21. package/src/claude/.claude/skills/analyze/references/debt.md +76 -0
  22. package/src/claude/.claude/skills/analyze/references/doc.md +67 -0
  23. package/src/claude/.claude/skills/analyze/references/security.md +76 -0
  24. package/src/claude/.claude/skills/analyze/references/style.md +72 -0
  25. package/src/claude/.claude/skills/create-checkpoint/SKILL.md +88 -0
  26. package/src/claude/.claude/skills/create-log/SKILL.md +75 -0
  27. package/src/claude/.claude/skills/fix-analyze/SKILL.md +102 -0
  28. package/src/claude/.claude/skills/git-branch/SKILL.md +71 -0
  29. package/src/claude/.claude/skills/git-commit/SKILL.md +107 -0
  30. package/src/claude/.claude/skills/git-pr/SKILL.md +96 -0
  31. package/src/claude/.claude/skills/orchestrate/SKILL.md +120 -0
  32. package/src/claude/.claude/skills/sdlc-plan/SKILL.md +163 -0
  33. package/src/claude/.claude/skills/sdlc-plan/references/bug.md +115 -0
  34. package/src/claude/.claude/skills/sdlc-plan/references/chore.md +105 -0
  35. package/src/claude/.claude/skills/sdlc-plan/references/feature.md +130 -0
  36. package/src/claude/.claude/skills/sdlc-review/SKILL.md +215 -0
  37. package/src/claude/.claude/skills/workflow-builder/SKILL.md +185 -0
  38. package/src/claude/.claude/skills/workflow-builder/references/REFERENCE.md +487 -0
  39. package/src/claude/.claude/skills/workflow-builder/references/workflow-example.yaml +427 -0
  40. package/src/cli.ts +182 -0
  41. package/src/commands/config-cmd.ts +28 -0
  42. package/src/commands/index.ts +21 -0
  43. package/src/commands/init.ts +96 -0
  44. package/src/commands/release-notes.ts +85 -0
  45. package/src/commands/resume.ts +103 -0
  46. package/src/commands/run.ts +234 -0
  47. package/src/commands/shortcuts.ts +11 -0
  48. package/src/commands/skills-dir.ts +11 -0
  49. package/src/commands/status.ts +112 -0
  50. package/src/commands/update.ts +64 -0
  51. package/src/commands/version.ts +27 -0
  52. package/src/commands/workflows.ts +129 -0
  53. package/src/config.ts +129 -0
  54. package/src/console.ts +790 -0
  55. package/src/executor.ts +354 -0
  56. package/src/git/worktree.ts +236 -0
  57. package/src/logging/logger.ts +95 -0
  58. package/src/orchestrator.ts +815 -0
  59. package/src/parser.ts +225 -0
  60. package/src/progress.ts +306 -0
  61. package/src/prompts/agentic-system.md +31 -0
  62. package/src/ralph-loop.ts +260 -0
  63. package/src/renderer.ts +164 -0
  64. package/src/runner.ts +634 -0
  65. package/src/signal-manager.ts +55 -0
  66. package/src/steps/base.ts +71 -0
  67. package/src/steps/conditional-step.ts +144 -0
  68. package/src/steps/index.ts +15 -0
  69. package/src/steps/parallel-step.ts +213 -0
  70. package/src/steps/prompt-step.ts +121 -0
  71. package/src/steps/ralph-loop-step.ts +186 -0
  72. package/src/steps/serial-step.ts +84 -0
  73. package/src/templates/analysis/bug.md.j2 +35 -0
  74. package/src/templates/analysis/debt.md.j2 +38 -0
  75. package/src/templates/analysis/doc.md.j2 +45 -0
  76. package/src/templates/analysis/security.md.j2 +35 -0
  77. package/src/templates/analysis/style.md.j2 +44 -0
  78. package/src/templates/analysis-summary.md.j2 +58 -0
  79. package/src/templates/checkpoint.md.j2 +27 -0
  80. package/src/templates/implementation-report.md.j2 +81 -0
  81. package/src/templates/memory.md.j2 +16 -0
  82. package/src/templates/plan-bug.md.j2 +42 -0
  83. package/src/templates/plan-chore.md.j2 +27 -0
  84. package/src/templates/plan-feature.md.j2 +41 -0
  85. package/src/templates/progress.json.j2 +16 -0
  86. package/src/templates/ralph-report.md.j2 +45 -0
  87. package/src/types.ts +141 -0
  88. package/src/workflows/analyze-codebase-merge.yaml +328 -0
  89. package/src/workflows/analyze-codebase.yaml +196 -0
  90. package/src/workflows/analyze-single.yaml +56 -0
  91. package/src/workflows/demo.yaml +180 -0
  92. package/src/workflows/one-shot.yaml +54 -0
  93. package/src/workflows/plan-build-review.yaml +160 -0
  94. package/src/workflows/ralph-loop.yaml +73 -0
  95. package/tests/config.test.ts +219 -0
  96. package/tests/console.test.ts +506 -0
  97. package/tests/executor.test.ts +339 -0
  98. package/tests/init.test.ts +86 -0
  99. package/tests/logger.test.ts +110 -0
  100. package/tests/parser.test.ts +290 -0
  101. package/tests/progress.test.ts +345 -0
  102. package/tests/ralph-loop.test.ts +418 -0
  103. package/tests/renderer.test.ts +350 -0
  104. package/tests/runner.test.ts +497 -0
  105. package/tests/setup.test.ts +7 -0
  106. package/tests/signal-manager.test.ts +26 -0
  107. package/tests/steps.test.ts +412 -0
  108. package/tests/worktree.test.ts +411 -0
  109. package/tsconfig.json +18 -0
  110. package/vitest.config.ts +8 -0
@@ -0,0 +1,27 @@
1
+ # Chore Plan: {{ title }}
2
+
3
+ Created: {{ created }}
4
+ Status: {{ status }}
5
+ Workflow: {{ workflow_id }}
6
+
7
+ ## Summary
8
+
9
+ {{ summary }}
10
+
11
+ ## Tasks
12
+
13
+ {% for task in tasks %}
14
+ - [{% if task.completed %}x{% else %} {% endif %}] {{ task.description }}
15
+ {% endfor %}
16
+
17
+ ## Affected Files
18
+
19
+ {% for file in affected_files %}
20
+ - {{ file }}
21
+ {% endfor %}
22
+
23
+ {% if notes %}
24
+ ## Notes
25
+
26
+ {{ notes }}
27
+ {% endif %}
@@ -0,0 +1,41 @@
1
+ # Feature Plan: {{ title }}
2
+
3
+ Created: {{ created }}
4
+ Status: {{ status }}
5
+ Workflow: {{ workflow_id }}
6
+
7
+ ## Summary
8
+
9
+ {{ summary }}
10
+
11
+ ## Progress Tracker
12
+
13
+ {% for milestone in milestones %}
14
+ ### Milestone {{ milestone.id }}: {{ milestone.title }}
15
+
16
+ Complexity: {{ milestone.complexity }}
17
+
18
+ {% for task in milestone.tasks %}
19
+ - [{% if task.completed %}x{% else %} {% endif %}] {{ task.id }}: {{ task.description }}
20
+ {%- if task.files %} ({{ task.files | join(", ") }}){% endif %}
21
+ {% endfor %}
22
+
23
+ {% endfor %}
24
+
25
+ ## Affected Files
26
+
27
+ {% for file in affected_files %}
28
+ - {{ file }}
29
+ {% endfor %}
30
+
31
+ ## Dependencies
32
+
33
+ {% for dep in dependencies %}
34
+ - {{ dep }}
35
+ {% endfor %}
36
+
37
+ ## Risks & Considerations
38
+
39
+ {% for risk in risks %}
40
+ - {{ risk }}
41
+ {% endfor %}
@@ -0,0 +1,16 @@
1
+ {
2
+ "schema_version": "1.0",
3
+ "workflow_id": "{{ workflow_id }}",
4
+ "workflow_name": "{{ workflow_name }}",
5
+ "status": "{{ status }}",
6
+ "started_at": "{{ started_at }}",
7
+ "completed_at": {{ completed_at | tojson if completed_at else "null" }},
8
+ "current_step": {{ current_step | tojson if current_step else "null" }},
9
+ "completed_steps": {{ completed_steps | tojson }},
10
+ "pending_steps": {{ pending_steps | tojson }},
11
+ "running_steps": {{ running_steps | tojson }},
12
+ "parallel_branches": {{ parallel_branches | tojson }},
13
+ "errors": {{ errors | tojson }},
14
+ "variables": {{ variables | tojson }},
15
+ "step_outputs": {{ step_outputs | tojson }}
16
+ }
@@ -0,0 +1,45 @@
1
+ # Ralph Wiggum Loop Report
2
+
3
+ Generated: {{ workflow.completed_at }}
4
+ Workflow: {{ workflow.name }}
5
+ ID: {{ workflow.id | default(workflow.workflow_id, true) }}
6
+
7
+ ## Summary
8
+
9
+ **Status**: {{ workflow.status | default('completed') }}
10
+ **Started**: {{ workflow.started_at }}
11
+ **Completed**: {{ workflow.completed_at }}
12
+
13
+ ## Task
14
+
15
+ {% if inputs.task %}
16
+ {{ inputs.task }}
17
+ {% else %}
18
+ _No task description provided_
19
+ {% endif %}
20
+
21
+ ## Loop Execution
22
+
23
+ | Step | Status | Iterations | Summary |
24
+ |------|--------|------------|---------|
25
+ {% for step_name, step in steps.items() %}
26
+ | {{ step_name }} | {{ step.status }} | {{ step.output_summary | default('-') | truncate(80) }} |
27
+ {% endfor %}
28
+
29
+ ## Final Output
30
+
31
+ {% for step_name, step in steps.items() %}
32
+ {% if step.output %}
33
+ ### {{ step_name }}
34
+
35
+ {{ step.output }}
36
+ {% endif %}
37
+ {% endfor %}
38
+
39
+ {% if files_changed %}
40
+ ## Files Changed
41
+
42
+ {% for file in files_changed %}
43
+ - `{{ file }}`
44
+ {% endfor %}
45
+ {% endif %}
package/src/types.ts ADDED
@@ -0,0 +1,141 @@
1
+ /** Core types for agentic-forge workflow engine. */
2
+
3
+ // --- Step types ---
4
+
5
+ export type StepType =
6
+ | "prompt"
7
+ | "parallel"
8
+ | "serial"
9
+ | "conditional"
10
+ | "ralph-loop"
11
+ | "wait-for-human";
12
+
13
+ export const VALID_STEP_TYPES: StepType[] = [
14
+ "prompt",
15
+ "parallel",
16
+ "serial",
17
+ "conditional",
18
+ "ralph-loop",
19
+ "wait-for-human",
20
+ ];
21
+
22
+ // --- Workflow definition types ---
23
+
24
+ export interface Variable {
25
+ name: string;
26
+ type: string;
27
+ required: boolean;
28
+ default?: unknown;
29
+ description?: string;
30
+ }
31
+
32
+ export interface GitSettings {
33
+ enabled: boolean;
34
+ worktree: boolean;
35
+ autoCommit: boolean;
36
+ autoPr: boolean;
37
+ branchPrefix: string;
38
+ }
39
+
40
+ export interface StepGitSettings {
41
+ worktree: boolean;
42
+ autoPr: boolean;
43
+ branchPrefix: string;
44
+ }
45
+
46
+ export interface WorkflowSettings {
47
+ maxRetry: number;
48
+ timeoutMinutes: number;
49
+ trackProgress: boolean;
50
+ autofix: string;
51
+ terminalOutput: string;
52
+ bypassPermissions: boolean;
53
+ strictMode: boolean;
54
+ model: string | null;
55
+ requiredTools: string[];
56
+ git: GitSettings;
57
+ }
58
+
59
+ export interface StepDefinition {
60
+ name: string;
61
+ type: StepType;
62
+ prompt?: string | null;
63
+ agent?: string | null;
64
+ steps: StepDefinition[];
65
+ mergeStrategy: string;
66
+ mergeMode: string;
67
+ condition?: string | null;
68
+ thenSteps: StepDefinition[];
69
+ elseSteps: StepDefinition[];
70
+ maxIterations: number | string;
71
+ completionPromise?: string | null;
72
+ message?: string | null;
73
+ pollingInterval: number;
74
+ onTimeout: string;
75
+ model?: string | null;
76
+ stepTimeoutMinutes?: number | null;
77
+ stepMaxRetry?: number | null;
78
+ onError: string;
79
+ checkpoint: boolean;
80
+ dependsOn?: string | null;
81
+ git?: StepGitSettings | null;
82
+ }
83
+
84
+ export interface OutputDefinition {
85
+ name: string;
86
+ template: string;
87
+ path: string;
88
+ when: string;
89
+ }
90
+
91
+ export interface WorkflowDefinition {
92
+ name: string;
93
+ version: string;
94
+ description: string;
95
+ settings: WorkflowSettings;
96
+ variables: Variable[];
97
+ steps: StepDefinition[];
98
+ outputs: OutputDefinition[];
99
+ }
100
+
101
+ // --- Progress tracking types ---
102
+
103
+ export type WorkflowStatus = "pending" | "running" | "completed" | "failed" | "paused" | "canceled";
104
+
105
+ export type StepStatus = "pending" | "running" | "completed" | "failed" | "skipped";
106
+
107
+ export interface StepProgress {
108
+ name: string;
109
+ status: string;
110
+ startedAt: string | null;
111
+ completedAt: string | null;
112
+ retryCount: number;
113
+ outputSummary: string;
114
+ error: string | null;
115
+ humanInput: string | null;
116
+ }
117
+
118
+ export interface ParallelBranch {
119
+ branchId: string;
120
+ status: string;
121
+ worktreePath: string;
122
+ progressFile: string;
123
+ }
124
+
125
+ export interface WorkflowProgress {
126
+ schemaVersion: string;
127
+ workflowId: string;
128
+ workflowName: string;
129
+ status: string;
130
+ startedAt: string | null;
131
+ completedAt: string | null;
132
+ currentStep: Record<string, unknown> | null;
133
+ completedSteps: StepProgress[];
134
+ pendingSteps: string[];
135
+ runningSteps: string[];
136
+ parallelBranches: ParallelBranch[];
137
+ errors: Record<string, unknown>[];
138
+ variables: Record<string, unknown>;
139
+ stepOutputs: Record<string, unknown>;
140
+ workflowFile: string;
141
+ }
@@ -0,0 +1,328 @@
1
+ name: analyze-codebase-merge
2
+ version: "1.0"
3
+ description: Run comprehensive codebase analysis with autofix, merge branches, review, and create PR
4
+
5
+ settings:
6
+ max-retry: 2
7
+ timeout-minutes: 180
8
+ track-progress: true
9
+ terminal-output: base
10
+ git:
11
+ enabled: true
12
+ worktree: true
13
+ auto-commit: true
14
+ branch-prefix: "agentic/analysis"
15
+
16
+ variables:
17
+ - name: autofix
18
+ type: string
19
+ required: false
20
+ default: "major"
21
+ description: Severity level for automatic fixes (none, minor, major, critical)
22
+ - name: fix_severity
23
+ type: string
24
+ required: false
25
+ default: "major"
26
+ description: Minimum severity for validation auto-fix
27
+ - name: paths
28
+ type: string
29
+ required: false
30
+ default: ""
31
+ description: Space-separated list of paths to analyze (optional)
32
+ - name: create_pr
33
+ type: boolean
34
+ required: false
35
+ default: false
36
+ description: Whether to create a PR after all changes are merged
37
+ - name: max_fix_iterations
38
+ type: number
39
+ required: false
40
+ default: 25
41
+ description: Maximum iterations per analysis type for fixing issues
42
+
43
+ steps:
44
+ - name: analyze-and-fix-all
45
+ type: parallel
46
+ merge-strategy: wait-all
47
+ merge-mode: merge
48
+ git:
49
+ worktree: true
50
+ branch-prefix: "agentic/analysis"
51
+ steps:
52
+ - name: bug-analysis
53
+ type: serial
54
+ steps:
55
+ - name: analyze-bug
56
+ type: prompt
57
+ prompt: /af-analyze bug {{ variables.paths }}
58
+
59
+ - name: fix-bug
60
+ type: conditional
61
+ condition: "variables.autofix != 'none'"
62
+ then:
63
+ - name: apply-bug-fixes
64
+ type: ralph-loop
65
+ max-iterations: "{{ variables.max_fix_iterations }}"
66
+ completion-promise: "BUG_FIXES_COMPLETE"
67
+ model: sonnet
68
+ timeout-minutes: 30
69
+ prompt: |
70
+ ## Task
71
+ Fix issues from the bug analysis document.
72
+
73
+ ## Instructions
74
+ 1. Read the analysis document at agentic/analysis/bug.md
75
+ 2. If the document does not exist or has no unfixed issues, return the completion promise
76
+ 3. Pick the NEXT unfixed issue (highest severity first, must be {{ variables.autofix }} or higher)
77
+ 4. Navigate the code to understand the issue context
78
+ 5. Implement the fix
79
+ 6. Run build/lint commands and fix any errors
80
+ 7. Mark the issue as fixed in the analysis document
81
+ 8. Commit using git-commit with title starting with issue ID
82
+ 9. End this session (do NOT continue to next issue)
83
+
84
+ ## Completion
85
+ When ALL issues with severity {{ variables.autofix }} or higher are fixed OR the document doesn't exist, output:
86
+ ```json
87
+ {"ralph_complete": true, "promise": "BUG_FIXES_COMPLETE"}
88
+ ```
89
+
90
+ IMPORTANT:
91
+ - Fix only ONE issue per iteration, then end session
92
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
93
+ - Only return completion promise when genuinely done
94
+
95
+ - name: debt-analysis
96
+ type: serial
97
+ steps:
98
+ - name: analyze-debt
99
+ type: prompt
100
+ prompt: /af-analyze debt {{ variables.paths }}
101
+
102
+ - name: fix-debt
103
+ type: conditional
104
+ condition: "variables.autofix != 'none'"
105
+ then:
106
+ - name: apply-debt-fixes
107
+ type: ralph-loop
108
+ max-iterations: "{{ variables.max_fix_iterations }}"
109
+ completion-promise: "DEBT_FIXES_COMPLETE"
110
+ model: sonnet
111
+ timeout-minutes: 30
112
+ prompt: |
113
+ ## Task
114
+ Fix issues from the technical debt analysis document.
115
+
116
+ ## Instructions
117
+ 1. Read the analysis document at agentic/analysis/debt.md
118
+ 2. If the document does not exist or has no unfixed issues, return the completion promise
119
+ 3. Pick the NEXT unfixed issue (highest severity first, must be {{ variables.autofix }} or higher)
120
+ 4. Navigate the code to understand the issue context
121
+ 5. Implement the fix
122
+ 6. Run build/lint commands and fix any errors
123
+ 7. Mark the issue as fixed in the analysis document
124
+ 8. Commit using git-commit with title starting with issue ID
125
+ 9. End this session (do NOT continue to next issue)
126
+
127
+ ## Completion
128
+ When ALL issues with severity {{ variables.autofix }} or higher are fixed OR the document doesn't exist, output:
129
+ ```json
130
+ {"ralph_complete": true, "promise": "DEBT_FIXES_COMPLETE"}
131
+ ```
132
+
133
+ IMPORTANT:
134
+ - Fix only ONE issue per iteration, then end session
135
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
136
+ - Only return completion promise when genuinely done
137
+
138
+ - name: doc-analysis
139
+ type: serial
140
+ steps:
141
+ - name: analyze-doc
142
+ type: prompt
143
+ prompt: /af-analyze doc {{ variables.paths }}
144
+
145
+ - name: fix-doc
146
+ type: conditional
147
+ condition: "variables.autofix != 'none'"
148
+ then:
149
+ - name: apply-doc-fixes
150
+ type: ralph-loop
151
+ max-iterations: "{{ variables.max_fix_iterations }}"
152
+ completion-promise: "DOC_FIXES_COMPLETE"
153
+ model: sonnet
154
+ timeout-minutes: 30
155
+ prompt: |
156
+ ## Task
157
+ Fix issues from the documentation analysis document.
158
+
159
+ ## Instructions
160
+ 1. Read the analysis document at agentic/analysis/doc.md
161
+ 2. If the document does not exist or has no unfixed issues, return the completion promise
162
+ 3. Pick the NEXT unfixed issue (highest severity first, must be {{ variables.autofix }} or higher)
163
+ 4. Navigate the code to understand the issue context
164
+ 5. Implement the fix
165
+ 6. Run build/lint commands and fix any errors
166
+ 7. Mark the issue as fixed in the analysis document
167
+ 8. Commit using git-commit with title starting with issue ID
168
+ 9. End this session (do NOT continue to next issue)
169
+
170
+ ## Completion
171
+ When ALL issues with severity {{ variables.autofix }} or higher are fixed OR the document doesn't exist, output:
172
+ ```json
173
+ {"ralph_complete": true, "promise": "DOC_FIXES_COMPLETE"}
174
+ ```
175
+
176
+ IMPORTANT:
177
+ - Fix only ONE issue per iteration, then end session
178
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
179
+ - Only return completion promise when genuinely done
180
+
181
+ - name: security-analysis
182
+ type: serial
183
+ steps:
184
+ - name: analyze-security
185
+ type: prompt
186
+ prompt: /af-analyze security {{ variables.paths }}
187
+
188
+ - name: fix-security
189
+ type: conditional
190
+ condition: "variables.autofix != 'none'"
191
+ then:
192
+ - name: apply-security-fixes
193
+ type: ralph-loop
194
+ max-iterations: "{{ variables.max_fix_iterations }}"
195
+ completion-promise: "SECURITY_FIXES_COMPLETE"
196
+ model: sonnet
197
+ timeout-minutes: 30
198
+ prompt: |
199
+ ## Task
200
+ Fix issues from the security analysis document.
201
+
202
+ ## Instructions
203
+ 1. Read the analysis document at agentic/analysis/security.md
204
+ 2. If the document does not exist or has no unfixed issues, return the completion promise
205
+ 3. Pick the NEXT unfixed issue (highest severity first, must be {{ variables.autofix }} or higher)
206
+ 4. Navigate the code to understand the issue context
207
+ 5. Implement the fix
208
+ 6. Run build/lint commands and fix any errors
209
+ 7. Mark the issue as fixed in the analysis document
210
+ 8. Commit using git-commit with title starting with issue ID
211
+ 9. End this session (do NOT continue to next issue)
212
+
213
+ ## Completion
214
+ When ALL issues with severity {{ variables.autofix }} or higher are fixed OR the document doesn't exist, output:
215
+ ```json
216
+ {"ralph_complete": true, "promise": "SECURITY_FIXES_COMPLETE"}
217
+ ```
218
+
219
+ IMPORTANT:
220
+ - Fix only ONE issue per iteration, then end session
221
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
222
+ - Only return completion promise when genuinely done
223
+
224
+ - name: style-analysis
225
+ type: serial
226
+ steps:
227
+ - name: analyze-style
228
+ type: prompt
229
+ prompt: /af-analyze style {{ variables.paths }}
230
+
231
+ - name: fix-style
232
+ type: conditional
233
+ condition: "variables.autofix != 'none'"
234
+ then:
235
+ - name: apply-style-fixes
236
+ type: ralph-loop
237
+ max-iterations: "{{ variables.max_fix_iterations }}"
238
+ completion-promise: "STYLE_FIXES_COMPLETE"
239
+ model: sonnet
240
+ timeout-minutes: 30
241
+ prompt: |
242
+ ## Task
243
+ Fix issues from the style analysis document.
244
+
245
+ ## Instructions
246
+ 1. Read the analysis document at agentic/analysis/style.md
247
+ 2. If the document does not exist or has no unfixed issues, return the completion promise
248
+ 3. Pick the NEXT unfixed issue (highest severity first, must be {{ variables.autofix }} or higher)
249
+ 4. Navigate the code to understand the issue context
250
+ 5. Implement the fix
251
+ 6. Run build/lint commands and fix any errors
252
+ 7. Mark the issue as fixed in the analysis document
253
+ 8. Commit using git-commit with title starting with issue ID
254
+ 9. End this session (do NOT continue to next issue)
255
+
256
+ ## Completion
257
+ When ALL issues with severity {{ variables.autofix }} or higher are fixed OR the document doesn't exist, output:
258
+ ```json
259
+ {"ralph_complete": true, "promise": "STYLE_FIXES_COMPLETE"}
260
+ ```
261
+
262
+ IMPORTANT:
263
+ - Fix only ONE issue per iteration, then end session
264
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
265
+ - Only return completion promise when genuinely done
266
+
267
+ - name: review-merged-changes
268
+ type: prompt
269
+ prompt: /af-sdlc-review "" {{ variables.fix_severity }}
270
+
271
+ - name: fix-validation-issues
272
+ type: conditional
273
+ condition: "variables.fix_severity != 'none'"
274
+ then:
275
+ - name: apply-validation-fixes
276
+ type: ralph-loop
277
+ max-iterations: "{{ variables.max_fix_iterations }}"
278
+ completion-promise: "VALIDATION_FIXES_COMPLETE"
279
+ model: sonnet
280
+ timeout-minutes: 30
281
+ prompt: |
282
+ ## Task
283
+ Fix validation issues from the merged analysis changes.
284
+
285
+ ## Instructions
286
+ 1. Run validation checks (tests, build, lint)
287
+ 2. If all checks pass, return the completion promise
288
+ 3. Pick the NEXT failing check (tests first, then build, then lint)
289
+ 4. Navigate the code to understand the failure
290
+ 5. Implement the fix
291
+ 6. Run the failing check again to verify
292
+ 7. Commit using git-commit with clear message
293
+ 8. End this session (do NOT continue to next issue)
294
+
295
+ ## Checks to Run
296
+ - Run the test suite and fix failing tests
297
+ - Run the build and fix any build errors
298
+ - Run linting and fix style issues
299
+ - Verify all changes follow project conventions
300
+
301
+ ## Completion
302
+ When ALL validation checks pass, output:
303
+ ```json
304
+ {"ralph_complete": true, "promise": "VALIDATION_FIXES_COMPLETE"}
305
+ ```
306
+
307
+ IMPORTANT:
308
+ - Fix only ONE issue per iteration, then end session
309
+ - If an issue cannot be fixed (error, missing data), mark as skipped with reason
310
+ - Only return completion promise when genuinely done
311
+
312
+ - name: re-review
313
+ type: prompt
314
+ prompt: /af-sdlc-review "" {{ variables.fix_severity }}
315
+
316
+ - name: create-pr
317
+ type: conditional
318
+ condition: "variables.create_pr"
319
+ then:
320
+ - name: open-pr
321
+ type: prompt
322
+ prompt: /af-git-pr "[Analysis] Codebase analysis and fixes"
323
+
324
+ outputs:
325
+ - name: analysis-summary
326
+ template: analysis-summary.md.j2
327
+ path: summary.md
328
+ when: completed