From codereview-skills
Inline @AI code-review workflow. Scans uncommitted changes across the repo, attends every comment containing `@AI`, prepends `@SEEN ` to mark it processed, and writes an `@AI-reply:` comment immediately after. Works on any text source file using per-filetype comment syntax. Reads git state but never commits. Use when the user types `go`, `/codereview`, "process AI comments", or similar.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codereview-skills:codereview-inlineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Lightweight, in-source code-review loop. The user drops `@AI` comments anywhere in any source file. The agent scans uncommitted changes, answers every open `@AI` in place, and leaves the exchange embedded in the codebase as a review trail. The companion `codereview-clean` skill removes the trail when the user is done.
Lightweight, in-source code-review loop. The user drops @AI comments anywhere in any source file. The agent scans uncommitted changes, answers every open @AI in place, and leaves the exchange embedded in the codebase as a review trail. The companion codereview-clean skill removes the trail when the user is done.
The user says one of: go, /codereview, process AI comments, review my @AI. No arguments — the scan is repo-wide over uncommitted changes.
| Token | Meaning |
|---|---|
@AI | Open thread. Agent must attend. |
@SEEN | Prepended (same comment, before @AI) when the agent processes the thread. Original @AI is preserved. |
@AI-reply: | Prefix for the agent's reply comment, placed immediately after the user's comment block. |
Tokens are case-sensitive and recognized only inside comments. Never inside string literals, format specifiers, URLs, or identifiers. Language-aware comment-context check is mandatory before treating a hit as an open thread.
| Languages | Line comment | Block comment |
|---|---|---|
| Python, Ruby, Shell, YAML, TOML, R, Elixir, Perl, Make, Dockerfile | # | (none — use # per line) |
| JS, TS, C, C++, Java, Go, Rust, Swift, Kotlin, Scala, C#, Dart, PHP, CSS, SCSS, Less, Sass | // | /* ... */ |
| HTML, XML, SVG, Vue templates | (none) | <!-- ... --> |
| JSX/TSX body (inside JSX expressions) | (none) | {/* ... */} |
| SQL, Haskell, Ada, Lua | -- | /* ... */ (SQL only) |
| Lisp, Clojure, Scheme, Common Lisp | ;; | (none) |
| Markdown, MDX | bare prose line (no marker needed); also <!-- ... --> or %% ... %% if the user wants the trail hidden in rendered output | same |
Reply comment uses the same comment syntax as the user's marker. For block-only languages (HTML, JSX), both marker and reply are block comments. For line-only languages, both occupy their own line. For Markdown/MDX, the reply matches the user's form: if the user wrote a bare @AI line in prose, reply as a bare @AI-reply: line; if the user wrote %% @AI ... %% or <!-- @AI ... -->, wrap the reply the same way.
git status --porcelain → list of changed files (staged + unstaged combined). Skip binary files, lockfiles, generated files, vendored paths, and anything in .gitignore-style locations.@AI word-boundary hits. The file-level "is changed" gate is enough; within a changed file every open @AI is fair game.@AI in plain prose is valid and processed normally. Still skip hits inside fenced code blocks (``` or indented), inline backticks, link targets, and HTML attribute values.@AI and NOT @SEEN → open.@SEEN and @AI → closed, skip.@AI-reply: → agent's prior reply, skip.@SEEN (literal, with one trailing space) before the @AI token in the same comment. Preserve all other text, whitespace, indentation, and surrounding prose. For multi-line block comments, only the line containing @AI is modified.
d. Insert a new comment immediately after the user's comment block, using the filetype's comment syntax, prefixed @AI-reply:. Match the user's indentation. Replies are normal prose; one or two lines is typical; longer is fine when warranted. No markdown formatting that would render badly in source comments.Processed N threads across M files, followed by one line per thread: <path>:<line> + a short gist of the question. The user opens the file to see the full reply.Before formulating a reply, scan upward and downward within the same file for an adjacent closed review block — defined as a sequence of @SEEN @AI comments and/or @AI-reply: comments within ~10 lines of the current open @AI, OR sharing the same enclosing code construct (same function, same JSX node, same markdown section, same struct/class body).
If a prior exchange is found:
@AI is a follow-up, not a fresh question.@AI is a clarification request or contradicts the prior reply, address that directly.@AI-reply: is the agent's last word in this thread.Cross-file continuity is out of scope. If a follow-up genuinely spans files, the user adds explicit context inline (e.g. @AI re: the reply in auth.py, what about session.py?).
Python (line-comment language):
# @AI why this magic number?
TIMEOUT = 47
After go:
# @SEEN @AI why this magic number?
# @AI-reply: legacy API page size; see PR #4421
TIMEOUT = 47
JavaScript (block-comment language):
/* @AI is this branch reachable? */
if (user == null) { handleNull(); }
After go:
/* @SEEN @AI is this branch reachable? */
/* @AI-reply: yes — null-token path when getUser() expires mid-request */
if (user == null) { handleNull(); }
HTML (block-only):
<!-- @AI should this be aria-live? -->
<div class="toast"></div>
After go:
<!-- @SEEN @AI should this be aria-live? -->
<!-- @AI-reply: yes — toast container, polite priority -->
<div class="toast"></div>
Markdown — bare prose (default for .md/.mdx):
The retry budget is 3 attempts with exponential backoff.
@AI is 3 enough for the new ingestion pipeline?
After go:
The retry budget is 3 attempts with exponential backoff.
@SEEN @AI is 3 enough for the new ingestion pipeline?
@AI-reply: probably not — ingestion p99 latency exceeds the 3-attempt window during peak. Bump to 5 or add jitter.
Markdown — hidden trail (Obsidian %% or HTML <!-- -->, user's choice):
%% @AI is this section still accurate? %%
After go:
%% @SEEN @AI is this section still accurate? %%
%% @AI-reply: outdated — protocol moved to gRPC in Apr 2026 %%
Follow-up (continuity):
# @SEEN @AI why this magic number?
# @AI-reply: legacy API page size; see PR #4421
# @AI but is PR #4421 still load-bearing? Anything still depend on this?
TIMEOUT = 47
After go:
# @SEEN @AI why this magic number?
# @AI-reply: legacy API page size; see PR #4421
# @SEEN @AI but is PR #4421 still load-bearing? Anything still depend on this?
# @AI-reply: grep finds 3 active importers (api/client.py, jobs/sync.py, tests/integration/test_pager.py). Still load-bearing.
TIMEOUT = 47
User deletes the @SEEN token from a closed comment. Original @AI reactivates on the next go. No retyping required.
printf("@AI"), "User asked: @AI"): skip. Language-aware comment-context check is mandatory.@AI mid-block: prepend @SEEN on the line that contains @AI. Reply goes after the whole block, not in the middle.@SEEN @AI) modified by user edits: still skip. Only a fresh @AI (without @SEEN in the same comment) reopens a thread.package-lock.json, dist/, .map files, *.min.*): skip even if they contain @AI.@AI but no uncommitted changes: skipped by default (file-level gate). User can hand-stage a no-op change to force inclusion.@AI with \b boundaries OR followed by non-letter, so identifiers like @AIRequest don't false-trigger. @SEEN does not contain \bAI\b (the Y before AI blocks the boundary), so naive @AI greps cleanly distinguish open from closed markers.@AI-reply: comment.@SEEN to the @AI line, and (b) inserting the new @AI-reply: comment.go run.@AI-reply, @AI-todo, etc. outside what's specified here).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 korayucar/ai_review --plugin codereview-skills