agentleFS
rajfnurajfnu/agent-engineering-standard/skills/engineering-quality/SKILL.md

engineering-quality

Skill0 starsChanged 51 days agoApache-2.0View on GitHub

Universal engineering standard for making changes to a codebase — decide how much context to load, keep capability boundaries and dependency direction sound, reuse proven behaviour without importing technical debt, choose the right test scope, and treat frontend UX as engineering quality. Use when implementing, refactoring, extending, or reviewing a change in any language, framework, or repository, and when deciding how much of a repository to read before changing it. Do NOT use for pure Q&A about a codebase, for generating documentation with no code change, or as a substitute for running the repository's own linters, type checkers, and tests.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    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:

    Run this for every change.

    line 25
  2. Distinctive:

    Keep each step proportional.

    line 35
  3. Distinctive:

    Never: *small change -> read whole repo -> read all docs -> run all tests*.

    line 46
  4. Distinctive:

    Default budgets, override only with a reason:

    line 48
  5. Distinctive:

    Keep domain logic away from volatile infrastructure (DB drivers, cloud SDKs, model providers, external APIs, UI frameworks).

    line 69
  6. Distinctive:

    Before copying code from another repo or module, answer four questions:

    line 102
  7. Distinctive:

    Do not carry over obsolete compatibility layers, dead utilities, customer-specific assumptions, old experiments, stale prompts, generated …

    line 105
  8. Very specific:

    Do not run L4 after every edit.

    line 119
  9. Distinctive:

    If a tool can enforce a rule reliably, use the tool instead of repeating the rule in prose: import/dependency rules, architecture tests, …

    line 125
  10. Distinctive:

    Never assume code, tests, README, the newest file, or the latest prompt is automatically correct.

    line 147
  11. Distinctive:

    Avoid microservices everywhere, containers everywhere, interfaces everywhere, factories everywhere, thousands of shallow tests, full-suite …

    line 155

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Engineering Quality

An engineering standard for coding agents. Language, framework, and agent agnostic.

Core principle

Preserve proven behaviour. Reuse proven implementation intelligently. Do not preserve unnecessary complexity or technical debt.

Existing code is evidence that some behaviour works. It is not evidence that the architecture, design, tests, documentation, UX, or dependency structure are good. Everything relevant stays reviewable.

The loop

Run this for every change. Stop at the first step that answers the question.

  1. Scope — name the capability being changed and the blast radius.
  2. Context — load the smallest context that covers that scope (references/context-economy.md).
  3. Understand — responsibility, public contracts, relevant tests and docs, runtime paths.
  4. Change — smallest coherent change that leaves the boundary sound.
  5. Test — the impacted level, not every level (references/testing.md).
  6. Reconcile — leave no second live version of the thing you changed (references/repository-reconciliation.md).

Keep each step proportional. A one-line fix does not get an architecture review.

Context economy

Context is a first-class engineering budget, not a free resource.

identify scope -> load global rules -> load the owning capability
               -> pull adjacent context only when a question demands it

Never: small change -> read whole repo -> read all docs -> run all tests.

Default budgets, override only with a reason:

Change sizeFiles readTest level
Local fix inside one modulethe module + its testsL1
New behaviour in one capabilitythe capability + its contract + callers of the contractL1–L2
Contract or schema changethe contract + every consumerL2–L3
Cross-cutting / releaseas neededL4

Details: references/context-economy.md.

Boundaries and dependency direction

Derive module boundaries from coherent responsibility, ownership, independent evolution, state ownership, explicit contract, independent testability, and blast radius — not from folder layout and not from a fixed module count.

A meaningful capability exposes a contract: responsibility, inputs, outputs, errors, state ownership, allowed dependencies, compatibility expectations. Callers depend on the contract, never on internals.

