代码与文档重构
awa-refactor
在保持行为、含义和可追溯性的前提下重构代码或文档。当被要求重构、重组结构或提升代码质量时使用。
- License 许可
- BSD-3-Clause
- 所属仓库
- ncoderz/awa
- 最近更新
- 2026-08-13
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- awa-refactor
- description
- Refactor code or docs while preserving behavior, meaning, and traceability. Use this when asked to refactor, restructure, or improve code quality.
03 SKILL.md 正文
Refactor Code
Bootstrap
<tool name="read_file"> <read path=".awa/.agent/awa.core.md" required="true" error="on not found" /> <read path=".awa/rules/*.md" required="true" /> <read path=".awa/specs/ARCHITECTURE.md" required="true" error="on not found" /> </tool>
User Input
${input}
You MUST consider the user input before proceeding (if not empty).
Inputs
<file type="architecture" path=".awa/specs/ARCHITECTURE.md" /> <file type="requirements" path=".awa/specs/REQ-{CODE}-{feature-name}.md" required="if relevant" /> <file type="design" path=".awa/specs/DESIGN-{CODE}-{feature-name}.md" required="if relevant" /> <file type="api" path=".awa/specs/API-{CODE}-{feature-name}.md" required="if relevant" /> <file type="tasks" path=".awa/tasks/TASK-{CODE}-{feature-name}-{nnn}.md" required="if relevant" /> <file type="code" required="if relevant" />
Action
Refactor the specified cod or docs as instructed, following awa conventions.
Outputs
- Refactored source code files with preserved markers
- Updated test files if structure changed
- Refactored documentation
Rules
You SHALL preserve existing behavior unless explicitly asked to change it.
You SHALL maintain all traceability markers (@awa-component, @awa-impl, @awa-test).
You SHALL run awa check after refactoring to verify all traceability markers are preserved and still resolve correctly.
You SHALL ensure tests pass before and after refactoring.
You SHALL make incremental changes, not wholesale rewrites.
You SHALL NOT change public interfaces without explicit approval.
You SHALL update user-facing documentation when implementation changes user-facing behavior, CLI, API, or configuration.
You SHALL clarify scope and risks with user before major refactors.
You MAY use todos and tools as needed.
04 同仓库更多 Skills
awa 全流程开发实现
awa-vibe
使用完整的 awa 工作流从头到尾实现一个想法。当被要求将一个想法走完完整开发周期时使用。
awa 工具使用与配置
awa-usage
了解 awa 本身、其命令行界面(CLI)及配置。当被问及 awa 本身、如何使用它或如何配置它时使用。
规格文档升级迁移
awa-upgrade
升级规格文档以匹配当前模式(schema)。当被要求升级、迁移或更新规格文档以符合模式变更时使用。
任务清单生成与分解
awa-tasks
创建或更新任务清单文档。当被要求创建任务、生成实施步骤,或将需求与设计分解为工作项时使用。
规格文档整理重组
awa-spec-tidy
按逻辑整理和重组规格文档。当被要求整理或重组规格文档时使用。
功能代码合并
awa-spec-merge
将两个功能代码合并为一个。当被要求组合、合并或整合功能代码时使用。