@rasensio/aidlc 0.1.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.
Files changed (187) hide show
  1. package/README.md +251 -0
  2. package/capabilities/claude-code.yaml +9 -0
  3. package/capabilities/codex.yaml +8 -0
  4. package/capabilities/cursor.yaml +8 -0
  5. package/capabilities/kiro.yaml +9 -0
  6. package/capabilities/windsurf.yaml +8 -0
  7. package/ci/aidlc-gate.yml +100 -0
  8. package/dist/cli.d.ts +11 -0
  9. package/dist/cli.d.ts.map +1 -0
  10. package/dist/cli.js +39 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/commands/add-action.d.ts +83 -0
  13. package/dist/commands/add-action.d.ts.map +1 -0
  14. package/dist/commands/add-action.js +437 -0
  15. package/dist/commands/add-action.js.map +1 -0
  16. package/dist/commands/continue.d.ts +23 -0
  17. package/dist/commands/continue.d.ts.map +1 -0
  18. package/dist/commands/continue.js +238 -0
  19. package/dist/commands/continue.js.map +1 -0
  20. package/dist/commands/discover.d.ts +19 -0
  21. package/dist/commands/discover.d.ts.map +1 -0
  22. package/dist/commands/discover.js +85 -0
  23. package/dist/commands/discover.js.map +1 -0
  24. package/dist/commands/docs.d.ts +25 -0
  25. package/dist/commands/docs.d.ts.map +1 -0
  26. package/dist/commands/docs.js +282 -0
  27. package/dist/commands/docs.js.map +1 -0
  28. package/dist/commands/gate.d.ts +25 -0
  29. package/dist/commands/gate.d.ts.map +1 -0
  30. package/dist/commands/gate.js +168 -0
  31. package/dist/commands/gate.js.map +1 -0
  32. package/dist/commands/init.d.ts +24 -0
  33. package/dist/commands/init.d.ts.map +1 -0
  34. package/dist/commands/init.js +187 -0
  35. package/dist/commands/init.js.map +1 -0
  36. package/dist/commands/review.d.ts +60 -0
  37. package/dist/commands/review.d.ts.map +1 -0
  38. package/dist/commands/review.js +264 -0
  39. package/dist/commands/review.js.map +1 -0
  40. package/dist/commands/setup.d.ts +24 -0
  41. package/dist/commands/setup.d.ts.map +1 -0
  42. package/dist/commands/setup.js +206 -0
  43. package/dist/commands/setup.js.map +1 -0
  44. package/dist/commands/start.d.ts +27 -0
  45. package/dist/commands/start.d.ts.map +1 -0
  46. package/dist/commands/start.js +243 -0
  47. package/dist/commands/start.js.map +1 -0
  48. package/dist/commands/status.d.ts +25 -0
  49. package/dist/commands/status.d.ts.map +1 -0
  50. package/dist/commands/status.js +263 -0
  51. package/dist/commands/status.js.map +1 -0
  52. package/dist/commands/transition.d.ts +30 -0
  53. package/dist/commands/transition.d.ts.map +1 -0
  54. package/dist/commands/transition.js +353 -0
  55. package/dist/commands/transition.js.map +1 -0
  56. package/dist/compile/adapters/claude-code.d.ts +24 -0
  57. package/dist/compile/adapters/claude-code.d.ts.map +1 -0
  58. package/dist/compile/adapters/claude-code.js +271 -0
  59. package/dist/compile/adapters/claude-code.js.map +1 -0
  60. package/dist/compile/adapters/codex.d.ts +19 -0
  61. package/dist/compile/adapters/codex.d.ts.map +1 -0
  62. package/dist/compile/adapters/codex.js +157 -0
  63. package/dist/compile/adapters/codex.js.map +1 -0
  64. package/dist/compile/adapters/cursor.d.ts +21 -0
  65. package/dist/compile/adapters/cursor.d.ts.map +1 -0
  66. package/dist/compile/adapters/cursor.js +181 -0
  67. package/dist/compile/adapters/cursor.js.map +1 -0
  68. package/dist/compile/adapters/index.d.ts +16 -0
  69. package/dist/compile/adapters/index.d.ts.map +1 -0
  70. package/dist/compile/adapters/index.js +26 -0
  71. package/dist/compile/adapters/index.js.map +1 -0
  72. package/dist/compile/adapters/kiro.d.ts +24 -0
  73. package/dist/compile/adapters/kiro.d.ts.map +1 -0
  74. package/dist/compile/adapters/kiro.js +222 -0
  75. package/dist/compile/adapters/kiro.js.map +1 -0
  76. package/dist/compile/adapters/windsurf.d.ts +25 -0
  77. package/dist/compile/adapters/windsurf.d.ts.map +1 -0
  78. package/dist/compile/adapters/windsurf.js +242 -0
  79. package/dist/compile/adapters/windsurf.js.map +1 -0
  80. package/dist/compile/install-plan.d.ts +49 -0
  81. package/dist/compile/install-plan.d.ts.map +1 -0
  82. package/dist/compile/install-plan.js +112 -0
  83. package/dist/compile/install-plan.js.map +1 -0
  84. package/dist/compile/loaders.d.ts +81 -0
  85. package/dist/compile/loaders.d.ts.map +1 -0
  86. package/dist/compile/loaders.js +293 -0
  87. package/dist/compile/loaders.js.map +1 -0
  88. package/dist/compile/merger.d.ts +32 -0
  89. package/dist/compile/merger.d.ts.map +1 -0
  90. package/dist/compile/merger.js +60 -0
  91. package/dist/compile/merger.js.map +1 -0
  92. package/dist/core/gate.d.ts +36 -0
  93. package/dist/core/gate.d.ts.map +1 -0
  94. package/dist/core/gate.js +97 -0
  95. package/dist/core/gate.js.map +1 -0
  96. package/dist/core/index.d.ts +7 -0
  97. package/dist/core/index.d.ts.map +1 -0
  98. package/dist/core/index.js +7 -0
  99. package/dist/core/index.js.map +1 -0
  100. package/dist/core/lifecycle.d.ts +89 -0
  101. package/dist/core/lifecycle.d.ts.map +1 -0
  102. package/dist/core/lifecycle.js +356 -0
  103. package/dist/core/lifecycle.js.map +1 -0
  104. package/dist/core/template-resolver.d.ts +56 -0
  105. package/dist/core/template-resolver.d.ts.map +1 -0
  106. package/dist/core/template-resolver.js +261 -0
  107. package/dist/core/template-resolver.js.map +1 -0
  108. package/dist/core/types.d.ts +527 -0
  109. package/dist/core/types.d.ts.map +1 -0
  110. package/dist/core/types.js +8 -0
  111. package/dist/core/types.js.map +1 -0
  112. package/dist/discover/scanner.d.ts +58 -0
  113. package/dist/discover/scanner.d.ts.map +1 -0
  114. package/dist/discover/scanner.js +772 -0
  115. package/dist/discover/scanner.js.map +1 -0
  116. package/dist/events/event-bus.d.ts +53 -0
  117. package/dist/events/event-bus.d.ts.map +1 -0
  118. package/dist/events/event-bus.js +263 -0
  119. package/dist/events/event-bus.js.map +1 -0
  120. package/dist/events/plugin-hooks.d.ts +44 -0
  121. package/dist/events/plugin-hooks.d.ts.map +1 -0
  122. package/dist/events/plugin-hooks.js +225 -0
  123. package/dist/events/plugin-hooks.js.map +1 -0
  124. package/dist/orchestrator/budget-packer.d.ts +57 -0
  125. package/dist/orchestrator/budget-packer.d.ts.map +1 -0
  126. package/dist/orchestrator/budget-packer.js +70 -0
  127. package/dist/orchestrator/budget-packer.js.map +1 -0
  128. package/dist/orchestrator/config.d.ts +43 -0
  129. package/dist/orchestrator/config.d.ts.map +1 -0
  130. package/dist/orchestrator/config.js +109 -0
  131. package/dist/orchestrator/config.js.map +1 -0
  132. package/dist/orchestrator/endpoint-clients.d.ts +23 -0
  133. package/dist/orchestrator/endpoint-clients.d.ts.map +1 -0
  134. package/dist/orchestrator/endpoint-clients.js +129 -0
  135. package/dist/orchestrator/endpoint-clients.js.map +1 -0
  136. package/dist/orchestrator/orchestrator-loop.d.ts +93 -0
  137. package/dist/orchestrator/orchestrator-loop.d.ts.map +1 -0
  138. package/dist/orchestrator/orchestrator-loop.js +185 -0
  139. package/dist/orchestrator/orchestrator-loop.js.map +1 -0
  140. package/dist/security/confirmation.d.ts +90 -0
  141. package/dist/security/confirmation.d.ts.map +1 -0
  142. package/dist/security/confirmation.js +140 -0
  143. package/dist/security/confirmation.js.map +1 -0
  144. package/dist/setup/setup-compute.d.ts +54 -0
  145. package/dist/setup/setup-compute.d.ts.map +1 -0
  146. package/dist/setup/setup-compute.js +66 -0
  147. package/dist/setup/setup-compute.js.map +1 -0
  148. package/dist/state/snapshot-store.d.ts +79 -0
  149. package/dist/state/snapshot-store.d.ts.map +1 -0
  150. package/dist/state/snapshot-store.js +164 -0
  151. package/dist/state/snapshot-store.js.map +1 -0
  152. package/dist/state/state-recovery.d.ts +87 -0
  153. package/dist/state/state-recovery.d.ts.map +1 -0
  154. package/dist/state/state-recovery.js +274 -0
  155. package/dist/state/state-recovery.js.map +1 -0
  156. package/dist/state/transition-log.d.ts +40 -0
  157. package/dist/state/transition-log.d.ts.map +1 -0
  158. package/dist/state/transition-log.js +83 -0
  159. package/dist/state/transition-log.js.map +1 -0
  160. package/dist/state/yaml-helpers.d.ts +53 -0
  161. package/dist/state/yaml-helpers.d.ts.map +1 -0
  162. package/dist/state/yaml-helpers.js +110 -0
  163. package/dist/state/yaml-helpers.js.map +1 -0
  164. package/examples/.gitkeep +0 -0
  165. package/guidance/accessibility.md +67 -0
  166. package/guidance/api-conventions.md +124 -0
  167. package/guidance/index.yaml +7 -0
  168. package/guidance/secure-defaults.md +71 -0
  169. package/package.json +52 -0
  170. package/phases/.gitkeep +0 -0
  171. package/skills/00-overview.md +74 -0
  172. package/skills/10-ideation.md +45 -0
  173. package/skills/20-requirements.md +54 -0
  174. package/skills/30-design.md +57 -0
  175. package/skills/40-implementation.md +64 -0
  176. package/skills/50-testing.md +60 -0
  177. package/skills/60-deployment.md +63 -0
  178. package/skills/70-maintenance.md +56 -0
  179. package/skills/80-review.md +85 -0
  180. package/skills/81-continue.md +57 -0
  181. package/skills/82-add-action.md +71 -0
  182. package/templates/.gitkeep +0 -0
  183. package/templates/bugfix.yaml +14 -0
  184. package/templates/full-feature.yaml +44 -0
  185. package/templates/micro-task.yaml +11 -0
  186. package/templates/quick-feature.yaml +20 -0
  187. package/templates/spike.yaml +15 -0
