@ethlete/agent-rules 0.1.0-next.0 → 0.1.0-next.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/CHANGELOG.md +20 -0
- package/README.md +97 -15
- package/content/hooks/context-warning.py +215 -0
- package/content/skills/sdk-docs/SKILL.md +1 -0
- package/content/skills/sdk-local-build/SKILL.md +113 -0
- package/content/skills/sdk-source/SKILL.md +108 -0
- package/content/skills/styleguide/STYLEGUIDE.md +1 -1
- package/package.json +1 -1
- package/src/index.js +12 -4
- package/src/index.js.map +1 -1
- package/src/lib/config.d.ts +39 -2
- package/src/lib/config.js +30 -8
- package/src/lib/config.js.map +1 -1
- package/src/lib/index.d.ts +1 -0
- package/src/lib/index.js +1 -0
- package/src/lib/index.js.map +1 -1
- package/src/lib/migrate.d.ts +6 -0
- package/src/lib/migrate.js +155 -0
- package/src/lib/migrate.js.map +1 -0
- package/src/lib/owned-paths.js +4 -1
- package/src/lib/owned-paths.js.map +1 -1
- package/src/lib/plan.d.ts +4 -0
- package/src/lib/plan.js +85 -6
- package/src/lib/plan.js.map +1 -1
- package/src/lib/sync.js +8 -2
- package/src/lib/sync.js.map +1 -1
- package/src/lib/targets/agents-skills.d.ts +8 -0
- package/src/lib/targets/agents-skills.js +18 -0
- package/src/lib/targets/agents-skills.js.map +1 -0
- package/src/lib/targets/claude-hooks.d.ts +33 -0
- package/src/lib/targets/claude-hooks.js +97 -0
- package/src/lib/targets/claude-hooks.js.map +1 -0
- package/src/lib/targets/claude.d.ts +3 -1
- package/src/lib/targets/claude.js +13 -20
- package/src/lib/targets/claude.js.map +1 -1
- package/src/lib/targets/codex.d.ts +5 -3
- package/src/lib/targets/codex.js +8 -7
- package/src/lib/targets/codex.js.map +1 -1
- package/src/lib/targets/copilot.d.ts +3 -3
- package/src/lib/targets/copilot.js +5 -28
- package/src/lib/targets/copilot.js.map +1 -1
- package/src/lib/targets/cursor.d.ts +3 -3
- package/src/lib/targets/cursor.js +6 -11
- package/src/lib/targets/cursor.js.map +1 -1
- package/src/lib/targets/shared.d.ts +22 -12
- package/src/lib/targets/shared.js +32 -15
- package/src/lib/targets/shared.js.map +1 -1
- package/src/lib/targets/neutral.d.ts +0 -8
- package/src/lib/targets/neutral.js +0 -29
- package/src/lib/targets/neutral.js.map +0 -1
package/src/lib/sync.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../../libs/agent-rules/src/lib/sync.ts"],"names":[],"mappings":";;;AAAA,2BAAwG;AACxG,+BAA+C;AAC/C,qCAAmD;AACnD,+CAAkD;AAClD,iCAAmC;AAcnC,MAAM,aAAa,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,CAAC,IAAA,eAAU,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAY,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAE3G,MAAM,QAAQ,GAAG,CAAC,OAAuF,EAAE,EAAE;IAC3G,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,aAAa,CAAC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,IAAI,OAAO,KAAK,IAAI,CAAC,QAAQ;YAAE,SAAS;QAExC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,OA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AO,EAAE,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAA,+BAAiB,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhG,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QAExC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;IACxE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAExE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AApBW,QAAA,KAAK,SAoBhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EmitContext, EmittedFile } from './shared';
|
|
2
|
+
/**
|
|
3
|
+
* Skills in the agentskills.io standard layout under `.agents/skills/`, discovered natively by
|
|
4
|
+
* Codex, Cursor, Copilot and VS Code — each tool loads a skill's body on demand from its
|
|
5
|
+
* `description` frontmatter. Claude Code only scans `.claude/skills/`, so the claude target emits
|
|
6
|
+
* its own copies there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const emitAgentsSkills: (context: EmitContext) => EmittedFile[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitAgentsSkills = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
/**
|
|
6
|
+
* Skills in the agentskills.io standard layout under `.agents/skills/`, discovered natively by
|
|
7
|
+
* Codex, Cursor, Copilot and VS Code — each tool loads a skill's body on demand from its
|
|
8
|
+
* `description` frontmatter. Claude Code only scans `.claude/skills/`, so the claude target emits
|
|
9
|
+
* its own copies there.
|
|
10
|
+
*/
|
|
11
|
+
const emitAgentsSkills = (context) => context.skills.flatMap((item) => (0, shared_1.skillBundle)({
|
|
12
|
+
item,
|
|
13
|
+
context,
|
|
14
|
+
dir: (0, shared_1.agentsSkillDir)(item.frontmatter.name),
|
|
15
|
+
links: (0, shared_1.agentsSkillsLinks)(context),
|
|
16
|
+
}));
|
|
17
|
+
exports.emitAgentsSkills = emitAgentsSkills;
|
|
18
|
+
//# sourceMappingURL=agents-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-skills.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/agents-skills.ts"],"names":[],"mappings":";;;AAAA,qCAAoG;AAEpG;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,OAAoB,EAAiB,EAAE,CACtE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAC9B,IAAA,oBAAW,EAAC;IACV,IAAI;IACJ,OAAO;IACP,GAAG,EAAE,IAAA,uBAAc,EAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IAC1C,KAAK,EAAE,IAAA,0BAAiB,EAAC,OAAO,CAAC;CAClC,CAAC,CACH,CAAC;AARS,QAAA,gBAAgB,oBAQzB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EmitContext, EmittedFile } from './shared';
|
|
2
|
+
export declare const CLAUDE_SETTINGS_FILE = ".claude/settings.json";
|
|
3
|
+
type HookDefinition = {
|
|
4
|
+
event: string;
|
|
5
|
+
file: string;
|
|
6
|
+
timeout: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Hooks a repo can opt into via the config's `hooks` array. Hooks run arbitrary commands on the
|
|
10
|
+
* developer's machine, so unlike rules and skills they are never emitted by default.
|
|
11
|
+
*/
|
|
12
|
+
export declare const CLAUDE_HOOKS: Record<string, HookDefinition>;
|
|
13
|
+
export declare const assertKnownHooks: (hooks: string[]) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Rewrites the generated entries in `.claude/settings.json` declaratively: every entry pointing
|
|
16
|
+
* into `.claude/hooks/ethlete/` is dropped and the currently enabled hooks are re-added, so
|
|
17
|
+
* disabling a hook in the config also unregisters it. Everything else in the file is untouched.
|
|
18
|
+
*/
|
|
19
|
+
export declare const mergeClaudeSettings: (options: {
|
|
20
|
+
existing: string;
|
|
21
|
+
hooks: string[];
|
|
22
|
+
}) => string;
|
|
23
|
+
/**
|
|
24
|
+
* The hook scripts plus the settings registration. Runs even when the claude target is off so a
|
|
25
|
+
* repo that drops the target also gets its stale registrations removed — the settings file is
|
|
26
|
+
* only planned when its parsed content actually changes, and an unparseable file is left alone.
|
|
27
|
+
*/
|
|
28
|
+
export declare const emitClaudeHooks: (options: {
|
|
29
|
+
context: EmitContext;
|
|
30
|
+
claudeTarget: boolean;
|
|
31
|
+
existingSettings: string;
|
|
32
|
+
}) => EmittedFile[];
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitClaudeHooks = exports.mergeClaudeSettings = exports.assertKnownHooks = exports.CLAUDE_HOOKS = exports.CLAUDE_SETTINGS_FILE = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const load_content_1 = require("../load-content");
|
|
7
|
+
exports.CLAUDE_SETTINGS_FILE = '.claude/settings.json';
|
|
8
|
+
const HOOKS_DIR = '.claude/hooks/ethlete';
|
|
9
|
+
/**
|
|
10
|
+
* Hooks a repo can opt into via the config's `hooks` array. Hooks run arbitrary commands on the
|
|
11
|
+
* developer's machine, so unlike rules and skills they are never emitted by default.
|
|
12
|
+
*/
|
|
13
|
+
exports.CLAUDE_HOOKS = {
|
|
14
|
+
'context-warning': { event: 'UserPromptSubmit', file: 'context-warning.py', timeout: 10 },
|
|
15
|
+
};
|
|
16
|
+
const assertKnownHooks = (hooks) => {
|
|
17
|
+
const unknown = hooks.filter((name) => !(name in exports.CLAUDE_HOOKS));
|
|
18
|
+
if (unknown.length > 0) {
|
|
19
|
+
throw new Error(`Unknown hook(s): ${unknown.join(', ')}. Known hooks: ${Object.keys(exports.CLAUDE_HOOKS).join(', ')}.`);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.assertKnownHooks = assertKnownHooks;
|
|
23
|
+
const commandFor = (file) => `python3 "$CLAUDE_PROJECT_DIR/${HOOKS_DIR}/${file}"`;
|
|
24
|
+
/** `#` comment instead of the HTML banner, placed after the shebang so the file stays runnable. */
|
|
25
|
+
const withBanner = (raw, version) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const banner = `# Generated by @ethlete/agent-rules v${version} — DO NOT EDIT. Run \`npx ethlete-agents sync\`.`;
|
|
28
|
+
const lines = raw.split('\n');
|
|
29
|
+
if ((_a = lines[0]) === null || _a === void 0 ? void 0 : _a.startsWith('#!'))
|
|
30
|
+
return [lines[0], banner, ...lines.slice(1)].join('\n');
|
|
31
|
+
return `${banner}\n${raw}`;
|
|
32
|
+
};
|
|
33
|
+
const isGenerated = (hook) => { var _a; return ((_a = hook.command) !== null && _a !== void 0 ? _a : '').includes(HOOKS_DIR); };
|
|
34
|
+
/**
|
|
35
|
+
* Rewrites the generated entries in `.claude/settings.json` declaratively: every entry pointing
|
|
36
|
+
* into `.claude/hooks/ethlete/` is dropped and the currently enabled hooks are re-added, so
|
|
37
|
+
* disabling a hook in the config also unregisters it. Everything else in the file is untouched.
|
|
38
|
+
*/
|
|
39
|
+
const mergeClaudeSettings = (options) => {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const { existing, hooks } = options;
|
|
42
|
+
const settings = JSON.parse(existing.trim() || '{}');
|
|
43
|
+
const events = Object.assign({}, ((_a = settings.hooks) !== null && _a !== void 0 ? _a : {}));
|
|
44
|
+
for (const [event, groups] of Object.entries(events)) {
|
|
45
|
+
const kept = groups
|
|
46
|
+
.map((group) => { var _a; return (Object.assign(Object.assign({}, group), { hooks: ((_a = group.hooks) !== null && _a !== void 0 ? _a : []).filter((hook) => !isGenerated(hook)) })); })
|
|
47
|
+
.filter((group) => group.hooks.length > 0);
|
|
48
|
+
if (kept.length > 0)
|
|
49
|
+
events[event] = kept;
|
|
50
|
+
else
|
|
51
|
+
delete events[event];
|
|
52
|
+
}
|
|
53
|
+
for (const name of hooks) {
|
|
54
|
+
const definition = exports.CLAUDE_HOOKS[name];
|
|
55
|
+
if (!definition)
|
|
56
|
+
continue;
|
|
57
|
+
events[definition.event] = [
|
|
58
|
+
...((_b = events[definition.event]) !== null && _b !== void 0 ? _b : []),
|
|
59
|
+
{ hooks: [{ type: 'command', command: commandFor(definition.file), timeout: definition.timeout }] },
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
if (Object.keys(events).length > 0)
|
|
63
|
+
settings.hooks = events;
|
|
64
|
+
else
|
|
65
|
+
delete settings.hooks;
|
|
66
|
+
return `${JSON.stringify(settings, null, 2)}\n`;
|
|
67
|
+
};
|
|
68
|
+
exports.mergeClaudeSettings = mergeClaudeSettings;
|
|
69
|
+
/**
|
|
70
|
+
* The hook scripts plus the settings registration. Runs even when the claude target is off so a
|
|
71
|
+
* repo that drops the target also gets its stale registrations removed — the settings file is
|
|
72
|
+
* only planned when its parsed content actually changes, and an unparseable file is left alone.
|
|
73
|
+
*/
|
|
74
|
+
const emitClaudeHooks = (options) => {
|
|
75
|
+
const { context, claudeTarget, existingSettings } = options;
|
|
76
|
+
const hooks = claudeTarget ? context.hooks : [];
|
|
77
|
+
const files = [];
|
|
78
|
+
for (const name of hooks) {
|
|
79
|
+
const definition = exports.CLAUDE_HOOKS[name];
|
|
80
|
+
if (!definition)
|
|
81
|
+
continue;
|
|
82
|
+
const raw = (0, fs_1.readFileSync)((0, path_1.join)((0, load_content_1.resolveContentRoot)(), 'hooks', definition.file), 'utf8');
|
|
83
|
+
files.push({ path: `${HOOKS_DIR}/${definition.file}`, contents: withBanner(raw, context.version) });
|
|
84
|
+
}
|
|
85
|
+
try {
|
|
86
|
+
const merged = (0, exports.mergeClaudeSettings)({ existing: existingSettings, hooks });
|
|
87
|
+
if (JSON.stringify(JSON.parse(existingSettings.trim() || '{}')) !== JSON.stringify(JSON.parse(merged))) {
|
|
88
|
+
files.push({ path: exports.CLAUDE_SETTINGS_FILE, contents: merged });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (_a) {
|
|
92
|
+
// Unparseable settings.json — never clobber a file the repo owns.
|
|
93
|
+
}
|
|
94
|
+
return files;
|
|
95
|
+
};
|
|
96
|
+
exports.emitClaudeHooks = emitClaudeHooks;
|
|
97
|
+
//# sourceMappingURL=claude-hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-hooks.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/claude-hooks.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAClC,+BAA4B;AAC5B,kDAAqD;AAGxC,QAAA,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAI1C;;;GAGG;AACU,QAAA,YAAY,GAAmC;IAC1D,iBAAiB,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,EAAE,EAAE;CAC1F,CAAC;AAEK,MAAM,gBAAgB,GAAG,CAAC,KAAe,EAAE,EAAE;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IA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AE,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACvG,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,4BAAoB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAAC,WAAM,CAAC;QACP,kEAAkE;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}
|
|
@@ -2,6 +2,8 @@ import { EmitContext, EmittedFile } from './shared';
|
|
|
2
2
|
/**
|
|
3
3
|
* Rules land in `.claude/rules/ethlete/` (loaded every session, or only for matching files when
|
|
4
4
|
* the content declares `paths`); skills land in `.claude/skills/` under an `ethlete-` prefix so a
|
|
5
|
-
* generated skill can never collide with one the repo wrote itself.
|
|
5
|
+
* generated skill can never collide with one the repo wrote itself. When the repo's `CLAUDE.md`
|
|
6
|
+
* imports `AGENTS.md`, the rules already reach Claude through the `AGENTS.md` marker block, so the
|
|
7
|
+
* rules directory is skipped entirely rather than loading everything twice.
|
|
6
8
|
*/
|
|
7
9
|
export declare const emitClaude: (context: EmitContext) => EmittedFile[];
|
|
@@ -8,7 +8,9 @@ const quoteList = (values) => values.map((value) => ` - '${value}'`).join('\n')
|
|
|
8
8
|
/**
|
|
9
9
|
* Rules land in `.claude/rules/ethlete/` (loaded every session, or only for matching files when
|
|
10
10
|
* the content declares `paths`); skills land in `.claude/skills/` under an `ethlete-` prefix so a
|
|
11
|
-
* generated skill can never collide with one the repo wrote itself.
|
|
11
|
+
* generated skill can never collide with one the repo wrote itself. When the repo's `CLAUDE.md`
|
|
12
|
+
* imports `AGENTS.md`, the rules already reach Claude through the `AGENTS.md` marker block, so the
|
|
13
|
+
* rules directory is skipped entirely rather than loading everything twice.
|
|
12
14
|
*/
|
|
13
15
|
const emitClaude = (context) => {
|
|
14
16
|
const banner = (0, render_1.buildBanner)(context.version);
|
|
@@ -18,27 +20,18 @@ const emitClaude = (context) => {
|
|
|
18
20
|
resource: (target) => `\`${target.fileName}\` (bundled next to this skill)`,
|
|
19
21
|
});
|
|
20
22
|
const files = [];
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
if (!context.claudeMdImportsAgentsMd) {
|
|
24
|
+
for (const item of context.rules) {
|
|
25
|
+
const { name, paths } = item.frontmatter;
|
|
26
|
+
const frontmatter = paths.length > 0 ? `---\npaths:\n${quoteList(paths)}\n---` : '';
|
|
27
|
+
files.push({
|
|
28
|
+
path: `.claude/rules/ethlete/${name}.md`,
|
|
29
|
+
contents: (0, shared_1.document)([frontmatter, banner, (0, shared_1.body)({ item, context, links })]),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
for (const item of context.skills) {
|
|
30
|
-
|
|
31
|
-
const frontmatter = [
|
|
32
|
-
'---',
|
|
33
|
-
`name: ethlete-${name}`,
|
|
34
|
-
`description: ${(0, shared_1.yamlString)((0, shared_1.description)({ item, context }))}`,
|
|
35
|
-
'---',
|
|
36
|
-
].join('\n');
|
|
37
|
-
files.push({
|
|
38
|
-
path: `${skillDir(name)}/SKILL.md`,
|
|
39
|
-
contents: (0, shared_1.document)([frontmatter, banner, (0, shared_1.body)({ item, context, links })]),
|
|
40
|
-
});
|
|
41
|
-
files.push(...(0, shared_1.resourceFiles)({ item, context, pathFor: (fileName) => `${skillDir(name)}/${fileName}` }));
|
|
34
|
+
files.push(...(0, shared_1.skillBundle)({ item, context, dir: skillDir(item.frontmatter.name), links }));
|
|
42
35
|
}
|
|
43
36
|
return files;
|
|
44
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/claude.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;A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,WAAW,EAAE,MAAM,EAAE,IAAA,aAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;aAC1E,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAClC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAA,oBAAW,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA1BW,QAAA,UAAU,cA0BrB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { EmitContext, EmittedFile } from './shared';
|
|
2
2
|
export declare const CODEX_FILE = "AGENTS.md";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The always-loaded rules are inlined into the `AGENTS.md` marker block — layered `AGENTS.md`
|
|
5
|
+
* files are Codex's rules mechanism. Skills are emitted as real skills under `.agents/skills/`
|
|
6
|
+
* (see `emitAgentsSkills`) and self-describe through their frontmatter, so the block carries only
|
|
7
|
+
* a two-line hint instead of repeating every description into each session's context. Everything
|
|
8
|
+
* outside the marker block is left as the repo wrote it.
|
|
7
9
|
*/
|
|
8
10
|
export declare const emitCodex: (options: {
|
|
9
11
|
context: EmitContext;
|
package/src/lib/targets/codex.js
CHANGED
|
@@ -5,18 +5,19 @@ const render_1 = require("../render");
|
|
|
5
5
|
const shared_1 = require("./shared");
|
|
6
6
|
exports.CODEX_FILE = 'AGENTS.md';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* The always-loaded rules are inlined into the `AGENTS.md` marker block — layered `AGENTS.md`
|
|
9
|
+
* files are Codex's rules mechanism. Skills are emitted as real skills under `.agents/skills/`
|
|
10
|
+
* (see `emitAgentsSkills`) and self-describe through their frontmatter, so the block carries only
|
|
11
|
+
* a two-line hint instead of repeating every description into each session's context. Everything
|
|
12
|
+
* outside the marker block is left as the repo wrote it.
|
|
11
13
|
*/
|
|
12
14
|
const emitCodex = (options) => {
|
|
13
15
|
const { context, existing } = options;
|
|
14
|
-
const sections = context.rules.map((item) => (0, shared_1.body)({ item, context, links: (0, shared_1.
|
|
16
|
+
const sections = context.rules.map((item) => (0, shared_1.body)({ item, context, links: (0, shared_1.agentsSkillsLinks)(context) }));
|
|
15
17
|
if (context.skills.length > 0) {
|
|
16
18
|
sections.push([
|
|
17
|
-
'## Ethlete
|
|
18
|
-
'
|
|
19
|
-
(0, shared_1.pointerTable)({ skills: context.skills, context, pathFor: shared_1.neutralBodyPath }),
|
|
19
|
+
'## Ethlete skills',
|
|
20
|
+
"On-demand guides live in `.agents/skills/ethlete-*/SKILL.md`; each one's frontmatter says when to read it. If your agent does not discover skills on its own, list that directory and read the matching guide before starting that kind of work — do not work from memory.",
|
|
20
21
|
].join('\n\n'));
|
|
21
22
|
}
|
|
22
23
|
const block = (0, shared_1.document)([(0, render_1.buildBanner)(context.version), ...sections]).trimEnd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/codex.ts"],"names":[],"mappings":";;;AAAA,sCAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/codex.ts"],"names":[],"mappings":";;;AAAA,sCAA4D;AAC5D,qCAAuF;AAE1E,QAAA,UAAU,GAAG,WAAW,CAAC;AAEtC;;;;;;GAMG;AACI,MAAM,SAAS,GAAG,CAAC,OAAmD,EAAiB,EAAE;IAC9F,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,aAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAA,0BAAiB,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IAEzG,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CACX;YACE,mBAAmB;YACnB,4QAA4Q;SAC7Q,CAAC,IAAI,CAAC,MAAM,CAAC,CACf,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,IAAA,iBAAQ,EAAC,CAAC,IAAA,oBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAE9E,OAAO,CAAC,EAAE,IAAI,EAAE,kBAAU,EAAE,QAAQ,EAAE,IAAA,2BAAkB,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC;AAhBW,QAAA,SAAS,aAgBpB"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EmitContext, EmittedFile } from './shared';
|
|
2
2
|
export declare const COPILOT_FILE = ".github/copilot-instructions.md";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Always-loaded rules go into the `copilot-instructions.md` marker block. Skills are not mirrored
|
|
5
|
+
* here — Copilot discovers `.agents/skills/` natively, so the old pointer table and the
|
|
6
|
+
* `applyTo`-scoped `.instructions.md` fallback are gone.
|
|
7
7
|
*/
|
|
8
8
|
export declare const emitCopilot: (options: {
|
|
9
9
|
context: EmitContext;
|
|
@@ -5,39 +5,16 @@ const render_1 = require("../render");
|
|
|
5
5
|
const shared_1 = require("./shared");
|
|
6
6
|
exports.COPILOT_FILE = '.github/copilot-instructions.md';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Always-loaded rules go into the `copilot-instructions.md` marker block. Skills are not mirrored
|
|
9
|
+
* here — Copilot discovers `.agents/skills/` natively, so the old pointer table and the
|
|
10
|
+
* `applyTo`-scoped `.instructions.md` fallback are gone.
|
|
11
11
|
*/
|
|
12
12
|
const emitCopilot = (options) => {
|
|
13
13
|
const { context, existing } = options;
|
|
14
14
|
const banner = (0, render_1.buildBanner)(context.version);
|
|
15
|
-
const
|
|
16
|
-
context,
|
|
17
|
-
skill: (name) => `\`${(0, shared_1.neutralBodyPath)(name)}\``,
|
|
18
|
-
resource: (target) => `\`${(0, shared_1.neutralResourcePath)(target)}\``,
|
|
19
|
-
});
|
|
20
|
-
const files = [];
|
|
21
|
-
const scoped = context.skills.filter((item) => item.frontmatter.paths.length > 0);
|
|
22
|
-
const unscoped = context.skills.filter((item) => item.frontmatter.paths.length === 0);
|
|
23
|
-
for (const item of scoped) {
|
|
24
|
-
const frontmatter = ['---', `applyTo: ${(0, shared_1.yamlString)(item.frontmatter.paths.join(','))}`, '---'].join('\n');
|
|
25
|
-
files.push({
|
|
26
|
-
path: `.github/instructions/ethlete-${item.frontmatter.name}.instructions.md`,
|
|
27
|
-
contents: (0, shared_1.document)([frontmatter, banner, (0, shared_1.body)({ item, context, links })]),
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const sections = context.rules.map((item) => (0, shared_1.body)({ item, context, links }));
|
|
31
|
-
if (unscoped.length > 0) {
|
|
32
|
-
sections.push([
|
|
33
|
-
'## Ethlete reference docs',
|
|
34
|
-
'Read the matching file before starting that kind of work — do not work from memory.',
|
|
35
|
-
(0, shared_1.pointerTable)({ skills: unscoped, context, pathFor: shared_1.neutralBodyPath }),
|
|
36
|
-
].join('\n\n'));
|
|
37
|
-
}
|
|
15
|
+
const sections = context.rules.map((item) => (0, shared_1.body)({ item, context, links: (0, shared_1.agentsSkillsLinks)(context) }));
|
|
38
16
|
const block = (0, shared_1.document)([banner, ...sections]).trimEnd();
|
|
39
|
-
|
|
40
|
-
return files;
|
|
17
|
+
return [{ path: exports.COPILOT_FILE, contents: (0, render_1.replaceMarkedBlock)({ existing, block }) }];
|
|
41
18
|
};
|
|
42
19
|
exports.emitCopilot = emitCopilot;
|
|
43
20
|
//# sourceMappingURL=copilot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/copilot.ts"],"names":[],"mappings":";;;AAAA,sCAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/copilot.ts"],"names":[],"mappings":";;;AAAA,sCAA4D;AAC5D,qCAAuF;AAE1E,QAAA,YAAY,GAAG,iCAAiC,CAAC;AAE9D;;;;GAIG;AACI,MAAM,WAAW,GAAG,CAAC,OAAmD,EAAiB,EAAE;IAChG,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACtC,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,aAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAA,0BAAiB,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;IACzG,MAAM,KAAK,GAAG,IAAA,iBAAQ,EAAC,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAExD,OAAO,CAAC,EAAE,IAAI,EAAE,oBAAY,EAAE,QAAQ,EAAE,IAAA,2BAAkB,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AACrF,CAAC,CAAC;AAPW,QAAA,WAAW,eAOtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EmitContext, EmittedFile } from './shared';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Always-loaded rules become `alwaysApply` `.mdc` files (path-scoped ones via `globs`). Skills are
|
|
4
|
+
* not mirrored here — Cursor discovers them from `.agents/skills/` like every other
|
|
5
|
+
* agentskills.io-aware tool.
|
|
6
6
|
*/
|
|
7
7
|
export declare const emitCursor: (context: EmitContext) => EmittedFile[];
|
|
@@ -4,24 +4,20 @@ exports.emitCursor = void 0;
|
|
|
4
4
|
const render_1 = require("../render");
|
|
5
5
|
const shared_1 = require("./shared");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Always-loaded rules become `alwaysApply` `.mdc` files (path-scoped ones via `globs`). Skills are
|
|
8
|
+
* not mirrored here — Cursor discovers them from `.agents/skills/` like every other
|
|
9
|
+
* agentskills.io-aware tool.
|
|
10
10
|
*/
|
|
11
11
|
const emitCursor = (context) => {
|
|
12
12
|
const banner = (0, render_1.buildBanner)(context.version);
|
|
13
|
-
const links = (0, shared_1.
|
|
14
|
-
|
|
15
|
-
skill: (name) => `the **\`ethlete-${name}\`** rule`,
|
|
16
|
-
resource: (target) => `\`${(0, shared_1.neutralResourcePath)(target)}\``,
|
|
17
|
-
});
|
|
18
|
-
const emit = (options) => options.items.map((item) => {
|
|
13
|
+
const links = (0, shared_1.agentsSkillsLinks)(context);
|
|
14
|
+
return context.rules.map((item) => {
|
|
19
15
|
const { name, paths } = item.frontmatter;
|
|
20
16
|
const frontmatter = [
|
|
21
17
|
'---',
|
|
22
18
|
`description: ${(0, shared_1.yamlString)((0, shared_1.description)({ item, context }))}`,
|
|
23
19
|
paths.length > 0 ? `globs: ${paths.join(',')}` : 'globs:',
|
|
24
|
-
|
|
20
|
+
'alwaysApply: true',
|
|
25
21
|
'---',
|
|
26
22
|
].join('\n');
|
|
27
23
|
return {
|
|
@@ -29,7 +25,6 @@ const emitCursor = (context) => {
|
|
|
29
25
|
contents: (0, shared_1.document)([frontmatter, banner, (0, shared_1.body)({ item, context, links })]),
|
|
30
26
|
};
|
|
31
27
|
});
|
|
32
|
-
return [...emit({ items: context.rules, alwaysApply: true }), ...emit({ items: context.skills, alwaysApply: false })];
|
|
33
28
|
};
|
|
34
29
|
exports.emitCursor = emitCursor;
|
|
35
30
|
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/cursor.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/cursor.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AACxC,qCAAgH;AAEhH;;;;GAIG;AACI,MAAM,UAAU,GAAG,CAAC,OAAoB,EAAiB,EAAE;IAChE,MAAM,MAAM,GAAG,IAAA,oBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,CAAC;IAEzC,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAChC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC;QACzC,MAAM,WAAW,GAAG;YAClB,KAAK;YACL,gBAAgB,IAAA,mBAAU,EAAC,IAAA,oBAAW,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE;YAC5D,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ;YACzD,mBAAmB;YACnB,KAAK;SACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,OAAO;YACL,IAAI,EAAE,yBAAyB,IAAI,MAAM;YACzC,QAAQ,EAAE,IAAA,iBAAQ,EAAC,CAAC,WAAW,EAAE,MAAM,EAAE,IAAA,aAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,UAAU,cAmBrB"}
|
|
@@ -12,13 +12,17 @@ export type EmitContext = {
|
|
|
12
12
|
emittedSkills: Set<string>;
|
|
13
13
|
vars: Record<string, string | string[]>;
|
|
14
14
|
version: string;
|
|
15
|
+
/**
|
|
16
|
+
* The repo's `CLAUDE.md` is an `@AGENTS.md` import (or symlink), so Claude already receives the
|
|
17
|
+
* rules through the `AGENTS.md` marker block and must not get a second copy in `.claude/rules/`.
|
|
18
|
+
*/
|
|
19
|
+
claudeMdImportsAgentsMd: boolean;
|
|
20
|
+
/** Opt-in Claude Code hooks from the config. */
|
|
21
|
+
hooks: string[];
|
|
15
22
|
};
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
skillName: string;
|
|
20
|
-
fileName: string;
|
|
21
|
-
}) => string;
|
|
23
|
+
export declare const AGENTS_SKILLS_DIR = ".agents/skills";
|
|
24
|
+
export declare const agentsSkillDir: (name: string) => string;
|
|
25
|
+
export declare const agentsSkillPath: (name: string) => string;
|
|
22
26
|
/**
|
|
23
27
|
* A guide can be filtered out of a given repo while another still references it. Degrade such a
|
|
24
28
|
* link to the bare name rather than emitting a path to a file that was never written.
|
|
@@ -31,7 +35,7 @@ export declare const makeLinks: (options: {
|
|
|
31
35
|
fileName: string;
|
|
32
36
|
}) => string;
|
|
33
37
|
}) => LinkResolver;
|
|
34
|
-
export declare const
|
|
38
|
+
export declare const agentsSkillsLinks: (context: EmitContext) => LinkResolver;
|
|
35
39
|
export declare const body: (options: {
|
|
36
40
|
item: ContentItem;
|
|
37
41
|
context: EmitContext;
|
|
@@ -49,12 +53,18 @@ export declare const resourceFiles: (options: {
|
|
|
49
53
|
path: string;
|
|
50
54
|
contents: string;
|
|
51
55
|
}[];
|
|
56
|
+
/**
|
|
57
|
+
* One skill in the agentskills.io layout: a `SKILL.md` with `name`/`description` frontmatter plus
|
|
58
|
+
* its resource files as siblings. The same bundle serves `.claude/skills/` and `.agents/skills/`;
|
|
59
|
+
* only the directory and the link resolver differ per target.
|
|
60
|
+
*/
|
|
61
|
+
export declare const skillBundle: (options: {
|
|
62
|
+
item: ContentItem;
|
|
63
|
+
context: EmitContext;
|
|
64
|
+
dir: string;
|
|
65
|
+
links: LinkResolver;
|
|
66
|
+
}) => EmittedFile[];
|
|
52
67
|
/** Descriptions routinely contain `:` and `-`, so always quote them rather than guess. */
|
|
53
68
|
export declare const yamlString: (value: string) => string;
|
|
54
69
|
/** Every generated document ends with exactly one trailing newline so Prettier stays quiet. */
|
|
55
70
|
export declare const document: (parts: string[]) => string;
|
|
56
|
-
export declare const pointerTable: (options: {
|
|
57
|
-
skills: ContentItem[];
|
|
58
|
-
context: EmitContext;
|
|
59
|
-
pathFor: (name: string) => string;
|
|
60
|
-
}) => string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.document = exports.yamlString = exports.skillBundle = exports.resourceFiles = exports.description = exports.body = exports.agentsSkillsLinks = exports.makeLinks = exports.agentsSkillPath = exports.agentsSkillDir = exports.AGENTS_SKILLS_DIR = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const render_1 = require("../render");
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
exports.
|
|
9
|
-
const
|
|
10
|
-
exports.
|
|
6
|
+
exports.AGENTS_SKILLS_DIR = '.agents/skills';
|
|
7
|
+
const agentsSkillDir = (name) => `${exports.AGENTS_SKILLS_DIR}/ethlete-${name}`;
|
|
8
|
+
exports.agentsSkillDir = agentsSkillDir;
|
|
9
|
+
const agentsSkillPath = (name) => `${(0, exports.agentsSkillDir)(name)}/SKILL.md`;
|
|
10
|
+
exports.agentsSkillPath = agentsSkillPath;
|
|
11
11
|
/**
|
|
12
12
|
* A guide can be filtered out of a given repo while another still references it. Degrade such a
|
|
13
13
|
* link to the bare name rather than emitting a path to a file that was never written.
|
|
@@ -17,12 +17,12 @@ const makeLinks = (options) => ({
|
|
|
17
17
|
resource: options.resource,
|
|
18
18
|
});
|
|
19
19
|
exports.makeLinks = makeLinks;
|
|
20
|
-
const
|
|
20
|
+
const agentsSkillsLinks = (context) => (0, exports.makeLinks)({
|
|
21
21
|
context,
|
|
22
|
-
skill: (name) => `\`${(0, exports.
|
|
23
|
-
resource: (target) => `\`${(0, exports.
|
|
22
|
+
skill: (name) => `\`${(0, exports.agentsSkillPath)(name)}\``,
|
|
23
|
+
resource: (target) => `\`${(0, exports.agentsSkillDir)(target.skillName)}/${target.fileName}\``,
|
|
24
24
|
});
|
|
25
|
-
exports.
|
|
25
|
+
exports.agentsSkillsLinks = agentsSkillsLinks;
|
|
26
26
|
const body = (options) => (0, render_1.renderBody)({ item: options.item, vars: options.context.vars, links: options.links });
|
|
27
27
|
exports.body = body;
|
|
28
28
|
const description = (options) => (0, render_1.renderDescription)({ item: options.item, vars: options.context.vars });
|
|
@@ -36,15 +36,32 @@ const resourceFiles = (options) => options.item.resources.map((resource) => ({
|
|
|
36
36
|
}),
|
|
37
37
|
}));
|
|
38
38
|
exports.resourceFiles = resourceFiles;
|
|
39
|
+
/**
|
|
40
|
+
* One skill in the agentskills.io layout: a `SKILL.md` with `name`/`description` frontmatter plus
|
|
41
|
+
* its resource files as siblings. The same bundle serves `.claude/skills/` and `.agents/skills/`;
|
|
42
|
+
* only the directory and the link resolver differ per target.
|
|
43
|
+
*/
|
|
44
|
+
const skillBundle = (options) => {
|
|
45
|
+
const { item, context, dir, links } = options;
|
|
46
|
+
const frontmatter = [
|
|
47
|
+
'---',
|
|
48
|
+
`name: ethlete-${item.frontmatter.name}`,
|
|
49
|
+
`description: ${(0, exports.yamlString)((0, exports.description)({ item, context }))}`,
|
|
50
|
+
'---',
|
|
51
|
+
].join('\n');
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
path: `${dir}/SKILL.md`,
|
|
55
|
+
contents: (0, exports.document)([frontmatter, (0, render_1.buildBanner)(context.version), (0, exports.body)({ item, context, links })]),
|
|
56
|
+
},
|
|
57
|
+
...(0, exports.resourceFiles)({ item, context, pathFor: (fileName) => `${dir}/${fileName}` }),
|
|
58
|
+
];
|
|
59
|
+
};
|
|
60
|
+
exports.skillBundle = skillBundle;
|
|
39
61
|
/** Descriptions routinely contain `:` and `-`, so always quote them rather than guess. */
|
|
40
62
|
const yamlString = (value) => `"${value.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
|
|
41
63
|
exports.yamlString = yamlString;
|
|
42
64
|
/** Every generated document ends with exactly one trailing newline so Prettier stays quiet. */
|
|
43
65
|
const document = (parts) => `${parts.filter((part) => part.length > 0).join('\n\n')}\n`;
|
|
44
66
|
exports.document = document;
|
|
45
|
-
const pointerTable = (options) => {
|
|
46
|
-
const rows = options.skills.map((item) => `| \`${options.pathFor(item.frontmatter.name)}\` | ${(0, exports.description)({ item, context: options.context })} |`);
|
|
47
|
-
return ['| Read this file | When |', '| --- | --- |', ...rows].join('\n');
|
|
48
|
-
};
|
|
49
|
-
exports.pointerTable = pointerTable;
|
|
50
67
|
//# sourceMappingURL=shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/shared.ts"],"names":[],"mappings":";;;AAAA,2BAAkC;AAElC,
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../../libs/agent-rules/src/lib/targets/shared.ts"],"names":[],"mappings":";;;AAAA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