@sublang/spex 0.3.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,19 +32,39 @@ spex scaffold
32
32
 
33
33
  This creates:
34
34
 
35
- - **`specs/`** — directories and starter templates for writing behavioral
36
- specs, decision records, and iteration plans
37
- - **`CLAUDE.md` / `AGENTS.md`** — instructions that tell AI agents (Claude,
38
- Codex, etc.) to read and follow the specs before writing code
35
+ - **`specs/`** — the spec tree and its law:
36
+ - `specs/packages/` holds one file per spec package: a self-contained `## Intent`, the behavior its users may rely on (`## External Behavior`), implementation hidden from them (`## Internal Behavior`), and the tests of its own claims (`## Verification`) — one read covers one package.
37
+ Behavior that emerges from several packages working together is itself a spec package citing the peers' External Behavior — there is no compositions directory.
38
+ - `specs/decisions/` and `specs/intents/` hold decision records (DRs) and intent records (IRs); `specs/map.md` indexes the tree and `specs/meta.md` is the spec of specs.
39
+ - Two starter packages (`git.md`, `licensing.md`) and a sample intent record seed the tree.
40
+ - **`LICENSE`** — the verbatim Apache-2.0 text at the target root, written only when no `LICENSE` exists there.
41
+ - **`CLAUDE.md` / `AGENTS.md`** — instructions that tell AI agents
42
+ (Claude, Codex, etc.) to read relevant specs, resolve conflicts there
43
+ first, and keep specs and code aligned.
39
44
 
40
- See `specs/decisions/000-spec-structure-format.md` for the spec format and naming conventions.
45
+ See `specs/decisions/000-spec-structure-format.md` and `specs/meta.md` for the spec format and naming conventions.
41
46
 
42
- Idempotency: Rerunning is safe — existing files and directories are skipped.
47
+ Idempotency: rerunning `scaffold` is safe — it only adds missing files.
48
+ The one in-place edit it makes is to an existing `CLAUDE.md`/`AGENTS.md`, whose managed `## Specs (Source of Truth)` section is added or refreshed.
49
+ (`--update` edits more, mechanically; see below.)
43
50
 
