lightspec 0.1.1
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 +22 -0
- package/README.md +435 -0
- package/bin/lightspec.js +3 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +361 -0
- package/dist/commands/change.d.ts +35 -0
- package/dist/commands/change.js +277 -0
- package/dist/commands/completion.d.ts +72 -0
- package/dist/commands/completion.js +257 -0
- package/dist/commands/config.d.ts +8 -0
- package/dist/commands/config.js +198 -0
- package/dist/commands/feedback.d.ts +9 -0
- package/dist/commands/feedback.js +183 -0
- package/dist/commands/show.d.ts +14 -0
- package/dist/commands/show.js +132 -0
- package/dist/commands/spec.d.ts +15 -0
- package/dist/commands/spec.js +225 -0
- package/dist/commands/validate.d.ts +24 -0
- package/dist/commands/validate.js +294 -0
- package/dist/core/archive.d.ts +11 -0
- package/dist/core/archive.js +280 -0
- package/dist/core/completions/command-registry.d.ts +7 -0
- package/dist/core/completions/command-registry.js +456 -0
- package/dist/core/completions/completion-provider.d.ts +60 -0
- package/dist/core/completions/completion-provider.js +102 -0
- package/dist/core/completions/factory.d.ts +64 -0
- package/dist/core/completions/factory.js +75 -0
- package/dist/core/completions/generators/bash-generator.d.ts +32 -0
- package/dist/core/completions/generators/bash-generator.js +174 -0
- package/dist/core/completions/generators/fish-generator.d.ts +32 -0
- package/dist/core/completions/generators/fish-generator.js +157 -0
- package/dist/core/completions/generators/powershell-generator.d.ts +33 -0
- package/dist/core/completions/generators/powershell-generator.js +207 -0
- package/dist/core/completions/generators/zsh-generator.d.ts +44 -0
- package/dist/core/completions/generators/zsh-generator.js +250 -0
- package/dist/core/completions/installers/bash-installer.d.ts +87 -0
- package/dist/core/completions/installers/bash-installer.js +318 -0
- package/dist/core/completions/installers/fish-installer.d.ts +43 -0
- package/dist/core/completions/installers/fish-installer.js +143 -0
- package/dist/core/completions/installers/powershell-installer.d.ts +88 -0
- package/dist/core/completions/installers/powershell-installer.js +327 -0
- package/dist/core/completions/installers/zsh-installer.d.ts +125 -0
- package/dist/core/completions/installers/zsh-installer.js +449 -0
- package/dist/core/completions/templates/bash-templates.d.ts +6 -0
- package/dist/core/completions/templates/bash-templates.js +24 -0
- package/dist/core/completions/templates/fish-templates.d.ts +7 -0
- package/dist/core/completions/templates/fish-templates.js +39 -0
- package/dist/core/completions/templates/powershell-templates.d.ts +6 -0
- package/dist/core/completions/templates/powershell-templates.js +25 -0
- package/dist/core/completions/templates/zsh-templates.d.ts +6 -0
- package/dist/core/completions/templates/zsh-templates.js +36 -0
- package/dist/core/completions/types.d.ts +79 -0
- package/dist/core/completions/types.js +2 -0
- package/dist/core/config-prompts.d.ts +9 -0
- package/dist/core/config-prompts.js +34 -0
- package/dist/core/config-schema.d.ts +76 -0
- package/dist/core/config-schema.js +200 -0
- package/dist/core/config.d.ts +16 -0
- package/dist/core/config.js +30 -0
- package/dist/core/configurators/agents.d.ts +8 -0
- package/dist/core/configurators/agents.js +15 -0
- package/dist/core/configurators/base.d.ts +7 -0
- package/dist/core/configurators/base.js +2 -0
- package/dist/core/configurators/claude.d.ts +8 -0
- package/dist/core/configurators/claude.js +15 -0
- package/dist/core/configurators/cline.d.ts +8 -0
- package/dist/core/configurators/cline.js +15 -0
- package/dist/core/configurators/codebuddy.d.ts +8 -0
- package/dist/core/configurators/codebuddy.js +15 -0
- package/dist/core/configurators/costrict.d.ts +8 -0
- package/dist/core/configurators/costrict.js +15 -0
- package/dist/core/configurators/iflow.d.ts +8 -0
- package/dist/core/configurators/iflow.js +15 -0
- package/dist/core/configurators/qoder.d.ts +30 -0
- package/dist/core/configurators/qoder.js +42 -0
- package/dist/core/configurators/qwen.d.ts +24 -0
- package/dist/core/configurators/qwen.js +37 -0
- package/dist/core/configurators/registry.d.ts +9 -0
- package/dist/core/configurators/registry.js +43 -0
- package/dist/core/configurators/slash/amazon-q.d.ts +9 -0
- package/dist/core/configurators/slash/amazon-q.js +46 -0
- package/dist/core/configurators/slash/antigravity.d.ts +9 -0
- package/dist/core/configurators/slash/antigravity.js +23 -0
- package/dist/core/configurators/slash/auggie.d.ts +9 -0
- package/dist/core/configurators/slash/auggie.js +31 -0
- package/dist/core/configurators/slash/base.d.ts +19 -0
- package/dist/core/configurators/slash/base.js +69 -0
- package/dist/core/configurators/slash/claude.d.ts +9 -0
- package/dist/core/configurators/slash/claude.js +37 -0
- package/dist/core/configurators/slash/cline.d.ts +9 -0
- package/dist/core/configurators/slash/cline.js +23 -0
- package/dist/core/configurators/slash/codebuddy.d.ts +9 -0
- package/dist/core/configurators/slash/codebuddy.js +34 -0
- package/dist/core/configurators/slash/codex.d.ts +14 -0
- package/dist/core/configurators/slash/codex.js +109 -0
- package/dist/core/configurators/slash/continue.d.ts +9 -0
- package/dist/core/configurators/slash/continue.js +46 -0
- package/dist/core/configurators/slash/costrict.d.ts +9 -0
- package/dist/core/configurators/slash/costrict.js +31 -0
- package/dist/core/configurators/slash/crush.d.ts +9 -0
- package/dist/core/configurators/slash/crush.js +37 -0
- package/dist/core/configurators/slash/cursor.d.ts +9 -0
- package/dist/core/configurators/slash/cursor.js +37 -0
- package/dist/core/configurators/slash/factory.d.ts +10 -0
- package/dist/core/configurators/slash/factory.js +35 -0
- package/dist/core/configurators/slash/gemini.d.ts +9 -0
- package/dist/core/configurators/slash/gemini.js +22 -0
- package/dist/core/configurators/slash/github-copilot.d.ts +9 -0
- package/dist/core/configurators/slash/github-copilot.js +34 -0
- package/dist/core/configurators/slash/iflow.d.ts +9 -0
- package/dist/core/configurators/slash/iflow.js +37 -0
- package/dist/core/configurators/slash/kilocode.d.ts +9 -0
- package/dist/core/configurators/slash/kilocode.js +17 -0
- package/dist/core/configurators/slash/opencode.d.ts +12 -0
- package/dist/core/configurators/slash/opencode.js +72 -0
- package/dist/core/configurators/slash/qoder.d.ts +35 -0
- package/dist/core/configurators/slash/qoder.js +76 -0
- package/dist/core/configurators/slash/qwen.d.ts +32 -0
- package/dist/core/configurators/slash/qwen.js +49 -0
- package/dist/core/configurators/slash/registry.d.ts +8 -0
- package/dist/core/configurators/slash/registry.js +78 -0
- package/dist/core/configurators/slash/roocode.d.ts +9 -0
- package/dist/core/configurators/slash/roocode.js +23 -0
- package/dist/core/configurators/slash/toml-base.d.ts +10 -0
- package/dist/core/configurators/slash/toml-base.js +53 -0
- package/dist/core/configurators/slash/windsurf.d.ts +9 -0
- package/dist/core/configurators/slash/windsurf.js +23 -0
- package/dist/core/converters/json-converter.d.ts +6 -0
- package/dist/core/converters/json-converter.js +51 -0
- package/dist/core/global-config.d.ts +39 -0
- package/dist/core/global-config.js +115 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/init.d.ts +52 -0
- package/dist/core/init.js +644 -0
- package/dist/core/list.d.ts +9 -0
- package/dist/core/list.js +171 -0
- package/dist/core/parsers/change-parser.d.ts +13 -0
- package/dist/core/parsers/change-parser.js +193 -0
- package/dist/core/parsers/markdown-parser.d.ts +22 -0
- package/dist/core/parsers/markdown-parser.js +187 -0
- package/dist/core/parsers/requirement-blocks.d.ts +37 -0
- package/dist/core/parsers/requirement-blocks.js +201 -0
- package/dist/core/project-config.d.ts +64 -0
- package/dist/core/project-config.js +223 -0
- package/dist/core/schemas/base.schema.d.ts +13 -0
- package/dist/core/schemas/base.schema.js +13 -0
- package/dist/core/schemas/change.schema.d.ts +73 -0
- package/dist/core/schemas/change.schema.js +31 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/spec.schema.d.ts +18 -0
- package/dist/core/schemas/spec.schema.js +15 -0
- package/dist/core/specs-apply.d.ts +73 -0
- package/dist/core/specs-apply.js +384 -0
- package/dist/core/styles/palette.d.ts +7 -0
- package/dist/core/styles/palette.js +8 -0
- package/dist/core/templates/agents-root-stub.d.ts +2 -0
- package/dist/core/templates/agents-root-stub.js +17 -0
- package/dist/core/templates/agents-template.d.ts +2 -0
- package/dist/core/templates/agents-template.js +458 -0
- package/dist/core/templates/claude-template.d.ts +2 -0
- package/dist/core/templates/claude-template.js +2 -0
- package/dist/core/templates/cline-template.d.ts +2 -0
- package/dist/core/templates/cline-template.js +2 -0
- package/dist/core/templates/costrict-template.d.ts +2 -0
- package/dist/core/templates/costrict-template.js +2 -0
- package/dist/core/templates/index.d.ts +17 -0
- package/dist/core/templates/index.js +37 -0
- package/dist/core/templates/project-template.d.ts +8 -0
- package/dist/core/templates/project-template.js +32 -0
- package/dist/core/templates/slash-command-templates.d.ts +4 -0
- package/dist/core/templates/slash-command-templates.js +49 -0
- package/dist/core/update.d.ts +4 -0
- package/dist/core/update.js +88 -0
- package/dist/core/validation/constants.d.ts +34 -0
- package/dist/core/validation/constants.js +40 -0
- package/dist/core/validation/types.d.ts +18 -0
- package/dist/core/validation/types.js +2 -0
- package/dist/core/validation/validator.d.ts +33 -0
- package/dist/core/validation/validator.js +409 -0
- package/dist/core/view.d.ts +8 -0
- package/dist/core/view.js +168 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/telemetry/config.d.ts +32 -0
- package/dist/telemetry/config.js +68 -0
- package/dist/telemetry/index.d.ts +31 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/utils/file-system.d.ts +25 -0
- package/dist/utils/file-system.js +218 -0
- package/dist/utils/interactive.d.ts +18 -0
- package/dist/utils/interactive.js +21 -0
- package/dist/utils/item-discovery.d.ts +4 -0
- package/dist/utils/item-discovery.js +72 -0
- package/dist/utils/match.d.ts +3 -0
- package/dist/utils/match.js +22 -0
- package/dist/utils/shell-detection.d.ts +20 -0
- package/dist/utils/shell-detection.js +41 -0
- package/dist/utils/task-progress.d.ts +8 -0
- package/dist/utils/task-progress.js +36 -0
- package/package.json +82 -0
- package/scripts/postinstall.js +147 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LightSpec
|
|
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.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/augmenter-dev/lightspec">
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="assets/lightspec_pixel_dark.svg" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<source srcset="assets/lightspec_pixel_light.svg" media="(prefers-color-scheme: light)">
|
|
6
|
+
<img src="assets/lightspec_pixel_light.svg" alt="LightSpec logo" height="64">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
|
|
10
|
+
</p>
|
|
11
|
+
<p align="center">Spec-driven development for AI coding assistants.</p>
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://github.com/augmenter-dev/lightspec/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/augmenter-dev/lightspec/actions/workflows/ci.yml/badge.svg" /></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/lightspec"><img alt="npm version" src="https://img.shields.io/npm/v/lightspec?style=flat-square" /></a>
|
|
15
|
+
<a href="https://nodejs.org/"><img alt="node version" src="https://img.shields.io/node/v/lightspec?style=flat-square" /></a>
|
|
16
|
+
<a href="./LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" /></a>
|
|
17
|
+
<a href="https://conventionalcommits.org"><img alt="Conventional Commits" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square" /></a>
|
|
18
|
+
<a href="https://discord.gg/YctCnvvshC"><img alt="Discord" src="https://img.shields.io/badge/Discord-Join%20the%20community-5865F2?logo=discord&logoColor=white&style=flat-square" /></a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<img src="assets/lightspec_dashboard.png" alt="LightSpec dashboard preview" width="90%">
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<p align="center">
|
|
26
|
+
Follow <a href="https://x.com/0xTab">@0xTab on X</a> for updates · Join the <a href="https://discord.gg/YctCnvvshC">LightSpec Discord</a> for help and questions.
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
# LightSpec
|
|
30
|
+
|
|
31
|
+
A fork of [LightSpec](https://github.com/Fission-AI/LightSpec) v0.23.0
|
|
32
|
+
|
|
33
|
+
LightSpec aligns humans and AI coding assistants with spec-driven development so you agree on what to build before any code is written. **No API keys required.**
|
|
34
|
+
|
|
35
|
+
## Why LightSpec?
|
|
36
|
+
|
|
37
|
+
AI coding assistants are powerful but unpredictable when requirements live in chat history. LightSpec adds a lightweight specification workflow that locks intent before implementation, giving you deterministic, reviewable outputs.
|
|
38
|
+
|
|
39
|
+
Key outcomes:
|
|
40
|
+
- Human and AI stakeholders agree on specs before work begins.
|
|
41
|
+
- Structured change folders (proposals, tasks, and spec updates) keep scope explicit and auditable.
|
|
42
|
+
- Shared visibility into what's proposed, active, or archived.
|
|
43
|
+
- Works with the AI tools you already use: custom slash commands where supported, context rules everywhere else.
|
|
44
|
+
|
|
45
|
+
## How LightSpec compares (at a glance)
|
|
46
|
+
|
|
47
|
+
- **Lightweight**: simple workflow, no API keys, minimal setup.
|
|
48
|
+
- **Brownfield-first**: works great beyond 0→1. LightSpec separates the source of truth from proposals: `lightspec/specs/` (current truth) and `lightspec/changes/` (proposed updates). This keeps diffs explicit and manageable across features.
|
|
49
|
+
- **Change tracking**: proposals, tasks, and spec deltas live together; archiving merges the approved updates back into specs.
|
|
50
|
+
- **Compared to spec-kit & Kiro**: those shine for brand-new features (0→1). LightSpec also excels when modifying existing behavior (1→n), especially when updates span multiple specs.
|
|
51
|
+
|
|
52
|
+
See the full comparison in [How LightSpec Compares](#how-lightspec-compares).
|
|
53
|
+
|
|
54
|
+
## How It Works
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
┌────────────────────┐
|
|
58
|
+
│ Draft Change │
|
|
59
|
+
│ Proposal │
|
|
60
|
+
└────────┬───────────┘
|
|
61
|
+
│ share intent with your AI
|
|
62
|
+
▼
|
|
63
|
+
┌────────────────────┐
|
|
64
|
+
│ Review & Align │
|
|
65
|
+
│ (edit specs/tasks) │◀──── feedback loop ──────┐
|
|
66
|
+
└────────┬───────────┘ │
|
|
67
|
+
│ approved plan │
|
|
68
|
+
▼ │
|
|
69
|
+
┌────────────────────┐ │
|
|
70
|
+
│ Implement Tasks │──────────────────────────┘
|
|
71
|
+
│ (AI writes code) │
|
|
72
|
+
└────────┬───────────┘
|
|
73
|
+
│ ship the change
|
|
74
|
+
▼
|
|
75
|
+
┌────────────────────┐
|
|
76
|
+
│ Archive & Update │
|
|
77
|
+
│ Specs (source) │
|
|
78
|
+
└────────────────────┘
|
|
79
|
+
|
|
80
|
+
1. Draft a change proposal that captures the spec updates you want.
|
|
81
|
+
2. Review the proposal with your AI assistant until everyone agrees.
|
|
82
|
+
3. Implement tasks that reference the agreed specs.
|
|
83
|
+
4. Archive the change to merge the approved updates back into the source-of-truth specs.
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Getting Started
|
|
87
|
+
|
|
88
|
+
### Supported AI Tools
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary><strong>Native Slash Commands</strong> (click to expand)</summary>
|
|
92
|
+
|
|
93
|
+
These tools have built-in LightSpec commands. Select the LightSpec integration when prompted.
|
|
94
|
+
|
|
95
|
+
| Tool | Commands |
|
|
96
|
+
|------|----------|
|
|
97
|
+
| **Amazon Q Developer** | `@lightspec-proposal`, `@lightspec-apply`, `@lightspec-archive` (`.amazonq/prompts/`) |
|
|
98
|
+
| **Antigravity** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.agent/workflows/`) |
|
|
99
|
+
| **Auggie (Augment CLI)** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.augment/commands/`) |
|
|
100
|
+
| **Claude Code** | `/lightspec:proposal`, `/lightspec:apply`, `/lightspec:archive` |
|
|
101
|
+
| **Cline** | Workflows in `.clinerules/workflows/` directory (`.clinerules/workflows/lightspec-*.md`) |
|
|
102
|
+
| **CodeBuddy Code (CLI)** | `/lightspec:proposal`, `/lightspec:apply`, `/lightspec:archive` (`.codebuddy/commands/`) — see [docs](https://www.codebuddy.ai/cli) |
|
|
103
|
+
| **Codex** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (global: `~/.codex/prompts`, auto-installed) |
|
|
104
|
+
| **Continue** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.continue/prompts/`) |
|
|
105
|
+
| **CoStrict** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.cospec/lightspec/commands/`) — see [docs](https://costrict.ai)|
|
|
106
|
+
| **Crush** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.crush/commands/lightspec/`) |
|
|
107
|
+
| **Cursor** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` |
|
|
108
|
+
| **Factory Droid** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.factory/commands/`) |
|
|
109
|
+
| **Gemini CLI** | `/lightspec:proposal`, `/lightspec:apply`, `/lightspec:archive` (`.gemini/commands/lightspec/`) |
|
|
110
|
+
| **GitHub Copilot** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.github/prompts/`) |
|
|
111
|
+
| **iFlow (iflow-cli)** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.iflow/commands/`) |
|
|
112
|
+
| **Kilo Code** | `/lightspec-proposal.md`, `/lightspec-apply.md`, `/lightspec-archive.md` (`.kilocode/workflows/`) |
|
|
113
|
+
| **OpenCode** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` |
|
|
114
|
+
| **Qoder (CLI)** | `/lightspec:proposal`, `/lightspec:apply`, `/lightspec:archive` (`.qoder/commands/lightspec/`) — see [docs](https://qoder.com/cli) |
|
|
115
|
+
| **Qwen Code** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.qwen/commands/`) |
|
|
116
|
+
| **RooCode** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.roo/commands/`) |
|
|
117
|
+
| **Windsurf** | `/lightspec-proposal`, `/lightspec-apply`, `/lightspec-archive` (`.windsurf/workflows/`) |
|
|
118
|
+
|
|
119
|
+
Kilo Code discovers team workflows automatically. Save the generated files under `.kilocode/workflows/` and trigger them from the command palette with `/lightspec-proposal.md`, `/lightspec-apply.md`, or `/lightspec-archive.md`.
|
|
120
|
+
|
|
121
|
+
</details>
|
|
122
|
+
|
|
123
|
+
<details>
|
|
124
|
+
<summary><strong>AGENTS.md Compatible</strong> (click to expand)</summary>
|
|
125
|
+
|
|
126
|
+
These tools automatically read workflow instructions from `lightspec/AGENTS.md`. Ask them to follow the LightSpec workflow if they need a reminder. Learn more about the [AGENTS.md convention](https://agents.md/).
|
|
127
|
+
|
|
128
|
+
| Tools |
|
|
129
|
+
|-------|
|
|
130
|
+
| Amp • Jules • Others |
|
|
131
|
+
|
|
132
|
+
</details>
|
|
133
|
+
|
|
134
|
+
### Install & Initialize
|
|
135
|
+
|
|
136
|
+
#### Prerequisites
|
|
137
|
+
- **Node.js >= 20.19.0** - Check your version with `node --version`
|
|
138
|
+
|
|
139
|
+
#### Step 1: Install the CLI globally
|
|
140
|
+
|
|
141
|
+
**Option A: Using npm**
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm install -g lightspec@latest
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Verify installation:
|
|
148
|
+
```bash
|
|
149
|
+
lightspec --version
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Option B: Using Nix (NixOS and Nix package manager)**
|
|
153
|
+
|
|
154
|
+
Run LightSpec directly without installation:
|
|
155
|
+
```bash
|
|
156
|
+
nix run github:augmenter-dev/lightspec -- init
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Or install to your profile:
|
|
160
|
+
```bash
|
|
161
|
+
nix profile install github:augmenter-dev/lightspec
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Or add to your development environment in `flake.nix`:
|
|
165
|
+
```nix
|
|
166
|
+
{
|
|
167
|
+
inputs = {
|
|
168
|
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
169
|
+
lightspec.url = "github:augmenter-dev/lightspec";
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
outputs = { nixpkgs, lightspec, ... }: {
|
|
173
|
+
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
|
|
174
|
+
buildInputs = [ lightspec.packages.x86_64-linux.default ];
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Verify installation:
|
|
181
|
+
```bash
|
|
182
|
+
lightspec --version
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Step 2: Initialize LightSpec in your project
|
|
186
|
+
|
|
187
|
+
Navigate to your project directory:
|
|
188
|
+
```bash
|
|
189
|
+
cd my-project
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Run the initialization:
|
|
193
|
+
```bash
|
|
194
|
+
lightspec init
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**What happens during initialization:**
|
|
198
|
+
- You'll be prompted to pick any natively supported AI tools (Claude Code, CodeBuddy, Cursor, OpenCode, Qoder,etc.); other assistants always rely on the shared `AGENTS.md` stub
|
|
199
|
+
- LightSpec automatically configures slash commands for the tools you choose and always writes a managed `AGENTS.md` hand-off at the project root
|
|
200
|
+
- A new `lightspec/` directory structure is created in your project
|
|
201
|
+
|
|
202
|
+
**After setup:**
|
|
203
|
+
- Primary AI tools can trigger `/lightspec` workflows without additional configuration
|
|
204
|
+
- Run `lightspec list` to verify the setup and view any active changes
|
|
205
|
+
- If your coding assistant doesn't surface the new slash commands right away, restart it. Slash commands are loaded at startup,
|
|
206
|
+
so a fresh launch ensures they appear
|
|
207
|
+
|
|
208
|
+
### Optional: Populate Project Context
|
|
209
|
+
|
|
210
|
+
After `lightspec init` completes, you'll receive a suggested prompt to help populate your project context:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
Populate your project context:
|
|
214
|
+
"Please read lightspec/project.md and help me fill it out with details about my project, tech stack, and conventions"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Use `lightspec/project.md` to define project-level conventions, standards, architectural patterns, and other guidelines that should be followed across all changes.
|
|
218
|
+
|
|
219
|
+
### Create Your First Change
|
|
220
|
+
|
|
221
|
+
Here's a real example showing the complete LightSpec workflow. This works with any AI tool. Those with native slash commands will recognize the shortcuts automatically.
|
|
222
|
+
|
|
223
|
+
#### 1. Draft the Proposal
|
|
224
|
+
Start by asking your AI to create a change proposal:
|
|
225
|
+
|
|
226
|
+
```text
|
|
227
|
+
You: Create an LightSpec change proposal for adding profile search filters by role and team
|
|
228
|
+
(Shortcut for tools with slash commands: /lightspec:proposal Add profile search filters)
|
|
229
|
+
|
|
230
|
+
AI: I'll create an LightSpec change proposal for profile filters.
|
|
231
|
+
*Scaffolds lightspec/changes/add-profile-filters/ with proposal.md, tasks.md, spec deltas.*
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### 2. Verify & Review
|
|
235
|
+
Check that the change was created correctly and review the proposal:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
$ lightspec list # Confirm the change folder exists
|
|
239
|
+
$ lightspec validate add-profile-filters # Validate spec formatting
|
|
240
|
+
$ lightspec show add-profile-filters # Review proposal, tasks, and spec delta
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
#### 3. Refine the Specs
|
|
244
|
+
Iterate on the specifications until they match your needs:
|
|
245
|
+
|
|
246
|
+
```text
|
|
247
|
+
You: Can you add acceptance criteria for the role and team filters?
|
|
248
|
+
|
|
249
|
+
AI: I'll update the spec delta with scenarios for role and team filters.
|
|
250
|
+
*Edits lightspec/changes/add-profile-filters/specs/profile/spec.md and tasks.md.*
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
#### 4. Implement the Change
|
|
254
|
+
Once specs look good, start implementation:
|
|
255
|
+
|
|
256
|
+
```text
|
|
257
|
+
You: The specs look good. Let's implement this change.
|
|
258
|
+
(Shortcut for tools with slash commands: /lightspec:apply add-profile-filters)
|
|
259
|
+
|
|
260
|
+
AI: I'll work through the tasks in the add-profile-filters change.
|
|
261
|
+
*Implements tasks from lightspec/changes/add-profile-filters/tasks.md*
|
|
262
|
+
*Marks tasks complete: Task 1.1 ✓, Task 1.2 ✓, Task 2.1 ✓...*
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### 5. Archive the Completed Change
|
|
266
|
+
After implementation is complete, archive the change:
|
|
267
|
+
|
|
268
|
+
```text
|
|
269
|
+
AI: All tasks are complete. The implementation is ready.
|
|
270
|
+
|
|
271
|
+
You: Please archive the change
|
|
272
|
+
(Shortcut for tools with slash commands: /lightspec:archive add-profile-filters)
|
|
273
|
+
|
|
274
|
+
AI: I'll archive the add-profile-filters change.
|
|
275
|
+
*Runs: lightspec archive add-profile-filters --yes*
|
|
276
|
+
✓ Change archived successfully. Specs updated. Ready for the next feature!
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Or run the command yourself in terminal:
|
|
280
|
+
```bash
|
|
281
|
+
$ lightspec archive add-profile-filters --yes # Archive the completed change without prompts
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**Note:** Tools with native slash commands (Claude Code, CodeBuddy, Cursor, Codex, Qoder, RooCode) can use the shortcuts shown. All other tools work with natural language requests to "create an LightSpec proposal", "apply the LightSpec change", or "archive the change".
|
|
285
|
+
|
|
286
|
+
## Command Reference
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
lightspec list # View active change folders
|
|
290
|
+
lightspec view # Interactive dashboard of specs and changes
|
|
291
|
+
lightspec show <change> # Display change details (proposal, tasks, spec updates)
|
|
292
|
+
lightspec validate <change> # Check spec formatting and structure
|
|
293
|
+
lightspec archive <change> [--yes|-y] # Move a completed change into archive/ (non-interactive with --yes)
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Example: How AI Creates LightSpec Files
|
|
297
|
+
|
|
298
|
+
When you ask your AI assistant to "add two-factor authentication", it creates:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
lightspec/
|
|
302
|
+
├── specs/
|
|
303
|
+
│ └── auth/
|
|
304
|
+
│ └── spec.md # Current auth spec (if exists)
|
|
305
|
+
└── changes/
|
|
306
|
+
└── add-2fa/ # AI creates this entire structure
|
|
307
|
+
├── proposal.md # Why and what changes
|
|
308
|
+
├── tasks.md # Implementation checklist
|
|
309
|
+
├── design.md # Technical decisions (optional)
|
|
310
|
+
└── specs/
|
|
311
|
+
└── auth/
|
|
312
|
+
└── spec.md # Delta showing additions
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### AI-Generated Spec (created in `lightspec/specs/auth/spec.md`):
|
|
316
|
+
|
|
317
|
+
```markdown
|
|
318
|
+
# Auth Specification
|
|
319
|
+
|
|
320
|
+
## Purpose
|
|
321
|
+
Authentication and session management.
|
|
322
|
+
|
|
323
|
+
## Requirements
|
|
324
|
+
### Requirement: User Authentication
|
|
325
|
+
The system SHALL issue a JWT on successful login.
|
|
326
|
+
|
|
327
|
+
#### Scenario: Valid credentials
|
|
328
|
+
- WHEN a user submits valid credentials
|
|
329
|
+
- THEN a JWT is returned
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### AI-Generated Change Delta (created in `lightspec/changes/add-2fa/specs/auth/spec.md`):
|
|
333
|
+
|
|
334
|
+
```markdown
|
|
335
|
+
# Delta for Auth
|
|
336
|
+
|
|
337
|
+
## ADDED Requirements
|
|
338
|
+
### Requirement: Two-Factor Authentication
|
|
339
|
+
The system MUST require a second factor during login.
|
|
340
|
+
|
|
341
|
+
#### Scenario: OTP required
|
|
342
|
+
- WHEN a user submits valid credentials
|
|
343
|
+
- THEN an OTP challenge is required
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### AI-Generated Tasks (created in `lightspec/changes/add-2fa/tasks.md`):
|
|
347
|
+
|
|
348
|
+
```markdown
|
|
349
|
+
## 1. Database Setup
|
|
350
|
+
- [ ] 1.1 Add OTP secret column to users table
|
|
351
|
+
- [ ] 1.2 Create OTP verification logs table
|
|
352
|
+
|
|
353
|
+
## 2. Backend Implementation
|
|
354
|
+
- [ ] 2.1 Add OTP generation endpoint
|
|
355
|
+
- [ ] 2.2 Modify login flow to require OTP
|
|
356
|
+
- [ ] 2.3 Add OTP verification endpoint
|
|
357
|
+
|
|
358
|
+
## 3. Frontend Updates
|
|
359
|
+
- [ ] 3.1 Create OTP input component
|
|
360
|
+
- [ ] 3.2 Update login flow UI
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Important:** You don't create these files manually. Your AI assistant generates them based on your requirements and the existing codebase.
|
|
364
|
+
|
|
365
|
+
## Understanding LightSpec Files
|
|
366
|
+
|
|
367
|
+
### Delta Format
|
|
368
|
+
|
|
369
|
+
Deltas are "patches" that show how specs change:
|
|
370
|
+
|
|
371
|
+
- **`## ADDED Requirements`** - New capabilities
|
|
372
|
+
- **`## MODIFIED Requirements`** - Changed behavior (include complete updated text)
|
|
373
|
+
- **`## REMOVED Requirements`** - Deprecated features
|
|
374
|
+
|
|
375
|
+
**Format requirements:**
|
|
376
|
+
- Use `### Requirement: <name>` for headers
|
|
377
|
+
- Every requirement needs at least one `#### Scenario:` block
|
|
378
|
+
- Use SHALL/MUST in requirement text
|
|
379
|
+
|
|
380
|
+
## How LightSpec Compares
|
|
381
|
+
|
|
382
|
+
### vs. spec-kit
|
|
383
|
+
LightSpec’s two-folder model (`lightspec/specs/` for the current truth, `lightspec/changes/` for proposed updates) keeps state and diffs separate. This scales when you modify existing features or touch multiple specs. spec-kit is strong for greenfield/0→1 but provides less structure for cross-spec updates and evolving features.
|
|
384
|
+
|
|
385
|
+
### vs. Kiro.dev
|
|
386
|
+
LightSpec groups every change for a feature in one folder (`lightspec/changes/feature-name/`), making it easy to track related specs, tasks, and designs together. Kiro spreads updates across multiple spec folders, which can make feature tracking harder.
|
|
387
|
+
|
|
388
|
+
### vs. No Specs
|
|
389
|
+
Without specs, AI coding assistants generate code from vague prompts, often missing requirements or adding unwanted features. LightSpec brings predictability by agreeing on the desired behavior before any code is written.
|
|
390
|
+
|
|
391
|
+
## Team Adoption
|
|
392
|
+
|
|
393
|
+
1. **Initialize LightSpec** – Run `lightspec init` in your repo.
|
|
394
|
+
2. **Start with new features** – Ask your AI to capture upcoming work as change proposals.
|
|
395
|
+
3. **Grow incrementally** – Each change archives into living specs that document your system.
|
|
396
|
+
4. **Stay flexible** – Different teammates can use Claude Code, CodeBuddy, Cursor, or any AGENTS.md-compatible tool while sharing the same specs.
|
|
397
|
+
|
|
398
|
+
Run `lightspec update` whenever someone switches tools so your agents pick up the latest instructions and slash-command bindings.
|
|
399
|
+
|
|
400
|
+
## Updating LightSpec
|
|
401
|
+
|
|
402
|
+
1. **Upgrade the package**
|
|
403
|
+
```bash
|
|
404
|
+
npm install -g lightspec@latest
|
|
405
|
+
```
|
|
406
|
+
2. **Refresh agent instructions**
|
|
407
|
+
- Run `lightspec update` inside each project to regenerate AI guidance and ensure the latest slash commands are active.
|
|
408
|
+
|
|
409
|
+
## Contributing
|
|
410
|
+
|
|
411
|
+
- Install dependencies: `pnpm install`
|
|
412
|
+
- Build: `pnpm run build`
|
|
413
|
+
- Test: `pnpm test`
|
|
414
|
+
- Develop CLI locally: `pnpm run dev` or `pnpm run dev:cli`
|
|
415
|
+
- Conventional commits (one-line): `type(scope): subject`
|
|
416
|
+
|
|
417
|
+
<details>
|
|
418
|
+
<summary><strong>Maintainers & Advisors</strong></summary>
|
|
419
|
+
|
|
420
|
+
See [MAINTAINERS.md](MAINTAINERS.md) for the list of core maintainers and advisors who help guide the project.
|
|
421
|
+
|
|
422
|
+
</details>
|
|
423
|
+
|
|
424
|
+
## Agent Skills
|
|
425
|
+
|
|
426
|
+
LightSpec includes 3 Claude Code skills for the core development workflow:
|
|
427
|
+
- `lightspec-new` - Create a new change
|
|
428
|
+
- `lightspec-apply` - Get apply instructions for implementation
|
|
429
|
+
- `lightspec-archive` - Archive a completed change
|
|
430
|
+
|
|
431
|
+
See [README_SKILLS.md](README_SKILLS.md) for details.
|
|
432
|
+
|
|
433
|
+
## License
|
|
434
|
+
|
|
435
|
+
MIT
|
package/bin/lightspec.js
ADDED