From pr-codex
投稿後の GitHub review thread / resolved / outdated / false-positive 信号から public-safe な feedback artifact を生成する
How this skill is triggered — by the user, by Claude, or both
Slash command
/pr-codex:learn [snapshot.json] [output-dir][snapshot.json] [output-dir]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
`/pr-codex:send` 後に返ってきた明示的な GitHub feedback だけを、次回レビュー改善用のローカル artifact として蓄積する。暗黙の merge、author 無反応、bot/generated marker だけでは学習しない。
/pr-codex:send 後に返ってきた明示的な GitHub feedback だけを、次回レビュー改善用のローカル artifact として蓄積する。暗黙の merge、author 無反応、bot/generated marker だけでは学習しない。
isResolved: true: addressed signalisOutdated: true: superseded signalpr-codex/false-positive: false_positive signalいずれも pr-codex が投稿した review thread だけを対象にする。snapshot の review_author / review_authors(未指定時は chatgpt-codex-connector)と thread 先頭コメント author が一致しない thread は無視する。
<!-- hermes-auto:... --> など bot/generated marker だけtasks/learn_feedback.py は snapshot JSON から以下を生成する。
learn-result.json: 集計、学習ポリシー、無視した thread の理由feedback-artifacts/*.json: signal ごとの public-safe artifactepisodes.jsonl: tasks/episode_memory.py write で上記 artifact から作る repo-local episode storeartifact は token らしき値とローカルパスを redaction し、コメント本文は excerpt に切り詰める。episode store へ昇格する場合も raw comment/log は入れず、PR type / path / finding class を必ず付ける。
/pr-codex:learn [snapshot.json] [output-dir] として呼び出されたら、Claude は $ARGUMENTS を shell で再分割せず、Claude が解釈済みの 1 番目の引数を SNAPSHOT_JSON、2 番目の引数を OUTPUT_DIR として直接 bind する。これにより空白を含む quoted path を保持したまま、現在の作業ディレクトリではなく plugin root 配下の tasks/learn_feedback.py に渡す。
# Claude が slash-command の解釈済み引数から直接 bind する。shell で再分割しない。
SNAPSHOT_JSON="<1 番目の引数: snapshot.json>"
OUTPUT_DIR="<2 番目の引数: output-dir>"
if [ -z "${CLAUDE_PLUGIN_ROOT:-}" ]; then
LEARN_SKILL_PATH="$(find "$PWD" .. -path '*/skills/learn/SKILL.md' -print -quit 2>/dev/null || true)"
if [ -z "$LEARN_SKILL_PATH" ]; then
echo "CLAUDE_PLUGIN_ROOT が未設定で、skills/learn/SKILL.md から plugin root を推定できません" >&2
exit 1
fi
CLAUDE_PLUGIN_ROOT="${LEARN_SKILL_PATH%/skills/learn/SKILL.md}"
fi
CLAUDE_PLUGIN_ROOT="$(cd "$CLAUDE_PLUGIN_ROOT" && pwd)"
HELPER="$CLAUDE_PLUGIN_ROOT/tasks/learn_feedback.py"
python3 "$HELPER" \
--input "$SNAPSHOT_JSON" \
--output-dir "$OUTPUT_DIR"
例:
/pr-codex:learn feedback.json out
/pr-codex:learn "feedback snapshot.json" "learn out"
上記は $CLAUDE_PLUGIN_ROOT/tasks/learn_feedback.py を絶対パスとして解決してから、それぞれ --input "feedback.json" --output-dir "out"、--input "feedback snapshot.json" --output-dir "learn out" として実行する。
snapshot には少なくとも次のキーを含める。
{
"repository": "owner/repo",
"pr_number": 123,
"head_sha": "...",
"review_threads": [],
"labels": [],
"comments": []
}
review_threads は GitHub GraphQL の reviewThreads.nodes 形式を使う。labels は [{"name":"..."}] または文字列配列、comments は false-positive の明示コメントを含む PR issue comments を渡す。
pr-codex/false-positive が明示され、対象 thread id がコメント本文に含まれる場合だけ扱うGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub yuki777/pr-codex --plugin pr-codex