@fabersep/spec 0.2.0 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "faber-spec",
3
3
  "description": "Spec-driven engineering templates and skills (Master PRD, Architecture, Feature PRD, BDD Acceptance Criteria, and Cross-Model Design Discussion) for AI coding agents.",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "author": {
6
6
  "name": "FaberSEP",
7
7
  "url": "https://fabersep.dev"
package/CHANGELOG.md ADDED
@@ -0,0 +1,29 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@fabersep/spec`. Versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## 0.2.1 (unreleased)
6
+
7
+ ### Fixed
8
+ - `uninstall` could delete a link you made yourself at a `faber-*` skill path; it now removes only links and folders that FaberSEP Spec created.
9
+ - `status` reported any folder at a tool's plugin path as installed; folders FaberSEP Spec did not create now show as `not managed`.
10
+ - Updating left broken links behind in Codex and Cursor for skills a newer version no longer ships; `init` now removes them (only its own links, never another package's `faber-*` skills).
11
+ - `init --engine=` with an empty list printed "Installed" without wiring any tool; it is now rejected with the list of supported tools.
12
+ - After `init --link`, `status` said "not installed"; it now shows the linked checkout and its version.
13
+ - Antigravity's `agy plugin validate` rejected the plugin: the documentation rules had no `trigger` (now `manual`, so they still cost zero idle tokens) and the manifest had four suggested prompts where only three are shown.
14
+
15
+ ### Added
16
+ - `init --preview` (same as `--dry-run`) shows what would change without writing anything; `--apply` is accepted as an alias of plain `init`, matching `@fabersep/memory` and `@fabersep/atlas`.
17
+ - `docs/guide.md` (technical guide and full command reference), `CHANGELOG.md`, `CONTRIBUTING.md` and a CI test workflow.
18
+
19
+ ### Changed
20
+ - The README is now a plain-language, story-first introduction; technical detail moved to `docs/guide.md`.
21
+
22
+ ## 0.2.0 (2026-11-27)
23
+
24
+ - One-command interactive installer (`npx @fabersep/spec init`) for Antigravity, Claude Code, OpenAI Codex and Cursor, with `status` and `uninstall`.
25
+ - `faber-discuss`: a read-only, cross-model design and spec review loop (`agy` or `claude` as reviewer).
26
+
27
+ ## 0.1.0 (2026-11-26)
28
+
29
+ - First release: Antigravity plugin with the documentation rules, four templates and the `faber-init-arch`, `faber-init-prd`, `faber-extract-features` and `faber-new-feature` skills.
package/README.md CHANGED
@@ -1,278 +1,133 @@
1
- # FaberSEP Spec (`@fabersep/spec`)
1
+ # FaberSEP Spec
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@fabersep/spec.svg)](https://www.npmjs.com/package/@fabersep/spec)
3
4
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE)
4
5
 
5
- **Spec-driven engineering templates, governance rules, and `faber-*` agent skills — installed across all your AI coding tools with one command.**
6
+ **Your AI coding assistant builds what it guesses you meant. FaberSEP Spec has it write down what you mean first, in short documents you can read, approve and keep.**
6
7
 
7
- Zero runtime dependencies. Zero template files dumped into your repositories. Zero idle token overhead. Run `npx @fabersep/spec init`, pick your AI coding tools from an interactive checklist, and start turning any codebase or raw idea into verified Architecture docs, Master PRDs, and atomic Given-When-Then BDD specs.
8
+ <!-- Video: a 60-second walkthrough will go here. -->
8
9
 
9
10
  ---
10
11
 
11
- ## Table of Contents
12
-
13
- - [Why FaberSEP Spec?](#why-fabersep-spec)
14
- - [How It Works (The 2-Minute Mental Model)](#how-it-works-the-2-minute-mental-model)
15
- - [Prerequisites](#prerequisites)
16
- - [Step-by-Step Quickstart](#step-by-step-quickstart)
17
- - [Everyday Development Cycle](#everyday-development-cycle)
18
- - [Included Skills](#included-skills)
19
- - [Supported AI Coding Tools](#supported-ai-coding-tools)
20
- - [Updating & Uninstalling](#updating--uninstalling)
21
- - [CLI Command Reference](#cli-command-reference)
22
- - [Running from Source (Contributors)](#running-from-source-contributors)
23
- - [Works Great With](#works-great-with)
24
- - [Documentation & Specs](#documentation--specs)
25
- - [License](#license)
12
+ ## The problem you already know
26
13
 
27
- ---
28
-
29
- ## Why FaberSEP Spec?
30
-
31
- *"Can't I just ask my AI coding agent to write a spec or paste a Markdown template into my repo?"*
32
-
33
- Ad-hoc prompting produces inconsistent docs that drift from the codebase and hallucinate APIs. Copy-pasting template folders into every repository pollutes your git history and goes stale fast. **`@fabersep/spec` solves all of these at once:**
34
-
35
- | | Ad-Hoc Prompting | Copy-Paste Templates in Repo | `@fabersep/spec` |
36
- | :--- | :--- | :--- | :--- |
37
- | **Setup** | Re-explain rules every chat | Copy & sync files in every repo | **One command (`npx @fabersep/spec init`) for all tools** |
38
- | **Repo Cleanliness** | Unstructured notes | Template & prompt clutter in git | **Zero boilerplate in your repo — only clean `docs/`** |
39
- | **Accuracy** | Hallucinates APIs & flags | No verification rules | **Evidence-first; unknowns marked `GAP-XX`** |
40
- | **Idle Token Cost** | Long system prompts | Always-on instruction bloat | **Zero idle tokens; skills load only when invoked** |
41
- | **Multi-Tool Support** | Tied to one chat | Manual per-tool setup | **Antigravity, Claude Code/Desktop, Codex, Cursor** |
42
-
43
- ---
14
+ You ask your AI assistant: *"Add a way for users to export their data."* Ten minutes later it has written 400 lines. It picked CSV when you wanted JSON, it exports everyone's data instead of only the user's own, and it changed a file you didn't want touched.
44
15
 
45
- ## How It Works (The 2-Minute Mental Model)
16
+ So you explain again. And again in the next chat, because it forgot. A month later nobody, human or AI, can say what the export feature is supposed to do, because the only record is the code itself.
46
17
 
47
- ```mermaid
48
- flowchart LR
49
- Code["Your Repository<br/>(existing code or new idea)"] --> Arch["1. Architecture<br/>docs/architecture.md<br/>(HOW it is built)"]
50
- Arch --> Master["2. Master PRD<br/>docs/master-prd.md<br/>(WHAT & WHY)"]
51
- Master --> Feat["3. Feature Specs<br/>docs/features/NN-slug/<br/>prd.md + acceptance_criteria.md"]
52
- Feat -->|"Optional second opinion"| Discuss["4. faber-discuss<br/>(Cross-model review loop)"]
53
- Discuss --> Build["Confident Implementation<br/>& Verification"]
54
- ```
18
+ Asking it to "write a spec first" helps a little, but every time you get a different format. Sometimes it describes functions that don't exist.
55
19
 
56
- If you are new to spec-driven development with AI coding agents, here is the whole idea in 4 points:
20
+ ## What changes with FaberSEP Spec
57
21
 
58
- 1. **Three separate kinds of truth (never mixed together):**
59
- - **Architecture (`docs/architecture.md`) — *HOW the system is built*:** Real folders, modules, data flows, and entry points verified directly from your code.
60
- - **Product Requirements (`docs/master-prd.md` and `docs/features/<NN>-<slug>/prd.md`) — *WHAT & WHY*:** Users, workflows, functional requirements (`FR-XX`), and explicit non-goals (`NG-XX`) in plain product language.
61
- - **Acceptance Criteria (`docs/features/<NN>-<slug>/acceptance_criteria.md`) — *HOW we verify it*:** Atomic `GIVEN / WHEN / THEN` BDD scenarios (`AC-XX`) mapped 1-to-1 to `FR-XX`, with zero internal code identifiers.
62
- 2. **Evidence first, zero hallucination:** When documenting an existing repo, skills verify real files before writing and record missing information openly as `GAP-XX` instead of guessing.
63
- 3. **Installed globally once, clean in every repo:** `npx @fabersep/spec init` installs one canonical copy under `~/.faber/spec/` and links it into your AI coding tools. Your project repositories stay clean — only the generated `docs/` files are written.
64
- 4. **Optional cross-model review (`faber-discuss`):** Before coding a tricky feature, your active agent can debate the design and spec with a second read-only model (`claude` or `agy` CLI) and hand you a short key-point summary + owner questions.
22
+ The same request, with FaberSEP Spec:
65
23
 
66
- ---
24
+ 1. **Your assistant asks before it builds.** Three to five short questions, each with a suggested answer: *"Only the signed-in user's data? JSON or CSV? What if they have none?"*
25
+ 2. **It writes a one-page spec.** What the feature does, what it explicitly won't do, and a list of checks in plain language: *"GIVEN a user with no data, WHEN they export, THEN they get an empty file and a short note."*
26
+ 3. **You read a short summary and say yes or no.** Only then does the code get written, and it gets checked against that list.
67
27
 
68
- ## Prerequisites
28
+ The spec stays in your project's `docs/` folder. Next month, the next chat, or a different AI tool reads the same page and knows what the feature is for.
69
29
 
70
- - **Node.js 20 or newer** (`node -v` to check) — needed for `npx @fabersep/spec init`
71
- - **One or more supported AI coding tools:** Antigravity, Claude Code / Claude Desktop, OpenAI Codex, or Cursor
72
- - *(Optional)* **Python 3** + `agy` or `claude` CLI — only needed if you use `faber-discuss`
30
+ ## Why you can trust it
73
31
 
74
- You do **not** need to clone this repository or install anything globally to get started.
32
+ - **It checks before it writes.** When it documents an existing project, it reads the real files first. What it can't confirm, it lists as an open question instead of making it up.
33
+ - **Same shape every time.** Every project gets the same few documents, so you always know where to look.
34
+ - **Your projects stay clean.** It is installed once on your computer. Nothing is added to your repositories except the documents you ask for.
35
+ - **It costs nothing until you use it.** The instructions load only when you call one of its skills, so everyday chats stay as fast and cheap as before.
36
+ - **Works with the tools you already use:** Claude Code, Antigravity, OpenAI Codex and Cursor. Switch tools and the documents still mean the same thing.
37
+ - **Free and open source** (Apache-2.0). No account and no server: it runs inside the AI tool you already use.
75
38
 
76
39
  ---
77
40
 
78
- ## Step-by-Step Quickstart
41
+ ## Get started (about 2 minutes)
79
42
 
80
- Follow these 4 steps. Setup takes under 30 seconds and is completely reversible.
43
+ You need **Node.js 20 or newer**. To check, run `node -v` in a terminal.
81
44
 
82
- ### Step 1: Install into your AI coding tools
83
-
84
- Run:
45
+ **1. Install it**
85
46
 
86
47
  ```bash
87
48
  npx @fabersep/spec init
88
49
  ```
89
50
 
90
- The installer automatically scans your machine for installed AI coding tools (`~/.gemini`, `~/.claude`, `~/.codex`, `~/.cursor`) and opens an interactive checklist with detected tools pre-selected:
91
-
92
- ```text
93
- FaberSEP Spec v0.2.0 — Select AI coding tools to install into:
94
- Detected tools are pre-selected. Uncheck any tool to skip or remove it, then press Enter.
95
-
96
- > [x] Antigravity (detected: ~/.gemini)
97
- [x] Claude Code / Desktop (detected: ~/.claude)
98
-
99
- 2 selected • ↑/↓ move • Space toggle • a toggle all • Enter install • q cancel
100
- ```
101
-
102
- - Use **↑ / ↓** to move, **Space** to check or uncheck any tool, and **Enter** to install.
103
- - Prefer a non-interactive one-liner?
104
- ```bash
105
- # Install into all auto-detected tools without prompting
106
- npx @fabersep/spec init --yes
107
-
108
- # Or target specific tools explicitly
109
- npx @fabersep/spec init --engine antigravity,claude-code,codex,cursor
51
+ It finds the AI tools on your computer and shows them as a checklist, already ticked. Press `Enter`. That's all. It keeps a backup of anything it would replace, and you can remove it any time with `npx @fabersep/spec uninstall`.
110
52
 
111
- # Preview what would change without touching disk
112
- npx @fabersep/spec init --yes --dry-run
113
- ```
53
+ Want to see what it would do first? Run `npx @fabersep/spec init --preview`: nothing is written.
114
54
 
115
- **What this does:**
116
- - Stages one clean copy of the rules, templates, manifests, and 5 `faber-*` skills in `~/.faber/spec/`.
117
- - Wires each selected tool automatically (native plugin link for Antigravity and Claude Code/Desktop; per-skill links for Codex and Cursor).
118
- - Never overwrites unmanaged folders — if a non-FaberSEP directory exists at a target path, it backs it up to `.bak.<timestamp>` first.
119
-
120
- Verify your installation anytime:
55
+ **2. Check it**
121
56
 
122
57
  ```bash
123
58
  npx @fabersep/spec status
124
59
  ```
125
60
 
126
- ### Step 2: Document an existing project (Brownfield)
127
-
128
- Open any repository in your AI coding tool (start a new session so it loads the newly installed skills) and run these three prompts in order:
129
-
130
- 1. **Map the codebase reality:**
131
- > *"Run `faber-init-arch` to document this repository's architecture."*
132
- - Creates `docs/architecture.md` grounded in real source files.
133
- 2. **Capture product intent:**
134
- > *"Run `faber-init-prd` to generate the Master PRD."*
135
- - Creates `docs/master-prd.md` with vision, personas, journeys, non-goals, and gaps.
136
- 3. **Extract existing features into PRDs + BDDs:**
137
- > *"Run `faber-extract-features` to extract existing feature PRDs and BDDs."*
138
- - Creates `docs/features/README.md` and `docs/features/<NN>-<slug>/{prd.md, acceptance_criteria.md}` for each capability.
139
-
140
- ### Step 3: Specify a new feature before coding (Greenfield)
141
-
142
- Whenever you want to build something new, ask your agent:
61
+ Your tools should say `installed`.
143
62
 
144
- > *"Run `faber-new-feature` for `<your feature idea>`."*
63
+ **3. Start a new chat in your AI tool and try it**
145
64
 
146
- The agent reads your existing `docs/master-prd.md` and `docs/architecture.md`, asks **3–5 short clarifying questions** (caller, edge cases, state, compatibility, non-goals), and writes a traceable `prd.md` + `acceptance_criteria.md` for your approval before writing a single line of code.
65
+ For something new you want to build:
147
66
 
148
- ### Step 4: (Optional) Stress-test a design with a second model
67
+ > *"Run faber-new-feature for: users can export their data."*
149
68
 
150
- For non-trivial features or architectural changes, ask your agent:
69
+ It asks its questions, then writes `docs/features/01-data-export/prd.md` (what and why) and `acceptance_criteria.md` (how to check it). Read the summary it gives you and answer yes, or tell it what to change.
151
70
 
152
- > *"Run `faber-discuss` to review this design and spec with a second model."*
71
+ **Already have a project with code?** Ask it to describe what is there, in this order:
153
72
 
154
- Your active agent (`author`) briefs a read-only external reviewer (`claude` or `agy` CLI), works through numbered findings (`F-1`, `F-2`, ...), enforces token budgets, saves a full audit ledger, and hands you a concise summary + numbered owner questions (`OQ-1`, ...).
73
+ > *"Run faber-init-arch."* → `docs/architecture.md`: how the project is built.
74
+ >
75
+ > *"Run faber-init-prd."* → `docs/master-prd.md`: what the product does and for whom.
76
+ >
77
+ > *"Run faber-extract-features."* → one short spec per existing feature.
155
78
 
156
79
  ---
157
80
 
158
- ## Everyday Development Cycle
81
+ ## A normal day with it
159
82
 
160
- ```mermaid
161
- flowchart LR
162
- Idea["New Feature Idea<br/>or Bug Fix"] --> NewFeat["faber-new-feature<br/>(3-5 questions -> PRD + BDD)"]
163
- NewFeat -->|"Complex change?"| Disc["faber-discuss<br/>(Cross-model review)"]
164
- NewFeat -->|"Straightforward"| Approve["Human Reviews<br/>Key-Point Summary"]
165
- Disc --> Approve
166
- Approve --> Code["Implement Against<br/>FR-XX & AC-XX"]
167
- Code --> Refresh["Refresh docs/architecture.md<br/>if boundaries changed"]
168
- ```
169
-
170
- ---
171
-
172
- ## Included Skills
83
+ - **Before building something:** *"Run faber-new-feature for …"*. Answer the questions, approve the summary.
84
+ - **While building:** your assistant works against the checklist in the spec, and you can ask it *"Which checks pass?"*.
85
+ - **For a big or risky change:** *"Run faber-discuss on this design."* A second AI model (for example Gemini reviewing Claude's plan) looks for holes. You get a short summary and a few numbered questions to answer.
86
+ - **When the project changes shape:** run `faber-init-arch` again; it updates only what changed.
173
87
 
174
- All skills in `@fabersep/spec` use the `faber-` prefix to prevent naming collisions with other plugins.
175
-
176
- | Skill | When to Use It | Output |
177
- | :--- | :--- | :--- |
178
- | `faber-init-arch` | Documenting an existing codebase or drafting architecture for a new project | `docs/architecture.md` |
179
- | `faber-init-prd` | Synthesizing product vision, personas, journeys, non-goals, and KPIs | `docs/master-prd.md` |
180
- | `faber-extract-features` | Bringing an existing repo up to spec-driven standards | `docs/features/README.md` + per-feature `prd.md` & `acceptance_criteria.md` |
181
- | `faber-new-feature` | Clarifying and specifying a new feature before writing code | `docs/features/<NN>-<slug>/{prd.md, acceptance_criteria.md}` |
182
- | `faber-discuss` | Running a read-only cross-model design & spec review (`agy` or `claude` CLI) | Review ledger (`decisions.md`, `stats.md`, `summary.md`) + reviewed PRD/BDD |
183
-
184
- ---
88
+ A check in a spec looks like this:
185
89
 
186
- ## Supported AI Coding Tools
187
-
188
- | Tool | Detection Path | Installed Location | Layout |
189
- | :--- | :--- | :--- | :--- |
190
- | **Antigravity** | `~/.gemini` | `~/.gemini/config/plugins/faber-spec` | Full native plugin (`plugin.json` + all skills) |
191
- | **Claude Code / Desktop** | `~/.claude` | `~/.claude/skills/faber-spec` | Full Claude plugin (`.claude-plugin/plugin.json` + all skills) |
192
- | **OpenAI Codex** | `~/.codex` | `~/.codex/skills/faber-*` | Per-skill links pointing to `~/.faber/spec/skills/` |
193
- | **Cursor** | `~/.cursor` | `~/.cursor/skills/faber-*` | Per-skill links pointing to `~/.faber/spec/skills/` |
194
-
195
- *(All 5 skills resolve `rules/` and `templates/` both from relative plugin paths and from `~/.faber/spec/`, so every tool works identically.)*
196
-
197
- ---
198
-
199
- ## Updating & Uninstalling
200
-
201
- ### Update to the latest version
202
-
203
- Re-run `init` with `@latest` — it safely refreshes `~/.faber/spec/` and keeps your tool links intact:
204
-
205
- ```bash
206
- npx @fabersep/spec@latest init --yes
207
- ```
208
-
209
- ### Uninstall cleanly
210
-
211
- Remove all tool links and `~/.faber/spec/` (never touches `docs/` inside your project repos):
212
-
213
- ```bash
214
- npx @fabersep/spec uninstall
215
- ```
216
-
217
- Or remove from a single tool only:
218
-
219
- ```bash
220
- npx @fabersep/spec uninstall --engine cursor
90
+ ```markdown
91
+ #### Scenario AC-03: Export with no data
92
+ - **GIVEN:** A signed-in user who has no saved items
93
+ - **WHEN:** They choose "Export my data"
94
+ - **THEN:** They receive an empty JSON file AND see the note "Nothing to export yet".
221
95
  ```
222
96
 
223
97
  ---
224
98
 
225
- ## CLI Command Reference
99
+ ## Common questions
226
100
 
227
- | Command | Description |
228
- | :--- | :--- |
229
- | `npx @fabersep/spec init` | Auto-detect AI tools and open the interactive checkbox installer. |
230
- | `npx @fabersep/spec init --yes` | Install into all auto-detected tools without prompting. |
231
- | `npx @fabersep/spec init --engine <list>` | Install into specific tools (`antigravity`, `claude-code`, `codex`, `cursor`). |
232
- | `npx @fabersep/spec init --dry-run` | Preview planned changes without modifying disk. |
233
- | `npx @fabersep/spec init --link` | Link tools directly to a local Git checkout (for contributors). |
234
- | `npx @fabersep/spec status` | Show installed version, skills, and connected AI coding tools. |
235
- | `npx @fabersep/spec uninstall [--engine <list>]` | Remove managed links and `~/.faber/spec/` cleanly. |
101
+ **Do I need to know how to write specs?**
102
+ No. The assistant asks you plain questions and writes the document. You only read the summary and say yes or no.
236
103
 
237
- ---
104
+ **Does it slow down my assistant or cost more?**
105
+ No. It stays out of the way until you call one of its skills.
238
106
 
239
- ## Running from Source (Contributors)
107
+ **What does it put in my project?**
108
+ Only Markdown files under `docs/`. You can edit or delete them like any other file.
240
109
 
241
- If you want to hack on templates, rules, or skills locally and see changes immediately in your AI tools:
110
+ **Does it work without code yet, for a brand-new idea?**
111
+ Yes. `faber-init-prd` and `faber-new-feature` ask you about the idea and write the documents from your answers.
242
112
 
243
- ```bash
244
- git clone https://github.com/fabersep/spec.git
245
- cd spec
246
- npm test
247
- node src/cli.mjs init --link
248
- ```
113
+ **How do I update or remove it?**
114
+ `npx @fabersep/spec@latest init --yes` updates it. `npx @fabersep/spec uninstall` removes it and leaves your `docs/` folders alone. See [Updating and removing](docs/guide.md#updating-and-removing).
249
115
 
250
- `--link` points your selected AI tools directly at your local checkout instead of copying to `~/.faber/spec/`.
116
+ **Something went wrong.**
117
+ Run `npx @fabersep/spec status` first. Then check [Troubleshooting](docs/guide.md#troubleshooting) or [open an issue](https://github.com/fabersep/spec/issues).
251
118
 
252
119
  ---
253
120
 
254
- ## Works Great With
121
+ ## Going further
255
122
 
256
- `@fabersep/spec` works completely standalone in any repository. If you want optional companion tools from the same open-source suite:
123
+ - **[User guide and reference](docs/guide.md):** what is installed where, every command and flag, the documents and skills in detail, how `faber-discuss` works.
124
+ - **[How this project is specified](docs/features/README.md):** FaberSEP Spec is documented with its own standard ([Master PRD](docs/master-prd.md), [architecture](docs/architecture.md)).
125
+ - **[Contributing](CONTRIBUTING.md)** and **[Changelog](CHANGELOG.md)**.
257
126
 
258
- - **[FaberSEP Memory (`@fabersep/memory`)](https://github.com/fabersep/memory):** Prefix-cache-first, Git-backed Markdown memory across all your AI coding tools.
259
- - **[FaberSEP Atlas (`@fabersep/atlas`)](https://github.com/fabersep/atlas):** Deterministic AST code map & MCP server. When Atlas MCP is connected, `faber-init-arch`, `faber-init-prd`, and `faber-extract-features` automatically use it to map codebases with far fewer tokens.
260
- - **[FaberSEP Blueprints](https://fabersep.dev):** Build-verified project scaffolds and recipes.
127
+ Works well with **[FaberSEP Memory](https://github.com/fabersep/memory)** (your assistant remembers the rules you approve, across tools) and **[FaberSEP Atlas](https://github.com/fabersep/atlas)** (a code map that lets the skills read far fewer files). Each one also works on its own.
261
128
 
262
- ---
263
-
264
- ## Documentation & Specs
265
-
266
- This repository dogfoods its own FaberSEP Spec standard:
267
-
268
- - [Master PRD](docs/master-prd.md)
269
- - [Architecture Guide](docs/architecture.md)
270
- - [Features Index](docs/features/README.md)
271
- - [01 — Core Spec Plugin](docs/features/01-antigravity-spec-plugin/prd.md)
272
- - [02 — Multi-Agent CLI Installer & Cross-Model Discuss](docs/features/02-cli-installer-and-cross-model-discuss/prd.md)
273
-
274
- ---
129
+ FaberSEP Spec is part of [FaberSEP](https://github.com/fabersep), open-source tools that help AI coding assistants work with more discipline.
275
130
 
276
131
  ## License
277
132
 
278
- Apache-2.0 — see [LICENSE](LICENSE).
133
+ [Apache-2.0](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabersep/spec",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
5
  "description": "Spec-driven engineering templates, documentation rules, and faber-* agent skills (Antigravity, Claude Code, Codex, Cursor) with a one-command interactive installer.",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,8 @@
39
39
  "!skills/**/__pycache__",
40
40
  "!**/*.pyc",
41
41
  "LICENSE",
42
- "README.md"
42
+ "README.md",
43
+ "CHANGELOG.md"
43
44
  ],
44
45
  "engines": {
45
46
  "node": ">=20"
package/plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "faber-spec",
3
3
  "displayName": "FaberSEP Spec",
4
4
  "description": "Spec-driven engineering templates and skills (Master PRD, Architecture, Feature PRD, and BDD Acceptance Criteria) for AI coding agents.",
5
- "version": "0.2.0",
5
+ "version": "0.2.1",
6
6
  "author": {
7
7
  "name": "FaberSEP",
8
8
  "url": "https://fabersep.dev"
@@ -12,7 +12,6 @@
12
12
  "suggestedPrompts": [
13
13
  "Run faber-init-arch to document this repository's architecture",
14
14
  "Run faber-init-prd to create the Master PRD for this project",
15
- "Run faber-new-feature to specify a new feature with PRD and BDD scenarios",
16
- "Run faber-discuss to review a design and spec with a second model"
15
+ "Run faber-new-feature to specify a new feature with PRD and BDD scenarios"
17
16
  ]
18
17
  }
@@ -1,8 +1,9 @@
1
1
  ---
2
+ trigger: manual
2
3
  id: faber.documentation-rules
3
4
  type: documentation_rules
4
5
  status: verified
5
- version: 0.2.0
6
+ version: 0.2.1
6
7
  ---
7
8
 
8
9
  # FaberSEP Documentation Standards & Governance Rules
@@ -11,7 +11,7 @@ Run a structured, read-only second-opinion loop with an external reviewer CLI (`
11
11
  - Start **only** when the user explicitly asks to run `faber-discuss` / `discuss` (never on your own initiative).
12
12
  - Respond to the user in the user's language; write every ledger file, brief, prompt, and spec in English (quoting the user's own constraints verbatim with an English gloss).
13
13
  - Never let the reviewer edit files, run shell commands, or launch subagents/workflows.
14
- - Never approve a spec, commit, push, or move project board cards inside this skill.
14
+ - Never approve a spec, commit, push, or move task-tracker items inside this skill.
15
15
  - **Testing the skill itself:** always pass `--test` to `discuss_round.py` so only the cheapest test model is used (`gemini-3.8-flash-low` for `agy`, `haiku` for `claude`).
16
16
 
17
17
  ---
package/src/cli.mjs CHANGED
@@ -27,7 +27,8 @@ ${bold('Usage:')}
27
27
  ${bold('Init options:')}
28
28
  -y, --yes Skip interactive prompt and install into all detected tools
29
29
  --engine <list> Comma-separated tools: antigravity,claude-code,codex,cursor
30
- --dry-run Preview what would be installed without modifying disk
30
+ --preview, --dry-run Show what would change without modifying disk
31
+ --apply Accepted for compatibility; init applies by default
31
32
  --link Link directly to this local checkout (for contributors)
32
33
  --undo Alias for uninstall
33
34
 
@@ -35,6 +36,7 @@ ${bold('Examples:')}
35
36
  npx @fabersep/spec init
36
37
  npx @fabersep/spec init --yes
37
38
  npx @fabersep/spec init --engine antigravity,claude-code
39
+ npx @fabersep/spec init --preview
38
40
  npx @fabersep/spec status
39
41
  npx @fabersep/spec uninstall
40
42
  `);
@@ -61,8 +63,10 @@ function parseArgs(argv) {
61
63
  flags.version = true;
62
64
  } else if (arg === '-y' || arg === '--yes') {
63
65
  flags.yes = true;
64
- } else if (arg === '--dry-run') {
66
+ } else if (arg === '--dry-run' || arg === '--preview') {
65
67
  flags.dryRun = true;
68
+ } else if (arg === '--apply') {
69
+ // Backwards-compatible alias: init applies by default.
66
70
  } else if (arg === '--link') {
67
71
  flags.link = true;
68
72
  } else if (arg === '--undo') {
@@ -87,6 +91,12 @@ function parseArgs(argv) {
87
91
  }
88
92
  }
89
93
 
94
+ if (flags.engines && flags.engines.length === 0) {
95
+ throw new Error(
96
+ 'the tool list is empty. Supported tools: antigravity, claude-code, codex, cursor',
97
+ );
98
+ }
99
+
90
100
  return { command, flags };
91
101
  }
92
102
 
@@ -184,6 +194,9 @@ async function runInit(flags) {
184
194
  console.log(` Skills (${summary.skills.length}): ${summary.skills.join(', ')}`);
185
195
  for (const r of summary.results) {
186
196
  console.log(` • ${r.label}: ${r.targets.join(', ')}`);
197
+ for (const stale of r.staleRemoved || []) {
198
+ console.log(` would remove skill no longer shipped: ${stale}`);
199
+ }
187
200
  }
188
201
  return 0;
189
202
  }
@@ -197,7 +210,11 @@ async function runInit(flags) {
197
210
  r.mode === 'plugin' ? r.targets[0] : `${r.targets.length} skills -> ${r.targets[0].replace(/\/faber-[^/]+$/, '')}`;
198
211
  console.log(` ${green('✓')} ${bold(r.label.padEnd(22))} ${targetSummary} ${dim(`(${r.method})`)}`);
199
212
  if (r.backedUpTo) {
200
- console.log(yellow(` backed up previous directory to: ${r.backedUpTo}`));
213
+ const backups = Array.isArray(r.backedUpTo) ? r.backedUpTo : [r.backedUpTo];
214
+ for (const b of backups) console.log(yellow(` backed up previous directory to: ${b}`));
215
+ }
216
+ for (const stale of r.staleRemoved || []) {
217
+ console.log(dim(` removed skill no longer shipped: ${stale}`));
201
218
  }
202
219
  }
203
220
  console.log('');
@@ -211,24 +228,33 @@ async function runInit(flags) {
211
228
  function runStatus() {
212
229
  const st = getStatus();
213
230
  console.log(bold(`FaberSEP Spec Status`));
214
- console.log(
215
- ` Canonical store: ${st.canonicalRoot} ${
216
- st.canonicalExists ? green(`(v${st.installedVersion || '?'})`) : yellow('(not installed)')
217
- }`,
218
- );
231
+ if (st.canonicalExists || !st.linkedRoot) {
232
+ console.log(
233
+ ` Canonical store: ${st.canonicalRoot} ${
234
+ st.canonicalExists ? green(`(v${st.installedVersion || '?'})`) : yellow('(not installed)')
235
+ }`,
236
+ );
237
+ }
238
+ if (st.linkedRoot) {
239
+ console.log(` Linked checkout: ${st.linkedRoot} ${green(`(v${st.linkedVersion || '?'})`)}`);
240
+ }
219
241
  console.log(` Skills (${st.skills.length}): ${st.skills.join(', ')}`);
220
242
  console.log('');
221
243
  for (const e of st.engines) {
222
244
  const state = e.installed
223
245
  ? green('installed')
224
- : e.detected
246
+ : e.unmanaged
247
+ ? yellow('not managed (not ours)')
248
+ : e.detected
225
249
  ? yellow('detected (not linked)')
226
250
  : dim('not detected');
227
251
  const detail = e.installed
228
252
  ? e.mode === 'plugin'
229
253
  ? e.targetHint
230
254
  : `${e.installedSkills.length}/${st.skills.length} skills in ${e.targetHint}`
231
- : e.detectHint;
255
+ : e.unmanaged
256
+ ? `${e.targetHint} holds files FaberSEP Spec did not create; init backs them up`
257
+ : e.detectHint;
232
258
  console.log(` ${e.label.padEnd(23)} ${state.padEnd(28)} ${dim(detail)}`);
233
259
  }
234
260
  return 0;
package/src/installer.mjs CHANGED
@@ -158,11 +158,15 @@ function isSymlink(p) {
158
158
  }
159
159
  }
160
160
 
161
- function isManagedTarget(p) {
162
- if (isSymlink(p)) return true;
163
- if (!fs.existsSync(p)) return false;
164
- if (fs.existsSync(path.join(p, META_FILENAME))) return true;
165
- const pluginJson = path.join(p, 'plugin.json');
161
+ function isInside(child, parent) {
162
+ const rel = path.relative(parent, child);
163
+ return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));
164
+ }
165
+
166
+ function hasOwnerMarker(dir) {
167
+ if (!fs.existsSync(dir)) return false;
168
+ if (fs.existsSync(path.join(dir, META_FILENAME))) return true;
169
+ const pluginJson = path.join(dir, 'plugin.json');
166
170
  if (fs.existsSync(pluginJson)) {
167
171
  try {
168
172
  const parsed = JSON.parse(fs.readFileSync(pluginJson, 'utf8'));
@@ -171,17 +175,39 @@ function isManagedTarget(p) {
171
175
  return false;
172
176
  }
173
177
  }
174
- const skillMd = path.join(p, 'SKILL.md');
175
- if (fs.existsSync(skillMd) && path.basename(p).startsWith('faber-')) {
178
+ const skillMd = path.join(dir, 'SKILL.md');
179
+ if (fs.existsSync(skillMd) && path.basename(dir).startsWith('faber-')) {
176
180
  return true;
177
181
  }
178
182
  return false;
179
183
  }
180
184
 
181
- function linkOrCopyDir(src, dst, { dryRun = false } = {}) {
185
+ // A path is ours only when it (or, for a link, the folder it points to) carries the
186
+ // FaberSEP Spec marker, the faber-spec plugin manifest, or a faber-* skill. A user's
187
+ // own folder or link is never treated as ours.
188
+ function isManagedTarget(p, { canonicalRoot } = {}) {
189
+ if (isSymlink(p)) {
190
+ const target = path.resolve(path.dirname(p), fs.readlinkSync(p));
191
+ if (canonicalRoot && isInside(target, canonicalRoot)) return true;
192
+ let real;
193
+ try {
194
+ real = fs.realpathSync(p);
195
+ } catch {
196
+ return false; // dangling link outside our store: not ours
197
+ }
198
+ return hasOwnerMarker(real);
199
+ }
200
+ return hasOwnerMarker(p);
201
+ }
202
+
203
+ function linkTargetOf(p) {
204
+ return isSymlink(p) ? path.resolve(path.dirname(p), fs.readlinkSync(p)) : null;
205
+ }
206
+
207
+ function linkOrCopyDir(src, dst, { dryRun = false, canonicalRoot } = {}) {
182
208
  let backedUpTo = null;
183
209
  if (isSymlink(dst) || fs.existsSync(dst)) {
184
- if (isManagedTarget(dst)) {
210
+ if (isManagedTarget(dst, { canonicalRoot })) {
185
211
  if (!dryRun) {
186
212
  fs.rmSync(dst, { recursive: true, force: true });
187
213
  }
@@ -205,12 +231,41 @@ function linkOrCopyDir(src, dst, { dryRun = false } = {}) {
205
231
  } catch (err) {
206
232
  if (err && (err.code === 'EPERM' || err.code === 'EACCES' || err.code === 'EXDEV')) {
207
233
  copyTree(src, dst);
234
+ if (!fs.existsSync(path.join(dst, META_FILENAME))) {
235
+ fs.writeFileSync(
236
+ path.join(dst, META_FILENAME),
237
+ JSON.stringify({ name: '@fabersep/spec', version: getPackageVersion() }, null, 2) + '\n',
238
+ 'utf8',
239
+ );
240
+ }
208
241
  return { method: 'copy', backedUpTo };
209
242
  }
210
243
  throw err;
211
244
  }
212
245
  }
213
246
 
247
+ // Remove faber-* entries in a per-skill tool folder that an earlier FaberSEP Spec
248
+ // install created but the current version no longer ships. Only links into our own
249
+ // store (or linked checkout) and copies carrying our marker are touched, so skills
250
+ // from other packages that share the faber- prefix stay in place.
251
+ function removeStaleSkills(dir, currentSkills, { roots, dryRun }) {
252
+ if (!fs.existsSync(dir)) return [];
253
+ const keep = new Set(currentSkills);
254
+ const removed = [];
255
+ for (const name of fs.readdirSync(dir)) {
256
+ if (!name.startsWith('faber-') || keep.has(name)) continue;
257
+ const p = path.join(dir, name);
258
+ const target = linkTargetOf(p);
259
+ const ours = target
260
+ ? roots.some((root) => isInside(target, path.join(root, 'skills')))
261
+ : fs.existsSync(path.join(p, META_FILENAME));
262
+ if (!ours) continue;
263
+ if (!dryRun) fs.rmSync(p, { recursive: true, force: true });
264
+ removed.push(p);
265
+ }
266
+ return removed;
267
+ }
268
+
214
269
  export function installEngines({
215
270
  engines,
216
271
  userHome = getUserHome(),
@@ -231,12 +286,13 @@ export function installEngines({
231
286
  : stageCanonicalInstall({ userHome, sourceRoot, dryRun }).canonicalRoot;
232
287
 
233
288
  const skills = getSkillNames(linkDev ? effectiveRoot : sourceRoot);
289
+ const canonicalRoot = getCanonicalRoot(userHome);
234
290
  const results = [];
235
291
 
236
292
  for (const id of selectedIds) {
237
293
  const def = allDefs.get(id);
238
294
  if (def.mode === 'plugin') {
239
- const outcome = linkOrCopyDir(effectiveRoot, def.targetPath, { dryRun });
295
+ const outcome = linkOrCopyDir(effectiveRoot, def.targetPath, { dryRun, canonicalRoot });
240
296
  results.push({
241
297
  engine: id,
242
298
  label: def.label,
@@ -252,11 +308,15 @@ export function installEngines({
252
308
  for (const skill of skills) {
253
309
  const srcSkill = path.join(effectiveRoot, 'skills', skill);
254
310
  const dstSkill = path.join(def.targetPath, skill);
255
- const outcome = linkOrCopyDir(srcSkill, dstSkill, { dryRun });
311
+ const outcome = linkOrCopyDir(srcSkill, dstSkill, { dryRun, canonicalRoot });
256
312
  targets.push(dstSkill);
257
313
  method = outcome.method;
258
314
  if (outcome.backedUpTo) backups.push(outcome.backedUpTo);
259
315
  }
316
+ const staleRemoved = removeStaleSkills(def.targetPath, skills, {
317
+ roots: [canonicalRoot, effectiveRoot],
318
+ dryRun,
319
+ });
260
320
  results.push({
261
321
  engine: id,
262
322
  label: def.label,
@@ -264,6 +324,7 @@ export function installEngines({
264
324
  targets,
265
325
  method,
266
326
  backedUpTo: backups.length > 0 ? backups : null,
327
+ staleRemoved,
267
328
  });
268
329
  }
269
330
  }
@@ -290,33 +351,60 @@ export function getStatus({ userHome = getUserHome() } = {}) {
290
351
  }
291
352
 
292
353
  const expectedSkills = meta?.skills || getSkillNames(PACKAGE_ROOT);
354
+ const owned = (p) => (isSymlink(p) || fs.existsSync(p)) && isManagedTarget(p, { canonicalRoot });
355
+ const present = (p) => isSymlink(p) || fs.existsSync(p);
356
+ const linkedRoots = new Set();
293
357
  const engines = detectEngines(userHome).map((engine) => {
294
358
  if (engine.mode === 'plugin') {
295
- const exists = isSymlink(engine.targetPath) || fs.existsSync(engine.targetPath);
296
- const linkTarget = isSymlink(engine.targetPath) ? fs.readlinkSync(engine.targetPath) : null;
359
+ const installed = owned(engine.targetPath);
360
+ const linkTarget = linkTargetOf(engine.targetPath);
361
+ if (installed && linkTarget && !isInside(linkTarget, canonicalRoot)) linkedRoots.add(linkTarget);
297
362
  return {
298
363
  ...engine,
299
- installed: exists,
364
+ installed,
365
+ unmanaged: !installed && present(engine.targetPath),
300
366
  linkTarget,
301
- installedSkills: exists ? expectedSkills : [],
367
+ installedSkills: installed ? expectedSkills : [],
302
368
  };
303
369
  }
304
- const installedSkills = expectedSkills.filter((skill) => {
370
+ const installedSkills = [];
371
+ const unmanagedSkills = [];
372
+ for (const skill of expectedSkills) {
305
373
  const p = path.join(engine.targetPath, skill);
306
- return isSymlink(p) || fs.existsSync(p);
307
- });
374
+ if (owned(p)) {
375
+ installedSkills.push(skill);
376
+ const t = linkTargetOf(p);
377
+ if (t && !isInside(t, canonicalRoot)) linkedRoots.add(path.dirname(path.dirname(t)));
378
+ } else if (present(p)) {
379
+ unmanagedSkills.push(skill);
380
+ }
381
+ }
308
382
  return {
309
383
  ...engine,
310
384
  installed: installedSkills.length > 0,
385
+ unmanaged: installedSkills.length === 0 && unmanagedSkills.length > 0,
386
+ unmanagedSkills,
311
387
  linkTarget: null,
312
388
  installedSkills,
313
389
  };
314
390
  });
315
391
 
392
+ const linkedRoot = linkedRoots.size > 0 ? [...linkedRoots][0] : null;
393
+ let linkedVersion = null;
394
+ if (linkedRoot) {
395
+ try {
396
+ linkedVersion = JSON.parse(fs.readFileSync(path.join(linkedRoot, 'package.json'), 'utf8')).version;
397
+ } catch {
398
+ linkedVersion = null;
399
+ }
400
+ }
401
+
316
402
  return {
317
403
  canonicalRoot,
318
404
  canonicalExists: fs.existsSync(canonicalRoot),
319
405
  installedVersion: meta?.version || null,
406
+ linkedRoot,
407
+ linkedVersion,
320
408
  packageVersion: getPackageVersion(),
321
409
  skills: expectedSkills,
322
410
  engines,
@@ -342,7 +430,7 @@ export function uninstallEngines({
342
430
  for (const def of allDefs) {
343
431
  if (!targetIds.has(def.id)) continue;
344
432
  if (def.mode === 'plugin') {
345
- if ((isSymlink(def.targetPath) || fs.existsSync(def.targetPath)) && isManagedTarget(def.targetPath)) {
433
+ if ((isSymlink(def.targetPath) || fs.existsSync(def.targetPath)) && isManagedTarget(def.targetPath, { canonicalRoot })) {
346
434
  if (!dryRun) {
347
435
  fs.rmSync(def.targetPath, { recursive: true, force: true });
348
436
  }
@@ -351,7 +439,7 @@ export function uninstallEngines({
351
439
  } else {
352
440
  for (const skill of skillNames) {
353
441
  const p = path.join(def.targetPath, skill);
354
- if ((isSymlink(p) || fs.existsSync(p)) && isManagedTarget(p)) {
442
+ if ((isSymlink(p) || fs.existsSync(p)) && isManagedTarget(p, { canonicalRoot })) {
355
443
  if (!dryRun) {
356
444
  fs.rmSync(p, { recursive: true, force: true });
357
445
  }
@@ -366,13 +454,9 @@ export function uninstallEngines({
366
454
  engines && engines.length > 0
367
455
  ? allDefs.some((def) => {
368
456
  if (targetIds.has(def.id)) return false;
369
- if (def.mode === 'plugin') {
370
- return isSymlink(def.targetPath) || fs.existsSync(def.targetPath);
371
- }
372
- return [...skillNames].some((skill) => {
373
- const p = path.join(def.targetPath, skill);
374
- return isSymlink(p) || fs.existsSync(p);
375
- });
457
+ const ours = (p) => (isSymlink(p) || fs.existsSync(p)) && isManagedTarget(p, { canonicalRoot });
458
+ if (def.mode === 'plugin') return ours(def.targetPath);
459
+ return [...skillNames].some((skill) => ours(path.join(def.targetPath, skill)));
376
460
  })
377
461
  : false;
378
462