cli
AGENTS.md34 starsChanged 8 days agoMITView on GitHub
- Reads credentials
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 31,700 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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Use Bun exclusively — never Node, npm, pnpm, yarn
- Very specific: line 8
Never hand-edit API types — they come from the @photon-ai/dashboard-api dependency.
- Distinctive: line 9
Never add forbidden dependencies: axios, chalk, zod, jest, vitest, ts-node, ws, express, dotenv, ioredis, pg, better-sqlite3
- Very specific: line 10
Every command must use getApi() from ~/lib/api.ts + Eden treaty pattern — never raw fetch()
- Distinctive: line 13
Never delete or rewrite snapshot files without justification in PR body under "## Snapshot changes"
- Very specific: line 15
Never modify files in .github/workflows/ or scripts/agent-flow/
- Distinctive: line 20
Prefer adding fields to existing DTOs over creating parallel types
- Very specific: line 21
All user-facing output uses c.dim(), c.success(), c.error() from ~/lib/output.ts
- Very specific: line 34
Read UPSTREAM_DIFF.md (committed at the root of your branch)
- Very specific: line 35
Run bun install && bun run check.
- Very specific: line 36
Update DTOs in src/lib/types.ts if the API surface changed
- Very specific: line 37
Update command files in src/commands/ to match new routes
- Very specific: line 38
Update or add tests in tests/ to cover changes
- Very specific: line 39
Run bun run check until green
- Very specific: line 40
If you can't make it green within 20 iterations, create AGENT_NOTES.md explaining where you got stuck
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Agent Guide for @photon-ai/cli
Mission
You're updating this CLI in response to upstream API changes in @photon-ai/dashboard-api. The API type contract arrives as a version bump of that dependency (in package.json/bun.lock). Your job: make bun run check pass.
Hard Rules (CI will fail if violated)
- Use Bun exclusively — never Node, npm, pnpm, yarn
- Never hand-edit API types — they come from the
@photon-ai/dashboard-apidependency; update them by bumping its version - Never add forbidden dependencies: axios, chalk, zod, jest, vitest, ts-node, ws, express, dotenv, ioredis, pg, better-sqlite3
- Every command must use
getApi()from~/lib/api.ts+ Eden treaty pattern — never rawfetch() - Destructure Eden responses as
{ data, error, status }— check error before using data - Handle 401 by throwing
SessionExpiredError(caught centrally inhandleTopLevelError) - Never delete or rewrite snapshot files without justification in PR body under "## Snapshot changes"
- One PR = one upstream version bump — don't bundle refactors
- Never modify files in
.github/workflows/orscripts/agent-flow/
Soft Rules (reviewer will flag)
- Match the style in
src/commands/projects.ts: same option ordering (--api-host, -t/--token, --json), same error handling - New DTOs go in
src/lib/types.ts, cast at the API boundary - Prefer adding fields to existing DTOs over creating parallel types
- All user-facing output uses
c.dim(),c.success(),c.error()from~/lib/output.ts - Comments only when intent isn't obvious from the code
Anti-patterns (we've seen AI do these — don't)
- Splitting the
ProjectDTO into one type per command - Adding try/catch around every
getApi()call (handled centrally insrc/index.ts#handleTopLevelError) - Using
console.log(JSON.stringify(...))instead of the output helpers - Replacing
picocolorswithchalk - Using
node:fsinstead ofBun.file - Adding
dotenv(Bun auto-loads .env) - Importing from
@elysiajs/edendirectly instead of usinggetApi()
Workflow
- Read
UPSTREAM_DIFF.md(committed at the root of your branch) - Run
bun install && bun run check. Note what breaks. - Update DTOs in
src/lib/types.tsif the API surface changed - Update command files in
src/commands/to match new routes - Update or add tests in
tests/to cover changes - Run
bun run checkuntil green - If you can't make it green within 20 iterations, create
AGENT_NOTES.mdexplaining where you got stuck
Tooling
- Package manager:
bunonly - Test runner:
bun test - Type check:
tsc --noEmit - Build:
bun run build - Aggregate:
bun run check(runs typecheck + test + build)
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.

