teitunnel
AGENTS.md2 starsChanged 47 days agoMITView on GitHub
Guidance for AI coding agents working on Teitunnel. Human contributors: start with CONTRIBUTING.md; everything here applies to you too. Teitunnel is a desktop app (Tauri 2: Rust + React) and a command line for Cloudflare Tunnel. It changes real Cloudflare accounts and puts local services on the internet, so correctness and security come before speed. - Secrets never cross IPC and are stored only in the OS keychain (core::secrets). Tunnel run tokens are never passed on a command line. Never…
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 repository11 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adding-cli-commandsSkill
- adding-doctor-checksSkill
- adding-ipc-commandsSkill
- adding-mcp-toolsSkill
- building-uiSkill
- changing-cloudflare-resourcesSkill
- reviewing-pull-requestsSkill
- verifying-changesSkill
- writing-docsSkill
- writing-user-facing-textSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Commits and pull requests: use Conventional Commits and contain no AI or assistant attribution (no Co-Authored-By trailers, no "Generated …
- Distinctive: line 71
Read the relevant part of docs/ARCHITECTURE.md and docs/CONVENTIONS.md.
- Very specific: line 76
Update the docs the change affects: user docs in apps/web/content/docs, contributor docs in docs/.
- Very specific: line 79
Run pnpm verify and fix everything it reports.
- Very specific: line 100
Write skills the same way as the existing ones: a name and a description that says what the skill does and when to use it, a checklist with …
- Distinctive: line 103
Before you change a skill, confirm what it will say against the code.
≈ “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
AGENTS.md
Guidance for AI coding agents working on Teitunnel. Human contributors: start with CONTRIBUTING.md; everything here applies to you too.
Teitunnel is a desktop app (Tauri 2: Rust + React) and a command line for Cloudflare Tunnel. It changes real Cloudflare accounts and puts local services on the internet, so correctness and security come before speed.
Rules that are never broken
- Secrets never cross IPC and are stored only in the OS keychain (
core::secrets). Tunnel run tokens are never passed on a command line. Never log, serialize or put a secret in a test fixture; wrap them inSecret<String>. - No shells. Processes start only through the typed builders in
crates/cloudflared(tokio::process::Commandwith discrete arguments). - Every Cloudflare change goes through the plan → apply engine (
core::engine): planned, shown to the person, applied with rollback, recorded in Activity. Nothing deletes a DNS record, Access application or rule Teitunnel didn't create without asking. src-taurihas no business logic.core,cf-apiandcloudflareddon't depend on Tauri.- IPC types are generated by tauri-specta. Never edit
apps/desktop/src/lib/ipc/bindings.tsby hand; runpnpm bindings. - Every user-visible sentence comes from
locales/en.json, in the UI and in Rust. unsafeis forbidden except incrates/core/src/secrets/macos.rs.- Tests with every change. A bug fix includes a test that fails without it.
- Commits and pull requests use Conventional Commits and contain no AI or assistant
attribution (no
Co-Authored-Bytrailers, no "Generated with" lines).
Layout
crates/cf-api Cloudflare REST and GraphQL client
crates/cloudflared the cloudflared binary: install/verify, commands, logs, metrics
crates/core everything the app does: engine, runtime, doctor, store, accounts, inspector
crates/lens the inspector's local reverse proxy
crates/mcp the MCP server for AI agents
crates/control the app's local control connection (JSON-RPC)
crates/localdomains local HTTPS domains: CA, certificates, resolvers
apps/cli the `teitunnel` command
apps/desktop Tauri shell (src-tauri) and React UI (src)
apps/web website and user docs (Next.js + Fumadocs, static export)
integrations/ VS Code, JetBrains, Raycast, browser extension, GitHub Action
tools/ fake-cloudflare and fake-cloudflared, the test doubles
locales/ every user-visible string (en.json)
docs/ contributor docs: ARCHITECTURE, CONVENTIONS, DESIGN, SECURITY_MODELCommands
pnpm install: dependencies and git hooks.pnpm dev: the app with hot reload (real keychain and data). The Vite dev server alone (pnpm --filter @teitunnel/desktop vite) runs the UI on a mocked backend.pnpm verify: everything CI checks (Biome, tsc, rustfmt, clippy, Vitest, nextest, cargo-deny). Must pass before every commit.pnpm check/pnpm test: checks or tests alone.pnpm bindings: regenerate IPC bindings after changing a command or an IPC type.CARGO_INCREMENTAL=0 cargo nextest run -p <package> -E 'test(<name>)': a subset of Rust tests. Packages:teitunnel-core,teitunnel-cf-api,teitunnel-cloudflared,teitunnel-lens,teitunnel-mcp,teitunnel-control,teitunnel-localdomains,teitunnel-cli,teitunnel-desktop,fake-cloudflare,fake-cloudflared.pnpm --filter @teitunnel/desktop test -- <pattern>: a subset of UI tests.pnpm --filter @teitunnel/desktop shoot <dir> [routes…]: WebKit screenshots, light and dark (?platform=windows|linuxpreviews that chrome).pnpm --filter @teitunnel/desktop a11y [routes…]: accessibility audit.pnpm --filter @teitunnel/desktop perf [seconds] [inspector]: frame timing under load.pnpm --filter @teitunnel/web dev/build/test: the website and its docs link check.
How to work
- Read the relevant part of docs/ARCHITECTURE.md and docs/CONVENTIONS.md; for UI, docs/DESIGN.md.
- Find the existing pattern and follow it. This codebase is consistent; a new pattern needs a reason.
- Make the smallest change that solves the problem completely, with tests.
- Update the docs the change affects: user docs in
apps/web/content/docs, contributor docs indocs/. Generated pages (apps/web/content/docs/reference/cli.mdx,apps/web/content/docs/reference/permissions.mdx) are regenerated withUPDATE_DOCS=1, never edited. - Run
pnpm verifyand fix everything it reports.
Recipes for the common changes are skills in .claude/skills/: plain
Markdown any agent or person can follow.
Keep this guidance current
The skills, this file and the contributor docs describe how the code works now. They are maintained like code, by whoever changes the code, in the same pull request:
- You changed a flow a skill describes (a file moved, a function was renamed, a step was added or removed, a command changed): update that skill so its paths, names, commands and examples are true again.
- You had to discover something a skill should have told you (a missing step, a generated file to refresh, a test to update, a pitfall you hit): add it to the skill, in one or two lines, where the next person will need it.
- A recurring kind of change has no skill yet, and you had to piece the recipe together
from several places: add a new skill in
.claude/skills/<gerund-name>/SKILL.md, and list it in the table above. - A rule here is wrong or outdated: fix it, and say why in the pull request.
Write skills the same way as the existing ones: a name and a description that says what
the skill does and when to use it, a checklist with exact paths, real code from this
repository (not invented examples), a way to check the result, and fewer than 500 lines.
Before you change a skill, confirm what it will say against the code. Never add dates,
session notes, or anything that's only true for one task.
node scripts/ci/check-agent-docs.mjs (part of pnpm check, and a CI job on every pull
request) fails when a skill or this file names a path that no longer exists, when a skill's
frontmatter is invalid, or when a skill is missing from the table above.
| Skill | For |
adding-ipc-commands | A Rust command the UI calls |
changing-cloudflare-resources | Anything that creates, changes or deletes something on Cloudflare |
adding-mcp-tools | A tool for AI agents in the MCP server |
adding-cli-commands | A teitunnel subcommand or flag |
writing-user-facing-text | Any message, label or error people see |
building-ui | Screens and components that follow the design system |
adding-doctor-checks | A problem the Doctor finds and fixes |
writing-docs | User and contributor documentation |
verifying-changes | Choosing and running the right checks before a commit |
reviewing-pull-requests | Reviewing a contribution against the project's bar |
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.

