mdkg 0.3.7 → 0.3.8
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 +24 -0
- package/CLI_COMMAND_MATRIX.md +81 -22
- package/README.md +50 -25
- package/dist/cli.js +70 -34
- 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/new.js +12 -3
- package/dist/commands/spec.js +76 -17
- package/dist/commands/subgraph.js +7 -4
- package/dist/commands/upgrade.js +70 -6
- package/dist/commands/validate.js +106 -3
- package/dist/commands/work.js +12 -5
- 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 +5 -5
- package/dist/init/CLI_COMMAND_MATRIX.md +29 -16
- package/dist/init/README.md +11 -9
- package/dist/init/init-manifest.json +59 -4
- 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 +17 -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 ...`.");
|
|
@@ -469,38 +472,54 @@ function printCapabilityHelp(log, subcommand) {
|
|
|
469
472
|
printGlobalOptions(log);
|
|
470
473
|
}
|
|
471
474
|
}
|
|
472
|
-
function printSpecHelp(log, subcommand) {
|
|
475
|
+
function printSpecHelp(log, subcommand, surface = "spec") {
|
|
476
|
+
const command = surface === "manifest" ? "manifest" : "spec";
|
|
477
|
+
const legacyNote = surface === "spec"
|
|
478
|
+
? " `mdkg spec` is the legacy alias for `mdkg manifest` during the compatibility bridge."
|
|
479
|
+
: undefined;
|
|
473
480
|
switch ((subcommand ?? "").toLowerCase()) {
|
|
474
481
|
case "list":
|
|
475
482
|
log("Usage:");
|
|
476
|
-
log(
|
|
483
|
+
log(` mdkg ${command} list [--json]`);
|
|
477
484
|
log("\nNotes:");
|
|
478
|
-
log("
|
|
485
|
+
log(" MANIFEST.md is canonical; SPEC.md remains a legacy alias for reusable capability surfaces.");
|
|
486
|
+
if (legacyNote) {
|
|
487
|
+
log(legacyNote);
|
|
488
|
+
}
|
|
479
489
|
printGlobalOptions(log);
|
|
480
490
|
return;
|
|
481
491
|
case "show":
|
|
482
492
|
log("Usage:");
|
|
483
|
-
log(
|
|
493
|
+
log(` mdkg ${command} show <id-or-qid-or-alias> [--json]`);
|
|
484
494
|
log("\nNotes:");
|
|
485
|
-
log(" Shows one
|
|
495
|
+
log(" Shows one MANIFEST.md/SPEC.md capability record from the capability index.");
|
|
496
|
+
if (legacyNote) {
|
|
497
|
+
log(legacyNote);
|
|
498
|
+
}
|
|
486
499
|
printGlobalOptions(log);
|
|
487
500
|
return;
|
|
488
501
|
case "validate":
|
|
489
502
|
log("Usage:");
|
|
490
|
-
log(
|
|
503
|
+
log(` mdkg ${command} validate [<id-or-qid-or-alias>] [--json]`);
|
|
491
504
|
log("\nNotes:");
|
|
492
|
-
log(" With no reference, validates the graph and all
|
|
493
|
-
log(" With a reference, also ensures that specific
|
|
505
|
+
log(" With no reference, validates the graph and all MANIFEST.md/SPEC.md capability records.");
|
|
506
|
+
log(" With a reference, also ensures that the specific manifest capability exists.");
|
|
507
|
+
if (legacyNote) {
|
|
508
|
+
log(legacyNote);
|
|
509
|
+
}
|
|
494
510
|
printGlobalOptions(log);
|
|
495
511
|
return;
|
|
496
512
|
default:
|
|
497
513
|
log("Usage:");
|
|
498
|
-
log(
|
|
499
|
-
log(
|
|
500
|
-
log(
|
|
514
|
+
log(` mdkg ${command} list [--json]`);
|
|
515
|
+
log(` mdkg ${command} show <id-or-qid-or-alias> [--json]`);
|
|
516
|
+
log(` mdkg ${command} validate [<id-or-qid-or-alias>] [--json]`);
|
|
501
517
|
log("\nNotes:");
|
|
502
|
-
log("
|
|
503
|
-
|
|
518
|
+
log(" MANIFEST.md is canonical and reusable-capability oriented; SPEC.md remains a legacy alias.");
|
|
519
|
+
if (legacyNote) {
|
|
520
|
+
log(legacyNote);
|
|
521
|
+
}
|
|
522
|
+
log(" Use `mdkg capability ...` for broader skill, MANIFEST.md/SPEC.md, WORK.md, core-doc, and design-doc discovery.");
|
|
504
523
|
printGlobalOptions(log);
|
|
505
524
|
}
|
|
506
525
|
}
|
|
@@ -721,7 +740,7 @@ function printWorkHelp(log, subcommand) {
|
|
|
721
740
|
log("\nExample:");
|
|
722
741
|
log(" mdkg work trigger work.example --id order.example-1 --requester user://example --json");
|
|
723
742
|
log("\nNotes:");
|
|
724
|
-
log(" Accepted targets: direct WORK.md ref, or SPEC.md ref with exactly one resolvable work contract.");
|
|
743
|
+
log(" Accepted targets: direct WORK.md ref, or MANIFEST.md/SPEC.md ref with exactly one resolvable work contract.");
|
|
725
744
|
log(" Creates a deterministic WORK_ORDER.md semantic mirror and does not execute work.");
|
|
726
745
|
log(" Queue enqueue requires a valid project DB plus an explicitly created active queue and never executes work.");
|
|
727
746
|
break;
|
|
@@ -747,10 +766,10 @@ function printWorkHelp(log, subcommand) {
|
|
|
747
766
|
break;
|
|
748
767
|
case "validate":
|
|
749
768
|
log("Usage:");
|
|
750
|
-
log(" mdkg work validate [<id-or-qid>] [--type spec|work|work_order|receipt|feedback|dispute|proposal] [--json]");
|
|
769
|
+
log(" mdkg work validate [<id-or-qid>] [--type manifest|spec|work|work_order|receipt|feedback|dispute|proposal] [--json]");
|
|
751
770
|
log("\nNotes:");
|
|
752
771
|
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.");
|
|
772
|
+
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
773
|
log(" Obvious raw secret, prompt, token, or payload markers are warnings so humans and agents can review boundaries.");
|
|
755
774
|
break;
|
|
756
775
|
default:
|
|
@@ -952,11 +971,13 @@ function printCheckpointHelp(log) {
|
|
|
952
971
|
}
|
|
953
972
|
function printValidateHelp(log) {
|
|
954
973
|
log("Usage:");
|
|
955
|
-
log(" mdkg validate [--out <path>] [--quiet] [--changed-only] [--json]");
|
|
974
|
+
log(" mdkg validate [--out <path>] [--json-out <path>] [--quiet] [--changed-only] [--summary] [--limit <n>] [--json]");
|
|
956
975
|
log("\nNotes:");
|
|
957
976
|
log(" Validates frontmatter schemas, graph references, visibility, skills, and events.");
|
|
958
977
|
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.");
|
|
978
|
+
log(" JSON output includes warning_summary plus warning_diagnostics with warning ids, categories, severity, paths, refs, and remediation text.");
|
|
979
|
+
log(" --summary emits bounded warning samples for agent/CI logs; --limit controls the sample size.");
|
|
980
|
+
log(" --out writes the compatibility text report; --json-out writes a clean full JSON receipt.");
|
|
960
981
|
printGlobalOptions(log);
|
|
961
982
|
}
|
|
962
983
|
function printStatusHelp(log) {
|
|
@@ -1060,10 +1081,11 @@ function printFixHelp(log, subcommand) {
|
|
|
1060
1081
|
function printFormatHelp(log) {
|
|
1061
1082
|
log("Usage:");
|
|
1062
1083
|
log(" mdkg format");
|
|
1063
|
-
log(" mdkg format --headings [--dry-run|--apply] [--json]");
|
|
1084
|
+
log(" mdkg format --headings [--dry-run|--apply] [--summary] [--limit <n>] [--json]");
|
|
1064
1085
|
log("\nNotes:");
|
|
1065
1086
|
log(" Default format normalizes frontmatter in place.");
|
|
1066
1087
|
log(" --headings adds missing recommended body headings; it defaults to dry-run and requires --apply to write files.");
|
|
1088
|
+
log(" --summary emits bounded heading-change samples for agent/CI logs; --limit controls the sample size.");
|
|
1067
1089
|
printGlobalOptions(log);
|
|
1068
1090
|
}
|
|
1069
1091
|
function printDoctorHelp(log) {
|
|
@@ -1134,6 +1156,9 @@ function printCommandHelp(log, command, subcommand) {
|
|
|
1134
1156
|
case "capability":
|
|
1135
1157
|
printCapabilityHelp(log, subcommand);
|
|
1136
1158
|
return;
|
|
1159
|
+
case "manifest":
|
|
1160
|
+
printSpecHelp(log, subcommand, "manifest");
|
|
1161
|
+
return;
|
|
1137
1162
|
case "spec":
|
|
1138
1163
|
printSpecHelp(log, subcommand);
|
|
1139
1164
|
return;
|
|
@@ -1671,43 +1696,47 @@ function runCapabilitySubcommand(parsed, root) {
|
|
|
1671
1696
|
throw new errors_1.UsageError("capability requires list/search/show/resolve");
|
|
1672
1697
|
}
|
|
1673
1698
|
}
|
|
1674
|
-
function runSpecSubcommand(parsed, root) {
|
|
1699
|
+
function runSpecSubcommand(parsed, root, surface = "spec") {
|
|
1675
1700
|
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
1701
|
+
const command = surface === "manifest" ? "manifest" : "spec";
|
|
1676
1702
|
switch (subcommand) {
|
|
1677
1703
|
case "list": {
|
|
1678
1704
|
if (parsed.positionals.length > 2) {
|
|
1679
|
-
throw new errors_1.UsageError(
|
|
1705
|
+
throw new errors_1.UsageError(`${command} list does not accept positional arguments`);
|
|
1680
1706
|
}
|
|
1681
1707
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1682
1708
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1683
1709
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1684
|
-
|
|
1710
|
+
const runList = surface === "manifest" ? spec_1.runManifestListCommand : spec_1.runSpecListCommand;
|
|
1711
|
+
runList({ root, json, noCache, noReindex });
|
|
1685
1712
|
return 0;
|
|
1686
1713
|
}
|
|
1687
1714
|
case "show": {
|
|
1688
1715
|
const id = parsed.positionals[2];
|
|
1689
1716
|
if (!id || parsed.positionals.length > 3) {
|
|
1690
|
-
throw new errors_1.UsageError(
|
|
1717
|
+
throw new errors_1.UsageError(`${command} show requires <id-or-qid-or-alias>`);
|
|
1691
1718
|
}
|
|
1692
1719
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1693
1720
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1694
1721
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1695
|
-
|
|
1722
|
+
const runShow = surface === "manifest" ? spec_1.runManifestShowCommand : spec_1.runSpecShowCommand;
|
|
1723
|
+
runShow({ root, id, json, noCache, noReindex });
|
|
1696
1724
|
return 0;
|
|
1697
1725
|
}
|
|
1698
1726
|
case "validate": {
|
|
1699
1727
|
const id = parsed.positionals[2];
|
|
1700
1728
|
if (parsed.positionals.length > 3) {
|
|
1701
|
-
throw new errors_1.UsageError(
|
|
1729
|
+
throw new errors_1.UsageError(`${command} validate accepts at most one manifest reference`);
|
|
1702
1730
|
}
|
|
1703
1731
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1704
1732
|
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
1705
1733
|
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
1706
|
-
|
|
1734
|
+
const runValidate = surface === "manifest" ? spec_1.runManifestValidateCommand : spec_1.runSpecValidateCommand;
|
|
1735
|
+
runValidate({ root, id, json, noCache, noReindex });
|
|
1707
1736
|
return 0;
|
|
1708
1737
|
}
|
|
1709
1738
|
default:
|
|
1710
|
-
throw new errors_1.UsageError(
|
|
1739
|
+
throw new errors_1.UsageError(`${command} requires list/show/validate`);
|
|
1711
1740
|
}
|
|
1712
1741
|
}
|
|
1713
1742
|
function runArchiveSubcommand(parsed, root) {
|
|
@@ -2671,6 +2700,8 @@ function runCommand(parsed, root, runtime) {
|
|
|
2671
2700
|
return runSkillSubcommand(parsed, root);
|
|
2672
2701
|
case "capability":
|
|
2673
2702
|
return runCapabilitySubcommand(parsed, root);
|
|
2703
|
+
case "manifest":
|
|
2704
|
+
return runSpecSubcommand(parsed, root, "manifest");
|
|
2674
2705
|
case "spec":
|
|
2675
2706
|
return runSpecSubcommand(parsed, root);
|
|
2676
2707
|
case "archive":
|
|
@@ -2914,10 +2945,13 @@ function runCommand(parsed, root, runtime) {
|
|
|
2914
2945
|
throw new errors_1.UsageError("validate does not accept positional arguments");
|
|
2915
2946
|
}
|
|
2916
2947
|
const out = requireFlagValue("--out", parsed.flags["--out"]);
|
|
2948
|
+
const jsonOut = requireFlagValue("--json-out", parsed.flags["--json-out"]);
|
|
2917
2949
|
const quiet = parseBooleanFlag("--quiet", parsed.flags["--quiet"]);
|
|
2918
2950
|
const changedOnly = parseBooleanFlag("--changed-only", parsed.flags["--changed-only"]);
|
|
2951
|
+
const summary = parseBooleanFlag("--summary", parsed.flags["--summary"]);
|
|
2952
|
+
const limit = parseNumberFlag("--limit", parsed.flags["--limit"]);
|
|
2919
2953
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
2920
|
-
(0, validate_1.runValidateCommand)({ root, out, quiet, json, changedOnly });
|
|
2954
|
+
(0, validate_1.runValidateCommand)({ root, out, jsonOut, quiet, json, changedOnly, summary, limit });
|
|
2921
2955
|
return 0;
|
|
2922
2956
|
}
|
|
2923
2957
|
case "status": {
|
|
@@ -2964,14 +2998,16 @@ function runCommand(parsed, root, runtime) {
|
|
|
2964
2998
|
const headings = parseBooleanFlag("--headings", parsed.flags["--headings"]);
|
|
2965
2999
|
const dryRun = parseBooleanFlag("--dry-run", parsed.flags["--dry-run"]);
|
|
2966
3000
|
const apply = parseBooleanFlag("--apply", parsed.flags["--apply"]);
|
|
3001
|
+
const summary = parseBooleanFlag("--summary", parsed.flags["--summary"]);
|
|
3002
|
+
const limit = parseNumberFlag("--limit", parsed.flags["--limit"]);
|
|
2967
3003
|
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");
|
|
3004
|
+
if (!headings && (dryRun || apply || json || summary || limit !== undefined)) {
|
|
3005
|
+
throw new errors_1.UsageError("format --dry-run, --apply, --summary, --limit, and --json require --headings");
|
|
2970
3006
|
}
|
|
2971
3007
|
if (dryRun && apply) {
|
|
2972
3008
|
throw new errors_1.UsageError("format --headings cannot use --dry-run and --apply together");
|
|
2973
3009
|
}
|
|
2974
|
-
(0, format_1.runFormatCommand)({ root, headings, dryRun, apply, json });
|
|
3010
|
+
(0, format_1.runFormatCommand)({ root, headings, dryRun, apply, json, summary, limit });
|
|
2975
3011
|
return 0;
|
|
2976
3012
|
case "doctor": {
|
|
2977
3013
|
if (parsed.positionals.length > 1) {
|