agentleFS
pranataa-labspranataa-labs/Workflow-Master/skills/diff-review/SKILL.md

diff-review

Skill2 starsChanged 8 days agoMITView on GitHub

Pre-commit and pre-merge review procedure for code diffs (Stage 7 Review). Scans added lines for hardcoded secrets, API keys, private keys, PII (NIK, phone numbers, real emails), staged .env files, oversized files, debug leftovers, and pre-filled demo credentials, then guides a manual review of authorization, error handling, and scope creep. Use before every commit, before opening or merging a PR, and whenever the user asks to review changes.

  • Reads credentials

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use test-design.

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.
  • shabarabaSkill

    test-design

    Automatically design comprehensive E2E test cases for newly implemented vibing.nvim features. Use immediately after completing feature implementation (Phase 5.4) and before running E2E tests. Generates test scenarios covering Happy paths, Error cases, Edge cases, and Integration points with priority ranking (Critical/High/Medium/Low) and ready-to-use test code templates using e2e_helper.lua.

    Also in 3 projects that use this

The file

Files
SKILL.md

Diff Review

Prosedur tinjauan perubahan sebelum commit dan sebelum merge. Tahap 7 (Review) pada 9-stage workflow mewajibkan pemeriksaan diff, otorisasi, dan pencegahan kebocoran rahasia. Skill ini membaginya menjadi pemindaian otomatis dan tinjauan manual.

Rule terkait: 05 (Security), 06 (Code Quality), 12 (Git Hygiene), 18 (Clean Production Handoff).


1. Pemindaian Otomatis

# Perubahan yang sudah di-stage (default, dipakai sebelum commit)
powershell -ExecutionPolicy Bypass -File skills/diff-review/scripts/scan-diff.ps1

# Seluruh perubahan terhadap branch dasar (dipakai sebelum PR/merge)
powershell -ExecutionPolicy Bypass -File skills/diff-review/scripts/scan-diff.ps1 -Base main

# Seluruh file yang dilacak git (dipakai sebelum publish repo pertama kali)
powershell -ExecutionPolicy Bypass -File skills/diff-review/scripts/scan-diff.ps1 -All

Tingkat temuan:

TingkatContohTindakan
[BLOCK]Private key, token GitHub/OpenAI/Google/AWS, .env ter-stage, file di atas 50 MBCommit dilarang sampai diperbaiki. Bila secret sudah pernah ter-push, anggap bocor: rotasi kunci.
[WARN]console.log, dd(), var_dump, debugger, password123 di atribut value=, nomor HP, NIK 16 digitTinjau. Hapus kecuali memang disengaja dan terdokumentasi.

Skrip keluar dengan kode 1 bila ada [BLOCK], sehingga dapat dipasang sebagai pre-commit hook.


2. Tinjauan Manual

Setelah pemindaian lolos, baca git diff --staged dan periksa:

2.1 Cakupan

  • Setiap file yang berubah berhubungan dengan tugas. Tidak ada refactor liar atau perubahan format massal.
  • Tidak ada file sementara: skrip debug, test_*.png, dump database, *.bak.
  • Perubahan dapat dipecah menjadi commit atomik bila menyentuh lebih dari satu concern.

2.2 Keamanan dan Otorisasi

  • Endpoint baru memiliki middleware auth dan pengecekan kepemilikan resource (cegah IDOR).
  • Input divalidasi di server, bukan hanya di frontend.
  • Query memakai parameter binding atau ORM, tanpa interpolasi string.
  • Output ke HTML di-escape; tidak ada dangerouslySetInnerHTML atau {!! !!} untuk data pengguna.
  • Mutasi state (POST/PUT/DELETE) dilindungi token CSRF.
  • Elemen UI khusus member tersembunyi bagi tamu dan aksi member terkunci di server (Rule 18).

2.3 Kualitas

  • Error ditangani secara eksplisit; tidak ada catch kosong.
  • Penamaan jelas; tidak ada kode mati atau kode yang di-comment.
  • Komentar menjelaskan alasan (why), bukan mengulang sintaks (Rule 20).
  • Log memakai tag formal [INFO], [WARN], [ERROR] tanpa emoji.

2.4 Data dan Kontrak

  • Migrasi database dapat di-rollback dan tidak menghapus data tanpa persetujuan.
  • Perubahan kontrak API (field, status code) tercermin di dokumentasi.
  • Tidak ada perubahan lockfile yang tidak disengaja.

3. Format Laporan

[REVIEW] <branch atau commit>
Scan     : PASS (0 block, 2 warn)
Scope    : 5 file, semua relevan dengan <tugas>
Security : auth dan validasi diperiksa pada <endpoint>
Findings :
  - [WARN] src/app.ts:42 console.log tersisa, dihapus
Verdict  : SIAP COMMIT | PERLU PERBAIKAN

4. Memasang sebagai Pre-commit Hook (Opsional)

Set-Content .git/hooks/pre-commit "#!/bin/sh`npowershell -NoProfile -ExecutionPolicy Bypass -File skills/diff-review/scripts/scan-diff.ps1"

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.