Xpersona
代

代码重构

CLAWHUB · Unverified

Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior. Skill: 代码重构 Owner: sf0799 Summary: Improve code readability, structure, and maintainability by cleaning up duplication, simplifying flow, renaming, or reorganizing without changing behavior. Tags: latest:0.1.0 Version history: v0.1.0 | 2026-04-06T08:19:35.227Z | user initial release Archive index: Archive v0.1.0: 4 files, 2476 bytes Files: agents/openai.yaml (232b), skill-card.md (1668b), SKILL.md (1122b), _meta.json

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s175a2gydqwpmq0pqjcykvhnq584b17r:code-refactor
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-sf0799-code-refactor/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

3,150 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: code-refactor
description: Improve readability, structure, and maintainability of the current local codebase without changing behavior. Use when the user asks to clean up code, reduce duplication, simplify control flow, rename for clarity, or reorganize logic while preserving compatibility. Do not use for feature work disguised as refactoring. Chinese triggers: 重构、优化结构、清理代码、提取重复逻辑、提高可读性、保持行为不变.
---

# 代码重构

只整理结构,不改变原有行为。

## 工作流

1. 先确认当前行为,再保证重构后行为保持一致。
2. 先指出具体问题:重复代码、命名差、函数过长、条件分支纠缠、职责不清。
3. 除非用户明确允许,否则不要破坏公共接口和调用方预期。
4. 只有在能明显降低复杂度或重复时才抽取公共逻辑或重组模块。
5. 重构时不顺手加入新业务逻辑。
6. 保留原有注释风格,除非注释已经失真。
7. 重构后验证行为未变。

## 输出

- 重构前的问题
- 重构思路
- 如何保证行为不变
- 已做验证

_meta.json

{
  "ownerId": "kn7f0wf6cndbzd2czy2c3ftj8s82nhb6",
  "slug": "code-refactor",
  "version": "0.1.0",
  "publishedAt": 1775463575227
}

skill-card.md

## Description:

Improves readability, structure, and maintainability of a local codebase while preserving behavior.

This skill is ready for commercial/non-commercial use.

## Publisher:

[sf0799](https://clawhub.ai/user/sf0799)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill to clean up naming, reduce duplication, simplify control flow, and reorganize code without changing public behavior or compatibility.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Automated refactoring can unintentionally change behavior or compatibility.

Mitigation: Review diffs, preserve public interfaces unless explicitly allowed, and run the existing test or validation path after changes.

Risk: The skill can modify local code during refactoring.

Mitigation: Use it in a reviewable workspace and inspect proposed edits before accepting or shipping them.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/sf0799/skills/code-refactor)

## Skill Output:

**Output Type(s):** [Text, Markdown, Code, Shell commands, Guidance]

**Output Format:** [Markdown summaries with code changes or command snippets when needed]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Focuses on behavior-preserving refactoring, rationale, and validation notes.]

## Skill Version(s):

0.1.0 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

agents/openai.yaml

interface:
  display_name: "代码重构"
  short_description: "在不改变行为的前提下优化命名、结构与重复代码。"
  default_prompt: "使用 $code-refactor 在保持行为不变的前提下重构这段代码。"

Sponsored

Ads related to 代码重构 and adjacent AI workflows.