docs(claude): install manual skills at top level (#2160)

* docs(claude): install manual skills at top level

* test(docs): guard Claude manual skill install path

* test(docs): detect PowerShell/$HOME nested skill-install paths

Address CodeRabbit on #2160: the nested-path regression guard only matched
Unix `mkdir`/`cp` with `~`, so a reintroduced PowerShell `Copy-Item ...
$HOME/.claude/skills/ecc` (or backslash-separated) form would have slipped
through. Extend the pattern to also cover `Copy-Item`/`New-Item` (and the
`md`/`copy`/`cpi` aliases), accept `$HOME` as an alternative to `~`, allow both
`/` and `\` separators, and match case-insensitively.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Kumario
2026-06-07 00:26:06 -05:00
committed by GitHub
parent be536c1a3e
commit 680cc7153b
4 changed files with 39 additions and 12 deletions

View File

@@ -61,6 +61,12 @@ const publicCommandNamespaceDocs = [
'docs/zh-TW/README.md',
];
const manualClaudeSkillInstallDocs = [
'README.md',
'docs/de-DE/README.md',
'docs/ru/README.md',
];
for (const relativePath of pluginAndManualInstallDocs) {
const content = fs.readFileSync(path.join(repoRoot, relativePath), 'utf8');
@@ -96,6 +102,21 @@ for (const relativePath of publicCommandNamespaceDocs) {
});
}
for (const relativePath of manualClaudeSkillInstallDocs) {
const content = fs.readFileSync(path.join(repoRoot, relativePath), 'utf8');
test(`${relativePath} keeps manual Claude skill installs top-level`, () => {
assert.ok(
!/^\s*#?\s*(mkdir\s+-p|md\s+.*|cp\s+.*|copy\s+.*|cpi\s+.*|New-Item\s+.*|Copy-Item\s+.*)\s+.*(~|\$HOME)[\\/]\.claude[\\/]skills[\\/]ecc([\\/]|\b)/mi.test(content),
'Claude Code does not discover skills installed by commands targeting ~/.claude/skills/ecc'
);
assert.ok(
content.includes('~/.claude/skills/'),
'Expected manual install docs to copy skills into direct ~/.claude/skills children'
);
});
}
if (failed > 0) {
console.log(`\nFailed: ${failed}`);
process.exit(1);