Architecture diagrams
Skill khmilevoi/rpi-deploy/.claude/skills/architecture-diagrams
Use when changing code behavior or structure in this repo, or when creating or editing files under docs/architecture/ — conventions, document template, and update procedure for the Mermaid architecture docs.From its SKILL.md
npx -y skills add khmilevoi/rpi-deploy --skill architecture-diagramsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.4 KB, as published. Nobody here has run it
Architecture Diagrams
docs/architecture/ explains the system at component/process level for a
reader who does not read Rust. English only; Mermaid inside GFM (GitHub
renders it natively). This skill defines the conventions and the update
procedure. Full design: docs/superpowers/specs/2026-07-13-architecture-docs-design.md.
When code changes
- Match the files you touched against the map below; update every affected
doc before finishing the task (this is a CLAUDE.md requirement).
1a. The map isn't exhaustive — a file can anchor more than one doc — so
also grep
docs/architecture/for each changed file's path and update every doc that anchors it, even ones the map above doesn't list. - Updating a doc means all three: diagram, numbered prose walkthrough, and
Source anchorsstay consistent with each other and the code. - No matching row but you added a crate/module/process or a new external
actor: update
crates.md(andoverview.mdfor external actors), and create a newflows/<name>.mdfrom the template if a new user-visible process appeared.
Code-area → doc map
| Code area touched | Update |
|---|---|
crates/application/src/deploy.rs, scheduler.rs; crates/infrastructure/src/{git,repo,docker,health,probe,hostnet,overrides}.rs | flows/deploy.md |
crates/bin/src/cli/{connect,ssh,tunnel,api,config}.rs, crates/bin/src/compat.rs | flows/connect.md |
crates/application/src/{secrets,mask}.rs; crates/infrastructure/src/{secrets,secretsfile,secretpath,dotenv}.rs | flows/secrets.md |
crates/infrastructure/src/{cloudflare,cloudflared}.rs | flows/ingress.md |
crates/bin/src/agent/{setup,self_install,uninstall}.rs, scripts/install.sh, scripts/postinstall.js, bin/rpi.js | flows/agent-setup.md |
crates/bin/src/agent/{update,release}.rs, crates/bin/src/cli/upgrade.rs | flows/agent-update.md |
crates/application/src/command.rs, crates/bin/src/cli/sse.rs | flows/commands.md |
crates/application/src/{logs,tail,stats,diagnostics}.rs; crates/infrastructure/src/{metrics,sys,events,stats}.rs; crates/bin/src/cli/stats_*.rs; crates/bin/src/agent/logfile.rs | flows/observability.md |
crates/application/src/gc.rs; crates/infrastructure/src/{disk,history}.rs | flows/gc.md |
Cargo.toml workspace members, any crates/*/src/lib.rs, crates/domain/src/contracts.rs | crates.md |
crates/infrastructure/src/{sqlite,history,migrations,secretsfile,secretpath}.rs; crates/bin/src/agent/{config,state,migrate,migrate_ledger}.rs | storage.md |
crates/bin/src/agent/http.rs routes, crates/bin/src/proto.rs, crates/bin/src/cli/commands.rs | the flow doc of the affected command, plus crates.md if the request path itself changed |
| New external actor (registry, API, cloud service) | overview.md |
Document template
Every doc has exactly these sections, in order:
- Title + one paragraph stating what the document explains, in plain English, no Rust terminology.
- Mermaid diagram(s).
## Walkthrough— numbered steps of what happens, including failure branches (what the user sees when a stage fails, a version is too old, a deploy is superseded, …).## Source anchors— bullet list, one per code file the doc describes:`path` — role note. This is the only place code paths appear in the doc.
Mermaid style rules
- Nodes/participants named by role, never by code identifiers:
"Deploy use case", not
DeployUseCase; "Agent HTTP API", nothttp.rs. - Diagram type by purpose:
flowchart= context/components/data location;sequenceDiagram= who-calls-whom;stateDiagram-v2= lifecycles. - Soft cap ~20 nodes per diagram — split rather than grow.
- No class/trait diagrams; detail stops at components and processes.
Definition of done
- Diagram updated and consistent with the prose walkthrough.
- Failure branches in the walkthrough match current behavior.
-
Source anchorslist updated (added/removed files reflected). - Every diagram passes: fences correct,
subgraph/alt/opt/loopblocks closed withend, special characters in labels quoted (id["label (text)"]), ≤ ~20 nodes.