@kurvball/ashlar 0.0.0-stage → 1.3.0
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 +238 -0
- package/LICENSE +21 -0
- package/README.md +145 -2
- package/dist/affected.d.ts +19 -0
- package/dist/affected.js +78 -0
- package/dist/areas.d.ts +2 -0
- package/dist/areas.js +20 -0
- package/dist/baseline.d.ts +27 -0
- package/dist/baseline.js +109 -0
- package/dist/beside.d.ts +1 -0
- package/dist/beside.js +4 -0
- package/dist/check.d.ts +39 -0
- package/dist/check.js +109 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +211 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.js +98 -0
- package/dist/configCheck.d.ts +2 -0
- package/dist/configCheck.js +204 -0
- package/dist/css.d.ts +13 -0
- package/dist/css.js +66 -0
- package/dist/drive.d.ts +77 -0
- package/dist/drive.js +188 -0
- package/dist/features.d.ts +32 -0
- package/dist/features.js +156 -0
- package/dist/git.d.ts +18 -0
- package/dist/git.js +140 -0
- package/dist/glob.d.ts +5 -0
- package/dist/glob.js +49 -0
- package/dist/graph.d.ts +16 -0
- package/dist/graph.js +83 -0
- package/dist/identity.d.ts +1 -0
- package/dist/identity.js +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +18 -0
- package/dist/jsonc.d.ts +1 -0
- package/dist/jsonc.js +66 -0
- package/dist/knowledge/areas.d.ts +25 -0
- package/dist/knowledge/areas.js +86 -0
- package/dist/knowledge/decisions.d.ts +14 -0
- package/dist/knowledge/decisions.js +53 -0
- package/dist/knowledge/guards.d.ts +4 -0
- package/dist/knowledge/guards.js +60 -0
- package/dist/knowledge/rules.d.ts +12 -0
- package/dist/knowledge/rules.js +100 -0
- package/dist/knowledge/secrets.d.ts +6 -0
- package/dist/knowledge/secrets.js +58 -0
- package/dist/layout.d.ts +61 -0
- package/dist/layout.js +120 -0
- package/dist/ledger.d.ts +28 -0
- package/dist/ledger.js +44 -0
- package/dist/lint.d.ts +11 -0
- package/dist/lint.js +109 -0
- package/dist/map.d.ts +25 -0
- package/dist/map.js +37 -0
- package/dist/move.d.ts +18 -0
- package/dist/move.js +94 -0
- package/dist/onboard/applies.d.ts +11 -0
- package/dist/onboard/applies.js +28 -0
- package/dist/onboard/brief.d.ts +40 -0
- package/dist/onboard/brief.js +126 -0
- package/dist/onboard/guide.d.ts +7 -0
- package/dist/onboard/guide.js +150 -0
- package/dist/onboard/model.d.ts +15 -0
- package/dist/onboard/model.js +57 -0
- package/dist/onboard/onboard.d.ts +28 -0
- package/dist/onboard/onboard.js +86 -0
- package/dist/onboard/questions.d.ts +15 -0
- package/dist/onboard/questions.js +90 -0
- package/dist/onboard/snapshot.d.ts +28 -0
- package/dist/onboard/snapshot.js +58 -0
- package/dist/order.d.ts +1 -0
- package/dist/order.js +1 -0
- package/dist/origins.d.ts +6 -0
- package/dist/origins.js +51 -0
- package/dist/plugin/boundaries.d.ts +5 -0
- package/dist/plugin/boundaries.js +174 -0
- package/dist/plugin/exports.d.ts +2 -0
- package/dist/plugin/exports.js +41 -0
- package/dist/plugin/features.d.ts +4 -0
- package/dist/plugin/features.js +34 -0
- package/dist/plugin/here.d.ts +13 -0
- package/dist/plugin/here.js +69 -0
- package/dist/plugin/imports.d.ts +12 -0
- package/dist/plugin/imports.js +103 -0
- package/dist/plugin/index.d.ts +14 -0
- package/dist/plugin/index.js +19 -0
- package/dist/plugin/messages.d.ts +20 -0
- package/dist/plugin/messages.js +36 -0
- package/dist/plugin/names.d.ts +3 -0
- package/dist/plugin/names.js +68 -0
- package/dist/plugin/references.d.ts +5 -0
- package/dist/plugin/references.js +52 -0
- package/dist/plugin/text.d.ts +7 -0
- package/dist/plugin/text.js +87 -0
- package/dist/plugin/types.d.ts +87 -0
- package/dist/plugin/types.js +1 -0
- package/dist/reach.d.ts +82 -0
- package/dist/reach.js +163 -0
- package/dist/reachDrive.d.ts +31 -0
- package/dist/reachDrive.js +200 -0
- package/dist/reachReader.d.ts +1 -0
- package/dist/reachReader.js +31 -0
- package/dist/rehearse/dependents.d.ts +9 -0
- package/dist/rehearse/dependents.js +38 -0
- package/dist/rehearse/fill.d.ts +28 -0
- package/dist/rehearse/fill.js +44 -0
- package/dist/report.d.ts +6 -0
- package/dist/report.js +91 -0
- package/dist/resolve.d.ts +3 -0
- package/dist/resolve.js +114 -0
- package/dist/runner.d.ts +6 -0
- package/dist/runner.js +29 -0
- package/dist/skill.d.ts +23 -0
- package/dist/skill.js +235 -0
- package/dist/usage.d.ts +1 -0
- package/dist/usage.js +53 -0
- package/dist/workspace.d.ts +16 -0
- package/dist/workspace.js +125 -0
- package/ledger.json +201 -0
- package/package.json +73 -3
- package/schema/affected.v1.json +58 -0
- package/schema/brief.v1.json +205 -0
- package/schema/check.v1.json +151 -0
- package/schema/dependents.v1.json +30 -0
- package/schema/drive.v1.json +55 -0
- package/schema/ledger.v1.json +61 -0
- package/schema/map.v1.json +62 -0
- package/schema/move.v1.json +61 -0
- package/schema/onboard.v1.json +186 -0
- package/schema/rehearse.v1.json +91 -0
- package/schema/snapshot.v1.json +101 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { featuresOf } from '../features.js';
|
|
2
|
+
import { REACH_FILE } from '../reach.js';
|
|
3
|
+
export const REHEARSE_CONTRACT = 1;
|
|
4
|
+
export function rehearseFill(config) {
|
|
5
|
+
const features = featuresOf(config);
|
|
6
|
+
const plain = (folder) => !/[*?[\]{}]/.test(folder);
|
|
7
|
+
const reached = features.flatMap((feature) => feature.reach?.ok && plain(feature.folder) ? [{ feature, script: feature.reach.script }] : []);
|
|
8
|
+
const entries = reached.map(({ feature }) => ({
|
|
9
|
+
path: `${feature.folder}/${REACH_FILE}`,
|
|
10
|
+
covers: [`${feature.folder}/**`],
|
|
11
|
+
}));
|
|
12
|
+
return {
|
|
13
|
+
v: REHEARSE_CONTRACT,
|
|
14
|
+
manifest: { version: 1, ...(entries.length > 0 && { scenarios: { flows: entries } }) },
|
|
15
|
+
flows: reached.map(({ feature, script }) => ({
|
|
16
|
+
file: `${feature.folder}/${REACH_FILE}`,
|
|
17
|
+
flow: { name: script.name, covers: [`${feature.folder}/**`], steps: [...script.steps] },
|
|
18
|
+
})),
|
|
19
|
+
missing: features
|
|
20
|
+
.filter((feature) => !reached.some((r) => r.feature === feature))
|
|
21
|
+
.map((feature) => feature.folder),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const quoted = (text) => `'${text.replaceAll("'", "''")}'`;
|
|
25
|
+
export function fillText(fill) {
|
|
26
|
+
const lines = [
|
|
27
|
+
'# Ashlar fills these blocks of rehearse.yaml: each feature’s reach script is a flow, and it',
|
|
28
|
+
'# covers its feature’s folder. rehearse list --affected asks `ashlar dependents` for the rest.',
|
|
29
|
+
'scenarios:',
|
|
30
|
+
' flows:',
|
|
31
|
+
];
|
|
32
|
+
if (fill.manifest.scenarios) {
|
|
33
|
+
for (const entry of fill.manifest.scenarios.flows) {
|
|
34
|
+
lines.push(` - path: ${quoted(entry.path)}`, ` covers: [${entry.covers.map(quoted).join(', ')}]`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else
|
|
38
|
+
lines.push(' []');
|
|
39
|
+
if (fill.missing.length > 0) {
|
|
40
|
+
const one = fill.missing.length === 1;
|
|
41
|
+
lines.push('', `# ${fill.missing.length} ${one ? 'feature has' : 'features have'} no flow: no reach script that reads, or a glob character in the folder's name. ${fill.missing.join(', ')}.`);
|
|
42
|
+
}
|
|
43
|
+
return `${lines.join('\n')}\n`;
|
|
44
|
+
}
|
package/dist/report.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AffectedReport } from './affected.ts';
|
|
2
|
+
import type { CheckReport } from './check.ts';
|
|
3
|
+
import type { Moved } from './move.ts';
|
|
4
|
+
export declare function checkText(report: CheckReport, baselineFile: string): string;
|
|
5
|
+
export declare function affectedText(report: AffectedReport): string;
|
|
6
|
+
export declare function movedText(moves: Moved[]): string;
|
package/dist/report.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
const SHOWN = 20;
|
|
2
|
+
const number = new Intl.NumberFormat('en');
|
|
3
|
+
function plural(count, one, many) {
|
|
4
|
+
return `${number.format(count)} ${count === 1 ? one : many}`;
|
|
5
|
+
}
|
|
6
|
+
function seconds(value) {
|
|
7
|
+
return `${value.toFixed(1)} s`;
|
|
8
|
+
}
|
|
9
|
+
function place(found, rule) {
|
|
10
|
+
const at = `${found.file}:${found.line}:${found.column}`;
|
|
11
|
+
if (rule === 'max-lines')
|
|
12
|
+
return `${at}, ${plural(found.size, 'line', 'lines')} over`;
|
|
13
|
+
return found.size > 1 ? `${at}, ${plural(found.size, 'line', 'lines')}` : at;
|
|
14
|
+
}
|
|
15
|
+
function rise(report) {
|
|
16
|
+
const fresh = report.breaks.filter((found) => found.fresh);
|
|
17
|
+
const shown = fresh.length > 0 ? fresh : report.breaks;
|
|
18
|
+
const where = `${report.rule} in ${report.file}`;
|
|
19
|
+
const head = report.count > report.baseline
|
|
20
|
+
? `${where}: ${number.format(report.count)}, up from ${number.format(report.baseline)}`
|
|
21
|
+
: `${where}: ${plural(report.added, 'new one', 'new ones')} on lines changed since main. None may be added, even where others went.`;
|
|
22
|
+
const lines = [head, ...shown.slice(0, SHOWN).map((found) => ` ${place(found, report.rule)}`)];
|
|
23
|
+
if (shown.length > SHOWN)
|
|
24
|
+
lines.push(` and ${number.format(shown.length - SHOWN)} more`);
|
|
25
|
+
if (fresh.length > 0 && fresh.length < report.breaks.length) {
|
|
26
|
+
lines.push(` (${plural(report.breaks.length - fresh.length, 'other was', 'others were')} there before)`);
|
|
27
|
+
}
|
|
28
|
+
lines.push(` ${report.message}`);
|
|
29
|
+
return lines;
|
|
30
|
+
}
|
|
31
|
+
const ACCEPTED = 'taken in with --accept-rise.';
|
|
32
|
+
function takenIn(taken) {
|
|
33
|
+
const rules = new Map();
|
|
34
|
+
for (const rise of taken)
|
|
35
|
+
rules.set(rise.rule, [...(rules.get(rise.rule) ?? []), rise]);
|
|
36
|
+
return [...rules].map(([rule, rises]) => {
|
|
37
|
+
const count = rises.reduce((sum, rise) => sum + rise.count, 0);
|
|
38
|
+
const was = rises.reduce((sum, rise) => sum + rise.baseline, 0);
|
|
39
|
+
const where = rises.length === 1 ? rises[0].file : plural(rises.length, 'file', 'files');
|
|
40
|
+
return ` ${rule} rose to ${number.format(count)}, up from ${number.format(was)}, in ${where}: ${ACCEPTED}`;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function held(report) {
|
|
44
|
+
return report.rules.reduce((total, rule) => total + rule.baseline, 0);
|
|
45
|
+
}
|
|
46
|
+
export function checkText(report, baselineFile) {
|
|
47
|
+
const head = `Ashlar checked ${plural(report.files, 'file', 'files')} in ${seconds(report.seconds)}`;
|
|
48
|
+
const lines = [];
|
|
49
|
+
if (report.baseline === 'taken') {
|
|
50
|
+
lines.push(`${head} and took the baseline: ${plural(held(report), 'break', 'breaks')} in ${baselineFile}.`);
|
|
51
|
+
}
|
|
52
|
+
else if (report.baseline === 'risen') {
|
|
53
|
+
lines.push(`${head}: ${plural(report.taken.length, 'count rose', 'counts rose')}.`, ...takenIn(report.taken));
|
|
54
|
+
}
|
|
55
|
+
else if (report.ok) {
|
|
56
|
+
lines.push(`${head}: no count rose.`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
lines.push(`${head}: ${plural(report.rises.length, 'count rose', 'counts rose')}.`);
|
|
60
|
+
}
|
|
61
|
+
if (report.baseline === 'shrunk' || report.baseline === 'risen') {
|
|
62
|
+
lines.push(`The baseline now holds ${plural(held(report), 'break', 'breaks')}.`);
|
|
63
|
+
}
|
|
64
|
+
else if (report.baseline === 'held' && report.slack > 0 && report.moves.length === 0) {
|
|
65
|
+
lines.push(`${plural(report.slack, 'break', 'breaks')} in the baseline ${report.slack === 1 ? 'is' : 'are'} gone: \`ashlar check --shrink\` lowers it.`);
|
|
66
|
+
}
|
|
67
|
+
else if (report.baseline === 'none' && report.ok) {
|
|
68
|
+
lines.push('There is no baseline, so every count must stay at zero.');
|
|
69
|
+
}
|
|
70
|
+
for (const moved of report.moves) {
|
|
71
|
+
lines.push(`${moved.to} moved from ${moved.from}: \`ashlar move ${moved.from} ${moved.to}\` takes its counts with it.`);
|
|
72
|
+
}
|
|
73
|
+
for (const found of report.rises)
|
|
74
|
+
lines.push('', ...rise(found));
|
|
75
|
+
return `${lines.join('\n')}\n`;
|
|
76
|
+
}
|
|
77
|
+
export function affectedText(report) {
|
|
78
|
+
return report.tests.map((test) => `${test}\n`).join('');
|
|
79
|
+
}
|
|
80
|
+
export function movedText(moves) {
|
|
81
|
+
return moves
|
|
82
|
+
.map((moved) => {
|
|
83
|
+
const head = `${moved.from} → ${moved.to}: ${plural(moved.breaks, 'break', 'breaks')} moved.\n`;
|
|
84
|
+
const rises = moved.rises.map((rise) => {
|
|
85
|
+
const where = moved.kind === 'folder' ? `, in ${rise.file}` : '';
|
|
86
|
+
return ` ${rise.rule} rose to ${number.format(rise.count)}, up from ${number.format(rise.held)}${where}: ${ACCEPTED}\n`;
|
|
87
|
+
});
|
|
88
|
+
return head + rises.join('');
|
|
89
|
+
})
|
|
90
|
+
.join('');
|
|
91
|
+
}
|
package/dist/resolve.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { join, posix } from 'node:path';
|
|
3
|
+
import { tidy, within } from './layout.js';
|
|
4
|
+
const EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts', '.d.ts', '.js', '.jsx', '.mjs', '.cjs', '.json'];
|
|
5
|
+
const SWAPS = {
|
|
6
|
+
'.js': ['.ts', '.tsx'],
|
|
7
|
+
'.jsx': ['.tsx'],
|
|
8
|
+
'.mjs': ['.mts'],
|
|
9
|
+
'.cjs': ['.cts'],
|
|
10
|
+
};
|
|
11
|
+
function matchStar(pattern, specifier) {
|
|
12
|
+
const star = pattern.indexOf('*');
|
|
13
|
+
if (star === -1)
|
|
14
|
+
return pattern === specifier ? '' : null;
|
|
15
|
+
const head = pattern.slice(0, star);
|
|
16
|
+
const tail = pattern.slice(star + 1);
|
|
17
|
+
if (!specifier.startsWith(head) || !specifier.endsWith(tail))
|
|
18
|
+
return null;
|
|
19
|
+
if (specifier.length < head.length + tail.length)
|
|
20
|
+
return null;
|
|
21
|
+
return specifier.slice(head.length, specifier.length - tail.length);
|
|
22
|
+
}
|
|
23
|
+
export function makeResolver(root, workspace) {
|
|
24
|
+
const files = new Map();
|
|
25
|
+
const answers = new Map();
|
|
26
|
+
const isFile = (path) => {
|
|
27
|
+
let known = files.get(path);
|
|
28
|
+
if (known === undefined) {
|
|
29
|
+
known =
|
|
30
|
+
!path.startsWith('..') && statSync(join(root, path), { throwIfNoEntry: false })?.isFile() === true;
|
|
31
|
+
files.set(path, known);
|
|
32
|
+
}
|
|
33
|
+
return known;
|
|
34
|
+
};
|
|
35
|
+
const fileAt = (path) => {
|
|
36
|
+
if (path.startsWith('..'))
|
|
37
|
+
return null;
|
|
38
|
+
if (path !== '' && isFile(path))
|
|
39
|
+
return path;
|
|
40
|
+
const extension = posix.extname(path);
|
|
41
|
+
for (const swap of SWAPS[extension] ?? []) {
|
|
42
|
+
const candidate = `${path.slice(0, -extension.length)}${swap}`;
|
|
43
|
+
if (isFile(candidate))
|
|
44
|
+
return candidate;
|
|
45
|
+
}
|
|
46
|
+
for (const candidate of EXTENSIONS)
|
|
47
|
+
if (isFile(`${path}${candidate}`))
|
|
48
|
+
return `${path}${candidate}`;
|
|
49
|
+
const folder = path === '' ? 'index' : `${path}/index`;
|
|
50
|
+
for (const candidate of EXTENSIONS)
|
|
51
|
+
if (isFile(`${folder}${candidate}`))
|
|
52
|
+
return `${folder}${candidate}`;
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
const viaPaths = (config, specifier) => {
|
|
56
|
+
let best = null;
|
|
57
|
+
for (const key of Object.keys(config.paths)) {
|
|
58
|
+
const capture = matchStar(key, specifier);
|
|
59
|
+
if (capture === null)
|
|
60
|
+
continue;
|
|
61
|
+
if (!best || key.indexOf('*') > best.key.indexOf('*'))
|
|
62
|
+
best = { key, capture };
|
|
63
|
+
}
|
|
64
|
+
if (!best)
|
|
65
|
+
return null;
|
|
66
|
+
for (const target of config.paths[best.key] ?? []) {
|
|
67
|
+
const found = fileAt(tidy(posix.join(config.base, target.replace('*', best.capture))));
|
|
68
|
+
if (found)
|
|
69
|
+
return found;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
const viaPackage = (pkg, subpath) => {
|
|
74
|
+
const exact = pkg.exports[subpath];
|
|
75
|
+
if (exact)
|
|
76
|
+
return fileAt(tidy(posix.join(pkg.dir, exact)));
|
|
77
|
+
for (const [key, target] of Object.entries(pkg.exports)) {
|
|
78
|
+
const capture = matchStar(key, subpath);
|
|
79
|
+
if (capture !== null && key.includes('*')) {
|
|
80
|
+
return fileAt(tidy(posix.join(pkg.dir, target.replace('*', capture))));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
};
|
|
85
|
+
const bare = (from, specifier) => {
|
|
86
|
+
const config = workspace.tsconfigs.find((candidate) => within(from, candidate.dir));
|
|
87
|
+
const aliased = config ? viaPaths(config, specifier) : null;
|
|
88
|
+
if (aliased)
|
|
89
|
+
return aliased;
|
|
90
|
+
for (const pkg of workspace.packages) {
|
|
91
|
+
if (specifier === pkg.name)
|
|
92
|
+
return viaPackage(pkg, '.');
|
|
93
|
+
if (specifier.startsWith(`${pkg.name}/`))
|
|
94
|
+
return viaPackage(pkg, `./${specifier.slice(pkg.name.length + 1)}`);
|
|
95
|
+
}
|
|
96
|
+
return null;
|
|
97
|
+
};
|
|
98
|
+
return (from, raw) => {
|
|
99
|
+
const specifier = raw.split('?')[0];
|
|
100
|
+
const folder = posix.dirname(from);
|
|
101
|
+
const key = specifier.startsWith('.') ? `${folder}\0${specifier}` : `${from}\0${specifier}`;
|
|
102
|
+
if (answers.has(key))
|
|
103
|
+
return answers.get(key);
|
|
104
|
+
let found = null;
|
|
105
|
+
if (specifier.startsWith('.'))
|
|
106
|
+
found = fileAt(tidy(posix.join(folder, specifier)));
|
|
107
|
+
else if (specifier.startsWith('/'))
|
|
108
|
+
found = fileAt(tidy(posix.relative(root, specifier)));
|
|
109
|
+
else if (!specifier.startsWith('node:') && specifier !== '')
|
|
110
|
+
found = bare(from, specifier);
|
|
111
|
+
answers.set(key, found);
|
|
112
|
+
return found;
|
|
113
|
+
};
|
|
114
|
+
}
|
package/dist/runner.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Loaded } from './config.ts';
|
|
2
|
+
export declare function binRun(root: string, bin: string): string;
|
|
3
|
+
export declare const ashlarRun: (root: string) => string;
|
|
4
|
+
export declare const REHEARSE_MANIFESTS: string[];
|
|
5
|
+
export declare function rehearseRun(root: string): string | null;
|
|
6
|
+
export declare function driveCommandOf(config: Pick<Loaded, 'drive' | 'root'>): string | null;
|
package/dist/runner.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
const RUNNERS = [
|
|
4
|
+
['pnpm-lock.yaml', 'pnpm exec'],
|
|
5
|
+
['yarn.lock', 'yarn'],
|
|
6
|
+
['bun.lock', 'bun run'],
|
|
7
|
+
['bun.lockb', 'bun run'],
|
|
8
|
+
];
|
|
9
|
+
export function binRun(root, bin) {
|
|
10
|
+
for (let folder = root;; folder = dirname(folder)) {
|
|
11
|
+
const runner = RUNNERS.find(([lock]) => existsSync(join(folder, lock)))?.[1];
|
|
12
|
+
if (runner)
|
|
13
|
+
return `${runner} ${bin}`;
|
|
14
|
+
const last = existsSync(join(folder, 'package-lock.json')) || existsSync(join(folder, '.git'));
|
|
15
|
+
if (last || dirname(folder) === folder)
|
|
16
|
+
return `npx --no-install ${bin}`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const ashlarRun = (root) => binRun(root, 'ashlar');
|
|
20
|
+
export const REHEARSE_MANIFESTS = ['rehearse.yaml'];
|
|
21
|
+
export function rehearseRun(root) {
|
|
22
|
+
return REHEARSE_MANIFESTS.some((file) => existsSync(join(root, file))) ? binRun(root, 'rehearse') : null;
|
|
23
|
+
}
|
|
24
|
+
export function driveCommandOf(config) {
|
|
25
|
+
if (config.drive)
|
|
26
|
+
return config.drive;
|
|
27
|
+
const rehearse = rehearseRun(config.root);
|
|
28
|
+
return rehearse ? `${rehearse} drive` : null;
|
|
29
|
+
}
|
package/dist/skill.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Loaded } from './config.ts';
|
|
2
|
+
export declare const SKILLS: readonly ['verify', 'onboard'];
|
|
3
|
+
export type SkillName = (typeof SKILLS)[number];
|
|
4
|
+
export declare const isSkill: (v: unknown) => v is SkillName;
|
|
5
|
+
export declare const SKILL_FILE: Readonly<Record<SkillName, string>>;
|
|
6
|
+
export { ashlarRun } from './runner.ts';
|
|
7
|
+
export interface SkillConfig {
|
|
8
|
+
drive: string | null;
|
|
9
|
+
ashlar: string;
|
|
10
|
+
attach?: string | null;
|
|
11
|
+
rehearse?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export declare function verifySkill(config: SkillConfig): string;
|
|
14
|
+
export type SkillLoaded = Pick<Loaded, 'drive' | 'root'> & Partial<Pick<Loaded, 'skills' | 'onboard'>>;
|
|
15
|
+
export declare function onboardSkill(ashlar: string, decisions?: string, rules?: string): string;
|
|
16
|
+
export declare function skillText(name: SkillName, config: SkillLoaded): string;
|
|
17
|
+
export type SkillWrite = 'written' | 'same' | 'replaced';
|
|
18
|
+
export declare function writeSkill(config: SkillLoaded, name: SkillName, options?: {
|
|
19
|
+
force?: boolean;
|
|
20
|
+
}): SkillWrite;
|
|
21
|
+
export declare const SKILL_WRITE_WORDS: {
|
|
22
|
+
readonly [W in SkillWrite]: (file: string) => string;
|
|
23
|
+
};
|
package/dist/skill.js
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, relative } from 'node:path';
|
|
3
|
+
import { AshlarError } from './config.js';
|
|
4
|
+
import { PACKAGE } from './identity.js';
|
|
5
|
+
import { ashlarRun, rehearseRun } from './runner.js';
|
|
6
|
+
import { REACH_FILE } from './reach.js';
|
|
7
|
+
import { SCHEME_VARIABLE } from './reachDrive.js';
|
|
8
|
+
export const SKILLS = ['verify', 'onboard'];
|
|
9
|
+
export const isSkill = (v) => typeof v === 'string' && SKILLS.includes(v);
|
|
10
|
+
export const SKILL_FILE = {
|
|
11
|
+
verify: '.claude/skills/verify/SKILL.md',
|
|
12
|
+
onboard: '.claude/skills/onboard/SKILL.md',
|
|
13
|
+
};
|
|
14
|
+
export { ashlarRun } from './runner.js';
|
|
15
|
+
function attachSection(attach) {
|
|
16
|
+
if (attach)
|
|
17
|
+
return ['Save them in your worktree, and don’t commit them.', '', ...attach.trimEnd().split('\n'), ''];
|
|
18
|
+
return [
|
|
19
|
+
'Save them in your worktree, and don’t commit them.',
|
|
20
|
+
'',
|
|
21
|
+
'## 4. Name them in your report',
|
|
22
|
+
'',
|
|
23
|
+
'For each file, say which feature it shows, by its name on the map, and in one line what it shows. The',
|
|
24
|
+
'developer reads proof, not prose.',
|
|
25
|
+
'',
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
function rehearseLines(rehearse, also = true) {
|
|
29
|
+
if (!rehearse)
|
|
30
|
+
return [];
|
|
31
|
+
return [
|
|
32
|
+
'',
|
|
33
|
+
`${also ? 'The project also rehearses its changes. ' : ''}Rehearse runs each feature’s reach script as a flow, on the base`,
|
|
34
|
+
`and on your work, and compares them: \`${rehearse} run <feature folder>/reach.ts\`, from Rehearse 0.3.0.`,
|
|
35
|
+
`\`${rehearse} list --affected <files>\` says which scenarios your work reaches, through Ashlar’s import graph.`,
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
function rehearseDriveSection(rehearse, ashlar) {
|
|
39
|
+
return [
|
|
40
|
+
`The project rehearses its changes, and Rehearse drives its running app: \`${rehearse} drive start\` brings it up,`,
|
|
41
|
+
`then \`${rehearse} drive click --name "Save"\`, \`type "A first note"\`, \`key Meta+k\`, \`snapshot\`,`,
|
|
42
|
+
`\`screenshot proof.png\` and \`stop\` each take one step, and each takes \`--json\`. Rehearse drives from its`,
|
|
43
|
+
`0.3.0; before then, take the screens and the video with the project’s own tooling.`,
|
|
44
|
+
'',
|
|
45
|
+
`\`${ashlar} drive <feature>\` walks a feature’s reach through \`${rehearse} drive\`, and stops at the first step that`,
|
|
46
|
+
`fails, saying which and why. \`${ashlar} drive --all\` walks every feature.`,
|
|
47
|
+
...rehearseLines(rehearse, false),
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
function driveSection(drive, ashlar, rehearse) {
|
|
51
|
+
if (!drive && rehearse)
|
|
52
|
+
return rehearseDriveSection(rehearse, ashlar);
|
|
53
|
+
if (!drive) {
|
|
54
|
+
return [
|
|
55
|
+
`This project has no drive command yet, so \`${ashlar} drive\` can’t walk its features. Run the work with the`,
|
|
56
|
+
'project’s own tooling, and take the screens and the video with it.',
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
return [
|
|
60
|
+
`The project drives its running app with \`${drive}\`. The first command starts the app on a scratch home`,
|
|
61
|
+
`with a seeded scenario, and the app stays up between commands until \`${drive} stop\`:`,
|
|
62
|
+
'',
|
|
63
|
+
`- \`${drive} click --name "Save"\` clicks the one element with that accessible name. Add`,
|
|
64
|
+
' `--role button` when more than one element has it.',
|
|
65
|
+
`- \`${drive} type "A first note"\` types into what has focus.`,
|
|
66
|
+
`- \`${drive} key Meta+k\` presses a key, named as Playwright names it.`,
|
|
67
|
+
`- \`${drive} snapshot\` prints the accessibility tree. With \`--name\`, it prints that element's, and fails`,
|
|
68
|
+
' when nothing on screen has that name.',
|
|
69
|
+
`- \`${drive} screenshot proof.png\` saves the window as it is now.`,
|
|
70
|
+
`- \`${drive} record proof.webm\` records what follows, and \`${drive} stop\` saves it and ends the app.`,
|
|
71
|
+
'',
|
|
72
|
+
'Each command takes `--json`, and then prints its result as one JSON object.',
|
|
73
|
+
'',
|
|
74
|
+
`First walk the reach of each feature your work changes with \`${ashlar} drive <feature>\`. It restarts the app:`,
|
|
75
|
+
'it stops any app you left running, so the reach starts fresh on the seeded scenario in the scheme asked,',
|
|
76
|
+
'and it stops the app again after. It runs each step and stops at the first that fails, saying which step',
|
|
77
|
+
"and why. Give it `--scheme dark` to walk it in the dark scheme. For drive's own commands, put",
|
|
78
|
+
`\`${SCHEME_VARIABLE}=dark\` in front of the first one. \`${ashlar} drive --all\` walks every feature.`,
|
|
79
|
+
'',
|
|
80
|
+
'Then drive through what your work changed, the way the developer would reach it, and read the snapshot:',
|
|
81
|
+
'what it says is what the developer and a screen reader get.',
|
|
82
|
+
...rehearseLines(rehearse),
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
export function verifySkill(config) {
|
|
86
|
+
const { drive, ashlar, attach } = config;
|
|
87
|
+
const lines = [
|
|
88
|
+
'---',
|
|
89
|
+
'name: verify',
|
|
90
|
+
'description: Check your own work in the running app before you report it finished. Use it when your item or task changes what the developer sees or does. Find the features it changes on the feature map, drive the running work through them, and show what you saw: screens and a short video.',
|
|
91
|
+
'---',
|
|
92
|
+
'',
|
|
93
|
+
'# Verify your work',
|
|
94
|
+
'',
|
|
95
|
+
'Tests say the code does what they check. This says the work does what the developer will see. Drive the',
|
|
96
|
+
'running app the way the developer reaches it, then show what you saw, so the review reads proof, not',
|
|
97
|
+
'prose.',
|
|
98
|
+
'',
|
|
99
|
+
'## 1. Find the features your work changes',
|
|
100
|
+
'',
|
|
101
|
+
`Run \`${ashlar} map\`. It lists each feature: its name, its folder, its reach (the way in, as drive steps) and`,
|
|
102
|
+
`its proofs (the tests in its folder). \`${ashlar} map --json\` prints the same map as JSON.`,
|
|
103
|
+
'',
|
|
104
|
+
'Your work changes a feature when it changes a file in that feature’s folder. Say each feature by its name',
|
|
105
|
+
'on the map: in your report, and on everything you attach. The developer and the other agents then mean',
|
|
106
|
+
'one thing by one name.',
|
|
107
|
+
'',
|
|
108
|
+
'## 2. Drive the running work',
|
|
109
|
+
'',
|
|
110
|
+
...driveSection(drive, ashlar, config.rehearse),
|
|
111
|
+
'',
|
|
112
|
+
'If a reach stops, fix the work, not the reach. Change a reach script only when the way in itself changed,',
|
|
113
|
+
`and run \`${ashlar} drive <feature>\` until it reaches. A feature folder without a \`${REACH_FILE}\` is a break`,
|
|
114
|
+
`that \`${ashlar} check\` counts: when you add a feature folder, write its reach script.`,
|
|
115
|
+
'',
|
|
116
|
+
'A reach script is plain data: its default export is `{ name, steps }`, and it imports only types, with',
|
|
117
|
+
`\`import type { ReachScript } from '${PACKAGE}/reach'\`. Node reads it as it is, so it imports no`,
|
|
118
|
+
'component, no other module and nothing to run. Its steps name elements by the words on screen, as the',
|
|
119
|
+
'snapshot shows them, and its name is the feature’s own: no other feature may use it.',
|
|
120
|
+
'',
|
|
121
|
+
'## 3. Take screens and a short video',
|
|
122
|
+
'',
|
|
123
|
+
'- A screen of each state your work changed, in the light scheme and in the dark one.',
|
|
124
|
+
'- A short video of the developer’s way through the change: start recording just before the steps that',
|
|
125
|
+
' show it and stop just after, so it runs under a minute.',
|
|
126
|
+
'',
|
|
127
|
+
...attachSection(attach),
|
|
128
|
+
];
|
|
129
|
+
return lines.join('\n');
|
|
130
|
+
}
|
|
131
|
+
function attachOf(config) {
|
|
132
|
+
const file = config.skills?.verify.attach;
|
|
133
|
+
if (!file)
|
|
134
|
+
return null;
|
|
135
|
+
const path = join(config.root, file);
|
|
136
|
+
if (!existsSync(path)) {
|
|
137
|
+
throw new AshlarError(`skills.verify.attach names ${file}, and there is no such file.`);
|
|
138
|
+
}
|
|
139
|
+
return readFileSync(path, 'utf8');
|
|
140
|
+
}
|
|
141
|
+
export function onboardSkill(ashlar, decisions = 'DECISIONS.md', rules = '.claude/rules') {
|
|
142
|
+
return [
|
|
143
|
+
'---',
|
|
144
|
+
'name: onboard',
|
|
145
|
+
'description: Learn what a part of this codebase needs before you change it, and keep what people decide. Use it before you change files in an area you have not worked in, and whenever a person tells you how something should be done.',
|
|
146
|
+
'---',
|
|
147
|
+
'',
|
|
148
|
+
'# Know the area before you change it',
|
|
149
|
+
'',
|
|
150
|
+
`Before you change files, run \`${ashlar} brief <the files or folders>\`. It prints only what that area needs:`,
|
|
151
|
+
'the data rules, the rules that apply there, the folder rules and their gotchas, the decisions people made',
|
|
152
|
+
'about it, the features it touches and the questions still open there. Follow what it says. It never holds',
|
|
153
|
+
'access or account details, and you never ask for them.',
|
|
154
|
+
'',
|
|
155
|
+
'## When a person decides something',
|
|
156
|
+
'',
|
|
157
|
+
`When a person tells you how something should be done, and it should outlive your task, add one line to`,
|
|
158
|
+
`\`${decisions}\` with today's date, their handle, the area and the kind:`,
|
|
159
|
+
'',
|
|
160
|
+
'```markdown',
|
|
161
|
+
'- 2026-12-03 @their-handle [src/area] rule: What they decided, in their words.',
|
|
162
|
+
'```',
|
|
163
|
+
'',
|
|
164
|
+
'Add a line only on a person’s word, never on your own guess. The kinds are `decision`, `rule`, `trust`',
|
|
165
|
+
'(a document is current), `access` (who grants access to what, never a credential), `owner` (the text is',
|
|
166
|
+
'the owner’s handle) and `setup` (how to run something).',
|
|
167
|
+
'',
|
|
168
|
+
`A rule that belongs to a folder can also go in \`${rules}/<folder>.md\`, with \`paths:\` in its`,
|
|
169
|
+
'frontmatter, so every agent meets it when it opens those files. Mark one that guards against a mistake',
|
|
170
|
+
'made before with `gotcha: <ticket>`.',
|
|
171
|
+
'',
|
|
172
|
+
'## Never',
|
|
173
|
+
'',
|
|
174
|
+
'- Never put a secret, a credential, a token or an account detail anywhere in the repository. Ashlar',
|
|
175
|
+
' refuses a knowledge file that holds one.',
|
|
176
|
+
`- Never edit the generated guide. Run \`${ashlar} onboard\` to write it again from its sources.`,
|
|
177
|
+
'',
|
|
178
|
+
].join('\n');
|
|
179
|
+
}
|
|
180
|
+
export function skillText(name, config) {
|
|
181
|
+
switch (name) {
|
|
182
|
+
case 'verify':
|
|
183
|
+
return verifySkill({
|
|
184
|
+
drive: config.drive,
|
|
185
|
+
ashlar: ashlarRun(config.root),
|
|
186
|
+
attach: attachOf(config),
|
|
187
|
+
rehearse: rehearseRun(config.root),
|
|
188
|
+
});
|
|
189
|
+
case 'onboard':
|
|
190
|
+
return onboardSkill(ashlarRun(config.root), config.onboard?.decisions, config.onboard?.rules);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function inside(root, path) {
|
|
194
|
+
const from = relative(root, path);
|
|
195
|
+
return from === '' || (!from.startsWith('..') && !from.startsWith('/'));
|
|
196
|
+
}
|
|
197
|
+
function nearest(path) {
|
|
198
|
+
let at = path;
|
|
199
|
+
while (!existsSync(at) && dirname(at) !== at)
|
|
200
|
+
at = dirname(at);
|
|
201
|
+
return at;
|
|
202
|
+
}
|
|
203
|
+
function linkedOut(root, file) {
|
|
204
|
+
if (!lstatSync(file, { throwIfNoEntry: false })?.isSymbolicLink())
|
|
205
|
+
return false;
|
|
206
|
+
try {
|
|
207
|
+
return !inside(root, realpathSync(file));
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
export function writeSkill(config, name, options = {}) {
|
|
214
|
+
const shown = SKILL_FILE[name];
|
|
215
|
+
const file = join(config.root, shown);
|
|
216
|
+
const text = skillText(name, config);
|
|
217
|
+
const root = realpathSync(config.root);
|
|
218
|
+
if (!inside(root, realpathSync(nearest(dirname(file)))) || linkedOut(root, file)) {
|
|
219
|
+
throw new AshlarError(`${shown} leads out of the project: Ashlar writes skills only into it.`);
|
|
220
|
+
}
|
|
221
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
222
|
+
const was = existsSync(file) ? readFileSync(file, 'utf8') : null;
|
|
223
|
+
if (was === text)
|
|
224
|
+
return 'same';
|
|
225
|
+
if (was !== null && !options.force) {
|
|
226
|
+
throw new AshlarError(`${shown} differs from Ashlar's ${name} skill: give \`--force\` to replace it with Ashlar's.`);
|
|
227
|
+
}
|
|
228
|
+
writeFileSync(file, text);
|
|
229
|
+
return was === null ? 'written' : 'replaced';
|
|
230
|
+
}
|
|
231
|
+
export const SKILL_WRITE_WORDS = {
|
|
232
|
+
written: (file) => `Wrote ${file}.`,
|
|
233
|
+
same: (file) => `${file} is already Ashlar's skill.`,
|
|
234
|
+
replaced: (file) => `Replaced ${file} with Ashlar's skill.`,
|
|
235
|
+
};
|
package/dist/usage.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const USAGE = "Usage:\n ashlar check [--shrink] [--accept-rise] [--json]\n Runs the rules and the import graph, and fails when a file's count rises above what the\n baseline holds for that file. A file the baseline doesn't name holds none.\n --shrink writes the baseline: it takes it the first time, then only lowers each file's counts.\n A file that is gone drops out, and a file git saw renamed takes its counts to its new name.\n --accept-rise takes each count that rose into the baseline, and says what it took in.\n ashlar affected [files...] [--since <ref>] [--json]\n Lists the tests that reach the files, or the files changed since <ref>, through imports,\n stylesheets, setup files and builds. A deleted file lists the tests that imported it,\n and --json lists the deleted files apart.\n ashlar move <from> <to> [<from> <to> ...] [--accept-rise] [--json]\n Moves a file's counts in the baseline to its new name, or those of every file in a folder.\n Each file keeps what it holds now, up to what the baseline held for it.\n It refuses a move that takes in new breaks, unless --accept-rise is given.\n ashlar ledger [--json]\n Lists Ashlar's ledger: each rule and each check from the import graph, what it corrected, the\n case it came from as a test, the prose it replaced and the message agents read.\n ashlar map [--json]\n Lists each feature folder in the layout: its name, its reach and its proofs, the tests in it.\n --json prints it as JSON, in the feature map's schema.\n ashlar drive <feature> [--scheme light|dark] [--json]\n ashlar drive --all [--scheme light|dark] [--json]\n Walks a feature's reach script, step by step, through the config's drive command, or through\n rehearse drive when the project has a rehearse.yaml and names none. It stops at the first step\n that fails, saying which and why. --all walks every feature's.\n ashlar onboard [--check] [--json]\n Writes the onboarding guide from the map, DECISIONS.md and .claude/rules/: what the system is, a\n page per area, and every unknown as a question routed to its owner. --check fails when the\n guide is stale or was edited by hand, and writes nothing.\n ashlar brief <paths...> [--json]\n Prints what an agent needs before it changes those files: the data rules, the rules that apply\n there, the folder rules and gotchas, the decisions, the features and the open questions. Never\n access lines, and never a secret-shaped value.\n ashlar snapshot [--json]\n Prints where things stand today: the ratchet, the map, the decisions and questions, and each\n area's recent commits. It writes nothing.\n ashlar dependents <files...> [--json]\n Lists every file that reaches each file through imports, directly or not, and the reach script\n of each feature whose folder they touch: what Rehearse reads for rehearse list --affected.\n --json prints it in Rehearse's dependents contract.\n ashlar rehearse [--json]\n Prints the blocks of rehearse.yaml Ashlar fills: each feature's reach script as a flow that\n covers its folder. --json adds each flow as Rehearse reads it.\n ashlar skill verify|onboard [--write] [--force]\n Prints a skill for agents. verify: how an agent checks its own work with the map and drive,\n and shows what it made, through the attach section the config names, if any. onboard: how an\n agent reads its brief before it changes files, and keeps what people decide.\n --write writes it into .claude/skills/<name>/SKILL.md, and --force replaces one that differs.\n\n ashlar --version\n Prints the version of Ashlar that runs.\n";
|
package/dist/usage.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export const USAGE = `Usage:
|
|
2
|
+
ashlar check [--shrink] [--accept-rise] [--json]
|
|
3
|
+
Runs the rules and the import graph, and fails when a file's count rises above what the
|
|
4
|
+
baseline holds for that file. A file the baseline doesn't name holds none.
|
|
5
|
+
--shrink writes the baseline: it takes it the first time, then only lowers each file's counts.
|
|
6
|
+
A file that is gone drops out, and a file git saw renamed takes its counts to its new name.
|
|
7
|
+
--accept-rise takes each count that rose into the baseline, and says what it took in.
|
|
8
|
+
ashlar affected [files...] [--since <ref>] [--json]
|
|
9
|
+
Lists the tests that reach the files, or the files changed since <ref>, through imports,
|
|
10
|
+
stylesheets, setup files and builds. A deleted file lists the tests that imported it,
|
|
11
|
+
and --json lists the deleted files apart.
|
|
12
|
+
ashlar move <from> <to> [<from> <to> ...] [--accept-rise] [--json]
|
|
13
|
+
Moves a file's counts in the baseline to its new name, or those of every file in a folder.
|
|
14
|
+
Each file keeps what it holds now, up to what the baseline held for it.
|
|
15
|
+
It refuses a move that takes in new breaks, unless --accept-rise is given.
|
|
16
|
+
ashlar ledger [--json]
|
|
17
|
+
Lists Ashlar's ledger: each rule and each check from the import graph, what it corrected, the
|
|
18
|
+
case it came from as a test, the prose it replaced and the message agents read.
|
|
19
|
+
ashlar map [--json]
|
|
20
|
+
Lists each feature folder in the layout: its name, its reach and its proofs, the tests in it.
|
|
21
|
+
--json prints it as JSON, in the feature map's schema.
|
|
22
|
+
ashlar drive <feature> [--scheme light|dark] [--json]
|
|
23
|
+
ashlar drive --all [--scheme light|dark] [--json]
|
|
24
|
+
Walks a feature's reach script, step by step, through the config's drive command, or through
|
|
25
|
+
rehearse drive when the project has a rehearse.yaml and names none. It stops at the first step
|
|
26
|
+
that fails, saying which and why. --all walks every feature's.
|
|
27
|
+
ashlar onboard [--check] [--json]
|
|
28
|
+
Writes the onboarding guide from the map, DECISIONS.md and .claude/rules/: what the system is, a
|
|
29
|
+
page per area, and every unknown as a question routed to its owner. --check fails when the
|
|
30
|
+
guide is stale or was edited by hand, and writes nothing.
|
|
31
|
+
ashlar brief <paths...> [--json]
|
|
32
|
+
Prints what an agent needs before it changes those files: the data rules, the rules that apply
|
|
33
|
+
there, the folder rules and gotchas, the decisions, the features and the open questions. Never
|
|
34
|
+
access lines, and never a secret-shaped value.
|
|
35
|
+
ashlar snapshot [--json]
|
|
36
|
+
Prints where things stand today: the ratchet, the map, the decisions and questions, and each
|
|
37
|
+
area's recent commits. It writes nothing.
|
|
38
|
+
ashlar dependents <files...> [--json]
|
|
39
|
+
Lists every file that reaches each file through imports, directly or not, and the reach script
|
|
40
|
+
of each feature whose folder they touch: what Rehearse reads for rehearse list --affected.
|
|
41
|
+
--json prints it in Rehearse's dependents contract.
|
|
42
|
+
ashlar rehearse [--json]
|
|
43
|
+
Prints the blocks of rehearse.yaml Ashlar fills: each feature's reach script as a flow that
|
|
44
|
+
covers its folder. --json adds each flow as Rehearse reads it.
|
|
45
|
+
ashlar skill verify|onboard [--write] [--force]
|
|
46
|
+
Prints a skill for agents. verify: how an agent checks its own work with the map and drive,
|
|
47
|
+
and shows what it made, through the attach section the config names, if any. onboard: how an
|
|
48
|
+
agent reads its brief before it changes files, and keeps what people decide.
|
|
49
|
+
--write writes it into .claude/skills/<name>/SKILL.md, and --force replaces one that differs.
|
|
50
|
+
|
|
51
|
+
ashlar --version
|
|
52
|
+
Prints the version of Ashlar that runs.
|
|
53
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface TsPaths {
|
|
2
|
+
dir: string;
|
|
3
|
+
base: string;
|
|
4
|
+
paths: Record<string, string[]>;
|
|
5
|
+
}
|
|
6
|
+
export interface WorkspacePackage {
|
|
7
|
+
name: string;
|
|
8
|
+
dir: string;
|
|
9
|
+
exports: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export interface Workspace {
|
|
12
|
+
tsconfigs: TsPaths[];
|
|
13
|
+
packages: WorkspacePackage[];
|
|
14
|
+
}
|
|
15
|
+
export declare function walkFolders(root: string, include: string[], skip: Set<string>, onFile?: (file: string) => void): string[];
|
|
16
|
+
export declare function readWorkspace(root: string, include: string[], skip: Set<string>): Workspace;
|