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

institute

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Run and interpret every Institute build, test, resolve, lint, and local probe through the Institute coordinator, and handle failures that come from the toolchain itself — compiler, optimizer and build-system defects, swiftlang/swift pull requests, Swift Evolution pitches, and pre-launch Swift Forums critique. Apply whenever a task builds, tests, resolves, cleans, lints, composes local sources, reports a result as evidence, or when a failure may be the toolchain rather than product logic.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are 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.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add --fresh when a chosen build or test result will be reported as newly originated evidence.

    line 35
  2. Very specific:

    Never delete .build directly.

    line 110
  3. Distinctive:

    Before any large sweep, census, or absence claim, read instrument-traps.md — every entry there is a way to obtain a confident zero from a …

    line 137
  4. Distinctive:

    Path-scoped exemptions are the dangerous class: Every AST-based exemption fails toward still firing, so an author complains and you find …

    line 173

≈ “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

Institute

The institute coordinator (swift-institute/institute-application) owns local SwiftPM execution. Never invoke swift build, swift test, swift package, or xcodebuild directly, and never wrap them in a repository-local script — a repository-local wrapper is how a machine-specific assumption becomes everyone's.

Commands

institute package build   --package-path <path>
institute package test    --package-path <path>
institute package resolve --package-path <path>
institute package update  --package-path <path>
institute package clean   --package-path <path>
institute package run     --package-path <path>
institute package dump-package --package-path <path>

institute doctor            # machine-checked checkout facts
institute inventory         # the name → org → path register
institute sync              # clone and fast-forward; --dry-run plans only
institute context install|check
institute navigation install|check

institute compose --consumer <c> --dependency <d>   # local-source composition
institute verify  --consumer <c> --dependency <d>
institute restore --consumer <c> --dependency <d>

Add --fresh when a chosen build or test result will be reported as newly originated evidence. Freshness makes that result admissible; it does not require every task or reviewer to originate another run. Forward SwiftPM arguments by repeating --argument, using the = form whenever the forwarded value begins with - or the parser claims it as an institute option:

institute package test --argument=--filter --argument "Suite or test"

In a fresh clone, from the institute-application checkout root, the bootstrap swift run institute install (no --package-path; the repository is the package, and the executable is institute) compiles the whole dependency graph and is silent for several minutes. It is not hung.

Local-build policy

Local iteration runs through coordinated paths only — institute package build|test|lint, never raw swift build/swift test/package-administration commands. The machine-wide swiftpm-build-coordinator flock serializes every coordinated SwiftPM build; no session bypasses, kills, or replaces it.

Interactive concurrency is capped, not uncapped, whenever another session shares the machine. Pass --jobs <n> on institute package build|test so a coordinated build leaves cores free for co-tenant sessions — start at half the machine's cores and adjust from there by observed contention, never uncapped while another session is on the machine.

institute build — one xcodebuild invocation over the merged institute.xcworkspace graph — is the quiet-point integration check, not an iteration tool. It is the only local path that sees unpushed cross-package edits, so its blast radius includes concurrent source edits anywhere else in the checkout. Run it at quiet points only, never during active lane work.

CI full-tier workflow_dispatch is the sole evidence of record for issue closure. A local green, capped or not, is iteration signal — never closure evidence. gh run rerun re-executes a pinned old snapshot and is void as closure evidence; dispatch a fresh run.

Evidence

A cached green is not newly originated evidence. Use --fresh for a new local release, audit, migration, benchmark, or correctness result. Exact-head evidence from another task remains usable when its command, root, toolchain, revision, exit status, and provenance are reported as task-attributed rather than re-labelled as independently checked.

Choose the smallest command that can change the decision. A fresh test normally compiles the tested target, so do not add a separate fresh build unless it answers a different material question. Once a decisive blocker fixes the next action, stop unrelated verification rather than filling out an evidence inventory.

A zero from the wrong root is not evidence either, so record what the run was: the package root, the action, the toolchain, the forwarded arguments, the exit status, and whether it was fresh. That record is what lets someone else disagree with your conclusion rather than only with your confidence.

Pair every probe with a positive control. A probe that cannot demonstrate it can report something proves nothing by reporting nothing — and a control proves the instrument RAN, not that the query was complete. For any claim that something is ABSENT, the final check is an unfiltered enumeration, never a pattern: a pattern matching zero lines and a wrong pattern look identical. A sweep's shape — which roots, which file kinds, which spelling — is itself a claim and needs its own control.

Dependencies are branch-based, so a green over stale pins doctor flagged is not evidence. canImport-gated code does not re-evaluate on an incremental build: a suite rejoined by a dependency change stays silently excluded from a green incremental run, so a clean build is the gate of record whenever conditional compilation is in scope. Embedded compatibility is proved by compiling with the declared SDK and compiler mode, never by searching for imports.

Report failures with the first compiler diagnostic and the complete log. Do not infer a source defect from a setup, resolution, capacity, or toolchain failure; recheck a nightly-only failure on stable; and confirm swift --version resolves to the intended toolchain before interpreting a toolchain-sensitive result.