Keep domain logic away from volatile infrastructure (DB drivers, cloud SDKs, model providers, external APIs, UI frameworks). Use a port/adapter only where it buys real isolation — a wrapper that mirrors one vendor's API one-to-one buys nothing.

Details: references/architecture.md.

Configuration vs. code

intentional variability  -> configuration
fundamental invariant    -> code / domain rule

Known-variable things (providers, models, endpoints, environments, flags, timeouts, retries, concurrency, limits) should not be hard-coded. Everything else should not be configurable.

Code quality

Apply SRP, separation of concerns, SOLID, KISS, DRY, YAGNI, high cohesion, low coupling, composition, explicit dependencies, testability, failure isolation, idempotency, determinism where practical, structured logging, clean error handling — as tools, in proportion. Patterns are not goals.

Size is a smell, not a limit. Around 300 substantive lines, ask whether the unit has several reasons to change, or mixes orchestration with persistence, domain with infrastructure, or configuration with execution. If it does not, leave it alone. Never split a file to satisfy a number.

Details: references/code-quality.md.

Reuse without importing debt

Before copying code from another repo or module, answer four questions: Do we need it? Is it clean enough? Does it belong here? What dependencies come with it?

Do not carry over obsolete compatibility layers, dead utilities, customer-specific assumptions, old experiments, stale prompts, generated artifacts, or unrelated docs.

Testing

Impact-based, four levels:

LevelScopeWhen
L1affected unit / moduleevery change
L2affected contract / integrationcontract, schema, or cross-module change
L3affected end-to-end journeyuser-visible flow changed
L4full regressionrelease, or broad/unclear blast radius

Do not run L4 after every edit. Test count is not a quality metric — every test must protect a real behaviour, invariant, contract, regression, security boundary, or architecture boundary. Details: references/testing.md.

Prefer mechanical enforcement

If a tool can enforce a rule reliably, use the tool instead of repeating the rule in prose: import/dependency rules, architecture tests, cycle detection, linting, type checking, contract tests, schema-compatibility checks, scoped test commands.

Security, reliability, observability

Proportional, not ceremonial: least privilege, secret management, input validation, authz/authn boundaries, dependency risk, sensitive-data handling, secure configuration, safe error messages, auditability. Production paths need logs, traces, metrics, correlation IDs, latency and dependency-failure visibility. Never log secrets. Details: references/security-reliability.md.

Frontend and UX

Frontend quality is engineering quality, not disposable glue. Before visual polish ask: who is the user, what are they doing, where are they, what do they need to know, what is the next obvious action? Then review journey, information architecture, navigation, terminology, progressive disclosure, forms, dialogs, empty states, errors, loading, and accessibility. Then style. Details: references/ux.md.

Source of truth

Never assume code, tests, README, the newest file, or the latest prompt is automatically correct. When they disagree, inspect runtime behaviour, implementation, requirements, ADRs, configuration, tests, and deployment; classify the disagreement (additive, refinement, superseding, conflicting, obsolete, duplicate, experimental, ambiguous) and resolve it. Ask the human only when consequential ambiguity genuinely remains.

No engineering theatre

Avoid microservices everywhere, containers everywhere, interfaces everywhere, factories everywhere, thousands of shallow tests, full-suite runs after local edits, giant prompts, sprawling documentation, unnecessary approval gates, and planning that never becomes implementation. If a rule does not materially improve quality, architecture, UX, safety, maintainability, developer experience, or efficiency, drop it.

References

Load only what the current task needs.

FileLoad when
references/context-economy.mddeciding what to read, or the repo is large/unfamiliar
references/architecture.mdboundaries, contracts, dependency direction, ports/adapters
references/code-quality.mdrefactoring, large files, design-principle calls
references/testing.mdchoosing test scope, writing or pruning tests
references/security-reliability.mdauth, secrets, external input, production paths
references/ux.mdany frontend or user-facing change
references/repository-reconciliation.mdduplicate/legacy versions, drifted docs, v1/v2/v3

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.