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.
- package/.gitattributes +24 -0
- package/.github/workflows/ci.yml +70 -0
- package/.markdownlint-cli2.jsonc +16 -0
- package/.prettierignore +3 -0
- package/.prettierrc +6 -0
- package/.vscode/agentic-forge.code-workspace +26 -0
- package/CHANGELOG.md +100 -0
- package/CLAUDE.md +158 -0
- package/CONTRIBUTING.md +152 -0
- package/LICENSE +21 -0
- package/README.md +145 -0
- package/agentic-forge-banner.png +0 -0
- package/biome.json +21 -0
- package/package.json +5 -0
- package/scripts/copy-assets.js +21 -0
- package/src/agents/explorer.md +97 -0
- package/src/agents/reviewer.md +137 -0
- package/src/checkpoints/manager.ts +119 -0
- package/src/claude/.claude/skills/analyze/SKILL.md +241 -0
- package/src/claude/.claude/skills/analyze/references/bug.md +62 -0
- package/src/claude/.claude/skills/analyze/references/debt.md +76 -0
- package/src/claude/.claude/skills/analyze/references/doc.md +67 -0
- package/src/claude/.claude/skills/analyze/references/security.md +76 -0
- package/src/claude/.claude/skills/analyze/references/style.md +72 -0
- package/src/claude/.claude/skills/create-checkpoint/SKILL.md +88 -0
- package/src/claude/.claude/skills/create-log/SKILL.md +75 -0
- package/src/claude/.claude/skills/fix-analyze/SKILL.md +102 -0
- package/src/claude/.claude/skills/git-branch/SKILL.md +71 -0
- package/src/claude/.claude/skills/git-commit/SKILL.md +107 -0
- package/src/claude/.claude/skills/git-pr/SKILL.md +96 -0
- package/src/claude/.claude/skills/orchestrate/SKILL.md +120 -0
- package/src/claude/.claude/skills/sdlc-plan/SKILL.md +163 -0
- package/src/claude/.claude/skills/sdlc-plan/references/bug.md +115 -0
- package/src/claude/.claude/skills/sdlc-plan/references/chore.md +105 -0
- package/src/claude/.claude/skills/sdlc-plan/references/feature.md +130 -0
- package/src/claude/.claude/skills/sdlc-review/SKILL.md +215 -0
- package/src/claude/.claude/skills/workflow-builder/SKILL.md +185 -0
- package/src/claude/.claude/skills/workflow-builder/references/REFERENCE.md +487 -0
- package/src/claude/.claude/skills/workflow-builder/references/workflow-example.yaml +427 -0
- package/src/cli.ts +182 -0
- package/src/commands/config-cmd.ts +28 -0
- package/src/commands/index.ts +21 -0
- package/src/commands/init.ts +96 -0
- package/src/commands/release-notes.ts +85 -0
- package/src/commands/resume.ts +103 -0
- package/src/commands/run.ts +234 -0
- package/src/commands/shortcuts.ts +11 -0
- package/src/commands/skills-dir.ts +11 -0
- package/src/commands/status.ts +112 -0
- package/src/commands/update.ts +64 -0
- package/src/commands/version.ts +27 -0
- package/src/commands/workflows.ts +129 -0
- package/src/config.ts +129 -0
- package/src/console.ts +790 -0
- package/src/executor.ts +354 -0
- package/src/git/worktree.ts +236 -0
- package/src/logging/logger.ts +95 -0
- package/src/orchestrator.ts +815 -0
- package/src/parser.ts +225 -0
- package/src/progress.ts +306 -0
- package/src/prompts/agentic-system.md +31 -0
- package/src/ralph-loop.ts +260 -0
- package/src/renderer.ts +164 -0
- package/src/runner.ts +634 -0
- package/src/signal-manager.ts +55 -0
- package/src/steps/base.ts +71 -0
- package/src/steps/conditional-step.ts +144 -0
- package/src/steps/index.ts +15 -0
- package/src/steps/parallel-step.ts +213 -0
- package/src/steps/prompt-step.ts +121 -0
- package/src/steps/ralph-loop-step.ts +186 -0
- package/src/steps/serial-step.ts +84 -0
- package/src/templates/analysis/bug.md.j2 +35 -0
- package/src/templates/analysis/debt.md.j2 +38 -0
- package/src/templates/analysis/doc.md.j2 +45 -0
- package/src/templates/analysis/security.md.j2 +35 -0
- package/src/templates/analysis/style.md.j2 +44 -0
- package/src/templates/analysis-summary.md.j2 +58 -0
- package/src/templates/checkpoint.md.j2 +27 -0
- package/src/templates/implementation-report.md.j2 +81 -0
- package/src/templates/memory.md.j2 +16 -0
- package/src/templates/plan-bug.md.j2 +42 -0
- package/src/templates/plan-chore.md.j2 +27 -0
- package/src/templates/plan-feature.md.j2 +41 -0
- package/src/templates/progress.json.j2 +16 -0
- package/src/templates/ralph-report.md.j2 +45 -0
- package/src/types.ts +141 -0
- package/src/workflows/analyze-codebase-merge.yaml +328 -0
- package/src/workflows/analyze-codebase.yaml +196 -0
- package/src/workflows/analyze-single.yaml +56 -0
- package/src/workflows/demo.yaml +180 -0
- package/src/workflows/one-shot.yaml +54 -0
- package/src/workflows/plan-build-review.yaml +160 -0
- package/src/workflows/ralph-loop.yaml +73 -0
- package/tests/config.test.ts +219 -0
- package/tests/console.test.ts +506 -0
- package/tests/executor.test.ts +339 -0
- package/tests/init.test.ts +86 -0
- package/tests/logger.test.ts +110 -0
- package/tests/parser.test.ts +290 -0
- package/tests/progress.test.ts +345 -0
- package/tests/ralph-loop.test.ts +418 -0
- package/tests/renderer.test.ts +350 -0
- package/tests/runner.test.ts +497 -0
- package/tests/setup.test.ts +7 -0
- package/tests/signal-manager.test.ts +26 -0
- package/tests/steps.test.ts +412 -0
- package/tests/worktree.test.ts +411 -0
- package/tsconfig.json +18 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
# Workflow Schema Reference
|
|
2
|
+
|
|
3
|
+
Complete reference for all agentic-forge workflow YAML properties.
|
|
4
|
+
|
|
5
|
+
## Top-Level Structure
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
name: workflow-name # Required. Unique identifier (kebab-case)
|
|
9
|
+
version: "1.0" # Required. Schema version (always "1.0")
|
|
10
|
+
description: | # Optional. Human-readable description
|
|
11
|
+
What this workflow does
|
|
12
|
+
settings: {} # Optional. Workflow configuration
|
|
13
|
+
variables: [] # Optional. Input parameters
|
|
14
|
+
steps: [] # Required. Workflow steps (at least one)
|
|
15
|
+
outputs: [] # Optional. Output artifacts
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Settings
|
|
19
|
+
|
|
20
|
+
All settings are optional with sensible defaults.
|
|
21
|
+
|
|
22
|
+
### Global Settings
|
|
23
|
+
|
|
24
|
+
| Key | Type | Default | Valid Values | Description |
|
|
25
|
+
| -------------------- | ------ | ---------- | ---------------------------- | ------------------------------------------------ |
|
|
26
|
+
| `max-retry` | int | `3` | 0+ | Max retry attempts for failed steps |
|
|
27
|
+
| `timeout-minutes` | int | `60` | 1+ | Max time for entire workflow (minutes) |
|
|
28
|
+
| `track-progress` | bool | `true` | true/false | Track progress in progress.json |
|
|
29
|
+
| `autofix` | string | `"none"` | none, minor, major, critical | Auto-fix severity level |
|
|
30
|
+
| `terminal-output` | string | `"base"` | base, all | Output mode: base (last message) or all (stream) |
|
|
31
|
+
| `bypass-permissions` | bool | `false` | true/false | Bypass tool permission prompts |
|
|
32
|
+
| `strict-mode` | bool | `false` | true/false | Fail on undefined template variables |
|
|
33
|
+
| `model` | string | `"sonnet"` | sonnet, haiku, opus | Default model for all steps |
|
|
34
|
+
| `required-tools` | list | `[]` | Tool names | Tools Claude can use without prompting |
|
|
35
|
+
|
|
36
|
+
### Git Settings
|
|
37
|
+
|
|
38
|
+
Nested under `settings.git`:
|
|
39
|
+
|
|
40
|
+
| Key | Type | Default | Valid Values | Description |
|
|
41
|
+
| --------------- | ------ | ----------- | ------------ | -------------------------------- |
|
|
42
|
+
| `enabled` | bool | `false` | true/false | Enable git operations |
|
|
43
|
+
| `worktree` | bool | `false` | true/false | Use worktrees for parallel steps |
|
|
44
|
+
| `auto-commit` | bool | `true` | true/false | Auto-commit after each step |
|
|
45
|
+
| `auto-pr` | bool | `true` | true/false | Auto-create PR on completion |
|
|
46
|
+
| `branch-prefix` | string | `"agentic"` | any string | Prefix for branch names |
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
settings:
|
|
50
|
+
git:
|
|
51
|
+
enabled: true
|
|
52
|
+
worktree: true
|
|
53
|
+
auto-commit: true
|
|
54
|
+
auto-pr: false
|
|
55
|
+
branch-prefix: "feature"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Variables
|
|
59
|
+
|
|
60
|
+
Define input parameters for the workflow. Passed via `--var "name=value"` on the CLI.
|
|
61
|
+
|
|
62
|
+
| Key | Required | Type | Default | Description |
|
|
63
|
+
| ------------- | -------- | ------ | ---------- | ------------------------------------- |
|
|
64
|
+
| `name` | Yes | string | - | Variable identifier (snake_case) |
|
|
65
|
+
| `type` | No | string | `"string"` | string, number, boolean |
|
|
66
|
+
| `required` | No | bool | `true` | Whether the variable must be provided |
|
|
67
|
+
| `default` | No | any | `null` | Default value if not provided |
|
|
68
|
+
| `description` | No | string | `""` | Human-readable description |
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
variables:
|
|
72
|
+
- name: task
|
|
73
|
+
type: string
|
|
74
|
+
required: true
|
|
75
|
+
description: Task description
|
|
76
|
+
|
|
77
|
+
- name: max_iterations
|
|
78
|
+
type: number
|
|
79
|
+
required: false
|
|
80
|
+
default: 10
|
|
81
|
+
description: Maximum loop iterations
|
|
82
|
+
|
|
83
|
+
- name: create_pr
|
|
84
|
+
type: boolean
|
|
85
|
+
required: false
|
|
86
|
+
default: true
|
|
87
|
+
description: Whether to create a PR
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Reference in templates: `{{ variables.task }}`, `{{ variables.max_iterations }}`
|
|
91
|
+
|
|
92
|
+
## Step Types
|
|
93
|
+
|
|
94
|
+
### Common Step Properties
|
|
95
|
+
|
|
96
|
+
These properties apply to all step types:
|
|
97
|
+
|
|
98
|
+
| Key | Type | Default | Valid Values | Description |
|
|
99
|
+
| ----------------- | ------ | ------------ | ----------------------------------------------------------------- | ---------------------------- |
|
|
100
|
+
| `name` | string | **required** | kebab-case | Unique step identifier |
|
|
101
|
+
| `type` | string | **required** | prompt, serial, parallel, conditional, ralph-loop, wait-for-human | Step type |
|
|
102
|
+
| `model` | string | null | sonnet, haiku, opus | Override workflow model |
|
|
103
|
+
| `timeout-minutes` | int | null | 1+ | Override workflow timeout |
|
|
104
|
+
| `max-retry` | int | null | 0+ | Override workflow max-retry |
|
|
105
|
+
| `on-error` | string | `"retry"` | retry, skip, fail | Error handling strategy |
|
|
106
|
+
| `checkpoint` | bool | `false` | true/false | Create checkpoint after step |
|
|
107
|
+
| `depends-on` | string | null | step name | Step dependency |
|
|
108
|
+
|
|
109
|
+
### prompt
|
|
110
|
+
|
|
111
|
+
Execute a prompt in a Claude session. The most common step type.
|
|
112
|
+
|
|
113
|
+
**Specific properties:**
|
|
114
|
+
|
|
115
|
+
| Key | Type | Required | Description |
|
|
116
|
+
| -------- | ------ | -------- | ----------------------------------------------- |
|
|
117
|
+
| `prompt` | string | Yes | The prompt text, skill invocation, or template |
|
|
118
|
+
| `agent` | string | No | Path to an agent file to load before the prompt |
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
# Simple prompt
|
|
122
|
+
- name: implement-feature
|
|
123
|
+
type: prompt
|
|
124
|
+
prompt: |
|
|
125
|
+
Implement the following feature: {{ variables.task }}
|
|
126
|
+
model: sonnet
|
|
127
|
+
timeout-minutes: 30
|
|
128
|
+
on-error: retry
|
|
129
|
+
checkpoint: true
|
|
130
|
+
|
|
131
|
+
# Skill invocation (always use fully qualified names)
|
|
132
|
+
- name: generate-plan
|
|
133
|
+
type: prompt
|
|
134
|
+
prompt: /sdlc-plan --type {{ variables.plan_type }} {{ variables.task }}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### serial
|
|
138
|
+
|
|
139
|
+
Execute nested steps sequentially. Stops on first failure.
|
|
140
|
+
|
|
141
|
+
**Specific properties:**
|
|
142
|
+
|
|
143
|
+
| Key | Type | Required | Description |
|
|
144
|
+
| ------- | ---- | -------- | ------------------------------- |
|
|
145
|
+
| `steps` | list | Yes | List of nested step definitions |
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
- name: setup-and-build
|
|
149
|
+
type: serial
|
|
150
|
+
steps:
|
|
151
|
+
- name: setup
|
|
152
|
+
type: prompt
|
|
153
|
+
prompt: "Set up the environment"
|
|
154
|
+
- name: build
|
|
155
|
+
type: prompt
|
|
156
|
+
prompt: "Build the project"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### parallel
|
|
160
|
+
|
|
161
|
+
Execute nested steps concurrently. Supports git worktrees for isolation.
|
|
162
|
+
|
|
163
|
+
**Specific properties:**
|
|
164
|
+
|
|
165
|
+
| Key | Type | Default | Description |
|
|
166
|
+
| ---------------- | ------ | --------------- | ---------------------------------------------------- |
|
|
167
|
+
| `steps` | list | **required** | List of nested step definitions |
|
|
168
|
+
| `merge-strategy` | string | `"wait-all"` | Only "wait-all" supported |
|
|
169
|
+
| `merge-mode` | string | `"independent"` | "independent" (no merge) or "merge" (merge branches) |
|
|
170
|
+
| `git` | object | null | Step-level git config (see below) |
|
|
171
|
+
|
|
172
|
+
**Step-level git (parallel only):**
|
|
173
|
+
|
|
174
|
+
| Key | Type | Default | Description |
|
|
175
|
+
| --------------- | ------ | ----------- | ---------------------------------- |
|
|
176
|
+
| `worktree` | bool | `false` | Run each step in separate worktree |
|
|
177
|
+
| `branch-prefix` | string | `"agentic"` | Prefix for parallel branch names |
|
|
178
|
+
| `auto-pr` | bool | `false` | Auto-create PR per branch |
|
|
179
|
+
|
|
180
|
+
**Constraints:**
|
|
181
|
+
|
|
182
|
+
- Nested parallel steps are NOT allowed (parallel inside parallel)
|
|
183
|
+
- When `merge-mode: merge`, branches are merged back to the parent branch after all complete
|
|
184
|
+
- When `merge-mode: independent`, each branch stays separate
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
- name: parallel-analysis
|
|
188
|
+
type: parallel
|
|
189
|
+
merge-strategy: wait-all
|
|
190
|
+
merge-mode: independent
|
|
191
|
+
git:
|
|
192
|
+
worktree: true
|
|
193
|
+
branch-prefix: "analysis"
|
|
194
|
+
steps:
|
|
195
|
+
- name: security-scan
|
|
196
|
+
type: prompt
|
|
197
|
+
prompt: /analyze security
|
|
198
|
+
on-error: skip
|
|
199
|
+
- name: style-check
|
|
200
|
+
type: prompt
|
|
201
|
+
prompt: /analyze style
|
|
202
|
+
on-error: skip
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### conditional
|
|
206
|
+
|
|
207
|
+
Branch execution based on a Jinja2 condition expression.
|
|
208
|
+
|
|
209
|
+
**Specific properties:**
|
|
210
|
+
|
|
211
|
+
| Key | Type | Required | Description |
|
|
212
|
+
| ----------- | ------ | -------- | ------------------------------------------ |
|
|
213
|
+
| `condition` | string | Yes | Jinja2 expression evaluating to true/false |
|
|
214
|
+
| `then` | list | Yes | Steps to execute if condition is true |
|
|
215
|
+
| `else` | list | No | Steps to execute if condition is false |
|
|
216
|
+
|
|
217
|
+
**Condition evaluation supports:**
|
|
218
|
+
|
|
219
|
+
- Variable checks: `{{ variables.create_pr }}`
|
|
220
|
+
- Equality: `{{ variables.severity == 'major' }}`
|
|
221
|
+
- Inequality: `{{ variables.mode != 'skip' }}`
|
|
222
|
+
- Output checks: `{{ outputs.review.passed }}`
|
|
223
|
+
- List operations: `{{ outputs.review.issues | length > 0 }}`
|
|
224
|
+
- Filtering: `{{ outputs.review.issues | selectattr('severity', 'eq', 'critical') | list | length > 0 }}`
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
- name: maybe-create-pr
|
|
228
|
+
type: conditional
|
|
229
|
+
condition: "{{ variables.create_pr }}"
|
|
230
|
+
then:
|
|
231
|
+
- name: open-pr
|
|
232
|
+
type: prompt
|
|
233
|
+
prompt: /git-pr
|
|
234
|
+
else:
|
|
235
|
+
- name: skip-pr
|
|
236
|
+
type: prompt
|
|
237
|
+
prompt: "Skipping PR creation as requested."
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### ralph-loop
|
|
241
|
+
|
|
242
|
+
Iterative prompt execution with completion detection. Each iteration runs in a fresh Claude session.
|
|
243
|
+
|
|
244
|
+
**Specific properties:**
|
|
245
|
+
|
|
246
|
+
| Key | Type | Default | Description |
|
|
247
|
+
| -------------------- | ------------- | ------------ | ------------------------------------------------ |
|
|
248
|
+
| `prompt` | string | **required** | Prompt template for each iteration |
|
|
249
|
+
| `max-iterations` | int or string | `5` | Maximum iterations (supports variable templates) |
|
|
250
|
+
| `completion-promise` | string | null | Text to match in completion JSON `promise` field |
|
|
251
|
+
|
|
252
|
+
**How it works:**
|
|
253
|
+
|
|
254
|
+
1. Each iteration runs in a fresh Claude session (no context accumulation)
|
|
255
|
+
2. State persists in `agentic/outputs/{workflow-id}/ralph-{step-name}.md`
|
|
256
|
+
3. Loop exits when Claude outputs completion JSON or max iterations reached
|
|
257
|
+
4. Additional template variables: `{{ iteration }}` (current), `{{ max_iterations }}` (max)
|
|
258
|
+
|
|
259
|
+
**Completion JSON format** (Claude must output this when done):
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{ "ralph_complete": true, "promise": "YOUR_PROMISE_TEXT" }
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**Failure signal** (Claude outputs this if stuck):
|
|
266
|
+
|
|
267
|
+
```json
|
|
268
|
+
{ "ralph_complete": false }
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
The `completion-promise` setting must match the `promise` value in Claude's JSON output.
|
|
272
|
+
|
|
273
|
+
````yaml
|
|
274
|
+
- name: implement-milestones
|
|
275
|
+
type: ralph-loop
|
|
276
|
+
prompt: |
|
|
277
|
+
Read the plan at agentic/outputs/{{ workflow_id }}/plan.md.
|
|
278
|
+
Implement the next incomplete milestone.
|
|
279
|
+
|
|
280
|
+
When ALL milestones are complete, output:
|
|
281
|
+
```json
|
|
282
|
+
{"ralph_complete": true, "promise": "ALL_DONE"}
|
|
283
|
+
```
|
|
284
|
+
max-iterations: "{{ variables.max_iterations }}"
|
|
285
|
+
completion-promise: "ALL_DONE"
|
|
286
|
+
model: sonnet
|
|
287
|
+
checkpoint: true
|
|
288
|
+
timeout-minutes: 120
|
|
289
|
+
````
|
|
290
|
+
|
|
291
|
+
### wait-for-human
|
|
292
|
+
|
|
293
|
+
Pause workflow execution and wait for human input via CLI.
|
|
294
|
+
|
|
295
|
+
**Specific properties:**
|
|
296
|
+
|
|
297
|
+
| Key | Type | Default | Description |
|
|
298
|
+
| ------------------ | ------ | ------------ | ----------------------------------------------- |
|
|
299
|
+
| `message` | string | **required** | Message displayed to the human |
|
|
300
|
+
| `polling-interval` | int | `15` | Seconds between input checks |
|
|
301
|
+
| `on-timeout` | string | `"abort"` | "abort" (stop workflow) or "continue" (proceed) |
|
|
302
|
+
| `timeout-minutes` | int | `5` | Minutes to wait before timeout action |
|
|
303
|
+
|
|
304
|
+
Human provides input via: `agentic-forge input <workflow-id> "response"`
|
|
305
|
+
|
|
306
|
+
```yaml
|
|
307
|
+
- name: get-approval
|
|
308
|
+
type: wait-for-human
|
|
309
|
+
message: |
|
|
310
|
+
Review the implementation at agentic/outputs/{{ workflow_id }}/plan.md.
|
|
311
|
+
Respond with "approved" to continue or provide feedback.
|
|
312
|
+
polling-interval: 30
|
|
313
|
+
on-timeout: abort
|
|
314
|
+
timeout-minutes: 120
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Templating
|
|
318
|
+
|
|
319
|
+
Workflows use Jinja2 for dynamic content in prompts, conditions, and output paths.
|
|
320
|
+
|
|
321
|
+
### Built-in Variables
|
|
322
|
+
|
|
323
|
+
| Variable | Description |
|
|
324
|
+
| ------------------------------ | -------------------------------------- |
|
|
325
|
+
| `{{ workflow_id }}` | Unique workflow execution ID |
|
|
326
|
+
| `{{ workflow_name }}` | Workflow name from YAML |
|
|
327
|
+
| `{{ variables.<name> }}` | User-defined variable |
|
|
328
|
+
| `{{ outputs.<step>.<field> }}` | Output from a previous step |
|
|
329
|
+
| `{{ iteration }}` | Current ralph-loop iteration (1-based) |
|
|
330
|
+
| `{{ max_iterations }}` | Max iterations for ralph-loop |
|
|
331
|
+
|
|
332
|
+
### Jinja2 Filters
|
|
333
|
+
|
|
334
|
+
| Filter | Example | Description |
|
|
335
|
+
| ------------------ | ----------------------------------------------- | ------------------- |
|
|
336
|
+
| `length` | `{{ list \| length }}` | Count items |
|
|
337
|
+
| `first` | `{{ list \| first }}` | First item |
|
|
338
|
+
| `last` | `{{ list \| last }}` | Last item |
|
|
339
|
+
| `upper` | `{{ text \| upper }}` | Uppercase |
|
|
340
|
+
| `lower` | `{{ text \| lower }}` | Lowercase |
|
|
341
|
+
| `replace` | `{{ text \| replace('old', 'new') }}` | String replace |
|
|
342
|
+
| `tojson` | `{{ data \| tojson }}` | Convert to JSON |
|
|
343
|
+
| `tojson(indent=2)` | `{{ data \| tojson(indent=2) }}` | Pretty JSON |
|
|
344
|
+
| `selectattr` | `{{ items \| selectattr('key', 'eq', 'val') }}` | Filter by attribute |
|
|
345
|
+
| `rejectattr` | `{{ items \| rejectattr('done', 'true') }}` | Reject by attribute |
|
|
346
|
+
|
|
347
|
+
### Conditionals and Loops in Templates
|
|
348
|
+
|
|
349
|
+
```yaml
|
|
350
|
+
prompt: |
|
|
351
|
+
{% if variables.create_pr %}
|
|
352
|
+
Create PR: {{ variables.pr_title }}
|
|
353
|
+
{% else %}
|
|
354
|
+
Skip PR creation
|
|
355
|
+
{% endif %}
|
|
356
|
+
|
|
357
|
+
{% for item in outputs.issues %}
|
|
358
|
+
- {{ item.description }}
|
|
359
|
+
{% endfor %}
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Strict vs Lenient Mode
|
|
363
|
+
|
|
364
|
+
- **Lenient** (`strict-mode: false`, default): Undefined variables log a warning, original `{{ ... }}` syntax is preserved in output
|
|
365
|
+
- **Strict** (`strict-mode: true`): Undefined variables cause immediate failure
|
|
366
|
+
|
|
367
|
+
## Output Artifacts
|
|
368
|
+
|
|
369
|
+
Generate files when the workflow completes or fails.
|
|
370
|
+
|
|
371
|
+
| Key | Required | Type | Default | Description |
|
|
372
|
+
| ---------- | -------- | ------ | ------------- | ------------------------------------- |
|
|
373
|
+
| `name` | Yes | string | - | Output identifier |
|
|
374
|
+
| `template` | Yes | string | - | Jinja2 template file path |
|
|
375
|
+
| `path` | Yes | string | - | Output file path (supports templates) |
|
|
376
|
+
| `when` | No | string | `"completed"` | "completed" or "failed" |
|
|
377
|
+
|
|
378
|
+
Template resolution order:
|
|
379
|
+
|
|
380
|
+
1. Workflow directory (same directory as the YAML file)
|
|
381
|
+
2. `agentic/templates/`
|
|
382
|
+
3. Bundled plugin templates
|
|
383
|
+
|
|
384
|
+
Template context variables: `workflow`, `variables`, `outputs`, `progress`, `steps`, `analysis_steps`, `fix_steps`, `files_changed`, `branches`, `pull_requests`, `inputs`
|
|
385
|
+
|
|
386
|
+
```yaml
|
|
387
|
+
outputs:
|
|
388
|
+
- name: report
|
|
389
|
+
template: report.md.j2
|
|
390
|
+
path: agentic/outputs/{{ workflow_id }}/report.md
|
|
391
|
+
when: completed
|
|
392
|
+
- name: error-log
|
|
393
|
+
template: error.md.j2
|
|
394
|
+
path: agentic/outputs/{{ workflow_id }}/error.md
|
|
395
|
+
when: failed
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## CLI Commands
|
|
399
|
+
|
|
400
|
+
```bash
|
|
401
|
+
# Run a workflow
|
|
402
|
+
agentic-forge run <workflow-name-or-path> --var "key=value" [--from-step <name>] [--terminal-output base|all]
|
|
403
|
+
|
|
404
|
+
# Resume a paused/failed workflow
|
|
405
|
+
agentic-forge resume <workflow-id>
|
|
406
|
+
|
|
407
|
+
# Check workflow status
|
|
408
|
+
agentic-forge status <workflow-id>
|
|
409
|
+
|
|
410
|
+
# Cancel a running workflow
|
|
411
|
+
agentic-forge cancel <workflow-id>
|
|
412
|
+
|
|
413
|
+
# Provide human input (for wait-for-human steps)
|
|
414
|
+
agentic-forge input <workflow-id> "response text"
|
|
415
|
+
|
|
416
|
+
# List workflow executions
|
|
417
|
+
agentic-forge list [--status running|completed|failed|paused]
|
|
418
|
+
|
|
419
|
+
# List available workflows with descriptions
|
|
420
|
+
agentic-forge workflows [-v]
|
|
421
|
+
|
|
422
|
+
# Copy bundled workflows to local project
|
|
423
|
+
agentic-forge init [--force] [--list]
|
|
424
|
+
|
|
425
|
+
# Configuration
|
|
426
|
+
agentic-forge config get <key>
|
|
427
|
+
agentic-forge config set <key> <value>
|
|
428
|
+
agentic-forge configure
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## Available Skills for Prompt Steps
|
|
432
|
+
|
|
433
|
+
Always use fully qualified names in workflows:
|
|
434
|
+
|
|
435
|
+
| Skill | Description |
|
|
436
|
+
| ------------------- | ----------------------------- |
|
|
437
|
+
| `/sdlc-plan` | Generate implementation plan |
|
|
438
|
+
| `/sdlc-review` | Review implementation quality |
|
|
439
|
+
| `/analyze bug` | Find bugs and logic errors |
|
|
440
|
+
| `/analyze debt` | Identify technical debt |
|
|
441
|
+
| `/analyze doc` | Check documentation |
|
|
442
|
+
| `/analyze security` | Security scan |
|
|
443
|
+
| `/analyze style` | Code style check |
|
|
444
|
+
| `/git-branch` | Create git branch |
|
|
445
|
+
| `/git-commit` | Create commit |
|
|
446
|
+
| `/git-pr` | Create pull request |
|
|
447
|
+
| `/orchestrate` | Workflow state evaluation |
|
|
448
|
+
|
|
449
|
+
## Bundled Workflows
|
|
450
|
+
|
|
451
|
+
Available via `agentic-forge init` or `agentic-forge run <name>`:
|
|
452
|
+
|
|
453
|
+
| Workflow | Description |
|
|
454
|
+
| ------------------------ | ----------------------------------------------------------------------- |
|
|
455
|
+
| `demo` | Validation workflow for installation testing |
|
|
456
|
+
| `one-shot` | Complete a single task with optional PR |
|
|
457
|
+
| `plan-build-review` | Full SDLC: plan -> implement -> review -> fix -> PR |
|
|
458
|
+
| `ralph-loop` | Generic iterative loop for any task |
|
|
459
|
+
| `analyze-codebase` | Parallel analysis (5 types) with optional autofix, independent branches |
|
|
460
|
+
| `analyze-codebase-merge` | Parallel analysis with autofix, branch merge, validation, and PR |
|
|
461
|
+
| `analyze-single` | Single analysis type with optional autofix |
|
|
462
|
+
|
|
463
|
+
## Validation Checklist
|
|
464
|
+
|
|
465
|
+
When validating a workflow, check for these issues:
|
|
466
|
+
|
|
467
|
+
**Errors (workflow will fail):**
|
|
468
|
+
|
|
469
|
+
- Missing `name` field
|
|
470
|
+
- Missing `steps` field or empty steps list
|
|
471
|
+
- Invalid step type (not one of: prompt, serial, parallel, conditional, ralph-loop, wait-for-human)
|
|
472
|
+
- Nested parallel steps (parallel inside parallel)
|
|
473
|
+
- Prompt step without `prompt` field
|
|
474
|
+
- Conditional step without `condition` field
|
|
475
|
+
- Ralph-loop step without `prompt` field
|
|
476
|
+
- Wait-for-human step without `message` field
|
|
477
|
+
- Required variable without default and not provided at runtime
|
|
478
|
+
|
|
479
|
+
**Warnings (may cause issues):**
|
|
480
|
+
|
|
481
|
+
- Variable referenced in templates but not defined in `variables` section
|
|
482
|
+
- `completion-promise` missing on ralph-loop (loop will only stop at max-iterations)
|
|
483
|
+
- No `timeout-minutes` on long-running steps
|
|
484
|
+
- `on-error: fail` without `max-retry` (any failure stops the workflow)
|
|
485
|
+
- Non-qualified skill names in prompt steps (e.g., `/sdlc-plan` instead of `/sdlc-plan`)
|
|
486
|
+
- Step name not in kebab-case
|
|
487
|
+
- Variable name not in snake_case
|