code-craft
Contract-first coding standard for writing code. Use before you implement a feature or fix, refactor code, or write tests, and when trimming code you just wrote that accumulated defensive guards, silent fallbacks, speculative abstractions, or unrelated changes. Write against the checked contract and the current requirement instead of coding around uncertainty. Not an independent review or merge decision; to review a diff, use code-craft-review.
- License 许可
- MIT
- 最近更新
- 2026-10-28
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- code-craft
- description
- Contract-first coding standard for writing code. Use before you implement a feature or fix, refactor code, or write tests, and when trimming code you just wrote that accumulated defensive guards, silent fallbacks, speculative abstractions, or unrelated changes. Write against the checked contract and the current requirement instead of coding around uncertainty. Not an independent review or merge decision; to review a diff, use code-craft-review.
- argument-hint
- [optional task, file, or decision to focus]
02 资源文件 1
- 参考文档references/standards.md8.5 KB
03 SKILL.md 正文
code-craft
Write code that satisfies the current requirement directly, on evidence. Do not convert your own uncertainty into runtime complexity.
The quality bar is references/standards.md. Read it before the first edit; this page is the working procedure.
1. Establish the local contract
Read the project's rules (AGENTS.md, CLAUDE.md, docs, lint, tests) and the code you are about to change. For every interface whose behavior changes the implementation, find the guarantee: declaration, implementation, boundary validation, tests, docs. Callers show usage, not the guarantee.
Investigate until the decision is determined, not until the repository is understood. When a question stays open, report the unknown instead of choosing a contract and defending against it.
Completion: for each guarantee you rely on or guard, you can name its source; open questions that would change behavior are stated, not coded around.
2. Implement the current need
Write the simplest direct implementation that satisfies the task under the standards. A new guard, default, retry, wrapper, config, or layer needs a fact it serves. Let errors propagate through the project's existing mechanism unless this code owns a recovery.
Put the judgment in the code shape, not in a justification report or design notes.
Completion: every added branch and abstraction has a current reason, and the diff contains nothing the requirement does not need.
3. Trim and verify
Reread your own diff for code added to satisfy uncertainty rather than a requirement. Prefer the clearer shape over the shorter one. Run the project's required checks (format, lint, typecheck, tests) and know their result.
Completion: the diff is what you would defend in review, and verification results are known or their absence is reported.
04 同仓库更多 Skills
teaching
Teach toward a maintainable implementation when the user asks to learn before building, or says they are unfamiliar with technology required by a development task. Use for conversational co-design tied to real project work; not for general explanations, standalone tutorials, or persistent courses.
teach-me
Learn enough to co-design and maintain a real development change.
review-with-me
Curate the code worth a human's attention and present it in reviewable slices.
refactor-ui
Improve an existing UI, screen, slide deck, or visual artifact that the user mostly accepts but finds too busy, unclear, inconsistent, ugly, plain, or over-decorated. Use when the user gives feedback on a rendered artifact and wants a bounded revision that preserves what works. Not for building from scratch, exploring an undecided visual direction, deck production or conversion, or implementing a specified design.
jj-describe
Write and apply concise, self-contained Conventional Commits descriptions for Jujutsu commits. Use when the user asks to describe a jj commit, and after completing a cohesive code or documentation change in a jj repository when the current non-empty commit is undescribed. Explain what changed and why without context-only planning labels such as P0 or P1.
jj-desc
Write a concise, self-contained Jujutsu commit description that explains what changed and why.