xangi 上で起きた事象(再投稿・cron が回らない・データ不整合・想定外の動作・エラー等)の調査・根本原因分析・横展開・修正・報告を、再現性のあるワークフローで実行する汎用スキル。「調査して」「原因調べて」「再発防止」「横展開して」「xangi-kaizen」「事象を分析して」で発動。
npx skills add https://github.com/karaage0703/ai-assistant-workspace --skill xs-xangi-kaizen
xangi 上で起きた事象を「事象整理 → ログ調査 → 真因特定 → 横展開 → 修正・報告」の5フェーズで深掘りし、再発防止までやり切る汎用スキル。
スキルの背景・設計思想・参考文献は README.md を参照。
何が起きた / いつ / どこで(チャンネル・対象スキル)。事実を時系列で整理する。
ステップ:
xangi-cmd discord_history --count 30
xangi-cmd discord_history --channel <ID> --count 50
[NOTES_DIR] の過去 xangi-kaizen ノートを事象キーワードで grep # xangi-kaizen タグの全事例
grep -rl '#xangi-kaizen' [NOTES_DIR] | sort
# 対象スキル名・キーワードで絞り込み
grep -rl '#<対象スキル名>' [NOTES_DIR]
grep -rl 'state\|cron\|<キーワード>' [NOTES_DIR]/*xangi-kaizen* 2>/dev/null
ヒットした事例は中身を読む。同じパターンなら「対策」「教訓」をそのまま適用できる。未知なら次フェーズへ。
複数のソースを横断的に追う。一つの観点で結論を出さない。
ステップ 0(重要): 調査対象 bot の workspace を特定する。 xangi は bot ごとに別 workspace・別プロセスで動く構成を取りうる。複数 bot を運用している場合、手元の workspace だけを見ても対象 bot の事象は写っていないことがある。
# Docker 運用の場合: bot がどのコンテナか確認
docker ps --format '{{.Names}}\t{{.Image}}'
# コンテナの workspace マウント元を確認
docker inspect <container> --format '{{range .Mounts}}{{.Source}} -> {{.Destination}}{{println}}{{end}}' | grep '/workspace'
特定した <bot-workspace> 配下の logs/sessions/ と logs/tool-trajectory/ を見る。環境変数やチャンネル割り当ては各 bot の .env で確認する。
| 観点 | コマンド/対象 |
|------|--------------|
| state ファイル | [STATE_DIR]/*_state.json、references/*_last_check.json 等の中身と stat -c "%y %n" |
| git 履歴 | git log -p --all -- <path>、git show <commit>:<path> |
| git reflog | git reflog --since=<時刻>(ブランチ切替・rebase・reset の追跡) |
| cron / schedule | xangi-cmd schedule_list 2>&1 \| grep -B2 -A3 <キーワード> |
| セッションログ(生応答) | 対象 bot の <bot-workspace>/logs/sessions/*.jsonl。事象の出たチャンネル ID で grep -rl <channelId> → 該当ファイルの当該ターンを開き、assistant result を確認 |
| tool-trajectory ログ | <bot-workspace>/logs/tool-trajectory/*.jsonl。tool search / loop / drift / stream buffer / cache などのイベントが時系列で残る |
| 該当スクリプト/コード | skills/<name>/scripts/、または対象リポのソース。ログで事象を確定した後に「なぜそうなるか」を辿る |
| 投稿履歴 | xangi-cmd discord_history --channel <ID> --count 30 |
「これしか見ていない」状態で次フェーズに行かない。
「なぜ」を最低3回掘る。 誰が読んでも納得できる説明になるまで掘り続ける。
仮説 → 証拠 → 検証のサイクル。仮説が間違ってたら戻る。実装前に詰める。
例:
pull --rebase / checkout 多発を確認 → ✓「ここまで掘れば再発防止策が書ける」と思える深さまで掘る。一段で止まると対症療法になる。
応答内容系(変な出力・空・drift)はコードからの推測で終わらせない。「コードのこの fallback だ」で止めず、Phase 2 で開いた当該ターンの生ログと突き合わせて確定する。ログで確定するまでは報告に「ここは未確認の推測」と明示する。
同じパターンの他ファイル/問題を網羅検索する。1件直しても、別の場所で同じ事故が起きうる。
# ランタイム状態ファイル系を全部洗い出し
git ls-files | grep -iE "state|cache|last_check|cookie|credential|\.pid$"
# 巨大ログ系(リポジトリ肥大化のリスク)
git ls-files | xargs -I {} stat -c "%s %n" {} 2>/dev/null | sort -rn | head -20
# 最近書き換えられた tracked ファイル(書き換え頻度 + tracked = 罠)
git ls-files | xargs -I {} stat -c "%y %n" {} 2>/dev/null | sort -r | head -30
事象の根本パターンに沿って検索クエリを組み立てる。「state ファイルが git ロールバックされた」が真因なら「他に git 管理されてる runtime state は無いか」を網羅する。
実装方針:
.gitignore に追加)報告フォーマット:
詳細レポートは [NOTES_DIR] にタグ付きで保存する。事例は積み重ねていく(次回の調査で Phase 1 の KEDB として効く)。
[NOTES_DIR]YYYYMMDD_xangi-kaizen_<事象タイトル>.md ---
title: <事象タイトル>
date: YYYY-MM-DD
type: incident
tags:
- xangi-kaizen
- incident
- <対象スキル名>
---
xs-note-taking スキルに従う(命名規則・フロントマター・同期手順を活用)過去事例を参照したいときは:
grep -rl '#xangi-kaizen' [NOTES_DIR] | sort
横展開で見つかったパターン化された教訓は、次回の調査ですぐ参照したいので [WORKSPACE]/AGENTS.md、[WORKSPACE]/MEMORY.md、または knowledge/lessons_archive.md のような長期参照先に集約する。
xs-xangi-kaizen
xangi-kaizen でこの事象を調査して
原因調べて
再発防止策を立てて
調査して、横展開もしてほしい
事象を分析して
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take karaage0703/xs-xangi-kaizen from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.