agentleFS
Docat0209Docat0209/SoloForge/skills/self-review/SKILL.md

self-review

Skill1 starsChanged 7 months agoMITView on GitHub

Reviews code quality before staging. Triggers ONLY when: implementation of a feature or fix is complete and code is ready to stage. Do NOT trigger after every small edit — only when a logical unit of work is done.

51 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use latex-formatting, novelty-assessment and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lingzhi227Skill

    latex-formatting

    Handle LaTeX formatting, templates, and styling for academic papers. Set up conference templates (ICML, ICLR, NeurIPS, AAAI, ACL), fix formatting issues, manage packages, and ensure venue-specific compliance. Use when the user needs to set up a paper template, fix LaTeX formatting, or prepare for submission.

    Also in 4 projects that use this

  • lingzhi227Skill

    novelty-assessment

    Assess research idea novelty through systematic literature search. Multi-round search-evaluate loops with harsh critic persona. Binary novel/not-novel decision with justification. Use before committing to a research direction.

    Also in 4 projects that use this

  • michaelboedingSkill

    slide-generation

    Use this skill to create presentation slides from structured content. Triggers: "create slides", "generate presentation", "make powerpoint", "create pptx", "build slides", "presentation from content", "slide deck", "slides for" Outputs: PPTX files, Markdown slides, or HTML presentations. Used by: pitch-deck-agent, market-researcher-agent, and other agents needing slides.

    Also in 4 projects that use this

  • juanlurgSkill

    paper-to-code

    Reads a research paper and generates an implementation notebook with equations, code, and a toy example. Use when the user wants to implement a paper, convert a paper to code, or reproduce a paper's algorithm.

    Also in 4 projects that use this

  • OpenAISkill

    idea-generation

    Use when triaging public-equity idea candidates. Do not use for final trade recommendations, pitches, memos, or models.

    Also in 3 projects that use this

  • sunnyclinches44Skill

    explain

    Explains code using real-world analogies and ASCII diagrams

    Also in 5 projects that use this

  • +6 more from lingzhi227

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 7

    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:

    Non-negotiable: Never skip. Never assume correctness.

    line 10
  2. Distinctive:

    Before reviewing code quality, verify the process was followed:

    line 16
  3. Distinctive:

    If ANY of these are NO: STOP.

    line 20
  4. Distinctive:

    Run git diff and git diff --staged — read EVERY line.

    line 26
  5. Distinctive:

    If ANY issue was found and fixed during this self-review, extract a REUSABLE PRINCIPLE — not a log entry.

    line 103
  6. Distinctive:

    Generalize: Ask "what universal rule would have prevented this AND all similar future mistakes?" Strip away project-specific details.

    line 107
  7. Very specific:

    De-duplicate: Read memory/principles.md — does a similar principle already exist?

    line 108
  8. Distinctive:

    Run the code, write a test, or verify — do not guess

    line 133

“Common” is measured: kept by at least 6 in 10 of the 42 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

Self-Review: Code Quality Gate

When this triggers: implementation complete, code written/modified, about to git add, or sub-agent returns code changes.

Non-negotiable: Never skip. Never assume correctness. Every line could contain a bug.


0. Process Compliance Check

Before reviewing code quality, verify the process was followed:

  • Was pre-code invoked (via Skill tool) before implementation started?
  • Was an issue created before code was written?
  • Is the branch correctly named and created from dev?
  • If ANY of these are NO: STOP. Do not proceed with self-review. Fix the process violation first — create the missing issue, fix the branch, or re-run pre-code.

Step 1: Read Your Own Diff

Run git diff and git diff --staged — read EVERY line.

  • Read each hunk as if reviewing someone else's PR — do not skim
  • Flag lines you did NOT intend to change (accidental whitespace, unrelated modifications)
  • If diff is large, read file by file — never skip files
  • Confirm every changed line is intentional and necessary

Step 2: Correctness

  • Solves the stated problem? Re-read issue/request, compare against acceptance criteria
  • Edge cases handled? Empty input, null/undefined, zero-length arrays, negative numbers, Unicode, concurrent access
  • Off-by-one errors? Loop boundaries, array indexing, string slicing, pagination offsets
  • Null checks present? Function params, API responses, DB results, optional chaining — every nullable value checked before use
  • Race conditions? Missing await, shared mutable state, async operations that assume ordering
  • Return values checked? Non-void function return values must be used or explicitly discarded — never silently ignored (NASA Power of 10, Rule 7)

