ai-spector 0.2.8 → 0.2.9
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 +2 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/config/load.d.ts +2 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +6 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/types.d.ts +2 -0
- package/dist/config/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/scaffold/.ai-spector/docflow.config.json +2 -1
- package/scaffold/.cursor/commands/_generate-graph.md +2 -1
- package/scaffold/.cursor/commands/_prerequisites.md +1 -1
- package/scaffold/.cursor/commands/generate-basic-design.md +1 -1
- package/scaffold/.cursor/commands/generate-srs.md +1 -1
- package/scaffold/.cursor/commands/summary.md +1 -1
- package/scaffold/.cursor/skills/ai-spector/SKILL.md +17 -1
- package/templates/README.md +22 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ npm install ai-spector
|
|
|
17
17
|
npx ai-spector init
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Put your source files in `docs/data-source/`, open the folder in Cursor, turn on the **ai-spector** skill, and **reload MCP** (init writes `.cursor/mcp.json` for Graphify).
|
|
20
|
+
Put your source files in `docs/data-source/`, open the folder in Cursor, turn on the **ai-spector** skill, and **reload MCP** (init writes `.cursor/mcp.json` for Graphify). Init also copies SRS/basic/detail **templates** into `.ai-spector/templates/` so agents always find them in the project.
|
|
21
21
|
|
|
22
22
|
**Graphify requires:** [uv](https://docs.astral.sh/uv/) installed; package `graphifyy` is pulled via `uv tool run` on first MCP start.
|
|
23
23
|
|
|
@@ -112,6 +112,7 @@ your-project/
|
|
|
112
112
|
.cursor/commands/ # /analyze, /index, /impact, …
|
|
113
113
|
.cursor/skills/ai-spector/
|
|
114
114
|
.ai-spector/
|
|
115
|
+
templates/ # SRS / basic_design / detail_design (from init)
|
|
115
116
|
graph/traceability.graph.json
|
|
116
117
|
.docflow/analysis/knowledge.json
|
|
117
118
|
index/ # optional summaries (/summary)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA8D9D"}
|
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import { scaffoldBundleRoot } from "../config/load.js";
|
|
3
|
+
import { packageBundleRoot, scaffoldBundleRoot } from "../config/load.js";
|
|
4
4
|
import { copyTree, pathExists, writeJson } from "../util/fs.js";
|
|
5
5
|
import { ensureGraphifyMcpConfig } from "../util/mcp.js";
|
|
6
6
|
import { ensureAiSpectorGitignore } from "../util/gitignore.js";
|
|
@@ -12,6 +12,9 @@ export async function runInit(opts) {
|
|
|
12
12
|
}
|
|
13
13
|
const scaffold = scaffoldBundleRoot();
|
|
14
14
|
await copyTree(scaffold, root);
|
|
15
|
+
const projectTemplates = join(root, ".ai-spector", "templates");
|
|
16
|
+
await mkdir(projectTemplates, { recursive: true });
|
|
17
|
+
await copyTree(join(packageBundleRoot(), "templates"), projectTemplates);
|
|
15
18
|
const dirs = [
|
|
16
19
|
".ai-spector/graph",
|
|
17
20
|
".ai-spector/registry",
|
|
@@ -43,6 +46,7 @@ export async function runInit(opts) {
|
|
|
43
46
|
console.log("");
|
|
44
47
|
console.log(` MCP → ${mcpPath} (Graphify server added/updated)`);
|
|
45
48
|
console.log(` gitignore → ${gitignorePath} (ai-spector block added/updated)`);
|
|
49
|
+
console.log(` templates → ${projectTemplates} (SRS / basic / detail design)`);
|
|
46
50
|
console.log("");
|
|
47
51
|
console.log("Next steps (Cursor):");
|
|
48
52
|
console.log(" 1. Open this folder in Cursor");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAOhE,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAiB;IAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,I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AAO,GAAG,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAChD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACjC,MAAM,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE3D,OAAO,CAAC,GAAG,CAAC,qCAAqC,IAAI,EAAE,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,iBAAiB,OAAO,kCAAkC,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,iBAAiB,aAAa,mCAAmC,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,iBAAiB,gBAAgB,gCAAgC,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC,CAAC;IACzF,OAAO,CAAC,GAAG,CAAC,+DAA+D,CAAC,CAAC;IAC7E,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;AACzF,CAAC"}
|
package/dist/config/load.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare function loadDocflowConfig(root?: string): Promise<{
|
|
|
9
9
|
config: DocflowConfig;
|
|
10
10
|
configFile: string;
|
|
11
11
|
}>;
|
|
12
|
+
/** Resolved absolute path to project-local templates (`.ai-spector/templates`). */
|
|
13
|
+
export declare function resolveProjectTemplatesDir(root: string, config: DocflowConfig): string;
|
|
12
14
|
export declare function resolveFromRoot(root: string, relativePath: string): string;
|
|
13
15
|
export declare function bundledSchemaPath(): string;
|
|
14
16
|
export declare function bundledRulesTraceabilityPath(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKnE,mEAAmE;AACnE,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,eAAe,CAAC,KAAK,SAAgB,GAAG,MAAM,CAkB7D;
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAKnE,mEAAmE;AACnE,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,eAAe,CAAC,KAAK,SAAgB,GAAG,MAAM,CAkB7D;AAgBD,wBAAsB,iBAAiB,CACrC,IAAI,SAAoB,GACvB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAYtE;AAED,mFAAmF;AACnF,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,GACpB,MAAM,CAER;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAErD;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC,CASD"}
|
package/dist/config/load.js
CHANGED
|
@@ -38,6 +38,7 @@ function configPath(root) {
|
|
|
38
38
|
const DEFAULT_PATHS = {
|
|
39
39
|
graph: ".ai-spector/graph/traceability.graph.json",
|
|
40
40
|
registry: ".ai-spector/registry/section-registry.json",
|
|
41
|
+
templates: ".ai-spector/templates",
|
|
41
42
|
};
|
|
42
43
|
export async function loadDocflowConfig(root = findProjectRoot()) {
|
|
43
44
|
const configFile = configPath(root);
|
|
@@ -47,10 +48,15 @@ export async function loadDocflowConfig(root = findProjectRoot()) {
|
|
|
47
48
|
paths: {
|
|
48
49
|
graph: raw.paths?.graph ?? DEFAULT_PATHS.graph,
|
|
49
50
|
registry: raw.paths?.registry ?? DEFAULT_PATHS.registry,
|
|
51
|
+
templates: raw.paths?.templates ?? DEFAULT_PATHS.templates,
|
|
50
52
|
},
|
|
51
53
|
};
|
|
52
54
|
return { root, config, configFile };
|
|
53
55
|
}
|
|
56
|
+
/** Resolved absolute path to project-local templates (`.ai-spector/templates`). */
|
|
57
|
+
export function resolveProjectTemplatesDir(root, config) {
|
|
58
|
+
return resolve(root, config.paths.templates ?? DEFAULT_PATHS.templates);
|
|
59
|
+
}
|
|
54
60
|
export function resolveFromRoot(root, relativePath) {
|
|
55
61
|
return resolve(root, relativePath);
|
|
56
62
|
}
|
package/dist/config/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],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types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,mBAAmB,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -83,7 +83,8 @@ Respect `regenerate` / `review` buckets; do not rewrite unrelated chapters.
|
|
|
83
83
|
|
|
84
84
|
### D. Write
|
|
85
85
|
|
|
86
|
-
-
|
|
86
|
+
- **Read the template** from `.ai-spector/templates/` (path = DAG `template` value, e.g. `srs/3-use-cases.md`, `basic_design/list-api-template.md`). If missing, stop and ask the user to run `npx ai-spector init`.
|
|
87
|
+
- Fill that template for the target only — keep all required headings/sections; replace placeholders with graph-backed content.
|
|
87
88
|
- Cross-check every UC/F reference against `nodes` from query JSON.
|
|
88
89
|
- Add section anchors `<!-- section:sec.... -->` where templates expect them.
|
|
89
90
|
|
|
@@ -6,7 +6,7 @@ Load `.ai-spector/.docflow/config/workflow.dependencies.json` for the active ste
|
|
|
6
6
|
|
|
7
7
|
## When checks fail
|
|
8
8
|
|
|
9
|
-
1. **Stop immediately** — do not read templates
|
|
9
|
+
1. **Stop immediately** — do not read `.ai-spector/templates/`, spawn subagents, or write outputs.
|
|
10
10
|
2. Reply with the **Blocked** format in [_cli-failures.md](./_cli-failures.md) (include full CLI output).
|
|
11
11
|
3. Help the user fix the issue; re-run the failed CLI; then continue the slash command.
|
|
12
12
|
|
|
@@ -96,7 +96,7 @@ ai-spector graph validate
|
|
|
96
96
|
|
|
97
97
|
#### 3b. Write
|
|
98
98
|
|
|
99
|
-
-
|
|
99
|
+
- Read DAG `template` files under **`.ai-spector/templates/`** (e.g. `.ai-spector/templates/basic_design/list-screen-template.md`). Missing folder → user must run `npx ai-spector init`.
|
|
100
100
|
- Align API/screen names with graph `feature` titles and SRS feature detail files.
|
|
101
101
|
|
|
102
102
|
#### 3c. Ingest (mandatory before next wave)
|
|
@@ -103,7 +103,7 @@ Read **only** paths from `projectionPaths` plus targeted `docs/data-source/**` f
|
|
|
103
103
|
|
|
104
104
|
#### 3b. Write one file
|
|
105
105
|
|
|
106
|
-
-
|
|
106
|
+
- Read the DAG `template` file under **`.ai-spector/templates/`** (e.g. `.ai-spector/templates/srs/1-introduction.md`). Missing folder → user must run `npx ai-spector init`.
|
|
107
107
|
- Content must match graph: UC list from `listedIn` on `useCase` nodes; features from `feature` + `satisfies`.
|
|
108
108
|
- No fabricated requirements.
|
|
109
109
|
|
|
@@ -31,7 +31,7 @@ Warn if no files to index; do not block. See `workflow.dependencies.json` warn s
|
|
|
31
31
|
## Guardrails
|
|
32
32
|
|
|
33
33
|
- Summaries do **not** replace graph for `/generate-*` when graph is populated.
|
|
34
|
-
- Never summarize templates
|
|
34
|
+
- Never summarize templates under `.ai-spector/templates/` (reference only during generation).
|
|
35
35
|
|
|
36
36
|
## Success
|
|
37
37
|
|
|
@@ -43,4 +43,20 @@ Context: **`ai-spector graph query <seedId> --json`** — depth 4 for targets, d
|
|
|
43
43
|
|
|
44
44
|
**Generate:** accuracy over speed — batch only same-wave independent targets; merge + validate after each wave.
|
|
45
45
|
|
|
46
|
-
Templates
|
|
46
|
+
## Templates (mandatory path)
|
|
47
|
+
|
|
48
|
+
`npx ai-spector init` copies bundled templates to **`.ai-spector/templates/`** (see `docflow.config.json` → `paths.templates`).
|
|
49
|
+
|
|
50
|
+
Before `/generate-srs`, `/generate-basic-design`, or `/generate-detail-design`:
|
|
51
|
+
|
|
52
|
+
1. **Read** the template file from `.ai-spector/templates/` (DAG `template` field is relative to that root, e.g. `srs/1-introduction.md`, `basic_design/list-screen-template.md`).
|
|
53
|
+
2. **Preserve** the template’s headings and section order in the output under `docs/`.
|
|
54
|
+
3. If `.ai-spector/templates/` is missing, tell the user to run **`npx ai-spector init`** (or `init --force` to refresh) — do not guess structure from memory or search `node_modules`.
|
|
55
|
+
|
|
56
|
+
| Kind | Directory |
|
|
57
|
+
|------|-----------|
|
|
58
|
+
| SRS | `.ai-spector/templates/srs/` |
|
|
59
|
+
| Basic design | `.ai-spector/templates/basic_design/` |
|
|
60
|
+
| Detail design | `.ai-spector/templates/detail_design/` |
|
|
61
|
+
|
|
62
|
+
Optional index: `.ai-spector/templates/README.md`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Documentation templates
|
|
2
|
+
|
|
3
|
+
This folder is copied into your project at **`.ai-spector/templates/`** when you run `npx ai-spector init`.
|
|
4
|
+
|
|
5
|
+
## For Cursor agents
|
|
6
|
+
|
|
7
|
+
**Always read templates from the project copy**, not from `node_modules`:
|
|
8
|
+
|
|
9
|
+
| Kind | Path (after init) |
|
|
10
|
+
|------|-------------------|
|
|
11
|
+
| SRS | `.ai-spector/templates/srs/` |
|
|
12
|
+
| Basic design | `.ai-spector/templates/basic_design/` |
|
|
13
|
+
| Detail design | `.ai-spector/templates/detail_design/` |
|
|
14
|
+
|
|
15
|
+
DAG config (`dag.*.json`) lists template filenames relative to this root (e.g. `srs/1-introduction.md`, `basic_design/list-api-template.md`).
|
|
16
|
+
|
|
17
|
+
When generating markdown under `docs/`, **preserve each template’s headings and section order**; replace placeholders with graph- and data-source-backed content.
|
|
18
|
+
|
|
19
|
+
## For developers
|
|
20
|
+
|
|
21
|
+
- Re-run `npx ai-spector init --force` to refresh scaffold files and template copies from the installed package.
|
|
22
|
+
- Editing files here is safe for project-specific wording; re-init overwrites them unless you back up changes first.
|