원클릭으로
project-patterns
Maestro project patterns — Rust CLI with ratatui TUI, tokio async, Claude CLI process management, and stream-json parsing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Maestro project patterns — Rust CLI with ratatui TUI, tokio async, Claude CLI process management, and stream-json parsing.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Compressed-prose response style for the orchestrator (opt-in via behavior.caveman_mode). Drops articles, fillers, and transitional prose; preserves code, paths, JSON/TOML, and quoted text verbatim.
TEMPLATE - Backend API development patterns. Copy and customize for your backend framework (Express, Django, Spring Boot, FastAPI, etc.)
TEMPLATE - Frontend web development patterns. Copy and customize for your frontend framework (React, Vue, Angular, Svelte, etc.)
Defensive patterns for GitHub (gh) and Azure DevOps (az) CLI interactions — error handling, idempotency, rate limits, missing resources.
API contract validation patterns for ensuring client-side models match backend JSON responses. Prevents decoding failures from schema mismatches. Tech-stack agnostic.
TEMPLATE - Mobile development patterns. Copy and customize for your mobile framework (React Native, Flutter, Swift, Kotlin, etc.)
| name | project-patterns |
| version | 1.0.0 |
| description | Maestro project patterns — Rust CLI with ratatui TUI, tokio async, Claude CLI process management, and stream-json parsing. |
| allowed-tools | Read, Grep, Glob, WebSearch |
Quick reference for development patterns used in the maestro project.
src/
├── main.rs # CLI entry (clap), command dispatch
├── config.rs # maestro.toml parsing (serde + toml)
├── session/
│ ├── mod.rs
│ ├── types.rs # Session state machine, StreamEvent enum
│ ├── parser.rs # Claude stream-json line parser
│ └── manager.rs # Process spawn, lifecycle, stdin/stdout
├── state/
│ ├── mod.rs
│ ├── types.rs # MaestroState, file claims
│ └── store.rs # JSON persistence (atomic write-rename)
└── tui/
├── mod.rs # Terminal setup, async event loop
├── app.rs # App state, session event handling
└── ui.rs # ratatui rendering (panels, gauges, logs)
Sessions follow: QUEUED → SPAWNING → RUNNING → COMPLETED/ERRORED/PAUSED/KILLED
SessionStatus enum with is_terminal() helperManagedSession::handle_event()StreamEvent enumassistant (text/tool_use), tool_result, result, error.tmp file, then rename() for atomicityMaestroState struct serialized as JSONApp owns all state (sessions, activity log, event channels)ui::draw() is pure rendering (takes &App, produces frame)mpsc::unbounded_channel for session → TUI communicationanyhow::Result for all fallible operations.context() for adding context to errorsunwrap() in production paths#[cfg(test)] mod tests { ... }#[test] for sync tests, #[tokio::test] for asyncunwrap() or expect() on external inputCanonical policy: docs/RUST-GUARDRAILS.md — the single source of truth for Rust coding policy in maestro. Consult this doc before proposing new modules, introducing new dependencies, or reviewing PRs that touch error handling, async, unsafe, serialization, or observability.
Quick-reference: the 8 principles (safe-by-default, errors-are-values, async hygiene, ownership-over-aliasing, tests-as-specification, supply-chain caution, readability-is-a-feature, observability).
Detailed sidecar: rust-guardrails.md in this skill directory — distilled rules with pattern exemplars (file paths and line numbers) from the maestro codebase. Read when you need a shorter answer than the full doc.
Enforced by:
Cargo.toml [lints] — unsafe_code = "deny", expect_used = "warn", dbg_macro = "deny".rustfmt.toml, clippy.toml, deny.toml, rust-toolchain.toml at repo root.test, clippy, fmt, file-size, deny (non-blocking), audit (non-blocking).maestro.toml [sessions.completion_gates].