Config
import { defineConfig } from '@kurvball/ashlar';
export default defineConfig({ include: ['src'],});That is a whole config. include is the only key Ashlar needs. Every other key has a default, given below.
Ashlar looks for ashlar.config.ts in the folder you run it from, then in each folder above it. It also reads
ashlar.config.mts, ashlar.config.js and ashlar.config.mjs. The file's default export is the config, and
defineConfig only gives it its type. The folder that holds the file is the project's root: every path in
the config is a path from there, except the paths inside an app, which are paths from the app's root.
Ashlar checks the config as it loads it. A key it doesn't read, or a value of the wrong type, gets one line each, and the command exits with 2:
$ pnpm exec ashlar checkashlar.config.ts doesn't read: `maxLine` isn't a key Ashlar reads: include, ignore, apps, setups, tests, maxLines, baseline, drive, confined, rules, messages, skills, onboard. `rules.no-timers` names no rule: no-cross-process-import, shared-is-pure, public-api-only, no-effect, no-timer, no-dom-query, client-only, no-comment, no-disable, max-lines, named-only-in, feature-reach. `rules.no-dom-query` is 'on' or 'off'. `messages.named-only-in` lives in each `confined` entry, as its `message`.The top level
Section titled “The top level”| Key | Type | Default | Meaning |
|---|---|---|---|
include |
list of strings | none: required | The folders Ashlar checks, from the root. Give at least one. |
ignore |
list of strings | ['node_modules', 'out', 'dist', 'release'] |
Folder names skipped at any depth. Your list replaces the default, so name the defaults you still want. Folders whose names start with a dot are always skipped. |
apps |
list of apps | [] |
Each app's layout: its stack and where its sides live. See Apps. |
setups |
list of setups | [] |
Setup files and the tests they run before, with paths from the root. See Setups. |
tests |
list of strings | ['.test.ts', '.test.tsx'] |
The endings that make a file a test. |
maxLines |
whole number above 0 | 600 |
The most lines a file may hold before max-lines counts each line over. |
baseline |
string | 'ashlar.baseline.json' |
The baseline file, from the root. |
drive |
string | none | The shell command that drives the running app, such as 'pnpm drive', for a project without Rehearse. With a rehearse.yaml and no drive, ashlar drive goes through rehearse drive. |
confined |
list of confined names | [] |
Words that may appear only in the folders you name. See Confined names. |
rules |
object | every rule on | Turns a rule off for the whole project. See Rules. |
messages |
object | each rule's own message | Replaces the message agents read for a rule. See Messages. |
skills |
object | none | Settings for the skills Ashlar prints. See Skills. |
onboard |
object | see Onboard | Where onboarding reads and writes, and who owns what. |
A file is a test when its path ends with one of tests. ashlar map lists the tests in a feature's folder
as its proofs, and ashlar affected lists tests. shared-is-pure, client-only, no-effect, no-timer,
no-dom-query and named-only-in leave tests alone. no-comment, no-disable and max-lines check them
too.
apps: [ { root: 'apps/desktop', stack: 'tauri' }, { root: 'apps/api', stack: 'web', main: ['src'], renderer: [], shared: [], areas: ['src/*'] },],Each entry in apps is one app. Its stack gives every other key a default, so root and stack are often
all an app needs. Every path in an app is from its root. A path that ends in /* means each folder directly
inside it.
| Key | Type | Default | Meaning |
|---|---|---|---|
apps[].root |
string | none: required | The app's folder, from the project's root. |
apps[].stack |
'electron', 'tauri' or 'web' |
none: required | The app's stack. It names the default folders below. |
apps[].main |
list of strings | the stack's main folder | The folders of the main side: the services, the host or the server. |
apps[].renderer |
list of strings | the stack's renderer folder | The folders of the renderer side: the screens. [] for an app with no renderer, such as an API. |
apps[].shared |
list of strings | ['shared'] |
The folders both sides may import: types and pure functions only. |
apps[].features |
list of strings | ['<renderer>/features/*'] |
The feature folders. Each one holds a reach script. None when renderer is []. |
apps[].client |
list of strings | ['<renderer>/client'] |
The folders that talk to the services. None when renderer is []. |
apps[].primitives |
list of strings | ['<renderer>/primitives'] |
The folders of hooks and small parts that features build on. None when renderer is []. |
apps[].areas |
list of strings | ['<main>/*'] |
The service areas. Another area is imported only through its index.ts, and each area gets a page in the onboarding guide. |
apps[].bridge |
object | see below | How the renderer reaches the services. |
apps[].bridge.global |
string | none | The global the renderer reaches the services by, such as api for window.api. Features and primitives never use it. |
apps[].bridge.modules |
list of strings | [] |
Modules that talk to the services. Features and primitives never import them. |
apps[].bridge.packages |
list of strings | the stack's packages | The packages that reach the other side. Features, primitives and shared code never import them. A name ending in * matches each package it starts. |
apps[].builds |
list of builds | [] |
Tests that reach a change only through a build. See Builds. |
apps[].setups |
list of setups | [] |
The app's setup files, with paths from its root. See Setups. |
<renderer> and <main> are the stack's own folder names, as below, whatever main and renderer say.
| Stack | main |
renderer |
shared |
features |
client |
primitives |
areas |
bridge.packages |
|---|---|---|---|---|---|---|---|---|
electron |
electron-main |
electron-renderer |
shared |
electron-renderer/features/* |
electron-renderer/client |
electron-renderer/primitives |
electron-main/* |
electron |
tauri |
src-tauri |
src |
shared |
src/features/* |
src/client |
src/primitives |
src-tauri/* |
@tauri-apps/api, @tauri-apps/plugin-* |
web |
server |
client |
shared |
client/features/* |
client/client |
client/primitives |
server/* |
none |
Builds
Section titled “Builds”builds: [{ tests: ['e2e/**/*.e2e.test.ts'], reach: ['src', 'index.html', 'vite.config.ts'] }],Some tests run against a built app, so no import leads from them to the code they test. A build names those
tests and what goes into the build. When a change reaches anything in reach, ashlar affected lists every
test in tests.
| Key | Type | Default | Meaning |
|---|---|---|---|
apps[].builds[].tests |
list of strings | none: required | Globs of the tests that run against the build, from the app's root. |
apps[].builds[].reach |
list of strings | none: required | The files, folders or globs the build takes in, from the app's root. |
Setups
Section titled “Setups”setups: [{ files: ['packages/ui/src/test/setup.ts'], tests: ['packages/ui/src/**/*.test.{ts,tsx}'] }],A setup file runs before tests without any test importing it. A setup names those files and the tests they
run before, so a change to a setup file reaches those tests. setups at the top level takes paths from the
project's root; apps[].setups takes paths from the app's root.
| Key | Type | Default | Meaning |
|---|---|---|---|
setups[].files |
list of strings | none: required | The setup files, or globs of them. |
setups[].tests |
list of strings | none: required | Globs of the tests they run before. |
setups[].exclude |
list of strings | [] |
Globs of tests the setup files don't run before, though tests matches them. |
apps[].setups[].files |
list of strings | none: required | The same, from the app's root. |
apps[].setups[].tests |
list of strings | none: required | The same, from the app's root. |
apps[].setups[].exclude |
list of strings | [] |
The same, from the app's root. |
Confined names
Section titled “Confined names”confined: [ { words: ['stripe'], only: ['apps/api/src/payments'], within: ['apps'], message: 'Only `apps/api/src/payments/` names the payment provider. Call `charge` from its index instead.', },],A confined name is a word that only some folders may say, such as the name of a provider that one module
wraps. The named-only-in rule counts each string, template text, regular expression or JSX text that holds one of words
outside only. It matches whole words and ignores case. It never counts an import path, a test, or a file in
a folder named test.
| Key | Type | Default | Meaning |
|---|---|---|---|
confined[].words |
list of strings | none: required | The words to confine. Give at least one. |
confined[].only |
list of strings | [] |
The folders or files that may say them. |
confined[].within |
list of strings | [], everywhere |
Where the rule looks. Outside these folders it says nothing. |
confined[].message |
string | none: required | The message agents read when the rule counts one. |
rules: { 'no-dom-query': 'off' },rules turns a rule off for the whole project. No comment in code can, and no-disable counts any comment
that tries. Each value is 'on' or 'off', and every rule is on until you turn it off.
| Key | Type | Default | Meaning |
|---|---|---|---|
rules.<rule> |
'on' or 'off' |
'on' |
Whether ashlar check runs the rule and counts its breaks. |
The rules are no-cross-process-import, shared-is-pure, public-api-only, no-effect, no-timer,
no-dom-query, client-only, no-comment, no-disable, max-lines, named-only-in and feature-reach.
Rules says what each one counts.
Messages
Section titled “Messages”messages: { 'no-timer': 'A timer patches over a render you don’t control. Wait with `useDebounced` from `primitives/`.',},messages replaces the message agents read for a rule, in ashlar check, ashlar ledger, ashlar brief
and the onboarding guide. Use it to name your own hooks and folders.
| Key | Type | Default | Meaning |
|---|---|---|---|
messages.<rule> |
string | the rule's own message | The words agents read when the rule counts a break. |
Any rule but named-only-in takes a message here. A confined name's message is its entry's message.
Skills
Section titled “Skills”skills: { verify: { attach: 'docs/attach.md' } },| Key | Type | Default | Meaning |
|---|---|---|---|
skills.verify |
object | none | Settings for the verify skill that ashlar skill verify prints. |
skills.verify.attach |
string | none | A Markdown file, from the root, whose text ends the verify skill: where the agent puts its screens and video. Without one, the skill asks the agent to name them in its report. |
ashlar skill verify fails when skills.verify.attach names a file that isn't there. See
Agent skills.
Onboard
Section titled “Onboard”onboard: { owner: '@sam', owners: { 'apps/api': '@lee' },},onboard says where ashlar onboard, ashlar brief and ashlar snapshot read and write, and who owns what.
ashlar onboard needs onboard.owner. Every other key has a default.
| Key | Type | Default | Meaning |
|---|---|---|---|
onboard.out |
string | 'docs/onboarding' |
The folder ashlar onboard writes the guide into. It must be a folder inside the project. |
onboard.decisions |
string | 'DECISIONS.md' |
The file of decisions, one line each. |
onboard.rules |
string | '.claude/rules' |
The folder of folder rules: every .md file in it, at any depth. |
onboard.owner |
string | none | The project's default owner, as a handle such as @sam. Every question nobody else owns goes to them. |
onboard.owners |
object | {} |
Owners by folder, such as { 'apps/api': '@lee' }. The longest folder that holds an area wins, and it wins over owner lines. |
onboard.areas |
list of strings | with no apps, each folder directly inside an include folder |
More areas: folders, or folder/* for each folder directly inside one. No other glob. The apps' features and areas are always areas too. |
onboard.documents |
list of strings | README.md and each app's README.md |
The documents onboarding asks about: is each one current, and who keeps it? Files that aren't there are left out. |
onboard.dataRules |
list of strings | two rules, below | The data rules every brief and the guide carry. Your list replaces the default. |
onboard.guards |
list of strings | **/*.guard.flow.yaml, **/*.guard.rehearse.yaml |
Rehearse scenario files that guard a gotcha, found anywhere but the ignored folders. Each is a gotcha of its folder, named by its name. |
The default data rules:
- Real data never enters the repository: not in code, tests, fixtures or documents.
- Secrets are never printed, logged or written into the repository.
Answer questions and record decisions shows these keys at work.
A full example
Section titled “A full example”Every key, in one config. Most projects need far less.
import { defineConfig } from '@kurvball/ashlar';
export default defineConfig({ include: ['apps', 'packages'], ignore: ['node_modules', 'dist', 'out', 'coverage'], tests: ['.test.ts', '.test.tsx'], maxLines: 500, baseline: 'ashlar.baseline.json', drive: 'pnpm drive', apps: [ { root: 'apps/desktop', stack: 'tauri', main: ['src-tauri'], renderer: ['src'], shared: ['src/shared'], features: ['src/features/*'], client: ['src/client'], primitives: ['src/primitives'], areas: ['src-tauri/*'], bridge: { global: 'shop', modules: ['src/client/ipc.ts'], packages: ['@tauri-apps/api', '@tauri-apps/plugin-*'], }, builds: [{ tests: ['e2e/**/*.e2e.test.ts'], reach: ['src', 'index.html', 'vite.config.ts'] }], setups: [ { files: ['src/test/setup.ts'], tests: ['src/**/*.test.{ts,tsx}'], exclude: ['src/theme/*.test.ts'], }, ], }, { root: 'apps/api', stack: 'web', main: ['src'], renderer: [], shared: [], areas: ['src/*'] }, ], setups: [{ files: ['packages/money/test/setup.ts'], tests: ['packages/money/src/**/*.test.ts'] }], confined: [ { words: ['stripe'], only: ['apps/api/src/payments'], within: ['apps'], message: 'Only `apps/api/src/payments/` names the payment provider. Call `charge` from its index instead.', }, ], rules: { 'no-dom-query': 'off' }, messages: { 'no-timer': 'A timer patches over a render you don’t control. Wait with `useDebounced` from `primitives/`.', }, skills: { verify: { attach: 'docs/attach.md' } }, onboard: { out: 'docs/onboarding', decisions: 'DECISIONS.md', rules: '.claude/rules', owner: '@sam', owners: { 'apps/api': '@lee' }, areas: ['packages/*'], documents: ['README.md', 'apps/api/README.md'], dataRules: [ 'Real data never enters the repository: not in code, tests, fixtures or documents.', 'Secrets are never printed, logged or written into the repository.', 'A fixture’s email address ends in @example.com.', ], },});