mancode 0.2.0 → 0.2.1
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 +6 -6
- package/README.zh-CN.md +6 -6
- package/dist/cli.js +52 -22
- package/dist/cli.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -82,9 +82,9 @@ testing, and multi-agent review: playoffs, every possession counts.
|
|
|
82
82
|
.claude/ # Claude Code: hooks, skills, agents
|
|
83
83
|
.cursor/rules/ # Cursor: project rules
|
|
84
84
|
AGENTS.md # Codex CLI: managed instruction block
|
|
85
|
-
.
|
|
85
|
+
.agents/skills/ # Codex CLI: mode skills
|
|
86
86
|
.github/copilot-instructions.md # GitHub Copilot: managed instruction block
|
|
87
|
-
.
|
|
87
|
+
.agents/skills/ # ZCode: project mode skills
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
`.mancode/` stores local state, project style signals, workflow reports, and
|
|
@@ -252,7 +252,7 @@ Supported platforms:
|
|
|
252
252
|
- Codex CLI: managed `AGENTS.md` block
|
|
253
253
|
- GitHub Copilot: managed `.github/copilot-instructions.md` block
|
|
254
254
|
- ZCode: managed `AGENTS.md` block and provisional `$man*` skills in
|
|
255
|
-
`.
|
|
255
|
+
`.agents/skills/`; project skill discovery and slash commands pending verified
|
|
256
256
|
workspace paths
|
|
257
257
|
- Windsurf, Cline, Roo Code: planned later
|
|
258
258
|
|
|
@@ -320,9 +320,9 @@ Installed platforms:
|
|
|
320
320
|
Platform status:
|
|
321
321
|
✓ Claude Code: ready (.claude/)
|
|
322
322
|
✓ Cursor: ready (.cursor/rules/)
|
|
323
|
-
✓ Codex CLI: ready (AGENTS.md + .
|
|
323
|
+
✓ Codex CLI: ready (AGENTS.md + .agents/skills/)
|
|
324
324
|
✓ GitHub Copilot: ready (.github/copilot-instructions.md)
|
|
325
|
-
✓ ZCode: ready (AGENTS.md + .
|
|
325
|
+
✓ ZCode: ready (AGENTS.md + .agents/skills/)
|
|
326
326
|
|
|
327
327
|
Hooks:
|
|
328
328
|
✓ session-start.sh
|
|
@@ -480,7 +480,7 @@ markers is preserved.
|
|
|
480
480
|
|
|
481
481
|
### ZCode skills not appearing
|
|
482
482
|
|
|
483
|
-
Ensure `.
|
|
483
|
+
Ensure `.agents/skills/man8/SKILL.md` through `.agents/skills/mansolo/SKILL.md`
|
|
484
484
|
exist, then restart or refresh ZCode. ZCode slash commands are not generated
|
|
485
485
|
yet because the workspace command file path still needs explicit verification.
|
|
486
486
|
|
package/README.zh-CN.md
CHANGED
|
@@ -76,9 +76,9 @@ mancode init
|
|
|
76
76
|
.claude/ # Claude Code:hooks、skills、agents
|
|
77
77
|
.cursor/rules/ # Cursor:项目 rules
|
|
78
78
|
AGENTS.md # Codex CLI:托管 instruction block
|
|
79
|
-
.
|
|
79
|
+
.agents/skills/ # Codex CLI:mode skills
|
|
80
80
|
.github/copilot-instructions.md # GitHub Copilot:托管 instruction block
|
|
81
|
-
.
|
|
81
|
+
.agents/skills/ # ZCode:项目 mode skills
|
|
82
82
|
```
|
|
83
83
|
|
|
84
84
|
`.mancode/` 保存本地状态、项目风格信号、工作流报告和团队记忆。平台文件保存对应
|
|
@@ -227,7 +227,7 @@ mancode init --platform cursor
|
|
|
227
227
|
- Cursor:`.cursor/rules/*.mdc` rules
|
|
228
228
|
- Codex CLI:托管 `AGENTS.md` block
|
|
229
229
|
- GitHub Copilot:托管 `.github/copilot-instructions.md` block
|
|
230
|
-
- ZCode:托管 `AGENTS.md` block,并暂按 `.
|
|
230
|
+
- ZCode:托管 `AGENTS.md` block,并暂按 `.agents/skills/` 生成 `$man*`
|
|
231
231
|
skills;项目级 skill 发现和 slash commands 仍需确认 workspace 路径后再发布承诺
|
|
232
232
|
- Windsurf、Cline、Roo Code:后续计划
|
|
233
233
|
|
|
@@ -295,9 +295,9 @@ Installed platforms:
|
|
|
295
295
|
Platform status:
|
|
296
296
|
✓ Claude Code: ready (.claude/)
|
|
297
297
|
✓ Cursor: ready (.cursor/rules/)
|
|
298
|
-
✓ Codex CLI: ready (AGENTS.md + .
|
|
298
|
+
✓ Codex CLI: ready (AGENTS.md + .agents/skills/)
|
|
299
299
|
✓ GitHub Copilot: ready (.github/copilot-instructions.md)
|
|
300
|
-
✓ ZCode: ready (AGENTS.md + .
|
|
300
|
+
✓ ZCode: ready (AGENTS.md + .agents/skills/)
|
|
301
301
|
|
|
302
302
|
Hooks:
|
|
303
303
|
✓ session-start.sh
|
|
@@ -449,7 +449,7 @@ mancode 要求目标目录有 `.git` 或 `package.json`。请在 git 仓库或 N
|
|
|
449
449
|
|
|
450
450
|
### ZCode skills 未出现
|
|
451
451
|
|
|
452
|
-
确认 `.
|
|
452
|
+
确认 `.agents/skills/man8/SKILL.md` 到 `.agents/skills/mansolo/SKILL.md`
|
|
453
453
|
都存在,然后重启或刷新 ZCode。当前尚不生成 ZCode `/man*` slash commands,
|
|
454
454
|
因为 workspace command 的文件路径仍需显式验证。
|
|
455
455
|
|
package/dist/cli.js
CHANGED
|
@@ -1785,6 +1785,10 @@ var MODE_NAMES = [
|
|
|
1785
1785
|
];
|
|
1786
1786
|
var CODEX_SKILL_MANAGED_MARKER = "<!-- Managed by mancode:codex-skill. Do not edit this file manually. -->";
|
|
1787
1787
|
var ZCODE_SKILL_MANAGED_MARKER = "<!-- Managed by mancode:zcode-skill. Do not edit this file manually. -->";
|
|
1788
|
+
var MANCODE_AGENT_SKILL_MARKERS = [
|
|
1789
|
+
CODEX_SKILL_MANAGED_MARKER,
|
|
1790
|
+
ZCODE_SKILL_MANAGED_MARKER
|
|
1791
|
+
];
|
|
1788
1792
|
function renderModeSkill(mode, commandPrefix = "$") {
|
|
1789
1793
|
const meta = MODE_META[mode];
|
|
1790
1794
|
const stateMode = mode === "mansolo" ? "solo" : mode;
|
|
@@ -1826,7 +1830,7 @@ async function installCodexSkills(projectRoot, minimal) {
|
|
|
1826
1830
|
await removeCodexSkills(projectRoot);
|
|
1827
1831
|
return;
|
|
1828
1832
|
}
|
|
1829
|
-
const skillsDir = path4.join(projectRoot, ".
|
|
1833
|
+
const skillsDir = path4.join(projectRoot, ".agents", "skills");
|
|
1830
1834
|
for (const mode of MODE_NAMES) {
|
|
1831
1835
|
const modeDir = path4.join(skillsDir, mode);
|
|
1832
1836
|
await mkdir4(modeDir, { recursive: true });
|
|
@@ -1846,7 +1850,8 @@ async function installCodexSkills(projectRoot, minimal) {
|
|
|
1846
1850
|
path4.join(modeDir, "SKILL.md"),
|
|
1847
1851
|
content,
|
|
1848
1852
|
CODEX_SKILL_MANAGED_MARKER,
|
|
1849
|
-
"Codex"
|
|
1853
|
+
"Codex",
|
|
1854
|
+
MANCODE_AGENT_SKILL_MARKERS
|
|
1850
1855
|
);
|
|
1851
1856
|
}
|
|
1852
1857
|
}
|
|
@@ -1855,7 +1860,7 @@ async function installZcodeSkills(projectRoot, minimal) {
|
|
|
1855
1860
|
await removeZcodeSkills(projectRoot);
|
|
1856
1861
|
return;
|
|
1857
1862
|
}
|
|
1858
|
-
const skillsDir = path4.join(projectRoot, ".
|
|
1863
|
+
const skillsDir = path4.join(projectRoot, ".agents", "skills");
|
|
1859
1864
|
for (const mode of MODE_NAMES) {
|
|
1860
1865
|
const modeDir = path4.join(skillsDir, mode);
|
|
1861
1866
|
await mkdir4(modeDir, { recursive: true });
|
|
@@ -1875,7 +1880,8 @@ async function installZcodeSkills(projectRoot, minimal) {
|
|
|
1875
1880
|
path4.join(modeDir, "SKILL.md"),
|
|
1876
1881
|
content,
|
|
1877
1882
|
ZCODE_SKILL_MANAGED_MARKER,
|
|
1878
|
-
"ZCode"
|
|
1883
|
+
"ZCode",
|
|
1884
|
+
MANCODE_AGENT_SKILL_MARKERS
|
|
1879
1885
|
);
|
|
1880
1886
|
}
|
|
1881
1887
|
}
|
|
@@ -1925,7 +1931,10 @@ async function installCopilotPrompts(projectRoot, minimal) {
|
|
|
1925
1931
|
}
|
|
1926
1932
|
}
|
|
1927
1933
|
async function removeCodexSkills(projectRoot) {
|
|
1928
|
-
|
|
1934
|
+
await cleanCodexManagedSkills(path4.join(projectRoot, ".agents", "skills"));
|
|
1935
|
+
await cleanCodexManagedSkills(path4.join(projectRoot, ".codex", "skills"));
|
|
1936
|
+
}
|
|
1937
|
+
async function cleanCodexManagedSkills(skillsDir) {
|
|
1929
1938
|
for (const mode of MODE_NAMES) {
|
|
1930
1939
|
const modeDir = path4.join(skillsDir, mode);
|
|
1931
1940
|
const skillPath = path4.join(modeDir, "SKILL.md");
|
|
@@ -1937,7 +1946,10 @@ async function removeCodexSkills(projectRoot) {
|
|
|
1937
1946
|
await removeIfEmpty(skillsDir);
|
|
1938
1947
|
}
|
|
1939
1948
|
async function removeZcodeSkills(projectRoot) {
|
|
1940
|
-
|
|
1949
|
+
await cleanZcodeManagedSkills(path4.join(projectRoot, ".agents", "skills"));
|
|
1950
|
+
await cleanZcodeManagedSkills(path4.join(projectRoot, ".zcode", "skills"));
|
|
1951
|
+
}
|
|
1952
|
+
async function cleanZcodeManagedSkills(skillsDir) {
|
|
1941
1953
|
for (const mode of MODE_NAMES) {
|
|
1942
1954
|
const modeDir = path4.join(skillsDir, mode);
|
|
1943
1955
|
const skillPath = path4.join(modeDir, "SKILL.md");
|
|
@@ -1972,9 +1984,9 @@ async function removeIfEmpty(dir) {
|
|
|
1972
1984
|
} catch {
|
|
1973
1985
|
}
|
|
1974
1986
|
}
|
|
1975
|
-
async function writeManagedSkill(skillPath, content, marker, platformLabel) {
|
|
1987
|
+
async function writeManagedSkill(skillPath, content, marker, platformLabel, recognizedMarkers = [marker]) {
|
|
1976
1988
|
const existing = await readTextIfExists2(skillPath);
|
|
1977
|
-
if (existing !== null && !existing.includes(
|
|
1989
|
+
if (existing !== null && !recognizedMarkers.some((m) => existing.includes(m))) {
|
|
1978
1990
|
throw new Error(
|
|
1979
1991
|
`refusing to overwrite user-authored ${platformLabel} skill: ${skillPath}`
|
|
1980
1992
|
);
|
|
@@ -3371,12 +3383,12 @@ function printPlatformCreatedFiles(platform) {
|
|
|
3371
3383
|
}
|
|
3372
3384
|
if (platform === "codex") {
|
|
3373
3385
|
console.log(" AGENTS.md # Codex managed block");
|
|
3374
|
-
console.log(" .
|
|
3386
|
+
console.log(" .agents/skills/ # Codex mode skills");
|
|
3375
3387
|
return;
|
|
3376
3388
|
}
|
|
3377
3389
|
if (platform === "zcode") {
|
|
3378
3390
|
console.log(" AGENTS.md # ZCode managed block");
|
|
3379
|
-
console.log(" .
|
|
3391
|
+
console.log(" .agents/skills/ # ZCode mode skills");
|
|
3380
3392
|
return;
|
|
3381
3393
|
}
|
|
3382
3394
|
console.log(" .github/copilot-instructions.md # Copilot instructions");
|
|
@@ -3452,15 +3464,15 @@ async function checkPlatformReadiness(rootDir, platform) {
|
|
|
3452
3464
|
readyDetail: "managed block present"
|
|
3453
3465
|
};
|
|
3454
3466
|
}
|
|
3455
|
-
const skillsDir = path14.join(rootDir, ".
|
|
3467
|
+
const skillsDir = path14.join(rootDir, ".agents", "skills");
|
|
3456
3468
|
const hasSkills = await allManagedSkills(
|
|
3457
3469
|
MODE_NAMES.map((mode) => path14.join(skillsDir, mode, "SKILL.md")),
|
|
3458
|
-
|
|
3470
|
+
MANCODE_AGENT_SKILL_MARKERS
|
|
3459
3471
|
);
|
|
3460
3472
|
return {
|
|
3461
3473
|
present: true,
|
|
3462
3474
|
ready: hasSkills,
|
|
3463
|
-
target: "AGENTS.md + .
|
|
3475
|
+
target: "AGENTS.md + .agents/skills/",
|
|
3464
3476
|
readyDetail: hasSkills ? "managed block and skills present" : "mode skills are missing, incomplete, or user-authored"
|
|
3465
3477
|
};
|
|
3466
3478
|
}
|
|
@@ -3486,15 +3498,15 @@ async function checkPlatformReadiness(rootDir, platform) {
|
|
|
3486
3498
|
readyDetail: "managed block present"
|
|
3487
3499
|
};
|
|
3488
3500
|
}
|
|
3489
|
-
const skillsDir = path14.join(rootDir, ".
|
|
3501
|
+
const skillsDir = path14.join(rootDir, ".agents", "skills");
|
|
3490
3502
|
const hasSkills = await allManagedSkills(
|
|
3491
3503
|
MODE_NAMES.map((mode) => path14.join(skillsDir, mode, "SKILL.md")),
|
|
3492
|
-
|
|
3504
|
+
MANCODE_AGENT_SKILL_MARKERS
|
|
3493
3505
|
);
|
|
3494
3506
|
return {
|
|
3495
3507
|
present: true,
|
|
3496
3508
|
ready: hasSkills,
|
|
3497
|
-
target: "AGENTS.md + .
|
|
3509
|
+
target: "AGENTS.md + .agents/skills/",
|
|
3498
3510
|
readyDetail: hasSkills ? "managed block and skills present" : "mode skills are missing, incomplete, or user-authored"
|
|
3499
3511
|
};
|
|
3500
3512
|
}
|
|
@@ -3537,16 +3549,16 @@ async function allPathsExist(paths) {
|
|
|
3537
3549
|
const results = await Promise.all(paths.map(pathExists5));
|
|
3538
3550
|
return results.every(Boolean);
|
|
3539
3551
|
}
|
|
3540
|
-
async function allManagedSkills(paths,
|
|
3552
|
+
async function allManagedSkills(paths, markers) {
|
|
3541
3553
|
const results = await Promise.all(
|
|
3542
|
-
paths.map((filePath) =>
|
|
3554
|
+
paths.map((filePath) => fileHasAnyMarker(filePath, markers))
|
|
3543
3555
|
);
|
|
3544
3556
|
return results.every(Boolean);
|
|
3545
3557
|
}
|
|
3546
|
-
async function
|
|
3558
|
+
async function fileHasAnyMarker(filePath, needles) {
|
|
3547
3559
|
try {
|
|
3548
3560
|
const content = await fs3.readFile(filePath, "utf-8");
|
|
3549
|
-
return content.includes(needle);
|
|
3561
|
+
return needles.some((needle) => content.includes(needle));
|
|
3550
3562
|
} catch {
|
|
3551
3563
|
return false;
|
|
3552
3564
|
}
|
|
@@ -5602,7 +5614,9 @@ async function uninstallCodex(rootDir) {
|
|
|
5602
5614
|
}
|
|
5603
5615
|
} catch {
|
|
5604
5616
|
}
|
|
5605
|
-
await
|
|
5617
|
+
if (!await otherAgentSkillsPlatformActive(rootDir, "codex")) {
|
|
5618
|
+
await removeCodexSkills(rootDir);
|
|
5619
|
+
}
|
|
5606
5620
|
}
|
|
5607
5621
|
async function uninstallCopilot(rootDir) {
|
|
5608
5622
|
const instructionsPath = path22.join(
|
|
@@ -5640,7 +5654,9 @@ async function uninstallZcode(rootDir) {
|
|
|
5640
5654
|
}
|
|
5641
5655
|
} catch {
|
|
5642
5656
|
}
|
|
5643
|
-
await
|
|
5657
|
+
if (!await otherAgentSkillsPlatformActive(rootDir, "zcode")) {
|
|
5658
|
+
await removeZcodeSkills(rootDir);
|
|
5659
|
+
}
|
|
5644
5660
|
}
|
|
5645
5661
|
async function removeFromConfig(rootDir, platform) {
|
|
5646
5662
|
const configPath = path22.join(rootDir, ".mancode", "config.json");
|
|
@@ -5678,6 +5694,20 @@ async function pathExists11(p) {
|
|
|
5678
5694
|
return false;
|
|
5679
5695
|
}
|
|
5680
5696
|
}
|
|
5697
|
+
async function otherAgentSkillsPlatformActive(rootDir, excluding) {
|
|
5698
|
+
try {
|
|
5699
|
+
const raw = await readFile8(
|
|
5700
|
+
path22.join(rootDir, ".mancode", "config.json"),
|
|
5701
|
+
"utf-8"
|
|
5702
|
+
);
|
|
5703
|
+
const config = JSON.parse(raw);
|
|
5704
|
+
const platforms = Array.isArray(config.platforms) ? config.platforms : [];
|
|
5705
|
+
const peers = ["codex", "zcode"].filter((p) => p !== excluding);
|
|
5706
|
+
return platforms.some((p) => peers.includes(p));
|
|
5707
|
+
} catch {
|
|
5708
|
+
return false;
|
|
5709
|
+
}
|
|
5710
|
+
}
|
|
5681
5711
|
|
|
5682
5712
|
// src/commands/version.ts
|
|
5683
5713
|
import process9 from "process";
|