agentleFS
midFangmidFang/ai-agent-skills-workflow/feature-worktree/SKILL.md

feature-worktree

Skill2 starsChanged 5 months agoMITView on GitHub

从业务项目 features/<版本>/feature_list.json 领取一个 FEAT-xxx,为该 feature 创建或恢复独立 git worktree 和分支,按 spec.md 开发;完成后必须做 AI 自证验证,构建待验证 APK 到 features/<版本>/apks/<feature_id>.apk,等待用户人工验证。适用于用户说要开始开发某个 feature、开 feature worktree、按 spec 实现功能。

The file

Files
SKILL.md

Feature Worktree

目的

一个 feature 对应一个分支、一个 worktree、一个 TASK 执行日志。

本 skill 负责:

领取 feature
-> 创建 worktree
-> 按 spec 开发
-> AI 自证验证
-> 构建待验证 APK
-> 等用户人工验证

合并和清理由 $feature-done 处理。

执行前检查

  1. 定位 features/<版本>/feature_list.json。
  2. 找到指定 feature_id。
  3. 读取 spec_file 和 task_file。
  4. base repo 的业务代码必须是干净 git 状态:
    • 读取 git status --porcelain。
    • issues/**/*.md、issues/**/*.csv、features/**/*.md、features/**/*.csv、features/**/*.json 这类流程文件可以忽略。
    • 除上述流程文件外,只要存在未提交、未暂存或未跟踪文件,就停止,提醒用户先 commit、stash 或清理这些业务代码/配置改动。
    • 如果只存在可忽略流程文件,可以继续;在 TASK 或回复里说明本次忽略了哪些流程文件。
  5. worktree 文件夹名使用 feature_id,例如 /path/to/worktrees/FEAT-001。

开发规则

  • 只做当前 feature。
  • 以 spec.md 的目标、主要行为、验收标准为准。
  • 如果 spec 明显缺关键事实,先标记 blocked 或 needs_info,不要脑补大方向。
  • 每次重要修改、方案选择、阻塞和验证结果都写入 TASK。
  • 本地提交 feature 时,commit message 使用中文需求描述:
    • 格式:<feature_id> feat: <中文需求描述或实现内容>
    • 中文描述优先取 spec 的“目标”,其次取 feature list 的 title / name / description。
    • 示例:FEAT-001 feat: 增加沉浸式写作模式

AI 自证验证

AI 不能只说完成,必须自己验证并留下证据。

优先验证方式:

  • 单元测试
  • UI 测试
  • 构建 APK
  • 截图验证
  • 简单 adb 操作
  • 日志检查

TASK 必须记录:

验证计划
执行命令
结果
证据
不能验证的部分

如果验证失败,设置:

status=blocked
block_reason=<原因>

构建待验证 APK

AI 自证验证通过后:

  1. 构建 debug 或用户指定 APK。
  2. 复制到:
    • features/<版本>/apks/<feature_id>.apk
  3. 更新 feature_list.json:
    • status=apk_built
    • commit
    • ai_verify_result=pass
  4. TASK 记录 APK 路径和验证摘要。

默认不安装 APK。用户需要人工验证时再决定安装方式。

收尾检查

每次结束前确认:

  • feature_list.json 状态已更新。
  • TASK 已记录本轮修改、验证、阻塞和下一步。
  • 已提交代码时记录 commit。
  • 有未提交改动时明确说明,不能静默留下半成品。

完成回复

报告:

  • feature_id
  • 状态
  • worktree
  • branch
  • commit
  • AI 验证结果
  • APK 路径
  • 需要用户验证什么

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.