一键导入
remy-patch
Apply code modifications under engineering constraints. Accepts plan packets from /remy-plan as argument, or use standalone with a modification request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Apply code modifications under engineering constraints. Accepts plan packets from /remy-plan as argument, or use standalone with a modification request.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Discover and run tests after code modification. Supports multi-angle defect prediction and coverage analysis. Recommended after large-scale edits or accumulated working tree changes.
Scan source files (Python, C/C++, TypeScript) and generate semantic logic index via LLM. Index is injected into CLAUDE.md and used by hooks/skills for dependency analysis. Run after repo init or major changes.
Deep repository analysis with multi-agent parallel perspectives. Requires /init + /remy-index as prerequisites. Produces structured research reports.
Diagnose bugs via hypothesis loop with circuit breaker. Diagnosis only — produces evidence packets for /remy-patch without modifying code.
Audit architecture for risks, side effects, and ambiguities before writing code. Produces evidence packets for /remy-patch. Recommended for large or complex tasks.
Verify code changes via Intent/Log/Code triangulation. Independent blind audit without prior session context. Paired with /remy-changelog: generate log, rewind context, then audit.
| name | remy-patch |
| description | Apply code modifications under engineering constraints. Accepts plan packets from /remy-plan as argument, or use standalone with a modification request. |
| allowed-tools | Read, Edit, Write, Grep, Glob, Bash, AskUserQuestion |
| argument-hint | [task_packet_file (optional)] |
| disable-model-invocation | true |
Although strict schema validation is disabled, you MUST internally structure your approach around these inputs:
context7 / documentation tools to verify signatures before writing code.Phase 0: Packet Loading (Conditional)
Execute only if a task_packet_file argument was provided.
If argument IS provided:
.claude/temp_task/{task_packet_file} using the Read tool.
evidence_packet.proposed_changes[] as the authoritative change scope.
evidence[] item with status: "suspected": re-read the referenced path and range and confirm before proceeding.If NO argument provided:
.claude/temp_task/.active_packet exists: run Bash("rm -f '.claude/temp_task/.active_packet'") to clear stale state.Phase 1: Discovery & Tracing (Mandatory)
Bash("test -f .claude/logic_index.db && echo EXISTS || echo MISSING").Bash("python \"~/.claude/skills/remy-index/impact.py\" <target_file_1> <target_file_2> ...") with the files targeted for modification. Use the output as the definitive dependency list. If exit code = 2 (no call graph data), fall through to the manual path below.remy-index MCP server is active, query_impact / query_callers tools provide equivalent data without subprocess overhead.grep or glob to locate all files that import or call the target_files.[L120-L155]) and the file exceeds PRECISION_READ_THRESHOLD lines (default: 500), use Read(file_path, offset=start_line, limit=end_line - start_line + 1) for each listed function. Group adjacent functions into a single Read when their ranges overlap or are within 10 lines.Read the entire file.Phase 2: Framework Compliance Check (Conditional)
Execute only if target files contain compiler decorators, metaprogramming patterns, or performance-critical annotations.
@jit, @compiled, @cached, framework-specific markers).Phase 3: Execution (Read-Plan-Edit)
For each file to be modified, execute the following sub-steps in order. Maintain a _rollback_cache (mapping file path → original content) for the duration of Phase 3.
_rollback_cache[file_path].Skip this sub-step entirely if no packet was loaded in Phase 0.
Before each Edit call, evaluate the following 3 conditions:
| # | Condition | Trigger |
|---|---|---|
| H1 | The file about to be edited is NOT listed in any proposed_changes[].description or referenced evidence[].path | Scope overflow |
| H2 | The target function's signature or structure has changed since the audit's evidence[].excerpt | Stale plan |
| H3 | The edit would violate a constraint stated in sender_payload.analysis | Constraint conflict |
If ANY condition is TRUE → Hard Interrupt:
AskUserQuestion with 3 options:
_rollback_cache, then print: "已回滚所有修改。请重新运行 /remy-plan 进行审计。"_rollback_cache, use Edit or Write to restore the original content. Then HALT Phase 3. Do NOT proceed to Phase 4.If ALL conditions are FALSE → Proceed to Edit.
Skip if no packet was loaded in Phase 0.
During editing, if you make a behavioral choice NOT explicitly covered by proposed_changes[] or sender_payload.analysis (e.g., choosing a specific error type, deciding on a default value, selecting between two valid patterns):
Record the decision in memory.
After ALL edits in Phase 3 are complete, if any decisions were recorded:
mkdir -p ".claude/temp_decisions".claude/temp_decisions/decisions_{PACKET_ID}.md:# Decisions Log — {PACKET_ID}
| 文件路径 | 决策描述 | 类别 |
| :--- | :--- | :--- |
| path/to/file | 选择抛出 ValueError 而非返回 None | Behavior |
Categories: Interface / Resource / Behavior / Ordering / Boundary.
If NO undocumented decisions were made, do NOT create the file.
Repeat sub-steps 3.1–3.4 for each file in the modification set.
Phase 4: Validation
Grep for test files that import or reference the modified symbols.If tests fail:
AskUserQuestion to present options:
Edit to restore original content).If no relevant tests exist:
/remy-inspect for test generation and coverage analysis."