agentleFS
swift-instituteswift-institute/Skills/composition/SKILL.md

composition

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Compose before implementing — search the ecosystem for an owning package, product, target, type, operation, or CI/linter capability before adding a local version, resolve to one disposition, and declare the dependency correctly. Apply before declaring any type, operation, helper, conversion, test utility, or integration, and whenever adding or auditing a package dependency.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. editframe/skills★ 19same name
    2. Akunda123/SVIXAGENT★ 13same name
    3. taniwhaai/arai★ 7same name
    4. tryonelove/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository9 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before declaring a type, operation, helper, accessor, conversion, collection, test utility, or integration, establish whether the ecosystem …

    line 8
  2. Distinctive:

    Search by capability — semantics, dimensions, constraints, ownership behavior, layer — before searching symbol names.

    line 11
  3. Distinctive:

    Every reuse decision resolves to exactly one:

    line 18
  4. Very specific:

    When an Institute package is insufficient, improve that package.

    line 50
  5. Very specific:

    Test Support spine dependencies are exempt: absence from literal imports means the spine needs @_exported public import, not that the …

    line 79

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Composition

Before declaring a type, operation, helper, accessor, conversion, collection, test utility, or integration, establish whether the ecosystem already owns it.

Search by capability — semantics, dimensions, constraints, ownership behavior, layer — before searching symbol names. Equivalent capabilities routinely use different vocabulary, and a name-first search finds only the thing you already thought of. Search tooling too: a CI check or a linter rule may already own the enforcement you are about to hand-roll.

Dispositions

Every reuse decision resolves to exactly one:

  • reuse — depend on and call the existing capability;
  • expose — add the smallest lawful dependency, product, target, import, overload, or conformance so the consumer can reach the owner;
  • complete — add the missing lawful operation to the owner, verify it there, then consume it;
  • compose — add integration at the lowest legal common owner;
  • implement once — create the capability at the correct owner;
  • do not implement — the absence is principled, protecting totality, dimensional correctness, ownership, lifetime, layering, or a spec boundary; redesign the call site.

Build and test the owner first, then its consumers.

Stop and search again

Each of these is a sign the search stopped early, not a thing to fix locally:

  • a local .rawValue reach-through, Int(bitPattern:), pointer arithmetic, or manual index math;
  • count - 1 or partial arithmetic presented as total;
  • a hand-rolled while loop for general iteration or bulk storage;
  • a new accessor wrapper, tag, bounded index, or storage view;
  • a type differing from an ecosystem type only by namespace or spelling;
  • a helper named for mechanism rather than domain intent;
  • a conformance duplicated across packages;
  • a dependency avoided by copying the depended-on capability.

"No result" is not evidence unless you show the search root and a positive control. Never accept an unexplained zero from an ecosystem sweep — the institute skill's instrument-traps reference is a catalogue of the ways one is produced.

When an Institute package is insufficient, improve that package. Do not reach for Apple Foundation, a third-party library, or a hand-rolled workaround. If no Institute path exists at all, the answer is a new Institute package, not a third-party adoption.

Declaring the dependency

A published package's manifest spells each dependency exactly https://github.com/<org>/<repo>.git — current org home, .git suffix, no bare form, no retired org spelling. The one path-form dependency in normal use is a nested test manifest reaching its own parent as .package(path: ".."), which resolves the same way on every machine because the parent is always exactly there.

  • Two spellings of one identity put it under two canonical locations and fire SwiftPM's conflicting-identity branch, which enumerates every distinct dependency path — an effective hang on institute-scale graphs. One divergent edge suffices.
  • .product(name:, package:) spells the URL's repo name, never the on-disk directory basename; the basename resolves only with the machine-local mirror.
  • Two packages in one closure declaring the same name: have been observed to stall the build planner: parent process at 99% CPU, zero swift-frontend children, no .build/ artifacts, no diagnostic, no termination. This is a field observation rather than a reduced reproducer, so treat the symptom set as the recognition signal rather than as a mechanism. Audit for it before adding a dependency, enumerating the closure from manifests plus Package.resolved — not swift package show-dependencies, whose dumpers are independently exponential on large graphs.
  • Declare every dependency the target's source actually imports; never rely on a transitive import. Imported but not declared as a .product is under-declared — add the product, do not remove the import.
  • A full build — not resolve, not dump — emits SwiftPM's own unused-dependency warning, and that is the authoritative prune signal.
  • Test Support spine dependencies are exempt: absence from literal imports means the spine needs @_exported public import, not that the dependency is dead.
  • A separate product gates linking, never resolution — SwiftPM resolves a package's dependencies: whole, whatever the consumer imports. To keep a dependency out of consumers' resolve, gate it with a package trait, off by default, and condition: the dependency on it. Verify by resolving and counting, never by reading the manifest.

Package.resolved is generated state; the institute skill owns what may be done to it.

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.