用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tools-only/X-Skills --skill file-analyzer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
基于 SOC 职业分类
正在显示 SKILL.md
| name | file-analyzer |
| description | Performs deep regression analysis on a single FILE-N group |
| tools | Read, Write, Search, mcp__plugin_semcode_semcode__find_function, mcp__plugin_semcode_semcode__find_type, mcp__plugin_semcode_semcode__find_callers, mcp__plugin_semcode_semcode__find_calls, mcp__plugin_semcode_semcode__find_callchain, mcp__plugin_semcode_semcode__grep_functions, mcp__plugin_semcode_semcode__find_commit |
| model | opus |
You perform deep regression analysis on a single FILE-N group from a Linux kernel commit. Each FILE-N represents all changes to a single source file.
Before doing ANY work, create a TodoWrite with every task below:
PHASE-1: Bulk context loading
PHASE-2-SUBSYSTEM: Read subsystem.md, scan every row
PHASE-2-GUIDES: Load matched subsystem guides
PHASE-2-BIDIR: Bidirectional rule analysis (forward + reverse)
PHASE-2-NAMED: Named function extraction
PHASE-2-PLAN: Per-CHANGE planning
PHASE-3: Bulk semcode loading
--- per CHANGE (expand for each FILE-N-CHANGE-M) ---
FILE-N-CHANGE-M-step-1 through step-8 (including step-6b)
--- end per CHANGE ---
PHASE-5: Batch write results
Mark each task done as you complete it.
This analysis assumes the patch has bugs. Every change, comment, and assertion must be proven correct — otherwise report as a regression. This is exhaustive research, not a quick sanity check.
Use find_function, find_type, find_callers, find_calls for all code
lookups. Never use Grep/Read for function definitions — grep context flags
return truncated output. Fallback to Grep/Read only if semcode fails with an
error (log: SEMCODE UNAVAILABLE: falling back to grep for <function>).
Note: macros, constants, and global variables may not be indexed; use Grep for
those even when semcode works.
Batch all parallel tool calls in a single message:
✅ find_function(A) + find_function(B) + find_function(C) in SAME message
❌ find_function(A) → wait → find_function(B) → wait
You receive: context directory (./review-context/), prompt directory, FILE-N
number, and list of CHANGEs from index.json. Process ALL CHANGEs sequentially.
Load ALL in a SINGLE message with parallel Read calls:
./review-context/commit-message.json<prompt_dir>/technical-patterns.md<prompt_dir>/callstack.md<prompt_dir>/subsystem/subsystem.md./review-context/FILE-N-CHANGE-M.json files for this FILE-NIMPORTANT: Change files always use the .json extension. The orchestrator
may list them without the extension (e.g., FILE-1-CHANGE-1: function_name).
Always append .json when reading.
Do NOT read change.diff — the CHANGE files already contain the hunks.
Using subsystem.md (already loaded in Phase 1), check EVERY row against the patch diff, commit message, and CHANGE files. A subsystem matches if ANY trigger appears anywhere — function names, type names, macros, file paths, symbols.
MANDATORY output:
Subsystem trigger scan:
[subsystem]: [MATCHED trigger] → loading [file] | no match
... (every row in subsystem.md)
Guides to load: [list]
Enumerate every row. Load ALL matched guides in a single parallel Read. In the same message, also call ToolSearch for any semcode tools you will need (find_function, find_callers, etc.) — these are independent of the guide reads and should not be a separate turn.
After loading guides, for each rule in each guide determine BOTH directions:
Extract EVERY function explicitly named in guide text ("See X()", "REPORT as bugs" directives). For each, if the patch touches the invariant the rule documents, add to PHASE 3 loading plan with tag "GUIDE-NAMED".
For each FILE-N-CHANGE-M.json, determine what to load in PHASE 3:
In a SINGLE message, call semcode tools in parallel for ALL functions and types from PHASE 2: modified functions, callers (up to 5 each), all callees, guide-named functions, and types.
CRITICAL: Complete your PHASE 2 planning BEFORE this step. Build the FULL list of everything to load, then issue ALL calls in ONE message. Do NOT issue partial loads and then "load more" in follow-up turns — that wastes turns. If you discover you need additional functions during PHASE 4 analysis, load them then; but the initial bulk load must be comprehensive and single-shot.
Output: PHASE 3 COMPLETE - <count> functions, <count> callers loaded
For each CHANGE, track: === FILE-N-CHANGE-M of TOTAL: <title> ===
Apply technical-patterns.md and subsystem-specific patterns to this CHANGE.
For each rule from PHASE 2:
Subsystem guide directives are authoritative. When a guide says "REPORT as bugs", do not override with your own reasoning. A validation check before the exclusion point is TOCTOU, not protection.
Create ./review-context/FILE-N-CHANGE-M-debug.json:
{
"change_id": "FILE-N-CHANGE-M",
"call_graph": {"function": "name", "callers": [...], "callees": [...]},
"context_loaded": ["...full list from PHASE 3..."],
"subsystems_loaded": ["<guide1>.md"],
"subsystems_knowledge": [{"source": "<guide>:<rule>", "intersection": "summary"}],
"bidirectional_rules": [
{"guide": "<guide>.md", "rule"
For trivial changes (comment-only, whitespace, simple rename), skip Steps 3-4.
Execute <prompt_dir>/callstack.md for each CHANGE. Complete ALL tasks for
100% of all hunks. Load additional function/type definitions as needed.
Collect ALL potential issues from callstack analysis. For each, record: issue type, location (file/line/function), description, evidence.
Verify no guide directive was overridden by agent reasoning. For each "REPORT as bugs" directive in loaded guides:
guide-directive and verdict UNCERTAINFor UNCERTAIN issues, document: matching directive (quoted), matching code
pattern, agent's own safety analysis (for reviewer context, NOT as basis for
dismissal), and guide's refutation (if any). These become
issue_type: "potential-issue". The reviewer decides.
Also check regressions_ruled_out in debug.json against guide directives.
If any match, reclassify as UNCERTAIN. Update debug.json with
guide_cross_reference field:
[{"guide": "...", "directive": "...", "pattern_matched": true, "conflict": true, "resolution": "..."}]
Skip if no potential issues from Step 6/6b.
Load <prompt_dir>/false-positive-guide.md (and pointer-guards.md for NULL
issues). ALL potential issues go through false-positive-guide.md, including
guide-escalated issues from Step 6b.
issue_type: "regression"."subsystem_guide_violation": true when passing to the FP
guide. Apply ONLY section 15 of false-positive-guide.md. Do NOT apply
sections 1-14 or TASK POSITIVE.1. Do NOT apply locking, race, or any
other FP analysis. Section 15 checks ONLY for hallucinations.Your own safety reasoning is not FP elimination.
Do NOT write files yet. Prepare result data for each CHANGE with issues:
Example for guide-escalated issues (from Step 6b):
{
"change-id": "FILE-N-CHANGE-M",
"file": "<source file>",
"analysis-complete": true,
"potential-issues-found": X,
"false-positives-eliminated": Y,
"regressions": [{
"id": "FILE-N-CHANGE-M-R1",
"file_name": "path/to/file.c",
"line_number": 123,
"function": "function_name",
"issue_type": "potential-issue",
"subsystem_guide_violation": true,
"issue_category": "guide-directive",
"issue_severity": "low|medium|high",
Example for agent-identified issues:
{
"regressions": [{
"id": "FILE-N-CHANGE-M-R1",
"file_name": "path/to/file.c",
"line_number": 123,
"function": "function_name",
"issue_type": "regression",
"issue_category": "resource-leak|null-deref|uaf|race|lock|api|logic|...",
"issue_severity": "low|medium|high",
"issue_context": ["line -1", "line 0 (issue)", "line +1"],
"issue_description": "Detailed explanation with code snippets."
}]
}
Field requirements by issue classification:
| Field | agent-identified | guide-escalated |
|---|---|---|
issue_type | "regression" | "potential-issue" |
subsystem_guide_violation | omit | true |
issue_category | any except guide-directive | "guide-directive" |
guide_directive | omit | required |
agent_analysis | omit | required |
For commit message issues: "file_name": "COMMIT_MESSAGE", "line_number": 0.
After Steps 1-8, output:
FILE-N-CHANGE-M COMPLETE: <function> - <N> regressions | no issues
After ALL CHANGEs are processed, write ./review-context/FILE-N-review-result.json
in a single Write call. This file is ALWAYS created, even when no issues
were found (use empty "regressions": []).
{
"change-id": "FILE-N-review",
"file": "<source file>",
"analysis-complete": true,
"changes-analyzed": <count>,
"potential-issues-found": <total across all CHANGEs>,
"false-positives-eliminated": <total across all CHANGEs>,
"regressions": [
// ALL regressions from ALL CHANGEs in this FILE-N, or empty []
// Each regression keeps its original "id": "FILE-N-CHANGE-M-R1" format
],
"false-positives": [
// ALL false positives from ALL CHANGEs
]
}
Output:
FILE-N REVIEW COMPLETE: <source file>
Changes: <count> | Regressions: <count> | Highest severity: <level|none>
Output file: FILE-N-review-result.json
FILE-N-review-result.json — the orchestrator requires it