Skip to content

Instantly share code, notes, and snippets.

View wagenet's full-sized avatar

Peter Wagenet wagenet

View GitHub Profile
@wagenet
wagenet / self-review-skill.md
Created September 15, 2026 19:56
Claude Self-Review Skill
name self-review
description Interactive self-review walkthrough of a PR or branch diff. Explains the change in plain language, then walks file by file, in a sensible reading order, through every change, keyed to the line numbers shown in GitHub's review UI so the user can check each one and mark the file Viewed. Ends with a readiness summary for taking the PR out of draft. Use when the user wants to review, understand, or sign off on their own PR before marking it ready. For a selective written explanation, or explanation comments posted to the PR, use explain-diff instead.

Self-review: PR walkthrough

The user has a PR (usually a draft, usually written by Claude) and wants to understand it well enough to stand behind it. The output is a guided review: a plain-language overview, then every file in turn, with every change explained, keyed to what the user sees in GitHub's "Files changed" tab. When the walkthrough ends, the user should be able to take the PR out of draft with confidence, or know e

#!/usr/bin/env bash
# git-migrate-reftable.sh
# Migrates a git repo from files backend to reftable, handling worktrees.
#
# Usage: ./git-migrate-reftable.sh [--dry-run]
#
# Requirements: git >= 2.46
# Caveats:
# - Reflogs are pruned (lost) — required by git refs migrate
# - No concurrent git operations should run during migration
@wagenet
wagenet / claude.settings.json
Last active May 20, 2026 22:54
Claude post-edit format hook
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/format.sh",
"timeout": 30
@wagenet
wagenet / fix-oxlint-config.js
Last active February 27, 2026 17:41
Oxlint migration scripts and plan for auditboard-backend
#!/usr/bin/env node
/**
* Rewrites a migration-tool-generated oxlint.config.ts:
* - Fixes indentation
* - Adds globals import + CJS override (if CJS files present)
* - Removes JSON-file overrides (tsconfig*.json)
* - Removes @auditboard/eslint-plugin from jsPlugins
* - Adds no-unsafe-assignment disable comment
*/
@wagenet
wagenet / application_policy.rb
Created May 6, 2021 21:25
Graphiti + Pundit
# frozen_string_literal: true
class ApplicationPolicy
attr_reader :user, :record
def initialize(user, record)
@user = user
@record = record
end
class Target
def call
puts "Called"
end
end
module TargetPrepend
def call
puts "Prepend"
super
#!/usr/bin/env ruby
require 'json'
def run_cmd(cmd)
puts cmd
unless ENV['VERBOSE']
cmd = "#{cmd} > /dev/null"
end
system(cmd)
@wagenet
wagenet / 0-Cargo.toml
Last active April 10, 2018 17:38
Cargo Git Dependency Error
my-dep = { git = "https://abc123:@github.com/myuser/my-dep", tag = "v1.0.0" }
require 'json'
output = `yarn outdated --json`
json = JSON.parse(output)
items = if json['type'] == 'table'
keys = json['data']['head']
json['data']['body'].map do |row|
Hash[*row.map.with_index{|v,i| [keys[i], v] }.flatten]
@wagenet
wagenet / Makefile
Last active July 19, 2017 21:45
skylight-rust Makefile
# Fail if piped commands fail
SHELL=bash -o pipefail
# Absolute root of the project
ROOT := $(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
include $(ROOT)/mk/*.mk
RUST_VERSION := $(shell cat $(ROOT)/.rust-version)
RUSTUP = rustup run $(RUST_VERSION)