agentic-forge 0.7.0 → 0.8.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 (67) hide show
  1. package/README.md +21 -81
  2. package/dist/{claude → authoring}/.claude/skills/workflow-builder/SKILL.md +3 -3
  3. package/dist/{claude → authoring}/.claude/skills/workflow-builder/references/REFERENCE.md +25 -17
  4. package/dist/{claude → authoring}/.claude/skills/workflow-builder/references/workflow-example.yaml +29 -22
  5. package/dist/checkpoints/manager.d.ts +4 -4
  6. package/dist/checkpoints/manager.js +9 -10
  7. package/dist/checkpoints/manager.js.map +1 -1
  8. package/dist/claude/.claude/skills/orchestrate/SKILL.md +2 -2
  9. package/dist/cli.js +51 -7
  10. package/dist/cli.js.map +1 -1
  11. package/dist/commands/authoring-dir.d.ts +2 -0
  12. package/dist/commands/authoring-dir.js +9 -0
  13. package/dist/commands/authoring-dir.js.map +1 -0
  14. package/dist/commands/config-cmd.d.ts +1 -1
  15. package/dist/commands/config-cmd.js +2 -2
  16. package/dist/commands/config-cmd.js.map +1 -1
  17. package/dist/commands/index.d.ts +3 -1
  18. package/dist/commands/index.js +3 -1
  19. package/dist/commands/index.js.map +1 -1
  20. package/dist/commands/init.d.ts +8 -2
  21. package/dist/commands/init.js +64 -30
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/paths.d.ts +2 -0
  24. package/dist/commands/paths.js +36 -0
  25. package/dist/commands/paths.js.map +1 -0
  26. package/dist/commands/resume.js +8 -2
  27. package/dist/commands/resume.js.map +1 -1
  28. package/dist/commands/run.d.ts +14 -0
  29. package/dist/commands/run.js +81 -36
  30. package/dist/commands/run.js.map +1 -1
  31. package/dist/commands/status.js +83 -22
  32. package/dist/commands/status.js.map +1 -1
  33. package/dist/commands/workflows.js +14 -12
  34. package/dist/commands/workflows.js.map +1 -1
  35. package/dist/config.d.ts +19 -2
  36. package/dist/config.js +79 -15
  37. package/dist/config.js.map +1 -1
  38. package/dist/executor.d.ts +2 -1
  39. package/dist/executor.js +19 -9
  40. package/dist/executor.js.map +1 -1
  41. package/dist/logging/logger.d.ts +3 -3
  42. package/dist/logging/logger.js +6 -8
  43. package/dist/logging/logger.js.map +1 -1
  44. package/dist/orchestrator.js +35 -16
  45. package/dist/orchestrator.js.map +1 -1
  46. package/dist/paths.d.ts +64 -0
  47. package/dist/paths.js +167 -0
  48. package/dist/paths.js.map +1 -0
  49. package/dist/progress.d.ts +5 -5
  50. package/dist/progress.js +15 -9
  51. package/dist/progress.js.map +1 -1
  52. package/dist/ralph-loop.d.ts +6 -6
  53. package/dist/ralph-loop.js +16 -16
  54. package/dist/ralph-loop.js.map +1 -1
  55. package/dist/runner.d.ts +1 -0
  56. package/dist/runner.js +5 -1
  57. package/dist/runner.js.map +1 -1
  58. package/dist/steps/base.d.ts +1 -0
  59. package/dist/steps/base.js +1 -0
  60. package/dist/steps/base.js.map +1 -1
  61. package/dist/steps/prompt-step.js +2 -1
  62. package/dist/steps/prompt-step.js.map +1 -1
  63. package/dist/steps/ralph-loop-step.js +11 -8
  64. package/dist/steps/ralph-loop-step.js.map +1 -1
  65. package/dist/types.d.ts +2 -0
  66. package/dist/workflows/plan-build-review.yaml +6 -6
  67. package/package.json +4 -1
package/README.md CHANGED
@@ -35,111 +35,51 @@ Agentic Forge is a TypeScript/Node.js package that provides YAML-based workflow
35
35
  ### Installation
36
36
 
37
37
  ```bash
38
- # Install globally with npm
39
38
  npm install -g agentic-forge
40
-
41
- # Or install from source
42
- git clone https://github.com/e-stpierre/agentic-forge.git
43
- cd agentic-forge
44
- pnpm install && pnpm build
45
- npm install -g .
46
39
  ```
47
40
 
