ワンクリックで
update-context-docs
Process captured friction events to improve context documentation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Process captured friction events to improve context documentation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Install the friction capture toolkit — session hooks that record AI friction events and remind developers to improve context docs
Assess a repository's readiness for AI-assisted development and bootstrap its layered documentation structure (guidelines, AGENTS.md, CLAUDE.md, README.md)
Disable friction capture for this repo
| name | update-context-docs |
| description | Process captured friction events to improve context documentation |
| allowedTools | ["Bash(bash *)","Bash(curl *)","Bash(find *)","Bash(git branch *)","Bash(git checkout *)","Bash(git fetch *)","Bash(git rev-parse *)","Edit","Read"] |
Check for toolkit updates:
Read .claude/.friction-capture-version.
Fetch the latest release tag:
curl -fsSL https://api.github.com/repos/gwenneg/blog-ai-friction-loop/releases/latest \
| jq -r '.tag_name'
Compare as semver (strip leading v before comparing). If the remote tag is newer, use AskUserQuestion to offer updating:
A newer version of the friction capture toolkit is available. Installed: {local} → Latest: {remote} Update now before processing friction events?
Options: Yes / No, continue anyway
If the user selects Yes, run:
bash .claude/scripts/install-friction-capture.sh
Read all *.md files from .claude/friction/ recursively (each session has its own subfolder: .claude/friction/{session-id}/{slug}.md). If none exist, report "No friction events to process." and stop.
For each file, extract the YAML frontmatter fields (type, doc_gap, date) and the body paragraph. Group events by doc_gap — the named file is the edit target.
Print a numbered list of all events:
Events to be processed:
1. one-sentence summary of what friction it captured
2. ...
Then use AskUserQuestion with a single question: "Enter the numbers of any events to exclude (comma-separated), or proceed with all." Provide one option — "Proceed with all" — and rely on the "Other" free-text input for exclusions.
Events the user excludes are tracked as "Skipped by user" and must not result in any doc edits.
Detect the default branch with git rev-parse --abbrev-ref origin/HEAD and check whether friction/update-context-docs-YYYY-MM-DD already exists with git branch --list (increment a numeric suffix until the name is unique, e.g. -2, -3). Then run:
git fetch origin
git checkout -b friction/update-context-docs-YYYY-MM-DD origin/<default-branch>
For each non-excluded event:
If a promptfoo.yaml or similar eval config exists, propose a new test case for each friction event backed by multiple events whose expected behavior can be verified with a contains/not-contains assertion rather than LLM judgment. Each case needs: description, vars.task, and at least one contains/not-contains or llm-rubric assertion.
Delete the session subfolders for all processed friction events from .claude/friction/. Each subfolder is named after the session ID; deleting it removes all friction files for that session at once.
Run git add -A, commit with message docs: improve context docs from friction capture, push, and open a PR. The PR body must contain:
YYYY-MM-DD — <what the friction was> → <what changed>## Friction Metrics
### Events
| Type | Count |
|---|---|
| Corrections | N |
| Clarifications | N |
| Denials | N |
| Mistakes | N |
| **Total** | **N** |
### Outcomes
| Result | Count |
|---|---|
| Docs improved | N |
| Eval cases added | N |
| Skipped by user | N |
**Docs improved:** `file1.md`, `file2.md`
Generated with Claude Code footer