mdkg 0.3.7 → 0.3.9
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 +50 -0
- package/CLI_COMMAND_MATRIX.md +85 -24
- package/README.md +51 -26
- package/dist/cli.js +72 -35
- package/dist/command-contract.json +354 -9
- package/dist/commands/capability.js +1 -0
- package/dist/commands/doctor.js +7 -7
- package/dist/commands/format.js +40 -1
- package/dist/commands/handoff.js +6 -0
- package/dist/commands/init.js +84 -3
- package/dist/commands/new.js +12 -3
- package/dist/commands/skill.js +1 -1
- package/dist/commands/skill_mirror.js +22 -17
- package/dist/commands/skill_support.js +1 -1
- package/dist/commands/spec.js +76 -17
- package/dist/commands/subgraph.js +7 -4
- package/dist/commands/upgrade.js +137 -30
- package/dist/commands/validate.js +106 -3
- package/dist/commands/work.js +12 -5
- package/dist/core/config.js +132 -0
- package/dist/graph/agent_file_types.js +59 -20
- package/dist/graph/capabilities_indexer.js +45 -3
- package/dist/graph/indexer.js +5 -0
- package/dist/graph/template_schema.js +37 -17
- package/dist/graph/validate_graph.js +11 -5
- package/dist/init/AGENT_START.md +10 -9
- package/dist/init/CLI_COMMAND_MATRIX.md +30 -17
- package/dist/init/README.md +11 -9
- package/dist/init/config.json +15 -0
- package/dist/init/core/COLLABORATION.md +45 -0
- package/dist/init/core/HUMAN.md +7 -1
- package/dist/init/core/core.md +1 -0
- package/dist/init/core/rule-1-mdkg-conventions.md +3 -0
- package/dist/init/core/rule-3-cli-contract.md +5 -5
- package/dist/init/init-manifest.json +78 -13
- package/dist/init/llms.txt +2 -1
- package/dist/init/skills/default/author-mdkg-skill/SKILL.md +211 -0
- package/dist/init/skills/default/pursue-mdkg-goal/SKILL.md +10 -0
- package/dist/init/skills/default/select-work-and-ground-context/SKILL.md +8 -0
- package/dist/init/skills/default/verify-close-and-checkpoint/SKILL.md +73 -9
- package/dist/init/templates/default/manifest.md +45 -0
- package/dist/init/templates/specs/agent.MANIFEST.md +80 -0
- package/dist/init/templates/specs/api.MANIFEST.md +33 -0
- package/dist/init/templates/specs/base.MANIFEST.md +120 -0
- package/dist/init/templates/specs/capability.MANIFEST.md +45 -0
- package/dist/init/templates/specs/integration.MANIFEST.md +25 -0
- package/dist/init/templates/specs/model.MANIFEST.md +21 -0
- package/dist/init/templates/specs/project.MANIFEST.md +39 -0
- package/dist/init/templates/specs/runtime-agent.MANIFEST.md +49 -0
- package/dist/init/templates/specs/runtime-image.MANIFEST.md +21 -0
- package/dist/init/templates/specs/tool.MANIFEST.md +25 -0
- package/dist/util/argparse.js +3 -0
- package/package.json +19 -3
package/dist/cli.js
CHANGED
|
@@ -71,7 +71,8 @@ function printUsage(log) {
|
|
|
71
71
|
log(" handoff Create sanitized agent handoff prompts from graph context");
|
|
72
72
|
log(" skill Create, list, show, search, and validate skills");
|
|
73
73
|
log(" capability List, search, show, and resolve cached capability surfaces");
|
|
74
|
-
log("
|
|
74
|
+
log(" manifest List, show, and validate MANIFEST.md/SPEC.md capability records");
|
|
75
|
+
log(" spec Legacy alias for `mdkg manifest` during the compatibility bridge");
|
|
75
76
|
log(" archive Add, list, show, verify, and compress archive sidecars");
|
|
76
77
|
log(" bundle Create, list, show, and verify full graph snapshot bundles");
|
|
77
78
|
log(" graph Clone, fork, import, and inspect mdkg graph references");
|
|
@@ -145,7 +146,8 @@ function printNewHelp(log) {
|
|
|
145
146
|
log("\nTypes:");
|
|
146
147
|
log(" rule prd edd dec prop goal epic feat task bug spike checkpoint test");
|
|
147
148
|
log("\nAgent workflow file types:");
|
|
148
|
-
log("
|
|
149
|
+
log(" manifest work work_order receipt feedback dispute proposal");
|
|
150
|
+
log(" spec is a legacy alias for manifest and emits MANIFEST.md during the compatibility bridge.");
|
|
149
151
|
log(" Use --id <portable-id> with these types for semantic ids like agent.image-worker.");
|
|
150
152
|
log(" Use `mdkg archive add` for archive sidecars instead of `mdkg new archive`.");
|
|
151
153
|
log("\nOptions:");
|
|
@@ -163,7 +165,8 @@ function printNewHelp(log) {
|
|
|
163
165
|
log(" --links --artifacts --refs --aliases --owners --cases --supersedes");
|
|
164
166
|
log(" --owners <owner,owner,...> Owners");
|
|
165
167
|
log("\nNotes:");
|
|
166
|
-
log("
|
|
168
|
+
log(" manifest/work scaffold as validation-clean docs; relational workflow docs need real refs.");
|
|
169
|
+
log(" mdkg new spec is deprecated; use mdkg new manifest for new reusable capability manifests.");
|
|
167
170
|
log(" spike creates actionable research/planning work; use `mdkg task ...` for lifecycle.");
|
|
168
171
|
log(" record spike research evidence by editing the Markdown body sections.");
|
|
169
172
|
log(" spikes do not run web search, create follow-up nodes, generate SKILL.md, or expose `mdkg spike ...`.");
|
|
@@ -411,7 +414,8 @@ function printSkillHelp(log, subcommand) {
|
|
|
411
414
|
log("Usage:");
|
|
412
415
|
log(" mdkg skill sync [--force] [--json]");
|
|
413
416
|
log("\nWhen to use:");
|
|
414
|
-
log(" Rebuild
|
|
417
|
+
log(" Rebuild configured skill mirror targets from canonical .mdkg/skills.");
|
|
418
|
+
log(" Defaults are .agents/skills and .claude/skills; add custom targets in .mdkg/config.json.");
|
|
415
419
|
printGlobalOptions(log);
|
|
416
420
|
return;
|
|
417
421
|
default:
|
|
@@ -469,38 +473,54 @@ function printCapabilityHelp(log, subcommand) {
|
|
|
469
473
|
printGlobalOptions(log);
|
|
470
474
|
}
|
|
471
475
|
}
|
|
472
|
-
function printSpecHelp(log, subcommand) {
|
|
476
|
+
function printSpecHelp(log, subcommand, surface = "spec") {
|
|
477
|
+
const command = surface === "manifest" ? "manifest" : "spec";
|
|
478
|
+
const legacyNote = surface === "spec"
|
|
479
|
+
? " `mdkg spec` is the legacy alias for `mdkg manifest` during the compatibility bridge."
|
|
480
|
+
: undefined;
|
|
473
481
|
switch ((subcommand ?? "").toLowerCase()) {
|
|
474
482
|
case "list":
|
|
475
483
|
log("Usage:");
|
|
476
|
-
log(
|
|
484
|
+
log(` mdkg ${command} list [--json]`);
|
|
477
485
|
log("\nNotes:");
|
|
478
|
-
log("
|
|
486
|
+
log(" MANIFEST.md is canonical; SPEC.md remains a legacy alias for reusable capability surfaces.");
|
|
487
|
+
if (legacyNote) {
|
|
488
|
+
log(legacyNote);
|
|
489
|
+
}
|
|
479
490
|
printGlobalOptions(log);
|
|
480
491
|
return;
|
|
481
492
|
case "show":
|
|
482
493
|
log("Usage:");
|
|
483
|
-
log(
|
|
494
|
+
log(` mdkg ${command} show <id-or-qid-or-alias> [--json]`);
|
|
484
495
|
log("\nNotes:");
|
|
485
|
-
log(" Shows one
|
|
496
|
+
log(" Shows one MANIFEST.md/SPEC.md capability record from the capability index.");
|
|
497
|
+
if (legacyNote) {
|
|
498
|
+
log(legacyNote);
|
|
499
|
+
}
|
|
486
500
|
printGlobalOptions(log);
|
|
487
501
|
return;
|
|
488
502
|
case "validate":
|
|
489
503
|
log("Usage:");
|
|
490
|
-
log(
|
|
504
|
+
log(` mdkg ${command} validate [<id-or-qid-or-alias>] [--json]`);
|
|
491
505
|
log("\nNotes:");
|
|
492
|
-
log(" With no reference, validates the graph and all
|
|
493
|
-
log(" With a reference, also ensures that specific
|
|
506
|
+
log(" With no reference, validates the graph and all MANIFEST.md/SPEC.md capability records.");
|
|
507
|
+
log(" With a reference, also ensures that the specific manifest capability exists.");
|
|
508
|
+
if (legacyNote) {
|
|
509
|
+
log(legacyNote);
|
|
510
|
+
}
|
|
494
511
|
printGlobalOptions(log);
|
|
495
512
|
return;
|
|
496
513
|
default:
|
|
497
514
|
log("Usage:");
|
|
498
|
-
log(
|
|
499
|
-
log(
|
|
500
|
-
log(
|
|
515
|
+
log(` mdkg ${command} list [--json]`);
|
|
516
|
+
log(` mdkg ${command} show <id-or-qid-or-alias> [--json]`);
|
|
517
|
+
log(` mdkg ${command} validate [<id-or-qid-or-alias>] [--json]`);
|
|
501
518
|
log("\nNotes:");
|
|
502
|
-
log("
|
|
503
|
-
|
|
519
|
+
log(" MANIFEST.md is canonical and reusable-capability oriented; SPEC.md remains a legacy alias.");
|
|
520
|
+
if (legacyNote) {
|
|
521
|
+
log(legacyNote);
|
|
522
|
+
}
|
|
523
|
+
log(" Use `mdkg capability ...` for broader skill, MANIFEST.md/SPEC.md, WORK.md, core-doc, and design-doc discovery.");
|
|
504
524
|
printGlobalOptions(log);
|
|
505
525
|
}
|
|
506
526
|
}
|
|
@@ -721,7 +741,7 @@ function printWorkHelp(log, subcommand) {
|
|
|
721
741
|
log("\nExample:");
|
|
722
742
|
log(" mdkg work trigger work.example --id order.example-1 --requester user://example --json");
|
|
723
743
|
log("\nNotes:");
|
|
724
|
-
log(" Accepted targets: direct WORK.md ref, or SPEC.md ref with exactly one resolvable work contract.");
|
|
744
|
+
log(" Accepted targets: direct WORK.md ref, or MANIFEST.md/SPEC.md ref with exactly one resolvable work contract.");
|
|
725
745
|
log(" Creates a deterministic WORK_ORDER.md semantic mirror and does not execute work.");
|
|
726
746
|
log(" Queue enqueue requires a valid project DB plus an explicitly created active queue and never executes work.");
|
|
727
747
|
break;
|
|
@@ -747,10 +767,10 @@ function printWorkHelp(log, subcommand) {
|
|
|
747
767
|
break;
|
|
748
768
|
case "validate":
|
|
749
769
|
log("Usage:");
|
|
750
|
-
log(" mdkg work validate [<id-or-qid>] [--type spec|work|work_order|receipt|feedback|dispute|proposal] [--json]");
|
|
770
|
+
log(" mdkg work validate [<id-or-qid>] [--type manifest|spec|work|work_order|receipt|feedback|dispute|proposal] [--json]");
|
|
751
771
|
log("\nNotes:");
|
|
752
772
|
log(" Read-only focused validation for agent workflow mirrors.");
|
|
753
|
-
log(" Reports typed diagnostics for SPEC.md, WORK.md, WORK_ORDER.md, RECEIPT.md, FEEDBACK.md, DISPUTE.md, and PROPOSAL.md files.");
|
|
773
|
+
log(" Reports typed diagnostics for MANIFEST.md, legacy SPEC.md, WORK.md, WORK_ORDER.md, RECEIPT.md, FEEDBACK.md, DISPUTE.md, and PROPOSAL.md files.");
|
|
754
774
|
log(" Obvious raw secret, prompt, token, or payload markers are warnings so humans and agents can review boundaries.");
|
|
755
775
|
break;
|
|
756
776
|
default:
|
|
@@ -952,11 +972,13 @@ function printCheckpointHelp(log) {
|
|
|
952
972
|
}
|
|
953
973
|
function printValidateHelp(log) {
|
|
954
974
|
log("Usage:");
|
|
955
|
-
log(" mdkg validate [--out <path>] [--quiet] [--changed-only] [--json]");
|
|
975
|
+
log(" mdkg validate [--out <path>] [--json-out <path>] [--quiet] [--changed-only] [--summary] [--limit <n>] [--json]");
|
|
956
976
|
log("\nNotes:");
|
|
957
977
|
log(" Validates frontmatter schemas, graph references, visibility, skills, and events.");
|
|
958
978
|
log(" --changed-only filters warning presentation to changed .mdkg files while full graph errors still run.");
|
|
959
|
-
log(" JSON output includes warning_diagnostics with warning ids, categories, severity, paths, refs, and remediation text.");
|
|
979
|
+
log(" JSON output includes warning_summary plus warning_diagnostics with warning ids, categories, severity, paths, refs, and remediation text.");
|
|
980
|
+
log(" --summary emits bounded warning samples for agent/CI logs; --limit controls the sample size.");
|
|
981
|
+
log(" --out writes the compatibility text report; --json-out writes a clean full JSON receipt.");
|
|
960
982
|
printGlobalOptions(log);
|
|
961
983
|
}
|
|
962
984
|
function printStatusHelp(log) {
|
|
@@ -1060,10 +1082,11 @@ function printFixHelp(log, subcommand) {
|
|
|
1060
1082
|
function printFormatHelp(log) {
|
|
1061
1083
|
log("Usage:");
|
|
1062
1084
|
log(" mdkg format");
|
|
1063
|
-
log(" mdkg format --headings [--dry-run|--apply] [--json]");
|
|
1085
|
+
log(" mdkg format --headings [--dry-run|--apply] [--summary] [--limit <n>] [--json]");
|
|
1064
1086
|
log("\nNotes:");
|
|
1065
1087
|
log(" Default format normalizes frontmatter in place.");
|
|
1066
1088
|
log(" --headings adds missing recommended body headings; it defaults to dry-run and requires --apply to write files.");
|
|
1089
|
+
log(" --summary emits bounded heading-change samples for agent/CI logs; --limit controls the sample size.");
|
|
1067
1090
|
printGlobalOptions(log);
|
|
1068
1091
|
}
|
|
1069
1092
|
function printDoctorHelp(log) {
|
|
@@ -1134,6 +1157,9 @@ function printCommandHelp(log, command, subcommand) {
|
|
|
1134
1157
|
case "capability":
|
|
1135
1158
|
printCapabilityHelp(log, subcommand);
|
|
1136
1159
|
return;
|
|
1160
|
+
case "manifest":
|
|
1161
|
+
printSpecHelp(log, subcommand, "manifest");
|
|
1162
|
+
return;
|
|
1137
1163
|
case "spec":
|
|
1138
1164
|
printSpecHelp(log, subcommand);
|
|
1139
1165
|
return;
|
|
@@ -1671,43 +1697,47 @@ function runCapabilitySubcommand(parsed, root) {
|
|
|
1671
1697
|
throw new errors_1.UsageError("capability requires list/search/show/resolve");
|
|
1672
1698
|
}
|
|
1673
1699
|
}
|
|
1674
|
-
function runSpecSubcommand(parsed, root) {
|
|
1700
|
+
function runSpecSubcommand(parsed, root, surface = "spec") {
|
|
1675
1701
|
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
1702
|
+
const command = surface === "manifest" ? "manifest" : "spec";
|
|
1676
1703
|
switch (subcommand) {
|
|
1677
1704
|
case "list": {
|
|
1678
1705
|
if (parsed.positionals.length > 2) {
|
|
1679
|
-
throw new errors_1.UsageError(
|
|
1706
|
+
throw new errors_1.UsageError(`${command} list does not accept positional arguments`);
|
|
1680
1707
|
}
|
|
1681
1708
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1682
1709
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1683
1710
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1684
|
-
|
|
1711
|
+
const runList = surface === "manifest" ? spec_1.runManifestListCommand : spec_1.runSpecListCommand;
|
|
1712
|
+
runList({ root, json, noCache, noReindex });
|
|
1685
1713
|
return 0;
|
|
1686
1714
|
}
|
|
1687
1715
|
case "show": {
|
|
1688
1716
|
const id = parsed.positionals[2];
|
|
1689
1717
|
if (!id || parsed.positionals.length > 3) {
|
|
1690
|
-
throw new errors_1.UsageError(
|
|
1718
|
+
throw new errors_1.UsageError(`${command} show requires <id-or-qid-or-alias>`);
|
|
1691
1719
|
}
|
|
1692
1720
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1693
1721
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1694
1722
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1695
|
-
|
|
1723
|
+
const runShow = surface === "manifest" ? spec_1.runManifestShowCommand : spec_1.runSpecShowCommand;
|
|
1724
|
+
runShow({ root, id, json, noCache, noReindex });
|
|
1696
1725
|
return 0;
|
|
1697
1726
|
}
|
|
1698
1727
|
case "validate": {
|
|
1699
1728
|
const id = parsed.positionals[2];
|
|
1700
1729
|
if (parsed.positionals.length > 3) {
|
|
1701
|
-
throw new errors_1.UsageError(
|
|
1730
|
+
throw new errors_1.UsageError(`${command} validate accepts at most one manifest reference`);
|
|
1702
1731
|
}
|
|
1703
1732
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1704
1733
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1705
1734
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1706
|
-
|
|
1735
|
+
const runValidate = surface === "manifest" ? spec_1.runManifestValidateCommand : spec_1.runSpecValidateCommand;
|
|
1736
|
+
runValidate({ root, id, json, noCache, noReindex });
|
|
1707
1737
|
return 0;
|
|
1708
1738
|
}
|
|
1709
1739
|
default:
|
|
1710
|
-
throw new errors_1.UsageError(
|
|
1740
|
+
throw new errors_1.UsageError(`${command} requires list/show/validate`);
|
|
1711
1741
|
}
|
|
1712
1742
|
}
|
|
1713
1743
|
function runArchiveSubcommand(parsed, root) {
|
|
@@ -2671,6 +2701,8 @@ function runCommand(parsed, root, runtime) {
|
|
|
2671
2701
|
return runSkillSubcommand(parsed, root);
|
|
2672
2702
|
case "capability":
|
|
2673
2703
|
return runCapabilitySubcommand(parsed, root);
|
|
2704
|
+
case "manifest":
|
|
2705
|
+
return runSpecSubcommand(parsed, root, "manifest");
|
|
2674
2706
|
case "spec":
|
|
2675
2707
|
return runSpecSubcommand(parsed, root);
|
|
2676
2708
|
case "archive":
|
|
@@ -2914,10 +2946,13 @@ function runCommand(parsed, root, runtime) {
|
|
|
2914
2946
|
throw new errors_1.UsageError("validate does not accept positional arguments");
|
|
2915
2947
|
}
|
|
2916
2948
|
const out = requireFlagValue("--out", parsed.flags["--out"]);
|
|
2949
|
+
const jsonOut = requireFlagValue("--json-out", parsed.flags["--json-out"]);
|
|
2917
2950
|
const quiet = parseBooleanFlag("--quiet", parsed.flags["--quiet"]);
|
|
2918
2951
|
const changedOnly = parseBooleanFlag("--changed-only", parsed.flags["--changed-only"]);
|
|
2952
|
+
const summary = parseBooleanFlag("--summary", parsed.flags["--summary"]);
|
|
2953
|
+
const limit = parseNumberFlag("--limit", parsed.flags["--limit"]);
|
|
2919
2954
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
2920
|
-
(0, validate_1.runValidateCommand)({ root, out, quiet, json, changedOnly });
|
|
2955
|
+
(0, validate_1.runValidateCommand)({ root, out, jsonOut, quiet, json, changedOnly, summary, limit });
|
|
2921
2956
|
return 0;
|
|
2922
2957
|
}
|
|
2923
2958
|
case "status": {
|
|
@@ -2964,14 +2999,16 @@ function runCommand(parsed, root, runtime) {
|
|
|
2964
2999
|
const headings = parseBooleanFlag("--headings", parsed.flags["--headings"]);
|
|
2965
3000
|
const dryRun = parseBooleanFlag("--dry-run", parsed.flags["--dry-run"]);
|
|
2966
3001
|
const apply = parseBooleanFlag("--apply", parsed.flags["--apply"]);
|
|
3002
|
+
const summary = parseBooleanFlag("--summary", parsed.flags["--summary"]);
|
|
3003
|
+
const limit = parseNumberFlag("--limit", parsed.flags["--limit"]);
|
|
2967
3004
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
2968
|
-
if (!headings && (dryRun || apply || json)) {
|
|
2969
|
-
throw new errors_1.UsageError("format --dry-run, --apply, and --json require --headings");
|
|
3005
|
+
if (!headings && (dryRun || apply || json || summary || limit !== undefined)) {
|
|
3006
|
+
throw new errors_1.UsageError("format --dry-run, --apply, --summary, --limit, and --json require --headings");
|
|
2970
3007
|
}
|
|
2971
3008
|
if (dryRun && apply) {
|
|
2972
3009
|
throw new errors_1.UsageError("format --headings cannot use --dry-run and --apply together");
|
|
2973
3010
|
}
|
|
2974
|
-
(0, format_1.runFormatCommand)({ root, headings, dryRun, apply, json });
|
|
3011
|
+
(0, format_1.runFormatCommand)({ root, headings, dryRun, apply, json, summary, limit });
|
|
2975
3012
|
return 0;
|
|
2976
3013
|
case "doctor": {
|
|
2977
3014
|
if (parsed.positionals.length > 1) {
|