48
- ## Workflows
49
-
50
- ### plan-build-review (Full SDLC)
41
+ ### Run Your First Workflow
51
42
 
52
- Plan -> Create Branch -> Implement (iterative) -> Review -> Fix Issues -> Create PR
43
+ No setup required. Run the demo workflow to verify your installation:
53
44
 
54
45
  ```bash
55
- agentic-forge run plan-build-review --var "task=Add dark mode support"
46
+ af run demo
56
47
  ```
57
48
 
58
- ### one-shot (Single Task)
59
-
60
- Create Branch -> Execute Task -> Review -> Create PR
49
+ Run a real workflow:
61
50
 
62
51
  ```bash
63
- agentic-forge run one-shot --var "task=Add user authentication"
52
+ af run plan-build-review --var "task=Add dark mode support" --slug "dark-mode"
64
53
  ```
65
54
 
66
- ### ralph-loop (Iterative Execution)
55
+ The `--slug` flag names the output directory (e.g., `dark-mode/` instead of a generated timestamp ID), making it easy to find results later.
67
56
 
68
- Generic iterative loop where each iteration runs in a fresh session.
57
+ ### Project Setup
58
+
59
+ Initialize a local `agentic/` directory to customize workflows and config for your project:
69
60
 
70
61
  ```bash
71
- agentic-forge run ralph-loop --var "task=Follow the improvement plan" --var "max_iterations=20"
62
+ af init --local
72
63
  ```
73
64
 
74
- ### analyze-codebase (Parallel Analysis)
65
+ ### Workflow Builder
75
66
 
76
- Run 5 parallel analysis types (bug, debt, doc, security, style) with optional autofix.
67
+ Load authoring skills into Claude Code to create and manage workflows interactively:
77
68
 
78
69
  ```bash
79
- agentic-forge run analyze-codebase --var "autofix=true"
70
+ claude --add-dir $(af authoring-dir)
80
71
  ```
81
72
 
