Imported from PrakashSewani/rstats-cli (
.commandcode/skills/rstats-cli-maintainer/SKILL.md). Install upstream withnpx skills add PrakashSewani/rstats-cli --skill rstats-cli-maintainer. Copyright stays with the author (MIT).
Maintain rstats-cli
Start here
- Read the repository root
AGENTS.md. - Read
docs/ARCHITECTURE.mdfor runtime/data-flow or UI changes. - Read
docs/DEVELOPMENT.mdfor tests, packaging, CI, versioning, or releases. - Inspect the current implementation and nearby tests before editing.
- Keep changes focused and follow existing Rust/TUI patterns.
Task routing
| Task | First files to inspect |
|---|---|
| CLI/config | src/cli.rs, src/config.rs, src/main.rs, tests/cli.rs, tests/config.rs |
| collection/model | src/collector/, src/model/, tests/collector.rs, tests/domain.rs |
| event loop/commands | src/app/runner.rs, src/app/command.rs, src/app/event.rs |
| state/recording | src/app/state.rs, src/recording.rs, tests/recording*.rs |
| dashboard/TUI | src/tui/layout.rs, src/tui/screens/, src/tui/widgets/, tests/dashboard.rs |
| alerts/history | src/alerts/, src/history/, tests/domain.rs, tests/history.rs |
| npm/release | package.json, npm/, scripts/, .github/workflows/, docs/DEVELOPMENT.md |
Invariants
Snapshotis the central runtime and recording object.- Keep
Snapshot.disks: Vec<DiskSnapshot>dynamic for zero, one, and many drives. Storage indicators belong on the live Dashboard and must remain readable in narrow terminals. AppState.recorder.is_some()is the authoritative active-recording state.sstarts/stops recording; the UI shows an active marker and contextual action.- Only
KeyEventKind::Presstriggers commands. Ignore repeat and release events so toggles and navigation happen once. - Preserve JSONL header/sample/footer records, flush each sample, and prefer parsed valid sample counts over an untrusted footer count.
- Bound live histories. Do not add unbounded event-loop state without a deliberate design.
Cargo.tomlowns the version. Keep all npm manifests and optional dependency versions synchronized.- Do not commit
target/,recordings/, native package binaries,dist/, archives, credentials, or other generated artifacts. - Do not modify
.commandcode/taste/; it is managed by the taste system.
UI rules
- Use existing theme helpers and Ratatui composition patterns.
- Test empty, normal, narrow, and overflow states for UI changes.
- For dynamic disks, use safe labels from mount point/name, deterministic ordering, clamped finite percentages, capacity text, and an overflow summary rather than fixed drive slots.
- For recording/history changes, cover active, stopped, empty, interrupted, selected, and loaded states as applicable.
- Keep user-facing documentation current when behavior or controls change.
Verification
Run the narrowest relevant test first, then the full checks:
cargo fmt --all -- --check
cargo check --all-targets --locked
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --locked
npm run check-version
npm run validate-packages
npm test
Before finishing, run git diff --check and git status --short. Confirm no generated artifacts or credentials were added. For release changes, also validate the exact v<Cargo.toml version> tag rule and use node scripts/validate-packages.mjs --require-binaries after staging native binaries.
