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,427 @@
|
|
|
1
|
+
# Annotated Reference Workflow
|
|
2
|
+
# This workflow demonstrates all available configuration options and step types
|
|
3
|
+
# Use this as a template for creating your own workflows
|
|
4
|
+
|
|
5
|
+
# Required: Unique workflow identifier
|
|
6
|
+
name: complete-workflow-example
|
|
7
|
+
|
|
8
|
+
# Required: Schema version
|
|
9
|
+
version: "1.0"
|
|
10
|
+
|
|
11
|
+
# Optional: Human-readable description
|
|
12
|
+
description: |
|
|
13
|
+
Comprehensive example workflow demonstrating all available features:
|
|
14
|
+
- All step types (prompt, serial, parallel, conditional, ralph-loop, wait-for-human)
|
|
15
|
+
- Git integration with worktrees
|
|
16
|
+
- Error handling and retries
|
|
17
|
+
- Checkpoints and progress tracking
|
|
18
|
+
- Variable templating with Jinja2
|
|
19
|
+
- Output generation
|
|
20
|
+
|
|
21
|
+
# Optional: Workflow-level settings
|
|
22
|
+
settings:
|
|
23
|
+
# Maximum retry attempts for failed steps (default: 3)
|
|
24
|
+
max-retry: 3
|
|
25
|
+
|
|
26
|
+
# Maximum time for entire workflow in minutes (default: 60)
|
|
27
|
+
timeout-minutes: 180
|
|
28
|
+
|
|
29
|
+
# Track progress in progress.json file (default: true)
|
|
30
|
+
track-progress: true
|
|
31
|
+
|
|
32
|
+
# Auto-fix severity level: none, minor, major, critical (default: none)
|
|
33
|
+
autofix: "major"
|
|
34
|
+
|
|
35
|
+
# Terminal output mode: base (last message), all (stream all) (default: base)
|
|
36
|
+
terminal-output: "base"
|
|
37
|
+
|
|
38
|
+
# Bypass permission prompts - use with caution (default: false)
|
|
39
|
+
bypass-permissions: false
|
|
40
|
+
|
|
41
|
+
# Template variable handling: false = warn and continue, true = fail on undefined (default: false)
|
|
42
|
+
strict-mode: false
|
|
43
|
+
|
|
44
|
+
# Default model for all steps: sonnet, haiku, opus (default: user-configured or sonnet)
|
|
45
|
+
# Steps can override this with their own model setting
|
|
46
|
+
model: sonnet
|
|
47
|
+
|
|
48
|
+
# Tools Claude can use without prompting (default: [])
|
|
49
|
+
required-tools:
|
|
50
|
+
- "Bash"
|
|
51
|
+
- "Edit"
|
|
52
|
+
- "Write"
|
|
53
|
+
- "Read"
|
|
54
|
+
|
|
55
|
+
# Git configuration
|
|
56
|
+
git:
|
|
57
|
+
# Enable git operations (default: false)
|
|
58
|
+
enabled: true
|
|
59
|
+
|
|
60
|
+
# Use worktrees for parallel steps (default: false)
|
|
61
|
+
worktree: true
|
|
62
|
+
|
|
63
|
+
# Auto-commit changes after each step (default: true)
|
|
64
|
+
auto-commit: true
|
|
65
|
+
|
|
66
|
+
# Auto-create PR when workflow completes (default: true)
|
|
67
|
+
auto-pr: false
|
|
68
|
+
|
|
69
|
+
# Prefix for branch names (default: "agentic")
|
|
70
|
+
branch-prefix: "feature"
|
|
71
|
+
|
|
72
|
+
# Optional: Input variables for the workflow
|
|
73
|
+
variables:
|
|
74
|
+
# Required string variable
|
|
75
|
+
- name: task
|
|
76
|
+
type: string
|
|
77
|
+
required: true
|
|
78
|
+
description: Task description for implementation
|
|
79
|
+
|
|
80
|
+
# Optional string variable with default
|
|
81
|
+
- name: plan_type
|
|
82
|
+
type: string
|
|
83
|
+
required: false
|
|
84
|
+
default: "auto"
|
|
85
|
+
description: Plan type (feature, bug, chore, auto)
|
|
86
|
+
|
|
87
|
+
# Optional boolean variable
|
|
88
|
+
- name: create_pr
|
|
89
|
+
type: boolean
|
|
90
|
+
required: false
|
|
91
|
+
default: true
|
|
92
|
+
description: Whether to create a pull request
|
|
93
|
+
|
|
94
|
+
# Optional number variable
|
|
95
|
+
- name: max_iterations
|
|
96
|
+
type: number
|
|
97
|
+
required: false
|
|
98
|
+
default: 10
|
|
99
|
+
description: Maximum iterations for ralph loop
|
|
100
|
+
|
|
101
|
+
# Optional severity level
|
|
102
|
+
- name: fix_severity
|
|
103
|
+
type: string
|
|
104
|
+
required: false
|
|
105
|
+
default: "major"
|
|
106
|
+
description: Minimum severity for auto-fixing issues
|
|
107
|
+
|
|
108
|
+
# Required: Workflow steps
|
|
109
|
+
steps:
|
|
110
|
+
# ==================== PROMPT STEP ====================
|
|
111
|
+
# Execute a custom prompt in a Claude session
|
|
112
|
+
- name: analyze-requirements
|
|
113
|
+
type: prompt
|
|
114
|
+
prompt: |
|
|
115
|
+
Analyze the following task and provide a detailed breakdown:
|
|
116
|
+
|
|
117
|
+
Task: {{ variables.task }}
|
|
118
|
+
|
|
119
|
+
Provide:
|
|
120
|
+
1. Key requirements
|
|
121
|
+
2. Potential challenges
|
|
122
|
+
3. Recommended approach
|
|
123
|
+
|
|
124
|
+
# Optional: Model to use (sonnet, haiku, opus)
|
|
125
|
+
model: sonnet
|
|
126
|
+
|
|
127
|
+
# Optional: Timeout for this step (overrides workflow timeout)
|
|
128
|
+
timeout-minutes: 15
|
|
129
|
+
|
|
130
|
+
# Optional: Max retry attempts (overrides workflow setting)
|
|
131
|
+
max-retry: 2
|
|
132
|
+
|
|
133
|
+
# Optional: Error handling strategy (retry, skip, fail)
|
|
134
|
+
on-error: retry
|
|
135
|
+
|
|
136
|
+
# Optional: Create checkpoint after this step completes
|
|
137
|
+
checkpoint: false
|
|
138
|
+
|
|
139
|
+
# ==================== SKILL INVOCATION ====================
|
|
140
|
+
# Invoke a Claude slash command skill
|
|
141
|
+
# IMPORTANT: Always use fully qualified skill names in workflows (e.g., /sdlc-plan)
|
|
142
|
+
# to avoid conflicts with skills from other plugins or built-in commands.
|
|
143
|
+
- name: generate-plan
|
|
144
|
+
type: prompt
|
|
145
|
+
prompt: /sdlc-plan --type {{ variables.plan_type }} --output_dir "agentic/outputs/{{ workflow_id }}" {{ variables.task }}
|
|
146
|
+
checkpoint: true
|
|
147
|
+
timeout-minutes: 20
|
|
148
|
+
|
|
149
|
+
# ==================== SERIAL STEP ====================
|
|
150
|
+
# Execute nested steps sequentially
|
|
151
|
+
- name: sequential-implementation
|
|
152
|
+
type: serial
|
|
153
|
+
steps:
|
|
154
|
+
- name: setup-environment
|
|
155
|
+
type: prompt
|
|
156
|
+
prompt: "Prepare the development environment for implementation"
|
|
157
|
+
|
|
158
|
+
- name: install-dependencies
|
|
159
|
+
type: prompt
|
|
160
|
+
prompt: "Install required dependencies"
|
|
161
|
+
|
|
162
|
+
- name: create-files
|
|
163
|
+
type: prompt
|
|
164
|
+
prompt: "Create necessary files and directory structure"
|
|
165
|
+
|
|
166
|
+
# ==================== PARALLEL STEP ====================
|
|
167
|
+
# Execute nested steps concurrently in git worktrees
|
|
168
|
+
- name: parallel-analysis
|
|
169
|
+
type: parallel
|
|
170
|
+
|
|
171
|
+
# Merge strategy: wait-all (wait for all steps to complete)
|
|
172
|
+
merge-strategy: wait-all
|
|
173
|
+
|
|
174
|
+
# Merge mode: independent (no merging), merge (merge branches)
|
|
175
|
+
merge-mode: independent
|
|
176
|
+
|
|
177
|
+
# Git configuration for parallel execution
|
|
178
|
+
git:
|
|
179
|
+
# Run each parallel step in separate worktree
|
|
180
|
+
worktree: true
|
|
181
|
+
|
|
182
|
+
# Prefix for parallel branch names
|
|
183
|
+
branch-prefix: "analysis"
|
|
184
|
+
|
|
185
|
+
# Parallel steps
|
|
186
|
+
steps:
|
|
187
|
+
- name: security-scan
|
|
188
|
+
type: prompt
|
|
189
|
+
prompt: /analyze security
|
|
190
|
+
on-error: skip # Don't fail workflow if security scan fails
|
|
191
|
+
|
|
192
|
+
- name: style-check
|
|
193
|
+
type: prompt
|
|
194
|
+
prompt: /analyze style
|
|
195
|
+
on-error: skip
|
|
196
|
+
|
|
197
|
+
- name: bug-detection
|
|
198
|
+
type: prompt
|
|
199
|
+
prompt: /analyze bug
|
|
200
|
+
on-error: skip
|
|
201
|
+
|
|
202
|
+
- name: debt-analysis
|
|
203
|
+
type: prompt
|
|
204
|
+
prompt: /analyze debt
|
|
205
|
+
on-error: skip
|
|
206
|
+
|
|
207
|
+
# ==================== RALPH LOOP STEP ====================
|
|
208
|
+
# Iterative prompt execution with completion detection
|
|
209
|
+
- name: implement-incrementally
|
|
210
|
+
type: ralph-loop
|
|
211
|
+
|
|
212
|
+
# Prompt executed in each iteration
|
|
213
|
+
prompt: |
|
|
214
|
+
## Ralph Loop Iteration
|
|
215
|
+
|
|
216
|
+
Read the implementation plan at agentic/outputs/{{ workflow_id }}/plan.md
|
|
217
|
+
|
|
218
|
+
Implement the NEXT INCOMPLETE milestone:
|
|
219
|
+
1. Read the plan and identify the next incomplete milestone
|
|
220
|
+
2. Implement all tasks in that milestone
|
|
221
|
+
3. Run tests to verify your implementation
|
|
222
|
+
4. Commit your changes with a descriptive message
|
|
223
|
+
5. Mark the milestone as complete in the plan file
|
|
224
|
+
|
|
225
|
+
**IMPORTANT**: When ALL milestones in the plan are marked as complete, output:
|
|
226
|
+
```json
|
|
227
|
+
{"ralph_complete": true, "promise": "ALL_MILESTONES_COMPLETE"}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Do NOT output the completion JSON until every milestone is genuinely finished.
|
|
231
|
+
|
|
232
|
+
Current iteration state is tracked in agentic/outputs/{{ workflow_id }}/ralph-implement-incrementally.md
|
|
233
|
+
|
|
234
|
+
# Maximum iterations before stopping (can use variable)
|
|
235
|
+
max-iterations: "{{ variables.max_iterations }}"
|
|
236
|
+
|
|
237
|
+
# Completion promise text to match in JSON output
|
|
238
|
+
completion-promise: "ALL_MILESTONES_COMPLETE"
|
|
239
|
+
|
|
240
|
+
# Model to use for each iteration
|
|
241
|
+
model: sonnet
|
|
242
|
+
|
|
243
|
+
# Create checkpoint after loop completes
|
|
244
|
+
checkpoint: true
|
|
245
|
+
|
|
246
|
+
# Timeout for entire loop
|
|
247
|
+
timeout-minutes: 120
|
|
248
|
+
|
|
249
|
+
# ==================== REVIEW STEP ====================
|
|
250
|
+
- name: review-implementation
|
|
251
|
+
type: prompt
|
|
252
|
+
prompt: /sdlc-review "agentic/outputs/{{ workflow_id }}/plan.md" minor
|
|
253
|
+
checkpoint: true
|
|
254
|
+
|
|
255
|
+
# ==================== CONDITIONAL STEP ====================
|
|
256
|
+
# Execute steps based on Jinja2 condition
|
|
257
|
+
- name: fix-validation-issues
|
|
258
|
+
type: conditional
|
|
259
|
+
|
|
260
|
+
# Jinja2 expression that evaluates to true/false
|
|
261
|
+
# This checks if there are any issues with severity >= fix_severity
|
|
262
|
+
condition: "{{ outputs.review_implementation.issues | selectattr('severity', 'ge', variables.fix_severity) | list | length > 0 }}"
|
|
263
|
+
|
|
264
|
+
# Steps to execute if condition is true
|
|
265
|
+
then:
|
|
266
|
+
- name: apply-fixes
|
|
267
|
+
type: prompt
|
|
268
|
+
prompt: |
|
|
269
|
+
The validation found issues that need to be fixed.
|
|
270
|
+
|
|
271
|
+
Issues to fix (severity {{ variables.fix_severity }} or higher):
|
|
272
|
+
{{ outputs.review_implementation.issues | tojson(indent=2) }}
|
|
273
|
+
|
|
274
|
+
Please fix these issues and commit your changes.
|
|
275
|
+
model: sonnet
|
|
276
|
+
timeout-minutes: 30
|
|
277
|
+
|
|
278
|
+
- name: re-review
|
|
279
|
+
type: prompt
|
|
280
|
+
prompt: /sdlc-review "" {{ variables.fix_severity }}
|
|
281
|
+
|
|
282
|
+
# Steps to execute if condition is false
|
|
283
|
+
else:
|
|
284
|
+
- name: log-success
|
|
285
|
+
type: prompt
|
|
286
|
+
prompt: "Validation passed! No issues found at severity {{ variables.fix_severity }} or higher."
|
|
287
|
+
|
|
288
|
+
# ==================== WAIT FOR HUMAN STEP ====================
|
|
289
|
+
# Pause workflow and wait for human input
|
|
290
|
+
- name: request-approval
|
|
291
|
+
type: wait-for-human
|
|
292
|
+
|
|
293
|
+
# Message shown to human
|
|
294
|
+
message: |
|
|
295
|
+
Please review the implementation and validation results.
|
|
296
|
+
|
|
297
|
+
Review the following:
|
|
298
|
+
- Implementation plan: agentic/outputs/{{ workflow_id }}/plan.md
|
|
299
|
+
- Review results: outputs.review_implementation
|
|
300
|
+
|
|
301
|
+
Respond with:
|
|
302
|
+
- "approved" to continue and create PR
|
|
303
|
+
- "rejected" to stop without PR
|
|
304
|
+
- Provide feedback for additional changes
|
|
305
|
+
|
|
306
|
+
# Polling interval in seconds (default: 15)
|
|
307
|
+
polling-interval: 30
|
|
308
|
+
|
|
309
|
+
# Action on timeout: abort (stop workflow), continue (proceed anyway)
|
|
310
|
+
on-timeout: abort
|
|
311
|
+
|
|
312
|
+
# Timeout in minutes (default: 1440 = 24 hours)
|
|
313
|
+
timeout-minutes: 120
|
|
314
|
+
|
|
315
|
+
# ==================== CONDITIONAL STEP (CREATE PR) ====================
|
|
316
|
+
- name: create-pull-request
|
|
317
|
+
type: conditional
|
|
318
|
+
condition: "{{ variables.create_pr and outputs.request_approval.response == 'approved' }}"
|
|
319
|
+
then:
|
|
320
|
+
- name: open-pr
|
|
321
|
+
type: prompt
|
|
322
|
+
prompt: /git-pr --title "[{{ variables.plan_type }}] {{ outputs.generate_plan.summary }}"
|
|
323
|
+
|
|
324
|
+
# ==================== FINAL SUMMARY ====================
|
|
325
|
+
- name: generate-summary
|
|
326
|
+
type: prompt
|
|
327
|
+
prompt: |
|
|
328
|
+
Generate a summary of the workflow execution.
|
|
329
|
+
|
|
330
|
+
Include:
|
|
331
|
+
- Task: {{ variables.task }}
|
|
332
|
+
- Plan type: {{ variables.plan_type }}
|
|
333
|
+
- Review results: {{ outputs.review_implementation | tojson }}
|
|
334
|
+
- PR created: {{ outputs.create_pull_request is defined }}
|
|
335
|
+
|
|
336
|
+
Save the summary to agentic/outputs/{{ workflow_id }}/summary.md
|
|
337
|
+
|
|
338
|
+
# Optional: Output artifacts
|
|
339
|
+
outputs:
|
|
340
|
+
# Generated when workflow completes successfully
|
|
341
|
+
- name: implementation-report
|
|
342
|
+
# Jinja2 template file (resolved from workflow dir, agentic/templates/, or bundled templates)
|
|
343
|
+
template: implementation-report.md.j2
|
|
344
|
+
# Output file path (relative to workflow directory)
|
|
345
|
+
path: agentic/outputs/{{ workflow_id }}/report.md
|
|
346
|
+
# When to generate: completed or failed
|
|
347
|
+
when: completed
|
|
348
|
+
|
|
349
|
+
# Generated when workflow fails
|
|
350
|
+
- name: error-report
|
|
351
|
+
template: error-report.md.j2
|
|
352
|
+
path: agentic/outputs/{{ workflow_id }}/error.md
|
|
353
|
+
when: failed
|
|
354
|
+
|
|
355
|
+
# ==================== USAGE EXAMPLES ====================
|
|
356
|
+
#
|
|
357
|
+
# Run with required variable:
|
|
358
|
+
# agentic-forge run workflow-example.yaml --var "task=Add user authentication"
|
|
359
|
+
#
|
|
360
|
+
# Run with custom variables:
|
|
361
|
+
# 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"
|
|
366
|
+
#
|
|
367
|
+
# Run with verbose output:
|
|
368
|
+
# agentic-forge run workflow-example.yaml \
|
|
369
|
+
# --var "task=Implement feature" \
|
|
370
|
+
# --terminal-output all
|
|
371
|
+
#
|
|
372
|
+
# Resume from specific step:
|
|
373
|
+
# agentic-forge run workflow-example.yaml \
|
|
374
|
+
# --var "task=Implement feature" \
|
|
375
|
+
# --from-step review-implementation
|
|
376
|
+
#
|
|
377
|
+
# Provide human input:
|
|
378
|
+
# agentic-forge input <workflow-id> "approved"
|
|
379
|
+
#
|
|
380
|
+
# Check workflow status:
|
|
381
|
+
# agentic-forge status <workflow-id>
|
|
382
|
+
#
|
|
383
|
+
# ==================== AVAILABLE SKILLS ====================
|
|
384
|
+
#
|
|
385
|
+
# IMPORTANT: Always use fully qualified skill names in workflows to avoid conflicts
|
|
386
|
+
# with skills from other plugins or built-in commands.
|
|
387
|
+
#
|
|
388
|
+
# Skills you can invoke via prompt steps:
|
|
389
|
+
#
|
|
390
|
+
# Planning & Review:
|
|
391
|
+
# - /sdlc-plan - Generate implementation plan
|
|
392
|
+
# - /sdlc-review - Review implementation quality
|
|
393
|
+
#
|
|
394
|
+
# Analysis:
|
|
395
|
+
# - /analyze bug - Find bugs and logic errors
|
|
396
|
+
# - /analyze debt - Identify technical debt
|
|
397
|
+
# - /analyze doc - Check documentation
|
|
398
|
+
# - /analyze security - Security scan
|
|
399
|
+
# - /analyze style - Code style check
|
|
400
|
+
#
|
|
401
|
+
# Git Operations:
|
|
402
|
+
# - /git-branch - Create git branch
|
|
403
|
+
# - /git-commit - Create commit
|
|
404
|
+
# - /git-pr - Create pull request
|
|
405
|
+
#
|
|
406
|
+
# Workflow Support:
|
|
407
|
+
# - /orchestrate - Workflow state evaluation
|
|
408
|
+
#
|
|
409
|
+
# ==================== BUILT-IN VARIABLES ====================
|
|
410
|
+
#
|
|
411
|
+
# Available in all Jinja2 templates:
|
|
412
|
+
# - {{ workflow_id }} - Unique workflow execution ID
|
|
413
|
+
# - {{ workflow_name }} - Workflow name from YAML
|
|
414
|
+
# - {{ variables.name }} - User-defined variables
|
|
415
|
+
# - {{ outputs.step_name.field }} - Step outputs
|
|
416
|
+
#
|
|
417
|
+
# ==================== JINJA2 FILTERS ====================
|
|
418
|
+
#
|
|
419
|
+
# Common filters for templating:
|
|
420
|
+
# - {{ list | length }} - Get list length
|
|
421
|
+
# - {{ list | first }} - Get first item
|
|
422
|
+
# - {{ list | last }} - Get last item
|
|
423
|
+
# - {{ list | selectattr('key', 'eq', 'value') }} - Filter list
|
|
424
|
+
# - {{ text | upper }} - Uppercase
|
|
425
|
+
# - {{ text | lower }} - Lowercase
|
|
426
|
+
# - {{ data | tojson }} - Convert to JSON
|
|
427
|
+
# - {{ data | tojson(indent=2) }} - Pretty JSON
|
package/src/cli.ts
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/** CLI entry point for agentic-forge command. */
|
|
4
|
+
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
cmdCancel,
|
|
9
|
+
cmdConfig,
|
|
10
|
+
cmdConfigure,
|
|
11
|
+
cmdInit,
|
|
12
|
+
cmdInput,
|
|
13
|
+
cmdList,
|
|
14
|
+
cmdReleaseNotes,
|
|
15
|
+
cmdResume,
|
|
16
|
+
cmdRun,
|
|
17
|
+
cmdSkillsDir,
|
|
18
|
+
cmdStatus,
|
|
19
|
+
cmdUpdate,
|
|
20
|
+
cmdVersion,
|
|
21
|
+
cmdWorkflows,
|
|
22
|
+
getVersion,
|
|
23
|
+
} from "./commands/index.js";
|
|
24
|
+
|
|
25
|
+
const program = new Command()
|
|
26
|
+
.name("agentic-forge")
|
|
27
|
+
.version(getVersion())
|
|
28
|
+
.description("Agentic workflow orchestration for Claude Code");
|
|
29
|
+
|
|
30
|
+
// run command
|
|
31
|
+
program
|
|
32
|
+
.command("run")
|
|
33
|
+
.argument("[workflow]", "workflow name or path to YAML file")
|
|
34
|
+
.option("--list", "list all available workflows")
|
|
35
|
+
.option("--var <key=value...>", "set workflow variable (can be used multiple times)")
|
|
36
|
+
.option("--from-step <step>", "resume from a specific step")
|
|
37
|
+
.option("--terminal-output <mode>", "terminal output granularity (base or all)")
|
|
38
|
+
.action(async (workflow: string | undefined, opts: Record<string, unknown>) => {
|
|
39
|
+
await cmdRun({
|
|
40
|
+
workflow,
|
|
41
|
+
listWorkflows: opts.list as boolean | undefined,
|
|
42
|
+
vars: opts.var as string[] | undefined,
|
|
43
|
+
fromStep: opts.fromStep as string | undefined,
|
|
44
|
+
terminalOutput: opts.terminalOutput as string | undefined,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// resume command
|
|
49
|
+
program
|
|
50
|
+
.command("resume")
|
|
51
|
+
.argument("<workflow_id>", "workflow ID to resume")
|
|
52
|
+
.option("--terminal-output <mode>", "terminal output granularity (base or all)")
|
|
53
|
+
.action(async (workflowId: string, opts: Record<string, unknown>) => {
|
|
54
|
+
await cmdResume({
|
|
55
|
+
workflowId,
|
|
56
|
+
terminalOutput: opts.terminalOutput as string | undefined,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// status command
|
|
61
|
+
program
|
|
62
|
+
.command("status")
|
|
63
|
+
.argument("<workflow_id>", "workflow ID")
|
|
64
|
+
.action((workflowId: string) => {
|
|
65
|
+
cmdStatus(workflowId);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// cancel command
|
|
69
|
+
program
|
|
70
|
+
.command("cancel")
|
|
71
|
+
.argument("<workflow_id>", "workflow ID to cancel")
|
|
72
|
+
.action((workflowId: string) => {
|
|
73
|
+
cmdCancel(workflowId);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// list command
|
|
77
|
+
program
|
|
78
|
+
.command("list")
|
|
79
|
+
.option("--status <status>", "filter by status (running, completed, failed, paused)")
|
|
80
|
+
.action((opts: Record<string, unknown>) => {
|
|
81
|
+
cmdList(opts.status as string | undefined);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// input command
|
|
85
|
+
program
|
|
86
|
+
.command("input")
|
|
87
|
+
.argument("<workflow_id>", "workflow ID")
|
|
88
|
+
.argument("<response>", "response to provide")
|
|
89
|
+
.action((workflowId: string, response: string) => {
|
|
90
|
+
cmdInput(workflowId, response);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// configure command
|
|
94
|
+
program
|
|
95
|
+
.command("configure")
|
|
96
|
+
.description("Configure plugin settings")
|
|
97
|
+
.action(() => {
|
|
98
|
+
cmdConfigure();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// init command
|
|
102
|
+
program
|
|
103
|
+
.command("init")
|
|
104
|
+
.description("Copy bundled workflow templates to local project")
|
|
105
|
+
.option("--force", "overwrite existing workflow files")
|
|
106
|
+
.option("--list", "list available bundled workflows without copying")
|
|
107
|
+
.action((opts: Record<string, unknown>) => {
|
|
108
|
+
cmdInit({
|
|
109
|
+
force: opts.force as boolean | undefined,
|
|
110
|
+
listOnly: opts.list as boolean | undefined,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// config command with subcommands
|
|
115
|
+
const configCmd = program.command("config").description("Get or set configuration");
|
|
116
|
+
|
|
117
|
+
configCmd
|
|
118
|
+
.command("get")
|
|
119
|
+
.argument("<key>", "configuration key (dot notation)")
|
|
120
|
+
.action((key: string) => {
|
|
121
|
+
cmdConfig("get", key);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
configCmd
|
|
125
|
+
.command("set")
|
|
126
|
+
.argument("<key>", "configuration key (dot notation)")
|
|
127
|
+
.argument("<value>", "value to set")
|
|
128
|
+
.action((key: string, value: string) => {
|
|
129
|
+
cmdConfig("set", key, value);
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// version command
|
|
133
|
+
program
|
|
134
|
+
.command("version")
|
|
135
|
+
.description("Show version information")
|
|
136
|
+
.action(() => {
|
|
137
|
+
cmdVersion();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// release-notes command
|
|
141
|
+
program
|
|
142
|
+
.command("release-notes")
|
|
143
|
+
.argument("[version]", "show release notes for a specific version")
|
|
144
|
+
.option("--latest", "show only the most recent version's release notes")
|
|
145
|
+
.action((specificVersion: string | undefined, opts: Record<string, unknown>) => {
|
|
146
|
+
cmdReleaseNotes({
|
|
147
|
+
specificVersion,
|
|
148
|
+
latest: opts.latest as boolean | undefined,
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
// skills-dir command
|
|
153
|
+
program
|
|
154
|
+
.command("skills-dir")
|
|
155
|
+
.description("Print path to bundled skills directory")
|
|
156
|
+
.action(() => {
|
|
157
|
+
cmdSkillsDir();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// update command
|
|
161
|
+
program
|
|
162
|
+
.command("update")
|
|
163
|
+
.description("Update agentic-forge to the latest version")
|
|
164
|
+
.option("--check", "check for updates without installing")
|
|
165
|
+
.action((opts: Record<string, unknown>) => {
|
|
166
|
+
cmdUpdate({
|
|
167
|
+
check: opts.check as boolean | undefined,
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// workflows command
|
|
172
|
+
program
|
|
173
|
+
.command("workflows")
|
|
174
|
+
.description("List available workflows with descriptions")
|
|
175
|
+
.option("-v, --verbose", "show workflow variables and full descriptions")
|
|
176
|
+
.action((opts: Record<string, unknown>) => {
|
|
177
|
+
cmdWorkflows({
|
|
178
|
+
verbose: opts.verbose as boolean | undefined,
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
program.parse();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Config command handler. */
|
|
2
|
+
|
|
3
|
+
import { getConfigValue, setConfigValue } from "../config.js";
|
|
4
|
+
|
|
5
|
+
export function cmdConfig(configCommand: string, key: string, value?: string): void {
|
|
6
|
+
if (configCommand === "get") {
|
|
7
|
+
const result = getConfigValue(key);
|
|
8
|
+
if (result === null) {
|
|
9
|
+
process.stderr.write(`Key not found: ${key}\n`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
if (typeof result === "object" && result !== null) {
|
|
13
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
14
|
+
} else {
|
|
15
|
+
process.stdout.write(`${result}\n`);
|
|
16
|
+
}
|
|
17
|
+
} else if (configCommand === "set") {
|
|
18
|
+
if (value === undefined) {
|
|
19
|
+
process.stderr.write("Usage: agentic-forge config set <key> <value>\n");
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
setConfigValue(key, value);
|
|
23
|
+
process.stdout.write(`Set ${key} = ${value}\n`);
|
|
24
|
+
} else {
|
|
25
|
+
process.stderr.write("Usage: agentic-forge config get|set <key> [value]\n");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Command handler exports. */
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
cmdRun,
|
|
5
|
+
discoverWorkflow,
|
|
6
|
+
listAvailableWorkflows,
|
|
7
|
+
resolveWorkflowPath,
|
|
8
|
+
getBundledWorkflowsDir,
|
|
9
|
+
getUserWorkflowsDir,
|
|
10
|
+
getProjectWorkflowsDir,
|
|
11
|
+
} from "./run.js";
|
|
12
|
+
export { cmdResume } from "./resume.js";
|
|
13
|
+
export { cmdStatus, cmdCancel, cmdList } from "./status.js";
|
|
14
|
+
export { cmdInit, cmdConfigure } from "./init.js";
|
|
15
|
+
export { cmdConfig } from "./config-cmd.js";
|
|
16
|
+
export { cmdVersion, getVersion } from "./version.js";
|
|
17
|
+
export { cmdUpdate } from "./update.js";
|
|
18
|
+
export { cmdReleaseNotes } from "./release-notes.js";
|
|
19
|
+
export { cmdSkillsDir } from "./skills-dir.js";
|
|
20
|
+
export { cmdWorkflows } from "./workflows.js";
|
|
21
|
+
export { cmdInput } from "./shortcuts.js";
|