writing-code
Skill4 starsChanged 9 days agoMITView on GitHub
Write or change production code in this repo — the coding standards, the validation gate, and the self-review checklist. Use this whenever you implement a spec item, add or edit Swift in Sources/, add a dependency, or are about to hand a code change back to the user. Covers naming, guard clauses, side-effect boundaries, DRY, idiomatic Swift, commenting rules (the minimal-comments skill, no spec citations in code), the validation gate, and what to re-check before notifying the user.
- Installs packages
2 other projects use a version of this.
Adopted by
Most recently taken up by
- classroomio/classroomiotheir own version, first seen Oct 8, 2026
- MedicV2/Claude-Skillstheir own version, first seen Jun 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- classroomio/classroomio★ 1.7ksame name
- MedicV2/Claude-Skills★ 1same 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 repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- release-highlightsSkill
- release-notesSkill
- writing-specsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
When writing a provider module:
- Distinctive: line 88
Do not commit, push, or otherwise touch git on your own.
- Distinctive: line 108
Treat the gate as a literal checklist.
- Very specific: line 145
swiftformat --lint .: must print 0/N files require formatting. - Very specific: line 148
swiftlint: must report 0 serious violations. - Very specific: line 153
swift test: must show 0 failures. - Very specific: line 154
All four Python test scripts: must report OK and exit with status 0.
- Very specific: line 158
If swiftformat or swiftlint is not installed, tell the user to install the version pinned in Mintfile.
- Very specific: line 163
If Swift itself is not available (swift build fails with "command not found"), tell the user to install Xcode Command Line Tools with …
- Distinctive: line 169
After the gate passes but before handing off, re-read every file you changed and verify:
- Distinctive: line 188
If self-review turns up issues, fix them and re-run the validation gate before proceeding.
≈ “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.
Files
Writing code
This is a macOS menu-bar app that makes network calls to AI provider APIs and stores credentials in the Keychain. Be methodical and safety-obsessed — verify every change. No quick fixes or temporary hacks unless the user explicitly asks. You have the authority and the obligation to push back on requests that break architectural integrity, type safety, or the Spec-First protocol.
Code follows a spec. If there is no spec for the change, stop and use the
writing-specs skill first.
1. Where code lives
Sources/App— the macOS app target: menu bar (MenuBarExtra), popover, widgets, app lifecycle (LSUIElement).Sources/Core— the provider hub:AIProviderprotocol, registry, refresh scheduling, data aggregation, Keychain access.Sources/Providers/<Name>— one module per provider. Depends only onCore. ImplementsAIProvider.Tests/— mirrors theSources/layout. Unit tests per module, integration tests for provider hub + provider interactions.
2. Coding standards
- Naming — intention-revealing. No hidden "magic".
- Guard clauses — prefer
guard+ early return over deep nesting. - Side effects at the boundaries — each function does one thing. Network calls and Keychain access happen at well-defined edges.
- DRY, but no premature abstraction — explicit beats implicit.
- Idiomatic Swift — follow the language's conventional patterns. Use
async/await,Resulttypes, and SwiftUI idioms where appropriate. - Protocol-oriented — the provider architecture depends on it. Each
provider is a struct or actor conforming to
AIProvider. The hub talks to the protocol, never to a concrete provider. - Comments — follow the
minimal-commentsskill. If it is not installed, tell the user to runnpx skills add victorhqc/skills.sh --skill minimal-comments. This repo adds two rules:- No spec or AC citations in code. No
(providers 02),AC1,// ── AC3 ──, or "implements spec". Specs cite each other; code does not cite specs. If a spec shapes a non-obvious decision, state the reason in plain words. Delete existing citations on sight. ///vs//— SwiftFormat'sdocCommentsrule (default-on, no.swiftformatopt-out in this repo) decides the syntax. A comment directly above a declaration must be///; any other comment must be//. Never downgrade a surviving why to//to make it "less official".
- No spec or AC citations in code. No
- Dependencies — if a package is not in
Package.swift, add it before using it. Prefer Apple frameworks over third-party packages. - Concurrency — use Swift's structured concurrency (
async/await,Task,@MainActor). No bareDispatchQueueunless interfacing with a callback-based API.
Provider rules
When writing a provider module:
- Implement
AIProviderand nothing else public. Internal helpers are fine. - One
URLSessionper provider, configured with the provider's base URL and default headers. - Parse the provider's response into the shared
ProviderQuotamodel. Map provider-specific fields don't leak into the core. - Handle auth errors (401), rate limits (429), and network errors distinctly.
- Log only failed operations with safe identifiers and numeric error codes. Never log API keys, auth headers, or raw response bodies.
3. The implementation loop
For each spec item, in order:
- Sync — re-read the spec file; the user may have edited it.
- Execute — perform the next unchecked item, only that item.
- Record — mark the item
[x]in the spec and log any new findings. - Validate — run the full validation gate (below), every step, in
order. Do not subset it. Build + test alone is not enough — CI runs
swiftformat --lint .,swiftlint, a release build, and tests; so must you. If any step fails, fix and restart from step 1. - Self-review — after the gate passes, review your own work (below).
Do not commit, push, or otherwise touch git on your own. Hand the git commands to the user to run.
4. Validation gate
This is the single most important step in the loop. The commands below are
the exact gate CI runs in .github/workflows/ci.yml. Run all of them, in
order, from the workspace root — every one must pass before you notify the
user. Running only swift build + swift test is not enough: CI also
runs the SwiftFormat lint and a release build, so any of those failing on CI is
a regression you shipped. Keep the gate in sync with ci.yml — if a step is
added there, add it here.
SwiftFormat and SwiftLint versions are pinned in Mintfile. CI downloads the
pinned prebuilt binaries from GitHub releases and runs them directly
(swiftformat / swiftlint). Locally you can use Homebrew (swiftformat /
swiftlint directly), but your installed versions must match the Mintfile
pins — otherwise a green local run will not predict a green CI run. If your
versions drift, grab the pinned prebuilt binaries (see DEVELOPMENT.md).
Treat the gate as a literal checklist. Run each command, read its full output, and only move to the next when the previous is green. If any step fails, fix the code and restart the gate from step 1 — earlier steps can regress when you edit to fix a later one.
# 1. Format — CI step "SwiftFormat (lint)" (version pinned in Mintfile;
# locally: swiftformat matching the pin, via Homebrew or prebuilt download)
swiftformat --lint .
# 2. Lint — CI step "SwiftLint" (version pinned in Mintfile)
swiftlint
# 3. Build — CI step "Build (debug)"
swift build
# 4. Build — CI step "Build (release)" — catches optimizer-only failures
swift build -c release
# 5. Tests — CI step "Test"
swift test
# 6. Workflow tests — CI step "Workflow tests"
python3 scripts/test-automatic-updates.py
# 7. Highlights tests — CI step "Release highlights tests"
python3 scripts/test-release-highlights.py
# 8. Cask tests — CI step "Homebrew cask tests"
python3 scripts/test-homebrew-cask.py
# 9. Packaging tests — CI step "Local signing and startup tests"
python3 scripts/test-local-signing.pyWhat counts as "passing"
swiftformat --lint .must print0/N files require formatting. Anyerror:line is a failure — fix the formatting in the file, do not silence the rule.swiftlintmust report0 seriousviolations. Warnings are not failures, but if a warning appears in a file you changed, fix it. Pre-existing warnings in untouched files are out of scope — note them but don't fix.swift buildandswift build -c releasemust end withBuild complete!.swift testmust show0 failures.- All four Python test scripts must report
OKand exit with status0.
When a tool isn't installed
- If
swiftformatorswiftlintis not installed, tell the user to install the version pinned inMintfile. Either match it with Homebrew (brew install swiftformat swiftlint, then verify the version matches the pin) or download the pinned prebuilt binaries (seeDEVELOPMENT.md). Do not skip the gate — tell the user the gate is blocked. - If Swift itself is not available (
swift buildfails with "command not found"), tell the user to install Xcode Command Line Tools withxcode-select --install.
5. Self-review checklist
After the gate passes but before handing off, re-read every file you changed and verify:
- Acceptance-criteria alignment — re-read the ACs from the spec; does the code satisfy them, or has it drifted?
- Naming & readability — are new functions, types, and files named with intention? Would someone understand them without context?
- Side effects — did you change behavior in code paths you didn't intend to touch?
- Provider isolation — did any change to one provider leak into another provider or into the core?
- Test quality — do the tests assert the right things, or are they just "tests to pass"?
- Scope creep — did you change anything beyond the spec?
- Comments — every remaining comment passes the
minimal-commentsskill. No spec citations and no AC markers anywhere. - No secrets in logs — no API keys, tokens, or auth headers in
print(),os_log, or debug output.
If self-review turns up issues, fix them and re-run the validation gate before proceeding. When self-review is clean, notify the user for review.
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
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.

