Skip to content

Instantly share code, notes, and snippets.

View odiak's full-sized avatar

Kaido Iwamoto odiak

View GitHub Profile
@odiak
odiak / codex-review.md
Last active January 20, 2026 04:19
Claude Code上でCodex CLIにコードレビューをさせるカスタムコマンド
allowed-tools
Bash(codex exec:*)

コーディングエージェント Codex CLI にコードレビューを依頼し、そのフィードバックをもとに修正を検討します。

まず、次のようなコマンドを実行します。 (プロンプトは、ユーザーの指示があれば調整してください。タイムアウトはできるだけ長く。)

@odiak
odiak / commit.md
Created January 16, 2026 02:53
変更をコミットするClaude Codeのカスタムコマンド

allowed-tools:

  • Bash(git status:*)
  • Bash(git diff:*)
  • Bash(git log:*)
  • Bash(git add:*)
  • Bash(git commit:*)
  • Bash(git restore:*)
  • Bash(git reset:*) model: claude-haiku-4-5
@odiak
odiak / PLANS.ja.md
Last active December 4, 2025 02:20
Japanese translation of PLANS.md on https://cookbook.openai.com/articles/codex_exec_plans

コード実行計画(ExecPlans)に関する仕様:

本文書では、コーディングエージェントが機能実装やシステム変更を完了するために従うべき実行計画(「ExecPlan」)の要件を規定する。読者はこのリポジトリについて全くの初心者であると想定すること。彼らが利用できるのは現在の作業ディレクトリと、こちらが提供する単一のExecPlanファイルのみである。過去の計画に関する記憶や外部の文脈情報は一切存在しないものとする。

ExecPlansとPLANS.mdの使用方法

実行可能な仕様書(ExecPlan)を作成する際には、PLANS.mdの記載内容を厳密に遵守すること。もしその内容が現在の作業コンテキストに含まれていない場合は、PLANS.mdファイル全体を読み返して内容を再確認すること。仕様書の作成にあたっては、ソース資料を入念に読み込み(必要に応じて再読し)、正確な仕様書を作成すること。仕様書を作成する際は、まずスケルトンから始め、調査を進めるにつれて内容を肉付けしていく手法を採用すること。

実行可能な仕様書(ExecPlan)を実装する際には、ユーザーに次の手順を尋ねる必要はない。単に次のマイルストーンに進むだけでよい。すべてのセクションを最新の状態に保ち、各作業段階でリストの項目を追加または分割することで、達成した進捗と次のステップを明確に示すこと。曖昧さが生じた場合は自律的に解決し、頻繁にコミットを行うこと。

#!/usr/bin/env node
// git-monthly-churn.js
// Usage:
// node git-monthly-churn.js # カレントリポジトリで実行
// node git-monthly-churn.js /path/to/repo > churn.svg
//
// 出力: 月別の変更行数(追加+削除)の棒グラフSVGを stdout に出力
import { spawnSync } from 'node:child_process';
import { stdout, stderr, argv } from 'node:process';
import ts from 'typescript';
import vue from '@vue/language-core';
import fs from 'fs';
import path from 'path';
import { proxyCreateProgram } from '@volar/typescript';
function main() {
const workspace = '.';
const compilerOptions: ts.CompilerOptions = {
@odiak
odiak / purge.js
Last active March 20, 2022 21:23
const fsp = require('fs').promises
async function purge(dir, pictureId) {
const entries = await fsp.readdir(dir, { withFileTypes: true })
let n = 0
await Promise.all(entries.map(async (e) => {
const path = `${dir}/${e.name}`
if (e.isDirectory()) {
n += await purge(path, pictureId)
} else if (e.isFile()) {
@odiak
odiak / each-dir.js
Last active November 26, 2025 08:18
each-dir.js: Execute same command on multiple directories
#! node
// example:
// each-dir dir1 somewhere/dir2 -- npm ci
const { spawn } = require("child_process");
(async () => {
const args = process.argv.slice(2);
const i = args.indexOf("--");
@odiak
odiak / export-inkdrop.js
Last active November 5, 2021 01:12
Convert Inkdrop's backup to plain Markdown files
// read notes from `data/note` directory and export to `md` directory
const fs = require('fs/promises')
;(async () => {
fs.mkdir('md', { recursive: true })
const list = await fs.readdir('data/note')
const usedNames = new Set()
for (const fileName of list) {
if (!/\.json$/.test(fileName)) continue
import * as t from "io-ts";
const codec = t.type({
a: t.number,
b: t.union([t.string, t.undefined]),
});
console.log(codec.decode({ a: 1 }));
type codec = t.TypeOf<typeof codec>;
// --------------------
# Welcome to Sonic Pi
use_random_seed 1
use_bpm 120
int = 1.0 / 8
d1 = [1, 0, 0, 0, 0.05, 0, 0, 0]
d2 = [0, 0, 0, 0, 1, 0, 0.1, 0]
d3 = [0, 0, 0.05, 0, 0, 0, 0, 0]