ashlr

Contributing

How to build, test, and ship changes to ashlr.

ashlr is MIT-licensed and developed in the open at github.com/ashlrai/ashlr-plugin. PRs welcome.

Pages in this section

ArchitectureThe mental model — MCP router, hook system, genome, server boundary. Read this first if you want to add a tool.
TestingHow to run the test suite, write new tests, and avoid the Windows flakes that bite this codebase.
ReleasesThe release process — version bumps, CHANGELOG conventions, what triggers each deploy.

Quickstart

You need:

  • Bun. The required CI check pins Bun 1.4.4, so use that version or newer to match it.
  • Node.js, for bun run fresh:check and the ashlr-plugin CLI.
  • Git, and the GitHub CLI (gh) for cloning, forking, opening PRs and arming auto-merge.
  • Perl 5 for the secret scan. It needs no extra modules and is preinstalled on macOS and most Linux distributions.
gh repo clone ashlrai/ashlr-plugin
cd ashlr-plugin
bun install
bun run typecheck                        # bunx tsc --noEmit
bun run test                             # plugin test suite
bun run smoke:tools                      # every default MCP tool registers (prints the count)
bun run bench -- --repo . --dry-run      # benchmark sanity, same as daily CI; writes nothing

The plugin and server are separate test suites with separate dependency trees. The plugin is the user-facing MCP code; the server (server/) is the optional Pro hosted backend, with its own dependencies and its own bun run check (cd server && bun install && bun run check). Use bun run test for the plugin rather than plain bun test: it prepares derived docs before the suite starts. bun run check runs every repository check; run bun install in server/, site/ and vscode/ first, as CI does. Each new git worktree needs its own bun install too.

Agents work here too

ashlr is part of the Ashlr ecosystem. Phantom and its sibling repos form an autonomous, code-first, agent-native software factory: agents do the engineering, the human sits as a passive board member, and the goal is open source RSI (recursive self-improvement). Most PRs here are opened by coding agents, and they follow the same rules as people, set in AGENTS.md: branch, commit, open a PR, and merge on green. No write access? Contribute from a fork with your own agent. Two hot-file rules keep parallel PRs from colliding:

  • New pipe server cases go in a new test file such as __tests__/pipe-server-<topic>.test.ts, not in __tests__/pipe-server.test.ts.
  • Do not commit a regenerated site/lib/docs.generated.json.

Agents that want to use the plugin, not just edit it, start at llms.txt.

From branch to main

People and agents take the same path.

  1. Branch or fork. With write access, branch from main. Without it, fork first: gh repo fork ashlrai/ashlr-plugin --clone.
  2. Check locally. Commit your work, run git fetch origin (git fetch upstream in a fork) so the base matches the main CI compares against, then run bun scripts/premerge-local.ts origin/main (in a fork whose main lags, use upstream/main). It picks the tests your committed diff affects, runs them alongside bun run typecheck within a 60-second budget (--budget-ms <n> raises it), and prints one JSON verdict. It exits 0 on "status":"pass" and 1 otherwise, and it fails rather than skips when it cannot select tests. See Testing. For docs-only changes, also run the doc tests listed in AGENTS.md.
  3. Scan for secrets. git diff origin/main...HEAD | perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures runs the same scanner CI does (in a fork, diff against upstream/main). It prints <blocked> allowed=<n>, the token-shaped matches it blocked and the test-fixture placeholders it let through, and exits 1 when <blocked> is above zero. It never prints a value.
  4. Open a PR using the template. Keep it to one concern and say how you tested it. If behavior changed, add a line under ## [Unreleased] in CHANGELOG.md.
  5. Arm auto-merge with gh pr merge --auto. That needs write access, so a maintainer arms it for a fork PR. The PR then merges through the merge queue once CI Gate is green, with no manual merge step.

What the pre-merge check runs depends on what your commits change. Text docs select no tests, so it runs only the typecheck: .md, .mdx, .rst and .txt files in a docs/ folder (including site/content/docs/), any README, CHANGELOG, CONTRIBUTING or LICENSE file, and top-level files such as AGENTS.md and llms.txt. That is narrower than CI's docs-only list: a meta.json beside the site docs, any other file under site/ or video/, and anything under .github/ (the PR template included) count as config or source and run all three suites. Markdown under commands/, skills/ and agents/ is product input, not docs. A changed test file runs just that file. A change under servers/, scripts/, hooks/, ports/, commands/, skills/, agents/ or __tests__/ runs all three suites (__tests__, server/tests and integration/tests), and so does a config file (JSON, YAML, a lockfile or a dotfile) or any other source file. A change under server/ runs server/tests and integration/tests; one under integration/ runs only integration/tests. server/ and integration/ have their own dependencies, so for those diffs run (cd server && bun install) && (cd integration && bun install) first and raise the budget, for example --budget-ms 600000. A fail whose step note says the budget ran out means the budget was too small, not that a test failed.

