AGENT SKILL

refactor

暂无简介

使用场景代码审查
License 许可
MIT
最近更新
2026-04-13
Stars
★ 0
Forks
0

01 前言 Front Matter

id
refactor
handler
.agents/refactor/handler.js
version
1.0.0
read_only
false
output_event
RefactoringProposed
output_schema
Patch[]
aggregate_root
Refactoring
bounded_context
Transformation
authorization_required_level
2

02 资源文件 1

03 SKILL.md 正文

SKILL: Refactor

Consumes Finding events where auto_fixable: true and produces safe, reviewable unified diff patches.

Patches MUST NOT be applied autonomously — all patches must be reviewed and approved before application.


Activation

agent:
  id: "refactor-agent-01"
  skill_set:
    - "refactor"
  authorization_level: 2
  read_only: false

Patch Generation Rules

Rule Description
Minimal Diff Smallest possible change that resolves the finding
No Behavior Change Semantically equivalent unless a security fix requires it (must be documented)
Test Preservation MUST NOT break existing tests; test changes must be in same diff
One Finding, One Patch Each patch addresses exactly one Finding.id

Output Contract

interface Patch {
  id: string;                    // uuid-v4
  finding_id: string;            // ID of the Finding being addressed
  skill: "refactor";
  status: "proposed" | "approved" | "rejected" | "applied";
  diff: string;                  // Unified diff format
  files_modified: string[];
  behavior_change: boolean;
  behavior_change_reason?: string;
  created_at: string;            // ISO-8601
  approved_by?: string;
}

Suppression

If a finding is suppressed via // agent-suppress, this skill MUST NOT generate a patch for it.


Schema version: 1.0.0 · Vendor-neutral

04 同仓库更多 Skills