
lastro
io.github.srnakyo/lastro
Requirements with the requester's words, tests per criterion and a quality gate for AI agents
Documentation
Requirements, evidence and quality gates for AI-driven development. Nothing is done without lastro.
English · Português
lastro (pt-BR): the backing that gives something its value.

With AI agents, writing code is no longer the bottleneck. The bottleneck is the path between what was asked for and what was delivered:
- the request arrives in pieces (message, audio, video, document, screenshot);
- the agent fills in the gaps on its own and doesn't say so;
- the tests confirm the agent's interpretation, not the requester's;
- what was agreed gets lost between sessions and compactions;
- the requester finds the difference in production.
Lastro is an open source layer between the requester, the agent that writes the code, and whoever accepts the delivery. A requirement is only done when it has three things:
- Origin. The literal quote from the request, with its anchor: section, paragraph, page, message, minute of the video. Lastro checks the quote against the source.
- Acceptance. Criteria with the requester's examples and numbers, each written as a script (what to do, what must show, and where: a screen, a rule or the data), which says the test to write. Changing an approved requirement is a revision kept with its reason; once its delivery is merged, its criteria and tests are locked, so the agent can't quietly edit them: changing one takes an unlock, which the audit records.
- Evidence. A run that Lastro executed itself, under every condition the requirement's type demands, bound to the files it touches. When those files change, the evidence goes stale.
How it works
flowchart LR
A["Requester's material<br/>docx · pdf · chat · audio · video"] --> B["Intake<br/>source with anchors and versions"]
B --> C["Atomic requirements<br/>quote · required fields · criteria"]
C --> D{"Questions and decisions"}
D --> T["Tests first<br/>unit · integration · Playwright"]
T --> E["approved automatically<br/>(on the first verify)"]
E --> F["Agent implements<br/>(Claude Code, Codex, ...)"]
F --> G["lastro verify<br/>QA flow by type and condition"]
G --> H{"Gate"}
H -- red --> F
H -- green --> I["PR · CI · Claude Ship"]
I --> J["Item-by-item report and acceptance"]
- Postgres is the source of truth; git gets the export. One self-hosted server holds every project.
lastro exportwrites a deterministic.lastro/snapshot that is reviewed in the same pull request as the code. - No LLM inside. The agent you already use does the thinking. Lastro stores, enforces and checks. No API key, no token cost, no client data sent anywhere.
- Work in deliveries. Each piece of work asked for is a delivery that goes through scope, criteria, plan in waves, build, local test, review, merge and production, loop by loop: the project opens on them, each showing where it is now and what it still misses, and the agent moves them along while the dashboard follows live. While building, a red gate warns and checks run on the touched files; the review runs everything once, and the merge locks what was delivered.
- Nothing waits for a person. Lastro approves and starts a requirement by itself on its first verify, once its spec is complete and every criterion has its tests; the latest version of a source counts. The agent unlocks, answers, confirms decisions, signs manual stages and records acceptances by itself, with its reason, and the audit keeps who did what for you to review in the dashboard. It asks you only what falls outside the scope or is ambiguous. Only the security of the account (tokens, members, authorizing a login) stays with a person signed in.
- Tests that prove something. Each requirement type says which tests it needs (unit, integration, end to end with Playwright, in every condition) and how much of the code it touches they must run (function and line coverage, read from LCOV). A test must fail on a Lastro run before it passes, and the requester's numbers must be in it. A requirement is not verified until all of that holds. Tests run in the dev environment: what only staging or production can check goes on the criterion as one line for you (
lastro req elsewhere), andlastro req worksuggests the tests a requirement still needs, one line each. - Agnostic. Claude Code first, with a CLI and an MCP server for any agent, on any stack whose tests write JUnit and whose linters write SARIF.
See it work
What runs now. Every project with an agent at work floats as a tab at the bottom right of every screen, the latest at the right. A tab opens the project's delivery now, and the delivery shows the machines the agents run on, with their slots in use.

A delivery in depth. How far it is as a whole, the critics that read each stage, each wave opening to its criteria marked by their tests, and the test script with how long the steps ahead take and OPEN at the screen.

The scope, gate by gate. The five scope questions close in order: answering the one asked closes its gate and opens the next.

The OK to merge. The pull request at the head the review read, clean and with CI green. A person gives the OK for that SHA, never an agent, and the delivery can merge; the card has the commands to merge at that head, to record it and to roll it back.

