pixtuoid rust.instructions.md

A set of Rust coding rules for the pixtuoid Cargo workspace, which is a Rust project made of related packages. It defines how code should handle errors, crashes, terminal code, and package boundaries.

In plain words
What is it for?
Use it when writing or reviewing Rust code in pixtuoid, especially error handling, hooks, JSONL input, or terminal and window features.
Why use it?
It prevents unsafe error handling and stops code from being placed in the wrong package. It also protects important behavior such as silent hook failures and the 200-millisecond write limit.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ivanwng97/pixtuoid/rust
Clone the repo
git clone --depth 1 https://github.com/IvanWng97/pixtuoid

Made for: GitHub Copilot.

Per session 817 This file is loaded in full into every session.
When invoked 817 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00817 $0.00817
Opus 5 $0.00409 $0.00409
Sonnet 5 $0.00163 $0.00163
Haiku 4.5 $0.00082 $0.00082

Measured 2d ago against content hash 23606d6254bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pixtuoid rust.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/instructions/rust.instructions.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust standards — pixtuoid

These apply to all Rust in this Cargo workspace. The authoritative source is the root CLAUDE.md and the nested crates/*/CLAUDE.md — read those for the architecture invariants. Many things that look like a bug are documented, load-bearing design — read the item's own doc comment. This file is the condensed coding-standard slice.

Errors & panics

  • No unwrap() / expect() in non-test code. Tests may unwrap freely.
  • App/binary code propagates errors via anyhow::Result. Core (pixtuoid-core) reaches for thiserror only when a typed error becomes load-bearing.
  • The hook listener and JSONL watcher log and continue on malformed input — they never panic.
  • The hook shim must always exit 0 silently on any error — blocking Claude Code breaks the user's primary workflow. The 200 ms write timeout is non-negotiable.

Crate boundaries (load-bearing)

  • pixtuoid-core and pixtuoid-scene have no terminal/window dependencies — never add ratatui, crossterm, winit, softbuffer, or stdout/println! there (the crate boundary + just arch enforce it). Terminal/window code lives only in the pixtuoid binary's painters over the engine's render seam (pixtuoid_scene::floor::render_floor / pixel_painter::render_to_rgb_buffer). There is no core render trait.
  • Events flow through one channel typed mpsc::Sender<(Transport, AgentEvent)>. Don't hardcode Transport::Hook on the consumer side — each Source tags its own events.
  • The Source trait is the only seam for adding agent CLIs. Don't bypass it.

Logging

  • Use tracing::{info, warn, error}not println!/eprintln!. The only exceptions are the headless summary and explicit user-facing CLI output.

Tests (TDD-first)

  • Write the failing test before the implementation. Don't add code without a test that exercises it.
  • Unit tests: #[cfg(test)] mod tests next to the code, or a sibling tests.rs declared #[cfg(test)] mod tests; for large modules (keeps production readable without widening the API).
  • Integration / public-contract tests live in crates/<crate>/tests/*.rs (they see only the pub API).
  • Run the suite with just test (nextest). Scope with cargo nextest run -p <crate> <filter> while iterating. Don't chain cargo clippy && cargo test — they use separate build caches, so chaining recompiles the workspace twice. Run just preflight or one check at a time.

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 68 lines · 817 tokens per session scan A 23606d6254bc

Subscribe to this mod's changes

pixtuoid rust.instructions.md is an instructions file published in the GitHub repository IvanWng97/pixtuoid (462 stars, last pushed 3d ago), licensed MIT. It adds 817 tokens to every session, about $0.0041 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.