agentleFS
santree-aisantree-ai/santree/.claude/skills/new-command/SKILL.md

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

  • Other versions5 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 5

    1. pnp/cli-microsoft365★ 1.5ksame name
    2. cortex-tms/cortex-tms★ 180same name
    3. flesler/scip-cli★ 4same name
    4. ivuorinen/skills★ 4same name
    5. 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.

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
  1. Very specific:

    New SQLite state: add a migration in src-tauri/migrations/.

    line 56

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Domain types — crates/core/src/domain.rs, derive Serialize, Deserialize, specta::Type (+ Clone, Debug). Ship plain enums; presentation (colors/labels) is the frontend's job via src/theme/colors.ts. For GraphQL-backed structs: explicit #[serde(rename_all = "camelCase")], and #[serde(default)] requires the field type to implement Default. Paginated lists reuse the generic Connection<T> — don't add a new *Conn struct. Avoid f64 fields on types that need Eq (it breaks the derive cascade).
  2. 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.
  3. Register it in the collect_commands![...] list in src-tauri/src/lib.rs.
  4. Security gate (load-bearing — run this checklist on every param):
    • Any param that becomes a path or id: through git.rs safe_path / safe_real_path (single normal component; reject .., absolute, symlink-escape). Never raw Path::join.
    • Any param that becomes a git argv (branch, ref, base): reject leading - (flag injection). Shell via the git.rs helpers, never raw.
    • Any URL/host check: parse at the sink — url.host_str() == Some("…"), never starts_with(...).
    • Secrets go to the OS keychain, never a plaintext SQLite column.
  5. Regenerate bindings — pnpm gen:bindings, commit the changed bindings.ts with the same change (CI fails on drift).
  6. Query hook — in src/lib/queries.ts, nowhere else. Result-typed commands → useUnwrappedQuery; raw values → plain useQuery; writes → useOptimisticMutation (cancel → patch → rollback → invalidate) or useActionMutation for fire-and-invalidate. Cross-check every invalidation key against a real registered useQuery key — dead keys fail silently.
  7. Wire the view — feature state in features/<view>/model.tsx, shared state in AppContext, server data only via the hook.
  8. 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" (type unstarted) 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, never cond && <C/>.
  • New SQLite state: add a migration in src-tauri/migrations/; test CHECK constraints against real values.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.