@rasensio/aidlc 0.4.0 → 0.7.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/LICENSE +21 -0
- package/README.md +43 -253
- package/dist/cli.js +0 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/continue.d.ts.map +1 -1
- package/dist/commands/continue.js +11 -15
- package/dist/commands/continue.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +35 -42
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/gate.d.ts.map +1 -1
- package/dist/commands/gate.js +11 -15
- package/dist/commands/gate.js.map +1 -1
- package/dist/commands/init.d.ts +17 -11
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +297 -77
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +14 -16
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +11 -15
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/transition.d.ts.map +1 -1
- package/dist/commands/transition.js +11 -15
- package/dist/commands/transition.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +31 -30
- package/dist/commands/update.js.map +1 -1
- package/dist/compile/adapters/claude-code.js +2 -2
- package/dist/compile/adapters/claude-code.js.map +1 -1
- package/dist/compile/adapters/kiro.d.ts.map +1 -1
- package/dist/compile/adapters/kiro.js +2 -1
- package/dist/compile/adapters/kiro.js.map +1 -1
- package/package.json +14 -21
- package/capabilities/claude-code.yaml +0 -9
- package/capabilities/codex.yaml +0 -8
- package/capabilities/cursor.yaml +0 -8
- package/capabilities/kiro.yaml +0 -9
- package/capabilities/windsurf.yaml +0 -8
- package/ci/aidlc-gate.yml +0 -100
- package/examples/.gitkeep +0 -0
- package/guidance/accessibility.md +0 -67
- package/guidance/api-conventions.md +0 -124
- package/guidance/index.yaml +0 -7
- package/guidance/secure-defaults.md +0 -71
- package/phases/.gitkeep +0 -0
- package/skills/00-overview.md +0 -74
- package/skills/01-getting-started.md +0 -131
- package/skills/02-first-activation.md +0 -158
- package/skills/10-ideation.md +0 -45
- package/skills/20-requirements.md +0 -54
- package/skills/30-design.md +0 -57
- package/skills/40-implementation.md +0 -64
- package/skills/50-testing.md +0 -60
- package/skills/60-deployment.md +0 -63
- package/skills/70-maintenance.md +0 -56
- package/skills/80-review.md +0 -85
- package/skills/81-continue.md +0 -57
- package/skills/82-add-action.md +0 -71
- package/templates/.gitkeep +0 -0
- package/templates/bugfix.yaml +0 -14
- package/templates/full-feature.yaml +0 -44
- package/templates/micro-task.yaml +0 -11
- package/templates/quick-feature.yaml +0 -20
- package/templates/spike.yaml +0 -15
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Rodrigo Asensio
|
|
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
CHANGED
|
@@ -1,213 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @rasensio/aidlc
|
|
2
2
|
|
|
3
3
|
Structured lifecycle guidance for AI coding agents across platforms. One set of skills, every major AI coding tool.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://github.com/rasensio/aidlc/blob/main/LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
# Verify Node.js >= 18
|
|
9
|
-
node --version
|
|
10
|
-
```
|
|
7
|
+
## What is AIDLC?
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
# Verify npm
|
|
14
|
-
npm --version
|
|
15
|
-
```
|
|
9
|
+
AIDLC brings phase-driven workflows, review gates, and quality checkpoints to AI-assisted software development. Instead of letting your AI assistant jump straight into code, AIDLC guides it through structured phases — ideation, requirements, design, implementation, testing, deployment, and maintenance.
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Install and initialize
|
|
11
|
+
Works with **Claude Code**, **Cursor**, **Windsurf**, **Kiro**, and **Codex**.
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
# Install globally (or use npx without installing)
|
|
23
|
-
npm install -g @rasensio/aidlc
|
|
24
|
-
```
|
|
13
|
+
## Quick Start
|
|
25
14
|
|
|
26
15
|
```bash
|
|
27
|
-
# platform
|
|
16
|
+
# Set up AIDLC once — interactive wizard, or pass --platform to skip prompts
|
|
28
17
|
npx @rasensio/aidlc init --platform claude-code
|
|
29
18
|
```
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
# platform: kiro
|
|
33
|
-
npx @rasensio/aidlc init --platform kiro
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
# platform: cursor
|
|
38
|
-
npx @rasensio/aidlc init --platform cursor
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# platform: windsurf
|
|
43
|
-
npx @rasensio/aidlc init --platform windsurf
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
# platform: codex
|
|
48
|
-
npx @rasensio/aidlc init --platform codex
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Start, check, and continue
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
npx @rasensio/aidlc start
|
|
55
|
-
npx @rasensio/aidlc status
|
|
56
|
-
npx @rasensio/aidlc continue
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Verification
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npx @rasensio/aidlc status
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
A successful run outputs lifecycle status and exits with code 0.
|
|
66
|
-
|
|
67
|
-
## Non-Interactive Setup
|
|
68
|
-
|
|
69
|
-
The `aidlc setup` command supports fully non-interactive operation for AI agents. All wizard options are available as CLI flags:
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
npx @rasensio/aidlc setup \
|
|
73
|
-
--project-type existing \
|
|
74
|
-
--complexity full \
|
|
75
|
-
--actions git-branch \
|
|
76
|
-
--platforms claude-code,kiro \
|
|
77
|
-
--yes
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
| Flag | Accepted Values | Description |
|
|
81
|
-
|------|----------------|-------------|
|
|
82
|
-
| `--project-type` | `new`, `existing` | Whether this is a new or existing project |
|
|
83
|
-
| `--complexity` | `simple`, `full` | Simple = Micro-Task template; Full = Full Feature template |
|
|
84
|
-
| `--actions` | `git-branch`, `github-issue`, `doc-update` (comma-separated) | Built-in lifecycle actions to enable |
|
|
85
|
-
| `--platforms` | `claude-code`, `kiro`, `cursor`, `windsurf`, `codex` (comma-separated) | Target AI platforms to configure |
|
|
86
|
-
| `--guidance` | `secure-defaults`, `accessibility`, `api-conventions` (comma-separated) | Guidance layers to install |
|
|
87
|
-
| `--yes` | (flag, no value) | Skip all confirmation prompts |
|
|
88
|
-
|
|
89
|
-
When `--yes` is provided, setup completes without interactive prompts or manual file editing.
|
|
90
|
-
|
|
91
|
-
## Post-Install: Discovery (Brownfield Projects)
|
|
92
|
-
|
|
93
|
-
For existing codebases, run discovery to generate project context:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
npx @rasensio/aidlc discover
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
This scans the codebase and generates context documents in `.aidlc/context/` covering coding style and architecture. AI agents reference these docs during all lifecycle phases.
|
|
100
|
-
|
|
101
|
-
Non-interactive mode (overwrites existing docs without prompting):
|
|
102
|
-
|
|
103
|
-
```bash
|
|
104
|
-
npx @rasensio/aidlc discover --yes
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Expected outputs: `.aidlc/context/style-guide.md` and `.aidlc/context/architecture.md`.
|
|
108
|
-
|
|
109
|
-
## Architecture
|
|
110
|
-
|
|
111
|
-
### Directory Layout
|
|
20
|
+
Then work from your AI coding tool. In Claude Code, invoke the entry point:
|
|
112
21
|
|
|
113
22
|
```
|
|
114
|
-
aidlc
|
|
115
|
-
├── skills/ # Universal skill definitions (platform-agnostic)
|
|
116
|
-
├── capabilities/ # Per-platform capability maps (YAML)
|
|
117
|
-
├── templates/ # Built-in workflow templates
|
|
118
|
-
├── guidance/ # Built-in guidance layers
|
|
119
|
-
├── src/
|
|
120
|
-
│ ├── cli.ts # CLI entry (commander wiring)
|
|
121
|
-
│ ├── commands/ # One module per CLI verb
|
|
122
|
-
│ ├── core/ # Lifecycle engine (pure functions)
|
|
123
|
-
│ ├── state/ # State store, atomic writes, transition log
|
|
124
|
-
│ ├── compile/ # Skill parser, adapters, install plans
|
|
125
|
-
│ ├── discover/ # Codebase scanner
|
|
126
|
-
│ ├── events/ # Event bus, action runner
|
|
127
|
-
│ ├── orchestrator/ # Bare-endpoint orchestration
|
|
128
|
-
│ └── setup/ # Setup wizard
|
|
129
|
-
└── test/ # vitest + fast-check tests
|
|
23
|
+
/aidlc
|
|
130
24
|
```
|
|
131
25
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
| Module | Responsibility |
|
|
135
|
-
|--------|---------------|
|
|
136
|
-
| `core/lifecycle.ts` | Pure functions: `evaluateTransition`, `nextStep`, `completionPercent`, `isStalled` |
|
|
137
|
-
| `core/gate.ts` | Phase gate evaluation with exit-code semantics |
|
|
138
|
-
| `state/snapshot-store.ts` | Atomic state persistence (tmp + rename) |
|
|
139
|
-
| `state/transition-log.ts` | Append-only NDJSON transition log |
|
|
140
|
-
| `compile/adapters/` | Platform-specific install plan generators |
|
|
141
|
-
| `compile/merger.ts` | Managed-block merge (preserves surrounding content) |
|
|
142
|
-
| `events/event-bus.ts` | Lifecycle event dispatch, action/hook runner |
|
|
26
|
+
It reads your lifecycle state and offers the next actions — continue an in-progress instance, start something new, check status, or review an artifact. You can also just describe what you want ("help me fix a bug") and the matching skill activates on its own.
|
|
143
27
|
|
|
144
|
-
|
|
28
|
+
## CLI Commands
|
|
145
29
|
|
|
146
|
-
|
|
30
|
+
The CLI has two core jobs: **bootstrap** (installing and refreshing skills) and **CI enforcement** (`aidlc gate`). Lifecycle work happens inside your AI tool via skills; the runtime commands below remain available as terminal shortcuts for the same state protocol.
|
|
147
31
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
```
|
|
32
|
+
| Command | Purpose |
|
|
33
|
+
|---------|---------|
|
|
34
|
+
| `aidlc init [--platform <id>]` | Set up AIDLC: interactive wizard, or non-interactive with `--platform` |
|
|
35
|
+
| `aidlc update` | Update CLI and refresh project skills |
|
|
36
|
+
| `aidlc gate <phase>` | CI gate check (exit 0 = pass, 1 = fail) |
|
|
37
|
+
| `aidlc start [template]` | Begin a new lifecycle instance |
|
|
38
|
+
| `aidlc continue [instance]` | Resume the active instance |
|
|
39
|
+
| `aidlc status [--json]` | Show progress across active instances |
|
|
40
|
+
| `aidlc transition <instance>` | Evaluate gates and advance phase |
|
|
41
|
+
| `aidlc review <artifact>` | Adversarial review of an artifact |
|
|
42
|
+
| `aidlc discover` | Scan codebase, generate context docs |
|
|
43
|
+
| `aidlc docs` | Generate onboarding documentation |
|
|
161
44
|
|
|
162
45
|
## Supported Platforms
|
|
163
46
|
|
|
164
47
|
| Platform | Config Location | Strategy |
|
|
165
48
|
|----------|----------------|----------|
|
|
166
|
-
| Claude Code | `.claude/skills/aidlc-*/SKILL.md` | Thin activation shims
|
|
167
|
-
| Kiro | `.kiro/skills/aidlc-*/SKILL.md` + steering |
|
|
168
|
-
| Cursor | `.cursor/rules/aidlc-*.mdc` |
|
|
169
|
-
| Windsurf | `.windsurf/rules/aidlc-*.md` | Size-constrained pointer shims
|
|
170
|
-
| Codex | `AGENTS.md`
|
|
49
|
+
| Claude Code | `.claude/skills/aidlc-*/SKILL.md` | Thin activation shims |
|
|
50
|
+
| Kiro | `.kiro/skills/aidlc-*/SKILL.md` + steering | Shims + steering file |
|
|
51
|
+
| Cursor | `.cursor/rules/aidlc-*.mdc` | Description-based rules |
|
|
52
|
+
| Windsurf | `.windsurf/rules/aidlc-*.md` | Size-constrained pointer shims |
|
|
53
|
+
| Codex | `AGENTS.md` | Managed delimiter block |
|
|
171
54
|
|
|
172
|
-
|
|
55
|
+
## How It Works
|
|
173
56
|
|
|
174
|
-
|
|
57
|
+
1. **Install** — `aidlc init` creates a `.aidlc/` directory with skills and configuration, compiled for your platform
|
|
58
|
+
2. **Pick a template** — full features, quick tasks, bug fixes, or spikes
|
|
59
|
+
3. **Your AI follows the lifecycle** — skills activate in each phase, and the agent manages state directly in `.aidlc/state/` (plain YAML)
|
|
60
|
+
4. **Gates enforce quality** — phase transitions require artifacts to be complete; `aidlc gate` gives CI the same check
|
|
175
61
|
|
|
176
|
-
|
|
177
|
-
|-------|---------|
|
|
178
|
-
| Ideation | Explore and validate ideas, identify alternatives |
|
|
179
|
-
| Requirements | Define acceptance criteria, scope, and constraints |
|
|
180
|
-
| Design | Produce architecture and technical design documents |
|
|
181
|
-
| Implementation | Write code following established conventions |
|
|
182
|
-
| Testing | Validate correctness and coverage |
|
|
183
|
-
| Deployment | Release to target environment |
|
|
184
|
-
| Maintenance | Monitor, patch, and evolve |
|
|
185
|
-
|
|
186
|
-
Phase applicability depends on the cycle scope: Full (all phases), Standard (Requirements through Deployment), Micro (Implementation + Testing only).
|
|
187
|
-
|
|
188
|
-
## CLI Commands
|
|
189
|
-
|
|
190
|
-
| Command | Purpose |
|
|
191
|
-
|---------|---------|
|
|
192
|
-
| `aidlc update` | Update CLI and refresh project skills |
|
|
193
|
-
| `aidlc setup` | Interactive setup or update of project configuration |
|
|
194
|
-
| `aidlc discover` | Scan codebase, generate style and architecture context |
|
|
195
|
-
| `aidlc init --platform <id>` | Install skills for a target AI platform |
|
|
196
|
-
| `aidlc start [template]` | Begin a new lifecycle instance |
|
|
197
|
-
| `aidlc continue [instance]` | Resume the active lifecycle instance |
|
|
198
|
-
| `aidlc status [--json]` | Show progress across active instances |
|
|
199
|
-
| `aidlc review <artifact\|phase>` | Adversarial review of a lifecycle artifact |
|
|
200
|
-
| `aidlc gate <phase>` | CI gate check (exit 0 = complete, exit 1 = incomplete) |
|
|
201
|
-
| `aidlc transition <instance>` | Evaluate gates and advance to the next phase |
|
|
202
|
-
| `aidlc add action "<description>"` | Create a lifecycle action from natural language |
|
|
203
|
-
| `aidlc run [--endpoint <url>]` | Drive a bare LLM endpoint through the lifecycle |
|
|
204
|
-
|
|
205
|
-
### Dry-Run Mode
|
|
62
|
+
## Non-Interactive Setup
|
|
206
63
|
|
|
207
|
-
|
|
64
|
+
For CI or AI-agent-driven setup:
|
|
208
65
|
|
|
209
66
|
```bash
|
|
210
|
-
|
|
67
|
+
# Apply defaults (or keep the existing config) without prompts
|
|
68
|
+
npx @rasensio/aidlc init --non-interactive
|
|
69
|
+
|
|
70
|
+
# Add a platform and install its skills without prompts
|
|
71
|
+
npx @rasensio/aidlc init --platform claude-code
|
|
211
72
|
```
|
|
212
73
|
|
|
213
74
|
## Configuration
|
|
@@ -219,81 +80,10 @@ version: 1
|
|
|
219
80
|
defaults: { scope: micro, template: micro-task }
|
|
220
81
|
stalled_threshold_days: 7
|
|
221
82
|
claim_timeout_minutes: 60
|
|
222
|
-
summary_threshold_bytes: 16384
|
|
223
|
-
orchestrator: # optional, only for bare-endpoint mode
|
|
224
|
-
endpoint: http://localhost:11434
|
|
225
|
-
model: qwen2.5-coder
|
|
226
|
-
api_format: ollama # ollama | openai
|
|
227
|
-
auto_advance: false
|
|
228
|
-
context_budget_tokens: 8000
|
|
229
83
|
```
|
|
230
84
|
|
|
231
85
|
Without this file, AIDLC defaults to Micro scope (Implementation + Testing only).
|
|
232
86
|
|
|
233
|
-
##
|
|
234
|
-
|
|
235
|
-
### 0.4.0 (2026-08-11)
|
|
236
|
-
|
|
237
|
-
**Features**
|
|
238
|
-
|
|
239
|
-
- add monorepo, service, and other project type options
|
|
240
|
-
|
|
241
|
-
### 0.3.3 (2026-08-11)
|
|
242
|
-
|
|
243
|
-
**Other**
|
|
244
|
-
|
|
245
|
-
- add dry-run mode feedback message
|
|
246
|
-
|
|
247
|
-
### 0.3.2 (2026-08-11)
|
|
248
|
-
|
|
249
|
-
**Other**
|
|
250
|
-
|
|
251
|
-
- add /release automation (conventional commits + changelog)
|
|
252
|
-
|
|
253
|
-
### 0.3.1
|
|
254
|
-
|
|
255
|
-
**Improved setup wizard UX**
|
|
256
|
-
|
|
257
|
-
- Every interactive prompt now includes a descriptive message explaining what it controls and why it matters.
|
|
258
|
-
- All options display contextual hints: project types explain the category, complexity shows which phases activate, platforms list the config file they generate, templates show the full phase flow, and scopes enumerate included phases.
|
|
259
|
-
- First-time users can now make informed choices without consulting external docs.
|
|
260
|
-
|
|
261
|
-
### 0.3.0
|
|
262
|
-
|
|
263
|
-
**First Activation (brownfield auto-discovery)**
|
|
264
|
-
|
|
265
|
-
- New skill: `02-first-activation.md` — when AIDLC is installed in an existing project, the AI now automatically scans the codebase on first chat interaction. It detects languages, frameworks, conventions, and directory structure, then asks the user about extra context folders (specs, roadmap, design docs, etc.) before writing context docs to `.aidlc/context/`. No terminal round-trip needed after `aidlc init`.
|
|
266
|
-
|
|
267
|
-
**`aidlc update` command**
|
|
268
|
-
|
|
269
|
-
- Self-update: detects which package manager installed AIDLC (npm, pnpm, yarn, bun), checks the npm registry for a newer version, and updates the global CLI.
|
|
270
|
-
- Project refresh: re-runs the install plan for each configured platform, updating skill shims and steering files to match the latest CLI version. Only files whose content changed are rewritten.
|
|
271
|
-
- `--self-only` — update just the CLI, skip project files
|
|
272
|
-
- `--project-only` — refresh project files from the currently installed CLI
|
|
273
|
-
- `--rediscover` — also regenerate `.aidlc/context/` docs (skipped by default to preserve manual edits)
|
|
274
|
-
- `--dry-run` — preview all changes without writing
|
|
275
|
-
|
|
276
|
-
**Getting-started skill update**
|
|
277
|
-
|
|
278
|
-
- The getting-started skill now defers to first-activation when `.aidlc/context/` doesn't exist yet, ensuring discovery runs before lifecycle guidance kicks in.
|
|
279
|
-
|
|
280
|
-
## Contributing
|
|
281
|
-
|
|
282
|
-
### Build and Test
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
npm install
|
|
286
|
-
npm run build
|
|
287
|
-
npm test
|
|
288
|
-
npm run lint
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Tests use vitest (unit + integration) and fast-check (property-based, 14 correctness properties, 100+ iterations each).
|
|
292
|
-
|
|
293
|
-
### Project Conventions
|
|
87
|
+
## License
|
|
294
88
|
|
|
295
|
-
|
|
296
|
-
- Pure-function core (no I/O) with I/O pushed to edges
|
|
297
|
-
- Exact-pinned dependencies (no ranges)
|
|
298
|
-
- Property-based tests for core logic, golden-file tests for adapter output
|
|
299
|
-
- Deterministic state serialization (stable key order, block YAML style)
|
|
89
|
+
[MIT](https://github.com/rasensio/aidlc/blob/main/LICENSE)
|
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,6 @@ import { registerStatus } from './commands/status.js';
|
|
|
15
15
|
import { registerGate } from './commands/gate.js';
|
|
16
16
|
import { registerTransition } from './commands/transition.js';
|
|
17
17
|
import { registerDiscover } from './commands/discover.js';
|
|
18
|
-
import { registerSetup } from './commands/setup.js';
|
|
19
18
|
import { registerAddAction } from './commands/add-action.js';
|
|
20
19
|
import { registerDocs } from './commands/docs.js';
|
|
21
20
|
import { registerReview } from './commands/review.js';
|
|
@@ -32,7 +31,6 @@ registerStatus(program);
|
|
|
32
31
|
registerGate(program);
|
|
33
32
|
registerTransition(program);
|
|
34
33
|
registerDiscover(program);
|
|
35
|
-
registerSetup(program);
|
|
36
34
|
registerAddAction(program);
|
|
37
35
|
registerDocs(program);
|
|
38
36
|
registerReview(program);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;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CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../src/commands/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"continue.d.ts","sourceRoot":"","sources":["../../src/commands/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuJpC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CASvD"}
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { Command } from 'commander';
|
|
19
19
|
import { existsSync, readdirSync } from 'node:fs';
|
|
20
|
-
import { join
|
|
21
|
-
import {
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { loadTemplates as loadBuiltInTemplates } from '@rasensio/aidlc-content';
|
|
22
22
|
import { nextStep } from '../core/lifecycle.js';
|
|
23
23
|
import { loadTemplates, resolveTemplate, } from '../core/template-resolver.js';
|
|
24
24
|
import { loadSnapshot, listInstanceDirs } from '../state/snapshot-store.js';
|
|
@@ -26,19 +26,16 @@ import { loadSnapshot, listInstanceDirs } from '../state/snapshot-store.js';
|
|
|
26
26
|
// Helpers
|
|
27
27
|
// ---------------------------------------------------------------------------
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Load all templates: built-in from @rasensio/aidlc-content + custom from the project.
|
|
30
30
|
*/
|
|
31
|
-
function
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function loadAllTemplates(packageRoot, projectRoot) {
|
|
39
|
-
const builtInDir = join(packageRoot, 'templates');
|
|
31
|
+
function loadAllTemplates(projectRoot) {
|
|
32
|
+
const builtInContent = loadBuiltInTemplates();
|
|
33
|
+
const templates = new Map();
|
|
34
|
+
for (const tpl of builtInContent) {
|
|
35
|
+
const cliTemplate = tpl.raw;
|
|
36
|
+
templates.set(tpl.name, cliTemplate);
|
|
37
|
+
}
|
|
40
38
|
const customDir = join(projectRoot, '.aidlc', 'templates');
|
|
41
|
-
const templates = loadTemplates(builtInDir);
|
|
42
39
|
if (existsSync(customDir)) {
|
|
43
40
|
const custom = loadTemplates(customDir);
|
|
44
41
|
for (const [name, tpl] of custom) {
|
|
@@ -160,7 +157,6 @@ export function registerContinue(program) {
|
|
|
160
157
|
// Core logic
|
|
161
158
|
// ---------------------------------------------------------------------------
|
|
162
159
|
async function runContinue(instanceArg, opts) {
|
|
163
|
-
const packageRoot = getPackageRoot();
|
|
164
160
|
const projectRoot = process.cwd();
|
|
165
161
|
const stateDir = join(projectRoot, '.aidlc', 'state');
|
|
166
162
|
// List all instances
|
|
@@ -206,7 +202,7 @@ async function runContinue(instanceArg, opts) {
|
|
|
206
202
|
// Load phase states
|
|
207
203
|
const phaseStates = loadPhaseStates(stateDir, targetInstance);
|
|
208
204
|
// Load and resolve template
|
|
209
|
-
const allTemplates = loadAllTemplates(
|
|
205
|
+
const allTemplates = loadAllTemplates(projectRoot);
|
|
210
206
|
const rawTemplate = allTemplates.get(instanceState.template);
|
|
211
207
|
if (!rawTemplate) {
|
|
212
208
|
process.stderr.write(`Error: template '${instanceState.template}' not found.\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"continue.js","sourceRoot":"","sources":["../../src/commands/continue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"continue.js","sourceRoot":"","sources":["../../src/commands/continue.ts"],"names":[],"mappings":"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,GAAG,eAAe,CAAC,cAAc,EAAE,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;QAChF,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAsE7E;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACxC,UAAU,EAAE,MAAM,EAAE,EACpB,cAAc,EAAE,kBAAkB,EAAE,GACnC,MAAM,CA2JR;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAOnD"}
|
package/dist/commands/docs.js
CHANGED
|
@@ -13,28 +13,25 @@
|
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
import { Command } from 'commander';
|
|
16
|
-
import { existsSync, mkdirSync, writeFileSync,
|
|
17
|
-
import { join
|
|
18
|
-
import { fileURLToPath } from 'node:url';
|
|
16
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
17
|
+
import { join } from 'node:path';
|
|
19
18
|
import { parse as parseYaml } from 'yaml';
|
|
19
|
+
import { loadTemplates as loadBuiltInTemplates, loadSkills as loadBuiltInSkills, loadGuidance as loadBuiltInGuidance, } from '@rasensio/aidlc-content';
|
|
20
20
|
import { loadTemplates, resolveTemplate } from '../core/template-resolver.js';
|
|
21
21
|
// ---------------------------------------------------------------------------
|
|
22
22
|
// Helpers
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Load all templates: built-in from @rasensio/aidlc-content + custom from the project.
|
|
26
26
|
*/
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function loadAllTemplates(packageRoot, projectRoot) {
|
|
35
|
-
const builtInDir = join(packageRoot, 'templates');
|
|
27
|
+
function loadAllTemplates(projectRoot) {
|
|
28
|
+
const builtInContent = loadBuiltInTemplates();
|
|
29
|
+
const templates = new Map();
|
|
30
|
+
for (const tpl of builtInContent) {
|
|
31
|
+
const cliTemplate = tpl.raw;
|
|
32
|
+
templates.set(tpl.name, cliTemplate);
|
|
33
|
+
}
|
|
36
34
|
const customDir = join(projectRoot, '.aidlc', 'templates');
|
|
37
|
-
const templates = loadTemplates(builtInDir);
|
|
38
35
|
if (existsSync(customDir)) {
|
|
39
36
|
const custom = loadTemplates(customDir);
|
|
40
37
|
for (const [name, tpl] of custom) {
|
|
@@ -44,41 +41,38 @@ function loadAllTemplates(packageRoot, projectRoot) {
|
|
|
44
41
|
return templates;
|
|
45
42
|
}
|
|
46
43
|
/**
|
|
47
|
-
* Load skill names from the
|
|
44
|
+
* Load skill names from the content package.
|
|
48
45
|
*/
|
|
49
|
-
function loadSkillNames(
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
return readdirSync(skillsDir)
|
|
55
|
-
.filter((f) => f.endsWith('.md'))
|
|
56
|
-
.sort()
|
|
57
|
-
.map((f) => f.replace(/\.md$/, ''));
|
|
46
|
+
function loadSkillNames() {
|
|
47
|
+
const skills = loadBuiltInSkills();
|
|
48
|
+
return skills.map(s => s.filename.replace(/\.md$/, ''));
|
|
58
49
|
}
|
|
59
50
|
/**
|
|
60
|
-
* Load guidance layer entries from the project or package
|
|
51
|
+
* Load guidance layer entries from the project or content package.
|
|
61
52
|
*/
|
|
62
|
-
function loadGuidanceEntries(projectRoot
|
|
53
|
+
function loadGuidanceEntries(projectRoot) {
|
|
63
54
|
// First try project-level guidance
|
|
64
55
|
const projectIndex = join(projectRoot, '.aidlc', 'guidance', 'index.yaml');
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
56
|
+
if (existsSync(projectIndex)) {
|
|
57
|
+
try {
|
|
58
|
+
const raw = readFileSync(projectIndex, 'utf8');
|
|
59
|
+
const data = parseYaml(raw);
|
|
60
|
+
if (data && Array.isArray(data.layers)) {
|
|
61
|
+
return data.layers;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
// Ignore parse errors — guidance is optional
|
|
66
|
+
}
|
|
70
67
|
}
|
|
68
|
+
// Fall back to content package guidance
|
|
71
69
|
try {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
if (data && Array.isArray(data.layers)) {
|
|
75
|
-
return data.layers;
|
|
76
|
-
}
|
|
70
|
+
const guidance = loadBuiltInGuidance();
|
|
71
|
+
return guidance.map(g => ({ name: g.name, file: g.filename }));
|
|
77
72
|
}
|
|
78
73
|
catch {
|
|
79
|
-
|
|
74
|
+
return [];
|
|
80
75
|
}
|
|
81
|
-
return [];
|
|
82
76
|
}
|
|
83
77
|
// ---------------------------------------------------------------------------
|
|
84
78
|
// Content generation
|
|
@@ -253,10 +247,9 @@ export function registerDocs(program) {
|
|
|
253
247
|
// Core logic
|
|
254
248
|
// ---------------------------------------------------------------------------
|
|
255
249
|
async function runDocs() {
|
|
256
|
-
const packageRoot = getPackageRoot();
|
|
257
250
|
const projectRoot = process.cwd();
|
|
258
251
|
// Load templates
|
|
259
|
-
const templates = loadAllTemplates(
|
|
252
|
+
const templates = loadAllTemplates(projectRoot);
|
|
260
253
|
if (templates.size === 0) {
|
|
261
254
|
process.stderr.write('Error: no workflow templates found. Cannot generate documentation.\n' +
|
|
262
255
|
'Ensure the package templates/ directory exists or add custom templates to .aidlc/templates/.\n');
|
|
@@ -264,9 +257,9 @@ async function runDocs() {
|
|
|
264
257
|
return;
|
|
265
258
|
}
|
|
266
259
|
// Load skill names
|
|
267
|
-
const skillNames = loadSkillNames(
|
|
260
|
+
const skillNames = loadSkillNames();
|
|
268
261
|
// Load guidance layers
|
|
269
|
-
const guidanceLayers = loadGuidanceEntries(projectRoot
|
|
262
|
+
const guidanceLayers = loadGuidanceEntries(projectRoot);
|
|
270
263
|
// Generate content
|
|
271
264
|
const content = generateOnboardingContent(templates, skillNames, guidanceLayers);
|
|
272
265
|
// Ensure .aidlc/ directory exists
|