ai-spector 0.8.30 → 0.8.32
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/package.json +1 -1
- package/scaffold/claude/.claude/skills/ai-spector-resolve-task/skill.md +43 -0
- package/scaffold/claude/CLAUDE.md +3 -0
- package/scaffold/cursor/WORKFLOW.md +1 -0
- package/scaffold/cursor/skills/README.md +1 -0
- package/scaffold/cursor/skills/_skill-router.md +1 -0
- package/scaffold/cursor/skills/ai-spector/SKILL.md +4 -1
- package/scaffold/cursor/skills/ai-spector-resolve-task/SKILL.md +38 -0
- package/scaffold/cursor/skills/ai-spector-resolve-task/references/runbook.md +177 -0
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector-resolve-task
|
|
3
|
+
description: >-
|
|
4
|
+
Conversational task workflow (create task, resolve task): clarify intent, build
|
|
5
|
+
GoalSpec + TaskPlan, get approval, then execute via resolve_task MCP or CLI.
|
|
6
|
+
Use for create task, add/update requirements, doc edits, prototype changes, or
|
|
7
|
+
any multi-step change described in natural language.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# AI Spector — Resolve Task
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- "create task", "create a task", "new task", "resolve task"
|
|
15
|
+
- "add requirement", "update docs", "change prototype", "I want to…", "we need to…"
|
|
16
|
+
- Any open-ended doc/graph change that is not a full generate-from-scratch workflow
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
1. Receive user intent (do not act yet)
|
|
22
|
+
2. Ask ≤3 clarifying questions → build GoalSpec
|
|
23
|
+
3. Show GoalSpec + TaskPlan → wait for approval
|
|
24
|
+
4. Execute: direct edits + resolve_task MCP (or CLI)
|
|
25
|
+
5. Report state update
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Full runbook: `.cursor/skills/ai-spector-resolve-task/references/runbook.md` (same content after init/sync-cursor).
|
|
29
|
+
|
|
30
|
+
## Checklist
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
- [ ] Clarified intent → GoalSpec (domain, scope, criteria)
|
|
34
|
+
- [ ] Showed plan and got user approval
|
|
35
|
+
- [ ] Executed steps (edits + resolve_task for index/graph steps)
|
|
36
|
+
- [ ] Reported results + state update
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## MCP
|
|
40
|
+
|
|
41
|
+
`resolve_task({ intent, goalSpec, plan, dryRun? })` — only after user approves the plan.
|
|
42
|
+
|
|
43
|
+
CLI fallback: `npx ai-spector resolve-task plan.json`
|
|
@@ -90,6 +90,7 @@ Skip impact/index only when the user explicitly says it was a typo-only fix with
|
|
|
90
90
|
| Translation status | `ai-spector-lang-status` |
|
|
91
91
|
| Resolve translations | `ai-spector-resolve-translation` |
|
|
92
92
|
| Resolve comments | `ai-spector-resolve-comments` |
|
|
93
|
+
| Create task / open-ended doc change | `ai-spector-resolve-task` |
|
|
93
94
|
|
|
94
95
|
## Quick reference
|
|
95
96
|
|
|
@@ -111,6 +112,7 @@ Skip impact/index only when the user explicitly says it was a typo-only fix with
|
|
|
111
112
|
| `cocoindex_index({})` | Rebuild semantic embeddings |
|
|
112
113
|
| `docs_search({ query })` | Semantic doc search (CocoIndex) |
|
|
113
114
|
| `graph_query_fuzzy({ query })` | Natural language graph lookup (CocoIndex) |
|
|
115
|
+
| `resolve_task({ intent, goalSpec, plan })` | Execute an approved task plan (index, graph_merge, etc.) |
|
|
114
116
|
|
|
115
117
|
### CLI (fallback / MCP-unavailable or no tool equivalent)
|
|
116
118
|
|
|
@@ -124,6 +126,7 @@ npx ai-spector template list # list installed packs + active
|
|
|
124
126
|
npx ai-spector template scan <path> # scan a template folder → scan-result.json
|
|
125
127
|
npx ai-spector template install # install pack from staging (AI writes manifest first)
|
|
126
128
|
npx ai-spector template use <name> # switch active pack (use "builtin" to revert)
|
|
129
|
+
npx ai-spector resolve-task plan.json # execute approved task plan
|
|
127
130
|
|
|
128
131
|
# CocoIndex (opt-in — requires Python 3.11+)
|
|
129
132
|
npx ai-spector cocoindex setup # scaffold pipeline into project
|
|
@@ -38,6 +38,7 @@ Then: add files under `docs/data-source/`, enable **all** skills under `.cursor/
|
|
|
38
38
|
| Translation status | “what’s stale in JP”, “pending translations” | `ai-spector-lang-status` | `lang_queue({})` MCP |
|
|
39
39
|
| Sync translations | “resolve translations”, “update JP from EN” | `ai-spector-resolve-translation` | read queue → translate → `index({ cocoindexSync: true })` |
|
|
40
40
|
| Review comments | “resolve comments”, “fix C-001” | `ai-spector-resolve-comments` | inbox → plan → edit → commit |
|
|
41
|
+
| Create task / change docs | “create a task”, “add requirement”, “update SRS section”, “I want to…” | `ai-spector-resolve-task` | clarify → show GoalSpec + TaskPlan → approve → `resolve_task` MCP or direct edits |
|
|
41
42
|
| Explore graph | “show the graph” | `ai-spector-graph` | `npx ai-spector graph visualize --open` (no MCP equivalent) |
|
|
42
43
|
|
|
43
44
|
Unsure? The agent uses [skills/_skill-router.md](./skills/_skill-router.md) or asks one clarifying question.
|
|
@@ -17,6 +17,7 @@ Enable **every** folder under `.cursor/skills/` in Cursor (Settings → Rules
|
|
|
17
17
|
| Screens, APIs, DB basic design | `ai-spector-generate-basic-design` |
|
|
18
18
|
| HTML prototype | `ai-spector-generate-prototype` |
|
|
19
19
|
| Review comments | `ai-spector-resolve-comments` |
|
|
20
|
+
| Create task / open-ended doc change | `ai-spector-resolve-task` |
|
|
20
21
|
| Translation status (read-only) | `ai-spector-lang-status` |
|
|
21
22
|
| Resolve / sync translations | `ai-spector-resolve-translation` |
|
|
22
23
|
| Unsure | `ai-spector` (core) |
|
|
@@ -28,6 +28,7 @@ Agents use this when intent is ambiguous.
|
|
|
28
28
|
| screens, APIs, wireframes, basic design | `ai-spector-generate` | `SKILL.md` (checks `packs.basicDesign`, then routes) |
|
|
29
29
|
| HTML prototype | `ai-spector-generate-prototype` | `references/runbook.md` |
|
|
30
30
|
| set up template pack, import template, custom template, install template | `ai-spector-template-import` | `references/runbook.md` |
|
|
31
|
+
| create task, new task, resolve task, add requirement, update docs, change prototype, new section, "I want to…", "we need to…" | `ai-spector-resolve-task` | `references/runbook.md` |
|
|
31
32
|
| review comments, C-001, inbox | `ai-spector-resolve-comments` | `references/runbook.md` |
|
|
32
33
|
| translation status, stale langs | `ai-spector-lang-status` | `SKILL.md` |
|
|
33
34
|
| resolve translations, sync JP/VI | `ai-spector-resolve-translation` | `references/runbook.md` |
|
|
@@ -5,7 +5,8 @@ description: >-
|
|
|
5
5
|
and routing to task skills. Use when the user mentions ai-spector, docflow, or .npx ai-spector but the
|
|
6
6
|
task is unclear, or for init and project layout. Do not use when the user clearly wants SRS,
|
|
7
7
|
basic design, HTML prototype, graph operations, or comment resolution — use the
|
|
8
|
-
matching task skill instead.
|
|
8
|
+
matching task skill instead. For open-ended doc/graph changes or "create task",
|
|
9
|
+
use ai-spector-resolve-task.
|
|
9
10
|
---
|
|
10
11
|
|
|
11
12
|
# AI Spector (core)
|
|
@@ -33,6 +34,7 @@ When the `ai-spector` MCP server is enabled (`.cursor/mcp.json` or `.mcp.json` l
|
|
|
33
34
|
| Rebuild semantic embeddings | `cocoindex_index({})` | `npx ai-spector cocoindex index` |
|
|
34
35
|
| Semantic doc search | `docs_search({ query })` | `npx ai-spector cocoindex search --query …` |
|
|
35
36
|
| Natural language graph lookup | `graph_query_fuzzy({ query })` | *(no CLI equivalent)* |
|
|
37
|
+
| Execute approved task plan | `resolve_task({ intent, goalSpec, plan })` | `npx ai-spector resolve-task plan.json` |
|
|
36
38
|
| **Visualize graph** | *(no MCP tool)* | `npx ai-spector graph visualize --open` |
|
|
37
39
|
|
|
38
40
|
Use CLI **only** when: MCP server is not configured, the tool errors, or no MCP equivalent exists (visualize, `lang add`, template mutations).
|
|
@@ -84,6 +86,7 @@ When `npx ai-spector` exits non-zero, required `--json` is invalid, or a require
|
|
|
84
86
|
| Comments | `ai-spector-resolve-comments` |
|
|
85
87
|
| Translation status / stale languages | `ai-spector-lang-status` |
|
|
86
88
|
| Resolve / sync translations | `ai-spector-resolve-translation` |
|
|
89
|
+
| Create task, open-ended doc/graph change | `ai-spector-resolve-task` |
|
|
87
90
|
| “Generate docs” (vague) | `ai-spector-generate` |
|
|
88
91
|
|
|
89
92
|
When a task skill applies, read its `references/` runbook fully before acting.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ai-spector-resolve-task
|
|
3
|
+
description: >-
|
|
4
|
+
Conversational task workflow (create task, resolve task): agent clarifies user
|
|
5
|
+
intent, builds a GoalSpec + TaskPlan, shows it for approval, then executes via
|
|
6
|
+
the resolve_task MCP tool or CLI. Use when the user wants to create a task,
|
|
7
|
+
add/update a requirement, change a prototype, update docs, regenerate
|
|
8
|
+
sections, or any multi-step doc/graph change described in natural language.
|
|
9
|
+
paths:
|
|
10
|
+
- "docs/**"
|
|
11
|
+
- "prototype/**"
|
|
12
|
+
- ".ai-spector/**"
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# AI Spector — Resolve Task
|
|
16
|
+
|
|
17
|
+
**Core:** [../ai-spector/SKILL.md](../ai-spector/SKILL.md)
|
|
18
|
+
|
|
19
|
+
## Required reading
|
|
20
|
+
|
|
21
|
+
[references/runbook.md](references/runbook.md) — follow phases in order.
|
|
22
|
+
|
|
23
|
+
## Checklist
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
- [ ] Receive user intent (free-form)
|
|
27
|
+
- [ ] Ask ≤3 clarifying questions → build GoalSpec
|
|
28
|
+
- [ ] Show GoalSpec + TaskPlan → wait for approval
|
|
29
|
+
- [ ] Execute via resolve_task MCP tool (or CLI)
|
|
30
|
+
- [ ] Report results + state update
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Natural language triggers → this skill
|
|
34
|
+
|
|
35
|
+
"create task", "create a task", "new task", "resolve task", "run a task",
|
|
36
|
+
"add requirement", "update docs", "change prototype", "new feature section",
|
|
37
|
+
"update SRS", "regenerate screens", "I want to…", "we need to…",
|
|
38
|
+
any open-ended change request that is not a full generate-from-scratch workflow.
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Resolve Task — conversational runbook
|
|
2
|
+
|
|
3
|
+
Chat-first workflow for any multi-step doc/graph change. User describes intent in plain language; agent clarifies, plans, gets approval, then executes.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 1 — Receive intent
|
|
8
|
+
|
|
9
|
+
User sends a free-form message. **Do not act yet.** Just read and move to Phase 2.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
- "create a task to add authentication to the SRS"
|
|
13
|
+
- "add an authentication requirement to the SRS"
|
|
14
|
+
- "change the prototype theme to dark"
|
|
15
|
+
- "we need a new API section in basic design"
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Phase 2 — Clarify (≤ 3 questions)
|
|
20
|
+
|
|
21
|
+
Ask only what is needed to fill `GoalSpec`. Stop when you can answer all four fields.
|
|
22
|
+
|
|
23
|
+
| Field | What to clarify |
|
|
24
|
+
|-------|----------------|
|
|
25
|
+
| `domain` | Which area: docs / prototype / graph / template / lang? |
|
|
26
|
+
| `scope` | Which specific files or sections change? |
|
|
27
|
+
| `criteria` | What does "done" look like? |
|
|
28
|
+
| `notes` | Any constraints, tone, related nodes? |
|
|
29
|
+
|
|
30
|
+
**Rules:**
|
|
31
|
+
- Ask at most 3 questions per round; batch them in one message.
|
|
32
|
+
- If the intent is already specific enough, skip to Phase 3.
|
|
33
|
+
- Do not propose edits or generate content yet.
|
|
34
|
+
|
|
35
|
+
**Example clarification message:**
|
|
36
|
+
> To make sure I plan this correctly:
|
|
37
|
+
> 1. Should this go in the main SRS (`docs/srs/`) or a language variant?
|
|
38
|
+
> 2. Is there an existing section to extend, or does this need a new one?
|
|
39
|
+
> 3. What does "done" look like — e.g. the section exists + graph reindexed?
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Phase 3 — Build and show the plan
|
|
44
|
+
|
|
45
|
+
Once you have enough to fill `GoalSpec`, construct the plan and **show it in chat** before doing anything.
|
|
46
|
+
|
|
47
|
+
### GoalSpec format (show this)
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Domain : docs
|
|
51
|
+
Scope : docs/srs/02-features.md
|
|
52
|
+
Criteria:
|
|
53
|
+
- FR-AUTH section present with at least 3 requirements
|
|
54
|
+
- graph reindexed successfully
|
|
55
|
+
Notes : keep consistent with existing FR-PAY section style
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### TaskPlan format (show this)
|
|
59
|
+
|
|
60
|
+
| # | Step | Tool |
|
|
61
|
+
|---|------|------|
|
|
62
|
+
| s1 | Edit docs/srs/02-features.md — add FR-AUTH section | (direct edit) |
|
|
63
|
+
| s2 | Re-index project | `index` |
|
|
64
|
+
| s3 | Merge knowledge | `graph_merge` |
|
|
65
|
+
|
|
66
|
+
**Risk level:** low / medium / high / critical (from impact analysis)
|
|
67
|
+
|
|
68
|
+
**Then ask:** "Does this plan look right? Reply **yes** to execute, or tell me what to change."
|
|
69
|
+
|
|
70
|
+
Do not proceed until the user confirms.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Phase 4 — Execute
|
|
75
|
+
|
|
76
|
+
After approval, run each step in order.
|
|
77
|
+
|
|
78
|
+
### Steps that are direct edits
|
|
79
|
+
Use the Edit / Write tools directly. Report each file changed.
|
|
80
|
+
|
|
81
|
+
### Steps that call MCP tools
|
|
82
|
+
Use the `resolve_task` MCP tool with the approved plan:
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"intent": "<original user message>",
|
|
87
|
+
"goalSpec": {
|
|
88
|
+
"trigger": "<original user message>",
|
|
89
|
+
"domain": "docs",
|
|
90
|
+
"scope": ["docs/srs/02-features.md"],
|
|
91
|
+
"criteria": ["FR-AUTH section present", "graph reindexed"]
|
|
92
|
+
},
|
|
93
|
+
"plan": {
|
|
94
|
+
"goal": { "...same as goalSpec..." },
|
|
95
|
+
"steps": [
|
|
96
|
+
{ "id": "s2", "description": "Re-index project", "tool": "index", "args": {} },
|
|
97
|
+
{ "id": "s3", "description": "Merge knowledge", "tool": "graph_merge", "args": {} }
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Or via CLI if MCP is unavailable:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# write plan.json, then:
|
|
107
|
+
npx ai-spector resolve-task plan.json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### If a step is blocked
|
|
111
|
+
Report the blocker in chat. Ask the user: "Step **sN** is blocked: `<reason>`. Should I skip it, retry, or stop?"
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Phase 5 — Report state update
|
|
116
|
+
|
|
117
|
+
After execution, show a summary:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
✓ Task task-abc123 — COMPLETE
|
|
121
|
+
domain: docs risk: low
|
|
122
|
+
|
|
123
|
+
Steps:
|
|
124
|
+
✓ [s1] Edit docs/srs/02-features.md
|
|
125
|
+
✓ [s2] Re-index project
|
|
126
|
+
✓ [s3] Merge knowledge
|
|
127
|
+
|
|
128
|
+
State update:
|
|
129
|
+
reindexed: 1 file(s)
|
|
130
|
+
graph diff: +2 -0 ~1
|
|
131
|
+
3 file(s) changed across 3 steps
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Then ask if there is anything else to adjust.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Replanning
|
|
139
|
+
|
|
140
|
+
If the user changes their mind after seeing the plan (Phase 3), go back to Phase 2 — update `GoalSpec` + `TaskPlan` and show the revised plan again.
|
|
141
|
+
|
|
142
|
+
If a step fails mid-execution, either:
|
|
143
|
+
- Replan without that step and continue, or
|
|
144
|
+
- Stop and report the full blocker to the user
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Guardrails
|
|
149
|
+
|
|
150
|
+
- **Never start editing** before the user approves the plan.
|
|
151
|
+
- **Never skip the clarify phase** — even one ambiguous word can target the wrong file.
|
|
152
|
+
- **Never run `resolve_task` with an unapproved plan.**
|
|
153
|
+
- Ask for approval once, clearly. Don't loop approval prompts.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## CLI reference
|
|
158
|
+
|
|
159
|
+
| Command | Purpose |
|
|
160
|
+
|---------|---------|
|
|
161
|
+
| `npx ai-spector resolve-task plan.json` | Execute a pre-built plan JSON |
|
|
162
|
+
| `npx ai-spector resolve-task plan.json --dry-run` | Validate without writing |
|
|
163
|
+
| `npx ai-spector resolve-task plan.json --json` | Machine-readable output |
|
|
164
|
+
|
|
165
|
+
MCP tool: `resolve_task` (schema: `ResolveTaskSchema`)
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## If blocked
|
|
170
|
+
|
|
171
|
+
See [cli-failures.md](../../ai-spector/references/cli-failures.md).
|
|
172
|
+
|
|
173
|
+
| Issue | Fix |
|
|
174
|
+
|-------|-----|
|
|
175
|
+
| `No executor registered for tool "X"` | Use a supported tool: `index`, `graph_merge`, `graph_report`, `graph_impact` |
|
|
176
|
+
| Plan JSON parse error | Validate JSON with `node -e "JSON.parse(require('fs').readFileSync('plan.json','utf8'))"` |
|
|
177
|
+
| Reindex fails | Check `npx ai-spector setup --check` first |
|