@projitive/mcp 2.1.1 → 2.1.3
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/output/package.json +5 -1
- package/output/source/common/linter.js +2 -4
- package/output/source/common/response.js +27 -2
- package/output/source/common/response.test.js +13 -1
- package/output/source/prompts/quickStart.js +8 -3
- package/output/source/prompts/taskDiscovery.js +17 -2
- package/output/source/prompts/taskDiscovery.test.js +4 -0
- package/output/source/prompts/taskExecution.js +19 -5
- package/output/source/prompts/taskExecution.test.js +6 -1
- package/output/source/tools/project.js +316 -45
- package/output/source/tools/project.test.js +50 -5
- package/output/source/tools/task.js +83 -55
- package/output/source/tools/task.test.js +42 -32
- package/output/source/types.js +2 -1
- package/package.json +5 -1
package/output/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@projitive/mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Projitive MCP Server for project and task discovery/update",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/yinxulai/projitive"
|
|
18
|
+
},
|
|
15
19
|
"scripts": {
|
|
16
20
|
"test": "vitest run",
|
|
17
21
|
"test:coverage": "vitest run --coverage",
|
|
@@ -13,10 +13,7 @@ export const TASK_LINT_CODES = {
|
|
|
13
13
|
ROADMAP_REFS_EMPTY: 'TASK_ROADMAP_REFS_EMPTY',
|
|
14
14
|
OUTSIDE_MARKER: 'TASK_OUTSIDE_MARKER',
|
|
15
15
|
LINK_PATH_FORMAT_INVALID: 'TASK_LINK_PATH_FORMAT_INVALID',
|
|
16
|
-
HOOK_FILE_MISSING: 'TASK_HOOK_FILE_MISSING',
|
|
17
16
|
FILTER_EMPTY: 'TASK_FILTER_EMPTY',
|
|
18
|
-
CONTEXT_HOOK_HEAD_MISSING: 'TASK_CONTEXT_HOOK_HEAD_MISSING',
|
|
19
|
-
CONTEXT_HOOK_FOOTER_MISSING: 'TASK_CONTEXT_HOOK_FOOTER_MISSING',
|
|
20
17
|
// Spec v1.1.0 - Blocker Categorization
|
|
21
18
|
BLOCKED_WITHOUT_BLOCKER: 'TASK_BLOCKED_WITHOUT_BLOCKER',
|
|
22
19
|
BLOCKER_TYPE_INVALID: 'TASK_BLOCKER_TYPE_INVALID',
|
|
@@ -37,5 +34,6 @@ export const ROADMAP_LINT_CODES = {
|
|
|
37
34
|
export const PROJECT_LINT_CODES = {
|
|
38
35
|
TASKS_FILE_MISSING: 'PROJECT_TASKS_FILE_MISSING',
|
|
39
36
|
ARCHITECTURE_DOC_MISSING: 'PROJECT_ARCHITECTURE_DOC_MISSING',
|
|
40
|
-
|
|
37
|
+
CODE_STYLE_DOC_MISSING: 'PROJECT_CODE_STYLE_DOC_MISSING',
|
|
38
|
+
UI_STYLE_DOC_MISSING: 'PROJECT_UI_STYLE_DOC_MISSING',
|
|
41
39
|
};
|
|
@@ -32,7 +32,8 @@ export function getDefaultToolTemplateMarkdown(toolName) {
|
|
|
32
32
|
'- Check lint gaps and create executable fix tasks.',
|
|
33
33
|
'- Check test quality gaps (missing tests, flaky tests, low-value coverage).',
|
|
34
34
|
'- Learn current project architecture and consolidate/update design docs in designs/.',
|
|
35
|
-
'- Review and update
|
|
35
|
+
'- Review and update core governance docs under designs/core/ (architecture.md, code-style.md, ui-style.md) if missing or outdated.',
|
|
36
|
+
'- When finishing a task, re-check whether architecture boundaries, code conventions, or UI patterns changed and update the matching core docs.',
|
|
36
37
|
'- Re-run {{tool_name}} after creating 1-3 focused TODO tasks.',
|
|
37
38
|
].join('\n');
|
|
38
39
|
}
|
|
@@ -49,10 +50,34 @@ export function getDefaultToolTemplateMarkdown(toolName) {
|
|
|
49
50
|
'- ./.cursor/rules/*',
|
|
50
51
|
].join('\n');
|
|
51
52
|
}
|
|
52
|
-
if (toolName === 'taskUpdate'
|
|
53
|
+
if (toolName === 'taskUpdate') {
|
|
53
54
|
return [
|
|
54
55
|
base,
|
|
55
56
|
'',
|
|
57
|
+
'## Governance Write Rule',
|
|
58
|
+
'- MUST use governance tools for task/roadmap state updates.',
|
|
59
|
+
'- NEVER edit tasks.md/roadmap.md directly; they are generated views.',
|
|
60
|
+
'',
|
|
61
|
+
'## Core Docs Review Checklist (Required When Marking DONE)',
|
|
62
|
+
'- [ ] architecture.md reviewed (designs/core/architecture.md)',
|
|
63
|
+
'- [ ] code-style.md reviewed (designs/core/code-style.md)',
|
|
64
|
+
'- [ ] ui-style.md reviewed (designs/core/ui-style.md)',
|
|
65
|
+
'',
|
|
66
|
+
'## Commit Reminder',
|
|
67
|
+
'- After this update, create a commit to keep progress auditable.',
|
|
68
|
+
'- Recommended format: type(scope): summary',
|
|
69
|
+
'- Example: feat(task): complete TASK-0007 validation flow',
|
|
70
|
+
'- Footer suggestion: Refs: TASK-0007, ROADMAP-0002',
|
|
71
|
+
].join('\n');
|
|
72
|
+
}
|
|
73
|
+
if (toolName === 'roadmapUpdate') {
|
|
74
|
+
return [
|
|
75
|
+
base,
|
|
76
|
+
'',
|
|
77
|
+
'## Governance Write Rule',
|
|
78
|
+
'- MUST use governance tools for task/roadmap state updates.',
|
|
79
|
+
'- NEVER edit tasks.md/roadmap.md directly; they are generated views.',
|
|
80
|
+
'',
|
|
56
81
|
'## Commit Reminder',
|
|
57
82
|
'- After this update, create a commit to keep progress auditable.',
|
|
58
83
|
'- Recommended format: type(scope): summary',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { asText, nextCallSection, renderErrorMarkdown, renderToolResponseMarkdown, summarySection, } from './response.js';
|
|
2
|
+
import { asText, getDefaultToolTemplateMarkdown, nextCallSection, renderErrorMarkdown, renderToolResponseMarkdown, summarySection, } from './response.js';
|
|
3
3
|
describe('response helpers', () => {
|
|
4
4
|
it('wraps markdown text as MCP text content', () => {
|
|
5
5
|
const result = asText('# hello');
|
|
@@ -47,4 +47,16 @@ describe('response helpers', () => {
|
|
|
47
47
|
});
|
|
48
48
|
expect(withoutCall).toContain('- (none)');
|
|
49
49
|
});
|
|
50
|
+
it('taskUpdate default template includes core docs review checklist', () => {
|
|
51
|
+
const markdown = getDefaultToolTemplateMarkdown('taskUpdate');
|
|
52
|
+
expect(markdown).toContain('Core Docs Review Checklist (Required When Marking DONE)');
|
|
53
|
+
expect(markdown).toContain('- [ ] architecture.md reviewed (designs/core/architecture.md)');
|
|
54
|
+
expect(markdown).toContain('- [ ] code-style.md reviewed (designs/core/code-style.md)');
|
|
55
|
+
expect(markdown).toContain('- [ ] ui-style.md reviewed (designs/core/ui-style.md)');
|
|
56
|
+
});
|
|
57
|
+
it('roadmapUpdate default template keeps governance write rule without task checklist', () => {
|
|
58
|
+
const markdown = getDefaultToolTemplateMarkdown('roadmapUpdate');
|
|
59
|
+
expect(markdown).toContain('Governance Write Rule');
|
|
60
|
+
expect(markdown).not.toContain('Core Docs Review Checklist (Required When Marking DONE)');
|
|
61
|
+
});
|
|
50
62
|
});
|
|
@@ -69,6 +69,7 @@ export function registerQuickStartPrompt(server) {
|
|
|
69
69
|
'2. Understand task requirements and acceptance criteria',
|
|
70
70
|
'3. Write governance source via tools (`taskCreate` / `taskUpdate` / `roadmapCreate` / `roadmapUpdate`) instead of editing tasks.md/roadmap.md directly',
|
|
71
71
|
'4. Update docs (`designs/` / `reports/`) as required by evidence',
|
|
72
|
+
'4.5. Before closing the task, check whether `designs/core/architecture.md`, `designs/core/code-style.md`, or `designs/core/ui-style.md` need updates',
|
|
72
73
|
'5. taskCreate/taskUpdate/roadmapCreate/roadmapUpdate will auto-sync corresponding markdown views',
|
|
73
74
|
'6. Update task status:',
|
|
74
75
|
' - TODO → IN_PROGRESS (when starting execution)',
|
|
@@ -104,11 +105,12 @@ export function registerQuickStartPrompt(server) {
|
|
|
104
105
|
'**Stop Reason 3: No actionable tasks (all TODO blocked or no tasks exist)**',
|
|
105
106
|
'- Means: all unblocked work is complete, only blocked tasks remain OR no tasks at all',
|
|
106
107
|
'- **What to do next:** Analyze blockers and roadmap, create 1-3 new TODO tasks via `taskCreate()`',
|
|
108
|
+
'- Prefer creating or refreshing core-doc tasks first when `designs/core/architecture.md`, `designs/core/code-style.md`, or `designs/core/ui-style.md` are missing or stale',
|
|
107
109
|
'',
|
|
108
110
|
'## Special Cases',
|
|
109
111
|
'',
|
|
110
|
-
'### Case 1: No .projitive directory',
|
|
111
|
-
'Call `projectInit(projectPath="<project-dir>")` to initialize governance structure.',
|
|
112
|
+
'### Case 1: No .projitive directory or required governance artifacts are missing',
|
|
113
|
+
'Call `projectInit(projectPath="<project-dir>")` to initialize or repair governance structure.',
|
|
112
114
|
'',
|
|
113
115
|
'### Case 2: No actionable tasks (all TODO/IN_PROGRESS are blocked OR task count is zero)',
|
|
114
116
|
'',
|
|
@@ -135,6 +137,7 @@ export function registerQuickStartPrompt(server) {
|
|
|
135
137
|
' - **Minimal dependencies**: avoid complex task chains at start',
|
|
136
138
|
'4. Call `taskCreate()` for each task with complete metadata',
|
|
137
139
|
'5. Re-run `taskNext()` to start executing the new tasks',
|
|
140
|
+
'6. Ensure bootstrap projects include TODO tasks for project architecture, code style, and UI style docs',
|
|
138
141
|
'',
|
|
139
142
|
'**If roadmap is also empty:**',
|
|
140
143
|
'1. Read design documents under `projitive://designs/`',
|
|
@@ -147,9 +150,11 @@ export function registerQuickStartPrompt(server) {
|
|
|
147
150
|
'- **NEVER modify TASK/ROADMAP IDs** - Keep them immutable once assigned',
|
|
148
151
|
'- **Every status transition must have report evidence** - Create execution reports in reports/ directory',
|
|
149
152
|
'- **.projitive governance store is source of truth** - tasks.md/roadmap.md are generated views and may be overwritten',
|
|
150
|
-
'- **
|
|
153
|
+
'- **MUST use tools for task/roadmap changes** - Use taskCreate/taskUpdate/roadmapCreate/roadmapUpdate',
|
|
154
|
+
'- **NEVER edit tasks.md or roadmap.md directly** - They are generated views, not writable source-of-truth',
|
|
151
155
|
'- **Always verify after updates** - Re-run taskContext() to confirm reference consistency',
|
|
152
156
|
'- **BLOCKED tasks require full blocker metadata** - type, description required; blockingEntity, unblockCondition, escalationPath as needed',
|
|
157
|
+
'- **Every completed task should re-check core docs** - architecture.md for system changes, code-style.md for engineering conventions, ui-style.md for UI/pattern changes',
|
|
153
158
|
].join('\n');
|
|
154
159
|
return asUserPrompt(text);
|
|
155
160
|
});
|
|
@@ -155,6 +155,12 @@ export function registerTaskDiscoveryPrompt(server) {
|
|
|
155
155
|
'',
|
|
156
156
|
'3. **Execute task content**',
|
|
157
157
|
' - Update governance store via MCP tools; edit designs/*.md and reports/*.md as needed',
|
|
158
|
+
' - NEVER edit tasks.md/roadmap.md directly; use taskCreate/taskUpdate/roadmapCreate/roadmapUpdate',
|
|
159
|
+
' - Core docs review checklist (required before DONE):',
|
|
160
|
+
' - [ ] architecture.md reviewed (`designs/core/architecture.md`)',
|
|
161
|
+
' - [ ] code-style.md reviewed (`designs/core/code-style.md`)',
|
|
162
|
+
' - [ ] ui-style.md reviewed (`designs/core/ui-style.md`)',
|
|
163
|
+
' - Before closing a task, re-check designs/core/architecture.md, designs/core/code-style.md, and designs/core/ui-style.md and update any stale guidance',
|
|
158
164
|
' - If immediate markdown snapshots are required by another agent/session, call syncViews(force=true)',
|
|
159
165
|
' - Create execution report (reports/ directory)',
|
|
160
166
|
' - Update task status to DONE',
|
|
@@ -171,6 +177,7 @@ export function registerTaskDiscoveryPrompt(server) {
|
|
|
171
177
|
'If taskNext() returns empty:',
|
|
172
178
|
'1. Check if .projitive exists',
|
|
173
179
|
'2. Analyze active roadmap milestones and derive 1-3 executable TODO tasks',
|
|
180
|
+
'2.5. If core docs are missing or clearly stale, create TODO tasks to initialize or refresh project architecture, code style, and UI style docs first',
|
|
174
181
|
'3. Prioritize milestone slices that unblock multiple downstream tasks',
|
|
175
182
|
'3.5 If roadmap milestone is missing, create it first via `roadmapCreate()`',
|
|
176
183
|
'4. Create tasks via `taskCreate(projectPath="...", taskId="TASK-xxxx", title="...", roadmapRefs=["ROADMAP-xxxx"], summary="...")`',
|
|
@@ -193,8 +200,8 @@ export function registerTaskDiscoveryPrompt(server) {
|
|
|
193
200
|
'',
|
|
194
201
|
'### Case 3: Missing required governance files',
|
|
195
202
|
'',
|
|
196
|
-
'If .projitive does not exist:',
|
|
197
|
-
'1. Call `projectInit(projectPath="...")` to initialize governance structure',
|
|
203
|
+
'If .projitive does not exist or required governance artifacts are missing:',
|
|
204
|
+
'1. Call `projectInit(projectPath="...")` to initialize or repair governance structure',
|
|
198
205
|
'2. Then restart discovery flow',
|
|
199
206
|
'',
|
|
200
207
|
'## Quick Reference',
|
|
@@ -211,6 +218,14 @@ export function registerTaskDiscoveryPrompt(server) {
|
|
|
211
218
|
'| `taskUpdate()` | Update task status |',
|
|
212
219
|
'| `roadmapCreate()` | Create a new roadmap milestone |',
|
|
213
220
|
'| `syncViews()` | Force materialize tasks.md/roadmap.md from governance store |',
|
|
221
|
+
'',
|
|
222
|
+
'## Core Doc Maintenance Rule',
|
|
223
|
+
'- When a task changes architecture, engineering conventions, or UI patterns, update the matching core doc before marking the task DONE.',
|
|
224
|
+
'- Core docs live under `designs/core/`: `architecture.md`, `code-style.md`, `ui-style.md`.',
|
|
225
|
+
'',
|
|
226
|
+
'## Governance Write Rule',
|
|
227
|
+
'- MUST use governance tools (`taskCreate`, `taskUpdate`, `roadmapCreate`, `roadmapUpdate`) for state changes.',
|
|
228
|
+
'- NEVER edit `tasks.md` or `roadmap.md` directly; those files are generated views.',
|
|
214
229
|
].join('\n');
|
|
215
230
|
return asUserPrompt(text);
|
|
216
231
|
});
|
|
@@ -11,6 +11,10 @@ describe('taskDiscovery prompt', () => {
|
|
|
11
11
|
expect(text).toContain('Known project path: "/workspace/app"');
|
|
12
12
|
expect(text).toContain('Method A: Auto-select with taskNext()');
|
|
13
13
|
expect(text).toContain('roadmapCreate');
|
|
14
|
+
expect(text).toContain('Core docs review checklist (required before DONE):');
|
|
15
|
+
expect(text).toContain('- [ ] architecture.md reviewed (`designs/core/architecture.md`)');
|
|
16
|
+
expect(text).toContain('- [ ] code-style.md reviewed (`designs/core/code-style.md`)');
|
|
17
|
+
expect(text).toContain('- [ ] ui-style.md reviewed (`designs/core/ui-style.md`)');
|
|
14
18
|
});
|
|
15
19
|
it('renders unknown-project discovery steps', async () => {
|
|
16
20
|
const server = { registerPrompt: vi.fn() };
|
|
@@ -47,7 +47,8 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
47
47
|
'- If status is MISSING/INCOMPLETE, complete it before any implementation',
|
|
48
48
|
'',
|
|
49
49
|
'### Pre-Execution Research Brief (Mandatory Gate)',
|
|
50
|
-
'- Fixed file name: `designs/research/<TASK-ID>.implementation-research.md`',
|
|
50
|
+
'- Fixed file name (relative to governanceDir): `designs/research/<TASK-ID>.implementation-research.md`',
|
|
51
|
+
'- Absolute location: `<governanceDir>/designs/research/<TASK-ID>.implementation-research.md`',
|
|
51
52
|
'- Required sections:',
|
|
52
53
|
' - `## Design Guidelines and Specs`',
|
|
53
54
|
' - `## Code Architecture and Implementation Findings`',
|
|
@@ -85,7 +86,9 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
85
86
|
'2. **Execute task content**',
|
|
86
87
|
' - Prefer MCP tool writes for governance store (`taskUpdate` / `roadmapUpdate`)',
|
|
87
88
|
' - .projitive (task table) - Update task status and metadata',
|
|
89
|
+
' - NEVER edit tasks.md/roadmap.md directly; always write via tools and let views sync automatically',
|
|
88
90
|
' - designs/*.md - Add or update design documents',
|
|
91
|
+
' - Before marking DONE, check whether `designs/core/architecture.md`, `designs/core/code-style.md`, or `designs/core/ui-style.md` need maintenance',
|
|
89
92
|
' - reports/*.md - Create execution reports',
|
|
90
93
|
' - .projitive (roadmap table) - Update roadmap (if needed)',
|
|
91
94
|
' - taskCreate/taskUpdate/roadmapCreate/roadmapUpdate auto-sync corresponding markdown views',
|
|
@@ -98,6 +101,11 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
98
101
|
'',
|
|
99
102
|
'4. **Complete task (if status is IN_PROGRESS)',
|
|
100
103
|
' - Confirm all acceptance criteria are met',
|
|
104
|
+
' - Core docs review checklist (required):',
|
|
105
|
+
' - [ ] architecture.md reviewed (`designs/core/architecture.md`)',
|
|
106
|
+
' - [ ] code-style.md reviewed (`designs/core/code-style.md`)',
|
|
107
|
+
' - [ ] ui-style.md reviewed (`designs/core/ui-style.md`)',
|
|
108
|
+
' - Confirm project architecture, code style, and UI style docs are still accurate after the change',
|
|
101
109
|
' - Call `taskUpdate()` to change status to DONE',
|
|
102
110
|
' - Update updatedAt timestamp',
|
|
103
111
|
'',
|
|
@@ -194,8 +202,8 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
194
202
|
'',
|
|
195
203
|
'### Case 3: Need to initialize governance',
|
|
196
204
|
'',
|
|
197
|
-
'If .projitive directory does not exist:',
|
|
198
|
-
'1. Call `projectInit(projectPath="<project-dir>")`',
|
|
205
|
+
'If .projitive directory does not exist or required governance artifacts are missing:',
|
|
206
|
+
'1. Call `projectInit(projectPath="<project-dir>")` to initialize or repair governance structure',
|
|
199
207
|
'2. Then restart',
|
|
200
208
|
'',
|
|
201
209
|
'## Hard Rules (NEVER violate)',
|
|
@@ -211,7 +219,8 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
211
219
|
'',
|
|
212
220
|
'3. **Governance-store-first writes only**',
|
|
213
221
|
' - tasks.md/roadmap.md are generated views, not authoritative source',
|
|
214
|
-
' -
|
|
222
|
+
' - MUST use taskCreate/taskUpdate/roadmapCreate/roadmapUpdate for governance state changes',
|
|
223
|
+
' - NEVER directly edit tasks.md/roadmap.md',
|
|
215
224
|
'',
|
|
216
225
|
'4. **Always verify after updates**',
|
|
217
226
|
' - After every taskUpdate() call',
|
|
@@ -224,7 +233,12 @@ export function registerTaskExecutionPrompt(server) {
|
|
|
224
233
|
'',
|
|
225
234
|
'6. **Pre-execution research brief is mandatory**',
|
|
226
235
|
' - `TODO -> IN_PROGRESS` is not allowed until research brief is READY',
|
|
227
|
-
' - Always read
|
|
236
|
+
' - Always read `<governanceDir>/designs/research/<TASK-ID>.implementation-research.md` before implementation',
|
|
237
|
+
'',
|
|
238
|
+
'7. **Core docs are a completion checkpoint**',
|
|
239
|
+
' - Re-check `designs/core/architecture.md` when system boundaries or flows change',
|
|
240
|
+
' - Re-check `designs/core/code-style.md` when coding conventions or reusable engineering patterns change',
|
|
241
|
+
' - Re-check `designs/core/ui-style.md` when UI behavior, tokens, or interaction patterns change',
|
|
228
242
|
].join('\n');
|
|
229
243
|
return asUserPrompt(text);
|
|
230
244
|
});
|
|
@@ -11,7 +11,12 @@ describe('taskExecution prompt', () => {
|
|
|
11
11
|
expect(text).toContain('1) Run taskContext(projectPath="/workspace/app", taskId="TASK-0007").');
|
|
12
12
|
expect(text).toContain('Every status transition must have report evidence');
|
|
13
13
|
expect(text).toContain('Pre-Execution Research Brief (Mandatory Gate)');
|
|
14
|
-
expect(text).toContain('designs/research/<TASK-ID>.implementation-research.md');
|
|
14
|
+
expect(text).toContain('Fixed file name (relative to governanceDir): `designs/research/<TASK-ID>.implementation-research.md`');
|
|
15
|
+
expect(text).toContain('Always read `<governanceDir>/designs/research/<TASK-ID>.implementation-research.md` before implementation');
|
|
16
|
+
expect(text).toContain('Core docs review checklist (required):');
|
|
17
|
+
expect(text).toContain('- [ ] architecture.md reviewed (`designs/core/architecture.md`)');
|
|
18
|
+
expect(text).toContain('- [ ] code-style.md reviewed (`designs/core/code-style.md`)');
|
|
19
|
+
expect(text).toContain('- [ ] ui-style.md reviewed (`designs/core/ui-style.md`)');
|
|
15
20
|
});
|
|
16
21
|
it('falls back to taskNext when task is not provided', async () => {
|
|
17
22
|
const server = { registerPrompt: vi.fn() };
|