agentleFS
alvaroofernaandezalvaroofernaandez/dotfiles/.claude/skills/aval-architecture/SKILL.md

aval-architecture

Skill5 starsChanged 5 days agoMITView on GitHub

Use when adding a package, interface or seam, adding an import between internal/ packages, moving code across layers, or before and after a refactor in aval. Evidence before abstractions, the ADR 0002 allowlist, the ratchet, the generated model, optional archsieve reports.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only when a diagram, the affected set or churn helps a review.

    line 47
  2. Very specific:

    If the layering changed: the ADR amendment, in the same PR, before the archRules edit.

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Activation contract

Load before a structural change in this repository: a new package under internal/, a new interface or seam, a new internal import, or a refactor that moves code. Not for runtime behaviour or performance. Where it disagrees with a global skill, this one wins (AGENTS.md).

Hard rules

  • Evidence before abstractions. A new package, interface or seam is a visible cost. Name its need before you add it: a second implementation that exists or is planned in odd/tasks/, a test seam a test uses, or a security or ownership boundary. "Cleaner" or "more flexible" is not a need. No need, no abstraction.
  • AS-IS and TO-BE stay separate. AS-IS is what go list and docs/architecture/model.md show at this commit. TO-BE is your proposal, labelled as one. Never draw a proposed package or edge into the generated model.
  • The allowlist is the law. archRules in tests/architecture_test.go implements ADR 0002 (with its 2026-11-23 amendments). A package no rule matches is itself a violation, so a new package forces a decision.
  • Change order: ADR, then table, then code. To change the layering: (1) add a dated ### YYYY-MM-DD amendment to ADR 0002 or write a new ADR (docs/adr/README.md; tests/adr_test.go checks it); (2) edit archRules; (3) write the import; (4) regenerate the model. Never rewrite the accepted ADR text.
  • The ratchet only shrinks. archExceptions lists edges that break the rules today; archMaxExceptions caps it (0 now). A new violation fails; an exception that no longer matches also fails. Fix the import. Raising the cap is never part of a feature change.
  • archsieve is a report, never a gate. ADR 0001: Node tooling is never a dependency, and in Go archsieve only sees import cycles, which the compiler already rejects. No test, hook or CI step may depend on it.

The allowlist today (ADR 0002 + amendment)

PackageMay import (internal)
cmd/avalanything under internal/ (composition root)
internal/uicore/*, devmode, i18n, release, ui/caps; design/gate in tests only
internal/ui/cliui, ui/caps, i18n
internal/core/*core/*, release
internal/design/hookdesign/ack
leaves: agent/*, devops/*, term/*, docs/*, herdr/*, deck, design/ack, design/gate, release, devmode, i18n, ui/caps, testenv, tools/*nothing internal

Everywhere: internal/testenv only from _test.go files; nothing imports cmd/aval. The table above is a reading aid; archRules is the source.

Commands

go test ./tests/ -run Architecture                        # the gate: edges, ratchet, self-test, stale model
go test ./tests/ -run TestArchitectureModel -update       # regenerate docs/architecture/model.md

The gate reads go list for linux, darwin and windows, so build-tagged files count. A failure prints from -> import per edge.

Reading docs/architecture/model.md

Generated; never edit it by hand (a test fails when it is stale). Families fold into one node (core/*, agent/*). A solid arrow is a production import, a dotted test arrow exists only in tests. The leaves subgraph is every package with no internal production import. The Rules table and the exception count are rendered from archRules and archExceptions.

Optional: archsieve reports

Only when a diagram, the affected set or churn helps a review. Pinned tag tarball, artifacts outside the repo:

npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz scan . --go auto -o /tmp/archsieve/now.json
npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz scan . --go auto --ref main -o /tmp/archsieve/main.json
npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz diff /tmp/archsieve/main.json /tmp/archsieve/now.json --format md
npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz render /tmp/archsieve/now.json --depth 1
npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz affected /tmp/archsieve/now.json --base origin/main --repo .
npx -y https://github.com/FullFran/archsieve/archive/refs/tags/v0.6.0.tar.gz scan . --go auto --history --since 90d -o /tmp/archsieve/churn.json
  • error findings are facts; signal findings are questions, not orders; unknown means "not inferable", never "absent".
  • affected lists dependent files and tests; when blind is not empty, run the full suite.
  • --history churn and co-change-without-link point at coupling imports cannot show. Treat them as questions.
  • Bump the pinned tag deliberately, in its own commit. Never run archsieve unpinned.

Evidence a PR must show

  1. AS-IS: the relevant edges before the change (the model or go list).
  2. TO-BE: the new or changed packages and edges, each with the need it answers.
  3. go test ./tests/ -run Architecture output after the change, and the regenerated model diff if edges changed.
  4. If the layering changed: the ADR amendment, in the same PR, before the archRules edit.
  5. Optionally, an archsieve diff --format md excerpt, labelled as a report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.