polter / macos
AGENTS.md24 starsChanged 9 months agoMITView on GitHub
- Use swiftlint for formatting and linting Swift code. - If code outside of macos/ directory is modified, use zig build -Demit-macos-app=false before building the macOS app to update the underlying Ghostty library. - Use macos/build.nu to build the macOS app, do not use zig build (except to build the underlying library as mentioned above). - Build: macos/build.nu [--scheme Ghostty] [--configuration Debug] [--action build] - Output: macos/build/<configuration>/Ghostty.app (e.g. macos/build/Debug/Ghostty.app) - Run unit tests directly with macos/build.nu --action test swiftc -typecheck…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- windows/AGENTS.mdAGENTS.md
- docs/llms.txtllms.txt
- writing-commit-messagesSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Use swiftlint for formatting and linting Swift code.
- Very specific: line 4
If code outside of macos/ directory is modified, use zig build -Demit-macos-app=false before building the macOS app to update the …
- Very specific: line 7
Use macos/build.nu to build the macOS app, do not use zig build (except to build the underlying library as mentioned above).
- Very specific: line 11
Run unit tests directly with macos/build.nu --action test
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
macOS Ghostty Application
- Use
swiftlintfor formatting and linting Swift code. - If code outside of
macos/directory is modified, usezig build -Demit-macos-app=falsebefore building the macOS app to update the underlying Ghostty library. - Use
macos/build.nuto build the macOS app, do not usezig build(except to build the underlying library as mentioned above).- Build:
macos/build.nu [--scheme Ghostty] [--configuration Debug] [--action build] - Output:
macos/build/<configuration>/Ghostty.app(e.g.macos/build/Debug/Ghostty.app)
- Build:
- Run unit tests directly with
macos/build.nu --action test
Checking Swift when swiftlint is not installed
swiftc -typecheck -target arm64-apple-macos13.0 on the files you changed.
Name the deployment target: without it, an API that only exists on macOS 14
type-checks and then fails to run on the version this app supports.
Do not run it over all of macos/Sources and read the error count. The
tree has long-standing errors -- a parse error in Ghostty.Shell.swift, and
unresolved SPM members in AppDelegate.swift -- and a parse error stops the
compiler before it checks the files after it. So "26 errors, same as the
baseline" is what you get whether your own files are clean or broken, and it
looks exactly like having verified something. Type-check the directory you
touched, on its own, where the count starts at zero and can move.
The whole tree does start at zero, with the right flags (measured for
task 1753): add -enable-bare-slash-regex (the project's Swift language
mode needs it to parse the /…/ literal in Ghostty.Shell.swift), the
bridging header in Sources/App, the main tree's GhosttyKit headers, and
-F pointing at the Sparkle framework in DerivedData's Debug products.
Then all of macos/Sources type-checks with 0 errors, and a floor can be
read. Plant one error per run: with three planted at once the compiler
reported one of them, so counting errors against the number you planted
does not work.
A narrower run is not a lighter version of this. When a file the
directory depends on fails at the declaration level (a missing Ghostty
namespace, say), the compiler does not check function bodies at all: an
error planted in a body leaves the count unchanged.
swiftc -typecheck passing is also not the app building. Only zig build
(with the app bundle, i.e. without -Demit-macos-app=false) compiles the
Swift the way the app does; a change can type-check, pass tests, and still
fail there.
AppleScript
- The AppleScript scripting definition is in
macos/Ghostty.sdef. - Guard AppleScript entry points and object accessors with the
macos-applescriptconfiguration (useNSApp.isAppleScriptEnabledandNSApp.validateScript(command:)where applicable). - In
macos/Ghostty.sdef, keep top-level definitions in this order:- Classes
- Records
- Enums
- Commands
- Test AppleScript support:
(1) Build with
macos/build.nu(2) Launch and activate the app via osascript using the absolute path to the built app bundle:osascript -e 'tell application "<absolute path to build/Debug/Ghostty.app>" to activate'(3) Wait a few seconds for the app to fully launch and open a terminal. (4) Run test scripts withosascript, always targeting the app by its absolute path (not by name) to avoid calling the wrong application. (5) When done, quit via:osascript -e 'tell application "<absolute path to build/Debug/Ghostty.app>" to quit'
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.