82
- ### All Commands
83
-
84
- ```bash
85
- # Run a workflow with variables
86
- agentic-forge run <workflow> --var "key=value"
87
-
88
- # Resume a paused or failed workflow
89
- agentic-forge resume <workflow_id>
90
-
91
- # Check workflow status
92
- agentic-forge status <workflow_id>
93
-
94
- # Cancel a running workflow
95
- agentic-forge cancel <workflow_id>
96
-
97
- # List all workflow runs (optionally filter by status)
98
- agentic-forge list --status running
73
+ Then use `/af-workflow-builder` to create, validate, explain, or debug workflows.
99
74
 
100
- # Provide input to a paused workflow waiting for human response
101
- agentic-forge input <workflow_id> "response text"
75
+ ## Documentation
102
76
 
103
- # Copy bundled workflow templates to your project
104
- agentic-forge init
105
-
106
- # List available workflows with descriptions
107
- agentic-forge workflows
108
-
109
- # Get or set configuration
110
- agentic-forge config get <key>
111
- agentic-forge config set <key> <value>
112
-
113
- # Interactive configuration setup
114
- agentic-forge configure
115
-
116
- # Print path to bundled skills directory
117
- agentic-forge skills-dir
118
-
119
- # Show release notes
120
- agentic-forge release-notes --latest
121
-
122
- # Check current version
123
- agentic-forge version
124
-
125
- # Update to latest version
126
- agentic-forge update
127
- ```
128
-
129
- ## Repository Structure
130
-
131
- ```text
132
- src/
133
- agents/ # Bundled agent definitions (explorer, reviewer)
134
- claude/.claude/ # Skills loaded via --add-dir
135
- skills/ # 13 bundled skills
136
- commands/ # CLI command implementations
137
- prompts/ # System prompt templates
138
- steps/ # Workflow step handlers
139
- workflows/ # 7 bundled YAML workflow definitions
140
- *.ts # Core TypeScript modules
141
- tests/ # Vitest test suite
142
- ```
77
+ | Document | Description |
78
+ | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
79
+ | [Getting Started](https://github.com/e-stpierre/agentic-forge/blob/main/docs/getting-started.md) | Installation, quick tour, initialization, and creating your first workflow |
80
+ | [CLI Reference](https://github.com/e-stpierre/agentic-forge/blob/main/docs/cli.md) | Complete list of commands with all arguments and options |
81
+ | [Workflows](https://github.com/e-stpierre/agentic-forge/blob/main/docs/workflows.md) | Bundled workflows, their use cases, variables, and examples |
82
+ | [Configuration](https://github.com/e-stpierre/agentic-forge/blob/main/docs/configuration.md) | All configuration options, defaults, and layering behavior |
143
83
 
144
84
  ## Contributing
145
85
 
@@ -76,7 +76,7 @@ Arguments: $ARGUMENTS
76
76
 
77
77
  1. Read the workflow YAML and any error output
78
78
  2. Check for common issues (undefined variables, incorrect conditions, missing fields)
79
- 3. Check `agentic/outputs/<workflow-id>/progress.json` if available
79
+ 3. Check `agentic-forge status <workflow-id>` or look in the output directory for `progress.json`
80
80
  4. Suggest specific fixes
81
81
 
82
82
  ### Step Type Selection Guide
@@ -114,8 +114,8 @@ Priority: step `model` > `settings.model` > config default > `sonnet`
114
114
 
115
115
  | Symptom | Likely Cause | Fix |
116
116
  | -------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------- |
117
- | "Missing required variable" | Variable not passed via `--var` | Add `--var "name=value"` to CLI or set `default` |
118
- | Conditional always takes else | Condition expression evaluates to falsy | Check Jinja2 expression syntax and variable names |
117
+ | "Missing required variable" | Variable not passed via CLI | Add `name=value` arg, `--var "name=value"`, or set `default` |
118
+ | Conditional always takes else | Condition expression evaluates to falsy | Check Nunjucks expression syntax and variable names |
119
119
  | Ralph loop never completes | Completion JSON not output or promise mismatch | Verify `completion-promise` matches the `promise` field in JSON |
120
120
  | Template variable shows as `{{ ... }}` | Undefined variable in lenient mode | Define the variable or enable `strict-mode: true` to catch early |
121
121
  | Step timeout | Task exceeds `timeout-minutes` | Increase step or workflow `timeout-minutes` |
@@ -57,7 +57,7 @@ settings:
57
57
 
58
58
  ## Variables
59
59
 
60
- Define input parameters for the workflow. Passed via `--var "name=value"` on the CLI.
60
+ Define input parameters for the workflow. Passed as bare `key=value` args or via `--var "name=value"` on the CLI. Missing required variables are prompted interactively when running in a TTY (disable with `--no-interactive`).
61
61
 
62
62
  | Key | Required | Type | Default | Description |
63
63
  | ------------- | -------- | ------ | ---------- | ------------------------------------- |
@@ -204,15 +204,15 @@ Execute nested steps concurrently. Supports git worktrees for isolation.
204
204
 
205
205
  ### conditional
206
206
 
207
- Branch execution based on a Jinja2 condition expression.
207
+ Branch execution based on a Nunjucks condition expression.
208
208
 
209
209
  **Specific properties:**
210
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 |
211
+ | Key | Type | Required | Description |
212
+ | ----------- | ------ | -------- | -------------------------------------------- |
213
+ | `condition` | string | Yes | Nunjucks 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
216
 
217
217
  **Condition evaluation supports:**
218
218
 
@@ -252,7 +252,7 @@ Iterative prompt execution with completion detection. Each iteration runs in a f
252
252
  **How it works:**
253
253
 
254
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`
255
+ 2. State persists in `{output_dir}/ralph-{step-name}.md`
256
256
  3. Loop exits when Claude outputs completion JSON or max iterations reached
257
257
  4. Additional template variables: `{{ iteration }}` (current), `{{ max_iterations }}` (max)
258
258
 
@@ -274,7 +274,7 @@ The `completion-promise` setting must match the `promise` value in Claude's JSON
274
274
  - name: implement-milestones
275
275
  type: ralph-loop
276
276
  prompt: |
277
- Read the plan at agentic/outputs/{{ workflow_id }}/plan.md.
277
+ Read the plan at {{ output_dir }}/plan.md.
278
278
  Implement the next incomplete milestone.
279
279
 
280
280
  When ALL milestones are complete, output:
@@ -307,7 +307,7 @@ Human provides input via: `agentic-forge input <workflow-id> "response"`
307
307
  - name: get-approval
308
308
  type: wait-for-human
309
309
  message: |
310
- Review the implementation at agentic/outputs/{{ workflow_id }}/plan.md.
310
+ Review the implementation at {{ output_dir }}/plan.md.
311
311
  Respond with "approved" to continue or provide feedback.
312
312
  polling-interval: 30
313
313
  on-timeout: abort
@@ -316,7 +316,7 @@ Human provides input via: `agentic-forge input <workflow-id> "response"`
316
316
 
317
317
  ## Templating
318
318
 
319
- Workflows use Jinja2 for dynamic content in prompts, conditions, and output paths.
319
+ Workflows use Nunjucks for dynamic content in prompts, conditions, and output paths.
320
320
 
321
321
  ### Built-in Variables
322
322
 
@@ -329,7 +329,7 @@ Workflows use Jinja2 for dynamic content in prompts, conditions, and output path
329
329
  | `{{ iteration }}` | Current ralph-loop iteration (1-based) |
330
330
  | `{{ max_iterations }}` | Max iterations for ralph-loop |
331
331
 
332
- ### Jinja2 Filters
332
+ ### Nunjucks Filters
333
333
 
334
334
  | Filter | Example | Description |
335
335
  | ------------------ | ----------------------------------------------- | ------------------- |
@@ -371,7 +371,7 @@ Generate files when the workflow completes or fails.
371
371
  | Key | Required | Type | Default | Description |
372
372
  | ---------- | -------- | ------ | ------------- | ------------------------------------- |
373
373
  | `name` | Yes | string | - | Output identifier |
374
- | `template` | Yes | string | - | Jinja2 template file path |
374
+ | `template` | Yes | string | - | Nunjucks template file path |
375
375
  | `path` | Yes | string | - | Output file path (supports templates) |
376
376
  | `when` | No | string | `"completed"` | "completed" or "failed" |
377
377
 
@@ -381,25 +381,27 @@ Template resolution order:
381
381
  2. `agentic/templates/`
382
382
  3. Bundled plugin templates
383
383
 
384
+ Step prompt template variables: `{{ workflow_id }}`, `{{ output_dir }}` (absolute path to the workflow output directory), `{{ variables.* }}`, `{{ outputs.* }}`
385
+
384
386
  Template context variables: `workflow`, `variables`, `outputs`, `progress`, `steps`, `analysis_steps`, `fix_steps`, `files_changed`, `branches`, `pull_requests`, `inputs`
385
387
 
386
388
  ```yaml
387
389
  outputs:
388
390
  - name: report
389
391
  template: report.md.j2
390
- path: agentic/outputs/{{ workflow_id }}/report.md
392
+ path: report.md
391
393
  when: completed
392
394
  - name: error-log
393
395
  template: error.md.j2
394
- path: agentic/outputs/{{ workflow_id }}/error.md
396
+ path: error.md
395
397
  when: failed
396
398
  ```
397
399
 
398
400
  ## CLI Commands
399
401
 
400
402
  ```bash
401
- # Run a workflow
402
- agentic-forge run <workflow-name-or-path> --var "key=value" [--from-step <name>] [--terminal-output base|all]
403
+ # Run a workflow (bare key=value args or --var flag)
404
+ agentic-forge run <workflow> key=value [key=value ...] [--var "key=value"] [--from-step <name>] [--no-interactive] [--terminal-output base|all]
403
405
 
404
406
  # Resume a paused/failed workflow
405
407
  agentic-forge resume <workflow-id>
@@ -422,6 +424,12 @@ agentic-forge workflows [-v]
422
424
  # Copy bundled workflows to local project
423
425
  agentic-forge init [--force] [--list]
424
426
 
427
+ # Print path to bundled workflow skills directory
428
+ agentic-forge skills-dir
429
+
430
+ # Print path to interactive authoring skills directory
431
+ agentic-forge authoring-dir
432
+
425
433
  # Configuration
426
434
  agentic-forge config get <key>
427
435
  agentic-forge config set <key> <value>
@@ -15,7 +15,7 @@ description: |
15
15
  - Git integration with worktrees
16
16
  - Error handling and retries
17
17
  - Checkpoints and progress tracking
18
- - Variable templating with Jinja2
18
+ - Variable templating with Nunjucks
19
19
  - Output generation
20
20
 
21
21
  # Optional: Workflow-level settings
@@ -142,7 +142,7 @@ steps:
142
142
  # to avoid conflicts with skills from other plugins or built-in commands.
143
143
  - name: generate-plan
144
144
  type: prompt
145
- prompt: /sdlc-plan --type {{ variables.plan_type }} --output_dir "agentic/outputs/{{ workflow_id }}" {{ variables.task }}
145
+ prompt: /sdlc-plan --type {{ variables.plan_type }} --output_dir "{{ output_dir }}" {{ variables.task }}
146
146
  checkpoint: true
147
147
  timeout-minutes: 20
148
148
 
@@ -213,7 +213,7 @@ steps:
213
213
  prompt: |
214
214
  ## Ralph Loop Iteration
215
215
 
216
- Read the implementation plan at agentic/outputs/{{ workflow_id }}/plan.md
216
+ Read the implementation plan at {{ output_dir }}/plan.md
217
217
 
218
218
  Implement the NEXT INCOMPLETE milestone:
219
219
  1. Read the plan and identify the next incomplete milestone
@@ -229,7 +229,7 @@ steps:
229
229
 
230
230
  Do NOT output the completion JSON until every milestone is genuinely finished.
231
231
 
232
- Current iteration state is tracked in agentic/outputs/{{ workflow_id }}/ralph-implement-incrementally.md
232
+ Current iteration state is tracked in {{ output_dir }}/ralph-implement-incrementally.md
233
233
 
234
234
  # Maximum iterations before stopping (can use variable)
235
235
  max-iterations: "{{ variables.max_iterations }}"
@@ -249,15 +249,15 @@ steps:
249
249
  # ==================== REVIEW STEP ====================
250
250
  - name: review-implementation
251
251
  type: prompt
252
- prompt: /sdlc-review "agentic/outputs/{{ workflow_id }}/plan.md" minor
252
+ prompt: /sdlc-review "{{ output_dir }}/plan.md" minor
253
253
  checkpoint: true
254
254
 
255
255
  # ==================== CONDITIONAL STEP ====================
256
- # Execute steps based on Jinja2 condition
256
+ # Execute steps based on Nunjucks condition
257
257
  - name: fix-validation-issues
258
258
  type: conditional
259
259
 
260
- # Jinja2 expression that evaluates to true/false
260
+ # Nunjucks expression that evaluates to true/false
261
261
  # This checks if there are any issues with severity >= fix_severity
262
262
  condition: "{{ outputs.review_implementation.issues | selectattr('severity', 'ge', variables.fix_severity) | list | length > 0 }}"
263
263
 
@@ -295,7 +295,7 @@ steps:
295
295
  Please review the implementation and validation results.
296
296
 
297
297
  Review the following:
298
- - Implementation plan: agentic/outputs/{{ workflow_id }}/plan.md
298
+ - Implementation plan: {{ output_dir }}/plan.md
299
299
  - Review results: outputs.review_implementation
300
300
 
301
301
  Respond with:
@@ -333,45 +333,52 @@ steps:
333
333
  - Review results: {{ outputs.review_implementation | tojson }}
334
334
  - PR created: {{ outputs.create_pull_request is defined }}
335
335
 
336
- Save the summary to agentic/outputs/{{ workflow_id }}/summary.md
336
+ Save the summary to {{ output_dir }}/summary.md
337
337
 
338
338
  # Optional: Output artifacts
339
339
  outputs:
340
340
  # Generated when workflow completes successfully
341
341
  - name: implementation-report
342
- # Jinja2 template file (resolved from workflow dir, agentic/templates/, or bundled templates)
342
+ # Nunjucks template file (resolved from workflow dir, agentic/templates/, or bundled templates)
343
343
  template: implementation-report.md.j2
344
344
  # Output file path (relative to workflow directory)
345
- path: agentic/outputs/{{ workflow_id }}/report.md
345
+ path: "{{ output_dir }}/report.md"
346
346
  # When to generate: completed or failed
347
347
  when: completed
348
348
 
349
349
  # Generated when workflow fails
350
350
  - name: error-report
351
351
  template: error-report.md.j2
352
- path: agentic/outputs/{{ workflow_id }}/error.md
352
+ path: "{{ output_dir }}/error.md"
353
353
  when: failed
354
354
 
355
355
  # ==================== USAGE EXAMPLES ====================
356
356
  #
357
- # Run with required variable:
357
+ # Run with bare key=value args (preferred):
358
+ # agentic-forge run workflow-example.yaml task="Add user authentication"
359
+ #
360
+ # Run with --var flag (equivalent):
358
361
  # agentic-forge run workflow-example.yaml --var "task=Add user authentication"
359
362
  #
360
- # Run with custom variables:
363
+ # Run with multiple variables:
361
364
  # agentic-forge run workflow-example.yaml \
362
- # --var "task=Fix login bug" \
363
- # --var "plan_type=bug" \
364
- # --var "create_pr=true" \
365
- # --var "max_iterations=15"
365
+ # task="Fix login bug" \
366
+ # plan_type=bug \
367
+ # create_pr=true \
368
+ # max_iterations=15
366
369
  #
367
370
  # Run with verbose output:
368
371
  # agentic-forge run workflow-example.yaml \
369
- # --var "task=Implement feature" \
372
+ # task="Implement feature" \
370
373
  # --terminal-output all
371
374
  #
375
+ # Disable interactive prompts (for CI/scripts):
376
+ # agentic-forge run workflow-example.yaml --no-interactive \
377
+ # task="Implement feature"
378
+ #
372
379
  # Resume from specific step:
373
380
  # agentic-forge run workflow-example.yaml \
374
- # --var "task=Implement feature" \
381
+ # task="Implement feature" \
375
382
  # --from-step review-implementation
376
383
  #
377
384
  # Provide human input:
@@ -408,13 +415,13 @@ outputs:
408
415
  #
409
416
  # ==================== BUILT-IN VARIABLES ====================
410
417
  #
411
- # Available in all Jinja2 templates:
418
+ # Available in all Nunjucks templates:
412
419
  # - {{ workflow_id }} - Unique workflow execution ID
413
420
  # - {{ workflow_name }} - Workflow name from YAML
414
421
  # - {{ variables.name }} - User-defined variables
415
422
  # - {{ outputs.step_name.field }} - Step outputs
416
423
  #
417
- # ==================== JINJA2 FILTERS ====================
424
+ # ==================== NUNJUCKS FILTERS ====================
418
425
  #
419
426
  # Common filters for templating:
420
427
  # - {{ list | length }} - Get list length
@@ -1,5 +1,5 @@
1
1
  /** Checkpoint management for workflow sessions. */
2
- export declare function getCheckpointPath(workflowId: string, repoRoot?: string): string;
3
- export declare function createCheckpoint(workflowId: string, step: string, context: string, progress: string, notes?: string, issues?: string, repoRoot?: string): string;
4
- export declare function readCheckpoints(workflowId: string, repoRoot?: string): Record<string, unknown>[];
5
- export declare function getLatestCheckpoint(workflowId: string, repoRoot?: string): Record<string, unknown> | null;
2
+ export declare function getCheckpointPath(workflowId: string, outputDir: string): string;
3
+ export declare function createCheckpoint(workflowId: string, step: string, context: string, progress: string, outputDir: string, notes?: string, issues?: string): string;
4
+ export declare function readCheckpoints(workflowId: string, outputDir: string): Record<string, unknown>[];
5
+ export declare function getLatestCheckpoint(workflowId: string, outputDir: string): Record<string, unknown> | null;
@@ -3,16 +3,15 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
4
  import yaml from "js-yaml";
5
5
  // --- Path helper ---
6
- export function getCheckpointPath(workflowId, repoRoot) {
7
- const root = repoRoot ?? process.cwd();
8
- return path.join(root, "agentic", "outputs", workflowId, "checkpoint.md");
6
+ export function getCheckpointPath(workflowId, outputDir) {
7
+ return path.join(outputDir, "checkpoint.md");
9
8
  }
10
9
  // --- Create checkpoint ---
11
- export function createCheckpoint(workflowId, step, context, progress, notes = "", issues = "", repoRoot) {
12
- const checkpointPath = getCheckpointPath(workflowId, repoRoot);
10
+ export function createCheckpoint(workflowId, step, context, progress, outputDir, notes = "", issues = "") {
11
+ const checkpointPath = getCheckpointPath(workflowId, outputDir);
13
12
  const dir = path.dirname(checkpointPath);
14
13
  mkdirSync(dir, { recursive: true });
15
- const existing = readCheckpoints(workflowId, repoRoot);
14
+ const existing = readCheckpoints(workflowId, outputDir);
16
15
  const checkpointNum = existing.length + 1;
17
16
  const checkpointId = `chk-${String(checkpointNum).padStart(3, "0")}`;
18
17
  const timestamp = new Date().toISOString();
@@ -49,8 +48,8 @@ export function createCheckpoint(workflowId, step, context, progress, notes = ""
49
48
  return checkpointId;
50
49
  }
51
50
  // --- Read checkpoints ---
52
- export function readCheckpoints(workflowId, repoRoot) {
53
- const checkpointPath = getCheckpointPath(workflowId, repoRoot);
51
+ export function readCheckpoints(workflowId, outputDir) {
52
+ const checkpointPath = getCheckpointPath(workflowId, outputDir);
54
53
  if (!existsSync(checkpointPath)) {
55
54
  return [];
56
55
  }
@@ -80,8 +79,8 @@ export function readCheckpoints(workflowId, repoRoot) {
80
79
  return checkpoints;
81
80
  }
82
81
  // --- Get latest checkpoint ---
83
- export function getLatestCheckpoint(workflowId, repoRoot) {
84
- const checkpoints = readCheckpoints(workflowId, repoRoot);
82
+ export function getLatestCheckpoint(workflowId, outputDir) {
83
+ const checkpoints = readCheckpoints(workflowId, outputDir);
85
84
  return checkpoints.length > 0 ? checkpoints[checkpoints.length - 1] : null;
86
85
  }
87
86
  //# sourceMappingURL=manager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/checkpoints/manager.ts"],"names":[],"mappings":"AAAA,mDAAmD;AAEnD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,SAAS,CAAC;AAE3B,sBAAsB;AAEtB,MAAM,UAAU,iBAAiB,CAAC,UAAkB,EAAE,QAAiB;IACtE,MAAM,IAAI,GAAG,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;AAC3E,CAAC;AAED,4BAA4B;AAE5B,MAAM,UAAU,gBAAgB,CAC/B,UAAkB,EAClB,IAAY,EACZ,OAAe,EACf,QAAgB,EAChB,KAAK,GAAG,EAAE,EACV,MAAM,GAAG,EAAE,EACX,QAAiB;IAEjB,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACzC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpC,MAAM,QAAQ,GAAG,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACvD,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,aAAa,CA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C;QAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAEvC,IAAI,CAAC,cAAc,EAAE,CAAC;YACrB,CAAC,IAAI,CAAC,CAAC;YACP,SAAS;QACV,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAE7D,IAAI,CAAC;YACJ,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAmC,CAAC;YAChF,IAAI,WAAW,IAAI,eAAe,IAAI,WAAW,EAAE,CAAC;gBACnD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC3B,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/B,CAAC;QACF,CAAC;QAAC,MAAM,CAAC;YACR,qBAAqB;QACtB,CAAC;QAED,CAAC,IAAI,CAAC,CAAC;IACR,CAAC;IAED,OAAO,WAAW,CAAC;AACpB,CAAC;AAED,gCAAgC;AAEhC,MAAM,UAAU,mBAAmB,CAClC,UAAkB,EAClB,SAAiB;IAEjB,MAAM,WAAW,GAAG,eAAe,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC3D,OAAO,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5E,CAAC"}
@@ -21,7 +21,7 @@ You are the workflow orchestrator. Your job is to evaluate the current workflow
21
21
 
22
22
  ### Condition Evaluation
23
23
 
24
- For conditional steps, evaluate the Jinja2 condition using the available context:
24
+ For conditional steps, evaluate the Nunjucks condition using the available context:
25
25
 
26
26
  - `outputs.{step_name}` - Previous step outputs
27
27
  - `variables.{var_name}` - Workflow variables
@@ -85,7 +85,7 @@ For conditional steps, evaluate the Jinja2 condition using the available context
85
85
 
86
86
  3. **Determine Next Action**
87
87
  - Based on step dependencies and conditions
88
- - Evaluate any Jinja2 conditions
88
+ - Evaluate any Nunjucks conditions
89
89
  - Identify the appropriate action type
90
90
 
91
91
  4. **Return JSON Decision**
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ function optBool(val) {
10
10
  function optStringArray(val) {
11
11
  return Array.isArray(val) && val.every((v) => typeof v === "string") ? val : undefined;
12
12
  }
13
- import { cmdCancel, cmdConfig, cmdConfigure, cmdInit, cmdInput, cmdList, cmdReleaseNotes, cmdResume, cmdRun, cmdSkillsDir, cmdStatus, cmdUpdate, cmdVersion, cmdWorkflows, getVersion, } from "./commands/index.js";
13
+ import { CliExitError, cmdAuthoringDir, cmdCancel, cmdConfig, cmdConfigure, cmdInit, cmdInput, cmdList, cmdPaths, cmdReleaseNotes, cmdResume, cmdRun, cmdSkillsDir, cmdStatus, cmdUpdate, cmdVersion, cmdWorkflows, getVersion, } from "./commands/index.js";
14
14
  const program = new Command()
15
15
  .name("agentic-forge")
16
16
  .version(getVersion())
@@ -18,18 +18,25 @@ const program = new Command()
18
18
  // run command
19
19
  program
20
20
  .command("run")
21
+ .description("Run a workflow with optional key=value variables (prompts for missing required vars)")
21
22
  .argument("[workflow]", "workflow name or path to YAML file")
23
+ .argument("[vars...]", "workflow variables as key=value pairs")
22
24
  .option("--list", "list all available workflows")
23
25
  .option("--var <key=value...>", "set workflow variable (can be used multiple times)")
24
26
  .option("--from-step <step>", "resume from a specific step")
27
+ .option("--no-interactive", "disable interactive prompts for missing variables")
25
28
  .option("--terminal-output <mode>", "terminal output granularity (base or all)")
26
- .action(async (workflow, opts) => {
29
+ .option("--slug <slug>", "custom slug appended to the workflow run ID")
30
+ .action(async (workflow, vars, opts) => {
27
31
  await cmdRun({
28
32
  workflow,
29
33
  listWorkflows: optBool(opts.list),
30
34
  vars: optStringArray(opts.var),
35
+ bareVars: optStringArray(vars),
31
36
  fromStep: optString(opts.fromStep),
37
+ interactive: opts.interactive !== false,
32
38
  terminalOutput: optString(opts.terminalOutput),
39
+ slug: optString(opts.slug),
33
40
  });
34
41
  });
35
42
  // resume command
@@ -82,13 +89,23 @@ program
82
89
  // init command
83
90
  program
84
91
  .command("init")
85
- .description("Copy bundled workflow templates to local project")
86
- .option("--force", "overwrite existing workflow files")
92
+ .description("Initialize agentic-forge directory (global by default, or --local for project)")
93
+ .option("--force", "overwrite existing workflow files and config")
87
94
  .option("--list", "list available bundled workflows without copying")
95
+ .option("--local", "initialize project-local directory (cwd/agentic/)")
96
+ .option("--global", "initialize global user directory (default)")
97
+ .option("--config-only", "only create config, skip workflow copy")
98
+ .option("--workflows-only", "only copy workflows, skip config creation")
99
+ .option("--workflow <name>", "copy only the named bundled workflow")
88
100
  .action((opts) => {
89
101
  cmdInit({
90
102
  force: optBool(opts.force),
91
103
  listOnly: optBool(opts.list),
104
+ local: optBool(opts.local),
105
+ global: optBool(opts.global),
106
+ configOnly: optBool(opts.configOnly),
107
+ workflowsOnly: optBool(opts.workflowsOnly),
108
+ workflow: optString(opts.workflow),
92
109
  });
93
110
  });
94
111
  // config command with subcommands
@@ -103,8 +120,15 @@ configCmd
103
120
  .command("set")
104
121
  .argument("<key>", "configuration key (dot notation)")
105
122
  .argument("<value>", "value to set")
106
- .action((key, value) => {
107
- cmdConfig("set", key, value);
123
+ .option("--global", "write to global config")
124
+ .option("--local", "write to local project config")
125
+ .action((key, value, opts) => {
126
+ const scope = opts.global
127
+ ? "global"
128
+ : opts.local
129
+ ? "local"
130
+ : undefined;
131
+ cmdConfig("set", key, value, scope);
108
132
  });
109
133
  // version command
110
134
  program
@@ -124,6 +148,13 @@ program
124
148
  latest: optBool(opts.latest),
125
149
  });
126
150
  });
151
+ // paths command
152
+ program
153
+ .command("paths")
154
+ .description("Show resolved path configuration (global, local, and bundled directories)")
155
+ .action(() => {
156
+ cmdPaths();
157
+ });
127
158
  // skills-dir command
128
159
  program
129
160
  .command("skills-dir")
@@ -131,6 +162,13 @@ program
131
162
  .action(() => {
132
163
  cmdSkillsDir();
133
164
  });
165
+ // authoring-dir command
166
+ program
167
+ .command("authoring-dir")
168
+ .description("Print path to interactive authoring skills directory")
169
+ .action(() => {
170
+ cmdAuthoringDir();
171
+ });
134
172
  // update command
135
173
  program
136
174
  .command("update")
@@ -151,5 +189,11 @@ program
151
189
  verbose: optBool(opts.verbose),
152
190
  });
153
191
  });
154
- program.parse();
192
+ program.parseAsync().catch((err) => {
193
+ if (err instanceof CliExitError) {
194
+ process.stderr.write(`${err.message}\n`);
195
+ process.exit(err.exitCode);
196
+ }
197
+ throw err;
198
+ });
155
199
  //# sourceMappingURL=cli.js.map