agent-manifesto-kit 0.0.0-development → 1.1.0
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/LICENSE +21 -21
- package/README.md +159 -95
- package/collection/NOTICE.md +36 -36
- package/collection/agents/code-reviewer.md +103 -103
- package/collection/agents/docs-manager.md +127 -127
- package/collection/bundles/kit-adopt/README.md +36 -36
- package/collection/bundles/kit-adopt/conventions/recommended-companions.md +43 -43
- package/collection/bundles/kit-adopt/pipelines/kit-adopt.md +52 -52
- package/collection/bundles/kit-adopt/skills/kit-adopt/SKILL.md +72 -72
- package/collection/bundles/qa-automation/README.md +48 -0
- package/collection/bundles/qa-automation/RECOMMENDS.md +19 -0
- package/collection/bundles/qa-automation/agents/qa-explorer.md +55 -0
- package/collection/bundles/qa-automation/agents/qa-test-reviewer.md +71 -0
- package/collection/bundles/qa-automation/conventions/qa-verification.md +50 -0
- package/collection/bundles/qa-automation/pipelines/qa-test-debug.md +66 -0
- package/collection/bundles/qa-automation/pipelines/qa-test-from-spec.md +65 -0
- package/collection/bundles/qa-automation/skills/qa-playwright-cli/SKILL.md +83 -0
- package/collection/bundles/qa-automation/skills/qa-test-debugger/SKILL.md +60 -0
- package/collection/bundles/qa-automation/skills/qa-test-writer/SKILL.md +60 -0
- package/collection/bundles/sdd/README.md +50 -50
- package/collection/bundles/sdd/RECOMMENDS.md +21 -21
- package/collection/bundles/sdd/agents/sdd-gap-analyzer.md +79 -79
- package/collection/bundles/sdd/agents/sdd-spec-reviewer.md +75 -75
- package/collection/bundles/sdd/conventions/sdd-doc-set.md +136 -136
- package/collection/bundles/sdd/pipelines/sdd-adopt.md +60 -60
- package/collection/bundles/sdd/pipelines/sdd-bootstrap.md +60 -60
- package/collection/bundles/sdd/skills/sdd-doc-author/SKILL.md +69 -69
- package/collection/bundles/sdd/skills/sdd-feature-author/SKILL.md +71 -71
- package/collection/bundles/sdd/skills/sdd-index-sync/SKILL.md +61 -61
- package/collection/bundles/sdd/templates/docs/INDEX.md +35 -35
- package/collection/bundles/sdd/templates/docs/api.md +23 -23
- package/collection/bundles/sdd/templates/docs/architecture.md +42 -42
- package/collection/bundles/sdd/templates/docs/db.md +22 -22
- package/collection/bundles/sdd/templates/docs/decisions/ADR-template.md +24 -24
- package/collection/bundles/sdd/templates/docs/design.md +43 -43
- package/collection/bundles/sdd/templates/docs/idea.md +46 -46
- package/collection/bundles/sdd/templates/docs/operations.md +28 -28
- package/collection/bundles/sdd/templates/docs/roadmap.md +26 -26
- package/collection/bundles/sdd/templates/docs/security.md +24 -24
- package/collection/bundles/sdd/templates/docs/testing.md +34 -34
- package/collection/bundles/sdd/templates/features/F000_template/requirements.md +38 -38
- package/collection/bundles/sdd/templates/features/F000_template/scenarios.md +26 -26
- package/collection/bundles/sdd/templates/features/F000_template/tasks.md +11 -11
- package/collection/skills/brainstorm/SKILL.md +46 -46
- package/collection/skills/business-analyst/SKILL.md +58 -58
- package/collection/skills/documentation-maintenance/SKILL.md +60 -60
- package/collection/skills/explain-code/SKILL.md +81 -81
- package/collection/skills/frontend-audit/SKILL.md +135 -135
- package/collection/skills/frontend-impeccable-design/SKILL.md +135 -135
- package/collection/skills/frontend-impeccable-polish/SKILL.md +118 -118
- package/collection/skills/implement-feature/SKILL.md +99 -99
- package/collection/skills/memory-management/SKILL.md +75 -75
- package/collection/skills/meta-tags-optimizer/SKILL.md +73 -73
- package/collection/skills/pencil-design/SKILL.md +83 -83
- package/collection/skills/playwright-cli/SKILL.md +104 -104
- package/collection/skills/prepare-release-notes/SKILL.md +109 -109
- package/collection/skills/refactor-code/SKILL.md +104 -104
- package/collection/skills/review-code/SKILL.md +98 -98
- package/collection/skills/schema-markup-generator/SKILL.md +80 -80
- package/collection/skills/task-complete/SKILL.md +79 -79
- package/collection/skills/task-discovery/SKILL.md +69 -69
- package/collection/skills/task-validation/SKILL.md +71 -71
- package/collection/skills/test-review/SKILL.md +72 -72
- package/collection/skills/test-writer/SKILL.md +78 -78
- package/collection/skills/work-with-git/SKILL.md +154 -154
- package/dist/cli.js +31 -22
- package/dist/commands/adopt.js +240 -40
- package/dist/providers.js +3 -6
- package/package.json +48 -49
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { list } from "./commands/list.js";
|
|
5
|
-
import { adopt } from "./commands/adopt.js";
|
|
5
|
+
import { adopt, isSupportedCli, SUPPORTED_CLIS } from "./commands/adopt.js";
|
|
6
6
|
import { runLint } from "./commands/lint.js";
|
|
7
7
|
import { isProvider } from "./providers.js";
|
|
8
8
|
import { packageRoot } from "./catalog.js";
|
|
@@ -41,23 +41,29 @@ function parseArgs(args) {
|
|
|
41
41
|
return { positionals, flags };
|
|
42
42
|
}
|
|
43
43
|
function help() {
|
|
44
|
-
console.log(`agentkit - discover and adopt Agent Manifesto Kit capabilities
|
|
45
|
-
|
|
46
|
-
Usage:
|
|
47
|
-
agentkit list
|
|
48
|
-
agentkit lint [name]
|
|
49
|
-
agentkit adopt <name> [--provider claude|codex|agnostic] [--dest <dir>]
|
|
50
|
-
|
|
51
|
-
<name> is a capability (skill/agent/pipeline/convention) or a bundle.
|
|
52
|
-
Adopting a bundle
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
--
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
console.log(`agentkit - discover and adopt Agent Manifesto Kit capabilities
|
|
45
|
+
|
|
46
|
+
Usage:
|
|
47
|
+
agentkit list
|
|
48
|
+
agentkit lint [name]
|
|
49
|
+
agentkit adopt <name> [--provider claude|codex|agnostic] [--dest <dir>] [--force] [--cli <cli>]
|
|
50
|
+
|
|
51
|
+
<name> is a capability (skill/agent/pipeline/convention) or a bundle.
|
|
52
|
+
Adopting a bundle explodes it into type-specific directories.
|
|
53
|
+
|
|
54
|
+
Pass --cli to run an AI assistant after adoption to adapt the files to your project.
|
|
55
|
+
Pass --force to overwrite existing targets without prompting.
|
|
56
|
+
|
|
57
|
+
Options:
|
|
58
|
+
--provider target AI provider (default: claude)
|
|
59
|
+
--cli AI CLI to run after adoption for project-specific adaptation
|
|
60
|
+
supported: ${SUPPORTED_CLIS.join("|")}
|
|
61
|
+
--force overwrite existing targets without prompting
|
|
62
|
+
--dest target project root (default: current directory)
|
|
63
|
+
--version,-v print the installed version
|
|
58
64
|
--help,-h show this help`);
|
|
59
65
|
}
|
|
60
|
-
function main() {
|
|
66
|
+
async function main() {
|
|
61
67
|
const { positionals, flags } = parseArgs(process.argv.slice(2));
|
|
62
68
|
const cmd = positionals[0];
|
|
63
69
|
if (flags.version || flags.v) {
|
|
@@ -91,18 +97,21 @@ function main() {
|
|
|
91
97
|
console.error(`Invalid --provider "${provider}". Use claude|codex|agnostic.`);
|
|
92
98
|
return 1;
|
|
93
99
|
}
|
|
100
|
+
const cli = typeof flags.cli === "string" ? flags.cli : undefined;
|
|
101
|
+
if (cli !== undefined && !isSupportedCli(cli)) {
|
|
102
|
+
console.error(`Unknown --cli "${cli}". Supported: ${SUPPORTED_CLIS.join("|")}`);
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
94
105
|
const projectRoot = typeof flags.dest === "string" ? flags.dest : process.cwd();
|
|
95
|
-
|
|
106
|
+
const force = flags.force === true;
|
|
107
|
+
return adopt({ name, provider, projectRoot, force, cli });
|
|
96
108
|
}
|
|
97
109
|
default:
|
|
98
110
|
console.error(`Unknown command "${cmd}". Run "agentkit --help".`);
|
|
99
111
|
return 1;
|
|
100
112
|
}
|
|
101
113
|
}
|
|
102
|
-
|
|
103
|
-
process.exit(main());
|
|
104
|
-
}
|
|
105
|
-
catch (err) {
|
|
114
|
+
main().then(process.exit).catch((err) => {
|
|
106
115
|
console.error(`agentkit: ${err instanceof Error ? err.message : String(err)}`);
|
|
107
116
|
process.exit(1);
|
|
108
|
-
}
|
|
117
|
+
});
|
package/dist/commands/adopt.js
CHANGED
|
@@ -1,8 +1,136 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { createInterface } from "node:readline/promises";
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
2
5
|
import { dirname, join, relative } from "node:path";
|
|
3
6
|
import { findBundle, findCapability } from "../catalog.js";
|
|
4
|
-
import {
|
|
7
|
+
import { bundleExtrasDestination, destinationFor, wiringHint } from "../providers.js";
|
|
5
8
|
import { lint, transform } from "../portability.js";
|
|
9
|
+
export const SUPPORTED_CLIS = [
|
|
10
|
+
"claude", "codex", "agy", "aider", "opencode", "grok", "kilo", "qwen",
|
|
11
|
+
];
|
|
12
|
+
export function isSupportedCli(value) {
|
|
13
|
+
return SUPPORTED_CLIS.includes(value);
|
|
14
|
+
}
|
|
15
|
+
const CLI_INVOCATIONS = {
|
|
16
|
+
claude: { kind: "direct", args: (p) => ["claude", "--dangerously-skip-permissions", "-p", p] },
|
|
17
|
+
codex: { kind: "stdin", bin: "codex", args: ["exec", "--skip-git-repo-check", "-"] },
|
|
18
|
+
agy: { kind: "bash", cmd: 'agy --dangerously-skip-permissions -p "$(cat "$0")"' },
|
|
19
|
+
aider: { kind: "bash", cmd: 'aider --message "$(cat "$0")" --yes-always' },
|
|
20
|
+
opencode: { kind: "bash", cmd: 'opencode run "$(cat "$0")"' },
|
|
21
|
+
grok: { kind: "bash", cmd: 'grok -p "$(cat "$0")"' },
|
|
22
|
+
kilo: { kind: "bash", cmd: 'kilocode --auto "$(cat "$0")"' },
|
|
23
|
+
qwen: { kind: "bash", cmd: 'qwen --prompt "$(cat "$0")"' },
|
|
24
|
+
};
|
|
25
|
+
function buildPrompt(files) {
|
|
26
|
+
return `You have adopted the following AI capability files into this project:
|
|
27
|
+
${files.join("\n")}
|
|
28
|
+
|
|
29
|
+
Before editing anything:
|
|
30
|
+
1. Read CLAUDE.md (or AGENTS.md if present), README.md, and any project
|
|
31
|
+
specification files under .docs/ or .ai/docs/.
|
|
32
|
+
2. Build a clear picture of the project's domain, naming conventions,
|
|
33
|
+
file structure, tools in use, and vocabulary.
|
|
34
|
+
|
|
35
|
+
Adapt each file to this project:
|
|
36
|
+
- Replace generic references with project-specific names, paths, and terms
|
|
37
|
+
- Align tool references and file paths to what this project actually uses
|
|
38
|
+
- Preserve the file's structure, scope, and intent exactly
|
|
39
|
+
- Leave files that need no changes untouched`;
|
|
40
|
+
}
|
|
41
|
+
const SPINNER = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
42
|
+
// On Windows, `bash` in PATH resolves to the WSL relay (C:\Windows\System32\bash.exe),
|
|
43
|
+
// which fails when WSL has no distro or no /bin/bash. Prefer Git Bash explicitly.
|
|
44
|
+
function findBash() {
|
|
45
|
+
if (process.platform !== "win32")
|
|
46
|
+
return "bash";
|
|
47
|
+
const candidates = [
|
|
48
|
+
`${process.env.LOCALAPPDATA}\\Programs\\Git\\bin\\bash.exe`,
|
|
49
|
+
`${process.env.PROGRAMFILES}\\Git\\bin\\bash.exe`,
|
|
50
|
+
`${process.env["PROGRAMFILES(X86)"]}\\Git\\bin\\bash.exe`,
|
|
51
|
+
"C:\\Program Files\\Git\\bin\\bash.exe",
|
|
52
|
+
];
|
|
53
|
+
for (const c of candidates) {
|
|
54
|
+
try {
|
|
55
|
+
if (existsSync(c))
|
|
56
|
+
return c;
|
|
57
|
+
}
|
|
58
|
+
catch { /* skip */ }
|
|
59
|
+
}
|
|
60
|
+
return "bash";
|
|
61
|
+
}
|
|
62
|
+
async function invokeAi(inv, prompt, cwd, cli) {
|
|
63
|
+
console.log(`\nRunning ${cli} to adapt adopted files — this may take a several minutes…`);
|
|
64
|
+
let promptFile;
|
|
65
|
+
let child;
|
|
66
|
+
if (inv.kind === "direct") {
|
|
67
|
+
const [bin, ...args] = inv.args(prompt);
|
|
68
|
+
child = spawn(bin, args, { stdio: "inherit", cwd });
|
|
69
|
+
}
|
|
70
|
+
else if (inv.kind === "stdin") {
|
|
71
|
+
child = spawn(inv.bin, inv.args, {
|
|
72
|
+
stdio: ["pipe", "inherit", "inherit"],
|
|
73
|
+
cwd,
|
|
74
|
+
shell: process.platform === "win32",
|
|
75
|
+
});
|
|
76
|
+
child.stdin.write(prompt, "utf8");
|
|
77
|
+
child.stdin.end();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
promptFile = join(tmpdir(), `akt-prompt-${Date.now()}.txt`);
|
|
81
|
+
writeFileSync(promptFile, prompt, "utf8");
|
|
82
|
+
child = spawn(findBash(), ["-c", inv.cmd, promptFile], { stdio: "inherit", cwd });
|
|
83
|
+
}
|
|
84
|
+
// Spinner on stderr — visible when the AI CLI is silent during thinking.
|
|
85
|
+
let frame = 0;
|
|
86
|
+
const start = Date.now();
|
|
87
|
+
const timer = setInterval(() => {
|
|
88
|
+
const s = Math.floor((Date.now() - start) / 1000);
|
|
89
|
+
const ts = `${Math.floor(s / 60)}:${(s % 60).toString().padStart(2, "0")}`;
|
|
90
|
+
process.stderr.write(`\r${SPINNER[frame++ % SPINNER.length]} Working… ${ts} `);
|
|
91
|
+
}, 200);
|
|
92
|
+
return new Promise((resolve) => {
|
|
93
|
+
const cleanup = () => {
|
|
94
|
+
clearInterval(timer);
|
|
95
|
+
process.stderr.write("\r\x1b[K");
|
|
96
|
+
if (promptFile) {
|
|
97
|
+
try {
|
|
98
|
+
unlinkSync(promptFile);
|
|
99
|
+
}
|
|
100
|
+
catch { /* ignore */ }
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
child.on("error", (err) => {
|
|
104
|
+
cleanup();
|
|
105
|
+
console.error(`Failed to launch ${cli}: ${err instanceof Error ? err.message : String(err)}`);
|
|
106
|
+
resolve(1);
|
|
107
|
+
});
|
|
108
|
+
child.on("close", (code) => {
|
|
109
|
+
cleanup();
|
|
110
|
+
resolve(code ?? 1);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
async function promptConflict(target) {
|
|
115
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
116
|
+
try {
|
|
117
|
+
for (;;) {
|
|
118
|
+
const ans = (await rl.question(`Target already exists: ${target}\n[r] replace [s] skip [A] replace all [S] skip all: `)).trim();
|
|
119
|
+
if (ans === "r")
|
|
120
|
+
return "replace";
|
|
121
|
+
if (ans === "s")
|
|
122
|
+
return "skip";
|
|
123
|
+
if (ans === "A")
|
|
124
|
+
return "replace-all";
|
|
125
|
+
if (ans === "S")
|
|
126
|
+
return "skip-all";
|
|
127
|
+
console.log("Please enter r, s, A, or S.");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
rl.close();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
6
134
|
function walkMd(dir) {
|
|
7
135
|
const out = [];
|
|
8
136
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
@@ -14,7 +142,6 @@ function walkMd(dir) {
|
|
|
14
142
|
}
|
|
15
143
|
return out;
|
|
16
144
|
}
|
|
17
|
-
/** Print a bundle's RECOMMENDS.md companions as opt-in suggestions; never installs them. */
|
|
18
145
|
function surfaceCompanions(recommendsPath) {
|
|
19
146
|
const rows = readFileSync(recommendsPath, "utf8")
|
|
20
147
|
.split("\n")
|
|
@@ -28,73 +155,146 @@ function surfaceCompanions(recommendsPath) {
|
|
|
28
155
|
console.log(r);
|
|
29
156
|
console.log("Adopt any you want with: agentkit adopt <name>");
|
|
30
157
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
158
|
+
const CAPABILITY_DIRS = new Set(["skills", "agents", "pipelines", "conventions"]);
|
|
159
|
+
async function adoptBundle(bundle, opts, onFile) {
|
|
160
|
+
let bulkAction = null;
|
|
161
|
+
const toProcess = [];
|
|
162
|
+
for (const item of bundle.items) {
|
|
163
|
+
const target = destinationFor(item, opts.provider, opts.projectRoot);
|
|
164
|
+
if (!existsSync(target)) {
|
|
165
|
+
toProcess.push({ item, target });
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
if (opts.force) {
|
|
169
|
+
rmSync(target, { recursive: true, force: true });
|
|
170
|
+
toProcess.push({ item, target });
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
const choice = bulkAction ?? await promptConflict(target);
|
|
174
|
+
if (choice === "replace-all") {
|
|
175
|
+
bulkAction = "replace";
|
|
176
|
+
rmSync(target, { recursive: true, force: true });
|
|
177
|
+
toProcess.push({ item, target });
|
|
178
|
+
}
|
|
179
|
+
else if (choice === "replace") {
|
|
180
|
+
rmSync(target, { recursive: true, force: true });
|
|
181
|
+
toProcess.push({ item, target });
|
|
182
|
+
}
|
|
183
|
+
else if (choice === "skip-all") {
|
|
184
|
+
bulkAction = "skip";
|
|
185
|
+
}
|
|
186
|
+
// "skip" — leave existing, do not push
|
|
37
187
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
188
|
+
for (const { item, target } of toProcess) {
|
|
189
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
190
|
+
if (item.isDir) {
|
|
191
|
+
cpSync(item.sourceCopyPath, target, { recursive: true });
|
|
192
|
+
for (const md of walkMd(target)) {
|
|
193
|
+
const content = readFileSync(md, "utf8");
|
|
194
|
+
for (const f of lint(content)) {
|
|
195
|
+
console.warn(`warning: ${relative(target, md)}:${f.line} contains "${f.token}" — review for ${opts.provider}.`);
|
|
196
|
+
}
|
|
197
|
+
writeFileSync(md, transform(content, opts.provider));
|
|
198
|
+
onFile?.(md);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
const content = readFileSync(item.sourceCopyPath, "utf8");
|
|
203
|
+
for (const f of lint(content)) {
|
|
204
|
+
console.warn(`warning: ${item.name}:${f.line} contains "${f.token}" — review for ${opts.provider}.`);
|
|
205
|
+
}
|
|
206
|
+
writeFileSync(target, transform(content, opts.provider));
|
|
207
|
+
onFile?.(target);
|
|
44
208
|
}
|
|
45
|
-
writeFileSync(md, transform(content, opts.provider));
|
|
46
209
|
}
|
|
47
|
-
|
|
48
|
-
for (const
|
|
210
|
+
const extrasBase = bundleExtrasDestination(bundle.name, opts.provider, opts.projectRoot);
|
|
211
|
+
for (const entry of readdirSync(bundle.dir, { withFileTypes: true })) {
|
|
212
|
+
if (!entry.isDirectory() || CAPABILITY_DIRS.has(entry.name))
|
|
213
|
+
continue;
|
|
214
|
+
const src = join(bundle.dir, entry.name);
|
|
215
|
+
const dest = join(extrasBase, entry.name);
|
|
216
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
217
|
+
cpSync(src, dest, { recursive: true });
|
|
218
|
+
}
|
|
219
|
+
console.log(`Adopted bundle "${bundle.name}" (${opts.provider}) -> ${opts.projectRoot}`);
|
|
220
|
+
for (const { item } of toProcess)
|
|
49
221
|
console.log(` + ${item.type} ${item.name}`);
|
|
50
222
|
console.log(wiringHint(opts.provider));
|
|
51
223
|
if (bundle.recommendsPath)
|
|
52
224
|
surfaceCompanions(bundle.recommendsPath);
|
|
53
225
|
return 0;
|
|
54
226
|
}
|
|
55
|
-
function adoptSingle(match, opts) {
|
|
227
|
+
async function adoptSingle(match, opts, onFile) {
|
|
56
228
|
const target = destinationFor(match, opts.provider, opts.projectRoot);
|
|
57
229
|
if (existsSync(target)) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
230
|
+
if (opts.force) {
|
|
231
|
+
rmSync(target, { recursive: true, force: true });
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
const choice = await promptConflict(target);
|
|
235
|
+
if (choice === "skip" || choice === "skip-all") {
|
|
236
|
+
console.log(`Skipped ${match.name}.`);
|
|
237
|
+
return 0;
|
|
238
|
+
}
|
|
239
|
+
rmSync(target, { recursive: true, force: true });
|
|
240
|
+
}
|
|
61
241
|
}
|
|
62
|
-
// Non-fatal neutrality warning on the source.
|
|
63
242
|
for (const f of lint(readFileSync(match.sourcePath, "utf8"))) {
|
|
64
243
|
console.warn(`warning: ${match.name}:${f.line} contains "${f.token}" — review before relying on it for ${opts.provider}.`);
|
|
65
244
|
}
|
|
66
245
|
mkdirSync(dirname(target), { recursive: true });
|
|
67
246
|
if (match.isDir) {
|
|
68
247
|
cpSync(match.sourceCopyPath, target, { recursive: true });
|
|
69
|
-
for (const md of walkMd(target))
|
|
248
|
+
for (const md of walkMd(target)) {
|
|
70
249
|
writeFileSync(md, transform(readFileSync(md, "utf8"), opts.provider));
|
|
250
|
+
onFile?.(md);
|
|
251
|
+
}
|
|
71
252
|
}
|
|
72
253
|
else {
|
|
73
254
|
writeFileSync(target, transform(readFileSync(match.sourceCopyPath, "utf8"), opts.provider));
|
|
255
|
+
onFile?.(target);
|
|
74
256
|
}
|
|
75
257
|
console.log(`Adopted ${match.type} "${match.name}" (${opts.provider}) -> ${target}`);
|
|
76
258
|
console.log(wiringHint(opts.provider));
|
|
77
259
|
return 0;
|
|
78
260
|
}
|
|
79
|
-
export function adopt(opts) {
|
|
80
|
-
|
|
261
|
+
export async function adopt(opts, onFile) {
|
|
262
|
+
const files = [];
|
|
263
|
+
const track = (p) => { files.push(p); onFile?.(p); };
|
|
81
264
|
const bundle = findBundle(opts.name);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (ambiguous.length > 0) {
|
|
86
|
-
console.error(`Ambiguous name "${opts.name}" matches: ${ambiguous.map((c) => `${c.type}/${c.name}`).join(", ")}.`);
|
|
87
|
-
console.error("Names are expected to be unique; resolve the collision in the kit before adopting.");
|
|
88
|
-
return 1;
|
|
265
|
+
let code;
|
|
266
|
+
if (bundle) {
|
|
267
|
+
code = await adoptBundle(bundle, opts, track);
|
|
89
268
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
269
|
+
else {
|
|
270
|
+
const { match, ambiguous } = findCapability(opts.name);
|
|
271
|
+
if (ambiguous.length > 0) {
|
|
272
|
+
console.error(`Ambiguous name "${opts.name}" matches: ${ambiguous.map((c) => `${c.type}/${c.name}`).join(", ")}.`);
|
|
273
|
+
console.error("Names are expected to be unique; resolve the collision in the kit before adopting.");
|
|
274
|
+
return 1;
|
|
275
|
+
}
|
|
276
|
+
if (!match) {
|
|
277
|
+
console.error(`No capability named "${opts.name}". Run "agentkit list" to see options.`);
|
|
278
|
+
return 1;
|
|
279
|
+
}
|
|
280
|
+
if (match.bundle) {
|
|
281
|
+
console.error(`"${match.name}" is part of the "${match.bundle}" bundle and depends on other files in it.`);
|
|
282
|
+
console.error(`Adopt the whole bundle instead: agentkit adopt ${match.bundle}`);
|
|
283
|
+
return 1;
|
|
284
|
+
}
|
|
285
|
+
code = await adoptSingle(match, opts, track);
|
|
286
|
+
}
|
|
287
|
+
if (code !== 0 || !opts.cli)
|
|
288
|
+
return code;
|
|
289
|
+
if (files.length === 0) {
|
|
290
|
+
console.log("No files adopted; nothing to adapt.");
|
|
291
|
+
return 0;
|
|
292
|
+
}
|
|
293
|
+
try {
|
|
294
|
+
return await invokeAi(CLI_INVOCATIONS[opts.cli], buildPrompt(files), opts.projectRoot, opts.cli);
|
|
93
295
|
}
|
|
94
|
-
|
|
95
|
-
console.error(`
|
|
96
|
-
console.error(`Adopt the whole bundle instead: agentkit adopt ${match.bundle}`);
|
|
296
|
+
catch (err) {
|
|
297
|
+
console.error(`Failed to launch ${opts.cli}: ${err instanceof Error ? err.message : String(err)}`);
|
|
97
298
|
return 1;
|
|
98
299
|
}
|
|
99
|
-
return adoptSingle(match, opts);
|
|
100
300
|
}
|
package/dist/providers.js
CHANGED
|
@@ -18,12 +18,9 @@ export function destinationFor(cap, provider, projectRoot) {
|
|
|
18
18
|
const base = join(projectRoot, PROVIDER_ROOT[provider], TYPE_DIR[cap.type]);
|
|
19
19
|
return cap.isDir ? join(base, cap.name) : join(base, `${cap.name}.md`);
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
export function bundleDestination(name, provider, projectRoot) {
|
|
26
|
-
return join(projectRoot, PROVIDER_ROOT[provider], "bundles", name);
|
|
21
|
+
/** Destination for bundle extras (templates, etc.) that are not capability items. */
|
|
22
|
+
export function bundleExtrasDestination(name, provider, projectRoot) {
|
|
23
|
+
return join(projectRoot, PROVIDER_ROOT[provider], name);
|
|
27
24
|
}
|
|
28
25
|
export function wiringHint(provider) {
|
|
29
26
|
switch (provider) {
|
package/package.json
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agent-manifesto-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "CLI to discover and adopt Agent Manifesto Kit capabilities (skills, agents, pipelines) into your project for Claude, Codex, or AI-agnostic targets.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"agentkit": "dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"dist",
|
|
11
|
-
"collection"
|
|
12
|
-
],
|
|
13
|
-
"keywords": [
|
|
14
|
-
"ai",
|
|
15
|
-
"agents",
|
|
16
|
-
"skills",
|
|
17
|
-
"claude",
|
|
18
|
-
"codex",
|
|
19
|
-
"spec-driven-development",
|
|
20
|
-
"cli",
|
|
21
|
-
"agent-manifesto"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc",
|
|
25
|
-
"start": "node dist/cli.js",
|
|
26
|
-
"test": "npm run build && node --test",
|
|
27
|
-
"prepublishOnly": "npm run build && npm test"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"@types/node": "^22.19.19",
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-manifesto-kit",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "CLI to discover and adopt Agent Manifesto Kit capabilities (skills, agents, pipelines) into your project for Claude, Codex, or AI-agnostic targets.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"agentkit": "dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"collection"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"ai",
|
|
15
|
+
"agents",
|
|
16
|
+
"skills",
|
|
17
|
+
"claude",
|
|
18
|
+
"codex",
|
|
19
|
+
"spec-driven-development",
|
|
20
|
+
"cli",
|
|
21
|
+
"agent-manifesto"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"start": "node dist/cli.js",
|
|
26
|
+
"test": "npm run build && node --test",
|
|
27
|
+
"prepublishOnly": "npm run build && npm test",
|
|
28
|
+
"prepare": "git config core.hooksPath .githooks",
|
|
29
|
+
"version-branch": "node .ai/scripts/bump-version.mjs"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=20"
|
|
33
|
+
},
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"author": "Alexey Platkovsky",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/AlexeyPlatkovsky/agent-manifesto-kit.git"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/AlexeyPlatkovsky/agent-manifesto-kit#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/AlexeyPlatkovsky/agent-manifesto-kit/issues"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^22.19.19",
|
|
46
|
+
"typescript": "^5.6.0"
|
|
47
|
+
}
|
|
48
|
+
}
|