Rust Code One Task
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Carry out a single task’s implementation, tests, and checkbox update in a Rust crate or workspace — nothing else.
This is the narrowest execution unit for a rust task in the iru-code pipeline: iru-rust-code-one-task-group
calls it once per task in a bucket (potentially many at once, in parallel agents via iru-isolated-skill-executor).
Purpose
iru-rust-code-one-task is the Rust-specific implementation worker iru-rust-code-one-task-group calls once per
task. Given one task’s own text (what to build, its exact implementation_plan.md checkbox line(s), and any
sub-tasks), it detects the project shape at runtime from cargo metadata and the manifests, loads only the matching
guidance from its own bundled reference/ directory, re-checks the current code state, implements exactly what is
specified, and writes/updates the tests. It formats only its own files with rustfmt and compile-checks the touched
packages with cargo check --all-targets --locked. If the task didn’t stop on a blocker, it then immediately checks
off the task’s own checkbox (and its sub-tasks') in implementation_plan.md with a "group validation pending" note,
before reporting back. Tests, clippy, coverage, cargo deny, cargo doc and license-header checks all happen once per
bucket in iru-rust-code-one-task-group, not here. It uses a medium model on purpose: the plan carries the hard
reasoning, so this skill executes one task against code agreements that live in reference/.
When a task touches the terminal UI, it also follows the catalog’s UI contract on Ratatui (see
Building user interfaces): the Screen › Region › Component tree is written
before coding, components are Widget`s emitting `Action events, lists render only the visible window, and the UI
tests capture each state × direction × theme as .txt files in .ui-screenshots/.
Two things shape every Rust task:
-
Logic lives in the library. In a CLI,
src/main.rsonly gathers process facts and calls one library entry point with injected writers; commands, policies, TUI state and rendering are library code with unit tests, which is what makes the 80% per-file coverage bar reachable. -
A contract CLI’s observable behavior is the interface. When the project follows the catalog’s CLI contract (an exit-code enum converted to
ExitCode,--format/--json, a JSON error envelope), stdout/stderr separation, exit codes, the envelope, no prompts without a TTY andNO_COLORare non-negotiable.
Project shape detection
Step 0 settles these from the files, never from assumptions, because the skill is copied into other repositories:
-
Rust at all — a
Cargo.tomlat the root or in the directory the task names; otherwise the task was mis-tagged and is reported as a blocker. -
Layout — workspace vs. single crate, each package’s targets (
lib,bin,test,example,bench,build.rs), edition,rust-version(MSRV), features, anxtaskmember and its cargo alias. A bin-only package can’t be imported fromtests/. -
Toolchain and lints —
rust-toolchain.toml,clippy.toml,rustfmt.toml,deny.toml, and the[lints]/[workspace.lints]set new code must satisfy. -
Frameworks — clap derive vs. builder, ratatui/crossterm, tokio, serde, thiserror/anyhow, colour, prompt, signal and progress crates.
-
Tests — assert_cmd, predicates, tempfile, snapbox/trycmd, insta, proptest, rstest, serial_test, testcontainers, golden files, and a few existing tests for naming style.
-
CLI contract — followed when an exit-code enum maps to
ExitCode, a--format/--jsonflag exists, or an error envelope withschemaVersionis present; otherwise the CLI’s own conventions win and the contract isn’t retrofitted. -
Host — Windows or not;
#[cfg(windows)]code is cross-checked only when that target is already installed.
Step 1 then decides where the code goes (library modules, src/cli.rs for clap types, main.rs for process facts
only, xtask/ for generators) and records the packages touched, which Step 5 turns into the compile-check.
The bundled reference library
This skill ships a reference/ directory alongside its SKILL.md, read by progressive disclosure:
reference/README.md routes to the rest, code-style.md is always read, and the others only when the task needs them.
| File | Read when |
|---|---|
|
Always — edition 2024 rules, logic in the lib, naming, ownership, the lint set, no new dependencies. |
|
The task writes or updates tests (nearly every task) — unit tests with injected writers, |
|
An error type, a fallible function, a panic/ |
|
The task adds or changes a |
|
A contract CLI and the task touches a command, flag, output, exit code, prompt, signal, config, |
|
A subcommand, argument, flag, value enum, env-backed flag, help text, completions/man pages, or config precedence. |
|
Stdout/stderr output, JSON/JSONL or the envelope, colour, prompts, progress, SIGINT/SIGTERM, broken pipe. |
|
|
|
|
|
Spawning a process, paths from arguments/config, untrusted input, tokens/secrets, writing files, or anything tempting |
|
|
Every file follows the same override: the rules are the default for new code, and a file that consistently does
something else wins, with the divergence reported in Step 8. If reference/ is missing, the skill falls back to the
repository’s own CLAUDE.md conventions and the surrounding code’s style, and says so in its report.
Plugin
Shipped by the iru-rust plugin of the ai-catalog marketplace (install with /plugin install iru-rust@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
Yes |
The task’s full text as written in |
None — this skill has nothing to do without a task description. |
|
No |
The skill’s own bundled reference directory ( |
Bundled with the skill |
Outputs
-
Source and test files created/modified per the task, following the bundled
reference/agreements — logic in the library, a thinmain.rs, noprintln!/process::exitin library code, rustdoc on every newpubitem, no new dependency/feature/unsafe/lint relaxation unless the task calls for it — plus the repository’s ownCLAUDE.mdconventions where more specific. -
Unit, end-to-end (
tests/cli.rs), golden-file and TUI (TestBackend) tests added or updated, including a case per documented# Errors/# Panics— not run by this skill; the caller runs the suite once for the whole bucket. -
For terminal-UI tasks: UI tests (component/screen/flow, with minimal/typical/many-items/long-content and right-to-left fixtures) that write
.ui-screenshots/<kind>/<Id>/<state>--<direction>--<theme>.txtfor every.ui-quality.ymldirection × theme (plusno-color), with asserted accessibility checks at the file’s level. -
A rustfmt pass over only the files this task touched, and a
cargo check --all-targets --locked -p <package>compile-check of each touched package (plus--all-featureswhen the package declares features, and another target when it is already installed) — passed, fixed, found unrelated to this task, or reported unavailable. -
implementation_plan.mdwith this task’s own checkbox (and its sub-tasks') checked off and a "group validation pending" note, written immediately once the task finishes cleanly. Left untouched if the task stopped on a blocker. -
A short summary handed back to the caller: shape detected, packages touched, reference files read, files touched, tests added/updated, golden/snapshot changes (additive or needing a
schemaVersionbump), compile-check result, generated artifacts needing regeneration (completions, man pages, CLI reference), the Screen › Region › Component decomposition and the UI tests/captures added (terminal-UI work), whether it stopped on a blocker, and any deviation fromreference/.
Execution flow
A conflict between reference/ and the surrounding code is deliberately not a stop condition — the skill follows the
surrounding code and reports the divergence in Step 8.
Dependencies
Invokes
None — iru-rust-code-one-task is a leaf skill; it does not call any other skill in this catalog. It reads its own
reference/ directory and edits the code and test files the task names. Tests, clippy, coverage, cargo deny,
cargo doc and license-header checks all happen once per bucket in iru-rust-code-one-task-group.
Invoked by
-
Rust Code One Task Group — Step 2, once per task in a bucket (concurrently when the group allows it, one at a time otherwise), via the
iru-isolated-skill-executoragent, passing that task’s full text including its exact checkbox line(s). That caller re-readsimplementation_plan.mdafterward to confirm the checkbox this skill already flipped landed, then replaces the "pending" note with the final validation outcome.
Source
SKILL.md on GitHub — the file this page was generated from. The bundled Rust code agreements live alongside it under reference/.