Migrate the audit-uat + audit-open CLI commands from hardcoded gsd-tools.cjs case arms to a registry-dispatched Capability (commandFamilies mechanism, #961), mirroring the graphify cutover (#972). New src/audit-command-router.cts exports routeAuditUat/routeAuditOpen, each lazily requiring only its backing module (uat.cjs/audit.cjs) inside the route fn — matching the old per-case lazy loads. capabilities/audit/capability.json declares the two command families; commands-only (skills:[]), no config gate, audit_review cluster untouched. Behavior-CHANGING (dispatch path) but equivalence-proven: CLI output identical; existing audit regression tests pass unchanged. Closes #981 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
377 lines
7.6 KiB
JavaScript
377 lines
7.6 KiB
JavaScript
'use strict';
|
|
|
|
/**
|
|
* capability-registry.cjs — generated by scripts/gen-capability-registry.cjs
|
|
* DO NOT EDIT BY HAND. Run: node scripts/gen-capability-registry.cjs --write
|
|
* ADR-894 §5 — role-partitioned Capability Registry.
|
|
*/
|
|
|
|
const capabilities = {
|
|
"audit": {
|
|
"id": "audit",
|
|
"role": "feature",
|
|
"title": "Audit",
|
|
"description": "Open-artifact audit and UAT-gap audit for milestone close gates; exposes `gsd-tools audit-uat` (cross-phase UAT outstanding items) and `gsd-tools audit-open` (structured open-artifact scan across debug, tasks, threads, todos, seeds, UAT, verification, context-questions).",
|
|
"tier": "full",
|
|
"requires": [],
|
|
"skills": [],
|
|
"agents": [],
|
|
"config": {},
|
|
"commands": [
|
|
{
|
|
"family": "audit-uat",
|
|
"module": "audit-command-router.cjs",
|
|
"router": "routeAuditUat"
|
|
},
|
|
{
|
|
"family": "audit-open",
|
|
"module": "audit-command-router.cjs",
|
|
"router": "routeAuditOpen"
|
|
}
|
|
],
|
|
"hooks": [],
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"graphify": {
|
|
"id": "graphify",
|
|
"role": "feature",
|
|
"title": "Knowledge graph",
|
|
"description": "Build, query, and inspect the project knowledge graph in `.planning/graphs/`; exposes graphify CLI subcommands (build, query, status, diff) and the /gsd-graphify skill.",
|
|
"tier": "full",
|
|
"requires": [],
|
|
"skills": [
|
|
"graphify"
|
|
],
|
|
"agents": [],
|
|
"config": {
|
|
"graphify.enabled": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Enable the graphify knowledge-graph command + skill."
|
|
}
|
|
},
|
|
"commands": [
|
|
{
|
|
"family": "graphify",
|
|
"module": "graphify-command-router.cjs",
|
|
"router": "routeGraphifyCommand"
|
|
}
|
|
],
|
|
"hooks": [],
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"ui": {
|
|
"id": "ui",
|
|
"role": "feature",
|
|
"title": "UI design contracts",
|
|
"description": "UI-SPEC design contract + retrospective UI audit for frontend phases.",
|
|
"tier": "full",
|
|
"requires": [],
|
|
"skills": [
|
|
"ui-phase",
|
|
"ui-review"
|
|
],
|
|
"agents": [
|
|
"gsd-ui-checker",
|
|
"gsd-ui-auditor"
|
|
],
|
|
"hooks": [],
|
|
"config": {
|
|
"workflow.ui_phase": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Enable the UI design-contract gate during planning."
|
|
},
|
|
"workflow.ui_review": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Enable the retrospective UI audit."
|
|
},
|
|
"workflow.ui_safety_gate": {
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Block execution on unmet UI-SPEC contracts."
|
|
}
|
|
},
|
|
"steps": [
|
|
{
|
|
"point": "plan:pre",
|
|
"ref": {
|
|
"skill": "ui-phase"
|
|
},
|
|
"produces": [
|
|
"UI-SPEC.md"
|
|
],
|
|
"consumes": [
|
|
"CONTEXT.md"
|
|
],
|
|
"when": "workflow.ui_phase",
|
|
"onError": "skip"
|
|
},
|
|
{
|
|
"point": "verify:post",
|
|
"ref": {
|
|
"skill": "ui-review"
|
|
},
|
|
"produces": [
|
|
"UI-REVIEW.md"
|
|
],
|
|
"consumes": [
|
|
"UI-SPEC.md"
|
|
],
|
|
"when": "workflow.ui_review",
|
|
"onError": "skip"
|
|
}
|
|
],
|
|
"contributions": [],
|
|
"gates": [
|
|
{
|
|
"point": "execute:wave:post",
|
|
"check": {
|
|
"query": "ui.safety-gate"
|
|
},
|
|
"when": "workflow.ui_safety_gate",
|
|
"blocking": true,
|
|
"onError": "halt"
|
|
}
|
|
]
|
|
}
|
|
};
|
|
|
|
const bySkill = {
|
|
"graphify": "graphify",
|
|
"ui-phase": "ui",
|
|
"ui-review": "ui"
|
|
};
|
|
|
|
const byAgent = {
|
|
"gsd-ui-checker": "ui",
|
|
"gsd-ui-auditor": "ui"
|
|
};
|
|
|
|
const byLoopPoint = {
|
|
"discuss:pre": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"discuss:post": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"plan:pre": {
|
|
"steps": [
|
|
{
|
|
"capId": "ui",
|
|
"point": "plan:pre",
|
|
"ref": {
|
|
"skill": "ui-phase"
|
|
},
|
|
"produces": [
|
|
"UI-SPEC.md"
|
|
],
|
|
"consumes": [
|
|
"CONTEXT.md"
|
|
],
|
|
"when": "workflow.ui_phase",
|
|
"onError": "skip"
|
|
}
|
|
],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"plan:post": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"execute:pre": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"execute:wave:pre": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"execute:wave:post": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": [
|
|
{
|
|
"capId": "ui",
|
|
"point": "execute:wave:post",
|
|
"check": {
|
|
"query": "ui.safety-gate"
|
|
},
|
|
"when": "workflow.ui_safety_gate",
|
|
"blocking": true,
|
|
"onError": "halt"
|
|
}
|
|
]
|
|
},
|
|
"execute:post": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"verify:pre": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"verify:post": {
|
|
"steps": [
|
|
{
|
|
"capId": "ui",
|
|
"point": "verify:post",
|
|
"ref": {
|
|
"skill": "ui-review"
|
|
},
|
|
"produces": [
|
|
"UI-REVIEW.md"
|
|
],
|
|
"consumes": [
|
|
"UI-SPEC.md"
|
|
],
|
|
"when": "workflow.ui_review",
|
|
"onError": "skip"
|
|
}
|
|
],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"ship:pre": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
},
|
|
"ship:post": {
|
|
"steps": [],
|
|
"contributions": [],
|
|
"gates": []
|
|
}
|
|
};
|
|
|
|
const configKeys = {
|
|
"graphify.enabled": "graphify",
|
|
"workflow.ui_phase": "ui",
|
|
"workflow.ui_review": "ui",
|
|
"workflow.ui_safety_gate": "ui"
|
|
};
|
|
|
|
const configSchema = {
|
|
"graphify.enabled": {
|
|
"owner": "graphify",
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Enable the graphify knowledge-graph command + skill."
|
|
},
|
|
"workflow.ui_phase": {
|
|
"owner": "ui",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Enable the UI design-contract gate during planning."
|
|
},
|
|
"workflow.ui_review": {
|
|
"owner": "ui",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Enable the retrospective UI audit."
|
|
},
|
|
"workflow.ui_safety_gate": {
|
|
"owner": "ui",
|
|
"type": "boolean",
|
|
"default": true,
|
|
"description": "Block execution on unmet UI-SPEC contracts."
|
|
}
|
|
};
|
|
|
|
const runtimes = {};
|
|
|
|
const commandFamilies = {
|
|
"audit-open": {
|
|
"capId": "audit",
|
|
"module": "audit-command-router.cjs",
|
|
"router": "routeAuditOpen"
|
|
},
|
|
"audit-uat": {
|
|
"capId": "audit",
|
|
"module": "audit-command-router.cjs",
|
|
"router": "routeAuditUat"
|
|
},
|
|
"graphify": {
|
|
"capId": "graphify",
|
|
"module": "graphify-command-router.cjs",
|
|
"router": "routeGraphifyCommand"
|
|
}
|
|
};
|
|
|
|
const capabilityClusters = {
|
|
"graphify": [
|
|
"graphify"
|
|
],
|
|
"ui": [
|
|
"ui-phase",
|
|
"ui-review"
|
|
]
|
|
};
|
|
|
|
const profileMembership = {
|
|
"graphify": {
|
|
"tier": "full",
|
|
"profiles": [
|
|
"full"
|
|
]
|
|
},
|
|
"ui": {
|
|
"tier": "full",
|
|
"profiles": [
|
|
"full"
|
|
]
|
|
}
|
|
};
|
|
|
|
const _requiresGraph = {
|
|
"audit": [],
|
|
"graphify": [],
|
|
"ui": []
|
|
};
|
|
|
|
function requiresClosure(id) {
|
|
const visited = new Set();
|
|
const queue = [id];
|
|
while (queue.length > 0) {
|
|
const current = queue.shift();
|
|
const reqs = _requiresGraph[current] || [];
|
|
for (const req of reqs) {
|
|
if (!visited.has(req)) {
|
|
visited.add(req);
|
|
queue.push(req);
|
|
}
|
|
}
|
|
}
|
|
return visited;
|
|
}
|
|
|
|
module.exports = {
|
|
version: '1',
|
|
capabilities,
|
|
bySkill,
|
|
byAgent,
|
|
byLoopPoint,
|
|
configKeys,
|
|
configSchema,
|
|
runtimes,
|
|
commandFamilies,
|
|
capabilityClusters,
|
|
profileMembership,
|
|
requiresClosure,
|
|
};
|