Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 45 additions & 65 deletions core/CONTRACT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,45 +55,30 @@ requester needed).

## Reporting

Write PRs, issues, design docs, reports, requests and status messages for the
reader's next action, readable without the thread they came from. Templates
(handoff, delegation brief) keep their fields; these rules govern the prose
inside them.

- Lead with the outcome; when the reader must decide or act, put that request
first, before any status.
- **PRs** open with what changes for the owner or users (`Goal`), then what
is wrong (`Problem`) and the newcomer context (`Context`); keep internal
dispatch, rulings and batch names in `Notes`, not the opening.
- **Issues** open with what is broken or wanted and who notices
(consequence), then the evidence connecting it to the cause, then the
observable evidence that closes it.
- **Design docs** open with a plain summary of what changes, what decision
is needed and the recommendation before architecture details or decision
IDs.
- Write owner-facing text in plain words without session labels, batch names,
opaque IDs or unexpanded internal terms. Name things by what they are; link
a plan or issue instead of naming it. Explain each domain term from
something you read (code, docs, issue or glossary), or if nothing explains
it say what it does here instead of naming it.
- Give the observation a conclusion rests on: command and result, number, file
or example. Say which claims behind a decision are inferred or assumed, and
what was skipped or failed.
- To a reader who has seen earlier state, report what changed and what comes
next; give a new reader the state they need to act. Include steps taken only
when they change what to trust.
- For a decision, name who decides, ask the exact question, recommend a course
and say what happens if no answer comes. Give alternatives when the choice is
real.
- **Visuals, infographics and mockups:** include a visual whenever a topic,
change, design or owner update has a structural, quantitative or UI shape
that prose alone makes slower to scan. Follow [visual guidance](VISUALS.md)
for visuals, issues referring to UI functions and UI-changing PRs.
- Every visual must carry structure, comparison or appearance the prose does
not, and the prose must stand without it. Omit visuals for small,
straightforward text- or code-only changes.
- Stop when the reader can act. Apart from the delivery ending above, do not
close by restating the opening.
Write for the reader's next action without assuming thread context. Keep handoff
and delegation templates' fields and apply these rules to their prose.

- Lead with the outcome. Put a required reader decision or action first.
- **PRs** open with user or owner impact (Goal), the Problem and newcomer
Context. Put dispatch, rulings and batch names in Notes.
- **Issues** open with what is broken or wanted, who notices, evidence of the
cause and observable closure evidence.
- **Design docs** open with what changes, the decision and recommendation
before architecture details or decision IDs.
- Use plain names and links to plans or issues. Omit session and batch labels,
opaque IDs and unexplained terms. Define domain terms from sources you read
or describe what they do here.
- Ground conclusions in a command and result, number, file or example. Identify
inferences, assumptions, skipped checks and failures.
- Give returning readers changes and next steps, and new readers enough state
to act. Include process only when it affects what to trust.
- Name the decision owner, exact question, recommendation and default without
an answer. Give alternatives for real choices.
- Include a [visual](VISUALS.md) when structure, quantities or UI are harder

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Reporting no longer points to the required UI screenshots, but Implement still relies on it for them

The old Reporting text said to follow VISUALS for issues that refer to UI functions and for UI-changing PRs. The new visual bullet is only conditional: include a visual when structure, quantities or UI are harder to scan, and omit visuals for small text or code changes. core/skills/implement/SKILL.md:26 still sends readers to Reporting for visual proof of UI changes. The required screenshots are now only in VISUALS, behind a link that reads as optional. A builder making a small CSS or markup change could read the omission clause as permission to skip the before/after screenshots that VISUALS requires. Smallest fix, likely without adding a line: add a clause to this bullet such as "UI issues and UI-changing PRs always follow VISUALS", or exclude UI changes from the omission clause.

to scan in prose. Each visual must add information and the prose must stand
alone. Omit visuals for small, straightforward text or code changes.
- Stop when the reader can act. Restate the opening only if the delivery ending
above requires it.

