new-command
Skill14 starsChanged 4 months agoMITView on GitHub
End-to-end checklist for adding or changing a Tauri command in santree-app — domain type, #[tauri::command], bindings regeneration, query hook, view wiring, and the IPC security gate. Use whenever adding a new backend capability the frontend will call, or changing an existing command's signature.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- brycewc/domo-scriptstheir own version, first seen Nov 8, 2026
- flesler/scip-clitheir own version, first seen Oct 28, 2026
- pnp/cli-microsoft365their own version, first seen Oct 8, 2026
- ivuorinen/skillstheir own version, first seen Sep 24, 2026
- cortex-tms/cortex-tmstheir own version, first seen Feb 23, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- pnp/cli-microsoft365★ 1.5ksame name
- cortex-tms/cortex-tms★ 180same name
- flesler/scip-cli★ 4same name
- ivuorinen/skills★ 4same name
- brycewc/domo-scripts★ 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 repository6 other files it gives its agents.
- AGENTS.mdAGENTS.md
- new-commandSkill
- production-reviewSkill
- verifySkill
- production-reviewSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 56
New SQLite state: add a migration in src-tauri/migrations/.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Adding a Tauri command, end to end
The typed bridge is sacred: React view → hook in src/lib/queries.ts →
generated src/bindings.ts → #[tauri::command] → backend module. Never
invoke directly, never hand-edit bindings.ts.
Steps
- Domain types —
crates/core/src/domain.rs, deriveSerialize, Deserialize, specta::Type(+Clone, Debug). Ship plain enums; presentation (colors/labels) is the frontend's job viasrc/theme/colors.ts. For GraphQL-backed structs: explicit#[serde(rename_all = "camelCase")], and#[serde(default)]requires the field type to implementDefault. Paginated lists reuse the genericConnection<T>— don't add a new*Connstruct. Avoidf64fields on types that needEq(it breaks the derive cascade). - Command — thin wrapper in
src-tauri/src/commands.rs; real logic in the backend module (linear.rs,github.rs,repo.rs, …). When the backend isn't connected, return real-but-empty (unwrap_or_default(),Ok(vec![])) — never sample data, never hardcoded placeholder field values. - Register it in the
collect_commands![...]list insrc-tauri/src/lib.rs. - Security gate (load-bearing — run this checklist on every param):
- Any param that becomes a path or id: through
git.rssafe_path/safe_real_path(single normal component; reject.., absolute, symlink-escape). Never rawPath::join. - Any param that becomes a git argv (branch, ref, base): reject leading
-(flag injection). Shell via thegit.rshelpers, never raw. - Any URL/host check: parse at the sink —
url.host_str() == Some("…"), neverstarts_with(...). - Secrets go to the OS keychain, never a plaintext SQLite column.
- Any param that becomes a path or id: through
- Regenerate bindings —
pnpm gen:bindings, commit the changedbindings.tswith the same change (CI fails on drift). - Query hook — in
src/lib/queries.ts, nowhere else. Result-typed commands →useUnwrappedQuery; raw values → plainuseQuery; writes →useOptimisticMutation(cancel → patch → rollback → invalidate) oruseActionMutationfor fire-and-invalidate. Cross-check every invalidation key against a real registereduseQuerykey — dead keys fail silently. - Wire the view — feature state in
features/<view>/model.tsx, shared state inAppContext, server data only via the hook. - Verify — run the /verify skill (at minimum its static gates).
Recurring bug classes to check before finishing
- Linear state-type filters: any query filtering by state type must handle
the full terminal/non-startable set —
"triage","duplicate", and the custom "Blocked" (typeunstarted) have each been missed once already. - GraphQL: HTTP 200 with
{data: null, errors: [...]}needs an explicit error check; watch query complexity (cap 10000) when adding fields. - Non-idempotent effects driven by the new data (PTY spawn, setup scripts,
worktree create) must stay mounted with
display:none, nevercond && <C/>. - New SQLite state: add a migration in
src-tauri/migrations/; test CHECK constraints against real values.
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.