package/README.md ADDED
@@ -0,0 +1,251 @@
1
+ # AIDLC — AI Development Lifecycle Framework
2
+
3
+ Structured lifecycle guidance for AI coding agents across platforms. One set of skills, every major AI coding tool.
4
+
5
+ ## Prerequisites
6
+
7
+ ```bash
8
+ # Verify Node.js >= 18
9
+ node --version
10
+ ```
11
+
12
+ ```bash
13
+ # Verify npm
14
+ npm --version
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ### Install and initialize
20
+
21
+ ```bash
22
+ # Install globally (or use npx without installing)
23
+ npm install -g @rasensio/aidlc
24
+ ```
25
+
26
+ ```bash
27
+ # platform: claude-code
28
+ npx @rasensio/aidlc init --platform claude-code
29
+ ```
30
+
31
+ ```bash
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
112
+
113
+ ```
114
+ aidlc/ # npm package
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
130
+ ```
131
+
132
+ ### Key Modules
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 |
143
+
144
+ ### Installed Project Layout
145
+
146
+ After `aidlc init`, the target project gains:
147
+
148
+ ```
149
+ project/
150
+ ├── .aidlc/
151
+ │ ├── config.yaml # Project configuration (optional)
152
+ │ ├── actions.yaml # Lifecycle event actions (opt-in)
153
+ │ ├── skills/ # Canonical skill bodies
154
+ │ ├── context/ # style-guide.md, architecture.md
155
+ │ ├── guidance/ # Active guidance layers + index.yaml
156
+ │ ├── templates/ # Custom workflow templates
157
+ │ ├── plugins/ # Extensions
158
+ │ └── state/<instance>/ # Per-instance lifecycle state
159
+ └── (platform configs: .claude/ .kiro/ .cursor/ .windsurf/ AGENTS.md)
160
+ ```
161
+
162
+ ## Supported Platforms
163
+
164
+ | Platform | Config Location | Strategy |
165
+ |----------|----------------|----------|
166
+ | Claude Code | `.claude/skills/aidlc-*/SKILL.md` | Thin activation shims pointing to `.aidlc/skills/` |
167
+ | Kiro | `.kiro/skills/aidlc-*/SKILL.md` + steering | Activation shims + always-included steering file |
168
+ | Cursor | `.cursor/rules/aidlc-*.mdc` | Agent-requested rules with description-based activation |
169
+ | Windsurf | `.windsurf/rules/aidlc-*.md` | Size-constrained pointer shims (under 6K/file) |
170
+ | Codex | `AGENTS.md` (managed block) | Managed delimiter block within existing AGENTS.md |
171
+
172
+ Each adapter installs canonical skill bodies into `.aidlc/skills/` and generates native platform shims that reference them. Existing non-AIDLC configuration is preserved.
173
+
174
+ ## Lifecycle Phases
175
+
176
+ | Phase | Purpose |
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 setup` | Interactive setup or update of project configuration |
193
+ | `aidlc discover` | Scan codebase, generate style and architecture context |
194
+ | `aidlc init --platform <id>` | Install skills for a target AI platform |
195
+ | `aidlc start [template]` | Begin a new lifecycle instance |
196
+ | `aidlc continue [instance]` | Resume the active lifecycle instance |
197
+ | `aidlc status [--json]` | Show progress across active instances |
198
+ | `aidlc review <artifact\|phase>` | Adversarial review of a lifecycle artifact |
199
+ | `aidlc gate <phase>` | CI gate check (exit 0 = complete, exit 1 = incomplete) |
200
+ | `aidlc transition <instance>` | Evaluate gates and advance to the next phase |
201
+ | `aidlc add action "<description>"` | Create a lifecycle action from natural language |
202
+ | `aidlc run [--endpoint <url>]` | Drive a bare LLM endpoint through the lifecycle |
203
+
204
+ ### Dry-Run Mode
205
+
206
+ Preview what `init` would write without changing files:
207
+
208
+ ```bash
209
+ npx @rasensio/aidlc init --platform claude-code --dry-run
210
+ ```
211
+
212
+ ## Configuration
213
+
214
+ Project configuration lives in `.aidlc/config.yaml`:
215
+
216
+ ```yaml
217
+ version: 1
218
+ defaults: { scope: micro, template: micro-task }
219
+ stalled_threshold_days: 7
220
+ claim_timeout_minutes: 60
221
+ summary_threshold_bytes: 16384
222
+ orchestrator: # optional, only for bare-endpoint mode
223
+ endpoint: http://localhost:11434
224
+ model: qwen2.5-coder
225
+ api_format: ollama # ollama | openai
226
+ auto_advance: false
227
+ context_budget_tokens: 8000
228
+ ```
229
+
230
+ Without this file, AIDLC defaults to Micro scope (Implementation + Testing only).
231
+
232
+ ## Contributing
233
+
234
+ ### Build and Test
235
+
236
+ ```bash
237
+ npm install
238
+ npm run build
239
+ npm test
240
+ npm run lint
241
+ ```
242
+
243
+ Tests use vitest (unit + integration) and fast-check (property-based, 14 correctness properties, 100+ iterations each).
244
+
245
+ ### Project Conventions
246
+
247
+ - TypeScript, ES modules, Node >= 18
248
+ - Pure-function core (no I/O) with I/O pushed to edges
249
+ - Exact-pinned dependencies (no ranges)
250
+ - Property-based tests for core logic, golden-file tests for adapter output
251
+ - Deterministic state serialization (stable key order, block YAML style)
@@ -0,0 +1,9 @@
1
+ platform: claude-code
2
+ capabilities:
3
+ plan-mode:
4
+ phases: [ideation, requirements, design]
5
+ activation: >-
6
+ Before producing this phase's artifact, enter plan mode to reason through
7
+ the problem space, identify constraints, and outline the approach before
8
+ committing to a structure. Exit plan mode only when you begin writing the
9
+ artifact.
@@ -0,0 +1,8 @@
1
+ platform: codex
2
+ capabilities:
3
+ code-generation:
4
+ phases: [implementation, testing]
5
+ activation: >-
6
+ Leverage Codex sandboxed execution for this phase. Write implementation
7
+ code and tests together, using the sandbox to validate that tests pass
8
+ before proposing the final changeset.
@@ -0,0 +1,8 @@
1
+ platform: cursor
2
+ capabilities:
3
+ composer:
4
+ phases: [design, implementation]
5
+ activation: >-
6
+ Use Cursor Composer for this phase to coordinate multi-file edits in a
7
+ single operation. Frame the design or implementation as a Composer prompt
8
+ describing the desired end state across all affected files.
@@ -0,0 +1,9 @@
1
+ platform: kiro
2
+ capabilities:
3
+ spec-driven-development:
4
+ phases: [requirements, design, implementation]
5
+ activation: >-
6
+ Use Kiro spec sessions for this phase. Keep spec documents under
7
+ .kiro/specs/ and let the spec workflow drive requirements, design
8
+ decisions, and task breakdown. Reference the active spec when producing
9
+ artifacts so that traceability is maintained.
@@ -0,0 +1,8 @@
1
+ platform: windsurf
2
+ capabilities:
3
+ cascade:
4
+ phases: [implementation]
5
+ activation: >-
6
+ Use Windsurf Cascade flows for implementation steps that span multiple
7
+ files. Keep individual instructions concise due to context-size
8
+ constraints; reference .aidlc/skills/ for full phase guidance when needed.
@@ -0,0 +1,100 @@
1
+ # =============================================================================
2
+ # AIDLC Gate Check — GitHub Actions Workflow (sample/reference)
3
+ # =============================================================================
4
+ #
5
+ # This is a SAMPLE workflow demonstrating how to integrate `aidlc gate` into a
6
+ # CI/CD pipeline. Customize it for your project's branching strategy, instance
7
+ # naming, and phase requirements.
8
+ #
9
+ # Exit code semantics:
10
+ # 0 = phase is complete (gate passes, deployment may proceed)
11
+ # 1 = phase is incomplete (gate fails, deployment blocked)
12
+ #
13
+ # The --json flag outputs a structured GateCheckResult object:
14
+ # { pass, phase, missingArtifacts, unsatisfiedCriteria }
15
+ #
16
+ # Requirements: 9.5
17
+ # =============================================================================
18
+
19
+ name: AIDLC Gate Check
20
+
21
+ on:
22
+ pull_request:
23
+ branches: [main]
24
+
25
+ # ---------------------------------------------------------------------------
26
+ # Customization points:
27
+ #
28
+ # 1. AIDLC_INSTANCE — how you derive the lifecycle instance name.
29
+ # Below we use the PR title, but you could use branch name, a label, etc.
30
+ #
31
+ # 2. AIDLC_PHASE — which phase must be complete before merging.
32
+ # Common choices: "testing" (pre-merge), "deployment" (pre-deploy).
33
+ #
34
+ # 3. Node version — must be >= 18 (AIDLC prerequisite).
35
+ # ---------------------------------------------------------------------------
36
+
37
+ jobs:
38
+ gate:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - uses: actions/setup-node@v4
44
+ with:
45
+ node-version: '20'
46
+
47
+ - run: npm ci
48
+
49
+ # -----------------------------------------------------------------------
50
+ # Run the gate check.
51
+ # Exit code 0 means the phase is complete; exit code 1 means it is not.
52
+ # The --json flag produces structured output for downstream steps.
53
+ # -----------------------------------------------------------------------
54
+ - name: Check lifecycle gate
55
+ id: gate
56
+ run: |
57
+ set +e
58
+ OUTPUT=$(npx aidlc gate "$AIDLC_INSTANCE" "$AIDLC_PHASE" --json)
59
+ EXIT_CODE=$?
60
+ echo "$OUTPUT"
61
+ echo "result<<EOF" >> "$GITHUB_OUTPUT"
62
+ echo "$OUTPUT" >> "$GITHUB_OUTPUT"
63
+ echo "EOF" >> "$GITHUB_OUTPUT"
64
+ echo "exit_code=$EXIT_CODE" >> "$GITHUB_OUTPUT"
65
+ exit $EXIT_CODE
66
+ env:
67
+ AIDLC_INSTANCE: ${{ github.event.pull_request.title }}
68
+ AIDLC_PHASE: implementation
69
+
70
+ # -----------------------------------------------------------------------
71
+ # Optional: post gate results as a PR comment.
72
+ # Requires the `pull-requests: write` permission on the workflow.
73
+ # Uncomment and adapt as needed.
74
+ # -----------------------------------------------------------------------
75
+ # - name: Comment gate results on PR
76
+ # if: always()
77
+ # uses: actions/github-script@v7
78
+ # with:
79
+ # script: |
80
+ # const result = JSON.parse(`${{ steps.gate.outputs.result }}`);
81
+ # let body;
82
+ # if (result.pass) {
83
+ # body = `### ✓ AIDLC Gate Passed\n\nPhase **${result.phase}** is complete.`;
84
+ # } else {
85
+ # const missing = result.missingArtifacts.map(a => `- ${a}`).join('\n');
86
+ # const criteria = result.unsatisfiedCriteria.map(c => `- ${c}`).join('\n');
87
+ # body = [
88
+ # `### ✗ AIDLC Gate Failed`,
89
+ # ``,
90
+ # `Phase **${result.phase}** is not complete.`,
91
+ # missing ? `\n**Missing artifacts:**\n${missing}` : '',
92
+ # criteria ? `\n**Unsatisfied criteria:**\n${criteria}` : '',
93
+ # ].filter(Boolean).join('\n');
94
+ # }
95
+ # await github.rest.issues.createComment({
96
+ # owner: context.repo.owner,
97
+ # repo: context.repo.repo,
98
+ # issue_number: context.issue.number,
99
+ # body,
100
+ # });
package/dist/cli.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CLI entry point for the AIDLC Framework.
4
+ *
5
+ * Thin commander wiring — every command delegates to a module under `commands/`.
6
+ * Machine-consumable output goes to stdout, diagnostics to stderr.
7
+ *
8
+ * Requirements: 17.1
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG"}
package/dist/cli.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CLI entry point for the AIDLC Framework.
4
+ *
5
+ * Thin commander wiring — every command delegates to a module under `commands/`.
6
+ * Machine-consumable output goes to stdout, diagnostics to stderr.
7
+ *
8
+ * Requirements: 17.1
9
+ */
10
+ import { Command } from 'commander';
11
+ import { registerInit } from './commands/init.js';
12
+ import { registerStart } from './commands/start.js';
13
+ import { registerContinue } from './commands/continue.js';
14
+ import { registerStatus } from './commands/status.js';
15
+ import { registerGate } from './commands/gate.js';
16
+ import { registerTransition } from './commands/transition.js';
17
+ import { registerDiscover } from './commands/discover.js';
18
+ import { registerSetup } from './commands/setup.js';
19
+ import { registerAddAction } from './commands/add-action.js';
20
+ import { registerDocs } from './commands/docs.js';
21
+ import { registerReview } from './commands/review.js';
22
+ const program = new Command();
23
+ program
24
+ .name('aidlc')
25
+ .description('AI Development Lifecycle Framework')
26
+ .version('0.1.0');
27
+ registerInit(program);
28
+ registerStart(program);
29
+ registerContinue(program);
30
+ registerStatus(program);
31
+ registerGate(program);
32
+ registerTransition(program);
33
+ registerDiscover(program);
34
+ registerSetup(program);
35
+ registerAddAction(program);
36
+ registerDocs(program);
37
+ registerReview(program);
38
+ program.parse();
39
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +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,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,oCAAoC,CAAC;KACjD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1B,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5B,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1B,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAC3B,YAAY,CAAC,OAAO,CAAC,CAAC;AACtB,cAAc,CAAC,OAAO,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * `aidlc add action` command — AI-assisted action authoring.
3
+ *
4
+ * Translates a natural language description into a Lifecycle_Action entry
5
+ * in `.aidlc/actions.yaml`. Supports interactive confirmation, dry-run,
6
+ * and non-interactive mode.
7
+ *
8
+ * Requirements: 22.1, 22.5, 22.6, 22.7, 22.8, 22.9, 22.10, 22.11, 22.13, 20.2, 20.3
9
+ *
10
+ * @module
11
+ */
12
+ import { Command } from 'commander';
13
+ import type { LifecycleEvent, PhaseName } from '../core/types.js';
14
+ /** The inferred action declaration from a natural language description. */
15
+ export interface InferredAction {
16
+ id: string;
17
+ event: LifecycleEvent;
18
+ phase?: PhaseName | string;
19
+ use?: string;
20
+ with?: Record<string, unknown>;
21
+ run?: string;
22
+ blocking: boolean;
23
+ description: string;
24
+ }
25
+ /**
26
+ * Infer a lifecycle event from a natural language description.
27
+ *
28
+ * Rules:
29
+ * - "when starting" / "on start" → on-instance-start
30
+ * - "when entering" / "on enter" → on-phase-enter
31
+ * - "when exiting" / "on exit" / "after" → on-phase-exit
32
+ * - "when complete" / "on finish" → on-instance-complete
33
+ * - Otherwise → null (cannot infer)
34
+ */
35
+ export declare function inferEvent(description: string): LifecycleEvent | null;
36
+ /**
37
+ * Infer a phase filter from the description.
38
+ * Looks for known phase names in the text.
39
+ */
40
+ export declare function inferPhase(description: string): PhaseName | undefined;
41
+ /**
42
+ * Infer whether the action should use a built-in or a custom command.
43
+ *
44
+ * Rules:
45
+ * - "create branch" / "git branch" → use: git-branch
46
+ * - "issue" / "github" → use: github-issue
47
+ * - Otherwise → run: <description as command>
48
+ */
49
+ export declare function inferAction(description: string): {
50
+ use?: string;
51
+ with?: Record<string, unknown>;
52
+ run?: string;
53
+ };
54
+ /**
55
+ * Generate a URL-safe action ID from the description.
56
+ */
57
+ export declare function generateActionId(description: string): string;
58
+ /**
59
+ * Full inference pipeline: take a natural language description and produce
60
+ * an InferredAction. Returns `null` for the event field if it cannot be inferred.
61
+ */
62
+ export declare function inferActionFromDescription(description: string, eventOverride?: LifecycleEvent, blockingOverride?: boolean): InferredAction | {
63
+ event: null;
64
+ description: string;
65
+ };
66
+ /**
67
+ * Validate a single action entry against the ActionsConfig schema.
68
+ * Returns null if valid, or an error string describing the violation.
69
+ */
70
+ export declare function validateActionEntry(entry: InferredAction): string | null;
71
+ /**
72
+ * Append an action to the actions.yaml file (create if it doesn't exist).
73
+ */
74
+ export declare function appendAction(actionsPath: string, action: InferredAction): void;
75
+ /**
76
+ * Render an InferredAction as a YAML preview for user confirmation.
77
+ */
78
+ export declare function renderActionPreview(action: InferredAction): string;
79
+ /**
80
+ * Register the `aidlc add action` command on the given commander program.
81
+ */
82
+ export declare function registerAddAction(program: Command): void;
83
+ //# sourceMappingURL=add-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-action.d.ts","sourceRoot":"","sources":["../../src/commands/add-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,OAAO,KAAK,EAGV,cAAc,EACd,SAAS,EAEV,MAAM,kBAAkB,CAAC;AAO1B,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AA4BD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CA2DrE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQrE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAoB/G;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,cAAc,EAC9B,gBAAgB,CAAC,EAAE,OAAO,GACzB,cAAc,GAAG;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAoBvD;AAMD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAsBxE;AAiCD;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAwB9E;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAuBlE;AAMD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgBxD"}