@projitive/mcp 1.1.2 → 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 +115 -422
- package/output/package.json +4 -1
- package/output/source/common/files.js +1 -1
- package/output/source/common/index.js +1 -0
- package/output/source/common/migrations/runner.js +68 -0
- package/output/source/common/migrations/steps.js +55 -0
- package/output/source/common/migrations/types.js +1 -0
- package/output/source/common/response.js +147 -1
- package/output/source/common/store.js +623 -0
- package/output/source/common/store.test.js +164 -0
- package/output/source/index.js +1 -1
- package/output/source/prompts/quickStart.js +33 -7
- package/output/source/prompts/taskDiscovery.js +23 -9
- package/output/source/prompts/taskExecution.js +18 -8
- package/output/source/resources/governance.js +2 -2
- package/output/source/tools/project.js +254 -119
- package/output/source/tools/project.test.js +33 -11
- package/output/source/tools/roadmap.js +166 -16
- package/output/source/tools/roadmap.test.js +19 -55
- package/output/source/tools/task.js +152 -376
- package/output/source/tools/task.test.js +64 -392
- package/output/source/types.js +0 -9
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -2,80 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Language: English | [简体中文](README_CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Version
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- Current Spec Version: projitive-spec v1.0.0
|
|
8
|
+
- MCP Version: 2.0.0
|
|
8
9
|
|
|
9
|
-
##
|
|
10
|
+
## 60-Second Start
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
flowchart LR
|
|
13
|
-
A[taskNext / projectNext] --> B[taskContext / projectContext]
|
|
14
|
-
B --> C[Update tasks/designs/reports]
|
|
15
|
-
C --> D[taskContext verify]
|
|
16
|
-
D --> E{More actionable work?}
|
|
17
|
-
E -->|Yes| A
|
|
18
|
-
E -->|No| F[Done / wait for new tasks]
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Why Developers Choose This MCP
|
|
22
|
-
|
|
23
|
-
- Predictable API family: `List/Context` as core, `Next/Scan/Locate` for acceleration.
|
|
24
|
-
- Governance-safe automation: state changes are guided by evidence-first workflow.
|
|
25
|
-
- Agent-ready outputs: markdown contracts optimized for tool-chaining, not raw JSON blobs.
|
|
26
|
-
- Production publishing pipeline: release-triggered CI with lint/test/publish gates.
|
|
27
|
-
|
|
28
|
-
## How It Helps Agents Manage and Advance Projects
|
|
29
|
-
|
|
30
|
-
This MCP is designed to make agent execution operational, not just informative. It gives agents a closed-loop workflow:
|
|
31
|
-
|
|
32
|
-
1. **Find what to do next**
|
|
33
|
-
- `taskNext` or `projectNext` ranks actionable targets.
|
|
34
|
-
2. **Build the right context**
|
|
35
|
-
- `taskContext` / `projectContext` / `roadmapContext` provide evidence, references, and next-call hints.
|
|
36
|
-
3. **Execute with governance constraints**
|
|
37
|
-
- Agent updates markdown artifacts (`tasks.md`, `designs/`, `reports/`) with immutable IDs and evidence rules.
|
|
38
|
-
4. **Re-verify and continue**
|
|
39
|
-
- Re-run `taskContext` (or `roadmapContext`) to confirm consistency, then move to the next task.
|
|
12
|
+
If you only read one section, read this:
|
|
40
13
|
|
|
41
|
-
|
|
14
|
+
1. Start server: `npx -y @projitive/mcp`
|
|
15
|
+
2. Configure mcp.json with scan roots and depth
|
|
16
|
+
3. Run: taskNext -> taskContext -> taskUpdate -> taskContext -> taskNext
|
|
42
17
|
|
|
43
|
-
|
|
18
|
+
Why teams use it:
|
|
44
19
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
-> update artifacts (tasks/designs/reports)
|
|
49
|
-
-> taskContext (verify)
|
|
50
|
-
-> taskNext (next cycle)
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
When no actionable task exists (`actionableTasks: 0`), use bootstrap path:
|
|
20
|
+
- Faster next-task selection
|
|
21
|
+
- Better evidence traceability
|
|
22
|
+
- More predictable multi-agent delivery
|
|
54
23
|
|
|
55
|
-
|
|
56
|
-
taskNext
|
|
57
|
-
-> projectContext
|
|
58
|
-
-> create 1-3 TODO tasks in tasks.md marker block (from roadmap/readme/report gaps)
|
|
59
|
-
-> taskNext
|
|
60
|
-
```
|
|
24
|
+
## What It Is Useful For
|
|
61
25
|
|
|
62
|
-
|
|
26
|
+
Projitive MCP helps agents move work forward in governed projects without losing traceability.
|
|
63
27
|
|
|
64
|
-
|
|
28
|
+
- Pick the next highest-value task quickly.
|
|
29
|
+
- Build execution context with linked evidence.
|
|
30
|
+
- Update task and roadmap state in a consistent, auditable way.
|
|
31
|
+
- Keep delivery loop stable across long-running multi-agent workflows.
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
projectLocate -> projectContext -> taskList -> taskContext
|
|
68
|
-
```
|
|
33
|
+
## How To Use
|
|
69
34
|
|
|
70
|
-
|
|
35
|
+
### 1. Start MCP Server
|
|
71
36
|
|
|
72
|
-
Use
|
|
37
|
+
Use package directly in your MCP client:
|
|
73
38
|
|
|
74
39
|
```bash
|
|
75
40
|
npx -y @projitive/mcp
|
|
76
41
|
```
|
|
77
42
|
|
|
78
|
-
|
|
43
|
+
### 2. Add Client Config
|
|
44
|
+
|
|
45
|
+
Example mcp.json:
|
|
79
46
|
|
|
80
47
|
```json
|
|
81
48
|
{
|
|
@@ -84,7 +51,7 @@ MCP client config example (`mcp.json`):
|
|
|
84
51
|
"command": "npx",
|
|
85
52
|
"args": ["-y", "@projitive/mcp"],
|
|
86
53
|
"env": {
|
|
87
|
-
"
|
|
54
|
+
"PROJITIVE_SCAN_ROOT_PATHS": "/workspace/a:/workspace/b",
|
|
88
55
|
"PROJITIVE_SCAN_MAX_DEPTH": "3"
|
|
89
56
|
}
|
|
90
57
|
}
|
|
@@ -92,401 +59,127 @@ MCP client config example (`mcp.json`):
|
|
|
92
59
|
}
|
|
93
60
|
```
|
|
94
61
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
- `PROJITIVE_SCAN_ROOT_PATH`: required scan root for discovery methods.
|
|
98
|
-
- `PROJITIVE_SCAN_MAX_DEPTH`: required scan depth for discovery methods (integer `0-8`).
|
|
99
|
-
|
|
100
|
-
Local path startup is not the recommended usage mode in this README.
|
|
101
|
-
|
|
102
|
-
For maintainers/contributors only:
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
cd packages/mcp
|
|
106
|
-
npm ci
|
|
107
|
-
npm run build
|
|
108
|
-
npm run test
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Spec Version
|
|
112
|
-
|
|
113
|
-
- Current aligned spec version: `projitive-spec v1.0.0`
|
|
114
|
-
- Note: Projitive is a general governance specification; MCP is one implementation of this spec.
|
|
115
|
-
- Alignment rule: MCP major version must match the spec major version (currently both `v1.x`).
|
|
116
|
-
|
|
117
|
-
## Design Boundaries
|
|
118
|
-
|
|
119
|
-
- MCP handles discovery, locating, summarization, and execution guidance.
|
|
120
|
-
- Agents/AI handle reading and updating markdown content.
|
|
121
|
-
- MCP does not provide direct artifact-write APIs such as `task.update_*`, `roadmap.update_*`, or `sync_*`.
|
|
122
|
-
- All tool outputs are agent-oriented Markdown (not raw JSON objects).
|
|
123
|
-
- Standard output sections: `Summary` / `Evidence` / `Agent Guidance` / `Next Call`.
|
|
124
|
-
- Standard error sections: `Error` / `Next Step` / `Retry Example`.
|
|
125
|
-
|
|
126
|
-
## MCP Capability Model
|
|
127
|
-
|
|
128
|
-
- Tools: execute discovery/locating/summarization actions (primary channel).
|
|
129
|
-
- Resources: expose readable governance artifacts for low-cost context loading.
|
|
130
|
-
- Prompts: provide parameterized workflow templates to reduce execution drift.
|
|
131
|
-
|
|
132
|
-
### Resources (Implemented)
|
|
133
|
-
|
|
134
|
-
- `projitive://governance/workspace`: reads `.projitive/README.md`
|
|
135
|
-
- `projitive://governance/tasks`: reads `.projitive/tasks.md`
|
|
136
|
-
- `projitive://governance/roadmap`: reads `.projitive/roadmap.md`
|
|
137
|
-
- `projitive://mcp/method-catalog`: method naming and role catalog (`List/Context/Next/Scan/Locate`)
|
|
138
|
-
|
|
139
|
-
### Prompts (Implemented)
|
|
140
|
-
|
|
141
|
-
- `executeTaskWorkflow`: standard execution chain (`taskNext -> taskContext -> artifacts update -> verify`)
|
|
142
|
-
- `updateTaskStatusWithEvidence`: status transition + evidence alignment template
|
|
143
|
-
- `triageProjectGovernance`: project-level governance triage template
|
|
144
|
-
|
|
145
|
-
## Tools Methods
|
|
146
|
-
|
|
147
|
-
### Discovery Layer
|
|
148
|
-
|
|
149
|
-
#### `projectInit`
|
|
150
|
-
|
|
151
|
-
- **Purpose**: manually initialize governance directory structure for a project (default `.projitive`).
|
|
152
|
-
- **Input**: `projectPath`, `governanceDir?`, `force?`
|
|
153
|
-
- **Output Example (Markdown)**:
|
|
154
|
-
|
|
155
|
-
```markdown
|
|
156
|
-
# projectInit
|
|
157
|
-
|
|
158
|
-
## Summary
|
|
159
|
-
- projectPath: /workspace/proj-a
|
|
160
|
-
- governanceDir: /workspace/proj-a/.projitive
|
|
161
|
-
- markerPath: /workspace/proj-a/.projitive/.projitive
|
|
162
|
-
- force: false
|
|
163
|
-
|
|
164
|
-
## Evidence
|
|
165
|
-
- createdFiles: 4
|
|
166
|
-
- updatedFiles: 0
|
|
167
|
-
- skippedFiles: 0
|
|
168
|
-
|
|
169
|
-
## Agent Guidance
|
|
170
|
-
- If files were skipped and you want to overwrite templates, rerun with force=true.
|
|
171
|
-
- Continue with projectContext and taskList for execution.
|
|
172
|
-
|
|
173
|
-
## Next Call
|
|
174
|
-
- projectContext(projectPath="/workspace/proj-a/.projitive")
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
#### `projectNext`
|
|
178
|
-
|
|
179
|
-
- **Purpose**: directly list recently actionable projects (ranked by actionable task count and recency).
|
|
180
|
-
- **Input**: `limit?`
|
|
181
|
-
- **Output Example (Markdown)**:
|
|
182
|
-
|
|
183
|
-
```markdown
|
|
184
|
-
# projectNext
|
|
62
|
+
Required environment variables:
|
|
185
63
|
|
|
186
|
-
|
|
187
|
-
-
|
|
188
|
-
- maxDepth: 3
|
|
189
|
-
- matchedProjects: 8
|
|
190
|
-
- actionableProjects: 3
|
|
191
|
-
- limit: 10
|
|
64
|
+
- PROJITIVE_SCAN_ROOT_PATHS: discovery roots (platform-delimited)
|
|
65
|
+
- PROJITIVE_SCAN_MAX_DEPTH: discovery depth (0-8)
|
|
192
66
|
|
|
193
|
-
|
|
194
|
-
- rankedProjects:
|
|
195
|
-
1. /workspace/proj-a | actionable=5 | in_progress=2 | todo=3 | blocked=1 | done=4 | latest=2026-02-17T12:00:00.000Z | tasksPath=/workspace/proj-a/tasks.md
|
|
196
|
-
2. /workspace/proj-b | actionable=3 | in_progress=1 | todo=2 | blocked=0 | done=7 | latest=2026-02-16T09:00:00.000Z | tasksPath=/workspace/proj-b/tasks.md
|
|
67
|
+
Fallback: when PROJITIVE_SCAN_ROOT_PATHS is not set, legacy PROJITIVE_SCAN_ROOT_PATH is used.
|
|
197
68
|
|
|
198
|
-
|
|
199
|
-
- Pick top 1 project and call `projectContext` with its governanceDir.
|
|
200
|
-
- Then call `taskList` and `taskContext` to continue execution.
|
|
69
|
+
### 3. Use The Default Delivery Loop
|
|
201
70
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
- **Output Example (Markdown)**:
|
|
211
|
-
|
|
212
|
-
```markdown
|
|
213
|
-
# projectScan
|
|
214
|
-
|
|
215
|
-
## Summary
|
|
216
|
-
- rootPath: /workspace
|
|
217
|
-
- maxDepth: 3
|
|
218
|
-
- discoveredCount: 2
|
|
219
|
-
|
|
220
|
-
## Evidence
|
|
221
|
-
- projects:
|
|
222
|
-
1. /workspace/proj-a
|
|
223
|
-
2. /workspace/proj-b
|
|
224
|
-
|
|
225
|
-
## Agent Guidance
|
|
226
|
-
- Use one discovered project path and call `projectLocate` to lock governance root.
|
|
227
|
-
- Then call `projectContext` to inspect current governance state.
|
|
228
|
-
|
|
229
|
-
## Next Call
|
|
230
|
-
- projectLocate(inputPath="/workspace/proj-a")
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
#### `projectLocate`
|
|
234
|
-
|
|
235
|
-
- **Purpose**: when an agent is already inside a project path, resolve the nearest `.projitive` upward.
|
|
236
|
-
- **Input**: `inputPath`
|
|
237
|
-
- **Output Example (Markdown)**:
|
|
238
|
-
|
|
239
|
-
```markdown
|
|
240
|
-
# projectLocate
|
|
241
|
-
|
|
242
|
-
## Summary
|
|
243
|
-
- resolvedFrom: /workspace/proj-a/packages/mcp
|
|
244
|
-
- governanceDir: /workspace/proj-a
|
|
245
|
-
- markerPath: /workspace/proj-a/.projitive
|
|
246
|
-
|
|
247
|
-
## Agent Guidance
|
|
248
|
-
- Call `projectContext` with this governanceDir to get task and roadmap summaries.
|
|
249
|
-
|
|
250
|
-
## Next Call
|
|
251
|
-
- projectContext(projectPath="/workspace/proj-a")
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
#### `projectContext`
|
|
255
|
-
|
|
256
|
-
- **Purpose**: summarize governance state instead of only returning file lists.
|
|
257
|
-
- **Input**: `projectPath`
|
|
258
|
-
- **Output Example (Markdown)**:
|
|
259
|
-
|
|
260
|
-
```markdown
|
|
261
|
-
# projectContext
|
|
262
|
-
|
|
263
|
-
## Summary
|
|
264
|
-
- governanceDir: /workspace/proj-a
|
|
265
|
-
- tasksFile: /workspace/proj-a/tasks.md
|
|
266
|
-
- roadmapIds: 3
|
|
267
|
-
|
|
268
|
-
## Evidence
|
|
269
|
-
### Task Summary
|
|
270
|
-
- total: 12
|
|
271
|
-
- TODO: 4
|
|
272
|
-
- IN_PROGRESS: 3
|
|
273
|
-
- BLOCKED: 1
|
|
274
|
-
- DONE: 4
|
|
275
|
-
|
|
276
|
-
### Artifacts
|
|
277
|
-
- ✅ README.md
|
|
278
|
-
- ✅ roadmap.md
|
|
279
|
-
- ✅ tasks.md
|
|
280
|
-
- ✅ designs/
|
|
281
|
-
- ✅ reports/
|
|
282
|
-
- ✅ hooks/
|
|
283
|
-
|
|
284
|
-
## Agent Guidance
|
|
285
|
-
- Start from `taskList` to choose a target task.
|
|
286
|
-
- Then call `taskContext` with a task ID to retrieve evidence locations and reading order.
|
|
287
|
-
|
|
288
|
-
## Next Call
|
|
289
|
-
- taskList(projectPath="/workspace/proj-a")
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
### Task Layer
|
|
293
|
-
|
|
294
|
-
#### `taskNext`
|
|
295
|
-
|
|
296
|
-
- **Purpose**: one-step workflow for project discovery + best task selection + evidence/read-order output.
|
|
297
|
-
- **Input**: `limit?`
|
|
298
|
-
- **Output Example (Markdown)**:
|
|
299
|
-
|
|
300
|
-
```markdown
|
|
301
|
-
# taskNext
|
|
302
|
-
|
|
303
|
-
## Summary
|
|
304
|
-
- rootPath: /workspace
|
|
305
|
-
- maxDepth: 3
|
|
306
|
-
- matchedProjects: 8
|
|
307
|
-
- actionableTasks: 12
|
|
308
|
-
- selectedProject: /workspace/proj-a
|
|
309
|
-
- selectedTaskId: TASK-0003
|
|
310
|
-
- selectedTaskStatus: IN_PROGRESS
|
|
311
|
-
|
|
312
|
-
## Evidence
|
|
313
|
-
### Selected Task
|
|
314
|
-
- id: TASK-0003
|
|
315
|
-
- title: Build MCP tools
|
|
316
|
-
- taskLocation: /workspace/proj-a/tasks.md#L42
|
|
317
|
-
|
|
318
|
-
### Top Candidates
|
|
319
|
-
1. TASK-0003 | IN_PROGRESS | Build MCP tools | project=/workspace/proj-a | projectScore=6
|
|
320
|
-
2. TASK-0007 | TODO | Add docs examples | project=/workspace/proj-b | projectScore=5
|
|
321
|
-
|
|
322
|
-
### Selection Reason
|
|
323
|
-
- Rank rule: projectScore DESC -> taskPriority DESC -> taskUpdatedAt DESC.
|
|
324
|
-
- Selected candidate scores: projectScore=6, taskPriority=2, taskUpdatedAtMs=1739793600000.
|
|
325
|
-
|
|
326
|
-
### Suggested Read Order
|
|
327
|
-
1. /workspace/proj-a/tasks.md
|
|
328
|
-
2. /workspace/proj-a/designs/mcp-design.md
|
|
329
|
-
3. /workspace/proj-a/reports/mcp-progress.md
|
|
330
|
-
|
|
331
|
-
## Agent Guidance
|
|
332
|
-
- Start immediately with Suggested Read Order and execute the selected task.
|
|
333
|
-
- Re-run `taskContext` for the selectedTaskId after edits to verify evidence consistency.
|
|
334
|
-
|
|
335
|
-
## Next Call
|
|
336
|
-
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
71
|
+
```mermaid
|
|
72
|
+
flowchart LR
|
|
73
|
+
A[taskNext / projectNext] --> B[taskContext / projectContext]
|
|
74
|
+
B --> C[Update task and roadmap + docs]
|
|
75
|
+
C --> D[taskContext verify]
|
|
76
|
+
D --> E{More actionable work?}
|
|
77
|
+
E -->|Yes| A
|
|
78
|
+
E -->|No| F[Done / wait for new tasks]
|
|
337
79
|
```
|
|
338
80
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
#### `taskList`
|
|
342
|
-
|
|
343
|
-
- **Purpose**: list tasks in current project, with optional status filtering and limiting.
|
|
344
|
-
- **Input**: `projectPath`, `status?`, `limit?`
|
|
345
|
-
- **Output Example (Markdown)**:
|
|
81
|
+
Recommended minimal sequence:
|
|
346
82
|
|
|
347
|
-
|
|
348
|
-
|
|
83
|
+
1. taskNext
|
|
84
|
+
2. taskContext
|
|
85
|
+
3. taskUpdate and/or roadmapUpdate
|
|
86
|
+
4. taskContext
|
|
87
|
+
5. taskNext
|
|
349
88
|
|
|
350
|
-
|
|
351
|
-
- governanceDir: /workspace/proj-a
|
|
352
|
-
- tasksPath: /workspace/proj-a/tasks.md
|
|
353
|
-
- filter.status: IN_PROGRESS
|
|
354
|
-
- returned: 2
|
|
89
|
+
### 4. New User Minimal Flow
|
|
355
90
|
|
|
356
|
-
|
|
357
|
-
- tasks:
|
|
358
|
-
- TASK-0003 | IN_PROGRESS | Build MCP tools | owner=alice | updatedAt=2026-02-17T12:00:00.000Z
|
|
359
|
-
- TASK-0007 | IN_PROGRESS | Add docs examples | owner=bob | updatedAt=2026-02-17T13:30:00.000Z
|
|
91
|
+
This is the shortest end-to-end path from first connection to first governed update:
|
|
360
92
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
366
|
-
```
|
|
93
|
+
```mermaid
|
|
94
|
+
sequenceDiagram
|
|
95
|
+
participant U as User/Agent
|
|
96
|
+
participant M as Projitive MCP
|
|
367
97
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
- title: Build MCP tools
|
|
381
|
-
- status: IN_PROGRESS
|
|
382
|
-
- owner: alice
|
|
383
|
-
- updatedAt: 2026-02-17T12:00:00.000Z
|
|
384
|
-
- roadmapRefs: ROADMAP-0001
|
|
385
|
-
- taskLocation: /workspace/proj-a/tasks.md#L42
|
|
386
|
-
|
|
387
|
-
## Evidence
|
|
388
|
-
### Related Artifacts
|
|
389
|
-
- /workspace/proj-a/tasks.md
|
|
390
|
-
- /workspace/proj-a/designs/mcp-design.md
|
|
391
|
-
- /workspace/proj-a/reports/mcp-progress.md
|
|
392
|
-
|
|
393
|
-
### Reference Locations
|
|
394
|
-
- /workspace/proj-a/tasks.md#L42: "id": "TASK-0003"
|
|
395
|
-
- /workspace/proj-a/designs/mcp-design.md#L18: Ref: TASK-0003
|
|
396
|
-
|
|
397
|
-
### Suggested Read Order
|
|
398
|
-
1. /workspace/proj-a/tasks.md
|
|
399
|
-
2. /workspace/proj-a/designs/mcp-design.md
|
|
400
|
-
3. /workspace/proj-a/reports/mcp-progress.md
|
|
401
|
-
|
|
402
|
-
## Agent Guidance
|
|
403
|
-
- Read the files in Suggested Read Order.
|
|
404
|
-
- Verify whether current status and evidence are consistent.
|
|
405
|
-
- This task is IN_PROGRESS: prioritize finishing with report/design evidence updates.
|
|
406
|
-
- Verify references stay consistent before marking DONE.
|
|
407
|
-
|
|
408
|
-
## Next Call
|
|
409
|
-
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
98
|
+
U->>M: projectScan()
|
|
99
|
+
M-->>U: discovered governance projects
|
|
100
|
+
U->>M: projectContext(projectPath)
|
|
101
|
+
M-->>U: task/roadmap summary
|
|
102
|
+
U->>M: taskNext()
|
|
103
|
+
M-->>U: selected actionable task
|
|
104
|
+
U->>M: taskContext(projectPath, taskId)
|
|
105
|
+
M-->>U: evidence and read order
|
|
106
|
+
U->>M: taskUpdate(projectPath, taskId, updates)
|
|
107
|
+
M-->>U: updated task state
|
|
108
|
+
U->>M: taskContext(projectPath, taskId)
|
|
109
|
+
M-->>U: verification snapshot
|
|
410
110
|
```
|
|
411
111
|
|
|
412
|
-
|
|
112
|
+
## What You Can Do With It
|
|
413
113
|
|
|
414
|
-
|
|
114
|
+
### Core Tools
|
|
415
115
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
116
|
+
| Group | Tool | Purpose |
|
|
117
|
+
| --- | --- | --- |
|
|
118
|
+
| Project | projectInit | Initialize governance structure |
|
|
119
|
+
| Project | projectScan | Discover governable projects |
|
|
120
|
+
| Project | projectNext | Rank actionable projects |
|
|
121
|
+
| Project | projectLocate | Resolve nearest governance root |
|
|
122
|
+
| Project | projectContext | Summarize governance context |
|
|
123
|
+
| Project | syncViews | Force materialize markdown views |
|
|
124
|
+
| Task | taskList | List tasks |
|
|
125
|
+
| Task | taskNext | Select best actionable task |
|
|
126
|
+
| Task | taskContext | Get task evidence and reading order |
|
|
127
|
+
| Task | taskUpdate | Update task state and metadata |
|
|
128
|
+
| Roadmap | roadmapList | List roadmaps and linked tasks |
|
|
129
|
+
| Roadmap | roadmapContext | Get roadmap context |
|
|
130
|
+
| Roadmap | roadmapUpdate | Update roadmap milestone fields |
|
|
419
131
|
|
|
420
|
-
|
|
421
|
-
# roadmapList
|
|
132
|
+
### Resources
|
|
422
133
|
|
|
423
|
-
|
|
424
|
-
-
|
|
425
|
-
-
|
|
134
|
+
- projitive://governance/workspace
|
|
135
|
+
- projitive://governance/tasks
|
|
136
|
+
- projitive://governance/roadmap
|
|
137
|
+
- projitive://mcp/method-catalog
|
|
426
138
|
|
|
427
|
-
|
|
428
|
-
- roadmaps:
|
|
429
|
-
- ROADMAP-0001 | linkedTasks=6
|
|
430
|
-
- ROADMAP-0002 | linkedTasks=3
|
|
139
|
+
### Prompts
|
|
431
140
|
|
|
432
|
-
|
|
433
|
-
-
|
|
141
|
+
- executeTaskWorkflow
|
|
142
|
+
- updateTaskStatusWithEvidence
|
|
143
|
+
- triageProjectGovernance
|
|
434
144
|
|
|
435
|
-
##
|
|
436
|
-
- roadmapContext(projectPath="/workspace/proj-a", roadmapId="ROADMAP-0001")
|
|
437
|
-
```
|
|
145
|
+
## Design Philosophy
|
|
438
146
|
|
|
439
|
-
|
|
147
|
+
### 1. Source Of Truth vs Views
|
|
440
148
|
|
|
441
|
-
-
|
|
442
|
-
-
|
|
443
|
-
-
|
|
149
|
+
- Governance source data is stored in .projitive.
|
|
150
|
+
- tasks.md and roadmap.md are materialized/generated views.
|
|
151
|
+
- Manual edits on generated views can be overwritten by sync.
|
|
444
152
|
|
|
445
|
-
|
|
446
|
-
# roadmapContext
|
|
153
|
+
### 2. Query Performance Without Extra Files
|
|
447
154
|
|
|
448
|
-
|
|
449
|
-
-
|
|
450
|
-
- roadmapId: ROADMAP-0001
|
|
451
|
-
- relatedTasks: 6
|
|
452
|
-
- references: 9
|
|
155
|
+
- Query path uses embedded DuckDB in memory by default.
|
|
156
|
+
- No extra intermediate DuckDB database file is created.
|
|
453
157
|
|
|
454
|
-
|
|
455
|
-
### Related Tasks
|
|
456
|
-
- TASK-0001 | DONE | Bootstrap governance
|
|
457
|
-
- TASK-0003 | IN_PROGRESS | Build MCP tools
|
|
158
|
+
### 3. Evidence-First Execution
|
|
458
159
|
|
|
459
|
-
|
|
460
|
-
-
|
|
461
|
-
- /workspace/proj-a/tasks.md#L42: "roadmapRefs": ["ROADMAP-0001"]
|
|
160
|
+
- State changes should be backed by report/design/readme evidence.
|
|
161
|
+
- Tool output format is agent-friendly markdown for chained execution.
|
|
462
162
|
|
|
463
|
-
|
|
464
|
-
- Read roadmap references first, then related tasks.
|
|
465
|
-
- Keep ROADMAP/TASK IDs unchanged while updating markdown files.
|
|
163
|
+
### 4. Deterministic Multi-Agent Workflow
|
|
466
164
|
|
|
467
|
-
|
|
468
|
-
-
|
|
469
|
-
|
|
165
|
+
- Prefer tool-based writes over ad-hoc markdown edits.
|
|
166
|
+
- Keep IDs stable and transitions explicit.
|
|
167
|
+
- Re-verify context after each significant update.
|
|
470
168
|
|
|
471
|
-
##
|
|
169
|
+
## Architecture Documents
|
|
472
170
|
|
|
473
|
-
|
|
474
|
-
|
|
171
|
+
- Index: docs/README_CN.md
|
|
172
|
+
- Current architecture: docs/ARCHITECTURE_CN.md
|
|
173
|
+
- Migration architecture: docs/MIGRATION_ARCHITECTURE_CN.md
|
|
174
|
+
- Historical proposals: REFACTOR_CN.md, REFACTOR_V2_CN.md
|
|
475
175
|
|
|
476
|
-
##
|
|
477
|
-
- cause: Invalid task ID format: TASK-12
|
|
176
|
+
## Development
|
|
478
177
|
|
|
479
|
-
|
|
480
|
-
- expected format: TASK-0001
|
|
481
|
-
- retry with a valid task ID
|
|
178
|
+
For maintainers:
|
|
482
179
|
|
|
483
|
-
|
|
484
|
-
|
|
180
|
+
```bash
|
|
181
|
+
cd packages/mcp
|
|
182
|
+
npm ci
|
|
183
|
+
npm run build
|
|
184
|
+
npm run test
|
|
485
185
|
```
|
|
486
|
-
|
|
487
|
-
## Recommended Agent Call Flow
|
|
488
|
-
|
|
489
|
-
1. `taskNext`: one-step discovery and top task selection (default path).
|
|
490
|
-
2. `taskContext`: fetch detailed evidence for a specific task ID when needed.
|
|
491
|
-
3. `projectNext`: optional project-level scheduling flow when you need project-first dispatch.
|
|
492
|
-
4. When already in a project path, use `projectLocate` to quickly resolve governance root.
|
package/output/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projitive/mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Projitive MCP Server for project and task discovery/update",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -25,11 +25,14 @@
|
|
|
25
25
|
"output"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
+
"@duckdb/node-api": "1.5.0-r.1",
|
|
28
29
|
"@modelcontextprotocol/sdk": "^1.17.5",
|
|
30
|
+
"sql.js": "^1.14.1",
|
|
29
31
|
"zod": "^3.23.8"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@types/node": "^24.3.0",
|
|
35
|
+
"@types/sql.js": "^1.4.9",
|
|
33
36
|
"@vitest/coverage-v8": "^3.2.4",
|
|
34
37
|
"tsx": "^4.20.5",
|
|
35
38
|
"typescript": "^5.9.2",
|
|
@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { catchIt } from "./catch.js";
|
|
4
4
|
const FILE_ARTIFACTS = ["README.md", "roadmap.md", "tasks.md"];
|
|
5
|
-
const DIRECTORY_ARTIFACTS = ["designs", "reports", "
|
|
5
|
+
const DIRECTORY_ARTIFACTS = ["designs", "reports", "templates"];
|
|
6
6
|
async function fileLineCount(filePath) {
|
|
7
7
|
const content = await fs.readFile(filePath, "utf-8");
|
|
8
8
|
if (!content) {
|