matthewyjiang/rho-pstack
Matt's design-first engineering workflow: an attributed Rho port of pstack and thermos.
Sketch caller usage, types, signatures and module ownership before nontrivial implementation. Compare distinct designs, then implement only within the requested scope.
Trace what a change could break beyond its diff and prove the load-bearing safety assumptions through real code. Use before risky changes or shipping.
Turn recurring agent mistakes into structural prevention: architecture, types, actionable lint, then behavior tests. Use after a repeated correction or when asked to harden the workflow.
Explain subsystem architecture, runtime flow, placement, ownership, or layering before changing code. Use for how-does-this-work questions and grounding a nontrivial design.
Optional adversarial cross-model review to challenge a design or find blind spots, using per-call agent models or host delegation. Report unavailable model selection honestly; thermos remains the portable combined PR review.
Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions.
Apply to any non-trivial work, not just bulk work: edits, migrations, analyses, checks. Build the tool that does it or proves it (codemod, script, generator, or a skill your subagents follow) instead of working by hand. The tool is the artifact a reviewer can rerun.
Apply when product, UX, or feature-scope tradeoffs come up. Choose user delight over implementation convenience; ship fewer polished features over more rough ones.
Apply before you trust, report, or act on a number you measured: a speedup, a regression, a throughput, a latency, or an eval result. Find what limits it, and rule out that it measured something other than the work you think.
Apply when debugging. Trace each symptom back to the first place the system went wrong and fix it there. A guard is a fix only when the state it handles is legitimate.
Apply when context is filling up: large outputs, long files, repeated reads, fan-out planning. Route bulk to subagents; keep summaries in the main thread, not raw payloads.
Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs.
Apply when introducing a new internal API while old callers still exist. Migrate callers and delete the old API in the same wave instead of preserving compatibility layers.
Apply when reviewing or shaping code that's hard to trace. Count layers between question and answer, and hidden state in the reader's head; collapse one-caller wrappers and shrink mutable scope.
Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.
Apply when concurrent actors might write to the same file, branch, key, or state object. Eliminate the sharing first; serialize structurally only when one shared writer is a real invariant.
Apply to multi-step work (sweeps, migrations, runs of similar edits) and to how you stack commits and PRs. Break work into small units that each end in a verifiable state, check each before the next, and order delivery so the sequence proves itself to a reviewer.
Apply when sequencing an addition, refactor, or rewrite. Remove dead code, redundant validators, and stub references first, then build on the simpler base.
Apply when you write, change, or keep a test. Assert what the code's users can observe, so that the test fails when that behavior breaks and keeps passing when only the internals change.
Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, exhaust variants, derive from authoritative schemas.
Verify task outputs through the actual artifact or real user path before declaring completion. Use after implementation, fixes, migrations, or delegated work.
Lightweight entry point for Matt’s general engineering workflow. Route nontrivial tasks to design, proof, relevant principles, and thermos for every PR; no autonomy or merge-policy changes.
Frame a task before starting: expert methods, real user outcome, useful constraints, and an independent check. Use when a request is vague, overconstrained, or ready to execute.
Keep an evidence-linked decision trail for long or multi-phase work, then audit it against this Rho conversation and actual artifacts. Local by default; no automatic commits.
Deep maintainability audit for code-judo simplification, structural regressions, file growth, spaghetti, types, boundaries, canonical layers, and atomicity. Used as the quality lens of thermos; use thermos for the combined review on every PR.
Comprehensive diff-scoped correctness and security audit for bugs, cross-module breakage, developer-experience regressions, feature-gate leaks, and unintended risk. Used as the deep-audit lens of thermos; use thermos for the combined review on every PR.
The single combined PR review: run the correctness/security and code-quality lens agents in parallel, falling back to Rho's built-in reviewer, then synthesize evidence-backed findings.
Investigate design rationale, historical constraints, regressions, postmortems, or data-backed thresholds. Separate cited facts from inference; use how for runtime behavior.