plugins/tools/task/skills/align/SKILL.md
任务范围对齐。当用户需要明确任务目标、定义验收标准或确认实施边界时触发,自动生成 SMART-V 标准,通过交互确认后写入 align.json
npx skillsauth add lazygophers/ccplugin plugins/tools/task/skills/alignInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
核心规则:
当用户直接调用 /task:align 时(无 flow 上下文):
task update {task_id} --status=align 创建任务当由 flow 调用时:直接使用传入的 task_id 和 environment 参数。
align 分为两个阶段:生成和确认。生成阶段准备对齐内容,确认阶段获得用户批准。两个阶段缺一不可。
读取 .lazygophers/tasks/{task_id}/context.json。
task_related 和 code_style → 继续need_explore: true从 context.json 的 code_style 获取项目风格,作为后续所有阶段的锁定风格。
根据 prompt 关键词判断任务类型:
| 关键词 | 类型 | |--------|------| | 修复/fix/bug/报错/失败 | bug-fix | | 添加/新增/实现/开发/功能 | new-feature | | 重构/优化/整理/简化 | refactor | | 测试/test/覆盖 | add-tests | | 安全/漏洞/CVE/注入 | security-fix |
匹配到模板时以模板为基础细化,无模板则从 prompt 直接生成。
任务目标:一句话描述要达成的结果。
验收标准:3-5 条,每条满足 SMART-V(Specific/Measurable/Achievable/Relevant/Time-bound/Verifiable),结构为 name + description。
边界:in_scope(要做的事)+ out_of_scope(不做的事)。
如果是从 adjust 返回的重新对齐,参考失败原因调整。调整后必须重新走阶段二确认,不能复用之前的确认。
⚠ 以下步骤是硬性门控。不执行此步骤 = align 未完成。禁止跳过。
必须调用 AskUserQuestion,向用户展示以下全部内容:
提供两个选项:
如果用户选择"需要调整":追问具体方向(目标不准确 / 标准不合理 / 边界不清晰 / 风格检测错误),然后返回 need_explore: true 携带反馈。
如果用户选择"确认继续":进入步骤 7。
仅在用户确认后执行此步骤。
写入 .lazygophers/tasks/{task_id}/align.json:
{
"task_id": "任务ID",
"task_goal": "任务目标",
"acceptance_criteria": [...],
"boundary": {"in_scope": [...], "out_of_scope": [...]},
"behavior_spec": {"always_do": [...], "ask_first": [...], "never_do": [...]},
"code_style_follow": {...},
"user_confirmed": true
}
user_confirmed: true 是 flow 进入 plan 的前置条件。
常见语义化名称:functionality, correctness, bug_resolved, style_compliant, no_regression, no_new_risk, performance_improved
user_confirmed: truedevelopment
Go 数据库规范——GORM Model 命名 ModelXxx、表名单数、枚举 uint8 + 常量、索引 idx_ 前缀 + deleted_at leading column、禁 time.Time 统一 int64 unix、禁指针/nullable 字段、TEXT/BLOB/JSON 禁 default、AutoMigrate 禁改主键。设计 DB model、写 GORM tag、建索引、做 migration 审查时触发。
development
Go HTTP API 规范——响应始终 200 + body code 字段、路由 /api/* 全 POST 单段 <Action><Model>、中间件逐路由注册禁 Group(prefix,mw...)、handler 仅返回 (rsp,error)、认证走 header。设计 HTTP API、写路由/handler/中间件时触发。
development
Go 项目结构规范——三层架构(API → Impl → State)、全局状态模式、internal/ 私有包、cmd/ 仅 main.go、go.work 多模块、禁止 Repository 接口和 DI 容器、struct 公共字段开头全 omitempty、handler var rsp 顶声明、禁 legacy migration。设计项目骨架、新建目录、组织包、做架构评审时触发。
development
Go 命名规范——Id/Uid 字段(非 ID)、IsActive/HasMFA 布尔前缀、CreatedAt 时间字段、接收者统一用 p、包名全小写无下划线、泛型类型参数描述性命名、集合字段 xxx_list 禁 xxxs 复数、Enum 0 值 XxxNil 禁 Unknown、禁 Status 统一 State、Set/Update 语义区分。定义结构体字段、函数、变量、包、接收者名、泛型、枚举时触发。