@williambeto/ai-workflow 2.6.3 → 2.6.7

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 AI Workflow Kit contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,255 @@
1
+ <div align="center">
2
+
3
+ # AI Workflow Kit
4
+
5
+ **Workflow before code. Evidence before trust.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@williambeto/ai-workflow?style=flat-square&color=0066cc)](https://www.npmjs.com/package/@williambeto/ai-workflow)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
9
+ [![Node Version](https://img.shields.io/badge/node-%3E%3D20.11-brightgreen.svg?style=flat-square)](package.json)
10
+ [![Language](https://img.shields.io/badge/language-TypeScript-blue.svg?style=flat-square)](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
+ ---
34
+
35
+ ## The problem it solves
36
+
37
+ Coding agents are fast but undisciplined. Left to their own devices, they:
38
+
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
43
+
44
+ AI Workflow Kit enforces a contract: **the agent must earn the right to deliver.**
45
+
46
+ ---
47
+
48
+ ## How it works
49
+
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.
51
+
52
+ When you run `npx aw execute "your task"`, Atlas (the coordinator) takes over:
53
+
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
83
+
84
+ ```bash
85
+ npx aw init --yes
86
+ ```
87
+
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
+ ```
96
+
97
+ ### 3. Run your first task
98
+
99
+ ```bash
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
+ ```
110
+
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
118
+ ```
119
+
120
+ > **Using Antigravity IDE?** Run `npx aw init --yes --antigravity` to enable Atlas directly from the agent selector dropdown.
121
+
122
+ ---
123
+
124
+ ## The Agent Team
125
+
126
+ Each agent has a fixed role and cannot exceed its operational boundary.
127
+
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 |
136
+
137
+ Agents are installed as prompts in your `.ai-workflow/agents/` directory. You can read, audit, or customise them.
138
+
139
+ ---
140
+
141
+ ## CLI Commands
142
+
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 |
151
+
152
+ ---
153
+
154
+ ## Risk Levels and Policies
155
+
156
+ AIWK automatically assigns a risk level to every request. Policies scale accordingly.
157
+
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 |
163
+
164
+ You don't configure this. The kit reads your request and calibrates automatically.
165
+
166
+ ---
167
+
168
+ ## What gets installed in your project
169
+
170
+ Running `npx aw init` writes the following into your repository:
171
+
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
+ ```
183
+
184
+ Everything is plain text — readable, auditable, and version-controlled.
185
+
186
+ ---
187
+
188
+ ## Safety Guarantees
189
+
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.
195
+
196
+ ---
197
+
198
+ ## Skills
199
+
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
+ ```
213
+
214
+ → [Custom Skill Authoring Guide](docs/getting-started/authoring-custom-skills.md)
215
+
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
+ ```
248
+
249
+ All 22 quality gates must pass.
250
+
251
+ ---
252
+
253
+ ## License
254
+
255
+ MIT © José Willams