Imported from tunmiseo/blush (
trash/pruned-non-build-inputs-20260531165925/docs/agents/AGENTS.md). Install upstream withnpx skills add tunmiseo/blush --skill agents. Copyright stays with the author.
AGENTS — Working Method for @ble
Status: Active guidance. Scope: Reading authority, reasoning about changes, implementing carefully, and communicating clearly.
1. Repository Posture
@ble is a rings package repository: filesystem-first, shell-native, and document-driven. It uses the shared rings package model through docs/rings, which is a symlink to the rings repository's docs/spec tree.
That has four practical consequences:
- Read the tree before theorizing about it.
- Treat the live filesystem as primary evidence.
- Prefer extending the existing loader, module, and package model over introducing parallel systems.
- Keep local rules local. Do not turn a repo-specific behavior into a global law unless the architecture requires it.
2. Authority and Read Order
When a task touches semantics or behavior, read the authority documents before proposing changes.
In this repository, docs/rings is the active shared rings specification. It is a symlink to the rings repository's docs/spec tree. Do not treat docs/spec/bootstrap/rings-reference-spec/ as active authority unless an active document routes to it explicitly.
Use this order:
docs/rings/ARCHITECTURE.mdfor the layer model and document boundaries.docs/rings/LOADER.mdfor loader behavior,.loadlist, boot flow, and caching.docs/rings/MODULES.mdfor module identity, submodules, and@core.docs/rings/PACKAGES.mdfor package grammar, routing, registry behavior, lifecycle, facets, and package call rules.DOCUMENTATION-STYLE-GUIDE.mdfor prose and specification writing.SHELL_STYLE_GUIDE.mdfor shell code.CONSENSUS.mdfor settled repo points worth repeating in review.CLAUDE.mdfor repository-specific coding and writing discipline.
If two documents differ, the more specific authority wins.
Examples:
- If
ARCHITECTURE.mdandMODULES.mddiffer on module identity, followMODULES.md. - If
PACKAGES.mdand a draft note differ on package routing, followPACKAGES.md, but always flag for discussion.
Drafts, handoffs, and historical notes are not authority unless an authority document points to them.
Repository-status documents — STATUS.md, files matching *ASSESSMENT*.md or *PARITY*.md, contents of notes/migration-snapshot/, and any prose that describes repository state — are point-in-time narration. They do not prove their own claims. The active authority for completion claims is the structured ledger (@test/@oracle/classification/upstream.tsv) plus the lane registry (@test/@oracle/pty/lanes.tsv). When narration disagrees with the ledger, the ledger wins.
Before changing any @ble package boundary, private helper, public API, facet, function namespace, or cross-package call, read docs/rings/PACKAGES.md §10.
3. Design and Specification Work
3.1 Basic Discipline
- Distinguish structure from behavior.
- Distinguish mechanism from meaning.
- State what the system does before explaining why it is useful.
- State affirmative rules directly and only when fully evident. Add boundary rules only when the boundary matters.
- Prefer the contextualized, concrete, and fully true sentence over the broad impressive one.
3.2 Terms
Terms, or operative definitions, are essential for semantic compression and do real work. They become harmful when they only decorate the prose, obfuscate the point, or abstract away the distinctions that matter.
Judge a term by the work it does:
- Does it name a real repeated distinction?
- Is it defined plainly the first time?
- Does it save space and thought later?
- Is it reused consistently?
- Does it preserve flexibility instead of narrowing the design accidentally?
- If it is an abstraction, does the generalization invite real concrete novel directions?
Do not judge a term by its logical consistency or technical denotative accuracy alone. Those matter, but they are not enough.
If a term's scope or context matters, make that scope or context clear. Do it early, and do it concisely.
If two terms overlap, state the relation plainly instead of forcing one to replace the other. Use chosen terms consistently. Never equivocate.
3.3 Style
Follow DOCUMENTATION-STYLE-GUIDE.md.
In practice:
- Define syntax once and reuse the defined noun.
- Use plain declarative language.
- Prefer ordinary verbs over abstract summary nouns when both are equally accurate.
- Do not add conceptual weight where a direct sentence will do.
- Do not narrate the drafting process inside the document.
4. Implementation Work
4.0 Copy-First Porting
For upstream BLE behavior, implementation work starts from upstream code, not from a local design.
If an upstream subsystem exists, never rely on simplified original code instead of porting that subsystem. This is the invariant for parity work. Original code is allowed only where there is no upstream subsystem to port: rings glue, compiler and loader machinery, lints, ledgers, harnesses, package adapters, and other native integration surfaces.
Source parity is established by copying the upstream body or data table, translating names and ownership in place, and preserving the upstream call chain. PTY lanes are final smoke checks for completed user paths. They are not a design tool, not a prerequisite for starting a port, and not a substitute for source translation.
Before splitting. If an upstream body cannot fit in a single rings target, map every operation in the body to its rings destination before writing any code. The map must account for every upstream operation exactly once. Do not begin writing until the map is complete and every operation has a clear owner. Discovering the split mid-implementation produces invented bridging code.
- Locate the upstream function body or data table before editing.
- Copy that upstream body or data table into the rings target.
- Translate names, calls, package-owned globals, file placement, and package-boundary wrappers.
- Apply Bash 5 idioms only after the copied upstream body is present, and only when the edit is a direct semantics-preserving translation.
- If a dependency or package boundary blocks the copied body, port the dependency, reshape the boundary, or stop and report the blocker.
Do not create a plausible local implementation for upstream behavior. Do not write stubs, facades, simplified algorithms, or test-shaped bodies as an intermediate step. Tests verify copied-and-translated upstream behavior; they do not define it.
4.1 Code Discipline
- Keep implementation claims aligned with the authority docs.
- Do not harden an unsettled interface name into code or docs unless the task is to settle it.
- Keep active subsystem names current. Treat
PACKAGES.md§8 as the authority for the currentpackages::verblifecycle surface and itspkgs::verbalias. Treat stalebindings::...references as legacy unless the task is explicitly historical. Do not harden alternate top-levelrings ...spellings unless the binary surface is explicitly settled in the authority docs. - Never hardcode user-specific paths or secrets or other metadata. Seek a repository-relative or environment-derived safe and flexible solution.
- Use
$RING_ROOTgenerically and$PROFILE_Donly when the login ring specifically matters. - Keep
.package,.module,.env, andenv.drole boundaries explicit. - Respect ownership precedence: per-artifact override first, then
.package, then.module. - Do not privilege
packages.d/as the only meaningful authoring surface. Module-owned artifacts are co-equal. - Callable namespace follows package scope. When the package scope is inside reserved
@core, thecore::portion may be elided in the public surface. Do not infer callable names mechanically from raw implementation paths. - When the callable surface is in doubt, ask for or inspect the actual code surface before hardening names into docs. See
CONSENSUS.mdfor the settled rule and examples. - Broad mutation requires a recovery point. Before running a scripted rewrite, formatter, recursive rename, generated replacement, or any command that can change multiple files, create an atomic backup of the exact target set. Git protects tracked files only; copy or archive untracked files before mutating them. Recovery archives must cover active source targets only: exclude
.git/,trash/, previous backup archives, and other recovery artifacts. A backup that contains older backups grows without adding recovery value and is not an acceptable recovery point. - Place artifacts in their correct modular component. If a file belongs in the
env.dmodule, place it in theenv.d/modular component inside the package (e.g.,packages.d/@pkg/env.d/file.sh). Do not bypass the registry to write directly to module directories without applying ownership rules. - When a plan or claim asserts a precondition — "X passes," "Y is closed," "Z is implemented" — cite the artifact that proves it, run the verification before proceeding, or label the precondition as unverified. A repository-status document does not count as proof of its own claims. Plans built on unverified preconditions inherit those preconditions as risks.
- Check
src/@ble/@test/@oracle/classification/upstream.tsvat the start of every port task. Verify that every upstream symbol being translated has a row inupstream.tsv. Add missing rows before writing implementation code. Do not create or expand PTY lanes before the source port is complete. If a completed user path lacks final smoke coverage, document that gap explicitly; do not block the source translation on a new lane and do not claim ledger closure without the registered proof. - Use
/usr/local/bin/trashinstead ofrmwhen removing files or directories. Deletions in this repository should be recoverable from the user's Trash, including generated artifacts, stale notes, temporary probe files, and directories. If/usr/local/bin/trashis unavailable, stop and report the blocker instead of falling back to permanent deletion.
4.2 Sourced and Executed Shell
Keep the sourced/executed split explicit.
Sourced code must be safe in an existing shell session.
- Do not call
exit; usereturn. - Do not set global shell options such as
set -eorset -u. - Do not add a shebang.
- Keep code dual-shell unless it lives in an explicitly shell-specific namespace such as
@zsh/or@bash/.
Executed code may use stricter process-local behavior.
- Use an explicit shebang.
- Use stricter shell options when appropriate.
See SHELL_STYLE_GUIDE.md for the full rules.
4.3 Existing Contracts
Do not change these casually. First organize and defend a coherent proposal:
.loadlistformat- loader regex behavior
.zshrc.cacheformat- projection and reverse-projection rules
If a task requires changing one of these, update the relevant authority doc in the same change.
4.4 Read-Only and Assimilation Tasks
When the user asks to read, ingest, internalize, review, summarize, or audit documentation or code without asking for edits, implementation, or repository updates, do not modify repository files.
Do not add index entries, cross-links, README navigation, formatting-only passes, or other "helpful" discoverability edits unless the user explicitly asks for those changes.
Treat assimilation as context load for the session, not as a trigger to maintain docs.
Read-only, audit, and assimilation tasks are non-mutating by default, even when stale or broken documentation is discovered.
If it is unclear whether writes are in scope, ask once before editing.
5. Documentation Work
- Keep each section understandable on its own.
- Put the real rule in the document, not a note about the revision.
- Do not preserve stale names because older examples used them.
- Avoid superfluous invariants. Do not propose invariants simply for closure or elegance.
- Do not make lossy edits. Do not drop distinctions or weaken correct claims in the name of cleanup.
- Update the authority doc first when a semantic rule changes.
- Update
CONSENSUS.mdonly when a point is settled enough to repeat as standing guidance. - In spec integration work, compare the target document against the prior authority doc, the settled amendment or addendum if one exists, and the actual intended end state.
- A successful integration pass removes stale conflicting text; it does not merely append corrected text.
- Transitional addenda are not permanent authority. Once absorbed, the authority doc wins.
- When updating an existing document, preserve its structure, explicit distinctions, and strong operative sentences. Add new facts into the existing shape without rewriting prose. Do not replace full lists with examples or summaries.
6. Review and Discussion
- Quote the exact sentence, path, or command under discussion, with citations, references, or line numbers when they help.
- State the current rule or behavior it conflicts with.
- State the consequence of leaving it unchanged.
- State what should change in direct language.
Do not make the reader reconstruct the context from memory.
If something is unsettled, say so plainly. Do not write as if a possible future interface were already authority.
Speak your mind plainly. Defend recommendations with reasons, evidence, or direct reference to the current docs or code.
When a change would alter semantics, interfaces, or authority docs, prefer discussion and sign-off to unilateral action.
This section governs what to do with findings. The review taxonomy in CLAUDE.md governs how to think about them.
When auditing, classify each point before pushing it forward:
- real contradiction
- unresolved contract gap
- missing authority pointer
- implementation note
- style maximalism
Separate "keep and act on" from "optional cleanup" and "ignore." Do not require every residual category to gain a formal noun unless the term materially improves reuse and reasoning.
6.1 Reviewing Terms
Do not use a binary test such as "operational or ornamental."
Use a graded judgment:
- clearly earned
- earned but needing a sharper first definition
- earned but inconsistently reused
- useful only in a local subsection
- not yet earning its cost
6.2 Handoff and Verification
For inter-agent handoff, carry at least:
- claim
- evidence
- proposed change
- unresolved risk
Before finalizing a semantic or documentation change:
- identify which document or layer owns the rule
- update the authority surface first
- verify cross-document consistency and local links
- surface any unresolved conflict explicitly instead of silently choosing
6.3 Concrete Next Steps — Mandatory When Work Is Incomplete
Every response that does not fully complete the assigned work must end with concrete next steps.
Concrete means: specific file, specific line, specific command, specific question to ask. Not categories. Not directions. Not "investigate X."
Bad: "Add ledger rows for the unverified clusters."
Good: "Insert three rows into upstream.tsv after line 1110: history-core | ble/builtin/history/.load-recent-entries | open | <rings-fn> | ..."
Next steps must stay anchored to the existing plan. No drift, no new directions not already established. If the plan has no next step for the current gap, the TODO is "raise gap X with user" — not a substitute plan invented on the spot.
Reporting incompletion without concrete next steps is not acceptable.
7. Boundaries
Module identity, package grammar, loader behavior, and lifecycle mechanics belong in the authority documents listed above.