Skip to content

Instantly share code, notes, and snippets.

View edmondscommerce's full-sized avatar

Edmonds Commerce edmondscommerce

View GitHub Profile
@edmondscommerce
edmondscommerce / defence-before-fix-for-llms.md
Created June 26, 2026 13:10
Defence Before Fix (DBF) — an operating manual for LLM coding agents: the NET (static rule, bug class) + FILTER (TDD, instance) model, a decision procedure for when a rule goes RED, and the cardinal rule of never silencing/deleting to go green. Restates the methodology from ltscommerce.dev (Joseph Edmonds).

Defence Before Fix (DBF) — An Operating Manual for LLM Coding Agents

Audience: autonomous coding agents (and the humans who supervise them). Goal: by the end of this document you can recognise when DBF applies, run the decision procedure correctly, and — crucially — go green for the right reason instead of silencing the tool.

Primary / canonical source: Defence Before Fix: Preventing Bug Classes with Static Analysis — ltscommerce.dev, by Joseph Edmonds. DBF is one team's engineering discipline

@edmondscommerce
edmondscommerce / defence-before-fix-dbf.md
Created June 26, 2026 12:55
Defence Before Fix (DBF) — Complete Reference for Humans and LLMs. The DBF methodology coined by Joseph Edmonds: create static analysis rules that catch bug classes before fixing individual instances.
@edmondscommerce
edmondscommerce / claude-project-docs-optimisation-prompt.md
Created June 9, 2026 14:01
Claude Code Project Docs Optimisation Prompt - Resolve Excessively Large CLAUDE.md Problems

Prompt — Reorganise & Optimise a Project's Claude-Code Documentation/Instruction System

Paste everything below the line into a capable agent (Claude Code / Opus-class) working in the target repo. It runs a full discover → audit → plan → execute → verify → review of the project's agent-instruction/documentation system, with an optional memory-consolidation phase. It is project-agnostic — it discovers structure rather than assuming it — but it is concrete about the real mechanics (CLAUDE.md, @-imports, .claude/rules with paths: frontmatter, skills, generated tool regions, settings precedence) because the failure modes live in those mechanics. >

#!/usr/bin/env python
# Try to determine how much RAM is currently being used per program.
# Note per _program_, not per process. So for example this script
# will report RAM used by all httpd process together. In detail it reports:
# sum(private RAM for program processes) + sum(Shared RAM for program processes)
# The shared RAM is problematic to calculate, and this script automatically
# selects the most accurate method available for your kernel.
# Licence: LGPLv2
@edmondscommerce
edmondscommerce / is_cloudflare_caching.bash
Created September 6, 2018 10:45
Quickly test if Cloudflare is caching a resource
#!/usr/bin/env bash
readonly DIR=$(dirname $(readlink -f "$0"))
cd $DIR;
set -e
set -u
set -o pipefail
standardIFS="$IFS"
IFS=$'\n\t'
@edmondscommerce
edmondscommerce / gulpfile.js
Last active January 19, 2018 12:21
Front End Magento 1 SCSS Compilation
//Dependencies
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var cleanCss = require('gulp-clean-css');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var pump = require('pump');
var reload = browserSync.reload;
@edmondscommerce
edmondscommerce / .vimrc
Created October 25, 2017 10:18
Joseph's basic vimrc file
" =============== STANDARD VIMRC STUFF ================
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif
set nocompatible " Use Vim defaults (much better!)
set bs=indent,eol,start " allow backspacing over everything in insert mode
"set ai " always set autoindenting on
"set backup " keep a backup file
set viminfo='20,\"50 " read/write a .viminfo file, don't store more
@edmondscommerce
edmondscommerce / set strict types on PHP files.bash
Created August 29, 2017 10:12
A bash script to allow you to easily set any missing declare(strict_types) in PHP files
#!/usr/bin/env bash
echo "
Setting Strict Types If It's Missing
-------------------------------------
"
for f in $(grep -r -L 'strict_types' $projectRoot/src);
do
echo "Found file with no strict types:"
@edmondscommerce
edmondscommerce / composer install slow internet connection.bash
Created August 23, 2017 08:17
Stop Composer timing out when using a slow internet connection
#!/usr/bin/env bash
COMPOSER_PROCESS_TIMEOUT=0 composer install
@edmondscommerce
edmondscommerce / img_optimiser.bash
Last active November 23, 2017 16:19
Magento Image Optimisation Script
#!/usr/bin/env bash
readonly DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
cd $DIR;
set -e
set -u
set -o pipefail
standardIFS="$IFS"
IFS=$'\n\t'
# To use this script you'll need to install: