changing-code
How a change that spans the tree is made: moves through blaze-lints bans and `blaze check --fix`/`--replace`, whole ports of shared signatures, one concept in one home, the best long-term design, and a spec before a design. Load before renaming or moving a type, path or API, changing a shared signature, removing a duplicate, or choosing a design. Tests for persisted, durable or concurrent state ar
Install
Copy this folder into your Claude Code project (needs Node.js):
npx degit indexable-inc/blaze/.agents/skills/changing-code .claude/skills/changing-codeOr install it for every project:
npx degit indexable-inc/blaze/.agents/skills/changing-code ~/.claude/skills/changing-codeFile content
Made by its original authors and shared under Apache-2.0. We show it unchanged, with credit and a link to the source. Source ↗
--- name: changing-code description: "How a change that spans the tree is made: moves through blaze-lints bans and `blaze check --fix`/`--replace`, whole ports of shared signatures, one concept in one home, the best long-term design, and a spec before a design. Load before renaming or moving a type, path or API, changing a shared signature, removing a duplicate, or choosing a design. Tests for persisted, durable or concurrent state are the `testing` skill." --- # Changing code across blaze <!-- Generated by `bun tools/agents/rules.ts --write` from tools/agents/rules.ts, down to the end marker; edit the rules there. AGENTS.md carries each rule as one line. --> ## fix-through-blaze-lints (rule 13) A change that moves a type, path, API or idiom across the code is a ban with a `replacement` in `.clippy.toml` (mirrored in the hot crates' `clippy.toml`), which blaze-lints' `disallowed_types`/`disallowed_methods`/`disallowed_macros` enforce with a MachineApplicable fix, or a `blaze::` lint where the rule needs types or MIR; either is applied with `blaze check --fix`, and its count lives in `crates/blaze-lints/baselines/`, which may only shrink; a one-off move of a path is `blaze check --replace A=B`. Both find code by name resolution (imports, renames, globs, re-exports, macro output), never by text, and leave it compiling and lint-clean, so the rule keeps holding after the port. `sed`, `rg` replace and syntax-only rewriters (astlog) are for syntax-only shapes, scoped and checked by a build afterward. ## whole-ports (rule 24) A change to a shared signature or type (a struct's fields, a trait, a lock type) updates every caller in the same batch, so the shared tree compiles at every save point. Do it through `blaze check --fix`, `blaze check --replace` or a scoped rewrite, then build, then hand the batch over. A half-ported tree blocks every lane's run. ## best-long-term-design (rule 28) Pick the best long-term design, not the least work: own the layer or port rustc's rule properly, and spend the effort on proving it right: real crates' own test suites passing under blaze, Hegel property tests and deterministic simulation of blaze's own invariants (`testing` skill), and fuzzing of parsers of hostile bytes. See [docs/contributing.md#rules-for-code](../../../docs/contributing.md#rules-for-code). ## spec-then-build (rule 29) Before a change that spans crates, adds a concept, or changes a persisted format, a protocol or a hot path, write a short spec as a `plan` doc under `docs/` (what, why, the chosen design and the losing alternative in a line, the cost budget, the migration, how it is proven: for concurrent, durable, billing or data-deleting code, the DST and the invariant its oracle checks). Have a fresh reviewer check it against the code when it is large. Then start building it in the same lane, in the same session, without waiting to be asked: fan out the code, build, land. The spec ships in the same pull request as the first code that implements it, and is marked `current` (or rewritten to describe what was built) once the work lands. A spec with no code behind it is unfinished work, not a result; a lane that cannot build what it specified says what blocks it and who it handed the work to. See [docs/contributing.md#rules-for-code](../../../docs/contributing.md#rules-for-code). ## one-concept-one-home (rule 30) Each concept has one type, one rule and one place it is computed: two types for the same thing (a `BuiltFor` in two crates), two copies of a rule (where code runs, what a key covers), two paths that do the same job (two schedulers, two evaluators, two tiers for one level) are a bug. Merge them into the better one, delete the other, and ban its name with a `replacement` (`fix-through-blaze-lints`); a change that finds a duplicate removes it or files an issue naming both. <!-- End of the generated rules. Hand-written notes follow. -->