AGENT SKILL

engineering-principles

Apply simple, type-safe engineering practices while implementing, refactoring, testing, or reviewing TypeScript, Go, or C#. Use for code-quality decisions involving scope control, durable domain models, behavior-focused tests, idiomatic language patterns, and ceremony proportional to risk.

License 许可
MIT
所属仓库
dwin/skills
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
engineering-principles
description
Apply simple, type-safe engineering practices while implementing, refactoring, testing, or reviewing TypeScript, Go, or C#. Use for code-quality decisions involving scope control, durable domain models, behavior-focused tests, idiomatic language patterns, and ceremony proportional to risk.

02 资源文件 4

03 SKILL.md 正文

Engineering Principles

Apply these defaults when writing or changing code. More specific repository, directory, framework, generated-code, and user instructions take precedence.

Work from intent

  • Treat a question as a request for an answer, not implicit permission to edit.
  • Ask only when a missing decision materially changes behavior or safety. Otherwise use repository evidence and proceed.
  • Preserve behavior outside the requested scope. Surface valuable adjacent improvements separately instead of smuggling them into the change.
  • Prefer the simplest design that fully represents the domain. Avoid speculative abstractions, extension points, compatibility layers, and configuration.
  • Use types and constructors to make invalid states difficult to represent, without turning the type system into a second program.
  • Match process and architecture to risk. Do not add coordination or ceremony that the task does not earn.
  • When convenience for the implementer conflicts with the experience of whoever uses the work, choose their experience. That user is the end user of an interface, the caller of an API, and the next maintainer of the code. Prefer a few finished features to many rough ones.

Design the change

  • Keep policy close to the domain that owns it and keep I/O at clear boundaries.
  • Prefer focused modules with narrow public surfaces. Add an abstraction only when it hides meaningful complexity or supports demonstrated variation.
  • Reuse established repository patterns and dependencies unless they are the source of the problem.
  • Make concurrency, ownership, cancellation, resource lifetime, and failure behavior explicit.
  • Preserve compatibility across APIs, persisted data, messages, and rolling deployments unless a breaking change is intentional and approved.
  • Make an operation that changes state safe to repeat. Derive each step from the state that exists: read it, compare it with the goal, and apply the difference. A second run, or a run after a crash at any point, then reaches the same end state. Whatever a run can leave behind, such as a lock, a temporary file, or a claimed job, must be recognizable as stale by the next run.

Build the tool for the work

When the work is more than a few obvious edits, such as a sweep, a migration, or an analysis, write the smallest script, codemod, or generator that does it. A reviewer can read and rerun a tool. Changes made by hand can only be checked by redoing them.

  • Do the first unit by hand to learn the recipe. Then run the tool on that unit and compare the two results.
  • Make the tool safe to rerun.
  • Keep it where the reviewer can find it, and commit it when the work will outlive the session.

Test and explain behavior

  • Test observable behavior and important boundaries, not implementation trivia.
  • Add regression coverage for a bug when it proves the failure and protects the corrected contract.
  • Prefer deterministic signals, controlled clocks, and explicit fixtures over sleeps, retries, hidden globals, or order dependence.
  • Comment intent, invariants, external constraints, and surprising tradeoffs. Do not narrate obvious syntax.
  • Keep comments, public documentation, schemas, examples, and generated artifacts synchronized with behavior.

Load language guidance selectively

Read only the references relevant to files being changed:

When a change crosses languages, apply each reference at its boundary while keeping the end-to-end contract consistent.

Complete the work

Carry the user's objective through the authorized boundary. A passing test, review result, commit, or handoff is a checkpoint when assigned work remains. Answer status questions briefly, then continue the active task unless the user pauses or changes it.

When a dependency blocks one part, continue independent work within the agreed scope. Respect explicit holds on shared paths and unresolved policy decisions. Before stopping, identify the remaining work and the concrete dependency, permission, or decision that prevents progress. Preserve authorizations already given in the conversation; a checkpoint does not reset them.

  1. Re-read the request and diff for scope drift.
  2. Confirm types and validation match the actual runtime contract.
  3. Run focused tests and every repository-mandated check.
  4. Review error paths, cancellation, resource cleanup, observability, security, and compatibility in proportion to risk.
  5. Check documentation and generated artifacts affected by the behavior.
  6. Report concrete evidence, remaining risks, and intentionally deferred work.

04 同仓库更多 Skills

dwin
dwin/skills

visual-explainer

Render interactive visual explanations, architecture simulators, option tradeoff matrices, permission or blast-radius maps, and phased rollout cards on the host's native visual surface. Use when answering a question that compares three or more options across multiple dimensions, traces a multi-gate request or state flow, maps permissions or blast radius, lays out a multi-phase architecture plan, or when the user asks to visualize or sends `viz`.

★ 0
dwin
dwin/skills

writing-for-agents

Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.

★ 0
dwin
dwin/skills

wizard

Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.

★ 0
dwin
dwin/skills

why

Find out why code is the way it is from its history, reviews, tickets, docs, and other records, and say how sure each answer is. Use when the user asks why something is built, written, or behaves a certain way, why a choice was made, or where a number or limit came from.

★ 0
dwin
dwin/skills

whats-next

Match a task to the skill, flow, or playbook that fits it. Use when the user asks what to do next or which workflow applies, when a task fits no other skill, and for these kinds of work, which have playbooks here - proving a property of concurrent or stateful code with a model checker or verifier, matching a UI pixel for pixel, and diagnosing a live process or a captured profile, trace, or heap snapshot.

★ 0
dwin
dwin/skills

wayfinder

Plan a huge chunk of work — more than one agent session can hold — as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.

★ 0