@kaddo/cli 3.27.3 → 3.28.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/README.md +1 -0
- package/dist/index.js +40 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -521,6 +521,7 @@ create --from roadmap → owners → guard → explain`.
|
|
|
521
521
|
| v3.27.1 | Codex adapter command fallbacks: AGENTS.md tells Codex to try `corepack pnpm exec` / `pnpm exec` / `npx` kaddo when the global binary isn't on PATH |
|
|
522
522
|
| v3.27.2 | Codex adapter safe merge: `kaddo adapters install codex --inject` adds/updates only a delimited Kaddo block in an existing AGENTS.md, preserving team content |
|
|
523
523
|
| v3.27.3 | Codex adapter reference stabilization: package-manager-aware command fallbacks (lockfile detection) + Adapter Contract & Custom Adapters docs (reference for future adapters) |
|
|
524
|
+
| v3.28 | Claude Code adapter: `kaddo adapters install claude` (alias `kaddo export claude`) generates a `CLAUDE.md` projection reusing the shared adapter common core (`--dry-run`/`--force`) |
|
|
524
525
|
|
|
525
526
|
**Optional modules (installed with `kaddo add`):**
|
|
526
527
|
|
package/dist/index.js
CHANGED
|
@@ -12404,11 +12404,13 @@ var ROLE_HINTS = {
|
|
|
12404
12404
|
"graph-agent": "use to turn graph hints into front matter.",
|
|
12405
12405
|
"capsule-agent": "use to refine a Knowledge Capsule for sharing."
|
|
12406
12406
|
};
|
|
12407
|
-
|
|
12407
|
+
var TARGET_FILE = { codex: "AGENTS.md", claude: "CLAUDE.md" };
|
|
12408
|
+
function renderAdapterMarkdown(ctx, target) {
|
|
12409
|
+
const file = TARGET_FILE[target];
|
|
12408
12410
|
const L = [];
|
|
12409
|
-
L.push(
|
|
12411
|
+
L.push(`<!-- Generated by \`kaddo adapters install ${target}\`. Kaddo is the source of truth \u2014`);
|
|
12410
12412
|
L.push(" regenerate this file instead of editing it by hand. Do not treat it as primary. -->");
|
|
12411
|
-
L.push(
|
|
12413
|
+
L.push(`# ${file}`, "");
|
|
12412
12414
|
L.push("## Project guidance", "");
|
|
12413
12415
|
if (ctx.projectName) L.push(`Project: **${ctx.projectName}**${ctx.projectType ? ` (${ctx.projectType})` : ""}.`, "");
|
|
12414
12416
|
L.push("This repository uses **Kaddo** for Knowledge Driven Development. Kaddo keeps business,");
|
|
@@ -12511,6 +12513,9 @@ function renderAgentsMd(ctx) {
|
|
|
12511
12513
|
L.push("");
|
|
12512
12514
|
return L.join("\n");
|
|
12513
12515
|
}
|
|
12516
|
+
function renderAgentsMd(ctx) {
|
|
12517
|
+
return renderAdapterMarkdown(ctx, "codex");
|
|
12518
|
+
}
|
|
12514
12519
|
var KADDO_BEGIN_MARKER = "<!-- BEGIN KADDO CODEX ADAPTER -->";
|
|
12515
12520
|
var KADDO_END_MARKER = "<!-- END KADDO CODEX ADAPTER -->";
|
|
12516
12521
|
var GENERATED_HEADER = "Generated by `kaddo adapters install codex`";
|
|
@@ -12592,77 +12597,85 @@ ${sep}${block}
|
|
|
12592
12597
|
}
|
|
12593
12598
|
|
|
12594
12599
|
// src/commands/adapters.ts
|
|
12600
|
+
var TARGETS2 = {
|
|
12601
|
+
codex: { target: "codex", file: "AGENTS.md", label: "Codex", supportsInject: true },
|
|
12602
|
+
claude: { target: "claude", file: "CLAUDE.md", label: "Claude Code", supportsInject: false }
|
|
12603
|
+
};
|
|
12595
12604
|
function runAdaptersInstall(adapter, opts = {}) {
|
|
12596
12605
|
const dir = cwd();
|
|
12597
12606
|
requireConfig(dir);
|
|
12598
|
-
|
|
12599
|
-
|
|
12607
|
+
const spec = TARGETS2[adapter];
|
|
12608
|
+
if (!spec) {
|
|
12609
|
+
console.error(`Unknown adapter: "${adapter}". Available: ${Object.keys(TARGETS2).join(", ")}.`);
|
|
12600
12610
|
process.exit(1);
|
|
12611
|
+
return;
|
|
12601
12612
|
}
|
|
12602
12613
|
const ctx = buildCodexAdapterContext(dir);
|
|
12603
|
-
const rel =
|
|
12614
|
+
const rel = spec.file;
|
|
12604
12615
|
const full = join(dir, rel);
|
|
12605
12616
|
const existed = exists(full);
|
|
12606
12617
|
const existing = existed ? readFile(full) : null;
|
|
12607
|
-
|
|
12618
|
+
const cmd = `kaddo adapters install ${adapter}`;
|
|
12619
|
+
if (opts.inject && spec.supportsInject) {
|
|
12608
12620
|
const state = detectAgentsState(existing);
|
|
12609
12621
|
if (state === "invalid_kaddo_block") {
|
|
12610
|
-
console.error(
|
|
12622
|
+
console.error(`Invalid Kaddo adapter block detected in ${rel}.`);
|
|
12611
12623
|
console.error("Found one marker without its pair. Fix the file manually or use --force to overwrite.");
|
|
12612
12624
|
console.error("Nothing changed.");
|
|
12613
12625
|
process.exit(1);
|
|
12626
|
+
return;
|
|
12614
12627
|
}
|
|
12615
12628
|
if (existing === null) {
|
|
12616
12629
|
const content2 = renderAgentsMd(ctx);
|
|
12617
12630
|
if (opts.dryRun) {
|
|
12618
|
-
console.log(
|
|
12631
|
+
console.log(`# ${rel} preview`, "");
|
|
12619
12632
|
console.log(content2);
|
|
12620
12633
|
return;
|
|
12621
12634
|
}
|
|
12622
|
-
intro2(
|
|
12635
|
+
intro2(`${cmd} --inject`);
|
|
12623
12636
|
writeFile(full, content2);
|
|
12624
|
-
log2.success(
|
|
12637
|
+
log2.success(`Created ${rel} for ${spec.label}.`);
|
|
12625
12638
|
printCommandFooter("adapters install codex");
|
|
12626
|
-
outro2(
|
|
12639
|
+
outro2(`${rel} ready.`);
|
|
12627
12640
|
return;
|
|
12628
12641
|
}
|
|
12629
12642
|
const merged = injectKaddoBlock(existing, ctx);
|
|
12630
12643
|
if (opts.dryRun) {
|
|
12631
|
-
console.log(
|
|
12644
|
+
console.log(`# ${rel} preview (inject)`, "");
|
|
12632
12645
|
console.log(merged.content);
|
|
12633
12646
|
return;
|
|
12634
12647
|
}
|
|
12635
|
-
intro2(
|
|
12648
|
+
intro2(`${cmd} --inject`);
|
|
12636
12649
|
writeFile(full, merged.content);
|
|
12637
12650
|
if (merged.status === "updated") {
|
|
12638
|
-
log2.success(
|
|
12651
|
+
log2.success(`Updated existing Kaddo guidance block in ${rel}.`);
|
|
12639
12652
|
} else {
|
|
12640
|
-
log2.success(
|
|
12653
|
+
log2.success(`Injected Kaddo guidance block into ${rel}.`);
|
|
12641
12654
|
}
|
|
12642
12655
|
log2.info("Content outside the Kaddo markers was preserved.");
|
|
12643
12656
|
printCommandFooter("adapters install codex");
|
|
12644
|
-
outro2(
|
|
12657
|
+
outro2(`${rel} ready.`);
|
|
12645
12658
|
return;
|
|
12646
12659
|
}
|
|
12647
|
-
const content =
|
|
12660
|
+
const content = renderAdapterMarkdown(ctx, spec.target);
|
|
12648
12661
|
if (opts.dryRun) {
|
|
12649
|
-
console.log(
|
|
12662
|
+
console.log(`# ${rel} preview`, "");
|
|
12650
12663
|
console.log(content);
|
|
12651
12664
|
return;
|
|
12652
12665
|
}
|
|
12653
|
-
intro2(
|
|
12666
|
+
intro2(cmd);
|
|
12654
12667
|
if (existed && !opts.force) {
|
|
12655
|
-
log2.warn(
|
|
12656
|
-
log2.info("Use `--inject` to add or update only the Kaddo block,");
|
|
12657
|
-
log2.info(
|
|
12668
|
+
log2.warn(`${rel} already exists.`);
|
|
12669
|
+
if (spec.supportsInject) log2.info("Use `--inject` to add or update only the Kaddo block,");
|
|
12670
|
+
log2.info(`Use \`--force\` to overwrite, or \`--dry-run\` to preview.`);
|
|
12658
12671
|
outro2("Nothing changed.");
|
|
12659
12672
|
return;
|
|
12660
12673
|
}
|
|
12661
12674
|
writeFile(full, content);
|
|
12662
|
-
log2.success(`${existed ? "Overwrote" : "Created"}
|
|
12675
|
+
log2.success(`${existed ? "Overwrote" : "Created"} ${rel} for ${spec.label}.`);
|
|
12663
12676
|
log2.info("Source: Kaddo project knowledge. Regenerate it instead of editing by hand.");
|
|
12664
12677
|
printCommandFooter("adapters install codex");
|
|
12665
|
-
outro2(
|
|
12678
|
+
outro2(`${rel} ready.`);
|
|
12666
12679
|
}
|
|
12667
12680
|
|
|
12668
12681
|
// src/index.ts
|
|
@@ -12719,10 +12732,10 @@ var questionsAction = (opts) => runQuestions(opts);
|
|
|
12719
12732
|
program.command("questions").description("Open-questions readiness gate: blocking/important/deferred decisions before the roadmap").option("--json", "Output JSON instead of a summary").option("--output <path>", "Write the report to a file (e.g. .kaddo/reports/questions-report.md)").action(questionsAction);
|
|
12720
12733
|
program.command("readiness").description("Alias for `kaddo questions`").option("--json", "Output JSON instead of a summary").option("--output <path>", "Write the report to a file").action(questionsAction);
|
|
12721
12734
|
var adaptersCmd = program.command("adapters").description("Generate adapters that project Kaddo knowledge for external coding agents");
|
|
12722
|
-
adaptersCmd.command("install <adapter>").description("Generate an adapter file (codex \u2192 AGENTS.md) from Kaddo knowledge").option("--force", "Overwrite an existing output file").option("--inject", "Add or update only the Kaddo block in an existing file, preserving the rest").option("--dry-run", "Print the content without writing files").action((adapter, opts) => {
|
|
12735
|
+
adaptersCmd.command("install <adapter>").description("Generate an adapter file (codex \u2192 AGENTS.md, claude \u2192 CLAUDE.md) from Kaddo knowledge").option("--force", "Overwrite an existing output file").option("--inject", "Add or update only the Kaddo block in an existing file, preserving the rest").option("--dry-run", "Print the content without writing files").action((adapter, opts) => {
|
|
12723
12736
|
runAdaptersInstall(adapter, opts);
|
|
12724
12737
|
});
|
|
12725
|
-
program.command("export <adapter>").description("Alias for `kaddo adapters install <adapter>` (codex \u2192 AGENTS.md)").option("--force", "Overwrite an existing output file").option("--inject", "Add or update only the Kaddo block in an existing file, preserving the rest").option("--dry-run", "Print the content without writing files").action((adapter, opts) => {
|
|
12738
|
+
program.command("export <adapter>").description("Alias for `kaddo adapters install <adapter>` (codex \u2192 AGENTS.md, claude \u2192 CLAUDE.md)").option("--force", "Overwrite an existing output file").option("--inject", "Add or update only the Kaddo block in an existing file, preserving the rest").option("--dry-run", "Print the content without writing files").action((adapter, opts) => {
|
|
12726
12739
|
runAdaptersInstall(adapter, opts);
|
|
12727
12740
|
});
|
|
12728
12741
|
program.command("guard").description("Check if modified code has related artifacts that were not updated").option("--staged", "Check only staged files").option("--no-interactive", "Disable interactive ignore prompts").option("--ci", "CI mode: output JSON, no prompts, non-blocking").option("--json", "Output JSON (alias for --ci)").option("--workspace", "Also check local mapped module repos from .kaddo/modules.yml (opt-in)").option("--include-archived", "Include archived Work Items in ownership matching (excluded by default)").option("--record", "Record this run to .kaddo/history/ for drift trend reporting").action(async (opts) => {
|