pmpt-cli 1.18.0 → 1.18.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/dist/lib/config.js +7 -1
- package/dist/lib/harness.js +26 -24
- package/package.json +1 -1
package/dist/lib/config.js
CHANGED
|
@@ -62,7 +62,12 @@ export function saveConfig(projectPath, config) {
|
|
|
62
62
|
const configPath = join(getConfigDir(projectPath), CONFIG_FILE);
|
|
63
63
|
writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const PMPT_INDEX_SECTION = `
|
|
66
|
+
<!-- pmpt-index -->
|
|
67
|
+
See \`.pmpt/index.md\` for project context. Single source of truth: \`.pmpt/docs/pmpt.md\`.
|
|
68
|
+
<!-- /pmpt-index -->
|
|
69
|
+
`;
|
|
70
|
+
const PMPT_MCP_SECTION = `
|
|
66
71
|
<!-- pmpt -->
|
|
67
72
|
## pmpt MCP Tools
|
|
68
73
|
|
|
@@ -78,6 +83,7 @@ Save after: feature completion, architecture decisions, bug fixes, or any signif
|
|
|
78
83
|
If pmpt MCP is not available, run \`pmpt save\` in terminal instead.
|
|
79
84
|
<!-- /pmpt -->
|
|
80
85
|
`;
|
|
86
|
+
const PMPT_CLAUDE_SECTION = PMPT_INDEX_SECTION + PMPT_MCP_SECTION;
|
|
81
87
|
/**
|
|
82
88
|
* Add pmpt MCP instructions to CLAUDE.md in the project root.
|
|
83
89
|
* Creates the file if it doesn't exist; appends the section if not already present.
|
package/dist/lib/harness.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
|
-
import { getConfigDir, getDocsDir } from './config.js';
|
|
3
|
+
import { getConfigDir, getDocsDir, ensurePmptClaudeMd } from './config.js';
|
|
4
4
|
// ─── index.md — lightweight map pointing to pmpt.md ───────────────
|
|
5
5
|
export function generateIndexMd(projectName) {
|
|
6
6
|
return `# ${projectName} — Project Context
|
|
@@ -26,21 +26,35 @@ export function generateIndexMd(projectName) {
|
|
|
26
26
|
export function generateCursorRules() {
|
|
27
27
|
return `# Project Rules
|
|
28
28
|
|
|
29
|
-
See \`.pmpt/index.md\` for the project context map.
|
|
30
|
-
|
|
29
|
+
See \`.pmpt/index.md\` for the full project context map.
|
|
31
30
|
The single source of truth is \`.pmpt/docs/pmpt.md\`.
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
|
|
32
|
+
## pmpt
|
|
33
|
+
|
|
34
|
+
This project uses [pmpt](https://pmptwiki.com) to track development progress.
|
|
35
|
+
|
|
36
|
+
- Read \`.pmpt/docs/pmpt.md\` before making any code changes
|
|
37
|
+
- Follow every rule in the **## Constraints** section of pmpt.md
|
|
38
|
+
- After milestones, run \`pmpt save\` in terminal with a summary
|
|
39
|
+
- Run \`pmpt status\` to check project state
|
|
40
|
+
- Update pmpt.md when architecture, constraints, or features change
|
|
34
41
|
`;
|
|
35
42
|
}
|
|
36
43
|
export function generateAgentsMd(projectName) {
|
|
37
44
|
return `# ${projectName} — Agent Instructions
|
|
38
45
|
|
|
39
|
-
See \`.pmpt/index.md\` for the project context map.
|
|
40
|
-
|
|
46
|
+
See \`.pmpt/index.md\` for the full project context map.
|
|
41
47
|
The single source of truth is \`.pmpt/docs/pmpt.md\`.
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
|
|
49
|
+
## pmpt
|
|
50
|
+
|
|
51
|
+
This project uses [pmpt](https://pmptwiki.com) to track development progress.
|
|
52
|
+
|
|
53
|
+
- Read \`.pmpt/docs/pmpt.md\` before making any code changes
|
|
54
|
+
- Follow every rule in the **## Constraints** section of pmpt.md
|
|
55
|
+
- After milestones, run \`pmpt save\` in terminal with a summary
|
|
56
|
+
- Run \`pmpt status\` to check project state
|
|
57
|
+
- Update pmpt.md when architecture, constraints, or features change
|
|
44
58
|
`;
|
|
45
59
|
}
|
|
46
60
|
// ─── Setup functions ───────────────────────────────────────────────
|
|
@@ -81,21 +95,9 @@ export function ensureClaudeMdRef(projectPath) {
|
|
|
81
95
|
ensureClaudeMdIndexRef(projectPath);
|
|
82
96
|
}
|
|
83
97
|
function ensureClaudeMdIndexRef(projectPath) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (!existsSync(claudeMdPath))
|
|
88
|
-
return;
|
|
89
|
-
const content = readFileSync(claudeMdPath, 'utf-8');
|
|
90
|
-
if (content.includes(marker))
|
|
91
|
-
return;
|
|
92
|
-
const pmptMarker = '<!-- pmpt -->';
|
|
93
|
-
if (content.includes(pmptMarker)) {
|
|
94
|
-
writeFileSync(claudeMdPath, content.replace(pmptMarker, section + '\n\n' + pmptMarker), 'utf-8');
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
writeFileSync(claudeMdPath, section + '\n\n' + content, 'utf-8');
|
|
98
|
-
}
|
|
98
|
+
// Delegate to ensurePmptClaudeMd which handles both creation and section injection
|
|
99
|
+
// (index pointer + MCP tools)
|
|
100
|
+
ensurePmptClaudeMd(projectPath);
|
|
99
101
|
}
|
|
100
102
|
// ─── pmpt.md section migration ────────────────────────────────────
|
|
101
103
|
const HARNESS_SECTIONS = [
|