@chemx/starter-kit 26.9.12-93 → 26.9.13-272
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/cli/audit/ai-slop-detector.js +25 -41
- package/cli/audit/ast-visitors.js +10 -13
- package/cli/audit/history.js +45 -11
- package/cli/audit/pattern-detector.js +182 -0
- package/cli/audit/prompts.js +129 -72
- package/cli/audit/reporter-banner.js +4 -16
- package/cli/audit/reporter-grades.js +28 -16
- package/cli/audit/reporter-grouping.d.ts +6 -0
- package/cli/audit/reporter-grouping.js +48 -5
- package/cli/audit/reporter-markdown.js +31 -16
- package/cli/audit/reporter-sections.js +28 -12
- package/cli/audit/reporter-utils.js +88 -1
- package/cli/audit/reporter.d.ts +13 -4
- package/cli/audit/reporter.js +32 -5
- package/cli/audit/roadmap.js +236 -0
- package/cli/audit/rules-predicates.d.ts +17 -0
- package/cli/audit/rules-predicates.js +107 -0
- package/cli/audit/rules.js +6 -2
- package/cli/audit/social-gh.js +2 -6
- package/cli/audit/social-publisher.js +1 -1
- package/cli/audit/social.js +25 -9
- package/cli/audit/types.d.ts +52 -5
- package/cli/audit.js +76 -7
- package/cli/badge.js +9 -2
- package/cli/build/detector.js +68 -0
- package/cli/build/executor.js +58 -0
- package/cli/build/grouper.js +78 -0
- package/cli/build/parser-matchers.js +116 -0
- package/cli/build/parser.js +80 -0
- package/cli/build/reporter.js +66 -0
- package/cli/build/types.d.ts +58 -0
- package/cli/build/types.js +1 -0
- package/cli/build.d.ts +16 -0
- package/cli/build.js +55 -0
- package/cli/help.js +14 -0
- package/cli/index.js +39 -14
- package/cli/installer-templates.js +43 -4
- package/cli/license.js +10 -7
- package/cli/navigator-actions.js +34 -6
- package/cli/navigator-banner.js +4 -2
- package/cli/navigator-menu.js +18 -0
- package/cli/navigator-share.js +1 -1
- package/cli/navigator.d.ts +8 -1
- package/cli/navigator.js +3 -3
- package/cli/terminal.js +6 -5
- package/cli/theme.d.ts +41 -0
- package/cli/theme.js +84 -0
- package/docs/CHANGELOG.md +46 -0
- package/package.json +3 -2
package/cli/navigator-actions.js
CHANGED
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
buildAiSlopPrompt,
|
|
30
30
|
buildHotspotsPrompt,
|
|
31
31
|
buildMasterPrompt,
|
|
32
|
+
formatRoadmapSection,
|
|
33
|
+
buildSelfHealingRoadmapPrompt,
|
|
32
34
|
copyToClipboard
|
|
33
35
|
} from "./audit.js";
|
|
34
36
|
import { resolveGradeBadge } from "./navigator-grades.js";
|
|
@@ -43,20 +45,23 @@ const isExtremeMonolith = (h) => h.lineCount >= 2000;
|
|
|
43
45
|
const isSevereMonolith = (h) => h.lineCount >= 1000 && h.lineCount < 2000;
|
|
44
46
|
const isWarningMonolith = (h) => h.lineCount >= 500 && h.lineCount < 1000;
|
|
45
47
|
const isPassedPillar = (p) => p.status === "PASSED";
|
|
46
|
-
const
|
|
48
|
+
const isFailedPillar = (p) => p.status === "FAILED";
|
|
49
|
+
const isWarnPillar = (p) => p.status === "WARN";
|
|
47
50
|
|
|
48
51
|
export const buildActiveGrades = (report) => {
|
|
49
52
|
const { hotspots, violations, pillars } = report;
|
|
50
53
|
const { critical, high, medium, low } = groupViolationsBySeverity(violations);
|
|
51
54
|
|
|
52
55
|
const passedPillarsCount = Object.values(pillars || {}).filter(isPassedPillar).length;
|
|
56
|
+
const failedPillarsCount = Object.values(pillars || {}).filter(isFailedPillar).length;
|
|
57
|
+
const warnPillarsCount = Object.values(pillars || {}).filter(isWarnPillar).length;
|
|
53
58
|
|
|
54
59
|
const extremeMonoliths = hotspots.filter(isExtremeMonolith);
|
|
55
60
|
const severeMonoliths = hotspots.filter(isSevereMonolith);
|
|
56
61
|
const warningMonoliths = hotspots.filter(isWarningMonolith);
|
|
57
62
|
|
|
58
|
-
const gradeFCount = critical.length + extremeMonoliths.length;
|
|
59
|
-
const gradeDCount = high.length + severeMonoliths.length;
|
|
63
|
+
const gradeFCount = critical.length + extremeMonoliths.length + failedPillarsCount;
|
|
64
|
+
const gradeDCount = high.length + severeMonoliths.length + warnPillarsCount;
|
|
60
65
|
const gradeCCount = medium.length + warningMonoliths.length;
|
|
61
66
|
const gradeBCount = low.length;
|
|
62
67
|
const gradeACount = passedPillarsCount;
|
|
@@ -83,6 +88,7 @@ export const buildActiveGrades = (report) => {
|
|
|
83
88
|
|
|
84
89
|
const gradeTiers = [
|
|
85
90
|
{
|
|
91
|
+
key: "grade_a",
|
|
86
92
|
grade: "A",
|
|
87
93
|
count: gradeACount,
|
|
88
94
|
icon: "✅",
|
|
@@ -90,6 +96,7 @@ export const buildActiveGrades = (report) => {
|
|
|
90
96
|
action: handleGradeAAction
|
|
91
97
|
},
|
|
92
98
|
{
|
|
99
|
+
key: "grade_slop",
|
|
93
100
|
grade: report.aiSlop?.grade || (slopViolations.length > 0 ? "D" : "A"),
|
|
94
101
|
count: slopViolations.length,
|
|
95
102
|
icon: "🤖",
|
|
@@ -97,6 +104,7 @@ export const buildActiveGrades = (report) => {
|
|
|
97
104
|
action: handleSlopAction
|
|
98
105
|
},
|
|
99
106
|
{
|
|
107
|
+
key: "grade_b",
|
|
100
108
|
grade: "B",
|
|
101
109
|
count: gradeBCount,
|
|
102
110
|
icon: "💣",
|
|
@@ -104,6 +112,7 @@ export const buildActiveGrades = (report) => {
|
|
|
104
112
|
action: handleGradeBAction
|
|
105
113
|
},
|
|
106
114
|
{
|
|
115
|
+
key: "grade_c",
|
|
107
116
|
grade: "C",
|
|
108
117
|
count: gradeCCount,
|
|
109
118
|
icon: "⚡",
|
|
@@ -111,6 +120,7 @@ export const buildActiveGrades = (report) => {
|
|
|
111
120
|
action: handleGradeCAction
|
|
112
121
|
},
|
|
113
122
|
{
|
|
123
|
+
key: "grade_d",
|
|
114
124
|
grade: "D",
|
|
115
125
|
count: gradeDCount,
|
|
116
126
|
icon: "🔥",
|
|
@@ -118,6 +128,7 @@ export const buildActiveGrades = (report) => {
|
|
|
118
128
|
action: handleGradeDAction
|
|
119
129
|
},
|
|
120
130
|
{
|
|
131
|
+
key: "grade_f",
|
|
121
132
|
grade: "F",
|
|
122
133
|
count: gradeFCount,
|
|
123
134
|
icon: "💥",
|
|
@@ -127,14 +138,14 @@ export const buildActiveGrades = (report) => {
|
|
|
127
138
|
];
|
|
128
139
|
|
|
129
140
|
const createActiveGradeItem = (g) => ({
|
|
130
|
-
key: `grade_${g.grade.toLowerCase()}`,
|
|
141
|
+
key: g.key || `grade_${g.grade.toLowerCase()}`,
|
|
131
142
|
grade: g.grade.toLowerCase(),
|
|
132
143
|
tag: resolveGradeBadge(g.grade, 11),
|
|
133
144
|
label: `${g.icon} Grade ${g.grade}: ${g.description} (${g.count} ${g.grade === "A" ? "clean" : "items"})`,
|
|
134
145
|
action: g.action
|
|
135
146
|
});
|
|
136
147
|
|
|
137
|
-
return gradeTiers.
|
|
148
|
+
return gradeTiers.map(createActiveGradeItem);
|
|
138
149
|
};
|
|
139
150
|
|
|
140
151
|
export const buildDashboardActionGroups = ({ report, onScaffold = null, onRerun = null }) => {
|
|
@@ -149,6 +160,10 @@ export const buildDashboardActionGroups = ({ report, onScaffold = null, onRerun
|
|
|
149
160
|
await showConversionMenu(onScaffold);
|
|
150
161
|
};
|
|
151
162
|
|
|
163
|
+
const handleRoadmapAction = async () => {
|
|
164
|
+
await showPagedContent(formatRoadmapSection(report), buildSelfHealingRoadmapPrompt(report));
|
|
165
|
+
};
|
|
166
|
+
|
|
152
167
|
const handleReportAction = async () => {
|
|
153
168
|
await showPagedContent(formatTerminalReport(report), buildMasterPrompt(report));
|
|
154
169
|
};
|
|
@@ -173,7 +188,12 @@ export const buildDashboardActionGroups = ({ report, onScaffold = null, onRerun
|
|
|
173
188
|
output += formatTransformationTerminal(baseline, currentSnapshot);
|
|
174
189
|
} else {
|
|
175
190
|
output +=
|
|
176
|
-
"\n\x1b[33mNo baseline audit found. Current audit established as baseline.\x1b[0m\n";
|
|
191
|
+
"\n\x1b[33mNo baseline audit found. Current audit established as baseline floor.\x1b[0m\n";
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const previousSnapshot = history.length > 1 ? history[history.length - 2] : null;
|
|
195
|
+
if (previousSnapshot && previousSnapshot.id !== baseline?.id) {
|
|
196
|
+
output += "\n\n" + formatTransformationTerminal(previousSnapshot, currentSnapshot, { isStepDelta: true });
|
|
177
197
|
}
|
|
178
198
|
|
|
179
199
|
if (history.length > 0) {
|
|
@@ -256,6 +276,13 @@ export const buildDashboardActionGroups = ({ report, onScaffold = null, onRerun
|
|
|
256
276
|
action: handleUpgradeAction
|
|
257
277
|
};
|
|
258
278
|
|
|
279
|
+
const roadmapAction = {
|
|
280
|
+
key: "roadmap",
|
|
281
|
+
tag: formatButtonTag("Roadmap", "\x1b[38;2;45;212;191m"),
|
|
282
|
+
label: "🌱 Self-Healing Fix Roadmap (Optimal Remediation Order & Pattern Harvesting)",
|
|
283
|
+
action: handleRoadmapAction
|
|
284
|
+
};
|
|
285
|
+
|
|
259
286
|
const reportAction = {
|
|
260
287
|
key: "report",
|
|
261
288
|
tag: formatButtonTag("Full Report", "\x1b[36m"),
|
|
@@ -320,6 +347,7 @@ export const buildDashboardActionGroups = ({ report, onScaffold = null, onRerun
|
|
|
320
347
|
|
|
321
348
|
return {
|
|
322
349
|
installAction,
|
|
350
|
+
roadmapAction,
|
|
323
351
|
upgradeAction,
|
|
324
352
|
reportAction,
|
|
325
353
|
rerunAction,
|
package/cli/navigator-banner.js
CHANGED
|
@@ -38,9 +38,11 @@ export const renderDashboardBanner = (
|
|
|
38
38
|
highMediumCount,
|
|
39
39
|
low,
|
|
40
40
|
contextAnalysis = null,
|
|
41
|
-
aiSlop = null
|
|
41
|
+
aiSlop = null,
|
|
42
|
+
options = {}
|
|
42
43
|
) => {
|
|
43
|
-
|
|
44
|
+
const shouldClear = options.clear ?? Boolean(options.interactive && process.stdout.isTTY);
|
|
45
|
+
if (shouldClear && process.stdout.isTTY) console.clear();
|
|
44
46
|
process.stdout.write(getChemicalXAsciiBanner(health.grade));
|
|
45
47
|
|
|
46
48
|
const gColor = resolveGradeColor(health.grade);
|
package/cli/navigator-menu.js
CHANGED
|
@@ -51,6 +51,12 @@ const isChoiceMatchingItem = (cleanChoice) => (item) => {
|
|
|
51
51
|
) {
|
|
52
52
|
return true;
|
|
53
53
|
}
|
|
54
|
+
if (
|
|
55
|
+
item.key === "roadmap" &&
|
|
56
|
+
(cleanChoice.includes("Roadmap") || cleanChoice.includes("Healing") || cleanChoice.includes("Self-Healing"))
|
|
57
|
+
) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
54
60
|
if (
|
|
55
61
|
item.key === "rerun" &&
|
|
56
62
|
(cleanChoice.includes("Re-Run") ||
|
|
@@ -99,6 +105,12 @@ const isChoiceMatchingItem = (cleanChoice) => (item) => {
|
|
|
99
105
|
) {
|
|
100
106
|
return true;
|
|
101
107
|
}
|
|
108
|
+
if (
|
|
109
|
+
item.key === "grade_slop" &&
|
|
110
|
+
(cleanChoice.includes("Slop") || cleanChoice.includes("Authenticity") || cleanChoice.includes("ASI"))
|
|
111
|
+
) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
102
114
|
if (
|
|
103
115
|
item.grade &&
|
|
104
116
|
(cleanChoice.toLowerCase().includes(`grade ${item.grade}`) ||
|
|
@@ -150,6 +162,12 @@ const isEffectiveMatchingItem = (effective, exitIndex) => (item) => {
|
|
|
150
162
|
) {
|
|
151
163
|
return true;
|
|
152
164
|
}
|
|
165
|
+
if (
|
|
166
|
+
item.key === "grade_slop" &&
|
|
167
|
+
(effective === "slop" || effective === "asi" || effective === "authenticity")
|
|
168
|
+
) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
153
171
|
if (item.key === effective) return true;
|
|
154
172
|
if (item.grade && (effective === item.grade || effective === `grade ${item.grade}`)) {
|
|
155
173
|
return true;
|
package/cli/navigator-share.js
CHANGED
|
@@ -107,7 +107,7 @@ export const handleShareToDiscussions = async (report) => {
|
|
|
107
107
|
if (pubResult.success && pubResult.url) {
|
|
108
108
|
if (pubResult.updated) {
|
|
109
109
|
process.stdout.write(`\n\x1b[1m\x1b[32m✔ Successfully updated discussion topic #${pubResult.discussionNumber}!\x1b[0m\n`);
|
|
110
|
-
process.stdout.write(' \x1b[33mPrevious audit
|
|
110
|
+
process.stdout.write(' \x1b[33mPrevious audit checkpoint was archived as a comment in the thread.\x1b[0m\n');
|
|
111
111
|
process.stdout.write(`Discussion URL: \x1b[36m${pubResult.url}\x1b[0m\n\n`);
|
|
112
112
|
} else {
|
|
113
113
|
process.stdout.write(`\n\x1b[1m\x1b[32m✔ Successfully published discussion topic!\x1b[0m\nDiscussion URL: \x1b[36m${pubResult.url}\x1b[0m\n\n`);
|
package/cli/navigator.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare function extractPromptFromContent(content: string): string | null
|
|
|
31
31
|
export declare function showPagedContent(content: string, promptText?: string | null): Promise<void>;
|
|
32
32
|
export declare function showConversionMenu(onScaffold?: (() => Promise<void>) | null): Promise<void>;
|
|
33
33
|
export declare function handleShareToDiscussions(report: AuditReport): Promise<void>;
|
|
34
|
+
export interface DashboardBannerOptions {
|
|
35
|
+
readonly clear?: boolean;
|
|
36
|
+
readonly interactive?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
export declare function renderDashboardBanner(
|
|
35
40
|
health: AuditReport['health'],
|
|
36
41
|
metrics: AuditReport['metrics'],
|
|
@@ -38,7 +43,9 @@ export declare function renderDashboardBanner(
|
|
|
38
43
|
critical: readonly unknown[],
|
|
39
44
|
highMediumCount: number,
|
|
40
45
|
low: readonly unknown[],
|
|
41
|
-
contextAnalysis?: AuditReport['contextAnalysis'] | null
|
|
46
|
+
contextAnalysis?: AuditReport['contextAnalysis'] | null,
|
|
47
|
+
aiSlop?: AuditReport['aiSlop'] | null,
|
|
48
|
+
options?: DashboardBannerOptions
|
|
42
49
|
): void;
|
|
43
50
|
export declare function runInteractiveAuditNavigator(
|
|
44
51
|
report: AuditReport,
|
package/cli/navigator.js
CHANGED
|
@@ -79,7 +79,7 @@ export const runInteractiveAuditNavigator = async (initialReport, onScaffold = n
|
|
|
79
79
|
let activeGrades = buildActiveGrades(report);
|
|
80
80
|
let actions = buildDashboardActionGroups({ report, onScaffold, onRerun: handleRerun });
|
|
81
81
|
|
|
82
|
-
renderDashboardBanner(health, metrics, violations, critical, highMediumCount, low, contextAnalysis, aiSlop);
|
|
82
|
+
renderDashboardBanner(health, metrics, violations, critical, highMediumCount, low, contextAnalysis, aiSlop, { interactive: true });
|
|
83
83
|
|
|
84
84
|
const shouldPublish = await confirmAction(
|
|
85
85
|
"Publish audit report and promote your project to our GitHub Discussions Audits Forum?",
|
|
@@ -93,14 +93,14 @@ export const runInteractiveAuditNavigator = async (initialReport, onScaffold = n
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
while (true) {
|
|
96
|
-
renderDashboardBanner(health, metrics, violations, critical, highMediumCount, low, contextAnalysis, aiSlop);
|
|
96
|
+
renderDashboardBanner(health, metrics, violations, critical, highMediumCount, low, contextAnalysis, aiSlop, { interactive: true, clear: true });
|
|
97
97
|
|
|
98
98
|
const guardrailsInstalled = areGuardrailsInstalled(process.cwd());
|
|
99
99
|
const topActions = [];
|
|
100
100
|
if (!guardrailsInstalled) {
|
|
101
101
|
topActions.push(actions.installAction);
|
|
102
102
|
}
|
|
103
|
-
topActions.push(actions.upgradeAction, actions.reportAction, actions.rerunAction);
|
|
103
|
+
topActions.push(actions.roadmapAction, actions.upgradeAction, actions.reportAction, actions.rerunAction);
|
|
104
104
|
|
|
105
105
|
const midActions = [];
|
|
106
106
|
if (actions.hasHotspots) {
|
package/cli/terminal.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import readline from "node:readline";
|
|
2
2
|
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { formatChemicalXGradient, ANSI } from "./theme.js";
|
|
3
4
|
|
|
4
5
|
export const openBrowser = (url) => {
|
|
5
6
|
const platform = process.platform;
|
|
@@ -70,18 +71,18 @@ export const renderBanner = (title = "Chemical X Protocol: Molecular Architectur
|
|
|
70
71
|
"--border-foreground=45",
|
|
71
72
|
"--foreground=81",
|
|
72
73
|
"--bold",
|
|
73
|
-
` ${title}\n Zero-Context-Rot
|
|
74
|
+
` ${title}\n The Secret Sauce to Vibe Coding | Zero-Context-Rot Directives`
|
|
74
75
|
],
|
|
75
76
|
{ stdio: "inherit" }
|
|
76
77
|
);
|
|
77
78
|
} else {
|
|
78
79
|
process.stdout.write(
|
|
79
|
-
"\n
|
|
80
|
+
`\n${formatChemicalXGradient("=====================================================")}\n`
|
|
80
81
|
);
|
|
81
|
-
process.stdout.write(
|
|
82
|
-
process.stdout.write(
|
|
82
|
+
process.stdout.write(` ${formatChemicalXGradient(title)}\n`);
|
|
83
|
+
process.stdout.write(` ${ANSI.BOLD}${ANSI.GOLD}The Secret Sauce to Vibe Coding!${ANSI.RESET} ${ANSI.DIM}| Zero-Context-Rot Directives${ANSI.RESET}\n`);
|
|
83
84
|
process.stdout.write(
|
|
84
|
-
"\
|
|
85
|
+
`${formatChemicalXGradient("=====================================================")}\n\n`
|
|
85
86
|
);
|
|
86
87
|
}
|
|
87
88
|
};
|
package/cli/theme.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ChemxGradientColor {
|
|
2
|
+
readonly r: number;
|
|
3
|
+
readonly g: number;
|
|
4
|
+
readonly b: number;
|
|
5
|
+
readonly ansi: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare const CHEMX_COLORS: {
|
|
9
|
+
readonly blossomPink: string;
|
|
10
|
+
readonly powerPurple: string;
|
|
11
|
+
readonly bubblesCyan: string;
|
|
12
|
+
readonly chemicalMint: string;
|
|
13
|
+
readonly buttercupLime: string;
|
|
14
|
+
readonly vibeGold: string;
|
|
15
|
+
readonly goldenRibbon: string;
|
|
16
|
+
readonly midnightViolet: string;
|
|
17
|
+
readonly obsidian: string;
|
|
18
|
+
readonly slateBorder: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export declare const CHEMX_RGB: {
|
|
22
|
+
readonly blossomPink: readonly [number, number, number];
|
|
23
|
+
readonly bubblesCyan: readonly [number, number, number];
|
|
24
|
+
readonly buttercupLime: readonly [number, number, number];
|
|
25
|
+
readonly vibeGold: readonly [number, number, number];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare const ANSI: {
|
|
29
|
+
readonly PINK: string;
|
|
30
|
+
readonly PURPLE: string;
|
|
31
|
+
readonly CYAN: string;
|
|
32
|
+
readonly MINT: string;
|
|
33
|
+
readonly LIME: string;
|
|
34
|
+
readonly GOLD: string;
|
|
35
|
+
readonly BOLD: string;
|
|
36
|
+
readonly DIM: string;
|
|
37
|
+
readonly RESET: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export declare function getChemicalXGradientColor(t: number): ChemxGradientColor;
|
|
41
|
+
export declare function formatChemicalXGradient(text: string): string;
|
package/cli/theme.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chemical X Protocol: Official Comic Book Color Palette
|
|
3
|
+
* Codified from Hall of the Gods Chemical X Vol. 1 Comic Book Edition
|
|
4
|
+
*
|
|
5
|
+
* Blossom Pink (#f43f85) -> Bubbles Cyan (#38bdf8) -> Buttercup Lime (#a3e635)
|
|
6
|
+
* Golden Ribbon: (#fbbf24) | Midnight Violet Armor: (#181126)
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const CHEMX_COLORS = Object.freeze({
|
|
10
|
+
blossomPink: '#f43f85',
|
|
11
|
+
powerPurple: '#a855f7',
|
|
12
|
+
bubblesCyan: '#38bdf8',
|
|
13
|
+
chemicalMint: '#2dd4bf',
|
|
14
|
+
buttercupLime: '#a3e635',
|
|
15
|
+
vibeGold: '#fbbf24',
|
|
16
|
+
goldenRibbon: '#f59e0b',
|
|
17
|
+
midnightViolet: '#181126',
|
|
18
|
+
obsidian: '#090d16',
|
|
19
|
+
slateBorder: '#26354a'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const CHEMX_RGB = Object.freeze({
|
|
23
|
+
blossomPink: [244, 63, 133],
|
|
24
|
+
bubblesCyan: [56, 189, 248],
|
|
25
|
+
buttercupLime: [163, 230, 53],
|
|
26
|
+
vibeGold: [251, 191, 36]
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const ANSI = Object.freeze({
|
|
30
|
+
PINK: '\x1b[38;2;244;63;133m',
|
|
31
|
+
PURPLE: '\x1b[38;2;168;85;247m',
|
|
32
|
+
CYAN: '\x1b[38;2;56;189;248m',
|
|
33
|
+
MINT: '\x1b[38;2;45;212;191m',
|
|
34
|
+
LIME: '\x1b[38;2;163;230;53m',
|
|
35
|
+
GOLD: '\x1b[38;2;251;191;36m',
|
|
36
|
+
BOLD: '\x1b[1m',
|
|
37
|
+
DIM: '\x1b[2m',
|
|
38
|
+
RESET: '\x1b[0m'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const getChemicalXGradientColor = (t) => {
|
|
42
|
+
const clamped = Math.max(0, Math.min(1, t));
|
|
43
|
+
let r = 0;
|
|
44
|
+
let g = 0;
|
|
45
|
+
let b = 0;
|
|
46
|
+
|
|
47
|
+
if (clamped < 0.45) {
|
|
48
|
+
const factor = clamped / 0.45;
|
|
49
|
+
r = Math.round(244 * (1 - factor) + 56 * factor);
|
|
50
|
+
g = Math.round(63 * (1 - factor) + 189 * factor);
|
|
51
|
+
b = Math.round(133 * (1 - factor) + 248 * factor);
|
|
52
|
+
} else {
|
|
53
|
+
const factor = (clamped - 0.45) / 0.55;
|
|
54
|
+
r = Math.round(56 * (1 - factor) + 163 * factor);
|
|
55
|
+
g = Math.round(189 * (1 - factor) + 230 * factor);
|
|
56
|
+
b = Math.round(248 * (1 - factor) + 53 * factor);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
r,
|
|
61
|
+
g,
|
|
62
|
+
b,
|
|
63
|
+
ansi: `\x1b[38;2;${r};${g};${b}m`
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const formatChemicalXGradient = (text) => {
|
|
68
|
+
if (!text) return '';
|
|
69
|
+
const len = text.length;
|
|
70
|
+
if (len === 1) return `${ANSI.PINK}${ANSI.BOLD}${text}${ANSI.RESET}`;
|
|
71
|
+
|
|
72
|
+
let out = '';
|
|
73
|
+
for (let i = 0; i < len; i++) {
|
|
74
|
+
const ch = text[i];
|
|
75
|
+
if (ch === ' ') {
|
|
76
|
+
out += ' ';
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const t = i / (len - 1);
|
|
80
|
+
const { ansi } = getChemicalXGradientColor(t);
|
|
81
|
+
out += `${ansi}${ANSI.BOLD}${ch}${ANSI.RESET}`;
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
};
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ All notable changes to the Chemical X Starter Kit repository will be documented
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
6
|
|
|
7
|
+
## [2026-09-12]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Added Build Auditor wrapper command (`chemx build`, aliases `run`, `wrap`) with token-optimized silent execution (`cli/build.js`, `cli/build/`):
|
|
11
|
+
- Wraps arbitrary or auto-detected build scripts (`pnpm run build`, `yarn build`, `bun run build`, `npm run build`, `vite build`, `tsc --noEmit`).
|
|
12
|
+
- Automatically parses and catalogs TypeScript (`TS*`), Rollup/Vite resolution, Sass/PostCSS syntax, and bundle budget errors into structured diagnostic categories with 1-line remediation hints.
|
|
13
|
+
- Implemented `--json` output flag emitting structured machine-readable error envelopes for AI agents, and `--silent` flag for zero-noise terminal output on successful builds.
|
|
14
|
+
- Added automated pull request comment step to Chemical X Gatekeeper workflows (`.github/workflows/chemx-audit.yml`, `blueprints/workflows/chemx-audit.yml`, `cli/installer-templates.js`) that renders the full audit report with an architectural discussion topic link, updating existing PR comments idempotently.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
- Fixed GitHub Actions runner failure in `chemx-audit.yml` workflows by removing `cache: npm` when no package lockfile exists.
|
|
18
|
+
- Upgraded runner `node-version` from deprecated 20 to 22 across CI workflows and installer templates (`.github/workflows/chemx-audit.yml`, `blueprints/workflows/chemx-audit.yml`, `cli/installer-templates.js`).
|
|
19
|
+
- Standardized non-interactive CLI audit mode to output the clean Gamer HUD scorecard banner without interactive menu options.
|
|
20
|
+
- Preserved clean stdout in workflows by writing markdown reports to `--output` files without dumping raw markdown to the terminal.
|
|
21
|
+
- Replaced top-level synchronous config directory creation in `cli/license.js` with lazy `ensureConfigDir` and `toResultSync` Result Tuple pattern.
|
|
22
|
+
|
|
7
23
|
## [2026-09-08]
|
|
8
24
|
|
|
9
25
|
### Added
|
|
@@ -19,7 +35,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
19
35
|
## [2026-09-11]
|
|
20
36
|
|
|
21
37
|
### Added
|
|
38
|
+
- Standardized the Chemical X color palette across the starter kit to match the official Hall of the Gods Chemical X Vol. 1 Comic Book cover:
|
|
39
|
+
- Created centralized palette module (`cli/theme.js`, `cli/theme.d.ts`) codifying Blossom Pink (`#f43f85`), Power Purple (`#a855f7`), Bubbles Cyan (`#38bdf8`), Chemical Mint (`#2dd4bf`), Buttercup Lime (`#a3e635`), Vibe Gold (`#fbbf24`), Golden Ribbon (`#f59e0b`), and Midnight Violet armor (`#181126`).
|
|
40
|
+
- Updated 24-bit TrueColor ASCII art banner (`getChemicalXAsciiBanner` in `cli/audit/reporter-banner.js`) with 3-phase gradient (Blossom Pink -> Bubbles Cyan -> Buttercup Lime) and golden ribbon motto styling (`The Secret Sauce to Vibe Coding!`).
|
|
41
|
+
- Upgraded terminal banner renderer (`renderBanner` in `cli/terminal.js`) with TrueColor gradient border and title formatting.
|
|
42
|
+
- Enhanced Verified Chemical X Footer Badge SVG asset generator (`generateSvgBadgeSnippet` in `cli/badge.js`) with embedded `<linearGradient id="chemx-comic">` border and updated HTML snippet.
|
|
43
|
+
- Aligned `m-chemx-badge` blueprint capsule styles (`_m-chemx-badge.scss`) with the official comic palette for hover glow and grade badges.
|
|
22
44
|
- Expanded AST static analysis engine with Pillars 8 to 11 (`cli/audit/extended-visitors.js`): added automated rules and visitors for Accessibility & Semantic Integrity (`A11Y_CLICKABLE_NON_SEMANTIC`, `A11Y_IMAGE_MISSING_ALT`), Security & Content Safety (`SECURITY_RAW_HTML_INJECTION`, `SECURITY_HARDCODED_SECRET`), Testing Discipline (`TEST_FAKE_GREEN`, `TEST_MISSING_COLOCATED`), and Naming Conventions (`NAMING_BARE_BOOLEAN`, `NAMING_HANDLER_PREFIX`).
|
|
45
|
+
- Implemented nested bullet tree path-chain formatter (`formatGroupedPromptViolations` in `cli/audit/prompts.js` and `renderGroupedViolationsTerminal` in `cli/audit/reporter-grouping.js`), clustering violations by rule and rendering folder hierarchy steps as indented bullet chains with `📁` folder emojis and ANSI severity colors (`📁 app/` -> `📁 components/` -> `📁 molecules/` -> leaf files with line hits) to eliminate boilerplate repetitions and slash AI prompt token consumption by up to 85%.
|
|
46
|
+
- Consolidated monolith refactoring action directives across `buildHotspotsPrompt`, `buildGradeFPrompt`, `buildGradeDPrompt`, and `buildGradeCPrompt`, stating action requirements once per section.
|
|
47
|
+
- Added `{ excludeAiSlop }` filter options to grade prompt builders to prevent duplicate slop violation listings in `buildMasterPrompt`.
|
|
48
|
+
- Added `{ includePrompt: false }` flag to `formatHotspotsSection` and `formatAiSlopSection` when rendered within full terminal report (`cli/audit/reporter.js`), preventing mid-report prompt box duplication before the master prompt.
|
|
23
49
|
- Added AI Agent refactoring prompt generator for AI Slop & Authenticity (`buildAiSlopPrompt` in `cli/audit/prompts.js`), generating surgical instructions to eliminate conversational residue, lazy placeholders, echo comments, shallow catch blocks, and reinvented utilities.
|
|
24
50
|
- Added AI Agent refactoring prompt generator for Top Refactoring Hotspots (`buildHotspotsPrompt` in `cli/audit/prompts.js`), providing phased decomposition plans for files exceeding line budgets.
|
|
25
51
|
- Integrated AI Slop and Hotspots prompt boxes into report sections (`formatAiSlopSection`, `formatHotspotsSection` in `cli/audit/reporter-sections.js`), composite master prompt (`buildMasterPrompt`), and interactive navigator inspection views (`cli/navigator-actions.js`, `cli/navigator.js`, `cli/navigator-menu.js`).
|
|
@@ -194,4 +220,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
194
220
|
- Excluded 3rd-party `vendor` and `build` directories, as well as minified bundles (`*.min.*`), from the AST context hazard audit to eliminate false positives on bundled external libraries.
|
|
195
221
|
- Fixed argument ordering in `gumChoose` to pass `--header` and styling flags to the `choose` subcommand rather than prepending to the parent binary.
|
|
196
222
|
|
|
223
|
+
## [2026-09-12]
|
|
197
224
|
|
|
225
|
+
### Added
|
|
226
|
+
- Pre-Split Pattern Discovery & Harmonization Protocol added to `AGENTS.md` (Section 1.F): mandates cross-file pattern discovery, design-system foundation mapping, and canonical extraction prior to code splitting monoliths.
|
|
227
|
+
- Updated AST audit refactoring prompt generators (`buildGradeFPrompt` and `buildHotspotsPrompt` in `cli/audit/prompts.js`) to enforce Pre-Split Pattern Discovery in generated AI directives.
|
|
228
|
+
- Structural Pattern Harmonization Detector module (`cli/audit/pattern-detector.js`): single-pass AST fingerprinting to detect cross-file clones (shared state machine unions, composite JSX layouts, multi-clause boolean predicates, parallel hook return signatures) without quadratic diffing overhead.
|
|
229
|
+
- Self-Healing Remediation Roadmap engine (`cli/audit/roadmap.js`): calculates optimal 5-phase refactoring sequence (Pattern Harvesting -> Domain Foundations -> Monolith Slicing -> Component Hygiene -> Automated Gatekeeping) so early canonical extractions compound and self-sustain subsequent monolith slicing.
|
|
230
|
+
- Integrated dedicated grade report card sections (`formatGradeASection`, `formatGradeBSection`, `formatGradeCSection`, `formatGradeDSection`, and `formatGradeFSection`) into the full terminal audit report (`formatTerminalReport` in `cli/audit/reporter.js`) with `{ includePrompt: false }` option.
|
|
231
|
+
- Permanent grade accessibility in Audit Navigator menu (`cli/navigator-actions.js`): eliminated `hasGradeItems` filtering so all grade tiers (Grade A, AI Slop, Grade B, Grade C, Grade D, and Grade F) remain visible and navigable at all times, matching the full report.
|
|
232
|
+
- Synchronized hazard counts in `buildActiveGrades` (`cli/navigator-actions.js`): included failed and warned pillars in Grade F and Grade D totals to match the grade report card totals.
|
|
233
|
+
- Automatic baseline floor calculation in `cli/audit/history.js`: resolved audit baseline to the lowest historical MHI score in `history.json`, ensuring before and after deltas accurately measure total debt reduction.
|
|
234
|
+
- Dual-delta progress display in `cli/navigator-actions.js` and `cli/audit/history.js`: `[ Progress ]` action shows cumulative transformation delta against baseline floor and incremental step delta against immediately preceding audit snapshot.
|
|
235
|
+
- Discussion thread living showcase architecture in `cli/audit/social-publisher.js` and `cli/navigator-share.js`: primary topic stays as the living showcase dashboard while subsequent audits post as checkpoint comments in the thread.
|
|
236
|
+
- 7-Pillar emoji reaction badges strip in terminal audit reports (`formatPillarReactionBadgesTerminal` in `cli/audit/reporter-utils.js` and `formatPillarsSection` in `cli/audit/reporter-sections.js`), prepending `[ <icon> ]` to matrix rows and rendering colored compact status reaction badges (`PASS`, `WARN`, `FAIL`).
|
|
237
|
+
- Markdown compliance matrix and GitHub Discussions integration (`formatPillarReactionBadgesMarkdown` in `cli/audit/reporter-utils.js`, `generateMarkdownReport` in `cli/audit/reporter-markdown.js`, `generateDiscussionContent` and `generateTransformationDiscussionContent` in `cli/audit/social.js`), embedding formatted reaction badge strips above compliance and progression tables in exports and checkpoint comments.
|
|
238
|
+
- Public API exports and typings for `formatPillarReactionBadgesTerminal` and `formatPillarReactionBadgesMarkdown` in `cli/audit/reporter.js`, `cli/audit/reporter.d.ts`, and `cli/audit.js`.
|
|
239
|
+
- Git Branching & Pull Request Workflow added to self-healing remediation roadmap (`buildRemediationRoadmap` and `buildSelfHealingRoadmapPrompt` in `cli/audit/roadmap.js`), hotspots refactoring prompt execution rules (`cli/audit/prompts.js`), and `AGENTS.md` (Section 1.G): instructs developers and agents to change to a dedicated branch prefixed with `chem-x/NAMEOFIMPROVEMENT` before modifying code, commit changes atomically on the branch, and create a Pull Request to `main`.
|
|
240
|
+
- Shields.io pillar and showcase badge strips across the top of audit reports:
|
|
241
|
+
- Added `formatPillarShieldBadges(pillars)` and `PILLAR_SHORT_NAMES` in `cli/audit/reporter-utils.js` to render Shields.io `style=for-the-badge` badges for all 11 pillars with emojis, compact short names, live status (`PASS`, `WARN <count>`, `FAIL <count>`), and signature Chemical X colors.
|
|
242
|
+
- Positioned prominent Shields.io showcase badges and the 11-pillar badge strip across the top of GitHub Discussions single audit showcase reports (`generateDiscussionContent` in `cli/audit/social.js`), Before vs. After transformation showcase reports (`generateTransformationDiscussionContent` in `cli/audit/social.js`), and Markdown audit exports (`generateMarkdownReport` in `cli/audit/reporter-markdown.js`).
|
|
243
|
+
- Added public exports and TypeScript declarations for `formatPillarShieldBadges`, `resolveBadgeColor`, and `PILLAR_SHORT_NAMES` in `cli/audit/reporter.js`, `cli/audit/reporter.d.ts`, and `cli/audit.js`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chemx/starter-kit",
|
|
3
|
-
"version": "26.9.
|
|
3
|
+
"version": "26.9.13-272",
|
|
4
4
|
"description": "Chemical X Protocol: Private drop-in architecture starter kit and capsule generator",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
],
|
|
21
21
|
"exports": {
|
|
22
22
|
".": "./cli/index.js",
|
|
23
|
-
"./audit": "./cli/audit.js"
|
|
23
|
+
"./audit": "./cli/audit.js",
|
|
24
|
+
"./build": "./cli/build.js"
|
|
24
25
|
},
|
|
25
26
|
"scripts": {
|
|
26
27
|
"publish:both": "node scripts/publish-both.mjs",
|