Skip to content

Instantly share code, notes, and snippets.

@devill
devill / HABIT_HOOKS_MICROFEATURE.md
Last active May 5, 2026 05:11
Habit Hooks Microfeature

Habit Hooks Microfeature

A language-agnostic blueprint for implementing automated quality enforcement that integrates with AI coding agents.

Philosophy

Habit Hooks simulates human habit forming by introducing deterministic reminders for predetermined short action plans. Just as humans develop good habits through consistent, repeated cues followed by small actions, this system trains AI agents to automatically respond to quality signals with specific, rehearsed fixes.

The key insight: habits form when a cue reliably triggers a practiced response. Habit Hooks provides the cue (the agent prompt marker) and the practiced response (the action guidance), creating a feedback loop that reinforces quality-focused behavior.

@devill
devill / learn.md
Last active April 13, 2026 07:04
Learn skill for claude

Learn

Reflect on session learnings and capture them appropriately.

Reflect

Answer: "What is it you wish you had known at the start of this session?"

Consider:

  • Gotchas encountered
import { promises as fs } from 'fs';
Array.prototype.countBy = function () {
return this.reduce((acc, item) => {
acc[item] = acc[item] || 0;
acc[item] += 1
return acc;
}, {})
}
Array.prototype.sum = function () { return this.reduce((s,v) => s + v); }
import expect from 'expect.js'
Array.prototype.groupBy = function (callback) {
return this.reduce((acc, item) => {
const key = callback(item);
acc[key] = acc[key] || [];
acc[key].push(item);
return acc;
}, {})
}
import expect from 'expect.js'
class GameOfLifeBoard {
alive = {};
isAlive(cell) {
return !!this.alive[cell];
}
spawn(cell) {
import { GPU } from 'gpu.js';
import expect from 'expect.js';
const gpu = new GPU();
const gameOfLifeFor = (n,m) => {
const evolve = gpu.createKernel(function(board, n, m) {
function countOfNeighbours(board, x, y, n, m) {
let count = 0;
for(let dy = -1; dy <= 1; dy ++) {
import expect from 'expect.js'
class GameOfLifeBoard {
alvie = {};
isAlive(cell) {
return !!this.alvie[cell];
}
spawn(cell) {
import expect from 'expect.js'
const DEAD = 0;
const ALIVE = 1;
function evolve(world) {
function countNeighbours(x, y) {
let count = 0;
for(let i = x - 1; i <= x + 1; i++) {
for (let j = y - 1; j <= y + 1; j++) {
@devill
devill / binary_search_tree_no_magic.rb
Last active August 29, 2015 14:03
Binary search tree without ruby magic
require 'rspec'
module BST
class BSTNode
attr_accessor :key, :left, :right
def copy(other)
@key = other.key
@left = other.left
@right = other.right
require 'rspec'
module BST
class BSTNode
attr_accessor :key, :value, :left, :right
def copy(other)
@key = other.key
@value = other.value
@left = other.left