Reflect on session learnings and capture them appropriately.
Answer: "What is it you wish you had known at the start of this session?"
Consider:
- Gotchas encountered
| require 'rspec' | |
| module BST | |
| class BSTNode | |
| attr_accessor :key, :value, :left, :right | |
| def copy(other) | |
| @key = other.key | |
| @value = other.value | |
| @left = other.left |
| require 'rspec' | |
| module BST | |
| class BSTNode | |
| attr_accessor :key, :left, :right | |
| def copy(other) | |
| @key = other.key | |
| @left = other.left | |
| @right = other.right |
| 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++) { |
| import expect from 'expect.js' | |
| class GameOfLifeBoard { | |
| alvie = {}; | |
| isAlive(cell) { | |
| return !!this.alvie[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 { | |
| alive = {}; | |
| isAlive(cell) { | |
| return !!this.alive[cell]; | |
| } | |
| spawn(cell) { |
| 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 { 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); } |
A language-agnostic blueprint for implementing automated quality enforcement that integrates with AI coding agents.
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.