bashcrawl — Constitution¶
The rules every change to this repo must satisfy, whoever makes it — a human or an AI agent. Agents read this before AGENTS.md conventions, the PRD, or the feature catalog. Ratified by merged PR; amended only per § 8.
1. Missions¶
Bashcrawl's direction is to become the ultimate open home for all things terminal learning — data, tools, resources and transparency, gathered in one place that anyone can inspect and reuse.
- Provide data, tools, resources and transparency for all stakeholders, learners, educators, terminal practitioners and the general public. Beginners, teachers, contributors, and the general public are first-class audiences. The aim is a shared, open commons: the same lessons, the same tools, and the same trail of evidence for everyone.
- Teach real POSIX terminal skills through a fantasy dungeon crawl where the filesystem is the game: directories are rooms, scroll files are lessons, and executable scripts are encounters. Lessons stay correct; a wrong command in a scroll is a defect. The classic dungeon runs in a real terminal.
- Put that dungeon in every learner's hands through two doors — the classic terminal dungeon and a free browser trainer built from the same content. Courses, story, practice arcade and reference ship alongside the dungeon, under GPL-3.0-only, in the lineage of Seth Kenlon's bashcrawl — an open toolkit for working with all things terminal learning.
These missions set the course; they do not claim the work is finished. They serve the existing constitution and PRD: real POSIX skills, two doors, and the GPL-3.0-only lineage. The earlier mission paragraph is absorbed into these three. Attribution and license principles are kept. Every feature must trace to them.
Source: ../PRD.md §1.1.
2. Invariants (non-negotiable)¶
These rules are lifted from the repo's own agent guide; breaking one is grounds to reject a PR.
- Game executables use no strict mode, emit plain text, never modify tracked files. (CLAUDE.md)
make validate-contracts && make web-build— the web app must pick the room up. (CLAUDE.md)- The engine stays classic. The root
package.jsonmust never declare"type": "module". (CLAUDE.md) - The reader layer (
web/src/terminal/prose.ts+log-decor.ts) runs after every paint. (CLAUDE.md) - The prompt answers some words with screens:
journal,menu/pause,hero/wardrobe,options/settings,titlenever reach the engine —GameStore.intercept()echoes a dim line and opens the overlay (InputTarget.intercept). (CLAUDE.md) - A new surface should get the same treatment — and never
AnimatePresence mode="wait". (CLAUDE.md) - A mini-game = (seed world + goal predicate + scoring) over a scoped bare
Runtime(BashcrawlArcade.GAMESinarcade.js) — never reimplement command behavior outsidetermforge/core/+runtime.js. (CLAUDE.md) - Dialogs animate out with
AnimatePresence, which never completes under jsdom — assert the store state, not the DOM's absence, and never usemode="wait"for a sequence of cards (the next one never mounts there); key an enter-onlymotion.divinstead. (CLAUDE.md) - Secrets (tokens, API keys) are never printed, logged or committed. (fleet rule)
CHANGELOG.md, when present, is not hand-edited once release-please owns it. (fleet rule)
3. Authority and precedence¶
When two documents disagree, the higher one wins and the lower one is fixed in the same PR:
- This constitution (and its ratified amendments in docs/amendments/)
- AGENTS.md — how to work here (commands, conventions, Definition of Done)
- The PRD (
PRD.md) — what the product must do (requirement idsFRn/NFRn) - features/features.yml — what it does today (stable feature ids)
- ADRs in
docs/adr/(none yet) and specs — why and how a specific change was made - Code, tests, generated files
4. Roles: humans and AI agents¶
| Actor | May | May not |
|---|---|---|
| Maintainer (human) | Ratify amendments, PRD changes and releases by merging PRs; change settings, secrets, branch protection | — |
| AI agent | Read this file first; open PRs on a branch with Conventional Commit titles; update the feature catalog, PRD block and docs in the same PR as the change; propose amendments | Merge a PR that is not mergeable, or one the review gate holds (§ Merge authority); push to the default branch; force-push; change repo settings or branch protection; print or commit secrets; invent features or requirements (unknown = TBD) |
5. How the artifacts relate¶
| Artifact | Answers | Owned by | Rule |
|---|---|---|---|
docs/constitution.md |
What must always hold | Maintainer | Changes only by amendment (§ 8) |
docs/amendments/NNNN-*.md |
How and why the rules changed | Proposer → maintainer | Append-only; ratified by merged PR |
AGENTS.md / CLAUDE.md |
How to work here | Repo | Must link this file; CLAUDE.md imports @AGENTS.md |
| PRD | What the product must do | Maintainer | Requirements carry stable ids (FRn, NFRn) |
features/features.yml |
What the product does, where, proven how | Repo | Every user-facing feature has an id, status, location and prd: refs |
| PRD "Feature catalog" block | PRD → feature trace | Generated | governance_lint.py prd-sync; never hand-edit |
docs/adr/NNNN-*.md |
Why a hard-to-reverse decision was made | Proposer | One ADR per decision; an amendment may cite one |
CHANGELOG.md |
What shipped | release-please | Generated from Conventional Commits; never hand-edit |
6. Change process¶
| Change | Required in the same PR |
|---|---|
| Typo, docs fix, refactor with no user-visible effect | Conventional Commit title |
| New or changed user-facing feature | Entry in features/features.yml (status, link/docs, prd:), regenerated PRD block |
| New or changed requirement | PRD edit with a new FRn/NFRn id (ids are never reused), feature prd: refs updated |
| Hard-to-reverse technical decision | ADR in docs/adr/ |
| Change to this constitution | Amendment record in docs/amendments/ (§ 8) |
7. Quality gates¶
Every PR passes the checks the repo's guide names:
make validate-contracts(AGENTS.md)make web-build(AGENTS.md)make web-test(AGENTS.md)make test(AGENTS.md)make test-js(AGENTS.md)make lint(AGENTS.md)python3 <bamr87/bamr87>/tools/governance_lint.py check .(feature catalog ↔ PRD, constitution, amendments)
8. Amendments¶
This constitution changes only through a numbered record in docs/amendments/ (NNNN-kebab-slug.md, copied from 0000-template.md):
- Propose — open a PR that adds the record (
Status: proposed) and the edit to this file it describes. Name what it affects: constitution sections, PRD requirement ids, feature ids. - Review — the maintainer reviews; an agent never approves or merges its own amendment.
- Ratify — merging the PR ratifies it. The record says
Status: ratifiedandRatified by:the PR. A rejected or withdrawn PR keeps its record with that status; numbers are never reused. - Supersede — a later amendment may replace an earlier one; mark the old record
superseded by NNNN.
Records are append-only history: fix a ratified rule with a new amendment, never by editing an old record. 0001 ratifies this document.
Merge authority and the review gate¶
(amendment agent-merge-review-gate, numbered at merge; conforms to hub constitution § 12, bamr87/bamr87 amendment. The hub's text governs.)
- Mergeable PR. A PR is mergeable only when all of these are true, rechecked against live state just before the merge: (1) the required CI checks are green; (2) the required reviews are satisfied; (3) there are no merge conflicts; (4) the review gate has passed wherever human review is required.
- An AI agent may merge a PR only when it is mergeable; otherwise it waits. Merges use a merge commit, never squash or rebase, never
--admin, and never a force-push. - Review gate. The gated categories are those in hub § 12: amendments and this constitution; secrets, budgets and billing; settings, branch protection and permissions; security-sensitive changes; deploys and the maintainer's machines; non-trivial conflicts; destructive changes; and anything labelled
agent:hold,blockedorneeds-amr. A gated PR gets theneeds-amrlabel and the Fleet status Needs Amr. An agent never merges it, and amendments are ratified only by the maintainer merging.