agentleFS
rakaarwakyrakaarwaky/agents-arwaky/skills/aes-architecture/aes-utility/SKILL.md

aes-utility

Skill0 starsChanged 56 days agoMITView on GitHub

AES stateless utility scaffolding for Python Rust TS. Use when creating utility helper files.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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. Very specific:

    Every rule is machine-checked by lint-arwaky-cli scan <layer-path> (see each HOW-TO § Verify).

    line 84
  2. Distinctive:

    Ask these questions in order.

    line 120
  3. Distinctive:

    Domain-specific or single-consumer helper extracted here: keep private until ≥2 consumers.

    line 180

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

aes-utility

Purpose: Scaffold AES utility files — stateless, domain-agnostic free functions shared across layers. Audience: The agent creating or validating a utility file. Scope: Python, Rust, and TypeScript utility_<domain>_<role> files — no class/struct/impl/interface/enum/type alias.

Utility vs Capability — Defining the Boundary

A utility and a capability are fundamentally different layers. Confusing them causes misplaced code, wrong imports, and linter violations.

Utility (utility_*)Capability (capabilities_*)
Core questionHow is a small task done?What can the system do?
NatureStateless, domain-agnostic, pure free functionsConcrete protocol behaviour — domain rules, external adaptation, DI-wired
ResponsibilityPerforms narrow, reusable operations with no business logicImplements a _protocol contract; orchestrates inputs into domain outcomes
StateAbsolutely no state — pure functions onlyHas instance state via injected dependencies (Arc<dyn Trait>, DI params)
LocationShared folder (shared/) beside taxonomy and contract filesFeature folder (crates/<feature>/, modules/<feature>/, packages/<feature>/)
ConsumersConsumed by capabilities, agents, surfaces, or other utilitiesConsumed by agent orchestrators or root composition
Examplesutility_string_sanitizer, utility_date_formatter, utility_hashercapabilities_user_auth, capabilities_data_persist, capabilities_rate_limit

Decision rule: Ask "Does this code perform a narrow, stateless, reusable operation with no business logic?" If yes → utility. Ask "Does this code implement a protocol behaviour with business rules?" If yes → capability. If it does both, split it: business logic stays in the capability; the stateless helper moves to utility.

The layer decides which suffix, which imports, and which structure apply. Rules, templates, section contracts, and Verify blocks live in the language HOW-TUs under references/.

LanguageFocusBody ruleHOW-TO
PythonStateless free functionsNo class; no self in function params (redundant with class check); taxonomy-only importsreferences/HOW-TO-MAKE-PYTHON-UTILITY.md
RustStateless free functionsNo struct/impl/trait/type-alias; taxonomy-only imports (not other utilities)references/HOW-TO-MAKE-RUST-UTILITY.md
TypeScriptStateless free functionsNo class/interface/enum/type-alias; taxonomy-only imports (not other utilities)references/HOW-TO-MAKE-TYPESCRIPT-UTILITY.md

The layer chain:

utility_* (beside taxonomy) → used by capabilities / agent / surface — never imports them

Each file answers one layer's job. A method or import in the wrong layer is the defect this skill exists to prevent.


Invariants

Every rule is machine-checked by lint-arwaky-cli scan <layer-path> (see each HOW-TO § Verify). A rule cannot drift from the gate. Cite the linter, not this file, when pointing at a rule.

LayerRule
NamingFile utility_<domain>_<role> — suffix flexible; forbidden: _vo/_entity/_error/_event/_constant/_protocol/_aggregate (AES101/AES102).
StructureFree / module-level / exported functions only — no class, no struct/impl/trait/type alias (Rust), no interface/enum/type alias (TS), no self/this (AES404).
StateStateless and deterministic — no random/now()/Math.random()/Date.now(), no global mutable state.
DomainDomain-agnostic — no business rules, no layer-name knowledge; ≥2 consumers (else keep as private helper).
ImportsTaxonomy only — never capabilities, agent, surface, contract, or other utility_* files (AES201).
RegisterShared barrel: __init__.py / mod.rs / index.ts.
Verifylint-arwaky-cli scan <layer-path> → 0. Language compile is fallback only.

Split details, templates, and Section Contract tables: read the language HOW-TO — do not restate them here.


Placement (AES701)

A utility_* file belongs in the workspace's shared/ folder, beside taxonomy_* and contract_* files:

crates/shared/src/     # Rust
modules/shared/src/     # Python
packages/shared/src/    # TypeScript

The shared folder is locked to taxonomy, utility, and contract files. A capabilities_*, agent_*, or surface_* file found there is an AES701 violation and must be moved out. A utility that only one feature uses does not belong in shared/ — keep it a private helper inside that feature folder.


Diagnostic Tree

Ask these questions in order. The first "No" dictates your next action.

  1. Is the function stateless, domain-agnostic, and used by ≥2 modules?
    • No → keep as a private helper where it is used, or move to capabilities if it has business rules.
  2. Does it implement protocol behaviour with business rules or injected dependencies?
    • Yes → belongs in capabilities, not utility. See aes-capabilities skill.
  3. Does the file define a class/struct/impl/trait/type alias?
    • Yes → strip to free functions only.
  4. Does it import above taxonomy?
    • Yes → remove (AES201).
  5. Does lint-arwaky-cli scan <layer-path> exit 0?
    • No → fix findings, re-scan.

Workflow

  1. Confirm stateless, domain-agnostic, ≥2 consumers (else keep private helper).
  2. Resolve the shared utility dir beside taxonomy. Run lint-arwaky-cli scan <layer-path>.
  3. Draft free functions from the language HOW-TO § Template / § Section Contract.
  4. Move needed literals to taxonomy_*_constant; keep business rules in capabilities.
  5. Register in __init__.py / mod.rs / index.ts, then verify with lint-arwaky-cli scan.

Verification

Machine Checks

lint-arwaky-cli scan <layer-path>   # AES101/102, AES201–205, AES401–406 → must be 0
# Fallback only: language compile (python -c import / cargo check / npx tsc --noEmit)

```text

A pass means naming, imports, primitives, and roles are clean. Structural judgement
(tier choice, block order, helper-vs-utility, "orchestration only") is **manual** — see HOW-TO § Rules.

### Human Checks

A machine pass does not mean the file is right. Layer purpose, structural order, and
"only what this layer may do" still need a reader (HOW-TO § Rules).

---

## Pre-flight Checklist

- [ ] `lint-arwaky-cli scan <layer-path>` exits 0.
- [ ] Every touched HOW-TO's `Verify` block was executed.
- [ ] File registered in `__init__.py` / `mod.rs` / `index.ts`.
- [ ] Language fallback compile clean if the HOW-TO lists it.
- [ ] Related skills considered for the next layer up/down.

---

## Common Mistakes (Anti-Patterns)

The linter covers naming, imports, and primitives. These need a reader (HOW-TO § Rules):

- **Class / `self` / `this` / `struct` / `impl` / `trait` / `type` alias in utility**: free functions only.
- **Domain-specific or single-consumer helper extracted here**: keep private until ≥2 consumers.
- **Imports from capabilities/agent/surface/contract**: forbidden (AES201).
- **Restating HOW-TO rules in SKILL.md**: delegate — this file only routes.

---

## Related Skills

- `aes-taxonomy`
- `aes-capabilities`
- `aes-root`

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.