executant 1.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/README.md +121 -0
- package/dist/index.js +2252 -0
- package/dist/prompts/judge-evaluation.txt +35 -0
- package/dist/prompts/judge-retry-context.txt +31 -0
- package/dist/prompts/plan-decompose.txt +199 -0
- package/dist/prompts/plan-judge.txt +82 -0
- package/dist/prompts/plan-research.txt +90 -0
- package/dist/prompts/plan-retry-judge.txt +18 -0
- package/dist/prompts/plan-retry-parse-error.txt +23 -0
- package/dist/prompts/plan-retry-schema-error.txt +75 -0
- package/dist/prompts/plan-system-rules.txt +21 -0
- package/dist/prompts/retrospective-analysis.txt +304 -0
- package/dist/prompts/self-healing-fix.txt +54 -0
- package/package.json +89 -0
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# executant
|
|
2
|
+
|
|
3
|
+
Harness for YAML-defined workflows that enables stepping through Claude sessions and bash commands. Define the steps, the quality criteria, and how failures recover -> Executant runs them.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g executant
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires [Node.js](https://nodejs.org) and the [Claude Code CLI](https://claude.ai/code).
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
# workflow.yaml
|
|
17
|
+
goal: "Review and test my changes"
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: test
|
|
21
|
+
type: script
|
|
22
|
+
command: npm test
|
|
23
|
+
|
|
24
|
+
- name: review
|
|
25
|
+
prompt: |
|
|
26
|
+
Review the changes in git diff and summarise any concerns.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
executant workflow.yaml
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## How It Works
|
|
34
|
+
|
|
35
|
+
A workflow is a YAML file with a `goal` and a list of `steps`. Each step is either a **prompt** (Claude runs it with full tool access), a **script** (bash runs it directly), a **log** (progress marker), or a **forEach** (iterates over a list). Steps run in order; the TUI shows live output and elapsed time for each.
|
|
36
|
+
|
|
37
|
+
## Generating Workflows
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
executant plan "convert all CoffeeScript files to TypeScript and run tests"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Generates a workflow YAML in your project's task directory using a three-pass Claude pipeline (research → decompose → validate). Also accepts `-f file` or stdin.
|
|
44
|
+
|
|
45
|
+
## Context & Variables
|
|
46
|
+
|
|
47
|
+
Use `vars` to define shared values substituted as `{{var_name}}` in any prompt or command. Pair with `context` to inject file contents directly into a prompt at runtime, and `output` to pipe a script step's stdout into a file for downstream steps to read.
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
vars:
|
|
51
|
+
spec: docs/spec.md
|
|
52
|
+
report: /tmp/report.txt
|
|
53
|
+
|
|
54
|
+
steps:
|
|
55
|
+
- name: implement
|
|
56
|
+
context: [spec] # prepends docs/spec.md contents to the prompt
|
|
57
|
+
prompt: Implement the feature described in the spec above.
|
|
58
|
+
|
|
59
|
+
- name: audit
|
|
60
|
+
type: script
|
|
61
|
+
command: npm run audit
|
|
62
|
+
output: report # captures stdout to /tmp/report.txt
|
|
63
|
+
|
|
64
|
+
- name: summarise
|
|
65
|
+
prompt: Summarise the audit findings in {{report}}.
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use `forEach` to repeat a step over a list or shell command output — `{{item}}` is substituted per iteration:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
steps:
|
|
72
|
+
- name: lint {{item}}
|
|
73
|
+
forEach: "git diff --name-only HEAD~1" # or an inline list: [a.ts, b.ts]
|
|
74
|
+
type: script
|
|
75
|
+
command: npx eslint src/{{item}}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Quality Controls
|
|
79
|
+
|
|
80
|
+
- **`llm_as_judge: true`** — after a step completes, Claude evaluates the output; retries with feedback on FAIL, up to 5×
|
|
81
|
+
- **`self_healing: true`** — on script failure, Claude diagnoses and repairs the command, then re-runs it, up to 5×
|
|
82
|
+
- **`self_improve: true`** — after the workflow finishes, Claude analyzes execution highlights and saves an improved YAML to `tasks/backlog/`
|
|
83
|
+
|
|
84
|
+
## Examples
|
|
85
|
+
|
|
86
|
+
| File | Demonstrates |
|
|
87
|
+
|------|-------------|
|
|
88
|
+
| `hello-world.yaml` | Simple prompt steps |
|
|
89
|
+
| `mixed-workflow.yaml` | Script + prompt steps together |
|
|
90
|
+
| `foreach-demo.yaml` | Inline lists and shell command iteration |
|
|
91
|
+
| `vars-demo.yaml` | Variable substitution |
|
|
92
|
+
| `judge-demo.yaml` | LLM-as-judge retry loop |
|
|
93
|
+
| `logging-demo.yaml` | Log steps, self-healing, judge |
|
|
94
|
+
| `git-status-summary.yaml` | Real-world git workflow |
|
|
95
|
+
|
|
96
|
+
See the [`examples/`](examples/) directory.
|
|
97
|
+
|
|
98
|
+
## CLI
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
executant plan "description" # generate a workflow YAML
|
|
102
|
+
executant workflow.yaml # run a workflow
|
|
103
|
+
executant --ci workflow.yaml # headless, NDJSON to stdout
|
|
104
|
+
executant --step <name|n> wf.yaml # run one step by name or index
|
|
105
|
+
executant --from-step <n> wf.yaml # resume from step n
|
|
106
|
+
executant update # upgrade to latest version
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
git clone https://github.com/coston/executant
|
|
113
|
+
cd executant
|
|
114
|
+
npm install
|
|
115
|
+
npm run dev examples/hello-world.yaml # run without building
|
|
116
|
+
npm test # run unit tests
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|