## Merge authority

Expand Down Expand Up @@ -169,20 +154,17 @@ runner reliability or speed) go to the front of the merge line, ahead of feature
work, through the repository's queue priority if it has one. Infra-only fixes
may use the infra-only route above.

The builder runs each full local gate once, recording command, exact head SHA,
environment fingerprint (defined by the consumer's AGENTS.md/docs), result, time
and log path. Builders, reviewers and coordinators reuse its green receipt at
the same head and fingerprint. Rerun only if head or gate inputs changed
(including rebase), fingerprint changed or cannot be shown, or receipt is missing,
red, partial or unverifiable. Reviewers still judge whether tests exercise claimed
behavior; reuse does not accept those claims. Hosted required CI and loopzero's
sandboxed check receipt remain unchanged.

Every gate, script, workflow step and pool-host job runs under the repository's
pinned interpreter and toolchain (for example `uv run` with the pinned Python),
never a host's system interpreter. An error from a missing newer-language API
means the wrong interpreter ran: fix the interpreter, not the code for an older
version.
The builder runs each full local gate once and records its command, exact head SHA,
environment fingerprint (from consumer AGENTS.md/docs), result, time and log path.
Builders, reviewers and coordinators reuse green receipts at the same head and
fingerprint. Rerun only if head or inputs changed (including rebase), the fingerprint
changed or cannot be shown, or the receipt is missing, red, partial or unverifiable.
Reviewers still verify tests prove the claimed behavior. Hosted CI and sandboxed
receipt requirements remain.

Run every gate, script, workflow step and pool-host job with the repository's
pinned toolchain, never the host interpreter. If a newer API is missing, use the
pinned interpreter rather than altering code for an older version.

## Findings

Expand Down Expand Up @@ -289,17 +271,15 @@ the failure. Exit 2 covers invalid arguments and sandbox unavailability in
Exit 3 means waiting or timeout. Review exits 4 when independent review is
unavailable and 5 when changes are requested. Interruption exits 130.

**Never pipe a `loopzero` command, even with `set -o pipefail`: the pipeline
can report the filter's exit code in place of the command's verdict.** Redirect
stdout/stderr to a file, e.g. `loopzero check >check.log 2>&1`; inspect that
file separately. Chain dependent commands with `&&`. Report the exit code
and final output line; earlier progress never proves queue/merge state.
**Never pipe `loopzero`, even with pipefail**, because it can hide the verdict.
Redirect stdout and stderr (e.g. `loopzero check >check.log 2>&1`) and read the
file separately. Chain dependent commands with `&&`. Report the exit code and
final output line. Progress alone cannot prove queue or merge state.

Use `loopzero ready --wait` and `loopzero merge --wait`, one waiter per PR.
Never use handwritten `gh` wait loops or `gh pr checks --watch`, which misses
checks not yet created. Other polling requires a deadline, visible progress,
preserved stderr and stopping on errors. Do not poll `gh pr view`,
`gh pr checks` or `gh pr list`: hidden GraphQL shares account quota. Use REST
`gh api` for one-off PR reads/comments. After a quota error, wait for a
verified reset or `Retry-After` before any GitHub-backed command, `loopzero`
waiters included; REST `/rate_limit` does not prove GraphQL capacity.
Never use handwritten `gh` waits or `gh pr checks --watch` (it misses future checks).
Other polling needs a deadline, visible progress, preserved stderr and a stop on errors.
Never poll GraphQL-backed `gh pr view`, `gh pr checks` or `gh pr list` (shared quota).
Use REST `gh api` for one-off PR reads and comments. After a quota error, wait for
a verified reset or `Retry-After` before GitHub-backed commands, including
`loopzero` waiters. REST `/rate_limit` does not prove GraphQL capacity.
31 changes: 11 additions & 20 deletions core/VISUALS.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
# Visual formats and channels

- **Steps, branches or states** (pipelines, lifecycles, before/after flow)
→ flowchart or state diagram.
- **3+ components, ownership or trust/data boundaries** → component or
boundary diagram.
- **2+ options, trade-offs or before/after behaviors** → comparison table
or decision matrix.
- **Trends, proportions, latency/cost or counts over time** (status updates,
briefings, retros, proposals) → chart or compact infographic.
- **UI layout, navigation, visual hierarchy or interactive flow** (design
docs, UI issues, owner product choices) → standalone mockup
([design-mockup](skills/design-mockup/SKILL.md)) or annotated wireframe
before coding. **Every issue that refers to a UI function** (bug, feature,
change or help text) shows that UI when filed: an annotated screenshot of
the current screen, plus a mockup of any intended change. **UI-changing
PRs** attach before/after (or expected vs. actual) screenshots.
- **Match the channel:** in interactive owner chat (such as T3), render
charts, infographics and HTML mockups inline or embed Mermaid/images; on
GitHub (PRs, issues, checked-in design docs), use Mermaid and Markdown
tables, and embed a static PNG preview whenever linking a checked-in HTML
mockup (GitHub does not render `.html` inline).
- **Steps, branches or states** → flowchart or state diagram.
- **3+ components, ownership or trust/data boundaries** → component or boundary diagram.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Part of the headroom comes from wider lines rather than less text

scripts/size_budget.sh counts lines, not characters. Several rewritten lines are well past the surrounding ~80-column wrap, for example VISUALS.md lines 4–12, the receipt-reuse and out-of-scope-defect lines in implement/SKILL.md (about 110–130 characters), and the gh polling lines in CONTRACT.md Failure. Some of the 44-line reduction therefore reflows text instead of shortening it, which overstates the real headroom and makes later diffs noisier. Some files already contain long lines, so this does not block. For a genuine reduction, rewrap the changed passages to the files' prevailing width and confirm the size script still reports ≤1,460.

- **2+ options, trade-offs or before/after behaviors** → table or decision matrix.
- **Trends, proportions, latency/cost or counts over time** → chart or compact infographic.
- **UI layout, navigation, hierarchy or flow** → standalone [mockup](skills/design-mockup/SKILL.md)
or annotated wireframe before coding. File every issue referring to a UI function with
an annotated screenshot of the current UI and a mockup of any intended change.
UI-changing PRs attach before/after (or expected vs. actual) screenshots.
- **Interactive owner chat** → render charts, infographics or HTML inline, or embed
Mermaid/images. **GitHub** → use Mermaid or Markdown tables and embed a static
PNG preview whenever linking a checked-in HTML mockup.
39 changes: 16 additions & 23 deletions core/skills/implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ implementing the change. For changes touching guards, auth, permissions,
sessions, secrets or trust boundaries, record a short design pass in Notes
before the first code edit: threats, invariants and chosen approach.

Implement that bounded acceptance with behavior proof; use
[write-tests](../write-tests/SKILL.md) for test design and regression evidence.
For migrations,
authorization, locking/concurrency or policy logic, list edge cases in Acceptance
and map each to a test or recorded evidence. Observe required UI/runtime behavior within actual permissions; include visual
proof for UI changes per [Reporting](../../CONTRACT.md#reporting). Required
acceptance that remains unobserved stays open
with a next-action owner. Record the tested revision, observations, trade-offs
and limits in Notes or human Validation. Start primary review only with a
completed passing `loopzero check` receipt for the exact pushed head. Focused
tests and running checks are intermediate evidence. Reuse a passing same-head
receipt under the [contract's reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority).
Use [write-tests](../write-tests/SKILL.md) to prove the bounded acceptance.
Map migration, authorization, locking/concurrency and policy edge cases to tests
or evidence in Acceptance. Observe required UI and runtime behavior under actual
permissions, with visual proof for UI changes per [Reporting](../../CONTRACT.md#reporting).
Leave unobserved acceptance open with a next-action owner. Record revision,
observations, trade-offs and limits in Notes or human Validation.
Primary review requires a completed passing `loopzero check` receipt at the pushed head.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The primary-review receipt no longer says "exact" pushed head

"completed passing loopzero check receipt for the exact pushed head" became "...at the pushed head". Elsewhere, the docs and the task's own map ("the exact-head primary receipt") use "exact" for the SHA-identity requirement. Dropping it here is a small loss of precision in a rule this repository treats as strict. Restore "exact" at no line cost. In the same paragraph, "Record the tested revision" became "Record revision". Consider restoring "tested" so it is clear which revision is recorded.

Focused or ongoing checks are intermediate. Follow the [receipt reuse rules](../../CONTRACT.md#gate-execution-and-delivery-priority).

Run commands expected to take more than about two minutes detached as in
[Long-running jobs](../../../docs/DELEGATION.md#long-running-jobs).
Expand Down Expand Up @@ -66,18 +62,15 @@ Before the check and draft push for primary review, rebase your own commits onto
Leave base merges out of a branch awaiting its delta.
For base or check-script changes after review, follow the
[Review budget](../../CONTRACT.md#review-budget).
Preserve the primary for the delta and the delta for
post-review fixes. Split the PR if resolving conflicts requires rewriting its reviewed history.
Preserve the primary for the delta and the delta for post-review fixes.

Do not bypass the sandbox, change the check list or enable `[checks].network`
to pass checks. Report base failures rather than work around them. If you must
work around a deterministic defect outside your scope, fix it in a follow-up PR
when small and test-only; otherwise file it labelled `urgent`, naming the PR it
blocks. Only you
commit, never checks, hooks or scripts. If acceptance requires unlisted paths,
update task and PR first; request scope decisions for expanded proof seams or
ownership. If interrupted, preserve an adoptable diff and report remaining
acceptance, checks and findings under the contract's handoff rules.
Never bypass the sandbox, change the check list or enable `[checks].network` to pass checks.
Report base failures without working around them. If a deterministic out-of-scope
defect requires a workaround, use a follow-up PR for a small test-only fix or file an `urgent` issue naming the
blocked PR. Commit yourself, never from checks, hooks or scripts. Update task and
PR before adding paths required by acceptance, and get scope decisions before
expanding proof seams or ownership. On interruption, preserve an adoptable diff
and report remaining acceptance, checks and findings per the contract.

A host or runner change that alters what jobs see (ports, env vars, paths,
services, labels) goes live only after the repository change consuming it is on
Expand Down
8 changes: 4 additions & 4 deletions core/skills/plan/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ issue or request. Size each task to one outcome someone can accept, or one
failure family, in one PR by default. Every PR pays a fixed check, review and
queue cost: keep tests, generated files, docs and related cleanup with their
change, and batch queued, non-urgent chores of one risk class and area, never
into a risky change or ahead of an urgent fix. Split or sequence only at a
seam: separate rollout or rollback, a measurement that could change the design,
a higher risk class (a destructive migration, a trust boundary), separate
ownership, or a diff too wide to review reliably. Scale
into a risky change or ahead of an urgent fix. Split an outcome only at a named
seam. The seam must be separate rollout or rollback, a measurement that could
change the design, a higher risk class (a destructive migration, a trust
boundary), separate ownership or a diff too wide to review reliably. Scale
planning depth to the cost of reversing a choice later: spend planning on
persisted state, CLI or config interfaces, trust boundaries, public APIs and
shared abstractions—asking "if this assumption changes after merge, what
Expand Down
24 changes: 10 additions & 14 deletions core/skills/work-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,16 @@ Record observable acceptance and the issue link. Deliver through
[seeded browser state or changed prerequisites](reference.md#fresh-stack-proof),
and [implementation or repairs without a base merge queue](reference.md#integration-without-a-queue).

Before review, record documentation impact; update docs or give an
evidence-backed reason they need no update.
Before publication, inspect the issue and linked artifacts for its lifecycle
blueprint. Include required completion in the closing delivery. A child issue
does not own its parent's blueprint.
Recheck collisions before publication and again before merge, rereading live
acceptance, prior delivery and ownership. Reconcile changed state before proceeding.
On approval, run readiness at the approved head and defer suggestions and cleanup.
Before making a source edit for the [delta](../../CONTRACT.md#review-budget), name
the unmet acceptance criterion or newly verified defect that requires it.
Review, CI and post-merge acceptance waits remain this task.
Before using [CI or observation-based acceptance](reference.md#acceptance-evidence)
or [resuming after interruption or context loss](reference.md#re-entry),
follow the linked safeguards.
Before review, update docs as needed and record changes or evidence that none are needed.
Before publication, inspect the issue and links for its lifecycle blueprint and
include required completion in the closing delivery. A child does not own its parent's blueprint.
Recheck collisions, live acceptance, prior delivery and ownership before
publication and merge. Reconcile changes before proceeding.
On approval, run readiness at the approved head and defer optional changes.
Before a source edit for [delta](../../CONTRACT.md#review-budget), name the unmet
criterion or verified defect. Own review, CI and post-merge acceptance waits.
Use the [acceptance evidence](reference.md#acceptance-evidence) and

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The safeguard links lost their triggers ("when applicable")

The old text said when to follow each linked safeguard: before using CI or observation-based acceptance, and when resuming after interruption or context loss. The new text says "Use the ... safeguards when applicable", so a reader of SKILL.md alone can no longer tell when to open reference.md. The re-entry trigger matters most, because an agent that has lost context is exactly the reader who needs the cue. Smallest fix: "Before CI or observation-based acceptance or resuming after interruption, follow the linked safeguards." This fits in the existing two lines. Related wording shift at line 31: "defer suggestions and cleanup" became "defer optional changes", which no longer clearly defers cleanup that is not optional. Consider keeping "suggestions and cleanup".

[re-entry](reference.md#re-entry) safeguards when applicable.

Partial delivery uses `Refs #N` and never closes the issue, including work needing
post-merge observation. Closing keywords belong only to complete acceptance;
Expand Down
22 changes: 9 additions & 13 deletions core/skills/write-design-doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@ Apply at the depth appropriate to the artifact and next action.

## Grounding

Read the request, complete existing artifact, linked issue or task, upstream
decisions, repository guidance, and enough code to verify current-state claims,
including claimed component capabilities. Separate facts from assumptions.
Requester decisions stay settled unless evidence invalidates their premise;
assumptions remain vetoable; deferred decisions become open questions.

Repository changes follow [the delivery contract](../../CONTRACT.md) in the
task worktree.
Read the request, complete existing artifact, linked issue or task, upstream decisions,
repository guidance and code needed to verify current claims and capabilities.
Separate facts from assumptions. Keep requester decisions settled unless evidence
invalidates their premise. Keep assumptions vetoable and deferred decisions open.
Follow [the delivery contract](../../CONTRACT.md) in the task worktree.

## Artifact Choice

Expand All @@ -23,11 +20,10 @@ task worktree.
| Specify bounded implementation | Blueprint |
| Explain an existing procedure | Guide |

Use repository paths, templates, frontmatter, terminology, and labels.
Without a convention, choose and explain a descriptive Markdown path in the
documentation tree; avoid a new hierarchy for one document.
Link sources of truth instead of copying them. When replacing instructions with
a link, point to the section that carries the same rule for the same actor.
Use repository conventions for paths, templates, frontmatter, terms and labels.
Without a convention, choose and explain a descriptive Markdown path in the docs
tree and avoid a new hierarchy for one document. Replace copies with links to the
section that carries the same rule for the same actor.

## Design Contract

Expand Down
Loading