@cobusgreyling/goal-audit 1.0.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 +27 -0
- package/dist/auditor.d.ts +54 -0
- package/dist/auditor.d.ts.map +1 -0
- package/dist/auditor.js +240 -0
- package/dist/auditor.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +63 -0
- package/dist/cli.js.map +1 -0
- package/dist/reporter.d.ts +5 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/reporter.js +47 -0
- package/dist/reporter.js.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# goal-audit
|
|
2
|
+
|
|
3
|
+
Goal Readiness Score CLI for Grok Build `/goal` workflows.
|
|
4
|
+
|
|
5
|
+
## Install / run
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @cobusgreyling/goal-audit .
|
|
9
|
+
npx @cobusgreyling/goal-audit . --suggest
|
|
10
|
+
npx @cobusgreyling/goal-audit . --json
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Levels
|
|
14
|
+
|
|
15
|
+
| Level | Score | Meaning |
|
|
16
|
+
|-------|-------|---------|
|
|
17
|
+
| G0 | < 40 | Ad hoc `/goal` usage |
|
|
18
|
+
| G1 | 40–59 | GOAL.md + assisted goals |
|
|
19
|
+
| G2 | 60–79 | Verifier + test gates |
|
|
20
|
+
| G3 | 80+ | CI, budget, run log |
|
|
21
|
+
|
|
22
|
+
## Development
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install
|
|
26
|
+
npm test
|
|
27
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface GoalSignals {
|
|
2
|
+
goalFile: {
|
|
3
|
+
present: boolean;
|
|
4
|
+
path?: string;
|
|
5
|
+
};
|
|
6
|
+
goalConfig: {
|
|
7
|
+
present: boolean;
|
|
8
|
+
};
|
|
9
|
+
skills: {
|
|
10
|
+
count: number;
|
|
11
|
+
goalSkills: string[];
|
|
12
|
+
};
|
|
13
|
+
verifier: {
|
|
14
|
+
present: boolean;
|
|
15
|
+
};
|
|
16
|
+
scoper: {
|
|
17
|
+
present: boolean;
|
|
18
|
+
};
|
|
19
|
+
agentsMd: {
|
|
20
|
+
present: boolean;
|
|
21
|
+
mentionsGoal: boolean;
|
|
22
|
+
};
|
|
23
|
+
patterns: {
|
|
24
|
+
documented: boolean;
|
|
25
|
+
};
|
|
26
|
+
safety: {
|
|
27
|
+
safetyDocPresent: boolean;
|
|
28
|
+
budgetDoc: boolean;
|
|
29
|
+
};
|
|
30
|
+
tests: {
|
|
31
|
+
present: boolean;
|
|
32
|
+
};
|
|
33
|
+
ci: {
|
|
34
|
+
present: boolean;
|
|
35
|
+
};
|
|
36
|
+
runLog: {
|
|
37
|
+
present: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface Finding {
|
|
41
|
+
level: 'ok' | 'warn' | 'fail';
|
|
42
|
+
message: string;
|
|
43
|
+
}
|
|
44
|
+
export interface AuditResult {
|
|
45
|
+
target: string;
|
|
46
|
+
score: number;
|
|
47
|
+
level: 'G0' | 'G1' | 'G2' | 'G3';
|
|
48
|
+
assessment: string;
|
|
49
|
+
signals: GoalSignals;
|
|
50
|
+
findings: Finding[];
|
|
51
|
+
recommendations: string[];
|
|
52
|
+
}
|
|
53
|
+
export declare function auditProject(target: string): Promise<AuditResult>;
|
|
54
|
+
//# sourceMappingURL=auditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditor.d.ts","sourceRoot":"","sources":["../src/auditor.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,UAAU,EAAE;QA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
|
1
|
+
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
const GOAL_FILES = ['GOAL.md', 'goal.md', 'docs/GOAL.md'];
|
|
4
|
+
const GOAL_SKILL_NAMES = [
|
|
5
|
+
'goal-verifier',
|
|
6
|
+
'goal-scoper',
|
|
7
|
+
'goal-completion-check',
|
|
8
|
+
];
|
|
9
|
+
const SAFETY_FILES = ['docs/safety.md', 'SECURITY.md', 'safety.md'];
|
|
10
|
+
const BUDGET_FILES = ['goal-budget.md', 'docs/goal-budget.md'];
|
|
11
|
+
const RUN_LOG_FILES = ['goal-run-log.md', 'docs/goal-run-log.md'];
|
|
12
|
+
async function fileExists(p) {
|
|
13
|
+
try {
|
|
14
|
+
await stat(p);
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function findSkills(root) {
|
|
22
|
+
const dirs = [
|
|
23
|
+
path.join(root, '.grok', 'skills'),
|
|
24
|
+
path.join(root, '.claude', 'skills'),
|
|
25
|
+
path.join(root, '.codex', 'skills'),
|
|
26
|
+
path.join(root, 'skills'),
|
|
27
|
+
];
|
|
28
|
+
const found = [];
|
|
29
|
+
for (const dir of dirs) {
|
|
30
|
+
if (!(await fileExists(dir)))
|
|
31
|
+
continue;
|
|
32
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
33
|
+
for (const e of entries) {
|
|
34
|
+
if (e.isDirectory())
|
|
35
|
+
found.push(e.name);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return found;
|
|
39
|
+
}
|
|
40
|
+
async function detectTests(root) {
|
|
41
|
+
const hints = [
|
|
42
|
+
'package.json',
|
|
43
|
+
'pyproject.toml',
|
|
44
|
+
'go.mod',
|
|
45
|
+
'Cargo.toml',
|
|
46
|
+
'vitest.config.ts',
|
|
47
|
+
'jest.config.js',
|
|
48
|
+
'pytest.ini',
|
|
49
|
+
];
|
|
50
|
+
for (const h of hints) {
|
|
51
|
+
if (await fileExists(path.join(root, h)))
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
const testDirs = ['tests', 'test', '__tests__'];
|
|
55
|
+
for (const d of testDirs) {
|
|
56
|
+
if (await fileExists(path.join(root, d)))
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
async function detectCi(root) {
|
|
62
|
+
const ciPaths = [
|
|
63
|
+
'.github/workflows',
|
|
64
|
+
'.gitlab-ci.yml',
|
|
65
|
+
'Jenkinsfile',
|
|
66
|
+
];
|
|
67
|
+
for (const p of ciPaths) {
|
|
68
|
+
if (await fileExists(path.join(root, p)))
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
function scoreLevel(score) {
|
|
74
|
+
if (score >= 80)
|
|
75
|
+
return 'G3';
|
|
76
|
+
if (score >= 60)
|
|
77
|
+
return 'G2';
|
|
78
|
+
if (score >= 40)
|
|
79
|
+
return 'G1';
|
|
80
|
+
return 'G0';
|
|
81
|
+
}
|
|
82
|
+
function assessmentFor(level) {
|
|
83
|
+
switch (level) {
|
|
84
|
+
case 'G3':
|
|
85
|
+
return 'production-ready goal workflows';
|
|
86
|
+
case 'G2':
|
|
87
|
+
return 'verified goals with checker split';
|
|
88
|
+
case 'G1':
|
|
89
|
+
return 'assisted goals — add verifier for G2';
|
|
90
|
+
default:
|
|
91
|
+
return 'ad hoc — scaffold GOAL.md and skills';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export async function auditProject(target) {
|
|
95
|
+
const root = path.resolve(target);
|
|
96
|
+
const findings = [];
|
|
97
|
+
const recommendations = [];
|
|
98
|
+
let score = 0;
|
|
99
|
+
const goalPaths = [];
|
|
100
|
+
for (const f of GOAL_FILES) {
|
|
101
|
+
if (await fileExists(path.join(root, f)))
|
|
102
|
+
goalPaths.push(f);
|
|
103
|
+
}
|
|
104
|
+
const goalFilePresent = goalPaths.length > 0;
|
|
105
|
+
if (goalFilePresent) {
|
|
106
|
+
score += 15;
|
|
107
|
+
findings.push({ level: 'ok', message: `GOAL file present (${goalPaths.join(', ')})` });
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
findings.push({ level: 'fail', message: 'No GOAL.md — goals will not survive compaction' });
|
|
111
|
+
recommendations.push('cp templates/GOAL.md.template GOAL.md');
|
|
112
|
+
}
|
|
113
|
+
const goalConfigPresent = await fileExists(path.join(root, 'GOAL.md'));
|
|
114
|
+
if (goalConfigPresent)
|
|
115
|
+
score += 5;
|
|
116
|
+
const allSkills = await findSkills(root);
|
|
117
|
+
const goalSkills = allSkills.filter((s) => GOAL_SKILL_NAMES.includes(s));
|
|
118
|
+
if (goalSkills.length > 0) {
|
|
119
|
+
score += 10 + Math.min(goalSkills.length * 5, 15);
|
|
120
|
+
findings.push({ level: 'ok', message: `Goal skills: ${goalSkills.join(', ')}` });
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
findings.push({ level: 'warn', message: 'No goal-verifier / goal-scoper skills found' });
|
|
124
|
+
recommendations.push('cp -r starters/minimal-goal/.grok/skills/goal-verifier .grok/skills/');
|
|
125
|
+
}
|
|
126
|
+
const verifierPresent = goalSkills.includes('goal-verifier') || allSkills.some((s) => s.includes('verifier'));
|
|
127
|
+
if (verifierPresent) {
|
|
128
|
+
score += 20;
|
|
129
|
+
findings.push({ level: 'ok', message: 'Verifier skill or agent present' });
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
findings.push({ level: 'fail', message: 'No verifier — implementer may self-grade' });
|
|
133
|
+
recommendations.push('Add goal-verifier skill from skills/goal-verifier/');
|
|
134
|
+
}
|
|
135
|
+
const scoperPresent = goalSkills.includes('goal-scoper');
|
|
136
|
+
if (scoperPresent)
|
|
137
|
+
score += 5;
|
|
138
|
+
const agentsPath = path.join(root, 'AGENTS.md');
|
|
139
|
+
const agentsPresent = await fileExists(agentsPath);
|
|
140
|
+
let mentionsGoal = false;
|
|
141
|
+
if (agentsPresent) {
|
|
142
|
+
const content = await readFile(agentsPath, 'utf8');
|
|
143
|
+
mentionsGoal = /goal|update_goal|GOAL\.md/i.test(content);
|
|
144
|
+
score += mentionsGoal ? 10 : 5;
|
|
145
|
+
findings.push({
|
|
146
|
+
level: mentionsGoal ? 'ok' : 'warn',
|
|
147
|
+
message: mentionsGoal ? 'AGENTS.md mentions goal discipline' : 'AGENTS.md present but no goal rules',
|
|
148
|
+
});
|
|
149
|
+
if (!mentionsGoal) {
|
|
150
|
+
recommendations.push('Add goal rules to AGENTS.md: verifier before completed: true');
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
findings.push({ level: 'warn', message: 'No AGENTS.md' });
|
|
155
|
+
recommendations.push('gbs scaffold agents-md --write (from grok-build-showcase) or write AGENTS.md');
|
|
156
|
+
}
|
|
157
|
+
const patternsPresent = (await fileExists(path.join(root, 'patterns'))) ||
|
|
158
|
+
(await fileExists(path.join(root, 'docs', 'api-reference.md')));
|
|
159
|
+
if (patternsPresent) {
|
|
160
|
+
score += 5;
|
|
161
|
+
findings.push({ level: 'ok', message: 'Goal patterns or API docs present' });
|
|
162
|
+
}
|
|
163
|
+
let safetyDocPresent = false;
|
|
164
|
+
for (const f of SAFETY_FILES) {
|
|
165
|
+
if (await fileExists(path.join(root, f))) {
|
|
166
|
+
safetyDocPresent = true;
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
let budgetDoc = false;
|
|
171
|
+
for (const f of BUDGET_FILES) {
|
|
172
|
+
if (await fileExists(path.join(root, f))) {
|
|
173
|
+
budgetDoc = true;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (safetyDocPresent)
|
|
178
|
+
score += 5;
|
|
179
|
+
if (budgetDoc) {
|
|
180
|
+
score += 10;
|
|
181
|
+
findings.push({ level: 'ok', message: 'Goal budget documented' });
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
recommendations.push('cp templates/goal-budget.md.template goal-budget.md');
|
|
185
|
+
}
|
|
186
|
+
const testsPresent = await detectTests(root);
|
|
187
|
+
if (testsPresent) {
|
|
188
|
+
score += 15;
|
|
189
|
+
findings.push({ level: 'ok', message: 'Test harness detected' });
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
findings.push({ level: 'warn', message: 'No test harness — done conditions are subjective' });
|
|
193
|
+
}
|
|
194
|
+
const ciPresent = await detectCi(root);
|
|
195
|
+
if (ciPresent) {
|
|
196
|
+
score += 10;
|
|
197
|
+
findings.push({ level: 'ok', message: 'CI configuration present' });
|
|
198
|
+
}
|
|
199
|
+
let runLog = false;
|
|
200
|
+
for (const f of RUN_LOG_FILES) {
|
|
201
|
+
if (await fileExists(path.join(root, f))) {
|
|
202
|
+
runLog = true;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (runLog) {
|
|
207
|
+
score += 5;
|
|
208
|
+
findings.push({ level: 'ok', message: 'Goal run log present' });
|
|
209
|
+
}
|
|
210
|
+
score = Math.min(100, score);
|
|
211
|
+
const level = scoreLevel(score);
|
|
212
|
+
if (level === 'G0') {
|
|
213
|
+
recommendations.push('Read docs/goal-design-checklist.md and starters/minimal-goal/');
|
|
214
|
+
}
|
|
215
|
+
if (level === 'G1' && !verifierPresent) {
|
|
216
|
+
recommendations.push('Graduate to G2: add goal-verifier before unattended goals');
|
|
217
|
+
}
|
|
218
|
+
return {
|
|
219
|
+
target: root,
|
|
220
|
+
score,
|
|
221
|
+
level,
|
|
222
|
+
assessment: assessmentFor(level),
|
|
223
|
+
signals: {
|
|
224
|
+
goalFile: { present: goalFilePresent, path: goalPaths[0] },
|
|
225
|
+
goalConfig: { present: goalConfigPresent },
|
|
226
|
+
skills: { count: allSkills.length, goalSkills },
|
|
227
|
+
verifier: { present: verifierPresent },
|
|
228
|
+
scoper: { present: scoperPresent },
|
|
229
|
+
agentsMd: { present: agentsPresent, mentionsGoal },
|
|
230
|
+
patterns: { documented: patternsPresent },
|
|
231
|
+
safety: { safetyDocPresent, budgetDoc },
|
|
232
|
+
tests: { present: testsPresent },
|
|
233
|
+
ci: { present: ciPresent },
|
|
234
|
+
runLog: { present: runLog },
|
|
235
|
+
},
|
|
236
|
+
findings,
|
|
237
|
+
recommendations: [...new Set(recommendations)],
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=auditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auditor.js","sourceRoot":"","sources":["../src/auditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,IAAI,MAAM,WAAW,CAAC;AA+B7B,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAC1D,MAAM,gBAAgB,GAAG;IACvB,eAAe;IACf,aAAa;IACb,uBAAuB;CACxB,CAAC;AACF,MAAM,YAAY,GAAG,CAAC,gBAAgB,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AACpE,MAAM,YAAY,GAAG,CAAC,gBAAgB,EAAE,qBAAqB,CAAC,CAAC;AAC/D,MAAM,aAAa,GAAG,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC;AAElE,KAAK,UAAU,UAAU,CAAC,CAAS;IACjC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,MAAM,IAAI,GAAG;QACX,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC;QAClC,I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E,CAAC,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;KAC/C,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { auditProject } from './auditor.js';
|
|
3
|
+
import { formatHuman, formatJson, formatMarkdown } from './reporter.js';
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
const target = args.find((a) => !a.startsWith('-')) || '.';
|
|
6
|
+
const json = args.includes('--json');
|
|
7
|
+
const md = args.includes('--md');
|
|
8
|
+
const suggest = args.includes('--suggest') || args.includes('--fix');
|
|
9
|
+
const help = args.includes('--help') || args.includes('-h');
|
|
10
|
+
if (help) {
|
|
11
|
+
console.log(`goal-audit — Goal Readiness Score CLI (G0–G3)
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
goal-audit [path] [options]
|
|
15
|
+
|
|
16
|
+
Options:
|
|
17
|
+
--json JSON output (for CI / scripting)
|
|
18
|
+
--md Markdown report
|
|
19
|
+
--suggest Show copy-from-template commands
|
|
20
|
+
--help, -h This help
|
|
21
|
+
|
|
22
|
+
Scores goal readiness for Grok Build /goal:
|
|
23
|
+
GOAL.md, verifier skills, AGENTS.md, tests, CI, budget docs
|
|
24
|
+
|
|
25
|
+
Exit codes:
|
|
26
|
+
0 score >= 40
|
|
27
|
+
2 score < 40
|
|
28
|
+
|
|
29
|
+
Examples:
|
|
30
|
+
goal-audit .
|
|
31
|
+
goal-audit . --suggest
|
|
32
|
+
npx @cobusgreyling/goal-audit . --json
|
|
33
|
+
`);
|
|
34
|
+
process.exit(0);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const result = await auditProject(target);
|
|
38
|
+
if (json)
|
|
39
|
+
console.log(formatJson(result));
|
|
40
|
+
else if (md)
|
|
41
|
+
console.log(formatMarkdown(result));
|
|
42
|
+
else
|
|
43
|
+
console.log(formatHuman(result));
|
|
44
|
+
if (suggest) {
|
|
45
|
+
console.log('\n=== Suggested actions ===');
|
|
46
|
+
console.log('');
|
|
47
|
+
console.log(' cp templates/GOAL.md.template GOAL.md');
|
|
48
|
+
console.log(' cp -r starters/minimal-goal/.grok/skills/goal-verifier .grok/skills/');
|
|
49
|
+
console.log(' cp templates/goal-budget.md.template goal-budget.md');
|
|
50
|
+
console.log(' cp templates/goal-run-log.md.template goal-run-log.md');
|
|
51
|
+
console.log('');
|
|
52
|
+
console.log(' # Then in Grok Build:');
|
|
53
|
+
console.log(' /goal Read GOAL.md. Work the objective. goal-verifier before completed: true.');
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(' Docs: https://github.com/cobusgreyling/goal-engineering');
|
|
56
|
+
}
|
|
57
|
+
process.exit(result.score >= 40 ? 0 : 2);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
console.error('goal-audit error:', err instanceof Error ? err.message : err);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC;AAC3D,MAAM,IAAI,GA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yB,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC/F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAAC,OAAO,GAAG,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,mBAAmB,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AuditResult } from './auditor.js';
|
|
2
|
+
export declare function formatHuman(result: AuditResult): string;
|
|
3
|
+
export declare function formatJson(result: AuditResult): string;
|
|
4
|
+
export declare function formatMarkdown(result: AuditResult): string;
|
|
5
|
+
//# sourceMappingURL=reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../src/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAgBvD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEtD;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAwB1D"}
|
package/dist/reporter.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const ICON = { ok: '✓', warn: '△', fail: '✗' };
|
|
2
|
+
export function formatHuman(result) {
|
|
3
|
+
const lines = [];
|
|
4
|
+
lines.push(`Goal Readiness Score: ${result.score}/100 (${result.level} — ${result.assessment})`);
|
|
5
|
+
lines.push(`Target: ${result.target}`);
|
|
6
|
+
lines.push('');
|
|
7
|
+
for (const f of result.findings) {
|
|
8
|
+
lines.push(`${ICON[f.level]} ${f.message}`);
|
|
9
|
+
}
|
|
10
|
+
if (result.recommendations.length > 0) {
|
|
11
|
+
lines.push('');
|
|
12
|
+
lines.push('Recommendations:');
|
|
13
|
+
for (const r of result.recommendations) {
|
|
14
|
+
lines.push(` • ${r}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return lines.join('\n');
|
|
18
|
+
}
|
|
19
|
+
export function formatJson(result) {
|
|
20
|
+
return JSON.stringify(result, null, 2);
|
|
21
|
+
}
|
|
22
|
+
export function formatMarkdown(result) {
|
|
23
|
+
const lines = [];
|
|
24
|
+
lines.push('# Goal Readiness Audit');
|
|
25
|
+
lines.push('');
|
|
26
|
+
lines.push(`| Metric | Value |`);
|
|
27
|
+
lines.push(`|--------|-------|`);
|
|
28
|
+
lines.push(`| Score | ${result.score}/100 |`);
|
|
29
|
+
lines.push(`| Level | ${result.level} |`);
|
|
30
|
+
lines.push(`| Assessment | ${result.assessment} |`);
|
|
31
|
+
lines.push('');
|
|
32
|
+
lines.push('## Findings');
|
|
33
|
+
lines.push('');
|
|
34
|
+
for (const f of result.findings) {
|
|
35
|
+
lines.push(`- ${ICON[f.level]} ${f.message}`);
|
|
36
|
+
}
|
|
37
|
+
if (result.recommendations.length > 0) {
|
|
38
|
+
lines.push('');
|
|
39
|
+
lines.push('## Recommendations');
|
|
40
|
+
lines.push('');
|
|
41
|
+
for (const r of result.recommendations) {
|
|
42
|
+
lines.push(`- ${r}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return lines.join('\n');
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporter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|
2
|
+
"name": "@cobusgreyling/goal-audit",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Goal engineering readiness auditor for Grok Build /goal. Compute Goal Readiness Score (G0-G3). npx @cobusgreyling/goal-audit . --suggest",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"goal-audit": "./dist/cli.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"test": "npm run build && node --test test/auditor.test.mjs",
|
|
16
|
+
"prepublishOnly": "npm test",
|
|
17
|
+
"start": "node dist/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"goal-engineering",
|
|
24
|
+
"grok-build",
|
|
25
|
+
"grok",
|
|
26
|
+
"ai-agents",
|
|
27
|
+
"coding-agents",
|
|
28
|
+
"readiness",
|
|
29
|
+
"audit"
|
|
30
|
+
],
|
|
31
|
+
"author": "Cobus Greyling",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/cobusgreyling/goal-engineering.git",
|
|
36
|
+
"directory": "tools/goal-audit"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/cobusgreyling/goal-engineering",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/cobusgreyling/goal-engineering/issues"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^25.9.3",
|
|
47
|
+
"typescript": "^5.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|