agentleFS
tradingstrategy-aitradingstrategy-ai/web3-ethereum-defi/.claude/skills/clean-up-for-pr/SKILL.md

clean-up-for-pr

Skill834 starsChanged 3 days agoMITView on GitHub

Clean up a completed feature, bug fix or maintained content change before PR handoff. Simplify the patch, correct code and prose, apply the required writing style guide, update agent and Sphinx documentation, check AGENTS.md conformance, and obtain an independent cross-agent review.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 16 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈16

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this after implementation and focused checks, before reporting the work as ready for review.

    line 8
  2. Distinctive:

    When reached from a skill invoked by another skill, leave cleanup to the outermost task after all its implementation is complete.

    line 12
  3. Distinctive:

    Keep the user's intended behaviour and scope.

    line 16
  4. Distinctive:

    Read the applicable AGENTS.md instructions.

    line 23
  5. Distinctive:

    Read new untracked source files explicitly: they are absent from git diff.

    line 37
  6. Distinctive:

    Simplify the code and relevant surrounding code: Remove unnecessary abstractions, redundant state, duplicated work and speculative …

    line 43
  7. Distinctive:

    Prefer existing helpers and direct control flow when they express the same behaviour more clearly.

    line 45
  8. Distinctive:

    Correct misleading information: Check comments, docstrings, error messages, examples, descriptions, notes and metadata against the actual …

    line 47
  9. Distinctive:

    When a repair or newly discovered vault starts collecting prices late, check whether it needs a historical price backfill.

    line 55
  10. Distinctive:

    Check that runbooks and PR reminders use the production Compose command and stamped image build in the migration guide.

    line 59
  11. Distinctive:

    Update Sphinx narrative/API sources, examples and index references when their contracts or usage change.

    line 65
  12. Distinctive:

    Follow the prescribed Poetry, environment and focused-test commands.

    line 74
  13. Distinctive:

    Review docstrings for rationale and mechanism: Keep a concise summary, then explain why the function exists, how it achieves its purpose, …

    line 75
  14. Distinctive:

    Before invoking any external agent CLI, read agent tricks and troubleshooting in the current session and follow its invocation, …

    line 99
  15. Distinctive:

    Do not silently substitute a moving alias or another model.

    line 110
  16. Distinctive:

    Verify each finding against the actual code and sources before applying it.

    line 126

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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

Clean up for PR

Use this after implementation and focused checks, before reporting the work as ready for review. It applies to code, documentation, skills and manually maintained descriptions, notes and metadata. Run it once for the completed change, rather than after every nested skill or individual file edit. When reached from a skill invoked by another skill, leave cleanup to the outermost task after all its implementation is complete. A child skill returns its result to its caller without starting a separate cleanup or review.

Keep the user's intended behaviour and scope. Inspect nearby code where it helps simplify or verify the change; avoid an unrelated repository-wide refactor. Preserve other work already present in the worktree. Follow the user's existing authorisation for commits, pushes, PRs and production actions.

Establish the review scope

Read the applicable AGENTS.md instructions. Confirm the repository, branch and worktree, then inspect tracked, staged and untracked changes:

pwd
git status --short --branch
git diff --stat
git diff --cached --stat
git diff --name-only
git diff --cached --name-only
git ls-files --others --exclude-standard

Include committed feature changes against the intended PR base when applicable. Read new untracked source files explicitly: they are absent from git diff. Inspect targeted hunks and the surrounding implementation rather than dumping the entire patch into context.