CI Gate is the single required check. On a PR it requires fast checks (version sync, plus install, typecheck and site release facts for code changes) and Secret-shape scan. The merge queue run always does the install, typecheck and release-facts steps, even for a docs-only PR. The full suite runs daily, and coverage, CodeQL and the benchmark also run after each merge to main. None of those is a required check, and a red run is fixed forward on main. See Testing.

Pull requests and merge-queue entries also run a Linux install smoke. OS-sensitive diffs run affected tests, typecheck and install smoke on Windows and macOS; scripts/os-path-gate.mjs defines the selected paths. Gate (linux), Gate (windows) and Gate (macos) report these jobs separately, outside CI Gate. See Testing for the job selection and failure artifacts.

A PR that touches site/** also runs Build + Deploy (Vercel) from deploy-site.yml. It builds the site, and deploys a preview when the repository's Vercel secrets are available (a fork PR gets the build only). It is not part of CI Gate, so the queue does not wait for it. cd site && bun install && bun run build reproduces a failure locally. See Releases.

The rules on main stop there. No approving review is required, and the merge queue squash-merges each PR, so the PR title becomes the commit subject on main. Write it as a conventional, imperative subject such as docs(contributing): ... or fix(grep): .... Paths listed in .github/CODEOWNERS (CI workflows, the secret-shape scanner, and files that make keyed, network or loopback requests) request the code owner's review automatically. Expect a closer look there, and keep such a change in its own PR.

To run the same checks before you push, one root bun install is enough:

bun run version:check                                    # fast checks: every manifest has the same version
bun run typecheck                                        # fast checks, code changes only
bun run site/scripts/gen-docs.ts --check --skip-corpus   # fast checks, code changes only: site release facts are fresh
git diff origin/main...HEAD | perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures   # Secret-shape scan

When a check fails

gh pr checks <pr-number> lists the checks on your PR (add --watch to wait for them). For a failed run, gh run view <run-id> --log-failed prints only the steps that failed. Each step CI Gate depends on has a local twin:

Failed stepRun locallyUsual fix
fast checks: Version sync checkbun run version:checkThe manifests disagree on the version. Only a release changes it; see Releases.
fast checks: Typecheckbun run typecheckFix the type error.
fast checks: Site release factsbun run site/scripts/gen-docs.ts --check --skip-corpusRun bun run site/scripts/gen-docs.ts and commit the files it rewrites, except site/lib/docs.generated.json.
Secret-shape scan: Scan candidate diff (fail closed)the scan command aboveTake the token-shaped string out of the diff. The scan prints counts, never the value. It reads the unchanged context lines git prints around each change as well as the added lines, so a match on an untouched line beside your edit fails too; replace that string in the same PR. A placeholder passes only in a test path (a test/, tests/, fixtures/, benches/ or examples/ folder, or a .test., .spec. or _test. file) and only if it contains FAKE, EXAMPLE, DUMMY, TEST or XXXX. A private key block never passes.

A PR can pass on its own and still fail in the merge queue. The queue runs the full fast checks against main plus the PRs queued ahead of it, and GitHub removes a PR whose run fails. Bring the branch up to date (git pull origin main, or git pull upstream main from a fork), fix it, and push. If gh pr view <pr-number> --json autoMergeRequest then shows null, auto-merge is off: arm it again with gh pr merge --auto. For a fork PR, a maintainer or fleet agent re-arms it.

Contribute from a fork with your own agent

No write access? You can still hand the whole job to Claude Code, Codex or another coding agent. Set up the fork once:

gh repo fork ashlrai/ashlr-plugin --clone   # origin = your fork, upstream = ashlrai/ashlr-plugin
cd ashlr-plugin
bun install
git fetch upstream
git switch -c fix/<topic> upstream/main   # branch from the current upstream main

Then give your agent a prompt like this:

Read AGENTS.md and the "From branch to main" section of CONTRIBUTING.md, and follow them. Fix (issue link). Keep the diff to one concern, commit, run bun scripts/premerge-local.ts upstream/main until it reports "status":"pass" (if the diff touches code, install the server/ and integration/ dependencies and raise --budget-ms first), and run the secret scan on git diff upstream/main...HEAD. Then push the branch to my fork and open a PR against ashlrai/ashlr-plugin main using the PR template.

The steps that differ from a maintainer branch use your fork and its upstream remote:

git diff upstream/main...HEAD | perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures   # scan against the PR's real base
git push -u origin fix/<topic>   # push to your fork
gh pr create --repo ashlrai/ashlr-plugin --base main --head <your-github-user>:fix/<topic> --fill

After that:

  • CI Gate runs on the PR. For a docs-only change (docs/, site/, video/, top-level Markdown, LICENSE or issue templates), the PR run of fast checks skips the install, typecheck and release-facts steps, so it is mostly version sync and the secret scan. The merge queue run always does the full fast checks. GitHub can hold workflow runs from a first-time contributor until a maintainer approves them.
  • You cannot arm auto-merge on a fork PR. A maintainer or fleet agent arms it, and the PR lands through the merge queue once CI Gate is green.
  • In a fork, origin/main is your fork's main, which stops moving once you fork. CI compares the PR against ashlrai/ashlr-plugin main, so local checks use upstream/main too.
  • If main moved on, run git pull upstream main on your branch and push again.

PR checklist

The PR template asks for most of these too, so people and agents tick the same boxes.

  • bun scripts/premerge-local.ts origin/main (upstream/main from a fork) reports "status":"pass". It covers bun run typecheck and the tests your diff affects. For a docs-only change, the doc tests in AGENTS.md pass too.
  • The secret scan is clean: git diff origin/main...HEAD | perl .github/tests/secret-shape/scrub.pl --check --allow-fixtures (upstream/main...HEAD from a fork).
  • If you changed a tool's output: the RESULT line of bun run bench -- --repo . --dry-run doesn't drop by more than 5 points against main.
  • bun run smoke:tools still reports every default tool. The expected count excludes ashlr__pipe, which registers only with ASHLR_PIPE_ENABLE=1.
  • If you added a tool or changed a tool's name, description or input schema: run bun run references:sync, and bun run references:check is clean apart from one expected line: site/lib/docs.generated.json is stale. PRs leave that file out, so the check reports it whenever the checkout holds the committed copy, as a fresh clone does. See Adding a new MCP tool.
  • If you changed skills, commands or hooks: run bun run doctor:sync and commit the rewritten .claude-plugin/install-manifest.json.
  • If you touched a manifest: bun run version:check passes.
  • If behavior changed: CHANGELOG.md has a line under ## [Unreleased].
  • No new network calls or telemetry without an opt-in.
  • If you changed the website (site/): cd site && bun install && bun run check passes.
  • Hot files left alone: new pipe server cases are in a new __tests__/pipe-server-<topic>.test.ts, and site/lib/docs.generated.json is not in the commit.
  • No agent scratch files in the commit: planning notes, investigation logs or evidence patches stay out of the repository, and the PR description carries what reviewers need.
  • The PR title is a conventional, imperative subject (it becomes the squashed commit on main), and the description says why, not just what.

Finding something to work on

New here? Start with the good first issue label; help wanted marks issues we would especially like a PR for. Comment on the issue before you start, keep the PR tied to one issue, and open an issue first if you are unsure something belongs here.

What we're looking for

  • Bug fixes with a regression test.
  • MCP tool fixes, tests and polish in servers/ (the catalog is servers/_tool-catalog.json). If you change a tool's output, the RESULT line of bun run bench -- --repo . --dry-run should not drop by more than 5 points against main. If you add a tool or change its name, description or input schema, run bun run references:sync; see Adding a new MCP tool.
  • Genome retrieval and sync in servers/_genome-*.ts. The genome, compression and budgeting algorithms themselves live in @ashlr/core-efficiency; open those PRs there.
  • Agents, slash commands and skills in agents/, commands/ and skills/. Run bun run doctor:sync after changing skills, commands or hooks; it rewrites .claude-plugin/install-manifest.json.
  • Documentation, including the pages under site/content/docs/. Some pages, such as the tool and command references, are generated from repository sources; Edit the docs lists them and what to edit instead.
  • Cross-platform fixes. Windows CI is the toughest target; flake fixes are always welcome.
  • CI fixes and benchmark harness improvements.

What gets rejected

  • Changes to the genome, compression or budgeting algorithms themselves. Those live in @ashlr/core-efficiency; open the PR there.
  • Telemetry, analytics, or tracking that isn't strictly opt-in. The contract is docs/telemetry.md.
  • Tools that depend on closed-source services without a clean local fallback.
  • Anything that breaks the privacy commitments, such as telemetry that includes paths, source, or query content.
  • Bundled third-party code that requires shipping binaries.

On this page