@williambeto/ai-workflow 2.4.9 → 2.6.4
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/CHANGELOG.md +1138 -168
- package/README.md +203 -77
- package/bin/ai-workflow.d.ts +3 -0
- package/bin/ai-workflow.js +2669 -1
- package/bin/ai-workflow.js.map +1 -0
- package/chunk-2AOV2ATY.js +749 -0
- package/chunk-5WRI5ZAA.js +31 -0
- package/chunk-6EMG6FAO.js +734 -0
- package/chunk-UHLZX2EG.js +1827 -0
- package/core/index.d.ts +440 -0
- package/core/index.js +32 -0
- package/core/index.js.map +1 -0
- package/dist-assets/AGENTS.md +23 -6
- package/dist-assets/agents/atlas.md +8 -8
- package/dist-assets/agents/nexus.md +4 -4
- package/dist-assets/agents/orion.md +1 -1
- package/dist-assets/agents/phoenix.md +1 -1
- package/dist-assets/agents/sage.md +1 -1
- package/dist-assets/commands/implement.md +1 -1
- package/dist-assets/docs/QUICKSTART.md +8 -8
- package/dist-assets/docs/cli-reference.md +7 -7
- package/dist-assets/docs/compatibility/provider-usage.md +1 -9
- package/dist-assets/docs/compatibility/runtime-matrix.md +5 -6
- package/dist-assets/docs/consumer-onboarding.md +2 -2
- package/dist-assets/docs/design-patterns-policy.md +1 -1
- package/dist-assets/docs/npm-consumer-quickstart.md +70 -109
- package/dist-assets/docs/policies/01-BRANCH_GATE.md +1 -1
- package/dist-assets/docs/policies/06-FINAL_EVIDENCE_CONTRACT.md +2 -2
- package/dist-assets/docs/policies/08-PRODUCT_TRUTHFULNESS_AND_PROJECT_DOCS.md +1 -1
- package/dist-assets/docs/policies/10-BEHAVIORAL_CONTRACT_HARDENING.md +1 -1
- package/dist-assets/docs/policies/ORCHESTRATION_PROTOCOL.md +8 -9
- package/dist-assets/docs/policies/PROCEDURE_DELIVERY_ARTIFACTS.md +4 -10
- package/dist-assets/docs/policies/SKILLS_COMMON_GOVERNANCE.md +1 -1
- package/dist-assets/docs/profiles/README.md +2 -2
- package/dist-assets/docs/specs/runtime-operational-contract.md +12 -12
- package/dist-assets/docs/troubleshooting-guide.md +2 -2
- package/dist-assets/docs/visual-validation-guide.md +3 -3
- package/dist-assets/schemas/evidence.schema.json +109 -0
- package/dist-assets/templates/ANTIGRAVITY.md.template +7 -5
- package/dist-assets/templates/CLAUDE.md.template +7 -5
- package/dist-assets/templates/CODEX.md.template +7 -5
- package/evidence-validator-76ZQQYDU.js +6661 -0
- package/package.json +7 -64
- package/{src/core/workspace/read-only-workspace.js → read-only-workspace-PZBE7KAX.js} +14 -31
- package/{src/commands/validate.js → validate-Q2NLLQ5G.js} +30 -22
- package/AGENTS.md +0 -34
- package/PUBLISH_MANIFEST.json +0 -34
- package/dist-assets/templates/.geminiignore.template +0 -8
- package/dist-assets/templates/GEMINI.md.template +0 -20
- package/docs/compatibility/provider-usage.md +0 -46
- package/docs/compatibility/runtime-matrix.md +0 -31
- package/docs/getting-started/DESKTOP_PROMPT.md +0 -52
- package/docs/getting-started/authoring-custom-skills.md +0 -80
- package/docs/getting-started/quickstart.md +0 -117
- package/docs/getting-started/troubleshooting.md +0 -123
- package/docs/getting-started/upgrading-to-v2.md +0 -62
- package/src/adapters/index.js +0 -4
- package/src/adapters/platforms/antigravity.js +0 -382
- package/src/adapters/platforms/claude.js +0 -126
- package/src/adapters/platforms/codex.js +0 -113
- package/src/adapters/platforms/gemini.js +0 -245
- package/src/cli.js +0 -155
- package/src/commands/clean.js +0 -106
- package/src/commands/collect-evidence.js +0 -25
- package/src/commands/doctor.js +0 -202
- package/src/commands/execute.js +0 -382
- package/src/commands/init.js +0 -359
- package/src/commands/run.js +0 -112
- package/src/core/backup.js +0 -65
- package/src/core/completion-contract.js +0 -35
- package/src/core/delegation-controller.js +0 -193
- package/src/core/evidence/evidence-ledger.js +0 -98
- package/src/core/execution-planner.js +0 -62
- package/src/core/filesystem.js +0 -141
- package/src/core/finalization/finalizer.js +0 -165
- package/src/core/finalization/workspace-snapshot.js +0 -110
- package/src/core/gates/branch-gate.js +0 -134
- package/src/core/gates/merge-gate.js +0 -74
- package/src/core/handoff/handoff-engine.js +0 -104
- package/src/core/healing/cli-remediation-executor.js +0 -153
- package/src/core/healing/healer-engine.js +0 -212
- package/src/core/healing/runtime-remediation-executor.js +0 -136
- package/src/core/identity.js +0 -43
- package/src/core/install-plan.js +0 -34
- package/src/core/opencode-merge.js +0 -150
- package/src/core/package-assets.js +0 -141
- package/src/core/request-classifier.js +0 -73
- package/src/core/request-router.js +0 -289
- package/src/core/runtime/opencode-adapter.js +0 -202
- package/src/core/sdd/validator.js +0 -67
- package/src/core/statuses.js +0 -29
- package/src/core/symlink-layout.js +0 -93
- package/src/core/templates.js +0 -229
- package/src/core/validation/artifact-fidelity-gate.js +0 -445
- package/src/core/validation/canonical-finalization.js +0 -43
- package/src/core/validation/delivery-decision-engine.js +0 -344
- package/src/core/validation/evidence-collector.js +0 -245
- package/src/core/validation/quality-guard.js +0 -251
- package/src/core/validation/stack-detector.js +0 -65
- package/src/core/validation/validation-planner.js +0 -134
- package/src/core/validation/visual-verifier.js +0 -175
- package/src/core/workflow-profiles.js +0 -107
- package/src/core/workflow-state-machine.js +0 -46
package/README.md
CHANGED
|
@@ -1,129 +1,255 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# AI Workflow Kit
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
**Workflow before code. Evidence before trust.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@williambeto/ai-workflow)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](package.json)
|
|
10
|
+
[](tsconfig.json)
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## What is AI Workflow Kit?
|
|
17
|
+
|
|
18
|
+
AI Workflow Kit (AIWK) is an **npm CLI** you install in your project that makes AI-assisted software delivery **safe, structured, and verifiable**.
|
|
19
|
+
|
|
20
|
+
It works with [OpenCode](https://opencode.ai) to turn a natural language request into a full delivery — with branch protection, specialist agent delegation, automated validation, and a persisted evidence log.
|
|
21
|
+
|
|
22
|
+
**Without AIWK**, a coding agent receives a request, writes code, and reports success. There is no proof, no branch isolation, and no guarantee that tests passed.
|
|
23
|
+
|
|
24
|
+
**With AIWK**, the same request travels through a mandatory workflow:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Your request → Classification → Branch Gate → Specialist Agent
|
|
28
|
+
→ Automated Validation → Evidence → Handoff
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
No step can be skipped. No claim of success is made without proof.
|
|
32
|
+
|
|
33
|
+
---
|
|
5
34
|
|
|
6
|
-
The
|
|
35
|
+
## The problem it solves
|
|
7
36
|
|
|
8
|
-
|
|
37
|
+
Coding agents are fast but undisciplined. Left to their own devices, they:
|
|
9
38
|
|
|
10
|
-
|
|
39
|
+
- Write directly to `main` without a feature branch
|
|
40
|
+
- Skip tests if they think the change is "simple"
|
|
41
|
+
- Report `Done!` without any verifiable trace of what happened
|
|
42
|
+
- Mix discovery, implementation, and validation into one unstructured loop
|
|
11
43
|
|
|
12
|
-
|
|
44
|
+
AI Workflow Kit enforces a contract: **the agent must earn the right to deliver.**
|
|
13
45
|
|
|
14
|
-
|
|
15
|
-
2. **Planning**: Select the execution mode and workflow profile.
|
|
16
|
-
3. **Branch Gate**: Never implement directly on main/master.
|
|
17
|
-
4. **Delegation**: Atlas routes; Astra implements; Sage validates when appropriate; Phoenix remediates within a defined limit.
|
|
18
|
-
5. **Implementation**: Deliver useful code, not just reports.
|
|
19
|
-
6. **Validation**: Run observed validations and relevant tests, blocking false success.
|
|
20
|
-
7. **Evidence**: Summarize changes, validations, and limitations.
|
|
46
|
+
---
|
|
21
47
|
|
|
22
|
-
|
|
48
|
+
## How it works
|
|
23
49
|
|
|
24
|
-
|
|
50
|
+
AIWK installs a structured team of 6 specialist agents into your repository. Each agent has a defined role, a permission boundary, and cannot claim work that belongs to another.
|
|
25
51
|
|
|
26
|
-
|
|
52
|
+
When you run `npx aw execute "your task"`, Atlas (the coordinator) takes over:
|
|
27
53
|
|
|
28
|
-
|
|
54
|
+
| Step | Who | What happens |
|
|
55
|
+
|:---|:---|:---|
|
|
56
|
+
| **1. Classify** | Atlas | Reads the request, assigns risk level (low / medium / high), selects evidence and spec policies |
|
|
57
|
+
| **2. Branch Gate** | Atlas | Creates `feat/<task>` from `main`. **Never writes to protected branches.** |
|
|
58
|
+
| **3. Plan** | Nexus / Orion | Writes a specification (when required by risk level) |
|
|
59
|
+
| **4. Implement** | Astra | Implements the change on the feature branch |
|
|
60
|
+
| **5. Validate** | Sage | Runs tests, accessibility checks, visual regression — writes evidence |
|
|
61
|
+
| **6. Remediate** | Phoenix | If validation fails, Phoenix heals within a bounded attempt limit |
|
|
62
|
+
| **7. Evidence** | Atlas | Saves `EVIDENCE.json` + `HANDOFF-<task>.md` to `.ai-workflow/` |
|
|
63
|
+
|
|
64
|
+
> **Proportional by design.** A typo fix in a README gets 1 remediation attempt and no spec. A payment integration gets 3 attempts, a required SDD, and mandatory persisted evidence. The kit calibrates automatically.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### Prerequisites
|
|
71
|
+
|
|
72
|
+
- Node.js ≥ 20.11
|
|
73
|
+
- Git repository initialised (`git init`)
|
|
74
|
+
- [OpenCode](https://opencode.ai) runtime installed
|
|
75
|
+
|
|
76
|
+
### 1. Install
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install -D @williambeto/ai-workflow
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 2. Initialise
|
|
29
83
|
|
|
30
84
|
```bash
|
|
31
|
-
npx
|
|
85
|
+
npx aw init --yes
|
|
32
86
|
```
|
|
33
87
|
|
|
34
|
-
|
|
88
|
+
This creates the `.ai-workflow/` directory and installs 6 agents, 25 skills, and all policies into your project:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
✔ Created .ai-workflow/
|
|
92
|
+
✔ Created opencode.jsonc
|
|
93
|
+
✔ Updated .gitignore
|
|
94
|
+
✔ Installed 6 agents, 25 skills, 14 commands, 11 policies
|
|
95
|
+
```
|
|
35
96
|
|
|
36
|
-
|
|
97
|
+
### 3. Run your first task
|
|
37
98
|
|
|
38
99
|
```bash
|
|
39
|
-
|
|
100
|
+
npx aw execute "Add a health check endpoint returning HTTP 200"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Atlas classifies the request, creates a branch, delegates to Astra, validates with Sage, and writes evidence — all automatically.
|
|
104
|
+
|
|
105
|
+
### 4. Check the evidence
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npx aw collect-evidence
|
|
109
|
+
```
|
|
40
110
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
111
|
+
```
|
|
112
|
+
--- Delivery Summary ---
|
|
113
|
+
Status: COMPLETED
|
|
114
|
+
Branch: feat/health-check
|
|
115
|
+
Changes: src/routes/health.js, tests/health.test.js
|
|
116
|
+
Validation: npm test: PASS
|
|
117
|
+
Limitations: None recorded
|
|
44
118
|
```
|
|
45
119
|
|
|
46
|
-
|
|
120
|
+
> **Using Antigravity IDE?** Run `npx aw init --yes --antigravity` to enable Atlas directly from the agent selector dropdown.
|
|
47
121
|
|
|
48
|
-
|
|
122
|
+
---
|
|
49
123
|
|
|
50
|
-
|
|
124
|
+
## The Agent Team
|
|
51
125
|
|
|
52
|
-
|
|
53
|
-
- `playwright` (or `@playwright/test`) and `axe-core` installed under `devDependencies`.
|
|
54
|
-
- Browser binaries installed on the host machine by running `npx playwright install` (specifically Chromium).
|
|
126
|
+
Each agent has a fixed role and cannot exceed its operational boundary.
|
|
55
127
|
|
|
56
|
-
|
|
128
|
+
| Agent | Role | What it does |
|
|
129
|
+
|:---|:---|:---|
|
|
130
|
+
| 🧭 **Atlas** | Coordinator | Classifies requests, manages branches, routes to specialists |
|
|
131
|
+
| 🔍 **Nexus** | Analyst | Researches codebase, defines requirements, authors specifications |
|
|
132
|
+
| 📅 **Orion** | Planner | Sequences pull requests, coordinates releases and planning |
|
|
133
|
+
| 💻 **Astra** | Engineer | Implements code changes safely on isolated feature branches |
|
|
134
|
+
| 🧪 **Sage** | Validator | Audits changes, runs quality gates, writes verifiable evidence |
|
|
135
|
+
| 🔧 **Phoenix** | Recovery | Heals broken states within a bounded remediation limit |
|
|
57
136
|
|
|
58
|
-
|
|
137
|
+
Agents are installed as prompts in your `.ai-workflow/agents/` directory. You can read, audit, or customise them.
|
|
59
138
|
|
|
60
|
-
|
|
61
|
-
| --- | --- | --- |
|
|
62
|
-
| `quick` | Small, focused, low-risk work | Concise summary with targeted validation |
|
|
63
|
-
| `standard` | Normal scoped feature or application work | Branch, changed areas, commands/results, limitations |
|
|
64
|
-
| `full` | Broad, risky, architectural, migration, security, or release work | Independent validation and persisted evidence |
|
|
139
|
+
---
|
|
65
140
|
|
|
66
|
-
|
|
141
|
+
## CLI Commands
|
|
67
142
|
|
|
68
|
-
|
|
143
|
+
| Command | Description |
|
|
144
|
+
|:---|:---|
|
|
145
|
+
| `npx aw execute "<request>"` | Run the full workflow from a natural language request |
|
|
146
|
+
| `npx aw run --spec-path=<path>` | Run implementation against an existing specification |
|
|
147
|
+
| `npx aw validate` | Execute all quality gates manually |
|
|
148
|
+
| `npx aw collect-evidence` | Collect and compile delivery evidence to `EVIDENCE.json` |
|
|
149
|
+
| `npx aw doctor` | Diagnose installation health |
|
|
150
|
+
| `npx aw clean` | Remove all AIWK configuration from the project |
|
|
69
151
|
|
|
70
|
-
|
|
71
|
-
- `frontend-utility` for validators, search pages, forms, dashboards, and focused tools;
|
|
72
|
-
- `backend-api`, `refactor`, `documentation`, and `security-review` for their respective domains.
|
|
152
|
+
---
|
|
73
153
|
|
|
74
|
-
|
|
154
|
+
## Risk Levels and Policies
|
|
75
155
|
|
|
76
|
-
|
|
156
|
+
AIWK automatically assigns a risk level to every request. Policies scale accordingly.
|
|
77
157
|
|
|
78
|
-
|
|
158
|
+
| Signal in your request | Risk | Spec required | Evidence persisted | Remediation attempts |
|
|
159
|
+
|:---|:---:|:---:|:---:|:---:|
|
|
160
|
+
| "fix typo in README" | Low | No | No | 1 |
|
|
161
|
+
| "refactor auth module" | Medium | No | Optional | 2 |
|
|
162
|
+
| "publish to npm", "payment integration" | High | **Yes** | **Yes** | 3 |
|
|
79
163
|
|
|
80
|
-
|
|
81
|
-
- `.ai-workflow/docs/compatibility/runtime-matrix.md`
|
|
82
|
-
- `.ai-workflow/docs/compatibility/provider-usage.md`
|
|
83
|
-
- `.ai-workflow/AGENTS.md`
|
|
84
|
-
- `opencode.jsonc`
|
|
164
|
+
You don't configure this. The kit reads your request and calibrates automatically.
|
|
85
165
|
|
|
86
|
-
|
|
166
|
+
---
|
|
87
167
|
|
|
88
|
-
##
|
|
168
|
+
## What gets installed in your project
|
|
89
169
|
|
|
90
|
-
|
|
170
|
+
Running `npx aw init` writes the following into your repository:
|
|
91
171
|
|
|
92
|
-
|
|
172
|
+
```
|
|
173
|
+
.ai-workflow/
|
|
174
|
+
├── agents/ # Atlas, Nexus, Orion, Astra, Sage, Phoenix prompts
|
|
175
|
+
├── commands/ # Slash commands for your AI IDE
|
|
176
|
+
├── skills/ # 25 domain skills (architecture, security, database, ...)
|
|
177
|
+
├── templates/ # Specification and handoff templates
|
|
178
|
+
├── policies/ # Branch gate, quality gate, merge gate policies
|
|
179
|
+
├── history/ # Ledger of every workflow execution
|
|
180
|
+
└── handoffs/ # HANDOFF-<task>.md for every completed delivery
|
|
181
|
+
opencode.jsonc # OpenCode runtime configuration
|
|
182
|
+
```
|
|
93
183
|
|
|
94
|
-
|
|
184
|
+
Everything is plain text — readable, auditable, and version-controlled.
|
|
95
185
|
|
|
96
|
-
|
|
97
|
-
- **Architectural Policy**: `.ai-workflow/docs/architecture-policy.md`
|
|
98
|
-
- **Design Conventions**: `.ai-workflow/docs/design-patterns-policy.md`
|
|
99
|
-
- **Visual E2E Validation**: `.ai-workflow/docs/visual-validation-guide.md`
|
|
100
|
-
- **Compatibility Matrix**: `.ai-workflow/docs/compatibility/runtime-matrix.md`
|
|
101
|
-
- **Platform Governance**: `.ai-workflow/AGENTS.md`
|
|
186
|
+
---
|
|
102
187
|
|
|
103
|
-
##
|
|
188
|
+
## Safety Guarantees
|
|
104
189
|
|
|
105
|
-
- `
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
- `
|
|
109
|
-
- `
|
|
190
|
+
- **Branch protection**: execution is always blocked on `main`/`master`. A feature branch is created automatically.
|
|
191
|
+
- **Read-only confinement**: tasks classified as read-only are cryptographically verified — any file mutation blocks the execution.
|
|
192
|
+
- **Bounded remediation**: Phoenix is limited to N attempts. The kit never loops indefinitely.
|
|
193
|
+
- **Mandatory handoff**: every write-mode execution produces a `HANDOFF-<task>.md` with evidence, diff, and status — regardless of risk level.
|
|
194
|
+
- **Schema-validated evidence**: `EVIDENCE.json` is validated against a strict Ajv schema. Path traversal and shell injection are blocked.
|
|
110
195
|
|
|
111
|
-
|
|
196
|
+
---
|
|
112
197
|
|
|
113
|
-
##
|
|
198
|
+
## Skills
|
|
114
199
|
|
|
115
|
-
|
|
200
|
+
Beyond the 6 core agents, AIWK ships 25 domain skills that agents activate as context lenses when the request profile warrants it. You can also author your own:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
.ai-workflow/skills/
|
|
204
|
+
├── architecture/
|
|
205
|
+
├── backend-development/
|
|
206
|
+
├── cyber-security/ # activated by Sage on audit tasks
|
|
207
|
+
├── database/ # activated by Astra on schema work
|
|
208
|
+
├── frontend-design-system/
|
|
209
|
+
├── performance/
|
|
210
|
+
├── qa-workflow/
|
|
211
|
+
└── ... 18 more
|
|
212
|
+
```
|
|
116
213
|
|
|
117
|
-
|
|
118
|
-
- `src/**` — CLI and runtime implementation
|
|
119
|
-
- `internal/**` — validators, build, and release tooling
|
|
214
|
+
→ [Custom Skill Authoring Guide](docs/getting-started/authoring-custom-skills.md)
|
|
120
215
|
|
|
121
|
-
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Documentation
|
|
219
|
+
|
|
220
|
+
| Guide | Description |
|
|
221
|
+
|:---|:---|
|
|
222
|
+
| [Quickstart](docs/getting-started/quickstart.md) | Step-by-step 5-minute setup |
|
|
223
|
+
| [Upgrading to v2](docs/getting-started/upgrading-to-v2.md) | Migration from v1 |
|
|
224
|
+
| [Visual Validation Guide](dist-assets/docs/visual-validation-guide.md) | Screenshot and layout regression testing |
|
|
225
|
+
| [Custom Skill Authoring](docs/getting-started/authoring-custom-skills.md) | Write project-specific guidance |
|
|
226
|
+
| [CHANGELOG](CHANGELOG.md) | Full version history |
|
|
227
|
+
| [Site](https://ai-workflow-kit-site.pages.dev/) | Official documentation site |
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Contributing
|
|
232
|
+
|
|
233
|
+
AIWK uses itself to manage its own development. To contribute:
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
src/ TypeScript source (CLI + Core)
|
|
237
|
+
dist-assets/ Templates, agents, skills, schemas installed into consumer repos
|
|
238
|
+
tests/ Unit (296 tests) and E2E (19 tests) suites
|
|
239
|
+
internal/ Validation pipelines and release scripts
|
|
240
|
+
docs/ Guides, ADRs, specs, and release notes
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Run the full validation suite before submitting a pull request:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
npm run validate
|
|
247
|
+
```
|
|
122
248
|
|
|
123
|
-
|
|
249
|
+
All 22 quality gates must pass.
|
|
124
250
|
|
|
125
|
-
|
|
251
|
+
---
|
|
126
252
|
|
|
127
253
|
## License
|
|
128
254
|
|
|
129
|
-
|
|
255
|
+
MIT © José Willams
|