| name | fude-watch |
|---|---|
| description | Watch fude.nvim local review sessions and respond to human review comments by editing code or appending replies to JSONL. Use when asked to watch local reviews, including "fude watch", "レビュー待受して", or "fude watch して". |
Tail the JSONL event log written by fude.nvim's :FudeReviewLocal session
and respond to human review comments. Copy this file and the two companion
scripts into each project's .claude/skills/fude-watch/ and adjust as needed.
.fude/current.jsonexists at the root of the repository being reviewed (the user has already run:FudeReviewLocal).- This agent session uses that repository as its working directory.
.fude/current.json is a map from branch names to sessions
({ "feat/a": { "id": ... }, ... }). Read the id from the current branch's
entry to locate the review file. The following is pseudocode:
# Detect the branch the same way as the plugin (empty on detached HEAD).
BRANCH=$(git symbolic-ref --quiet --short HEAD)
KEY=${BRANCH:-__detached__} # Use __detached__ for detached HEAD.
ID = current.json[KEY].id
REVIEW_FILE = .fude/reviews/<ID>.jsonl
- If
current.jsonor the current branch's entry is missing, ask the user to run:FudeReviewLocalon that branch first, then stop. - After a branch switch, repeat this step to locate the new
REVIEW_FILE; each branch has its own entry incurrent.json.
Read REVIEW_FILE to understand existing comments and thread states.
Each line is one JSON event: comment is a thread root, and reply points
to the root through in_reply_to. Resolved threads need no action.
If there are unhandled open comments, handle them now using step 4.
Raw tail output includes the agent's own replies and events such as viewed
and move. Filter these mechanically through fude-watch-filter.sh,
located beside this SKILL.md in the skill's base directory, rather than
relying on the language model to ignore them. The filter uses jq to
extract .event and .author_type structurally instead of matching text,
so JSON whitespace or a comment body containing "event":"comment" does
not cause a false match.
- command:
tail -n 0 -f <absolute path to REVIEW_FILE> | bash <skill base directory>/fude-watch-filter.sh - description:
fude local review comments - persistent: true
The notified stdout lines are human-authored comment, reply, resolve,
and reopen events. The filter drops viewed, move, edit, delete,
and session events, as well as lines with author_type: "agent" (echoes
of the agent's own writes). fude.nvim sets author_type on every action
event, defaulting to "human", so event kind and author type identify the
events to handle.
Dispatch on the notified event's event field:
comment(a new human-authored comment):- Read
path,start_line,end_line,body, andcontext, then inspect the relevant code. - If a fix is appropriate, edit the code and append a
replyexplaining the change. - If the comment is a question or a request for clarification, answer
with a
replywithout changing code.
- Read
reply(a follow-up from the human): reread the thread and respond in the same way.reopen: resume handling the thread.resolve: the thread is closed; you may stop work on it.- Other events (
viewed,move,edit,delete,session) or lines withauthor_type: "agent"should not pass the filter in step 3. If they do, silently ignore them without replying or reporting them.
Use the bundled fude-watch-reply.sh to append to REVIEW_FILE; never
rewrite existing lines. The script assigns a UUID, timestamp, and
author_type: "agent", and produces a single compact JSON line as required
by fude.nvim's line-based JSONL parser.
- Write only the reply body to a text file in the scratchpad (Markdown is allowed).
- Run
bash <skill base directory>/fude-watch-reply.sh <REVIEW_FILE> <root comment id> <body file>.- The second argument is the root comment's id, even when replying to a reply.
- On success, the script prints the appended JSON event on one stdout
line. If it exits with a nonzero status, the append may not have
happened; check the end of
REVIEW_FILEand report the result to the user.
When changing code, make the fix, run tests/lint, and then append the reply. Briefly describe what changed in the reply body.
When the user asks to stop watching, stop the Monitor with TaskStop. Report any open threads that have not been resolved.
- fude.nvim picks up appended events through the
auto_reloadtimer or the user's:FudeReviewReload. Do not resend a reply just because it does not appear immediately. - If a comment requires a major design change, propose an approach in a
replyand wait for the user's decision instead of implementing it unilaterally.