design
Resolve a consequential engineering design choice into the smallest useful contract and reviewable implementation plan. Use for architecture, new abstractions, migrations, or a request to plan before coding.
- License 许可
- MIT
- 所属仓库
- yasik/skills
- 最近更新
- 2026-11-08
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- design
- description
- Resolve a consequential engineering design choice into the smallest useful contract and reviewable implementation plan. Use for architecture, new abstractions, migrations, or a request to plan before coding.
03 SKILL.md 正文
Design
Make the proposed behavior and caller experience concrete before adding machinery.
- Read the request, current implementation, callers, and repository conventions. Identify the actual capability gap or failure, and the goal behind the stated task: a request for file retrieval may exist to let the system run scripts. Distinguish confirmed facts, working assumptions, and decisions for the user.
- Re-ground an existing plan before building on it. Pull the latest code and dependency releases; drop work that upstream now provides and fix premises the code no longer supports.
- Trace the existing control and data flow. Delegate to the native SDK, existing harness, or framework primitive first. Every proposed component must name the gap that remains after that delegation; a design that rebuilds the client it adapts is out of scope.
- Consult prior art when it answers a specific uncertainty. Compare at least two mature implementations when the choice is consequential, adapt what fits, and do not carry over fields or mechanisms that this system will not use.
- Write the smallest caller example and explicit input/output contract. For agent systems include the task message, system instructions, tool boundary, inherited context, state ownership, and result delivery. Preserve the original natural-language request rather than silently narrowing it into a conclusion.
- Put each responsibility in the right layer: core mechanism, application policy, or integration. The core never depends on an extension package. Explain failure propagation at the boundary that owns it.
- Challenge every new type, field, option, dependency, fallback, limit, and policy with the questions below. Remove anything that fails them.
- Compare at least two options for each consequential choice, including the smallest one that could work, and recommend one.
- Classify each decision by reversibility. An internal module boundary is cheap to change; a public API, persisted format, wire protocol, or migration is not. Spend rigor on the irreversible decisions. For stateful or deployed changes, state how a failure will be observed and how the change is rolled back.
- State preserved behavior and intended breaks. Do not add compatibility shims for an unshipped API or a surface without consumers. A migration requires semantic parity where requested; moving an entry point is not proof of parity.
- Sequence the work as phases, primitives and data types first, each small enough to review on its own and each with its own proof. Use an experiment for an empirical question instead of resolving it with confident prose.
Justify every construct
Ask these of each addition. A weak answer means remove or simplify it.
- What present requirement fails without it? "Extensibility" is not a requirement.
- Is it a real use case? Can this optional field actually be absent at runtime, or should the boundary validate it once and pass a required value?
- Where does this limit or default come from: a provider, a protocol, or a number invented here?
- Does it model something already modeled? Parallel type hierarchies, 1:1 mappers between identical models, and alias or rename layers fail this test.
- How many concepts must a caller learn? One surface beats two; a default that just works and can be overridden beats required configuration.
- How is it tested? If a unit needs heavy mocking, its ownership boundary is probably wrong.
An abstraction earns its place when it removes real duplication or caller burden. Fewer lines do not excuse hidden coupling, compressed logic, or a harder public API.
Output
Lead with the recommendation and tradeoff. Include outcome and non-goals, current seam, proposed contract with a caller example, options considered, justified additions, preserved behavior and intended breaks, phases with verification, rollback where relevant, and open questions. End with numbered review questions the user can answer inline. Scale detail to the decision. Do not invent estimates, dependencies, or deadlines.
A condensed example:
**Recommendation:** Add `steer(message)` to `RunHandle`; reuse the existing input
queue. Tradeoff: steering waits for the current tool call to finish.
**Gap after delegation:** The SDK accepts mid-run input; the runner exposes no
handle to send it.
**Caller:**
handle = runner.start(agent, task)
handle.steer("Focus on the billing module.")
**Options:** (A) method on `RunHandle`, reusing the queue, chosen; (B) a new
`SteeringChannel` type, rejected because it duplicates the queue.
**Phases:** 1. `steer` plus a public test that a queued message reaches the next
turn. 2. Runnable example. 3. Documentation.
**Review questions:**
1. Should `steer` during a tool call wait or cancel the call? Proposed: wait.
A plan-only request ends at the reviewable plan. When implementation is also
requested, develop's design-approval rule decides how the plan is reviewed:
in the session, as a tracker comment, or recorded as a decision in a headless run;
standalone, continue after resolving material questions unless the user reserved
plan approval. Do not reopen a settled decision without new contradictory
evidence; still surface correctness or safety defects in that choice.
04 同仓库更多 Skills
terminal-report
Produce beautiful, structured terminal output for a CLI or analysis tool — ANSI colors, aligned data tables, inline bar charts, diverging/centered bars, tagged progress logs, sparklines, and section headers. Use this skill whenever you are building a command-line tool, analysis script, report generator, data dashboard, or status/progress display that prints to a terminal, OR whenever the user wants output to look "polished", "colored", "styled", "like a dashboard", or shows a screenshot of a pretty terminal and asks how to make one. Applies even when the user just says "print the results nicely" or "make a little CLI for this" without naming colors or charts explicitly.
technical-prose
Write and revise technical explanations, design docs, reviews, reports, and progress updates in clear, connected prose. Use when the reader needs to understand a mechanism or decision, or when a draft feels dense, choppy, jargon-heavy, or like compressed implementation notes. Preserve technical meaning while making the reasoning easy to follow.
teach
Teach a complex topic as one complete, self-paced written lesson — chaptered sections the learner reads top to bottom, a deep-dive that slows down on the single hardest concept and breaks it into steps with worked examples, diagrams only where they actually clarify, and real citations for going deeper. Works from an explicit topic ("teach me how Raft consensus works") or from one or more links/papers/docs the user wants to be brought up to speed on — it fetches them, falling back to a browser when a page is paywalled, JavaScript-rendered, or only partially retrievable. Use this whenever the user wants to *understand* something rather than just get an answer: "teach me X", "explain this <link>", "help me understand <topic>", "I want to learn <thing>", "break this down for me", "ELI5 but properly / but deep", or when they drop a URL and ask to be walked through it like a class. Distinct from a quick factual lookup or a terse summary — reach for this when the goal is durable understanding, not a TL;DR.
mermaid-render
Render a Mermaid diagram as a beautiful, optionally animated SVG (and PNG) in a calm editorial style, instead of stock Mermaid output. Supports flowchart, stateDiagram, and sequenceDiagram. Use whenever the user wants to render, draw, beautify, restyle, or "make nice" a Mermaid / flowchart / sequence / state diagram, add animated data-flow to a diagram, or turn a described process or architecture into a polished diagram for a doc, README, or slide. All styling — colors, fonts, shapes, borders, animation — is configurable in one theme file.
dev-docs
Write, rewrite, or review developer documentation to a complete, packaged technical-writing style guide: tone, grammar, punctuation, formatting, procedures, code samples, placeholders, UI text, linking, naming, and a word list of about 700 terms, plus an index of every rule. Use whenever the user asks for developer docs, technical docs, a README, API reference, quickstart, how-to, tutorial, concept page, release notes, docstrings or reference comments, or a docs style review, or wants docs that read like a major platform's documentation. Also use to check a draft against the style guide or to look up a term in the word list.
unit-test-coverage
Select, write, and review meaningful tests of public functions and interfaces. Use when adding behavior, fixing a regression, reviewing test quality, or diagnosing failing tests. Every test must protect a critical behavior or flow; never add tests only to increase coverage.