agentleFS
pavel-molyanovpavel-molyanov/molyanov-ai-dev/skills/code-writing/SKILL.md

code-writing

Skill296 starsChanged 4 months agoMITView on GitHub

Guides code implementation through proportional context reading, focused changes, verification, and fresh reviews. Use whenever code needs to be written — from a short ad-hoc edit to a full user-spec.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read repository instructions, affected code, its usages, and only the project documentation needed to change it safely.

    line 23
  2. Distinctive:

    Treat a new idea, risk, edge case, or opportunity discovered during implementation or review as a proposal, not authorization.

    line 33
  3. Very specific:

    When the change can alter observable behavior, apply test-master to select and run the protecting tests.

    line 49
  4. Distinctive:

    Run the smallest supported lint, format, type, build, render, and user-requested checks that cover the change.

    line 52
  5. Distinctive:

    Run no more than two review waves.

    line 58
  6. Very specific:

    After every completed implementation, include a fresh code-reviewer without a model override.

    line 63
  7. Distinctive:

    After wave 1, correct only authorized local defects in agreed normal behavior that do not require a user decision, then rerun affected …

    line 85
  8. Distinctive:

    After wave 2, do not launch another reviewer automatically.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Writing

Understand the Change

  1. Extract the requested behavior and what done means from the request or user-spec. Resolve ambiguity from repository evidence; ask only when a substantive choice changes the result or scope.
  2. Read repository instructions, affected code, its usages, and only the project documentation needed to change it safely. A localized edit needs local context; cross-cutting work needs its contracts, architecture, and relevant patterns.
  3. For non-trivial work, read every source file that will change, find affected contracts and reusable code, and establish the smallest useful baseline check. Inspect generated, lock, snapshot, or other mechanical artifacts through their generator, relevant diff, and deterministic validation rather than an unhelpful full read.
  4. Discuss the approach before editing only when evidence exposes a substantive fork, risk, or scope decision. Otherwise choose the smallest safe implementation that follows project or framework conventions.
  5. Treat a new idea, risk, edge case, or opportunity discovered during implementation or review as a proposal, not authorization. A rare or unagreed scenario is a user decision even when its correction looks local. Correct autonomously only an authorized local defect in agreed normal behavior; ask before adding behavior, state, entities, contracts, dependencies, architecture, or material complexity.

Implement and Verify

  1. Implement only the requested behavior. Reuse existing capabilities before adding abstractions or dependencies. Do not add speculative validation, fallbacks, configuration, optimization, or future flexibility without a current requirement or realistic project condition.
  2. Validate untrusted input at its boundary, keep secrets out of source, preserve useful error information, and handle failures where the program can recover or add context.
  3. Let straightforward code explain itself. Comment only when code cannot communicate the reason for a business rule, safety invariant, external constraint, compatibility workaround, deliberate tradeoff, or required ordering.
  4. When the change can alter observable behavior, apply test-master to select and run the protecting tests. If it has no test subject, state that instead of creating artificial assertions.
  5. Run the smallest supported lint, format, type, build, render, and user-requested checks that cover the change. Use a project-wide command only when it is the available entrypoint or the change is cross-cutting. Separate unrelated baseline failures from regressions.

Run Fresh Reviews

Run no more than two review waves. One wave launches the complete reviewer set selected for the implementation in parallel against the same revision. Use that same complete set in both waves. Include reviewers required by other active skills in these same waves instead of starting a separate wave sequence.

After every completed implementation, include a fresh code-reviewer without a model override. Its review scope matches the change: a localized edit gets focused connected context; a broad change gets all affected contracts and architecture.

Also launch in parallel when applicable:

  • security-auditor when a security boundary changed or the user requested a security review.

test-master owns the additional test-reviewer invocation when meaningful test code changed. Include that reviewer in every wave for this implementation.

Give each reviewer the user request or user-spec, applicable repository instructions, validation evidence, every touched source file with relevant callers and dependencies, deleted or renamed file evidence, and generator/diff/validation evidence for mechanical artifacts.

Review findings are diagnoses, not a work queue. Check the evidence and exact correction. Apply only an authorized local correction to agreed normal behavior. If the scenario is rare or unagreed, or the correction adds behavior, state, entities, contracts, dependencies, architecture, or material complexity, reject it with a short reason or ask the user before editing. user_decision_required: false does not replace this check. Reject unsupported findings with evidence and report unrelated findings without expanding the task.

After wave 1, correct only authorized local defects in agreed normal behavior that do not require a user decision, then rerun affected direct checks. If those corrections changed the reviewed result, launch wave 2 with the same complete reviewer set. Stop after a clean wave or when no authorized correction changes the result.

After wave 2, do not launch another reviewer automatically. Correct remaining local defects only in agreed normal behavior and only when they do not require a user decision, rerun the applicable direct checks, and hand off any remaining findings or required decisions about scope, behavior, approach, or material complexity. Briefly explain rejected rare findings in the handoff.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.