@decantr/cli 3.4.1 → 3.4.2
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 +2 -1
- package/dist/bin.js +3 -3
- package/dist/{chunk-33IZQXZH.js → chunk-32WTNJQU.js} +51 -13
- package/dist/{chunk-UGRAHWCG.js → chunk-BDA6TWV3.js} +1 -1
- package/dist/{chunk-BDVI3SSP.js → chunk-PQKTJGYL.js} +31 -1
- package/dist/{health-G7HQCDXX.js → health-U7O6PCLZ.js} +1 -1
- package/dist/index.js +3 -3
- package/dist/{studio-T73T4Q2V.js → studio-X565XJKV.js} +2 -2
- package/dist/{workspace-3AJEXXUL.js → workspace-NE232D4K.js} +2 -2
- package/package.json +2 -2
- package/src/templates/DECANTR.md.template +24 -12
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Use `decantr setup` when you are unsure which path applies. It detects whether t
|
|
|
22
22
|
Use `decantr scan` when you want a zero-commit Brownfield preview. It reads local files, detects framework/routes/styling/static-hosting/assistant-rule signals, previews typed Contract graph readiness in memory when a Decantr contract already exists, reports the contract capsule source-handle count and limit, prints a terminal report, and writes no `.decantr` files or report artifacts. Add `--json` when automation needs the `ScanReportV1` payload.
|
|
23
23
|
Use `decantr new` for a greenfield workspace in a fresh directory. With a starter-kit blueprint or archetype it uses the runnable adapter and Decantr CSS; without certified vocabulary content it creates a contract-only workspace unless you explicitly pass `--adoption=decantr-css`.
|
|
24
24
|
Use `decantr adopt` when you already have an app and want Decantr governance without adopting a blueprint. Brownfield attach is proposal-driven: Decantr inventories the app, writes an observed essence proposal, hydrates hosted execution packs when online, and only applies the contract when you explicitly accept or merge it.
|
|
25
|
-
Use `decantr doctor` when the next step is unclear, `decantr task` before asking an LLM to modify a route, `decantr verify` after the edit, and `decantr ci` in required automation. Use `decantr graph` when you want the Decantr 3 typed Contract graph, typed graph diff summary, manifest, content-addressed snapshot history, and cache-friendly contract capsule written under `.decantr/graph`; the capsule includes a bounded SourceArtifact path index so agents can discover valid file-impact handles without reading the full snapshot, and `--capsule-source-limit <count>` can tune that index for large repos. Add `--route /feed --task "improve loading" --json` when you want the exact task-ranked route-scoped subgraph an agent should inspect before editing, `--node cmp:button --impact --json` when you need the graph-shaped blast radius for a component, token, rule, finding, or source artifact, or `--file src/app/page.tsx --impact --json` when the agent knows the source file it is about to change. Use `--snapshot-id <id>` to inspect a replayable history snapshot and `--compare-to <id> --include-diff-ops --json` to compare the selected/current graph against a prior snapshot. Use `decantr codify --from-audit --style-bridge` when you want project-owned UI patterns, optional `behavior_obligations`, local rules, and token/class bridge mappings such as button/card/shell/theme standards to appear in future task context and verification. Once accepted, that local law is the first Hybrid lane: the app still owns source and styling, but Decantr treats accepted local patterns, behavior obligations, rules, and style bridge mappings as project authority.
|
|
25
|
+
Use `decantr studio` after adoption when you want a local visual view of routes, findings, and attention areas. Use `decantr doctor` when the next step is unclear, `decantr task <route> "<intent>"` before asking an LLM to modify a route, `decantr verify` after the edit, and `decantr ci` in required automation. If runtime source and Decantr context disagree, report the drift instead of guessing; in Brownfield the existing source is observed truth, accepted local law/style bridge is project authority where present, Essence V4 is the structural contract, and hosted packs stay advisory until mapped into local law. Use `decantr graph` when you want the Decantr 3 typed Contract graph, typed graph diff summary, manifest, content-addressed snapshot history, and cache-friendly contract capsule written under `.decantr/graph`; the capsule includes a bounded SourceArtifact path index so agents can discover valid file-impact handles without reading the full snapshot, and `--capsule-source-limit <count>` can tune that index for large repos. Add `--route /feed --task "improve loading" --json` when you want the exact task-ranked route-scoped subgraph an agent should inspect before editing, `--node cmp:button --impact --json` when you need the graph-shaped blast radius for a component, token, rule, finding, or source artifact, or `--file src/app/page.tsx --impact --json` when the agent knows the source file it is about to change. Use `--snapshot-id <id>` to inspect a replayable history snapshot and `--compare-to <id> --include-diff-ops --json` to compare the selected/current graph against a prior snapshot. Use `decantr codify --from-audit --style-bridge` when you want project-owned UI patterns, optional `behavior_obligations`, local rules, and token/class bridge mappings such as button/card/shell/theme standards to appear in future task context and verification. Once accepted, that local law is the first Hybrid lane: the app still owns source and styling, but Decantr treats accepted local patterns, behavior obligations, rules, and style bridge mappings as project authority.
|
|
26
26
|
In monorepos, app-scoped commands accept `--project <app-path>`. `setup` shows attach guidance before adoption and the day-two loop after adoption. Hosted pack hydration also follows the essence path: `decantr registry compile-packs apps/web/decantr.essence.json --write-context` writes into `apps/web/.decantr/context`. In contract-only/offline Brownfield, deferred hosted packs are optional context unless a present manifest references missing files.
|
|
27
27
|
Use `decantr init`, `decantr analyze`, `decantr check`, and `decantr health` as advanced primitives when you need direct control over one step.
|
|
28
28
|
|
|
@@ -46,6 +46,7 @@ decantr setup
|
|
|
46
46
|
decantr scan
|
|
47
47
|
decantr scan --project apps/web --json
|
|
48
48
|
decantr adopt --yes
|
|
49
|
+
decantr studio
|
|
49
50
|
decantr doctor
|
|
50
51
|
decantr ci --fail-on error
|
|
51
52
|
decantr ci init
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-32WTNJQU.js";
|
|
3
3
|
import "./chunk-SIDKK73N.js";
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-BDA6TWV3.js";
|
|
5
|
+
import "./chunk-PQKTJGYL.js";
|
|
6
6
|
import "./chunk-2GCVVEQC.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
listWorkspaceCandidates,
|
|
23
23
|
listWorkspaceProjects,
|
|
24
24
|
shouldFailWorkspaceHealth
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-BDA6TWV3.js";
|
|
26
26
|
import {
|
|
27
27
|
acceptBrownfieldLocalLaw,
|
|
28
28
|
acceptStyleBridge,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
writeBrownfieldCodifyProposal,
|
|
53
53
|
writeHostedPatternMappingProposal,
|
|
54
54
|
writeStyleBridgeProposal
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-PQKTJGYL.js";
|
|
56
56
|
import {
|
|
57
57
|
buildGuardRegistryContext,
|
|
58
58
|
createDoctrineMap,
|
|
@@ -188,11 +188,14 @@ function buildAssistantBridgeContent(input) {
|
|
|
188
188
|
lines.push("## Suggested Rule Block");
|
|
189
189
|
lines.push("");
|
|
190
190
|
lines.push(START);
|
|
191
|
+
lines.push(
|
|
192
|
+
'Before editing any route, run `decantr task <route> "<intent>"` and use the printed authority block, read targets, local law, evidence, and verify command as the working contract.'
|
|
193
|
+
);
|
|
191
194
|
lines.push(
|
|
192
195
|
"Before implementing Decantr-scoped work, read `decantr.essence.json`, `.decantr/brownfield-report.md`, `.decantr/doctrine-map.json`, `.decantr/ambient-context.json`, and the compiled packs in `.decantr/context/`."
|
|
193
196
|
);
|
|
194
197
|
lines.push(
|
|
195
|
-
"Treat Decantr as the reconciled contract layer and the original project docs/rules as cited evidence; if
|
|
198
|
+
"Treat Decantr as the reconciled contract layer and the original project docs/rules as cited evidence; if runtime source and Decantr context conflict, stop and report the drift instead of guessing which side wins."
|
|
196
199
|
);
|
|
197
200
|
lines.push(
|
|
198
201
|
"For brownfield adoption, preserve existing framework, routing, styling, package manager, data boundaries, and build conventions unless the Decantr contract explicitly records a reviewed change."
|
|
@@ -215,8 +218,9 @@ function writeAssistantBridgePreview(input) {
|
|
|
215
218
|
function bridgeBlock() {
|
|
216
219
|
return [
|
|
217
220
|
START,
|
|
221
|
+
'Before editing any route, run `decantr task <route> "<intent>"` and use the printed authority block, read targets, local law, evidence, and verify command as the working contract.',
|
|
218
222
|
"Before implementing Decantr-scoped work, read `decantr.essence.json`, `.decantr/brownfield-report.md`, `.decantr/doctrine-map.json`, `.decantr/ambient-context.json`, and `.decantr/context/scaffold-pack.md` first.",
|
|
219
|
-
"Treat Decantr as the reconciled contract layer and the original project docs/rules as cited evidence; if
|
|
223
|
+
"Treat Decantr as the reconciled contract layer and the original project docs/rules as cited evidence; if runtime source and Decantr context conflict, stop and report the drift instead of guessing which side wins.",
|
|
220
224
|
"For brownfield adoption, preserve existing framework, routing, styling, package manager, data boundaries, and build conventions unless the Decantr contract explicitly records a reviewed change.",
|
|
221
225
|
"Do not install `@decantr/css` or rewrite styling unless the project adoption mode says `decantr-css` or the task explicitly asks for it.",
|
|
222
226
|
END,
|
|
@@ -3585,7 +3589,7 @@ function formatLocalLawText(summary, health) {
|
|
|
3585
3589
|
lines.push(` ${DIM3}[WARN] ${warning}${RESET3}`);
|
|
3586
3590
|
}
|
|
3587
3591
|
for (const finding of summary.findings.slice(0, 8)) {
|
|
3588
|
-
const label = finding.severity.
|
|
3592
|
+
const label = finding.severity === "error" ? "Local law error" : finding.severity === "warn" ? "Local law warning" : "Local law info";
|
|
3589
3593
|
lines.push(
|
|
3590
3594
|
` [${label}] ${finding.ruleId} ${finding.file}:${finding.line}:${finding.column} ${finding.message}`
|
|
3591
3595
|
);
|
|
@@ -10448,6 +10452,18 @@ function printWorkflowPlan(title, steps) {
|
|
|
10448
10452
|
}
|
|
10449
10453
|
console.log("");
|
|
10450
10454
|
}
|
|
10455
|
+
function studioCommandForProject(projectArg) {
|
|
10456
|
+
return projectArg ? `cd ${projectArg} && decantr studio` : "decantr studio";
|
|
10457
|
+
}
|
|
10458
|
+
function formatWhichCommandFirst(projectArg) {
|
|
10459
|
+
return [
|
|
10460
|
+
`${BOLD9}Which command first?${RESET16}`,
|
|
10461
|
+
` ${cyan3(withProject("decantr scan", projectArg))} Existing app, read-only preview`,
|
|
10462
|
+
` ${cyan3(withProject("decantr adopt --yes", projectArg))} Existing app, attach Decantr`,
|
|
10463
|
+
` ${cyan3("decantr new my-app --blueprint=<slug>")} New runnable app`,
|
|
10464
|
+
` ${cyan3(withProject("decantr init --existing", projectArg))} Advanced attach primitive`
|
|
10465
|
+
].join("\n");
|
|
10466
|
+
}
|
|
10451
10467
|
function scanSeverityColor(finding) {
|
|
10452
10468
|
if (finding.severity === "success") return success3("ok");
|
|
10453
10469
|
if (finding.severity === "error") return error2("error");
|
|
@@ -10583,7 +10599,7 @@ function printScanGraphPreview(preview) {
|
|
|
10583
10599
|
}
|
|
10584
10600
|
console.log("");
|
|
10585
10601
|
}
|
|
10586
|
-
function printScanReport(report) {
|
|
10602
|
+
function printScanReport(report, projectArg) {
|
|
10587
10603
|
console.log(heading2("Decantr Scan"));
|
|
10588
10604
|
console.log(dim3("Read-only Brownfield reconnaissance. No files were written."));
|
|
10589
10605
|
console.log("");
|
|
@@ -10655,6 +10671,19 @@ function printScanReport(report) {
|
|
|
10655
10671
|
}
|
|
10656
10672
|
console.log("");
|
|
10657
10673
|
console.log(dim3(report.privacy.notes[0] ?? "Scan completed without writing files."));
|
|
10674
|
+
console.log(
|
|
10675
|
+
dim3(
|
|
10676
|
+
"This scan was read-only: no Decantr files, dependencies, scripts, uploads, or reports were created."
|
|
10677
|
+
)
|
|
10678
|
+
);
|
|
10679
|
+
if (report.applicability.status !== "not_applicable") {
|
|
10680
|
+
console.log(
|
|
10681
|
+
`When ready to attach Decantr, run ${cyan3(withProject("decantr adopt --yes", projectArg))}.`
|
|
10682
|
+
);
|
|
10683
|
+
console.log(
|
|
10684
|
+
`After adoption, inspect what Decantr found with ${cyan3(studioCommandForProject(projectArg))}.`
|
|
10685
|
+
);
|
|
10686
|
+
}
|
|
10658
10687
|
}
|
|
10659
10688
|
async function cmdScanWorkflow(args) {
|
|
10660
10689
|
const { flags } = parseLooseArgs(args);
|
|
@@ -10673,7 +10702,7 @@ async function cmdScanWorkflow(args) {
|
|
|
10673
10702
|
console.log(JSON.stringify(reportWithGraph, null, 2));
|
|
10674
10703
|
return;
|
|
10675
10704
|
}
|
|
10676
|
-
printScanReport(reportWithGraph);
|
|
10705
|
+
printScanReport(reportWithGraph, projectArg);
|
|
10677
10706
|
}
|
|
10678
10707
|
async function cmdSetupWorkflow(args) {
|
|
10679
10708
|
const { flags } = parseLooseArgs(args);
|
|
@@ -10859,7 +10888,7 @@ async function cmdAdoptWorkflow(args) {
|
|
|
10859
10888
|
await cmdGraph(projectRoot, { displayRoot: process.cwd() });
|
|
10860
10889
|
if (process.exitCode && process.exitCode !== 0) return;
|
|
10861
10890
|
if (runVerify) {
|
|
10862
|
-
const { cmdHealth } = await import("./health-
|
|
10891
|
+
const { cmdHealth } = await import("./health-U7O6PCLZ.js");
|
|
10863
10892
|
await cmdHealth(projectRoot, {
|
|
10864
10893
|
browser: runBrowser,
|
|
10865
10894
|
browserBaseUrl: baseUrl,
|
|
@@ -10888,6 +10917,9 @@ async function cmdAdoptWorkflow(args) {
|
|
|
10888
10917
|
console.log(
|
|
10889
10918
|
` ${cyan3(withProject("decantr verify --brownfield --local-patterns", projectArg))} Check contract, health, and local law after edits`
|
|
10890
10919
|
);
|
|
10920
|
+
console.log(
|
|
10921
|
+
` ${cyan3(studioCommandForProject(projectArg))} Inspect routes, findings, and attention areas visually`
|
|
10922
|
+
);
|
|
10891
10923
|
console.log(
|
|
10892
10924
|
` ${cyan3(withProject("decantr verify --since-baseline", projectArg))} Compare future work against this baseline`
|
|
10893
10925
|
);
|
|
@@ -10930,7 +10962,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
10930
10962
|
return;
|
|
10931
10963
|
}
|
|
10932
10964
|
if (workspaceMode) {
|
|
10933
|
-
const { cmdWorkspace } = await import("./workspace-
|
|
10965
|
+
const { cmdWorkspace } = await import("./workspace-NE232D4K.js");
|
|
10934
10966
|
await cmdWorkspace(process.cwd(), ["workspace", "health", ...withoutWorkflowOnlyFlags(args)]);
|
|
10935
10967
|
return;
|
|
10936
10968
|
}
|
|
@@ -10973,7 +11005,7 @@ async function cmdVerifyWorkflow(args) {
|
|
|
10973
11005
|
process.exitCode = void 0;
|
|
10974
11006
|
}
|
|
10975
11007
|
}
|
|
10976
|
-
const { cmdHealth, parseHealthArgs } = await import("./health-
|
|
11008
|
+
const { cmdHealth, parseHealthArgs } = await import("./health-U7O6PCLZ.js");
|
|
10977
11009
|
await cmdHealth(workspaceInfo.appRoot, parseHealthArgs(healthArgs));
|
|
10978
11010
|
if (localPatterns) {
|
|
10979
11011
|
const validation = validateLocalLaw(workspaceInfo.appRoot);
|
|
@@ -11708,6 +11740,8 @@ ${BOLD9}Usage:${RESET16}
|
|
|
11708
11740
|
decantr codify [--from-audit] [--style-bridge] [--map-pattern <slug>] [--accept] [--project <path>]
|
|
11709
11741
|
decantr studio [--port 4319] [--host 127.0.0.1] [--report decantr-health.json] [--workspace]
|
|
11710
11742
|
|
|
11743
|
+
${formatWhichCommandFirst()}
|
|
11744
|
+
|
|
11711
11745
|
${BOLD9}Advanced primitives:${RESET16}
|
|
11712
11746
|
decantr init [options]
|
|
11713
11747
|
decantr analyze
|
|
@@ -11935,6 +11969,8 @@ ${BOLD9}Behavior:${RESET16}
|
|
|
11935
11969
|
and prints a terminal report. It does not write .decantr files, install dependencies,
|
|
11936
11970
|
build the app, execute scripts, upload source, or open pull requests.
|
|
11937
11971
|
|
|
11972
|
+
${formatWhichCommandFirst()}
|
|
11973
|
+
|
|
11938
11974
|
${BOLD9}Examples:${RESET16}
|
|
11939
11975
|
decantr scan
|
|
11940
11976
|
decantr scan --project apps/web
|
|
@@ -12093,6 +12129,8 @@ ${BOLD9}decantr setup${RESET16} \u2014 Detect the project state and recommend th
|
|
|
12093
12129
|
${BOLD9}Usage:${RESET16}
|
|
12094
12130
|
decantr setup [--project <path>]
|
|
12095
12131
|
|
|
12132
|
+
${formatWhichCommandFirst()}
|
|
12133
|
+
|
|
12096
12134
|
${BOLD9}Examples:${RESET16}
|
|
12097
12135
|
decantr setup
|
|
12098
12136
|
decantr setup --project apps/web
|
|
@@ -12501,7 +12539,7 @@ async function main() {
|
|
|
12501
12539
|
const { flags } = parseLooseArgs(args);
|
|
12502
12540
|
const workspaceInfo = resolveWorkflowProject(flags, "health");
|
|
12503
12541
|
if (!workspaceInfo) break;
|
|
12504
|
-
const { cmdHealth, parseHealthArgs } = await import("./health-
|
|
12542
|
+
const { cmdHealth, parseHealthArgs } = await import("./health-U7O6PCLZ.js");
|
|
12505
12543
|
await cmdHealth(workspaceInfo.appRoot, parseHealthArgs(stripProjectArgs(args)));
|
|
12506
12544
|
} catch (e) {
|
|
12507
12545
|
console.error(error2(e.message));
|
|
@@ -12529,7 +12567,7 @@ async function main() {
|
|
|
12529
12567
|
cmdStudioHelp();
|
|
12530
12568
|
break;
|
|
12531
12569
|
}
|
|
12532
|
-
const { cmdStudio, parseStudioArgs } = await import("./studio-
|
|
12570
|
+
const { cmdStudio, parseStudioArgs } = await import("./studio-X565XJKV.js");
|
|
12533
12571
|
await cmdStudio(process.cwd(), parseStudioArgs(args));
|
|
12534
12572
|
} catch (e) {
|
|
12535
12573
|
console.error(error2(e.message));
|
|
@@ -12543,7 +12581,7 @@ async function main() {
|
|
|
12543
12581
|
cmdWorkspaceHelp();
|
|
12544
12582
|
break;
|
|
12545
12583
|
}
|
|
12546
|
-
const { cmdWorkspace } = await import("./workspace-
|
|
12584
|
+
const { cmdWorkspace } = await import("./workspace-NE232D4K.js");
|
|
12547
12585
|
await cmdWorkspace(process.cwd(), args);
|
|
12548
12586
|
} catch (e) {
|
|
12549
12587
|
console.error(error2(e.message));
|
|
@@ -4907,6 +4907,36 @@ function colorForStatus(status) {
|
|
|
4907
4907
|
if (status === "warning") return YELLOW;
|
|
4908
4908
|
return RED2;
|
|
4909
4909
|
}
|
|
4910
|
+
var DNA_RULES = /* @__PURE__ */ new Set(["style", "density", "accessibility", "theme-mode", "theme"]);
|
|
4911
|
+
var BLUEPRINT_RULES = /* @__PURE__ */ new Set([
|
|
4912
|
+
"structure",
|
|
4913
|
+
"layout",
|
|
4914
|
+
"pattern-exists",
|
|
4915
|
+
"page-route-required",
|
|
4916
|
+
"page-pack-count-mismatch"
|
|
4917
|
+
]);
|
|
4918
|
+
function formatHumanFindingLabel(finding) {
|
|
4919
|
+
const severity = finding.severity;
|
|
4920
|
+
const rule = finding.rule?.toLowerCase() ?? "";
|
|
4921
|
+
const category = finding.category.toLowerCase();
|
|
4922
|
+
const source = finding.source;
|
|
4923
|
+
if (source === "brownfield" || rule.startsWith("brownfield-")) {
|
|
4924
|
+
return "Brownfield drift";
|
|
4925
|
+
}
|
|
4926
|
+
if (source === "style-bridge") {
|
|
4927
|
+
return `Style bridge ${severity}`;
|
|
4928
|
+
}
|
|
4929
|
+
if (source === "interaction") {
|
|
4930
|
+
return `Interaction ${severity}`;
|
|
4931
|
+
}
|
|
4932
|
+
if (DNA_RULES.has(rule) || category.includes("dna")) {
|
|
4933
|
+
return `DNA ${severity}`;
|
|
4934
|
+
}
|
|
4935
|
+
if (BLUEPRINT_RULES.has(rule) || category.includes("blueprint")) {
|
|
4936
|
+
return `Blueprint ${severity === "error" ? "error" : "warning"}`;
|
|
4937
|
+
}
|
|
4938
|
+
return severity.toUpperCase();
|
|
4939
|
+
}
|
|
4910
4940
|
function formatProjectHealthText(report) {
|
|
4911
4941
|
const color = colorForStatus(report.status);
|
|
4912
4942
|
const commandContext = commandContextForProject(report.projectRoot);
|
|
@@ -4932,7 +4962,7 @@ function formatProjectHealthText(report) {
|
|
|
4932
4962
|
for (const finding of report.findings) {
|
|
4933
4963
|
const findingColor = finding.severity === "error" ? RED2 : finding.severity === "warn" ? YELLOW : CYAN;
|
|
4934
4964
|
lines.push(
|
|
4935
|
-
` ${findingColor}[${finding
|
|
4965
|
+
` ${findingColor}[${formatHumanFindingLabel(finding)}]${RESET2} ${finding.id}: ${finding.message}`
|
|
4936
4966
|
);
|
|
4937
4967
|
if (finding.evidence.length > 0) {
|
|
4938
4968
|
lines.push(` ${DIM2}${finding.evidence[0]}${RESET2}`);
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkspaceHealthReport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BDA6TWV3.js";
|
|
4
4
|
import {
|
|
5
5
|
createProjectHealthReport
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PQKTJGYL.js";
|
|
7
7
|
import {
|
|
8
8
|
sendStudioHealthRefreshedTelemetry,
|
|
9
9
|
sendStudioStartedTelemetry
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
listWorkspaceProjects,
|
|
8
8
|
parseWorkspaceArgs,
|
|
9
9
|
shouldFailWorkspaceHealth
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-BDA6TWV3.js";
|
|
11
|
+
import "./chunk-PQKTJGYL.js";
|
|
12
12
|
import "./chunk-2GCVVEQC.js";
|
|
13
13
|
export {
|
|
14
14
|
cmdWorkspace,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/cli",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.2",
|
|
4
4
|
"description": "Decantr CLI - adopt, verify, graph, and govern frontend codebases touched by AI agents",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"decantr",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"ajv": "^8.20.0",
|
|
52
52
|
"@decantr/core": "3.4.0",
|
|
53
|
-
"@decantr/registry": "3.4.0",
|
|
54
53
|
"@decantr/essence-spec": "3.4.0",
|
|
54
|
+
"@decantr/registry": "3.4.0",
|
|
55
55
|
"@decantr/telemetry": "3.4.0",
|
|
56
56
|
"@decantr/verifier": "3.4.1"
|
|
57
57
|
},
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This project uses **Decantr** for AI Frontend Governance. Read this file before generating or editing UI code.
|
|
4
4
|
|
|
5
|
+
**Before editing any route, run `decantr task <route> "<intent>"`.** Use that task context as the working contract for the edit. If you are an AI assistant, do not start route-level source changes until task context has been loaded or the user explicitly tells you to proceed without it.
|
|
6
|
+
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## What is Decantr?
|
|
@@ -16,13 +18,13 @@ Decantr is a Contract / Context / Evidence layer that sits between you (the AI c
|
|
|
16
18
|
|
|
17
19
|
### DNA (Design Axioms)
|
|
18
20
|
|
|
19
|
-
DNA defines the foundational design rules. **DNA violations are errors** -- they must never happen without updating the essence first.
|
|
21
|
+
DNA defines the foundational design rules. **DNA violations are blocking contract errors** -- they must never happen without updating the essence first.
|
|
20
22
|
|
|
21
23
|
DNA axioms include: Theme (id, mode, shape), Spacing (density, content gap), Typography (scale, weights), Color (palette, accent count), Radius (philosophy, base), Elevation (system, levels), Motion (preference, reduce-motion), Accessibility (WCAG level, focus-visible), and Personality traits.
|
|
22
24
|
|
|
23
25
|
### Blueprint (Structural Layout)
|
|
24
26
|
|
|
25
|
-
Blueprint defines sections, pages, routes, features, and pattern layouts. **Blueprint deviations are warnings** -- they should be corrected but do not block generation.
|
|
27
|
+
Blueprint defines sections, pages, routes, features, and pattern layouts. **Blueprint deviations are usually advisory structural warnings** -- they should be corrected or reviewed, but they do not normally block generation unless the active workflow makes them strict.
|
|
26
28
|
|
|
27
29
|
Blueprint includes: Sections (grouped by archetype with role, shell, and scoped features), Page definitions with layouts and pattern references, Routes (URL mapping), and Features (resolved from archetype union + blueprint overrides).
|
|
28
30
|
|
|
@@ -82,6 +84,15 @@ When a user request would violate guard rules:
|
|
|
82
84
|
|
|
83
85
|
`decantr.essence.json` is the structural spec. Tools and guards read this.
|
|
84
86
|
|
|
87
|
+
Authority order for this project:
|
|
88
|
+
|
|
89
|
+
1. In Brownfield and Hybrid workflows, the existing production source is the observed implementation truth.
|
|
90
|
+
2. Accepted `.decantr/local-patterns.json`, `.decantr/rules.json`, and `.decantr/style-bridge.json` are project-owned local law where present.
|
|
91
|
+
3. `decantr.essence.json` is the structural contract for routes, sections, DNA, guard mode, and intended product shape.
|
|
92
|
+
4. Hosted registry patterns and execution packs are guidance unless the project maps them into accepted local law.
|
|
93
|
+
|
|
94
|
+
When runtime source and Decantr context disagree, report the drift and run `decantr doctor` or `decantr verify --brownfield --local-patterns`; do not guess which side wins.
|
|
95
|
+
|
|
85
96
|
### Initial scaffolding
|
|
86
97
|
|
|
87
98
|
This project is using Decantr in **{{WORKFLOW_MODE}}** mode.
|
|
@@ -95,6 +106,8 @@ Then read `.decantr/context/section-{name}.md` for the fuller context. Prefer th
|
|
|
95
106
|
|
|
96
107
|
### Working on a route
|
|
97
108
|
|
|
109
|
+
Run `decantr task <route> "<intent>"` before editing. Read the files it lists first and preserve the authority block it prints.
|
|
110
|
+
|
|
98
111
|
Read `.decantr/context/page-{name}-pack.md` for the most local compiled route contract before editing a specific page. Route-local packs should win over broader narrative docs when there is any mismatch.
|
|
99
112
|
|
|
100
113
|
### Editing rules
|
|
@@ -114,21 +127,20 @@ Read `.decantr/context/page-{name}-pack.md` for the most local compiled route co
|
|
|
114
127
|
|
|
115
128
|
### Validation
|
|
116
129
|
|
|
117
|
-
Run `decantr
|
|
118
|
-
Run `decantr health` for the broader Project Health view before handoff, pull requests, or CI. Use `decantr health init-ci` to install the default GitHub Actions health gate, `decantr health --prompt <finding-id>` to generate a scoped remediation prompt for a specific issue, and `decantr studio` to inspect local drift, routes, findings, remediation, CI, and pack state in a localhost dashboard.
|
|
130
|
+
Run `decantr verify` for the broader Project Health view before handoff, pull requests, or CI. Use `decantr ci init` to install the default GitHub Actions gate, `decantr health --prompt <finding-id>` to generate a scoped remediation prompt for a specific issue, and `decantr studio` to inspect local drift, routes, findings, remediation, CI, and pack state in a localhost dashboard.
|
|
119
131
|
Declared command palettes and hotkeys must be implemented, not merely acknowledged.
|
|
120
132
|
|
|
121
133
|
### Quick Commands
|
|
122
134
|
|
|
123
135
|
```bash
|
|
124
|
-
decantr
|
|
125
|
-
decantr
|
|
126
|
-
decantr
|
|
127
|
-
decantr
|
|
128
|
-
decantr
|
|
129
|
-
decantr
|
|
130
|
-
decantr
|
|
131
|
-
decantr
|
|
136
|
+
decantr setup # Detect project state and next workflow step
|
|
137
|
+
decantr scan # Read-only Brownfield preview; writes no files
|
|
138
|
+
decantr adopt --yes # Attach Decantr to an existing app
|
|
139
|
+
decantr doctor # Explain current state, authority, and next steps
|
|
140
|
+
decantr task <route> "<intent>" # Load route/task context before AI edits
|
|
141
|
+
decantr verify --brownfield # Run local Project Health and drift checks
|
|
142
|
+
decantr ci init # Install the pinned CI gate
|
|
143
|
+
decantr studio # Open the local health dashboard
|
|
132
144
|
```
|
|
133
145
|
|
|
134
146
|
---
|