--- name: with-standards description: "Applies the Standards principles to the current task and names the ones that shaped each decision. Use when writing, refactoring, or reviewing code or docs, or designing a change." --- Bundled skills live at ..//SKILL.md from this file. # With standards The Principles section below grounds every trigger. In your reply, name each principle that shaped a decision and the specific choice it changed. Cite only principles whose leaf SKILL.md you read this session. Repository instructions and standards docs override these principles on conflict. Remaining triggers: - Any code → name the data shape first, and choose its organizing structure per principle-model-the-domain. - Repository docs, RFCs, or readmes → the ponytail-docs skill to decide what to write and where, then the technical-writing skill for how it reads. - PR descriptions or commit messages → the technical-writing skill, cutting every word that changes neither meaning nor behavior. - Any prose surface, your reply to the user included → the unslop skill. # Principles Read the leaf skill in full for any principle you apply. Each entry names when it applies. Each leaf is the principle- skill, with the title in kebab case, hyphens kept and other punctuation dropped, unless the entry gives its name. ## Core - **Laziness Protocol.** Refactoring, sizing a diff, writing code that repeats work, or tempted to add abstractions or layers. Bias to deletion, reuse, and the smallest change that solves the problem. - **Foundational Thinking.** Before writing logic: core types and data structures, scaffold-vs-feature sequencing, what concurrent actors share. - **Redesign from First Principles.** Integrating a new requirement into an existing design. Redesign as if it had been foundational from day one. - **Subtract Before You Add.** Sequencing an addition, refactor, or rewrite. Remove dead weight first, then build on the simpler base. - **Minimize Reader Load.** Reviewing or shaping code that's hard to trace. Count layers and hidden state, collapse one-caller wrappers, shrink mutable scope. - **Outcome-Oriented Execution.** Planned rewrites and migrations with explicit phase boundaries. Converge on the target architecture, don't preserve throwaway compatibility states. - **Experience First.** Product, UX, or feature-scope tradeoffs. Choose user delight over implementation convenience. - **Exhaust the Design Space.** A novel interaction or architectural decision with no precedent. Build 2-3 competing prototypes and compare before committing. - **Build the Lever.** Any non-trivial work. Build the tool that does or proves it (codemod, script, generator), not by hand. The tool is the artifact a reviewer reruns. ## Architecture - **Model the Domain.** Writing stateful logic, or code that branches a lot or repeats a shape assumption across files. Encode the domain in a structure (state machine, typed model, table or registry, reducer, boundary, the right collection) instead of scattered conditionals. - **Boundary Discipline.** Wiring validation, error handling, or framework adapters. Guards at system boundaries, trust internal types, keep business logic pure. - **Type System Discipline.** Designing types or a signature in any typed language. Make illegal states unrepresentable, brand primitives, parse external data at boundaries. - **Make Operations Idempotent.** Designing commands, lifecycle steps, or loops that run amid crashes and retries. Converge to the same end state. - **Migrate Callers Then Delete Legacy APIs.** Introducing a new internal API while old callers exist. Migrate and delete in one wave. ## Verification - **Prove It Works.** After a task, before declaring done. Verify against the real artifact, not a proxy or "it compiles". - **Fix Root Causes.** 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. - **Sequence Work into Verifiable Units** (`principle-sequence-verifiable-units`). Multi-step work (sweeps, migrations, runs of similar edits) and how you stack commits and PRs. Break work into small units that each end in a check, verify each before the next, and order delivery so the sequence proves itself. - **Test Behavior, Not Implementation.** Writing, changing, or keeping a test. Assert what the code's users can observe, so the test fails when that behavior breaks and keeps passing when only the internals change. ## Delegation - **Guard the Context Window.** Context fills up: large outputs, long files, repeated reads, fan-out planning. Route bulk to subagents, keep summaries in the main thread. - **Never Block on the Human.** Tempted to ask "should I do X?" on reversible work. Proceed, present the result, let the human course-correct. ## Meta - **Encode Lessons in Structure.** You catch yourself writing the same instruction a second time. Encode it as a lint, metadata flag, runtime check, or script instead of more text.