Step 3: Design & Complexity (Google Engineering Practices + Clean Code + SOLID)

  • Functions do ONE thing, max ~20 lines (Clean Code, Ch. 3)
  • Function arguments: 0 ideal, 1 good, 2 acceptable, 3+ requires refactoring (Clean Code, Ch. 3)
  • No boolean/flag arguments — they prove the function does more than one thing (Clean Code, Ch. 3)
  • "Too complex" test: if a reader can't understand it quickly, simplify (Google: "too complex")
  • No over-engineering — solve the problem NOW, not speculative future needs (Google: YAGNI)
  • Single Responsibility: if you describe a class/module with "and", split it (SOLID-S)
  • New API? Include a usage example so reviewers see how it's called (Google: small CLs)
  • Names are intention-revealing — reader knows what it does from name alone (Clean Code, Ch. 2)
  • Comments explain WHY, never WHAT — if code needs a "what" comment, simplify the code (Google)

Step 4: Code Hygiene (Clean Code + Boy Scout Rule)

  • Delete dead code — don't comment it out, VCS has history (Clean Code, Ch. 4)
  • Delete all unused imports, variables, functions — zero tolerance
  • No silently swallowed errors: empty catch {}, .catch(() => {}), ignored rejections — every error must be logged or re-thrown
  • No backward-compat hacks, alias re-exports, redundant naming (v2/New/Old prefixes)
  • No copy-pasted code — if same logic appears twice, extract it (DRY)
  • Types are correct and specific — no any in TypeScript unless truly unavoidable, no overly broad types
  • Boy Scout Rule: leave the code cleaner than you found it (Clean Code, Ch. 1)

Step 5: Security (OWASP Top 10 2021)

  • No hardcoded secrets — tokens, API keys, passwords, connection strings — not in code, comments, or config literals
  • A03 Injection: parameterized queries for ALL database access — never string concatenation for SQL/NoSQL
  • A03 XSS: escape/sanitize all user-supplied content before rendering in HTML
  • A01 Broken Access Control: deny by default, enforce authorization on every endpoint/action
  • A09 Security Logging: log auth attempts and access control failures, but NEVER log sensitive data (passwords, tokens, PII)
  • No command injection: never pass user input to exec(), eval(), child_process, or shell commands
  • Input validation at system boundaries: API endpoints, form handlers, webhooks — validate and sanitize before processing

6. Scope Check

  • Run git diff --stat — are ALL changed files within the scope identified in pre-code?
  • If any file was modified that is NOT in the expected scope: justify it or revert it.
  • Out-of-scope improvements spotted during development belong in new issues, not this PR.

7. Agent Output Verification

  • "Build passes" ≠ "product works." If the build/tests pass, that verifies CODE correctness, not PRODUCT correctness.
  • Have you actually SEEN the output? Not read the code — seen the rendered result, clicked the buttons, observed the behavior?
  • If a sub-agent reported success: verify it yourself. Agents can write code but cannot judge product quality.
  • Rule: Never trust "it should work." Run it. See it. Click it. If you can't verify it visually, flag it for staging-verify or manual testing.

Step 7.5: Generalized Learning

If ANY issue was found and fixed during this self-review, extract a REUSABLE PRINCIPLE — not a log entry.

Process:

  1. Identify the error type: What category does this belong to? (auth config, scope creep, missing test, data model flaw, etc.)
  2. Generalize: Ask "what universal rule would have prevented this AND all similar future mistakes?" Strip away project-specific details.
  3. De-duplicate: Read memory/principles.md — does a similar principle already exist? If yes → strengthen the wording. If no → add it.
  4. Write one line to memory/principles.md:
    • Format: - [Category] [Universal principle]
    • ✅ Good: - [Auth] Any third-party auth integration must verify redirect URLs for ALL deployment environments in pre-code scope
    • ✅ Good: - [Testing] Never trust "build passes" — run the full user journey manually or with Playwright after every deploy
    • ❌ Bad: - [2026-04-05] Forgot OAuth redirect for staging (this is an event log, not a principle)
    • ❌ Bad: - Fixed the Supabase Site URL issue (this is project-specific, not reusable)
  5. Prune during retro: In the retro skill, review memory/principles.md. Remove principles that haven't been relevant in 3+ months. Merge overlapping principles.

The goal: memory/principles.md is a CONCISE list of 10-30 universal principles that improve every future project — not a growing log of past incidents.


Step 8: Verdict

If ANY issue was found:

  1. Fix it immediately — do not proceed with staging or committing
  2. Re-run self-review from Step 1 on the new diff
  3. Repeat until review is clean

When clean, report:

  • Which steps completed, issues found and fixed
  • State: "Self-review passed. Ready to stage/commit."

If uncertain about correctness:

  • Run the code, write a test, or verify — do not guess
  • "It should work" is NOT acceptable — prove it works

Next Steps

Report to user: "Self-review [PASSED/FAILED]. Issues found: [N]. Fixed: [N]. Remaining: [N]"

Suggested next steps (user decides):

  • Passed → "Run test-gate"
  • UI changes → "Plan ux-audit after PR"

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.