44
- **Try it:** review the sample iteration `specs/iterations/000-spdx-headers.md`, update the copyright text, then prompt your AI coding agent:
51
+ ### Linting
52
+
53
+ Check the specs tree at any time:
54
+
55
+ ```sh
56
+ spex lint
57
+ ```
58
+
59
+ The linter validates the layout, package file sections and their order, item IDs — lowercase `<pack>-<N>` matching the file's basename, unique across the tree — citations (enclosed inline links like `[[pack-3](pack.md#pack-3)]` whose files and anchors exist), Verification items citing the behaviors they check, reference markers, record sections, and the `map.md` index.
60
+ Relationship-metadata lines like `Verifies:` are errors — the citations woven into an item's statement are the single source of its relationships.
61
+ Directories of previous spec generations (`specs/compositions/`, `specs/user/`, …) are errors pointing at the migration skill (see [Upgrading](#upgrading-from-an-earlier-release)).
62
+ Errors exit non-zero; warnings do not.
63
+
64
+ **Try it:** review the sample intent record `specs/intents/000-spdx-headers.md`, update the copyright text, then prompt your AI coding agent:
45
65
 
46
66
  ```text
47
- Complete Iteration #0
67
+ Complete IR-000
48
68
  ```
49
69
 
50
70
  ### Localization
@@ -65,13 +85,48 @@ When a new release ships updated templates, refresh them with:
65
85
  spex scaffold --update
66
86
  ```
67
87
 
68
- - Spex-authoritative files (`specs/meta.md` and the spec-format decision record) are refreshed unconditionally, including when they are absent. If you had modified one of these, `--update` warns and names it so you can reapply your changes from git history.
69
- - Starter files (`map.md`, the sample iteration, boilerplate items) are refreshed when you have not customized them, and written from the bundled template when they are absent. Customized starter files are kept as-is. Remove a starter file *after* `--update` if you do not want it.
70
- - Anything you authored outside the bundled framework and starter files is left alone.
88
+ It runs from within a git repository and requires a clean `specs/` working tree, so every edit stays reviewable.
89
+
90
+ - Spex-authoritative *framework* files (`specs/meta.md` and the spec-format decision record) are refreshed unconditionally, including when they are absent. If you had modified one of these, `--update` warns and names it so you can reapply your changes from git history.
91
+ - Starter *seed* files (`map.md`, the sample intent record, the starter packages) are refreshed when you have not customized them, and written from the bundled template when they are absent. Customized starter files are kept as-is. Remove a starter file *after* `--update` if you do not want it.
92
+ - The managed specs section of an existing `CLAUDE.md`/`AGENTS.md` is refreshed; absent agent files are not created.
93
+ - Files you authored are never edited.
94
+
95
+ Review the changes with `git diff -- specs CLAUDE.md AGENTS.md` and run `spex lint`.
96
+ The command prints a per-file indicator for every framework and seed path, plus a copy-paste-ready prompt for your AI agent to reconcile citations and local extensions with the refreshed law.
97
+
98
+ ## Upgrading from an earlier release
99
+
100
+ ### From 1.x
101
+
102
+ Spex 2.0 tightens the packages-only law introduced in 1.0. Run
103
+ `spex scaffold --update`, review the refreshed law and merge guidance,
104
+ then reconcile your packages until `spex lint` passes. In particular,
105
+ every package now requires Verification of its own behavior, behavior
106
+ citations from Verification stay inside that package, record citations
107
+ use their exact IDs, and every item-bearing basename is tree-wide unique.
108
+
109
+ ### From 0.x
110
+
111
+ A tree scaffolded by a spex 0.x release carries the older structural
112
+ generation of the law. Spex 2.0 uses the following structure:
113
+
114
+ | | Previous generations (spex 0.x) | Current generation (spex 2.0) |
115
+ | --- | --- | --- |
116
+ | Layout | `specs/user`/`dev`/`test`, later `packages/` + `compositions/` | `packages/` only — composition is a package pattern |
117
+ | Cross-package behavior | binding and scenario items in composition files | behavior items binding inline to peers' External Behavior |
118
+ | Item IDs | ALLCAPS short form (`AUTH-3`) | lowercase file basename (`github-login-3`) |
119
+ | Item citations | `[AUTH-3](auth.md#auth-3)` | enclosed: `[[github-login-3](github-login.md#github-login-3)]` |
120
+ | Intent records | Goal, Deliverables, Tasks, Acceptance criteria | Status, Intent, Deliverables, Tasks, Verification |
121
+
122
+ The CLI detects but does not restructure a legacy tree:
123
+
124
+ - `spex scaffold --update` still refreshes the spex-owned law files, leaves all legacy content untouched, and prints migration guidance when it recognizes a legacy generation.
125
+ - Plain `spex scaffold` refuses a tree with a legacy directory — it writes nothing and points at `--update` — so two generations never entangle.
126
+ - `spex lint` reports legacy directories as errors pointing the same way.
71
127
 
72
- Review the changes with `git diff -- specs`.
73
- Update any citations that reference renamed sections or renumbered IDs — the command prints
74
- clear next steps and a copy-paste-ready prompt you can hand to your AI agent for that review.
128
+ The structural migration itself — items reclassify, compositions fold into packages, intents get rewritten — is judgment work done by an AI agent following the **spec-structure-migration** skill shipped in the spex repo, not by a script (the scripted migration of earlier releases is retired).
129
+ Follow the walkthrough in [docs/spec-migration.md](https://github.com/sublang-ai/spex/blob/main/docs/spec-migration.md), install the skill per [its README](https://github.com/sublang-ai/spex/blob/main/skills/spec-structure-migration/README.md), and let the agent loop until its checker and `spex lint` — the mechanical gate — pass clean.
75
130
 
76
131
  ## Workflow
77
132
 
@@ -79,10 +134,10 @@ Spex does *not* enforce a heavyweight workflow.
79
134
  We believe spec-driven development is a flexible combination of a few primitives.
80
135
 
81
136
  1. **Make Decisions** — Discuss requirements, architecture, and design with AI agents. Let AI generate and review decision records in `specs/decisions/`.
82
- 2. **Plan Iterations** — Break down work into tasks with AI agents. Let AI generate and review iteration records in `specs/iterations/`.
83
- 3. **Agents Execute** — Let AI agents complete the tasks autonomously. They generate code and update `specs/user/`, `specs/dev/`, and `specs/test/`.
137
+ 2. **Record Intents** — Break down work into tasks with AI agents. Let AI generate and review intent records in `specs/intents/`.
138
+ 3. **Agents Execute** — Let AI agents complete the tasks autonomously. They generate code and update `specs/packages/`.
84
139
 
85
- Then loop back to the next decision or iteration.
140
+ Then loop back to the next decision or intent.
86
141
 
87
142
  ## Requirements
88
143
 
@@ -3,8 +3,15 @@
3
3
  * at basePath.
4
4
  *
5
5
  * SCAF-10: when neither exists, both are created; when only one
6
- * exists, only that file is updated. Section replacement uses
7
- * case-sensitive match on "## Specs (Source of Truth)".
6
+ * exists, only that file is updated. Section replacement parses
7
+ * Markdown and matches the H2 heading "Specs (Source of Truth)"
8
+ * case-sensitively, immune to lookalikes inside code fences.
8
9
  * SCAF-5: replace in place or skip when identical.
10
+ *
11
+ * With `createMissing: false` (the --update flow), absent files stay
12
+ * absent; only existing agent files get their managed section
13
+ * refreshed.
9
14
  */
10
- export declare function appendAgentSpecs(basePath: string): void;
15
+ export declare function appendAgentSpecs(basePath: string, options?: {
16
+ createMissing?: boolean;
17
+ }): void;
@@ -3,37 +3,30 @@
3
3
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
  import { getScaffoldDir } from "./bundled-scaffold.js";
6
- const SECTION_HEADING = "## Specs (Source of Truth)";
6
+ import { headingText, parseMarkdown, startOffset } from "./markdown.js";
7
+ const SECTION_TITLE = "Specs (Source of Truth)";
7
8
  const AGENT_FILES = ["CLAUDE.md", "AGENTS.md"];
8
- function escapeRegExp(s) {
9
- return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
10
- }
11
9
  /**
12
- * Extract the specs section from content: from the heading to the
13
- * next h2 heading or end of file.
10
+ * Extract the specs section from content: from the managed heading to
11
+ * the next h2 heading or end of file. The content is parsed as
12
+ * Markdown, so only a real heading matches — a lookalike line inside a
13
+ * fenced code block neither starts the section nor terminates it.
14
14
  * Returns [start, end] character offsets, or null if not found.
15
15
  */
16
16
  function findSection(content) {
17
- // Match only as a real H2 heading at start of a line (or start of file).
18
- // Handle both LF and CRLF line endings.
19
- const pattern = new RegExp(`(?:^|\\r?\\n)${escapeRegExp(SECTION_HEADING)}(?:\\r?\\n|$)`);
20
- const match = pattern.exec(content);
21
- if (!match)
17
+ const headings = parseMarkdown(content).children.filter((node) => node.type === "heading" && node.depth === 2);
18
+ const managed = headings.find((heading) => headingText(content, heading) === SECTION_TITLE);
19
+ if (managed === undefined)
22
20
  return null;
23
- // Start at the heading itself, not the preceding line ending
24
- const matchText = match[0];
25
- let idx = match.index;
26
- if (matchText.startsWith("\r\n"))
27
- idx += 2;
28
- else if (matchText.startsWith("\n"))
29
- idx += 1;
30
- // Find the next ## heading after the section heading line
31
- const afterHeading = idx + SECTION_HEADING.length;
32
- const nextH2Match = content.slice(afterHeading).match(/\r?\n## /);
33
- const end = nextH2Match?.index !== undefined
34
- ? afterHeading + nextH2Match.index
35
- : content.length;
36
- return [idx, end];
21
+ const next = headings.find((heading) => startOffset(heading) > startOffset(managed));
22
+ if (next === undefined)
23
+ return [startOffset(managed), content.length];
24
+ // End before the line ending that precedes the next heading, so the
25
+ // separator between sections stays outside the replaced range.
26
+ let end = startOffset(next);
27
+ if (content[end - 1] === "\n")
28
+ end -= content[end - 2] === "\r" ? 2 : 1;
29
+ return [startOffset(managed), end];
37
30
  }
38
31
  /**
39
32
  * Process a single agent file: replace section in place, append,
@@ -72,11 +65,17 @@ function processFile(filePath, specsContent, fileExists, shouldCreate) {
72
65
  * at basePath.
73
66
  *
74
67
  * SCAF-10: when neither exists, both are created; when only one
75
- * exists, only that file is updated. Section replacement uses
76
- * case-sensitive match on "## Specs (Source of Truth)".
68
+ * exists, only that file is updated. Section replacement parses
69
+ * Markdown and matches the H2 heading "Specs (Source of Truth)"
70
+ * case-sensitively, immune to lookalikes inside code fences.
77
71
  * SCAF-5: replace in place or skip when identical.
72
+ *
73
+ * With `createMissing: false` (the --update flow), absent files stay
74
+ * absent; only existing agent files get their managed section
75
+ * refreshed.
78
76
  */
79
- export function appendAgentSpecs(basePath) {
77
+ export function appendAgentSpecs(basePath, options = {}) {
78
+ const createMissing = options.createMissing ?? true;
80
79
  const scaffoldDir = getScaffoldDir();
81
80
  const specsContent = readFileSync(join(scaffoldDir, "agent-specs.txt"), "utf-8");
82
81
  const presence = AGENT_FILES.map((f) => existsSync(join(basePath, f)));
@@ -85,7 +84,7 @@ export function appendAgentSpecs(basePath) {
85
84
  const fileName = AGENT_FILES[i];
86
85
  const filePath = join(basePath, fileName);
87
86
  const fileExists = presence[i];
88
- const shouldCreate = neitherExists;
87
+ const shouldCreate = createMissing && neitherExists;
89
88
  const result = processFile(filePath, specsContent, fileExists, shouldCreate);
90
89
  switch (result) {
91
90
  case "created":
package/dist/cli.js CHANGED
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
4
+ import { lint } from "./lint.js";
4
5
  import { scaffold } from "./scaffold.js";
5
6
  const USAGE = `Usage: spex <command> [options]
6
7
 
7
8
  Commands:
8
9
  scaffold [--lang <code>] [<path>] Create specs directory structure
9
- scaffold --update Refresh scaffold-provided specs templates`;
10
+ scaffold --update Refresh scaffold-provided specs templates
11
+ lint [<path>] Check the specs tree structure, item IDs,
12
+ and citations`;
10
13
  function main() {
11
14
  const args = process.argv.slice(2);
12
15
  const command = args[0];
@@ -18,6 +21,9 @@ function main() {
18
21
  case "scaffold":
19
22
  scaffold(args.slice(1));
20
23
  break;
24
+ case "lint":
25
+ lint(args.slice(1));
26
+ break;
21
27
  default:
22
28
  console.error(`Unknown command: ${command}\n`);
23
29
  console.error(USAGE);
@@ -9,9 +9,16 @@ export type LegacyItemLayoutResult = {
9
9
  type RefreshPristineSeedsOptions = {
10
10
  migratedFrom?: ReadonlyMap<string, string>;
11
11
  language?: ScaffoldLanguage;
12
+ /**
13
+ * Replacement indicator text for user-modified seeds that this run
14
+ * transformed in place (e.g. a restructured map.md), so one line
15
+ * reports the seed's true outcome.
16
+ */
17
+ indicatorOverrides?: ReadonlyMap<string, string>;
12
18
  };
13
19
  export declare function isSupportedLanguage(code: string): code is ScaffoldLanguage;
14
20
  export declare function formatSupportedLanguages(): string;
21
+ export declare function listFiles(dir: string): string[];
15
22
  export declare function getBundledSpecFilePath(relPath: string, language?: ScaffoldLanguage): string;
16
23
  /**
17
24
  * Copy bundled template files from scaffold/specs/ to target specs/.
@@ -20,10 +27,22 @@ export declare function getBundledSpecFilePath(relPath: string, language?: Scaff
20
27
  * SCAF-9: resolves scaffold/ from the dist/ output directory.
21
28
  */
22
29
  export declare function copyTemplates(basePath: string, language?: ScaffoldLanguage): void;
30
+ /**
31
+ * Copy the bundled top-level LICENSE to the target repository root.
32
+ *
33
+ * SCAF-37: writes scaffold/LICENSE (verbatim Apache-2.0) to
34
+ * <basePath>/LICENSE only when the target is absent, so an existing
35
+ * downstream license is never overwritten. Not localized.
36
+ */
37
+ export declare function copyRootLicense(basePath: string): void;
23
38
  export declare function getFrameworkSpecFiles(): readonly string[];
24
39
  export declare function getSeedSpecFiles(): readonly string[];
25
40
  export declare function migrateLegacyItemLayout(basePath: string): LegacyItemLayoutResult[];
41
+ export declare function migrateIterationsLayout(basePath: string): LegacyItemLayoutResult[];
26
42
  export declare function getFileHistory(relPath: string): string[];
43
+ export declare function getLegacyFileHistory(relPath: string): string[];
44
+ /** isPristine over the legacy manifest (removed bundled paths). */
45
+ export declare function isLegacyPristine(basePath: string, relPath: string): PristineState;
27
46
  export declare function canonicalContentHash(data: Buffer): string;
28
47
  export declare function isPristine(basePath: string, relPath: string, language?: ScaffoldLanguage): PristineState;
29
48
  export declare function overwriteFrameworkSpecFiles(basePath: string, language?: ScaffoldLanguage): string[];
@@ -12,11 +12,9 @@ const FRAMEWORK_FILES = [
12
12
  ];
13
13
  const SEED_FILES = [
14
14
  "specs/map.md",
15
- "specs/iterations/000-spdx-headers.md",
16
- "specs/dev/git.md",
17
- "specs/dev/licensing.md",
18
- "specs/test/licensing.md",
19
- "specs/user/.gitkeep",
15
+ "specs/intents/000-spdx-headers.md",
16
+ "specs/packages/git.md",
17
+ "specs/packages/licensing.md",
20
18
  ];
21
19
  const LEGACY_ITEM_DIRS = [
22
20
  ["specs/items/user", "specs/user"],
@@ -35,7 +33,7 @@ function getOverlayRelPath(language, relPath) {
35
33
  function getOverlayBase(scaffoldDir, language) {
36
34
  return join(scaffoldDir, "i18n", language);
37
35
  }
38
- function listFiles(dir) {
36
+ export function listFiles(dir) {
39
37
  const files = [];
40
38
  for (const entry of readdirSync(dir)) {
41
39
  if (entry === ".DS_Store")
@@ -95,6 +93,23 @@ export function copyTemplates(basePath, language = "en") {
95
93
  console.log(` ${relPath}`);
96
94
  }
97
95
  }
96
+ /**
97
+ * Copy the bundled top-level LICENSE to the target repository root.
98
+ *
99
+ * SCAF-37: writes scaffold/LICENSE (verbatim Apache-2.0) to
100
+ * <basePath>/LICENSE only when the target is absent, so an existing
101
+ * downstream license is never overwritten. Not localized.
102
+ */
103
+ export function copyRootLicense(basePath) {
104
+ const source = join(getScaffoldDir(), "LICENSE");
105
+ const target = join(basePath, "LICENSE");
106
+ if (existsSync(target)) {
107
+ console.log(` LICENSE (already exists)`);
108
+ return;
109
+ }
110
+ copyFileSync(source, target);
111
+ console.log(` LICENSE`);
112
+ }
98
113
  // SCAF-13.
99
114
  export function getFrameworkSpecFiles() {
100
115
  return FRAMEWORK_FILES;
@@ -147,6 +162,55 @@ export function migrateLegacyItemLayout(basePath) {
147
162
  removeEmptyDirectories(join(basePath, "specs", "items"));
148
163
  return results;
149
164
  }
165
+ // SCAF-51: iteration records become intent records (DR-017).
166
+ export function migrateIterationsLayout(basePath) {
167
+ const results = [];
168
+ const legacyRoot = join(basePath, "specs", "iterations");
169
+ if (!existsSync(legacyRoot) || !statSync(legacyRoot).isDirectory()) {
170
+ return results;
171
+ }
172
+ // Record ids form from the leading number, so a move may collide
173
+ // with a differently named intents/ file on the same number; such
174
+ // a move is kept in place and reported against the id holder.
175
+ const numberTaken = new Map();
176
+ const targetRoot = join(basePath, "specs", "intents");
177
+ if (existsSync(targetRoot) && statSync(targetRoot).isDirectory()) {
178
+ for (const existing of listFiles(targetRoot)) {
179
+ const rel = relative(targetRoot, existing).replace(/\\/g, "/");
180
+ const digits = /^(\d+)/.exec(posix.basename(rel))?.[1];
181
+ if (digits !== undefined && !numberTaken.has(digits)) {
182
+ numberTaken.set(digits, posix.join("specs/intents", rel));
183
+ }
184
+ }
185
+ }
186
+ for (const source of listFiles(legacyRoot)) {
187
+ const suffix = relative(legacyRoot, source).replace(/\\/g, "/");
188
+ const legacyRelPath = posix.join("specs/iterations", suffix);
189
+ const targetRelPath = posix.join("specs/intents", suffix);
190
+ const target = join(basePath, targetRelPath);
191
+ if (existsSync(target)) {
192
+ results.push({ status: "conflict", targetRelPath, legacyRelPath });
193
+ continue;
194
+ }
195
+ const digits = /^(\d+)/.exec(posix.basename(suffix))?.[1];
196
+ const idHolder = digits === undefined ? undefined : numberTaken.get(digits);
197
+ if (idHolder !== undefined) {
198
+ results.push({
199
+ status: "conflict",
200
+ targetRelPath: idHolder,
201
+ legacyRelPath,
202
+ });
203
+ continue;
204
+ }
205
+ mkdirSync(dirname(target), { recursive: true });
206
+ renameSync(source, target);
207
+ if (digits !== undefined)
208
+ numberTaken.set(digits, targetRelPath);
209
+ results.push({ status: "migrated", targetRelPath, legacyRelPath });
210
+ }
211
+ removeEmptyDirectories(legacyRoot);
212
+ return results;
213
+ }
150
214
  // SCAF-21.
151
215
  export function getFileHistory(relPath) {
152
216
  const manifestPath = join(getScaffoldDir(), ".file-history.json");
@@ -156,6 +220,25 @@ export function getFileHistory(relPath) {
156
220
  const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
157
221
  return manifest[relPath] ?? [];
158
222
  }
223
+ // Hash histories of bundled files that no longer ship (the legacy
224
+ // user/dev/test seeds), so migration can tell an untouched old seed
225
+ // from user-authored content.
226
+ export function getLegacyFileHistory(relPath) {
227
+ const manifestPath = join(getScaffoldDir(), ".legacy-file-history.json");
228
+ if (!existsSync(manifestPath))
229
+ return [];
230
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
231
+ return manifest[relPath] ?? [];
232
+ }
233
+ /** isPristine over the legacy manifest (removed bundled paths). */
234
+ export function isLegacyPristine(basePath, relPath) {
235
+ const target = join(basePath, relPath);
236
+ if (!existsSync(target))
237
+ return "missing";
238
+ return getLegacyFileHistory(relPath).includes(hashFile(target))
239
+ ? "pristine"
240
+ : "modified";
241
+ }
159
242
  function getRecognizedFileHistory(relPath, language) {
160
243
  const history = new Set(getFileHistory(relPath));
161
244
  if (language !== "en") {
@@ -226,7 +309,7 @@ export function refreshPristineSeeds(basePath, options = {}) {
226
309
  for (const relPath of SEED_FILES) {
227
310
  const state = isPristine(basePath, relPath, language);
228
311
  if (state === "modified") {
229
- const indicator = formatSeedIndicator(relPath, "kept — user-modified", options.migratedFrom);
312
+ const indicator = formatSeedIndicator(relPath, options.indicatorOverrides?.get(relPath) ?? "kept — user-modified", options.migratedFrom);
230
313
  console.log(` ${relPath} (${indicator})`);
231
314
  continue;
232
315
  }
@@ -8,10 +8,8 @@ import { join } from "node:path";
8
8
  const DIRS = [
9
9
  "specs",
10
10
  "specs/decisions",
11
- "specs/iterations",
12
- "specs/user",
13
- "specs/dev",
14
- "specs/test",
11
+ "specs/intents",
12
+ "specs/packages",
15
13
  ];
16
14
  /**
17
15
  * Create the specs directory structure under basePath.
package/dist/lint.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export type LintSeverity = "error" | "warning";
2
+ export type LintFinding = {
3
+ path: string;
4
+ line: number;
5
+ severity: LintSeverity;
6
+ rule: string;
7
+ message: string;
8
+ };
9
+ /** Lint the specs tree under basePath (lint-10). */
10
+ export declare function lintSpecs(basePath: string): LintFinding[];
11
+ /**
12
+ * Entry point for the lint subcommand. Prints findings and exits
13
+ * non-zero when any error-severity finding exists (lint-1..3).
14
+ */
15
+ export declare function lint(args?: string[]): void;