Skip to content

projects

One folder per project, named in arthur.config.ts: each holds that project’s project.config.ts, everything about the project for every plugin in one place, and may hold its own vision and criteria. The project’s own piece, projects.project(...), gives its checkout or the repository Arthur clones, its ticket prefix, its install and where its vision and criteria live; each other plugin’s helper makes that plugin’s piece (youtrack.project(...), uptime.project(...), github.project(...)), which that plugin reads and checks. Accounts and tokens stay in each plugin’s own section of arthur.config.ts. Each new worktree gets the project’s install before its job starts, and arthur init onboards a new repository.

arthur.config.ts
projects({ reposDir: "../repos", folders: ["projects/shop"] }),
// projects/shop/project.config.ts
import { projects } from "@arthur/projects";
export default [projects.project({ title: "Shop", about: "The online shop for garden tools.", repo: "git@github.com:acme/shop.git", prefix: "SH" })];
  • folders: the project folders, the first the main one, which a command without --project acts on; relative to the folder Arthur runs in. Each folder’s name is its project’s name (a clone’s folder name and the word --project takes), and each holds its project.config.ts. Keep them beside arthur.config.ts (projects/<name>/), where a project file’s @arthur/* imports resolve; projects/ is ignored by Git, as arthur.config.ts is.
  • reposDir: where repo projects are cloned, outside Arthur’s home folder; relative to the folder Arthur runs in.

A project file’s own piece, projects.project({ ... }): a prefix for its ticket ids, and a path (a folder with a .git, relative to the project’s folder) or a repo (a Git URL, cloned into reposDir/<name> at load when missing). Optional: title (default its name), about (what it is and is for, which the coordinator reads), install (the command that installs a new worktree’s dependencies, "" for none; default the frozen install of its one known lockfile), and prompts ({ vision?, criteriaDir?, rolesDir? }, each a path inside the project’s folder; default spec/vision.md, .agents/arthur/criteria, .agents/arthur/roles in its repository).

arthur projects (/projects on a channel) shows the projects; arthur projects --help holds each key in full. Each command’s page, what arthur <command> --help prints, is in commands/.

Usage: arthur init <project>. Comes with the projects plugin.

Gives the repository of <project>, a project’s name (arthur projects --help), what Arthur reads, in its folder (the main checkout), each file only where nothing is there yet, and commits the files it wrote:

  • its vision, spec/vision.md, and its criteria files in .agents/arthur/criteria/: one per criteria file a registered role reads (host.jobs.criteria()), today styleguide.md, which every job and the coordinator read, verify.md, how a change is proved, which workers and reviewers read, autopilot.md, the coordinator’s, and report.md, how a page for the owner looks and is checked, which the coordinator, the retro and the auditor read. Each is a skeleton, its headings and nothing under them, for the onboarding below to draft. A name this plugin ships no skeleton for gets the criteria/<name>.md a package of this load ships (host.code, the first in load order), as that package wrote it (the core’s verify.md, its headings alone; manage’s audit.md and retro.md, delivery’s review.md); else its title alone (code-review is # Code review);
  • .nvmrc, the major version of the Node Arthur runs on (24 today), for the nvm plugin (roadmap entry 84), unless the repository has one, kept then as it is; a repository without package.json gets one too;
  • its board, spec/build.json, empty ([]), written last.

A project whose prompts names files of its project folder is refused before anything is written, since arthur init writes only its repository’s files: arthur init: project <name> keeps its prompts in its folder <folder>; arthur init and the onboarding write only repository files: write <keys> there yourself (exit code 1). An onboarding of it is refused at its spawn with the same reason.

A file is written whole under a temporary name and linked in, never over anything there (a symlink included). It prints what it created, what it left as it was, and the next step:

created: spec/vision.md, .agents/arthur/criteria/styleguide.md, .agents/arthur/criteria/verify.md, .agents/arthur/criteria/autopilot.md, .agents/arthur/criteria/report.md, .nvmrc, spec/build.json
left as it was: nothing
committed chore: arthur init: 3f2a1b9, 7 files
next: start the onboarding: arthur spawn --kind onboarding --project shop 'Onboard shop.'

It commits the files it created, and only those, as chore: arthur init, since a job’s worktree starts from HEAD: the plugin that provides delivery.commit (delivery) makes the commit as arthur commit-board commits the board, with the hooks off and after the project’s own commit-msg script (arthur commit-board --help), and its line is printed. What it refuses (the checkout’s own Git config naming a program, the project’s check, a merge in a run, Git with no identity) leaves the files written and uncommitted, exit code 1: arthur init: nothing committed: <why>; commit these files, then start the onboarding: …. Without such a plugin nothing is committed, exit code 0: nothing committed: no plugin provides delivery.commit; commit these files, then start the onboarding: ….

Refused, exit code 1, writing nothing: a project not in the list (arthur init: unknown project <name>; projects: <names>); a repository that has a board already, spec/build.json (arthur init: <project> has a board already, <path>; arthur init is for a repository without one), so a project with tickets is never given a skeleton over its own files. Of two inits of one project at the same moment, the one that finds the board written by the other is refused the same way. Wrong usage (no project, more than one, or --project): usage: arthur init <project>, exit code 2.

arthur doctor (and so arthur setup) lists, for each project without a board, a requirement that is not critical: projects <project> board: missing: no spec/build.json; without it: no tickets for <project>; fix: arthur init <project>.

The kind onboarding, with its role onboarding (packages/projects/roles/onboarding.md, reading the project’s styleguide), works on its own branch and drafts the project’s vision and criteria. Its prompt ends with the paths of those files in this project. It goes in rounds, each a run of the same job:

  1. It reads the repository and ends with ## Repository and ## Questions, numbered, each with a proposed answer.
  2. arthur continue <job id> '<answers>' brings the owner’s answers; it commits the drafts and ends with one line per file and Review focus:.
  3. Each later arthur continue revises the drafts.

When an onboarding’s run ends, the coordinator’s wake carries the procedure packages/projects/roles/coordinator/onboarding-ended.md and, for a run that finished with questions, the questions to send the owner: the numbered items under ## Questions of its final message, each with the lines under it. One onboarding sends at most 10 questions in all of its runs: past 10 the rest are cut, and a run that asks when 10 were sent gets Its <n> new questions are cut: ... Send none. How many each run sent is kept in <home>/projects/onboarding/<job id>/, one file per final message, so a wake built twice counts once. The questions are read from the final message the wake is asked with (arthur coordinator --help), so an eval’s onboarding, a job in no home, gets them too; its count is not kept.

Its merge accepts only the vision and the .md files directly in the criteria folder: the plugin provides merge.check, asked with the job as host.jobs.list() has it (kind, project, branch), which answers undefined for any other kind and for an onboarding branch that changes only those files against HEAD of the project’s checkout, and otherwise a reason naming the files: <branch> changes <files>; an onboarding's merge accepts only <vision> and <criteriaDir>/*.md, and <branch> adds or changes the symlink <files>; an onboarding's merge accepts no symlink. .nvmrc is arthur init’s, never the onboarding’s. The merge command that asks it is roadmap entry 54.

Its merge is the project’s first arthur merge, and main has no merge that command made: arthur merge lists main’s commits that change code since main’s last merge commit, from the root without one, and refuses while there are any (arthur merge --help), so a history that ends in plain commits (squash or rebase merges, a solo project) refuses it. Before that merge the coordinator asks the owner to take main as it is (arthur take-main --help): his decision (arthur decision ask --kind merge --question 'Take main of <project> as it is at <commit>, its history kept?' --option 'Take it', his answer --picked 1 on his yes), then arthur take-main --decision <its id> --project <project>, then the onboarding’s merge. The procedure an onboarding’s end brings says so.

Usage: arthur projects; on a channel /projects. Comes with the projects plugin.

Every project, in the order of folders, answered without the model; the shell and the channel get the same text. Each project’s line is the one the coordinator reads (below), and under it its folder, its open tickets (every status but merged and dropped) and the install a new worktree gets:

SH Shop (web-shop): Online shop for garden tools; it succeeds when an order is paid.
/srv/web-shop; 3 open tickets; install: npm ci

A board that cannot be read (spec/build.json broken by hand) gives that project board unreadable: <error> in place of its count; every other project is listed as usual.

Any argument is wrong usage: usage: arthur projects and exit code 2 in the shell, usage: /projects on a channel. A config or a plugin that does not load: exit code 1.

Each project has a folder of its own, named in the folders option of the plugin in arthur.config.ts; the first is the main one, which a command or a spawn without --project acts on. The folder’s name is the project’s name: lowercase letters, digits, dots and dashes, from a letter or digit; the folder name of a clone and the word --project takes. Each folder holds the project’s project.config.ts, and may hold the project’s own vision and criteria. projects/ is ignored by Git, as arthur.config.ts is, so the projects stay on the machine. Adding a project is one folder and one line in folders, then arthur projects to see it:

// arthur.config.ts: the accounts once, in each plugin's own section, and the project folders
projects({ reposDir: "/srv/repos", folders: ["projects/web-shop", "projects/docs"] }),
// projects/web-shop/project.config.ts: everything about this project, each piece made by its plugin's helper
import { projects } from "@arthur/projects";
import { uptime } from "@arthur/uptime";
export default [
projects.project({ title: "Shop", prefix: "SH", path: "/srv/web-shop", about: "Online shop for garden tools; it succeeds when an order is paid." }),
uptime.project([{ url: "https://shop.example/" }]),
];
// projects/docs/project.config.ts
import { projects } from "@arthur/projects";
export default [projects.project({ prefix: "DOC", repo: "git@example.com:acme/docs.git", install: "" })];

project.config.ts has a default export: the project’s pieces, a list, each made by a plugin’s helper, which only returns { <plugin>: <value> }. Exactly one is projects.project({ ... }), this plugin’s; at most one per plugin. Every other piece is its plugin’s to read and to check at load (its piece, docs/plugin-api.md): youtrack.project(...), github.project(...), commitRules.project(...), delivery.project(...), machines.project(...), uptime.project(...), findings.project(...). A piece no loaded plugin reads, a disabled plugin’s or a key written by hand, is a line of arthur doctor, not a refusal (arthur doctor --help).

projects.project({ ... }):

  • Required: prefix (capital letters: the prefix of its ticket ids), and exactly one of path (its repository, which must exist with a .git) or repo (a Git URL, cloned into reposDir/<name>).
  • title: the full name, one line of at most 60 characters; the name when left out.
  • about: what the project is and what it is for, one line of at most 300 characters. Without it the coordinator knows the project only by its prefix, name and title, and arthur doctor says so (projects <name> about: missing: no about, not critical).
  • install: the shell command that installs a new worktree’s dependencies; "" turns the install off.
  • prompts: { vision?, criteriaDir?, rolesDir? }, where the roles read the project’s files, each a path inside the project’s folder (not absolute, no .. out of it), read there at its real path: its vision, its criteria folder and the folder of its role overrides. Left out, each is read from the job’s worktree, as committed in its repository: spec/vision.md, .agents/arthur/criteria and .agents/arthur/roles. The core’s prompt loader reads them (arthur roles --help); the coordinator reads each project’s vision every turn (arthur coordinator --help). arthur init and the onboarding write only repository files, so they refuse a project whose prompts names its folder’s: write those files yourself.

path counts from the project’s folder, folders and reposDir from the folder Arthur runs in. Keep the folders beside arthur.config.ts: a project file’s @arthur/* imports resolve only from under Arthur’s folder. One repository may be declared several times, each checkout its own project with its own folder, prefix and checkout: a client branch is a checkout declared as its own project.

Refused at load, each refusal naming the folder or the file: a folder name of other characters, or two folders with one name (folders[<i>]: ...); a missing project.config.ts, one that does not load, or a default export that is no list; a piece that is not an object of exactly one key; a second piece of one plugin; no projects.project(...); in it, a missing prefix, both or neither of path and repo, a prefix of other characters, any other key (name among them: the folder names the project), a wrong type for a key; a title over 60 characters or an about over 300, or either with a line break; two projects with one name, prefix or title, compared without case and across the three (a name shop and a prefix SHOP are one word); two projects with one checkout; a path that is not a folder or has no .git; a repo without reposDir, or reposDir inside Arthur’s home folder; two known lockfiles and no install. An old list option is an unknown option. A refusal reads <file>: projects.project(...).<key>: <problem>.

A missing clone is made at load: into a temporary name, renamed when whole, so a clone that fails names the project and leaves no folder. A folder there already that is a clone of another origin is refused and left as it is; one of the same origin is used as it is. These refusals print each URL without its user and password, and git’s own line with any word holding an @ replaced by the repo, so they show no credential a URL holds; SSH or git’s credential helper keeps it out of the config too.

A project’s repository without a board, spec/build.json, gets what Arthur reads from arthur init <project>: the vision and criteria skeletons, an .nvmrc and an empty board; then an onboarding job drafts its vision and criteria (arthur init --help). arthur doctor names each project without a board (projects <name> board: missing: no spec/build.json, not critical).

Each load that succeeds outside a job keeps the projects’ names and checkouts in <home>/projects/checkouts, a line <name> <checkout> each, their names and folders in <home>/projects/folders, a line <name> <folder> each (the folder’s real path), and their names and ticket prefixes in <home>/projects/prefixes, a line <name> <prefix> each, each rewritten whole only when it changed; a load refused, a bad prefix included, leaves all three as they were. Every running job’s worktree guard reads checkouts on each tool call, so a project added (and loaded, as by arthur projects) is refused to every other project’s job at once, not from its next spawn; each run of a job reads checkouts and folders at its start, and its sandbox hides the other projects’ checkouts, folders and jobs’ worktrees from it, but shows it the folder <home>/projects with all it holds, prefixes included, so a commit check in a job knows the other projects’ ticket ids without reading their project.config.ts, and reads each list anew after a load rewrites it while the job runs (arthur spawn --help, “The sandbox”).

Inside a job (arthur help --help) the plugin imports only the job’s own project’s file, the folder of folders named as the project the job’s record names, and serves that project alone: arthur projects there lists it alone, another project’s file is never imported, and checkouts, folders and prefixes are left as they are. A job whose project no folder holds is refused: job <id> is of project "<name>", which no folder of projects.folders holds; a job loads only its own project, and only the core’s commands load there.

On every turn the coordinator reads one block: a line saying how it matches a word to a project, then one line per project in the order of folders, <prefix> <title> (<name>): <about>, the (<name>) left out when it equals the title and the : <about> when there is none. The matching line: a prefix, name or title, in any case, names that project; a word found in only one project’s title or about names it; a word that fits none or several makes the coordinator ask which, naming the candidates; an exact match comes first. A line is at most about 410 characters.

Every new worktree, of every kind of job, gets its dependencies before its agent starts, on the job’s machine: the project’s install when set, else the frozen install of the one known lockfile at the top of the commit the job starts from. The plugin hands the command to the job as its variable ARTHUR_INSTALL, and the job’s wrapper runs it as its first step, in the worktree, inside the job’s scope and the job’s sandbox (arthur spawn --help, “The sandbox”), so the lifecycle scripts read neither the env file nor Arthur’s environment, it writes only where the job’s agent may and in the package managers’ caches, and the job’s caps hold the install and the lifecycle scripts its dependencies run (preinstall, postinstall, prepare; they stay on, since a project’s build needs them), and what they leave running is killed at the job’s end:

  • bun.lock: bun install --frozen-lockfile
  • package-lock.json: npm ci
  • pnpm-lock.yaml: pnpm install --frozen-lockfile
  • composer.lock: composer install
  • uv.lock: uv sync --frozen

No lockfile and no install, or install: "": nothing runs. arthur continue runs no install: the worktree keeps its spawn’s. Two known lockfiles and no install refuse the spawn, which leaves no worktree and no record. An install that exits with another code than 0 ends the job at once, before any agent starts, failed: the agent did not start: install `<command>` exited <code>: <its last line of output>; its worktree and branch are kept, and its output is in the job’s log, after the line install: <command>. An arthur stop, or the job’s time or memory limit, during the install stops it and starts no agent. The install’s time limit is the job’s timeout (timeoutMinutes, or --timeout; arthur spawn --help, its “Limits”), counted from the wrapper’s start: past it the install is stopped as the agent would be, its log saying limit: time: stopping the install, and the job ends limit: time: the job ran past its timeout of <minutes> minutes, during its install; a timeout of 0, no limit, leaves an install that never returns running until arthur stop. A tool an install needs must be on the PATH of Arthur’s service (see docs/setup.md). The install runs with the PATH the prepares returned: with the nvm plugin loaded, the Node the project’s .nvmrc names comes first on it (packages/nvm/docs/nvm.md).

The same install, of a project at a commit, is provided to other plugins as projects.install: arthur merge runs it on main after a merge (arthur merge --help).