Skip to content

Instantly share code, notes, and snippets.

@rlorenzo
rlorenzo / code-review-followup.md
Created January 26, 2026 17:16
Code Review Follow-up

Review agent-code-review.md for developer feedback. The changes are made, or an explanation is provided in the document. Re-review the staged files, taking into account the developer's feedback when making any additional recommendations. Do not repeat recommendations that were addressed and explained as not being done at this time. Please let me know if this is ready or if it needs further improvement. The revised document should not contain any completed items.

@rlorenzo
rlorenzo / code-review-response.md
Created January 26, 2026 17:15
Code Reviewer Response

Code Review Response Instructions

You are a senior software engineer evaluating code review feedback in agent-code-review.md. Your task is to either implement valid suggestions or provide your response directly within the same document, maintaining its existing format.

Process

Step 1: Read and Understand

Carefully read each comment in agent-code-review.md. The reviewer has provided their feedback - this is NOT a to-do list, but rather opinions and suggestions that need evaluation.

Step 2: Evaluate Each Point

@rlorenzo
rlorenzo / code-reviewer.md
Created January 26, 2026 17:15
Code Reviewer Prompt

ROLE You are a senior code reviewer and security expert. You are tech stack agnostic and adapt your review to the project’s languages and frameworks. You only read and analyze the code — you must never modify any source code files in the repository. The sole exception is writing your review output into a Markdown file. You never ask the user what to do next and you produce exactly one review report per run.

OUTPUT LOCATION

  • Always write your complete review to a file named agent-code-review.md in the project root.
  • Overwrite the file completely on each run — do not append.
  • This file is the only file you may create or modify.
@rlorenzo
rlorenzo / code-refinement.md
Created January 26, 2026 17:13
Claude: Code Refinement

Review the staged files to ensure the changes adhere to the KISS, DRY, and YAGNI principles. Confirm that Clean Code standards are met (including clear, consistent naming and comments where needed).

Run the linting on the changed files and fix all reported errors and warnings. Avoid using "ignore" or disabling linting rules (e.g., eslint-disable comments) to make the lint pass unless absolutely necessary, and only with a clear justification in the code.

Review tests and code coverage: check whether existing tests adequately cover the new or modified code, identify any gaps where additional tests are needed, and determine whether any existing tests must be updated to handle the new behavior correctly. When finished, ensure everything is ready for a high-quality code review.

du -sh .git
git remote prune origin && git repack && git prune-packed && git reflog expire --expire=1.month.ago && git gc --aggressive
du -sh .git
From https://gitbetter.substack.com/p/how-to-clean-up-the-git-repo-and
@rlorenzo
rlorenzo / votebug.php
Last active May 27, 2021 16:48
Bug example
<?php
function icv_createVoteEvent($data) {
global $wpdb;
if (icv_insertVoteEvent($data)) {
icv_sendVoteOpenedEmail($wpdb->insert_id);
return true;
}
return false;
}
@rlorenzo
rlorenzo / aws-lambda-policy.json
Created August 14, 2020 08:12
Policy for any AWS Lambda functions running the Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@rlorenzo
rlorenzo / findbom.php
Created February 21, 2020 01:49
Finds the BOM character in a given directory. Run in command line as a user with ability to edit the files
<?php
// From: https://stackoverflow.com/a/9773452/6001
// Tell me the root folder path.
// You can also try this one
// $HOME = $_SERVER["DOCUMENT_ROOT"];
// Or this
// dirname(__FILE__)
// This uses a ton of memory if you have lots of files.
@rlorenzo
rlorenzo / gist:2777474
Created May 23, 2012 20:11
UCLA catalog and section number formatters
/**
* Formats cat_num to display friendly version:
* 0000SSPP -> PP . int(0000) . SS
*
* @param string cat_num
*
* @return string Returns formatted string.
*/
function format_cat_num($cat_num)
{