Generated and machine-local state

Package.resolved is generated. Never commit, hand-edit, copy, stage, or delete it to force resolution — change Package.swift and resolve.

Never delete .build directly; use institute package clean. A manual deletion costs a full rebuild of an artifact tree large enough that the mistake is measured in hours, not seconds.

A composed manifest writes a machine-local absolute path deliberately, so that it fails loudly off-machine instead of silently resolving elsewhere. It is uncommittable: restore before pushing. restore's check is structural only — the manifest evaluates, the dependency is declared by URL, no local path leaked. It resolves nothing and contacts no remote, so report its scope honestly rather than as a resolution check.

The generated Xcode workspace and Institute.json carry relative references only; never emit a machine path into either. Institute.json is the sole name → org → path authority.

sync never rewrites work: it fast-forwards only a clean checkout on main tracking origin/main with no local commits, and reports dirty worktrees and feature branches without touching them.

Institute tooling is Full Swift. Do not add Python or shell automation, or revive a Scripts grab-bag; extend the typed Institute surface and test the extension.

Local probes

Bare grep in this shell is a function wrapping ugrep with --ignore-files, so it honours .gitignore and silently skips files — use /usr/bin/grep when the result is evidence. Target directories contain spaces, so quote paths and expect word-splitting bugs in any loop over find output. Imports frequently live in umbrella exports.swift files, often as @_exported public import, so a grep for import X in consumer files under-reports.

Before any large sweep, census, or absence claim, read instrument-traps.md — every entry there is a way to obtain a confident zero from a broken instrument.

swift-linter

A convention graduates from prose to a mechanical rule when it is recognizable from syntax or from a package graph. That is the dividing line worth keeping in mind while writing either one: swift-linter owns Swift syntax and AST semantics, Institute validators own checkout and package-graph facts, repository-policy owns GitHub state, and central CI executes them. Never restate an executable predicate as prose, and never create package-local severity overrides.

Consumers activate exactly one bundle in a root Lint.swift (Lint.Rule.Bundle.primitives, .standards, .institute, .universal); configuration stays in Swift.

Specify the predicate before implementing it: the exact syntax matched, the convention it represents, known false positives and negatives, diagnostic location and message, canonical fix, allowed exemptions. Ship positive, negative, edge, exemption, and self-firing fixtures — the fixtures are the rule's contract, and a rule with no failing fixture is not known to work.

Fix the predicate before measuring its zero. Graduate a rule to error only after the fixtures cover the intended surface, a fresh run scans Sources and Tests across every applicable package root with a non-zero control, the unsuppressed count is zero, and the same scope is reproducible in central CI.

Be honest in the rule's own message about which half it checks. A rule that requires a justification comment checks that the comment is there; it does not check that the justification is sound, and the reader deciding whether to trust a clean run needs to know which.

Suppress a single finding only for a sanctioned pattern, with // swift-linter:disable:next <rule> plus a // REASON: line naming the lawful shape. Never evade a detector by respelling the prohibited code. Exemptions belong in the rule's Swift predicate, not in consumer configuration, and must name the narrowest stable property distinguishing the lawful shape; add a violation fixture, an exempt fixture, and a near-miss fixture that must still fire.

Path-scoped exemptions are the dangerous class. Every AST-based exemption fails toward still firing, so an author complains and you find out. A path exemption fails toward NOT firing, silently suppressing the findings the rule exists to surface — and the drop reads as progress. Match whole directory segments against a required suffix that includes its leading separator, drop the trailing filename before matching, never use contains or a prefix test, and gate before the visitor walks. Fixtures are mandatory in both directions, including a positive control with a bare filename and no directory component — without it, a careless predicate silences the whole fixture suite and the run still reads green.

Exporting a package for an LLM

PKG=<absolute-package-path>; OUT="/tmp/$(basename "$PKG")-sources.swift"; \
{ echo "# $(basename "$PKG")"; printf '\n## Package Manifest\n\n'; cat "$PKG/Package.swift"; \
  printf '\n## Source Files\n'; \
  /usr/bin/find "$PKG/Sources" -name '*.swift' -type f | sort | while read -r f; do \
    printf '\n### File: %s\n\n' "${f#"$PKG"/}"; cat "$f"; done; } > "$OUT"; wc -c "$OUT"

Package name, raw manifest, then each file under a ### File: <relative path> header with raw contents. Exclude .build/, .git/, Package.resolved, and anything .gitignored. Export tests to a sibling -tests.swift file only when asked. Report the byte count and let the requester judge fit.

Elsewhere

  • Probes that return a confident zero — instrument-traps.md.
  • Compiler, optimizer, and build-system defects: reduction, production-shape verification, SIL-level diagnosis — toolchain-defects.md.
  • Pull requests to swiftlang/swift, Evolution pitches, pre-launch Forums review — upstream.md.

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.