ai-spector 0.3.1 → 0.3.2
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 +136 -14
- package/dist/cli.js +97 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/comments.d.ts +41 -0
- package/dist/commands/comments.d.ts.map +1 -0
- package/dist/commands/comments.js +138 -0
- package/dist/commands/comments.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +22 -5
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/sync-cursor.d.ts +6 -0
- package/dist/commands/sync-cursor.d.ts.map +1 -0
- package/dist/commands/sync-cursor.js +18 -0
- package/dist/commands/sync-cursor.js.map +1 -0
- package/dist/comments/anchor.d.ts +16 -0
- package/dist/comments/anchor.d.ts.map +1 -0
- package/dist/comments/anchor.js +59 -0
- package/dist/comments/anchor.js.map +1 -0
- package/dist/comments/inbox.d.ts +83 -0
- package/dist/comments/inbox.d.ts.map +1 -0
- package/dist/comments/inbox.js +180 -0
- package/dist/comments/inbox.js.map +1 -0
- package/dist/comments/paths.d.ts +12 -0
- package/dist/comments/paths.d.ts.map +1 -0
- package/dist/comments/paths.js +54 -0
- package/dist/comments/paths.js.map +1 -0
- package/dist/comments/plan.d.ts +20 -0
- package/dist/comments/plan.d.ts.map +1 -0
- package/dist/comments/plan.js +62 -0
- package/dist/comments/plan.js.map +1 -0
- package/dist/comments/storage.d.ts +30 -0
- package/dist/comments/storage.d.ts.map +1 -0
- package/dist/comments/storage.js +272 -0
- package/dist/comments/storage.js.map +1 -0
- package/dist/comments/types.d.ts +54 -0
- package/dist/comments/types.d.ts.map +1 -0
- package/dist/comments/types.js +2 -0
- package/dist/comments/types.js.map +1 -0
- package/dist/config/load.d.ts +2 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +4 -0
- package/dist/config/load.js.map +1 -1
- package/dist/postinstall.d.ts +3 -0
- package/dist/postinstall.d.ts.map +1 -0
- package/dist/postinstall.js +44 -0
- package/dist/postinstall.js.map +1 -0
- package/package.json +3 -5
- package/scaffold/{.cursor → cursor}/commands/_workflow.md +7 -3
- package/scaffold/cursor/commands/resolve-comments.md +145 -0
- package/scaffold/cursor/skills/_skill-router.md +22 -0
- package/scaffold/cursor/skills/ai-spector/SKILL.md +47 -0
- package/scaffold/cursor/skills/ai-spector-generate/SKILL.md +41 -0
- package/scaffold/cursor/skills/ai-spector-graph/SKILL.md +39 -0
- package/scaffold/cursor/skills/ai-spector-resolve-comments/SKILL.md +42 -0
- package/scaffold/.cursor/skills/ai-spector/SKILL.md +0 -62
- /package/scaffold/{.cursor → cursor}/commands/_cli-failures.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/_generate-graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/_graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/_prerequisites.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/analyze.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/generate-basic-design.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/generate-detail-design.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/generate-srs.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/graph-impact.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/impact.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/index.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/link-graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/summary.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/sync-graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/validate-graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/commands/visualize-graph.md +0 -0
- /package/scaffold/{.cursor → cursor}/mcp.json +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# /resolve-comments
|
|
2
|
+
|
|
3
|
+
IDE-first workflow (Cursor) for **git-backed review comments** under `comments/`. Web reviewers create threads; you resolve locally: inbox in chat → pick thread → impact → propose edit → apply → commit (doc + resolve meta) → push.
|
|
4
|
+
|
|
5
|
+
No Writer API — storage is git-only (`meta_data.json` + `events.jsonl`).
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
| You say | Agent does |
|
|
10
|
+
|---------|------------|
|
|
11
|
+
| `/resolve-comments` | Inbox table in chat → wait for your pick |
|
|
12
|
+
| `/resolve-comments C-001` | Plan + impact for pick **C-001** |
|
|
13
|
+
| `/resolve-comments srs/01-overview` | Inbox filtered to that file |
|
|
14
|
+
|
|
15
|
+
## IDE workflow (agent — follow in order)
|
|
16
|
+
|
|
17
|
+
### Phase 0 — Sync
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
git pull
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Phase 1 — Show thread pick list in chat (user selects)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ai-spector comments inbox --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**IDE presentation (required):**
|
|
30
|
+
|
|
31
|
+
1. Read `idePresentation.markdown` from JSON — render **only that markdown table** in chat.
|
|
32
|
+
2. Follow `idePresentation.rules`: **one row per open thread**, not per reply; **no raw JSON**; **no thread uuids** in user-facing text.
|
|
33
|
+
3. Use **pick ids** (`C-001`, `C-002`, …) for selection.
|
|
34
|
+
|
|
35
|
+
Example table (from CLI):
|
|
36
|
+
|
|
37
|
+
| Pick | Document | Lines | Lang | Reviewer ask |
|
|
38
|
+
|------|----------|-------|------|--------------|
|
|
39
|
+
| **C-001** | `docs/srs/01-overview.md` | 12-14 | EN | Please clarify… |
|
|
40
|
+
|
|
41
|
+
**Stop and ask:** “Which thread should we resolve? Reply with **C-00N**.”
|
|
42
|
+
|
|
43
|
+
Do not start editing until the user picks (unless they already passed `C-001` in the slash command).
|
|
44
|
+
|
|
45
|
+
**Do not use** `comments list` for user selection — use **`comments inbox`** only.
|
|
46
|
+
|
|
47
|
+
### Phase 2 — Plan + impact (after pick)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
ai-spector comments plan C-001 --json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Show in chat:** full thread comments, anchored doc text, impact summary, regen targets.
|
|
54
|
+
|
|
55
|
+
### Phase 3 — Propose edit (user approval required)
|
|
56
|
+
|
|
57
|
+
1. Quote anchored lines + reviewer ask
|
|
58
|
+
2. Propose concrete markdown change
|
|
59
|
+
3. Ask: **“Apply this edit?”** — wait for explicit approval
|
|
60
|
+
|
|
61
|
+
### Phase 4 — Apply edit
|
|
62
|
+
|
|
63
|
+
Edit `anchor.docPath` at lines `startLine`–`endLine`. Show diff summary in chat.
|
|
64
|
+
|
|
65
|
+
### Phase 5 — Resolve status + single git commit (doc + comment meta)
|
|
66
|
+
|
|
67
|
+
Each resolve must land in git with **both** the **document fix** and **comment thread metadata** — never commit only `comments/` without the changed doc file.
|
|
68
|
+
|
|
69
|
+
**Steps:**
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# 1) Stage and commit doc fix first (establishes resolvedInCommitSha target)
|
|
73
|
+
git add docs/srs/....md
|
|
74
|
+
git commit -m "fix(docs): address comment C-001 on srs/01-overview lines 12-14"
|
|
75
|
+
|
|
76
|
+
# 2) Write resolve meta pointing at that doc commit
|
|
77
|
+
ai-spector comments resolve <threadId> --file srs/01-overview \
|
|
78
|
+
--expected-version <v from plan> --json
|
|
79
|
+
|
|
80
|
+
# 3) Stage comment meta AND re-include doc in the same final commit
|
|
81
|
+
git add comments/srs/01-overview/<threadId>/ docs/srs/....md
|
|
82
|
+
git commit --amend -m "fix(docs): address comment C-001 on srs/01-overview lines 12-14
|
|
83
|
+
|
|
84
|
+
Resolved thread <threadId>. Pick C-001."
|
|
85
|
+
|
|
86
|
+
git push
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Why amend:** `comments resolve` needs HEAD after the doc commit for `resolvedInCommitSha`. Amending folds `meta_data.json` + `events.jsonl` into the **same commit** as the doc change so one push contains the full resolve.
|
|
90
|
+
|
|
91
|
+
**Commit must include:**
|
|
92
|
+
|
|
93
|
+
| Path | Content |
|
|
94
|
+
|------|---------|
|
|
95
|
+
| `docs/…` | Edited document (the fix) |
|
|
96
|
+
| `comments/…/{thread_id}/meta_data.json` | `status: resolved`, `resolvedInCommitSha`, … |
|
|
97
|
+
| `comments/…/{thread_id}/events.jsonl` | append `resolved` event |
|
|
98
|
+
|
|
99
|
+
**Never:** `git add` only `comments/` while doc changes stay unstaged or uncommitted.
|
|
100
|
+
|
|
101
|
+
If HEAD moved before resolve, pass `--commit-sha <doc-fix-sha>` explicitly.
|
|
102
|
+
|
|
103
|
+
### Phase 6 — Optional follow-up
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
ai-spector index
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or targeted `/generate-srs` / `/generate-basic-design` when plan lists regen targets.
|
|
110
|
+
|
|
111
|
+
## Multi-thread session
|
|
112
|
+
|
|
113
|
+
Re-run `comments inbox --json` → show `idePresentation.markdown` → ask for next pick.
|
|
114
|
+
|
|
115
|
+
## Chat presentation rules
|
|
116
|
+
|
|
117
|
+
- Inbox: **`idePresentation.markdown` table only** (threads, not replies)
|
|
118
|
+
- Plan/impact: full detail after pick
|
|
119
|
+
- Commits: **doc file + comment meta together** (amend pattern above)
|
|
120
|
+
- Pick ids in chat; thread ids only in CLI args
|
|
121
|
+
|
|
122
|
+
## CLI reference
|
|
123
|
+
|
|
124
|
+
| Command | Purpose |
|
|
125
|
+
|---------|---------|
|
|
126
|
+
| `comments inbox [--json]` | Thread pick list + `idePresentation` for chat |
|
|
127
|
+
| `comments plan C-001 [--json]` | Anchor excerpt + graph impact |
|
|
128
|
+
| `comments resolve <threadId> --file <path> [--expected-version]` | Update meta before final amend commit |
|
|
129
|
+
|
|
130
|
+
## Guardrails
|
|
131
|
+
|
|
132
|
+
- No Writer API
|
|
133
|
+
- No resolve before doc edit is applied
|
|
134
|
+
- No commit with only metadata — **always include changed doc file**
|
|
135
|
+
- No push until amend commit contains doc + `comments/…/thread/`
|
|
136
|
+
|
|
137
|
+
## If blocked
|
|
138
|
+
|
|
139
|
+
See [_cli-failures.md](./_cli-failures.md).
|
|
140
|
+
|
|
141
|
+
| Issue | Fix |
|
|
142
|
+
|-------|-----|
|
|
143
|
+
| Unknown C-00N | Re-run `comments inbox --json` |
|
|
144
|
+
| Stale version | Re-run `comments plan`, refresh `--expected-version` |
|
|
145
|
+
| Doc missing from commit | `git status` — stage `docs/…` before amend |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# AI Spector skill router
|
|
2
|
+
|
|
3
|
+
Cursor loads skills by **description** when the user does not use a slash command. Enable **all** skills under `.cursor/skills/` after `init`.
|
|
4
|
+
|
|
5
|
+
## Skills
|
|
6
|
+
|
|
7
|
+
| Skill folder | When Cursor should use it |
|
|
8
|
+
|--------------|---------------------------|
|
|
9
|
+
| `ai-spector` | Any ai-spector / docflow / `.ai-spector` project work; shared CLI rules |
|
|
10
|
+
| `ai-spector-graph` | Analyze, index, validate, impact, visualize, Graphify, knowledge.json, regen scope |
|
|
11
|
+
| `ai-spector-generate` | Generate or update SRS, basic design, detail design under `docs/` |
|
|
12
|
+
| `ai-spector-resolve-comments` | Review comments in `comments/`, resolve threads, C-001 pick list |
|
|
13
|
+
|
|
14
|
+
## Slash commands (explicit)
|
|
15
|
+
|
|
16
|
+
When the user runs `/analyze`, `/generate-srs`, `/resolve-comments`, etc., read the matching file in `.cursor/commands/` — skills and commands share the same rules.
|
|
17
|
+
|
|
18
|
+
## Priority
|
|
19
|
+
|
|
20
|
+
1. Explicit slash command → `commands/<name>.md`
|
|
21
|
+
2. Natural language → task skill above + same command doc when one exists
|
|
22
|
+
3. Ambiguous → `ai-spector` core + ask which task (graph vs generate vs comments)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector
|
|
3
|
+
description: >-
|
|
4
|
+
AI Spector docflow core — traceability graph, .ai-spector project, CLI failure rules, templates.
|
|
5
|
+
Use when working in an ai-spector project but task is unclear; read _skill-router.md to pick a task skill.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AI Spector (core)
|
|
9
|
+
|
|
10
|
+
Shared rules for **all** ai-spector work. For a specific task, also load the matching task skill (see router below).
|
|
11
|
+
|
|
12
|
+
**Workflow index:** `.cursor/commands/_workflow.md`
|
|
13
|
+
**Skill router:** `.cursor/skills/_skill-router.md`
|
|
14
|
+
|
|
15
|
+
## CLI failure rule (non-negotiable)
|
|
16
|
+
|
|
17
|
+
When `ai-spector` exits non-zero or required `--json` is missing/invalid:
|
|
18
|
+
|
|
19
|
+
1. **Stop** — no generate, no bulk `docs/srs/**` reads, no hand-editing the whole graph.
|
|
20
|
+
2. **Report** per `.cursor/commands/_cli-failures.md` (verbatim CLI output + fix steps).
|
|
21
|
+
3. **Fix**, then **re-run the same CLI**.
|
|
22
|
+
|
|
23
|
+
Never bypass CLI with manual graph edits or invented content.
|
|
24
|
+
|
|
25
|
+
## Graphify MCP
|
|
26
|
+
|
|
27
|
+
`init` writes `.cursor/mcp.json` → graph at `.ai-spector/.docflow/graph/graphify-out/graph.json`.
|
|
28
|
+
|
|
29
|
+
## Heart of the system
|
|
30
|
+
|
|
31
|
+
`.ai-spector/graph/traceability.graph.json` — context via `ai-spector graph query <id> --json`.
|
|
32
|
+
|
|
33
|
+
Run CLI from project root; prefer `npx ai-spector` if not on PATH.
|
|
34
|
+
|
|
35
|
+
## Task skills (auto-routing)
|
|
36
|
+
|
|
37
|
+
| User intent | Skill | Command doc |
|
|
38
|
+
|-------------|-------|---------------|
|
|
39
|
+
| Analyze, index, validate, impact, visualize graph | `ai-spector-graph` | `commands/analyze.md`, `index.md`, `impact.md`, … |
|
|
40
|
+
| Generate SRS / basic design / detail design | `ai-spector-generate` | `commands/generate-*.md` |
|
|
41
|
+
| Resolve review comments under `comments/` | `ai-spector-resolve-comments` | `commands/resolve-comments.md` |
|
|
42
|
+
|
|
43
|
+
When the user uses a **slash command** (`/analyze`, `/generate-srs`, `/resolve-comments`), follow that command file directly — skills reinforce the same rules.
|
|
44
|
+
|
|
45
|
+
## Templates
|
|
46
|
+
|
|
47
|
+
Read from `.ai-spector/templates/` before any generation. Missing templates → `npx ai-spector init --force`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector-generate
|
|
3
|
+
description: >-
|
|
4
|
+
AI Spector document generation — SRS, basic design, detail design from traceability graph.
|
|
5
|
+
Use for /generate-srs, /generate-basic-design, /generate-detail-design, or when user asks to
|
|
6
|
+
generate, write, or update requirements specs, SRS chapters, basic design, detail design, or docs under docs/srs docs/basic-design.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AI Spector — Generate
|
|
10
|
+
|
|
11
|
+
**Core rules:** `.cursor/skills/ai-spector/SKILL.md`
|
|
12
|
+
**Graph context:** `.cursor/commands/_generate-graph.md`, `_graph.md`
|
|
13
|
+
|
|
14
|
+
## Route to command doc
|
|
15
|
+
|
|
16
|
+
| Trigger | Read first | Notes |
|
|
17
|
+
|---------|------------|-------|
|
|
18
|
+
| `/generate-srs`, SRS, requirements spec | `commands/generate-srs.md` | DAG waves, `graph query`, templates in `.ai-spector/templates/srs/` |
|
|
19
|
+
| `/generate-basic-design`, screens, APIs, DB design | `commands/generate-basic-design.md` | `templates/basic_design/` |
|
|
20
|
+
| `/generate-detail-design` | `commands/generate-detail-design.md` | `templates/detail_design/` |
|
|
21
|
+
|
|
22
|
+
## Before generating
|
|
23
|
+
|
|
24
|
+
1. **`ai-spector graph validate`** should pass (or run `/validate-graph` first).
|
|
25
|
+
2. **Read the template** from `.ai-spector/templates/` — never guess structure.
|
|
26
|
+
3. After each wave: **`graph merge`** projection patch with `rendersTo` + `dependsOn`.
|
|
27
|
+
4. After SRS generation: recommend **`/index`**.
|
|
28
|
+
|
|
29
|
+
## Natural language → command
|
|
30
|
+
|
|
31
|
+
| User says | Action |
|
|
32
|
+
|-----------|--------|
|
|
33
|
+
| "generate SRS", "write requirements", "create use case docs" | `generate-srs.md` |
|
|
34
|
+
| "basic design", "screen list", "API design doc" | `generate-basic-design.md` |
|
|
35
|
+
| "detail design", "feature detail doc" | `generate-detail-design.md` |
|
|
36
|
+
|
|
37
|
+
Confirm scope when user describes generation in natural language (not explicit paths).
|
|
38
|
+
|
|
39
|
+
## Generate discipline
|
|
40
|
+
|
|
41
|
+
Accuracy over speed — batch only same-wave independent targets; merge + validate after each wave.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector-graph
|
|
3
|
+
description: >-
|
|
4
|
+
AI Spector graph operations — analyze docs/data-source, index refresh, validate traceability graph,
|
|
5
|
+
impact/regen scope, visualize graph, link semantic edges. Use for /analyze, /index, /validate-graph,
|
|
6
|
+
/impact, /visualize-graph, or when user asks about traceability graph, knowledge.json, Graphify, or what to regenerate.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AI Spector — Graph
|
|
10
|
+
|
|
11
|
+
**Core rules:** `.cursor/skills/ai-spector/SKILL.md` (CLI failure, graph path).
|
|
12
|
+
|
|
13
|
+
## Route to command doc
|
|
14
|
+
|
|
15
|
+
| Trigger | Read first | CLI |
|
|
16
|
+
|---------|------------|-----|
|
|
17
|
+
| `/analyze`, ingest data-source, extract knowledge | `commands/analyze.md` | `ai-spector analyze` → graphify → merge → validate |
|
|
18
|
+
| `/index`, refresh graph after edits | `commands/index.md` | `ai-spector index` |
|
|
19
|
+
| `/validate-graph`, graph errors | `commands/validate-graph.md` | `ai-spector graph validate` |
|
|
20
|
+
| `/impact`, what breaks, regen scope, git diff impact | `commands/impact.md` | `ai-spector graph impact … --json` |
|
|
21
|
+
| `/visualize-graph`, explore graph in browser | `commands/visualize-graph.md` | `ai-spector graph visualize --open` |
|
|
22
|
+
| `/link-graph`, semantic relatesTo edges | `commands/link-graph.md` | `graph merge --semantic` |
|
|
23
|
+
| `/sync-graph` | `commands/sync-graph.md` | per command |
|
|
24
|
+
| `/summary` (index summaries only) | `commands/summary.md` | index build under `.ai-spector/index/` |
|
|
25
|
+
|
|
26
|
+
## Natural language → command
|
|
27
|
+
|
|
28
|
+
| User says | Action |
|
|
29
|
+
|-----------|--------|
|
|
30
|
+
| "analyze my data source", "run analyze" | `/analyze` flow → `analyze.md` |
|
|
31
|
+
| "refresh the graph", "re-index" | `/index` → `index.md` |
|
|
32
|
+
| "validate graph", "graph has errors" | `/validate-graph` |
|
|
33
|
+
| "what's the impact", "what do I need to regenerate" | `/impact` → `impact.md` |
|
|
34
|
+
| "show the graph", "visualize traceability" | `/visualize-graph` |
|
|
35
|
+
|
|
36
|
+
## References
|
|
37
|
+
|
|
38
|
+
- Graph CLI details: `commands/_graph.md`
|
|
39
|
+
- Generate graph patches: `commands/_generate-graph.md`
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector-resolve-comments
|
|
3
|
+
description: >-
|
|
4
|
+
AI Spector git-backed review comment resolve — list open threads, pick C-001, plan with impact,
|
|
5
|
+
propose doc fix, commit doc + comment meta. Use for /resolve-comments, comments/ folder,
|
|
6
|
+
meta_data.json, reviewer comments on SRS/basic design, or "resolve this comment thread".
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# AI Spector — Resolve comments
|
|
10
|
+
|
|
11
|
+
**Core rules:** `.cursor/skills/ai-spector/SKILL.md`
|
|
12
|
+
**Full workflow:** `.cursor/commands/resolve-comments.md` (follow step-by-step)
|
|
13
|
+
|
|
14
|
+
## Quick flow
|
|
15
|
+
|
|
16
|
+
1. `git pull`
|
|
17
|
+
2. `ai-spector comments inbox --json` → show **`idePresentation.markdown`** only (thread table, pick ids)
|
|
18
|
+
3. User picks **C-00N** → `ai-spector comments plan C-00N --json` (impact + anchor)
|
|
19
|
+
4. Propose edit → user approves → apply to `docs/…`
|
|
20
|
+
5. Commit doc → `comments resolve` → amend commit with **doc + `comments/…/thread/`** → push
|
|
21
|
+
|
|
22
|
+
## CLI
|
|
23
|
+
|
|
24
|
+
| Step | Command |
|
|
25
|
+
|------|---------|
|
|
26
|
+
| Inbox | `ai-spector comments inbox --json` |
|
|
27
|
+
| Plan | `ai-spector comments plan C-001 --json` |
|
|
28
|
+
| Resolve meta | `ai-spector comments resolve <threadId> --file <logical_path> --expected-version <v>` |
|
|
29
|
+
|
|
30
|
+
## Natural language → this skill
|
|
31
|
+
|
|
32
|
+
| User says | Action |
|
|
33
|
+
|-----------|--------|
|
|
34
|
+
| "resolve comments", "fix review comments", "open comment threads" | Start inbox flow |
|
|
35
|
+
| "address C-001", "resolve thread on srs/…" | `plan` then edit + commit |
|
|
36
|
+
| "comments under comments/" | Git-only F-05 flow — no Writer API |
|
|
37
|
+
|
|
38
|
+
## Guardrails
|
|
39
|
+
|
|
40
|
+
- Inbox: thread table only — no raw JSON or thread uuids in chat
|
|
41
|
+
- Commit must include **changed doc file** and comment meta (amend pattern in `resolve-comments.md`)
|
|
42
|
+
- No resolve before doc fix is applied
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ai-spector
|
|
3
|
-
description: "Cursor-first docs: user runs slash commands; agent runs CLI; on CLI failure stop and help fix — no manual bypass."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# AI Spector Skill
|
|
7
|
-
|
|
8
|
-
**Workflow:** `.cursor/commands/_workflow.md` — user only runs `npx ai-spector init` once, then slash commands.
|
|
9
|
-
|
|
10
|
-
**Graphify MCP:** `init` configures `.cursor/mcp.json` → graph file at `.ai-spector/.docflow/graph/graphify-out/graph.json` (not `docs/data-source/graphify-out/`).
|
|
11
|
-
|
|
12
|
-
## CLI failure rule (non-negotiable)
|
|
13
|
-
|
|
14
|
-
When `ai-spector` exits non-zero or required `--json` is missing/invalid:
|
|
15
|
-
|
|
16
|
-
1. **Stop** — no generate, no bulk `docs/srs/**` reads, no hand-editing the whole graph.
|
|
17
|
-
2. **Report** using the format in `.cursor/commands/_cli-failures.md` (verbatim CLI output + plain fix steps).
|
|
18
|
-
3. **Fix** the root cause, then **re-run the same CLI** and continue the slash command.
|
|
19
|
-
|
|
20
|
-
Never ignore CLI errors and “work around” with index files, manual BFS, or inventing graph content. See `_cli-failures.md` for forbidden fallbacks.
|
|
21
|
-
|
|
22
|
-
## Slash commands (user)
|
|
23
|
-
|
|
24
|
-
| Command | Agent runs CLI |
|
|
25
|
-
|---------|----------------|
|
|
26
|
-
| `/analyze` | `analyze` → `graphify update` → Graphify MCP extract → `graph merge` → `graph validate` |
|
|
27
|
-
| `/index` | `ai-spector index` — rebuild graph structure, re-merge knowledge, Graphify storage, doc indexes |
|
|
28
|
-
| `/summary` | Build `.ai-spector/index/*.md` summaries (optional; graph is primary for generation) |
|
|
29
|
-
| `/validate-graph` | `graph validate` |
|
|
30
|
-
| `/visualize-graph` | `graph visualize --open` |
|
|
31
|
-
| `/generate-srs` | All DAG, explicit paths, or natural-language scope (confirm before gen) → waves → query → write → merge |
|
|
32
|
-
| `/impact` | Empty args → git diff + seeds; else resolve → `graph impact <id> --json` (optional `--git` / `--file` / `--heading`) |
|
|
33
|
-
| `/generate-basic-design` | Same as SRS: all / paths / request (**confirm**) → waves → query → merge (`dag.basic-design.*`) |
|
|
34
|
-
| `/generate-detail-design` | `graph query` per target |
|
|
35
|
-
|
|
36
|
-
Run CLI from **project workspace root**; prefer `npx ai-spector` if the binary is not on PATH.
|
|
37
|
-
|
|
38
|
-
## Heart of the system
|
|
39
|
-
|
|
40
|
-
`.ai-spector/graph/traceability.graph.json`
|
|
41
|
-
|
|
42
|
-
Context: **`ai-spector graph query <seedId> --json`** — depth 4 for targets, depth 2 for DAG deps; use `projectionPaths`. After each generated file: **`graph merge`** projection patch with `rendersTo` + `dependsOn`. Details: `_generate-graph.md`, `_graph.md`.
|
|
43
|
-
|
|
44
|
-
**Generate:** accuracy over speed — batch only same-wave independent targets; merge + validate after each wave.
|
|
45
|
-
|
|
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`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|