AGENT SKILL

grug-implement

Implement a feature or refactor with the smallest clear diff. Use when the user gives the required behavior or enough context to infer it.

License 许可
MIT
最近更新
2026-10-01
Stars
★ 0
Forks
0

01 前言 Front Matter

name
grug-implement
description
Implement a feature or refactor with the smallest clear diff. Use when the user gives the required behavior or enough context to infer it.

03 SKILL.md 正文

Grug implement

Grug writes the smallest untangled change that meets today's requirement.

Untangle first

Use an accepted plan when one exists. Otherwise derive the required behavior, constraints, behavior to preserve, and non-goals from the user's request and live code.

Name what is complected. Separate only the braid required by today's change.

Read the target code, callers, and relevant tests. Proceed when the context supports the smallest safe change. If missing information changes behavior, ask the user. If the missing work is design, suggest grug-design. A formal plan is not required.

Make the change

Try deletion, a local change, an existing module or boundary, then the smallest new one. A new module must be deep: it hides more complexity than it adds. Keep one authority for each decision.

Three real callers or a trust boundary may justify sharing. They do not prove it.

Keep new code in the file that uses it. Every read pays for the jump between files, so a caller elsewhere has to earn the split.

Change the code that owns the behavior. Delete superseded code. Leave unrelated code alone.

Keep policy separate from mechanism. Keep decisions pure and effects at existing boundaries. Add lifecycle state only when time changes which events are allowed.

If the diff creates dual authority, old and new paths, wrappers around wrappers, or policy in callers, simplify it. If that changes the requested design, ask the user or suggest grug-design.

The plan is wrong, not the code, when the same workaround repeats, unrelated edge cases each need a branch, types need casts or always-set optional fields, or callers must know the module's internal rules. Stop and return to grug-design instead of patching around it.

Check and report

Run the narrow existing checks that prove the changed behavior. Add a focused test only when behavior changed and existing tests cannot catch the regression.

Prove claims by running code. The working tree includes the user's unreviewed work, so change it only with edits you can undo one at a time: break one line, run the test, then undo that edit. To run another version, read it with git show <rev>:<path> or check it out with git worktree add in a scratch directory and remove it after. Never run git checkout, restore, reset, stash, or clean on the working tree, and never commit.

When the checks pass, run the grug-cleanup skill on the change.

Open with one sentence, alone in its paragraph: the change and the check result. Then give cleanup's report without its opening sentence, and any blockers. When the user wants an independent second opinion, suggest grug-review.

04 同仓库更多 Skills

stepankuzmin
stepankuzmin/skills

vendor-skill

Adapt an external skill into this marketplace, or review upstream changes to one already adapted. Use when asked to vendor, import, adapt, mirror, or update a skill from skills.sh, `npx skills add`, or any external GitHub skills repo, especially to work around Claude Code Web only allowing one marketplace per GitHub repo name.

★ 0
stepankuzmin
stepankuzmin/skills

why

Use when the user asks to investigate why code is built the way it is: 'why does X work this way', 'why we picked Y', design rationale, regressions, or postmortems. Not for explaining a single error or a quick question. Queries each available evidence source (git and PRs, issues, docs, team chat) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.

★ 0
stepankuzmin
stepankuzmin/skills

unslop

Cut AI tells from any writing. Must always apply.

★ 0
stepankuzmin
stepankuzmin/skills

uncomplect

Pressure-test a stateful system or replacement design through Rich Hickey's simplicity and complection, Greg Young's deletability, Ousterhout's deep modules, DDD boundaries, typed effects, and explicit lifecycle modeling. Use when the user asks "what would Rich Hickey do", "optimize for deletion", "make this simpler", "define this error out of existence", "review this state machine", "design it twice", or wants to replace a working prototype without preserving its accidental architecture.

★ 0
stepankuzmin
stepankuzmin/skills

typescript-best-practices

TypeScript best practices. Use when reading or editing any .ts or .tsx file.

★ 0
stepankuzmin
stepankuzmin/skills

technical-writing

Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for /technical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.

★ 0