Skip to content

Instantly share code, notes, and snippets.

View mandelbro's full-sized avatar
🌀

Chris Montes mandelbro

🌀
View GitHub Profile
@mandelbro
mandelbro / copilot-instructions-template
Created September 12, 2025 15:52
Template for Github Copilot Review Instructions
You are a principal-level software engineer with over 15 years of experience across startups and enterprises. You've debugged race conditions at 3 AM, refactored legacy codebases that predate npm, migrated monoliths to microservices (and sometimes back again), and have strong opinions about why certain patterns persist despite their obvious flaws. You've seen enough production incidents to know that complexity isn't always where you think it is, and simple isn't always what it seems.
## Your Core Strengths
### 1. Identify Hidden Complexity
You excel at spotting the iceberg beneath the surface. When reviewing work items or code:
- Point out non-obvious edge cases and failure modes
- Identify implicit dependencies that aren't immediately apparent
- Highlight areas where "simple" changes cascade into complex migrations
- Explain WHY something is complex, not just that it is
# Commit Size and Scope Optimization for Human Code Review Efficiency
Modern development teams face increasing pressure to balance AI-assisted productivity with maintainable code review processes. **Research consistently shows that pull requests containing 200-400 lines of code achieve optimal defect detection rates**, while **teams implementing structured commit practices see 36% fewer bugs and 10.6% higher development velocity**. This comprehensive guide provides actionable strategies specifically designed for medium-sized engineering teams working with AI coding tools like Cursor.
## Optimal commit size guidelines for code review effectiveness
**Industry standard thresholds for maximum review effectiveness:**
- **200-400 lines of code per PR** represents the optimal range for human reviewers
- **Under 200 lines** maximizes defect detection (Cisco's comprehensive study)
Memory Retrieval:
- Always begin your chat by saying only "Remembering..." and retrieve all relevant information from your knowledge graph
- While conversing with the user, be attentive to any new information that falls into these categories:
a) Goals (goals, targets, aspirations, etc.)
b) Project structure, location of directories, key documentation
c) Application use-cases, constraints, or intended outcomes
d) Design patterns, external libraries, naming conventions, etc.
e) Basic Identity (age, gender, location, job title, education level, etc.)
f) Behaviors (interests, habits, etc.)
g) Preferences (communication style, preferred language, etc.)
require: rubocop-rspec
AllCops:
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
TargetRubyVersion: 2.7
Exclude:
- '**/node_modules/**/*'
- '**/vendor/**/*'
;(function ( app ) {
'use strict';
angular.module('PeachDelivery')
.factory("DeployService", DeployService);
DeployService.$inject = [];
function DeployService () {
@mandelbro
mandelbro / IIFE
Last active August 31, 2016 17:46
;(function () {
"use strict";
// code in here keeps the global scope clean!
var globalVar = "I'm a global variable!";
function privateFunction () {
return "I'm a private function!";
}
app.directive("scrollToOnLoad", [
'$location',
function( $location ) {
return {
restrict: "A",
link: function(scope, element, attributes) {
var scrollTo = $location.hash() === attributes.id;
// scroll to the top of the posting with a padding for the header
if(scrollTo) {
@mandelbro
mandelbro / drush-cheatsheet.txt
Created April 11, 2014 18:31
SPT Drush Cheatsheet
Get files from the dev server
sudo -E rsync --recursive --compress --times --rsh='ssh -l deploy' \
spt-stage.com:/var/www/deploy/current/sites/de.animax/files/ \
/var/www/deploy/current/sites/de.animax/files/ && chown -R vagrant:www-data /var/www/deploy/current/sites/de.animax/files && sudo chmod -R 777 /var/www/deploy/current/sites/de.animax/files && find /var/www/deploy/current/sites/de.animax/files -type d -exec sudo chmod 777 -R {} \;
All database commands
drush @de.animax sql-drop -y && drush cc drush && ssh -l chrismontes spt-stage.com drush @de.animax sql-dump | drush @de.animax sql-cli && drush @de.animax updb -y && drush @de.animax ucrt root --mail="chrismontes@about.me" --password="rewt" && drush @de.animax urol "super administrator" --name=root && drush @de.animax vset preprocess_css 0 --yes && drush @de.animax vset preprocess_js 0 --yes && drush @de.animax vset block_cache 0 --yes && drush @de.animax vset cache 0 --yes && drush @de.animax vset cache_content_flush_cache_block 0 --yes && drus
@mandelbro
mandelbro / zepto-jquery-wrapper.js
Last active August 29, 2015 13:56
Zepto/jQuery Wrapper
/**
* A simple JavaScript wrapper that will provide allow
* you to take advantage of the ZeptoJS library if it
* is available, and fallback to jQuery if not.
*
* Based on this pattern explanation from Stack Overflow:
* http://stackoverflow.com/a/502068
*/
;(function( $, window, undefined ) {
/**
* Blueprint JS starter view controller
*/
var exampleViewController = (function( $, window, undefined ) {
// this is a private function
var buildListeners = function() {
var self = this,
// add a map of callbacks to use for the listeners below
callbacks = {};