# Pdlc Refactor

> 代码重构（保持外部行为不变，改善内部结构）

- **Type:** Skill
- **Install:** `agentstack add skill-kanfu-panda-pdlc-skills-pdlc-refactor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [kanfu-panda](https://agentstack.voostack.com/s/kanfu-panda)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [kanfu-panda](https://github.com/kanfu-panda)
- **Source:** https://github.com/kanfu-panda/pdlc-skills/tree/main/skills/pdlc-refactor
- **Website:** https://kanfu-panda.github.io/pdlc/

## Install

```sh
agentstack add skill-kanfu-panda-pdlc-skills-pdlc-refactor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 代码重构

对指定服务或模块进行安全重构，保证行为不变。

## 工作流程
1. **确认测试覆盖**: 先检查现有测试是否充分，不充分则先补测试
2. **阅读设计文档**: 阅读 `docs/02_design/` 对应子目录下的相关设计文档
3. **识别坏味道**: 分析代码中的坏味道（Code Smell）
4. **制定重构计划**: 列出重构项，按风险排序
5. **逐步重构**: 每次只做一个小的重构，确保测试通过
6. **运行完整测试**: 确认没有破坏现有功能

## 常见重构场景
- **提取方法/类**: 过长的方法、过大的类
- **消除重复**: DRY 原则，提取公共逻辑
- **简化条件**: 复杂的 if-else 链、嵌套条件
- **改善命名**: 不清晰的变量名、方法名
- **解耦依赖**: 降低模块间耦合度
- **统一风格**: 对齐项目编码规范

## 要求

- 重构提交信息格式: `refactor: `
- 严禁在重构中混入新功能
- 每个重构步骤都要保证测试通过
- 更新 CHANGELOG.md

重构目标: $ARGUMENTS

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [kanfu-panda](https://github.com/kanfu-panda)
- **Source:** [kanfu-panda/pdlc-skills](https://github.com/kanfu-panda/pdlc-skills)
- **License:** MIT
- **Homepage:** https://kanfu-panda.github.io/pdlc/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-kanfu-panda-pdlc-skills-pdlc-refactor
- Seller: https://agentstack.voostack.com/s/kanfu-panda
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