Clean up the implementation and text

  1. Simplify the code and relevant surrounding code. Remove unnecessary abstractions, redundant state, duplicated work and speculative generality. Prefer existing helpers and direct control flow when they express the same behaviour more clearly. Keep safeguards and meaningful regression coverage.
  2. Correct misleading information. Check comments, docstrings, error messages, examples, descriptions, notes and metadata against the actual behaviour and authoritative sources. Distinguish a published claim from a verified fact and a historical snapshot from current state. Correct factual errors without inventing missing information.
  3. Update documentation. For database repairs or persisted accessor refreshes, check the migration documentation and require a new numbered migration or an explicit no-migration rationale. When a repair or newly discovered vault starts collecting prices late, check whether it needs a historical price backfill. Standalone repair scripts are legacy format: do not recommend creating or invoking them, or rerunning a successful initial migration for a new change. Check that runbooks and PR reminders use the production Compose command and stamped image build in the migration guide. Provenance comes from the image's git commit; no host Docker hash is required. The host launcher is optional for Docker preflight and automatic image pinning. Revise relevant .claude/docs guidance when the work changes an agent workflow or reveals a reusable operational lesson. Update Sphinx narrative/API sources, examples and index references when their contracts or usage change. Keep public product copy focused on the product; put repository internals in technical documentation. Read the source files and check links and references; do not build Sphinx docs or edit generated _autosummary* files.
  4. Check repository conformance. Audit touched code and tests against AGENTS.md, especially argument and return type hints, Sphinx :param: and :return: documentation, dataclass(slots=True), #: member comments, logging, naive UTC datetimes and the repository's address/percentage types. Follow the prescribed Poetry, environment and focused-test commands.
  5. Review docstrings for rationale and mechanism. Keep a concise summary, then explain why the function exists, how it achieves its purpose, and any meaningful constraints or failure behaviour. Document inputs and outputs; include canonical API links and DataFrame column/value expectations where relevant. Replace prose that merely translates the implementation into English. Avoid padding simple functions or repeating inherited docstrings.
  6. Check the writing style guide (required for user-facing text). Read and follow the shared description writing style guide for added or changed user-facing website and data text: public descriptions, notes and metadata. Check the audience, plain language, field formatting, sources and dated claims; remove jargon, filler, hype and repetition. Repository engineering documentation, such as READMEs, Sphinx pages, .claude docs, docstrings, code comments, CHANGELOG.md entries and pull request descriptions, is outside the guide's scope: check it against the English rules in CLAUDE.md only. Reuse an earlier style review for unchanged text, but check subsequent substantive edits again. Record completion, the earlier review, or N/A when there are no user-facing text changes, including in the PR checklist when a PR is requested.
  7. Obtain an independent review using the opposite agent as described below.

Review with the opposite agent

Before invoking any external agent CLI, read agent tricks and troubleshooting in the current session and follow its invocation, permissions, streaming, timeout and completion rules. That document owns the CLI recipes.

Implementing agentRequired reviewerRequested model
CodexClaude CLIOpus 5.5 (--model claude-opus-5-5)
ClaudeCodex CLIGPT 6.1 sol (--model gpt-6.1-sol; smoke-test availability)

Resolve and smoke-test the exact requested model before a substantial review. Do not silently substitute a moving alias or another model. If the requested CLI/model cannot run after checking its setup, report the review as incomplete with the concrete reason; finish the independent cleanup that remains possible.

Give the reviewer the task intent and reviewed file groups, including new untracked files and relevant surrounding code. Require it to verify the worktree and non-empty patch, read AGENTS.md, and inspect the files itself. Ask for findings ranked by severity with file:line references and residual risks, covering correctness, regressions, missing tests, misleading text and repository instruction compliance. Request concrete simplifications only when they remove demonstrated unnecessary complexity without changing the intended behaviour.

The reviewer must not edit files, run tests, change GitHub or production state, invoke this cleanup skill, or start another reviewer. Only the implementing agent runs the cleanup workflow; this prevents recursive review chains.

Verify each finding against the actual code and sources before applying it. Fix substantiated issues within scope and re-run affected checks. Request a focused follow-up if a fix changes behaviour or leaves a material concern unresolved. Accept only a completed review with a final verdict, never a partial event stream or an empty output file.

Finish the handoff

Format only the reviewed Python paths, including reviewed new files, with poetry run ruff format path/to/changed.py path/to/new.py. Run the relevant focused checks and git diff --check. Inspect the final status and patch, including staged and untracked files. Do not start a Sphinx build or the whole test suite as a cleanup check.

Report the cleanup made, checks run, writing-style review status, reviewer and model used, review outcome, and any remaining limitations. Keep the repository's required PR description format when a PR was requested. Do not claim PR readiness when a required review or check remains incomplete.

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.