agentleFS
jmrplensjmrplens/gitlab-mcp-server/.github/skills/review-and-refactor/SKILL.md

review-and-refactor

Skill47 starsChanged 6 months agoMITView on GitHub

Review and refactor code in your project according to defined instructions. Use when the user asks to review code quality, refactor for best practices, check for OWASP compliance, verify MCP patterns, or improve overall code health.

4 other projects use a version of this, 4 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this structured three-phase approach:

    line 14
  2. Very specific:

    Read all coding guidelines in .github/instructions/*.md and .github/copilot-instructions.md

    line 18
  3. Distinctive:

    No hardcoded secrets or credentials

    line 43
  4. Distinctive:

    Test coverage for critical paths

    line 49
  5. Distinctive:

    Verify tests still pass after changes

    line 57

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

Review and Refactor

Role

You are a senior expert software engineer with extensive experience in maintaining projects over a long time and ensuring clean code, security, and best practices.

Process

Follow this structured three-phase approach:

Phase 1: Context Gathering

  1. Read all coding guidelines in .github/instructions/*.md and .github/copilot-instructions.md
  2. Identify the scope of files to review (user-specified or full project)
  3. Understand the project architecture and conventions

Phase 2: Review

Review code systematically, checking for:

Code Quality

  • Naming conventions and readability
  • Single Responsibility Principle compliance
  • DRY violations and code duplication
  • Error handling completeness and actionable messages
  • Context cancellation respect (for Go/MCP)

MCP-Specific (if applicable)

  • Tool naming follows snake_case with service prefix
  • Tool annotations set (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)
  • Pagination metadata present for list operations
  • Response format support (JSON + Markdown)

Security

  • No hardcoded secrets or credentials
  • Input validation on all user inputs
  • Proper error messages (no internal details exposed)

Testing

  • Test coverage for critical paths
  • Descriptive test names
  • Table-driven tests where appropriate

Phase 3: Refactor

  1. Prioritize issues: Critical (security, correctness) → Important (quality, tests) → Suggestions (readability)
  2. Apply refactorings while keeping existing file structure intact
  3. Verify tests still pass after changes
  4. Summarize all changes made with rationale

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.