The check in production, live. Where it runs, as which test account, at which commit, each automated step as the agent records it; when the last one passes, the delivery is done.

The dashboard
![]() | ![]() |
| Deliveries: how far each one is, the line of stages, done once and again each loop, what it is doing NOW and what is MISSING, the scope as gates, the waves, the critics, the test script to check step by step, the merge with its pull request and the check in production, followed live | Overview: where the project stands, what to do now and who does it, coverage, tests, runs and activity |
![]() | ![]() |
| Requirements: the quote next to the source passage, fields, criteria as scripts, revisions, tests by level, the live QA flow and what still holds it back | Tests: every test seen in a run, its history, flaky and orphan tests, criteria without a test |
![]() | ![]() |
| Runs: stages per condition, test results, SARIF findings, output and the comparison with the previous run | Diagrams: QA flows per type, traceability from source to test, module map and lifecycle, generated from the data |
![]() | ![]() |
| Settings: the test rules (red first, the requester's numbers, coverage), test levels per type, visual editor of QA flows, conditions, commands and gate; access tokens; members | Agents: what each agent did in each session, refused actions and stops held by the gate |
Also: a How it works page and plain-language help on every term, sources with versions and anchored passages, packages, decisions and questions, bugs with triage and billing, glossary, invariants and layout contract, an append-only audit log, light and dark themes, English and Portuguese.
Documentation is generated from the data in Markdown, HTML and PDF, each document stating the commit and date it comes from: overview, requirements by package, business rules and invariants, architecture, decisions, test plan, test cases, quality report, delivery history, diagrams and a delivery report for the requester. lastro report <PKG> writes the item-by-item report of a package in the requester's own order and numbering.

Three levels of assurance
| Level | How |
|---|---|
| Guidance | The project context (active requirements, criteria, glossary, invariants, decisions, open questions) goes back to the agent at the start of every session and after every compaction |
| Control | Claude Code hooks: the agent can't end its turn while it can fix a red gate, can't edit a locked test or the .lastro/ export |
| External blocking | lastro gate in a pre-push hook and as a required check in CI (GitHub Action included) |
Quick start
Try it first, with demo data and nothing to set: curl -fsSLO https://raw.githubusercontent.com/srnakyo/lastro/main/docker/compose.demo.yml && docker compose -f compose.demo.yml up -d, then open http://localhost:4317 and sign in as dev@lastro.local / lastro-dev-password. It is a demo: its passwords are public, so keep it on your machine. examples/coupon is a small project to run the CLI and an agent on.
1. Server (dashboard, API and MCP endpoint), on one machine with Docker. No clone, no build: the images are published for amd64 and arm64 at ghcr.io/srnakyo/lastro.
mkdir lastro && cd lastro
curl -fsSLO https://raw.githubusercontent.com/srnakyo/lastro/main/docker/compose.prod.yml
curl -fsSL https://raw.githubusercontent.com/srnakyo/lastro/main/.env.example -o .env
# in .env: LASTRO_URL, BETTER_AUTH_SECRET (openssl rand -base64 32) and POSTGRES_PASSWORD
docker compose -f compose.prod.yml up -d
Open LASTRO_URL, create your account and workspace, then a project (Projects › New project). LASTRO_VERSION in .env pins a release; to update, docker compose -f compose.prod.yml pull && docker compose -f compose.prod.yml up -d. From a clone, docker/compose.build.yml builds the images instead.
2. CLI in your repository:
npm install -g @nakyo/lastro
lastro login --url https://lastro.example.com # opens the browser: you authorize this machine, once
lastro init my-app # links this folder to the project
lastro intake "brief v4.docx"
lastro pending
lastro verify REQ-K7Q2M
lastro gate
lastro docs build --format md,pdf
lastro install-hooks # git pre-push runs lastro gate
The CLI, the server and the plugin share one version, listed in the CHANGELOG. Every answer of the server says its version, and the CLI tells you once when the two are of different minors.
3. Your agent. Claude Code takes the plugin:
/plugin marketplace add srnakyo/lastro
/plugin install lastro@lastro
The plugin uses the machine's lastro login. It adds the hooks, the lastro MCP server and the skills /lastro:start, /lastro:intake, /lastro:spec, /lastro:build, /lastro:report and /lastro:triage. For Codex, Gemini CLI or Cursor, run lastro setup codex (or gemini, cursor) in the repository: it writes the agent's instructions, the MCP server, the hooks and the workflows, with the same rules. Any other MCP client connects to lastro mcp (stdio) or to /api/mcp over HTTP with a Bearer token; the server is in the MCP Registry as io.github.srnakyo/lastro.
4. CI and review: the GitHub Action runs lastro verify and lastro gate, with a job summary. The Claude Ship templates bring a REVIEW.md for Claude Code Review and a Claude Approvals policy with the lastro_scope classifier.
References: every command with --json and its exit codes in the CLI reference; the tools, resources and prompts in the MCP reference; the REST API in OpenAPI, also served at /api/v1/openapi.json; the export files' JSON Schemas; and llms.txt for a language model to find its way.
How the CLI connects
One login per machine. lastro login opens the dashboard in your browser, shows a code to compare with the terminal and asks you to Authorize. The machine gets an agent token for every project of the workspace, kept in ~/.config/lastro/credentials.json, outside any repository. Each repository says which project it is (server.project in .lastro/lastro.yml, written by lastro init), so the same login works in every repository and nothing is switched between them.
Why a token, even on localhost. The token tells Lastro who is calling: you in the dashboard, or the agent through the CLI and Claude Code. Every action is recorded under the token that did it, so the audit shows what the agent did by itself and what you did. Creating tokens, managing members and authorizing a login stay with you, signed in to the browser: an agent can't hand itself new credentials, on localhost as on a server.
The AI sets the project up. Say "let's use Lastro" in Claude Code: the plugin's /lastro:start runs lastro init, which creates the project on the server when it does not exist (always with the strict test rules), links the folder and writes .lastro/, then brings your documents in as sources. The agent also sets up the QA commands and flows; every change to the rules, tightening or loosening, is recorded in the audit with who made it.
Tokens by hand are for what has no browser. In Workspace settings › Access tokens: a token for every project, for CI (LASTRO_URL and LASTRO_TOKEN as secrets) or lastro login --token on a server. In a project's Settings › Access tokens: a token that works only in that project; the CLI keeps it for that project and uses it in that project's folder. A person's token acts as you in the terminal. Revoke any token in the same places.
Development
Requirements: Bun 1.4, Node 22 or later and Postgres 16 (or docker compose -f docker/compose.dev.yml up -d).
bun install
cp .env.example .env # point LASTRO_DATABASE_URL and LASTRO_TEST_DATABASE_URL at your Postgres
(cd packages/database && bunx prisma migrate deploy && bunx prisma generate)
(cd apps/web && bun run dev) # http://localhost:4317
bun scripts/seed-dev.ts # dev@lastro.local / lastro-dev-password, with the shop-demo project
bun scripts/screenshots.ts # the README pictures and, on a demo database, the GIFs (scripts/gifs.ts)
bun run test # unit and integration tests against lastro_test
bunx playwright test # the real screens, desktop and phone
bunx eslint . && bun audit
| Folder | What it is |
|---|---|
apps/web | Dashboard, REST API (/api/v1) and MCP endpoint (/api/mcp): TanStack Start |
packages/core | Domain services, one folder per domain; every operation is scoped by project |
packages/database | Prisma schema and migrations, append-only audit enforced by a trigger |
packages/shared | zod contracts used by the API, the CLI, MCP and the export format |
packages/cli | The lastro command; talks to the API, never to the database |
packages/runner | Runs project commands per condition, reads JUnit and SARIF |
packages/intake | Source extractors: Markdown, DOCX with images in order, PDF, chat exports, audio and video |
packages/storage | Local or S3-compatible storage for sources, images and documents |
packages/docs | Document and Mermaid diagram generators, HTML and PDF rendering |
packages/adapters | Claude Code plugin, git hook, GitHub Action, Claude Ship templates |
The PRD describes the product: the problem, the data model, the lifecycle, the QA flows and the architecture. The ROADMAP tracks the build. .lastro/ is Lastro itself, described in its own format.
Contributing
Issues and pull requests are welcome: tell us how the gap between request and delivery shows up in your workflow, or propose an adapter for your agent or stack. CONTRIBUTING.md says how to set up, the rules the code follows and what a pull request needs; questions and ideas go to Discussions. Everyone follows the Code of Conduct, and vulnerabilities are reported privately, as SECURITY.md says.
License
@nakyo/lastronpm install @nakyo/lastro






