@kurvball/ashlar 1.9.0 → 1.10.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 +8 -0
- package/dist/cli.js +25 -23
- package/dist/decide.d.ts +6 -1
- package/dist/decide.js +102 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +9 -5
- package/dist/usage.d.ts +1 -1
- package/dist/usage.js +3 -2
- package/package.json +1 -1
- package/skill/ashlar/SKILL.md +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ changesets merged since the release before it, under its version and release dat
|
|
|
6
6
|
and patch changes; see [RELEASING.md](RELEASING.md). Versions up to 1.0.1 follow
|
|
7
7
|
[Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/).
|
|
8
8
|
|
|
9
|
+
## 1.10.0
|
|
10
|
+
|
|
11
|
+
_Released 2026-12-06._
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- `decide` is exported from `@kurvball/ashlar`, so a program records a decision without the command: it takes the config `settle` builds, or `{ root, decisions }`, the project's root and its decisions file, and returns the object `ashlar decide --json` prints. `ashlar decide --decisions <file>` and the MCP tool's `decisions` name the decisions file, from the folder Ashlar runs in, and need no `ashlar.config.ts`. `decideText` prints a report as the command does.
|
|
16
|
+
|
|
9
17
|
## 1.9.0
|
|
10
18
|
|
|
11
19
|
_Released 2026-12-06._
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import { readFileSync } from 'node:fs';
|
|
|
3
3
|
import { relative } from 'node:path';
|
|
4
4
|
import { affectedAnswer, briefAnswer, checkAnswer, mapAnswer, onboardAnswer } from './answers.js';
|
|
5
5
|
import { AshlarError, loadConfig } from './config.js';
|
|
6
|
-
import { decide, decideText } from './decide.js';
|
|
6
|
+
import { configFor, decide, decideText } from './decide.js';
|
|
7
7
|
import { init, initText } from './init.js';
|
|
8
8
|
import { errorJson, scrubbed } from './errors.js';
|
|
9
9
|
import { gateAnswer } from './gate.js';
|
|
@@ -36,7 +36,7 @@ const FLAGS = {
|
|
|
36
36
|
rehearse: ['json'],
|
|
37
37
|
mcp: [],
|
|
38
38
|
init: ['dry-run', 'json'],
|
|
39
|
-
decide: ['areas', 'by', 'kind', 'date', 'dry-run', 'json'],
|
|
39
|
+
decide: ['areas', 'by', 'kind', 'date', 'decisions', 'dry-run', 'json'],
|
|
40
40
|
};
|
|
41
41
|
const VALUED = new Map([
|
|
42
42
|
['since', 'a ref'],
|
|
@@ -45,6 +45,7 @@ const VALUED = new Map([
|
|
|
45
45
|
['by', 'a handle, such as @robin'],
|
|
46
46
|
['kind', 'a kind, such as rule'],
|
|
47
47
|
['date', 'a date, such as 2026-12-03'],
|
|
48
|
+
['decisions', 'the decisions file, such as memory/decisions.md'],
|
|
48
49
|
]);
|
|
49
50
|
function parse(args) {
|
|
50
51
|
const positional = [];
|
|
@@ -121,6 +122,28 @@ async function main(args) {
|
|
|
121
122
|
await serve();
|
|
122
123
|
return 0;
|
|
123
124
|
}
|
|
125
|
+
if (command === 'decide') {
|
|
126
|
+
if (positional.length !== 1) {
|
|
127
|
+
throw new AshlarError('Give `ashlar decide` what was decided, in quotes: ashlar decide "Prices are whole cents." --areas src/cart --by @robin');
|
|
128
|
+
}
|
|
129
|
+
const areas = values.get('areas');
|
|
130
|
+
const by = values.get('by');
|
|
131
|
+
if (areas === undefined)
|
|
132
|
+
throw new AshlarError('Name the areas it covers with `--areas`, such as `--areas src/cart`.');
|
|
133
|
+
if (by === undefined)
|
|
134
|
+
throw new AshlarError('Say who decided with `--by`, such as `--by @robin`.');
|
|
135
|
+
const config = await configFor(process.cwd(), values.get('decisions'));
|
|
136
|
+
const report = decide(config, {
|
|
137
|
+
text: positional[0],
|
|
138
|
+
areas: areas.split(','),
|
|
139
|
+
by,
|
|
140
|
+
kind: values.get('kind'),
|
|
141
|
+
date: values.get('date'),
|
|
142
|
+
dryRun: flags.has('dry-run'),
|
|
143
|
+
});
|
|
144
|
+
print(json, report, decideText(report));
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
124
147
|
const config = await loadConfig();
|
|
125
148
|
if (command === 'check') {
|
|
126
149
|
if (flags.has('gate') && (json || flags.has('shrink') || flags.has('accept-rise'))) {
|
|
@@ -199,27 +222,6 @@ async function main(args) {
|
|
|
199
222
|
print(json, fill, fillText(fill));
|
|
200
223
|
return 0;
|
|
201
224
|
}
|
|
202
|
-
if (command === 'decide') {
|
|
203
|
-
if (positional.length !== 1) {
|
|
204
|
-
throw new AshlarError('Give `ashlar decide` what was decided, in quotes: ashlar decide "Prices are whole cents." --areas src/cart --by @robin');
|
|
205
|
-
}
|
|
206
|
-
const areas = values.get('areas');
|
|
207
|
-
const by = values.get('by');
|
|
208
|
-
if (areas === undefined)
|
|
209
|
-
throw new AshlarError('Name the areas it covers with `--areas`, such as `--areas src/cart`.');
|
|
210
|
-
if (by === undefined)
|
|
211
|
-
throw new AshlarError('Say who decided with `--by`, such as `--by @robin`.');
|
|
212
|
-
const report = decide(config, {
|
|
213
|
-
text: positional[0],
|
|
214
|
-
areas: areas.split(','),
|
|
215
|
-
by,
|
|
216
|
-
kind: values.get('kind'),
|
|
217
|
-
date: values.get('date'),
|
|
218
|
-
dryRun: flags.has('dry-run'),
|
|
219
|
-
});
|
|
220
|
-
print(json, report, decideText(report));
|
|
221
|
-
return 0;
|
|
222
|
-
}
|
|
223
225
|
if (command === 'drive')
|
|
224
226
|
return drive(config, positional, flags, values);
|
|
225
227
|
if (command === 'skill')
|
package/dist/decide.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export interface DecideInput {
|
|
|
9
9
|
date?: string;
|
|
10
10
|
dryRun?: boolean;
|
|
11
11
|
}
|
|
12
|
+
export interface DecisionsAt {
|
|
13
|
+
root: string;
|
|
14
|
+
decisions: string;
|
|
15
|
+
}
|
|
12
16
|
export interface DecideReport {
|
|
13
17
|
version: typeof DECIDE_VERSION;
|
|
14
18
|
file: string;
|
|
@@ -17,5 +21,6 @@ export interface DecideReport {
|
|
|
17
21
|
decision: Decision;
|
|
18
22
|
}
|
|
19
23
|
export declare const today: (now?: Date) => string;
|
|
20
|
-
export declare function
|
|
24
|
+
export declare function configFor(cwd: string, decisions: string | undefined): Promise<Loaded>;
|
|
25
|
+
export declare function decide(given: Loaded | DecisionsAt, asked: DecideInput): DecideReport;
|
|
21
26
|
export declare function decideText(report: DecideReport): string;
|
package/dist/decide.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname, join } from 'node:path';
|
|
3
|
-
import { AshlarError } from './config.js';
|
|
1
|
+
import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync, realpathSync, statSync, writeFileSync, } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join, relative, resolve } from 'node:path';
|
|
3
|
+
import { AshlarError, CONFIG_FILE, findConfig, loadConfig, settle } from './config.js';
|
|
4
4
|
import { areasOf } from './knowledge/areas.js';
|
|
5
5
|
import { DECISION_KINDS, EVERYWHERE, HANDLE, isDate, parseDecisions, } from './knowledge/decisions.js';
|
|
6
6
|
import { secretsIn } from './knowledge/secrets.js';
|
|
@@ -93,14 +93,111 @@ function appended(existing, line) {
|
|
|
93
93
|
const gap = last === '' || last.startsWith('- ') ? '' : eol;
|
|
94
94
|
return `${ended}${gap}${line}${eol}`;
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
const outside = (path) => path === '..' || path.startsWith('../') || path.startsWith('/') || /^[A-Za-z]:/.test(path);
|
|
97
|
+
function there(path) {
|
|
98
|
+
try {
|
|
99
|
+
lstatSync(path);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function nearest(path) {
|
|
107
|
+
let found = path;
|
|
108
|
+
while (!there(found)) {
|
|
109
|
+
const up = dirname(found);
|
|
110
|
+
if (up === found)
|
|
111
|
+
return null;
|
|
112
|
+
found = up;
|
|
113
|
+
}
|
|
114
|
+
return found;
|
|
115
|
+
}
|
|
116
|
+
function realFolder(folder) {
|
|
117
|
+
const found = nearest(folder);
|
|
118
|
+
if (found === null || !existsSync(found))
|
|
119
|
+
return folder;
|
|
120
|
+
return join(realpathSync(found), relative(found, folder));
|
|
121
|
+
}
|
|
122
|
+
function withDecisions(config, given, from) {
|
|
123
|
+
const target = resolve(from, given);
|
|
124
|
+
const file = tidy(relative(config.root, join(realFolder(dirname(target)), basename(target))));
|
|
125
|
+
if (file === '')
|
|
126
|
+
throw new AshlarError('Name the decisions file, such as memory/decisions.md.');
|
|
127
|
+
if (outside(file)) {
|
|
128
|
+
throw new AshlarError(`${given} lies outside the project: name a decisions file inside it, such as memory/decisions.md.`);
|
|
129
|
+
}
|
|
130
|
+
return { ...config, onboard: { ...config.onboard, decisions: file } };
|
|
131
|
+
}
|
|
132
|
+
function bare(root) {
|
|
133
|
+
if (!statSync(root, { throwIfNoEntry: false })?.isDirectory()) {
|
|
134
|
+
throw new AshlarError(`${root} isn't a folder: give decide the project's root.`);
|
|
135
|
+
}
|
|
136
|
+
return settle({ include: ['.'], onboard: { areas: [] } }, realpathSync(root));
|
|
137
|
+
}
|
|
138
|
+
function placed(config, file) {
|
|
139
|
+
const path = join(config.root, file);
|
|
140
|
+
const found = nearest(path);
|
|
141
|
+
const at = found !== null && existsSync(found) ? realpathSync(found) : null;
|
|
142
|
+
if (found === null || at === null) {
|
|
143
|
+
throw new AshlarError(`${file} goes through a broken link: name a decisions file inside the project.`, 'decisions', {
|
|
144
|
+
file,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (outside(tidy(relative(realpathSync(config.root), at)))) {
|
|
148
|
+
throw new AshlarError(`${file} leads outside the project through a link: name a decisions file inside it.`, 'decisions', { file });
|
|
149
|
+
}
|
|
150
|
+
if (found === path && statSync(at).isDirectory()) {
|
|
151
|
+
throw new AshlarError(`${file} is a folder: name the decisions file in it.`, 'decisions', { file });
|
|
152
|
+
}
|
|
153
|
+
if (found !== path && !statSync(at).isDirectory()) {
|
|
154
|
+
throw new AshlarError(`${tidy(relative(config.root, found))} is a file, so ${file} can't go in it.`, 'decisions', { file });
|
|
155
|
+
}
|
|
156
|
+
return path;
|
|
157
|
+
}
|
|
158
|
+
export async function configFor(cwd, decisions) {
|
|
159
|
+
if (decisions === undefined) {
|
|
160
|
+
if (findConfig(cwd))
|
|
161
|
+
return loadConfig(cwd);
|
|
162
|
+
throw new AshlarError(`There is no ${CONFIG_FILE} in ${resolve(cwd)} or above it: name the decisions file instead, with --decisions (decisions for the MCP tool), such as memory/decisions.md.`, 'config');
|
|
163
|
+
}
|
|
164
|
+
const config = findConfig(cwd) ? await loadConfig(cwd) : bare(cwd);
|
|
165
|
+
return withDecisions(config, decisions, cwd);
|
|
166
|
+
}
|
|
167
|
+
function configOf(given) {
|
|
168
|
+
const loaded = given;
|
|
169
|
+
if (typeof loaded?.root === 'string' &&
|
|
170
|
+
Array.isArray(loaded.apps) &&
|
|
171
|
+
typeof loaded.onboard?.decisions === 'string')
|
|
172
|
+
return given;
|
|
173
|
+
const { root, decisions } = (given ?? {});
|
|
174
|
+
if (typeof root !== 'string' || typeof decisions !== 'string') {
|
|
175
|
+
throw new AshlarError('Give decide the config settle builds, or { root, decisions }: the project’s root and its decisions file.');
|
|
176
|
+
}
|
|
177
|
+
return withDecisions(bare(root), decisions, root);
|
|
178
|
+
}
|
|
179
|
+
function inputOf(input) {
|
|
180
|
+
const given = input;
|
|
181
|
+
const strings = [given?.kind, given?.date].every((value) => value === undefined || typeof value === 'string');
|
|
182
|
+
if (typeof given?.text !== 'string' ||
|
|
183
|
+
typeof given.by !== 'string' ||
|
|
184
|
+
!Array.isArray(given.areas) ||
|
|
185
|
+
!given.areas.every((area) => typeof area === 'string') ||
|
|
186
|
+
!strings) {
|
|
187
|
+
throw new AshlarError('Give decide { text, areas, by }, and kind, date or dryRun as you need them: areas is a list of strings, and text, by, kind and date are strings.');
|
|
188
|
+
}
|
|
189
|
+
return input;
|
|
190
|
+
}
|
|
191
|
+
export function decide(given, asked) {
|
|
192
|
+
const config = configOf(given);
|
|
193
|
+
const input = inputOf(asked);
|
|
97
194
|
const text = textOf(input.text);
|
|
98
195
|
const by = byOf(input.by);
|
|
99
196
|
const kind = kindOf(input.kind);
|
|
100
197
|
const date = dateOf(input.date);
|
|
101
198
|
const areas = areasFor(config, input.areas);
|
|
102
199
|
const file = config.onboard.decisions;
|
|
103
|
-
const path =
|
|
200
|
+
const path = placed(config, file);
|
|
104
201
|
const existing = existsSync(path) ? readFileSync(path, 'utf8') : null;
|
|
105
202
|
const before = existing === null ? [] : parseDecisions(existing, file);
|
|
106
203
|
const same = before.find((decision) => decision.kind === kind && decision.text === text && sameAreas(decision.areas, areas));
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export type { AffectedReport } from './affected.ts';
|
|
|
2
2
|
export type { BreakAt, CheckReport, RiseReport, RuleTotal } from './check.ts';
|
|
3
3
|
export { AshlarError, defineConfig, loadConfig, settle, type AshlarConfig, type Loaded, type RuleSwitch, type SkillsConfig, } from './config.ts';
|
|
4
4
|
export { checkConfig } from './configCheck.ts';
|
|
5
|
+
export { decide, decideText, type DecideInput, type DecideReport, type DecisionsAt } from './decide.ts';
|
|
5
6
|
export { DRIVE_COMMANDS, parseDrive, type DriveCommand, type DriveFailure, type DriveParse, type DriveResult, type DriveVerb, } from './drive.ts';
|
|
6
7
|
export { buildMap, featureFolders, featuresOf, type Feature, type ReachLoad } from './features.ts';
|
|
7
8
|
export { SERVICE_PACKAGES, STACKS, type AppConfig, type Build, type Setup, type Stack } from './layout.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { AshlarError, defineConfig, loadConfig, settle, } from './config.js';
|
|
2
2
|
export { checkConfig } from './configCheck.js';
|
|
3
|
+
export { decide, decideText } from './decide.js';
|
|
3
4
|
export { DRIVE_COMMANDS, parseDrive, } from './drive.js';
|
|
4
5
|
export { buildMap, featureFolders, featuresOf } from './features.js';
|
|
5
6
|
export { SERVICE_PACKAGES, STACKS } from './layout.js';
|
package/dist/mcp.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface Tool {
|
|
|
20
20
|
readOnly: boolean;
|
|
21
21
|
idempotent?: boolean;
|
|
22
22
|
run?: (config: Loaded, args: Record<string, unknown>) => Answer;
|
|
23
|
-
start?: (args: Record<string, unknown>, cwd: string) => Answer
|
|
23
|
+
start?: (args: Record<string, unknown>, cwd: string) => Answer | Promise<Answer>;
|
|
24
24
|
}
|
|
25
25
|
export declare const TOOLS: readonly Tool[];
|
|
26
26
|
export declare function outputSchemaOf(name: string): Record<string, unknown>;
|
package/dist/mcp.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { createInterface } from 'node:readline';
|
|
3
3
|
import { affectedAnswer, briefAnswer, checkAnswer, mapAnswer, onboardAnswer } from './answers.js';
|
|
4
4
|
import { AshlarError, loadConfig } from './config.js';
|
|
5
|
-
import { decide } from './decide.js';
|
|
5
|
+
import { configFor, decide } from './decide.js';
|
|
6
6
|
import { errorJson } from './errors.js';
|
|
7
7
|
import { init } from './init.js';
|
|
8
8
|
import { DECISION_KINDS } from './knowledge/decisions.js';
|
|
@@ -87,7 +87,7 @@ export const TOOLS = [
|
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
name: 'decide',
|
|
90
|
-
description: 'Records one decision a person made: adds a well-formed line to the decisions file the config names, so it is proposed in a pull request rather than written by hand. It refuses an area that is neither one of the guide’s areas nor a folder or file in the repository, a secret, and a decision the file already holds. With dryRun, answers with the line it would write, and writes nothing. Answers with decide.v1.json.',
|
|
90
|
+
description: 'Records one decision a person made: adds a well-formed line to the decisions file the config names, or the one decisions names, so it is proposed in a pull request rather than written by hand. It refuses an area that is neither one of the guide’s areas nor a folder or file in the repository, a secret, and a decision the file already holds. With dryRun, answers with the line it would write, and writes nothing. Answers with decide.v1.json.',
|
|
91
91
|
args: {
|
|
92
92
|
text: { kind: 'string', description: 'What was decided, in one line, in the person’s words.' },
|
|
93
93
|
areas: {
|
|
@@ -101,13 +101,17 @@ export const TOOLS = [
|
|
|
101
101
|
values: DECISION_KINDS,
|
|
102
102
|
},
|
|
103
103
|
date: { kind: 'string', description: 'The day it was decided, as 2026-12-03: today, unless given.' },
|
|
104
|
+
decisions: {
|
|
105
|
+
kind: 'string',
|
|
106
|
+
description: 'The decisions file, from the folder the server started in, instead of the one the config names. With it, decide needs no ashlar.config.ts.',
|
|
107
|
+
},
|
|
104
108
|
dryRun: { kind: 'boolean', description: 'Answer with the line it would write, and write nothing.' },
|
|
105
109
|
},
|
|
106
110
|
required: ['text', 'areas', 'by'],
|
|
107
111
|
readOnly: false,
|
|
108
112
|
idempotent: false,
|
|
109
|
-
|
|
110
|
-
json: decide(
|
|
113
|
+
start: async (args, cwd) => ({
|
|
114
|
+
json: decide(await configFor(cwd, text(args, 'decisions')), {
|
|
111
115
|
text: text(args, 'text'),
|
|
112
116
|
areas: paths(args, 'areas'),
|
|
113
117
|
by: text(args, 'by'),
|
|
@@ -189,7 +193,7 @@ export async function callTool(name, given, cwd = process.cwd(), log = process.s
|
|
|
189
193
|
try {
|
|
190
194
|
const args = argumentsOf(tool, given);
|
|
191
195
|
const { json, warnings = [] } = tool.start
|
|
192
|
-
? tool.start(args, cwd)
|
|
196
|
+
? await tool.start(args, cwd)
|
|
193
197
|
: tool.run(await loadConfig(cwd), args);
|
|
194
198
|
for (const warning of warnings)
|
|
195
199
|
log.write(`Warning: ${warning}\n`);
|
package/dist/usage.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const USAGE = "Usage:\n ashlar init [--dry-run] [--json]\n Finds the repository's apps, their features and areas, writes the config and takes the\n baseline, where there is no config yet. --dry-run prints the config it would write, and writes\n nothing.\n ashlar check [--shrink] [--accept-rise] [--since <ref>] [--gate] [--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 --since <ref> measures the lines a change touched, and the files it renamed, from where it\n left <ref> rather than main: on a pull request into a release line, give that line.\n --gate prints the gate answer a pull request report reads instead: ok, a one-line summary, the\n rules that moved, and each count that rose as an error on the lines the change wrote.\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 decide <what> --areas <areas> --by <@handle> [--kind <kind>] [--date <date>] [--dry-run] [--json]\n Adds one decision line to the decisions file the config names, DECISIONS.md unless onboard.decisions\n says otherwise, so an agent proposes what a person decided in a pull request. --areas takes the\n guide's areas, folders or files, separated by commas, or * for everywhere. --kind is decision,\n rule, trust, access, owner or setup, decision unless given, and --date is today unless given.\n It refuses an area it can't find, a secret, and a decision the file already holds. --dry-run\n prints the line it would write, and writes nothing.\n ashlar mcp\n Serves init, brief, check, affected, map, onboard and decide as MCP tools on stdio, for agents.\n Each tool takes its command's options and answers with the object its command prints with --json.\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";
|
|
1
|
+
export declare const USAGE = "Usage:\n ashlar init [--dry-run] [--json]\n Finds the repository's apps, their features and areas, writes the config and takes the\n baseline, where there is no config yet. --dry-run prints the config it would write, and writes\n nothing.\n ashlar check [--shrink] [--accept-rise] [--since <ref>] [--gate] [--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 --since <ref> measures the lines a change touched, and the files it renamed, from where it\n left <ref> rather than main: on a pull request into a release line, give that line.\n --gate prints the gate answer a pull request report reads instead: ok, a one-line summary, the\n rules that moved, and each count that rose as an error on the lines the change wrote.\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 decide <what> --areas <areas> --by <@handle> [--kind <kind>] [--date <date>] [--decisions <file>] [--dry-run] [--json]\n Adds one decision line to the decisions file the config names, DECISIONS.md unless onboard.decisions\n says otherwise, so an agent proposes what a person decided in a pull request. --areas takes the\n guide's areas, folders or files, separated by commas, or * for everywhere. --kind is decision,\n rule, trust, access, owner or setup, decision unless given, and --date is today unless given.\n It refuses an area it can't find, a secret, and a decision the file already holds. --decisions\n names the file instead, from the folder it runs in, and needs no ashlar.config.ts. --dry-run\n prints the line it would write, and writes nothing.\n ashlar mcp\n Serves init, brief, check, affected, map, onboard and decide as MCP tools on stdio, for agents.\n Each tool takes its command's options and answers with the object its command prints with --json.\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
CHANGED
|
@@ -40,12 +40,13 @@ export const USAGE = `Usage:
|
|
|
40
40
|
Prints what an agent needs before it changes those files: the data rules, the rules that apply
|
|
41
41
|
there, the folder rules and gotchas, the decisions, the features and the open questions. Never
|
|
42
42
|
access lines, and never a secret-shaped value.
|
|
43
|
-
ashlar decide <what> --areas <areas> --by <@handle> [--kind <kind>] [--date <date>] [--dry-run] [--json]
|
|
43
|
+
ashlar decide <what> --areas <areas> --by <@handle> [--kind <kind>] [--date <date>] [--decisions <file>] [--dry-run] [--json]
|
|
44
44
|
Adds one decision line to the decisions file the config names, DECISIONS.md unless onboard.decisions
|
|
45
45
|
says otherwise, so an agent proposes what a person decided in a pull request. --areas takes the
|
|
46
46
|
guide's areas, folders or files, separated by commas, or * for everywhere. --kind is decision,
|
|
47
47
|
rule, trust, access, owner or setup, decision unless given, and --date is today unless given.
|
|
48
|
-
It refuses an area it can't find, a secret, and a decision the file already holds. --
|
|
48
|
+
It refuses an area it can't find, a secret, and a decision the file already holds. --decisions
|
|
49
|
+
names the file instead, from the folder it runs in, and needs no ashlar.config.ts. --dry-run
|
|
49
50
|
prints the line it would write, and writes nothing.
|
|
50
51
|
ashlar mcp
|
|
51
52
|
Serves init, brief, check, affected, map, onboard and decide as MCP tools on stdio, for agents.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurvball/ashlar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "The rules for building software with agents: lint rules, an import graph with a shrink-only ratchet, a feature map and onboarding for TypeScript projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
package/skill/ashlar/SKILL.md
CHANGED
|
@@ -63,6 +63,9 @@ decision, in their words, with their handle:
|
|
|
63
63
|
- Tool: `decide` with `{ "text": "Prices are whole cents.", "areas": ["src/cart"], "by": "@robin", "kind": "rule" }`.
|
|
64
64
|
- Command: `ashlar decide "Prices are whole cents." --areas src/cart --by @robin --kind rule --json`.
|
|
65
65
|
|
|
66
|
+
In a project with no `ashlar.config.ts`, name the decisions file: `"decisions": "memory/decisions.md"` for the tool,
|
|
67
|
+
`--decisions memory/decisions.md` for the command.
|
|
68
|
+
|
|
66
69
|
It adds the line to the decisions file the config names, and answers with the `line` it wrote and where.
|
|
67
70
|
Commit it in your pull request, so people review the decision with the change. An area is one of the guide's
|
|
68
71
|
areas, a folder or a file, or `*` for everywhere. The `kind` is `decision` unless you give one: `rule` (what an
|