From ac3aca893fed718b85c6e162663d85aff2d297cd Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 16:39:42 +0800
Subject: [PATCH 01/14] init with draft plan
---
.tmp/discussion0303.md | 44 +++++++++++
.tmp/prd.md | 166 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 210 insertions(+)
create mode 100644 .tmp/discussion0303.md
create mode 100644 .tmp/prd.md
diff --git a/.tmp/discussion0303.md b/.tmp/discussion0303.md
new file mode 100644
index 0000000..cbad868
--- /dev/null
+++ b/.tmp/discussion0303.md
@@ -0,0 +1,44 @@
+0303 Summary
+
+-Schema Review
+
+1.super crew kanban的数据源位置:
+.supercrew/
+
+2. .supercrew/ 目录结构:
+.supercrew/
+ |-feature-name
+ |-meta.yaml
+ |-design.md
+ |-plan.md
+
+3.meta.yaml文件:
+id/featurename/description/status/priority/team/owner/target_release/tags/dev_branch
+
+4.design.md
+初步设计文档,在dev_branch持续更新,structured markdown,包括两个部分
+a)structured 部分, yml fields包括status/reviewer/approved_by(这个是for design review,是否需要enable这个审查看老板们想法,会加入这个流程是因为个人体验下来前期设计很重要,需要多费心设计,和ai来会讨论,会占据coding工作的30%左右,不建议无脑接受ai的plan)
+b)markdown部分,design文档
+
+5. plan.md
+structured markdown,task breakdown
+a)structured 部分,total tasks/complete tasks
+b)markdown部分,workitem breakdown,markdown格式,可以考虑类似societas的floating todo bar一样在看板上做visualize
+
+
+-Design Review
+1.kanban renderer,基于上述schema做renderer,demo version可见于user/steinsz/supercrew_schema,(需和真实github repo 做 integration test
+2.ai integration,创建一个plugin,用于对每个repo setup .supercrew目录结构和对应的文件管理。暂不考虑直接用superpowers,因为过于耦合,相对我们的需求太重。mvp之后会考虑将两者结合,实现过程会借鉴superpowsers。
+3.ai integration trigger。skill/hook/pre-commit等方式都会尝试,理想情况会做成全自动,slash command作为备选方案
+4.user flow: user clone his own repo -> install our plugin -> start coding (.supercrew folder will be created automatically) -> prd discussion and meta.yml be created by ai -> check in it to main/dev branch -> take the task and make plan, check-in plan to dev branch -> finish coding and check in code with final documents in docs/ folder
+5.user can use kanban with github oauth see the repo status (read only for now)
+
+-Open Discussion
+1.per user/per agent track, 暂时会放在p2,在schema设计过程中会保留可扩展性以便我们未来可以兼容这个需求,但是没有放在mvp阶段,为了控制复杂度
+2.ado v.s. .supercrew folder,暂时考虑用.supercrew下的文件来管理workitem,主要有两个考量:a)复杂度,在mvp阶段尽量简单。b)适用范围,目录结构更灵活不绑定ado
+3. .supercrew下的feature如何和branch link起来,a)优先考虑用worktree,b)次要考虑在meta.yml中配置一个branch来做关联
+
+-Next Step
+1.add market place with corresponding skills/subagents/plugings to create and maintain .supercrew folder
+2.support rendered with new schema
+3.integration test with claude code and real repo
diff --git a/.tmp/prd.md b/.tmp/prd.md
new file mode 100644
index 0000000..6b1c2fb
--- /dev/null
+++ b/.tmp/prd.md
@@ -0,0 +1,166 @@
+# SuperCrew MVP — `.supercrew/` Schema + Kanban + AI Plugin
+
+**TL;DR:** 基于 `user/steinsz/supercrew_schema` 分支的 demo 实现,将 kanban 从 `.team/` 资源导向 完全迁移到 `.supercrew/features/` feature 导向的数据模型。MVP 包含三大模块:(1) 后端 store + API 替换为 `.supercrew/` schema,(2) 前端看板重构为 feature-centric 视图,(3) AI 集成插件(skills + hooks + pre-commit)实现 `.supercrew/` 目录的自动化管理。参考 [superpowers](https://github.com/obra/superpowers) 的插件架构和 [vibe-kanban](https://github.com/BloopAI/vibe-kanban) 的 issue→workspace 模式。
+
+---
+
+## Phase 1: Schema 基础设施 — 后端迁移
+
+**目标:** 用 `.supercrew/features/` 替换 `.team/`,后端只认 `.supercrew/`。
+
+### 1.1 定义 TypeScript 类型与 Schema 校验
+- 基于 commit `62cd395f` 的 `SupercrewStatus`、`FeatureMeta` 类型,在 `kanban/backend/src/types/index.ts` 中替换现有 `Task`/`Sprint` 等类型
+- 新增类型:`FeatureMeta`(meta.yaml)、`DesignDoc`(design.md frontmatter + body)、`PlanDoc`(plan.md frontmatter + tasks breakdown)、`FeatureLog`(log.md)
+- 定义 `SupercrewStatus` 枚举:`planning → designing → ready → active → blocked → done`
+- 新增 `FeaturePriority`: `P0 | P1 | P2 | P3`
+- 使用 `zod` 做运行时校验(meta.yaml 必填字段:`id`, `title`, `status`, `owner`, `priority`)
+
+### 1.2 重写 Local Store
+- 将 `kanban/backend/src/store/index.ts` 改为读写 `.supercrew/features/` 目录
+- 每个子目录 = 一个 feature,读取 `meta.yaml`(用 `js-yaml`)、`design.md`(用 `gray-matter`)、`plan.md`(用 `gray-matter`)、`log.md`
+- CRUD:创建 feature = 创建子目录 + 4 个模板文件;更新 = 写入对应文件;删除 = 删除整个子目录
+- Status 流转逻辑放在 store 层(校验合法转换)
+
+### 1.3 重写 GitHub Store
+- 将 `kanban/backend/src/store/github-store.ts` 改为通过 GitHub Contents API 读写 `.supercrew/features/` 路径
+- 复用现有的 `ghGet`/`ghPut`/`ghDelete` pattern,路径从 `.team/tasks/` 改为 `.supercrew/features//`
+- Init 端点改为初始化 `.supercrew/features/` 目录(替代 `.team/`)
+
+### 1.4 重写 API Routes
+- 将 `kanban/backend/src/routes/` 下的 `tasks.ts`、`sprints.ts`、`people.ts`、`knowledge.ts`、`decisions.ts` 合并/替换为:
+ - `features.ts`:`GET/POST/PATCH/DELETE /api/features`,`PUT /api/features/:id/status`
+ - `GET /api/features/:id/design` — 获取 design.md
+ - `GET /api/features/:id/plan` — 获取 plan.md(含 progress)
+ - `GET /api/board` — 聚合 endpoint,将 features 按 status 映射到看板列
+- 保留 auth 路由(`auth.ts`)和 projects 路由不变
+- 移除 `SUPERCREW_DEMO` 环境变量守卫,`.supercrew/` 成为默认唯一模式
+- Init-status 改为检查 `.supercrew/features/` 是否存在
+
+### 1.5 删除遗留代码
+- 移除 `.team/` 相关的所有 store 逻辑、路由、类型
+- 移除 `Sprint`、`Person`、`KnowledgeEntry`、`Decision` 类型(MVP 阶段只聚焦 Feature)
+- 清理 `index.ts` 中的路由注册
+
+---
+
+## Phase 2: 前端看板重构
+
+**目标:** 用 feature-centric 视图替代现有 task-centric 看板。
+
+### 2.1 数据层重构
+- 更新 `kanban/frontend/packages/app-core/src/types.ts`:用 `Feature`(含 meta + design status + plan progress)替代 `Task`/`Sprint` 等
+- 更新 `kanban/frontend/packages/app-core/src/api.ts`:`fetchFeatures()`、`createFeature()`、`updateFeature()`、`updateFeatureStatus()`、`deleteFeature()`、`fetchFeatureDesign()`、`fetchFeaturePlan()`
+- 更新 `useBoard()` hook:返回 `{ features, featuresByStatus, isLoading, error }`
+- 更新 `useMutations()`:feature CRUD + status 更新 + optimistic updates
+
+### 2.2 看板主视图
+- 重构 `kanban/frontend/packages/ui/` 中的 `KanbanBoard` 组件
+- 6 列布局对应 status:`Planning | Designing | Ready | Active | Blocked | Done`
+- Feature 卡片显示:`title`、`priority` badge(P0 红/P1 橙/P2 蓝/P3 灰)、`owner`、`teams` tags、plan `progress` 进度条
+- 拖拽:保留 `@hello-pangea/dnd`,拖拽 = status 流转(需校验合法转换)
+- 参考 vibe-kanban 的卡片 UI 风格:简洁、信息密度高
+
+### 2.3 Feature 详情页
+- 新建 `/features/:id` 路由,替代原 `/tasks/:id`
+- 三 Tab 布局:**Overview**(meta.yaml 渲染:owner、priority、teams、target_release、tags、dates)、**Design**(design.md markdown 渲染 + status/reviewer 信息)、**Plan**(plan.md 渲染:进度条 + task checklist 可视化,类似 societas floating todo bar)
+- Design tab 显示 review status badge(draft/in-review/approved/rejected)
+- Plan tab 显示 `completed_tasks/total_tasks` 进度 + 每个 workitem 的完成状态
+
+### 2.4 FRE 与 Init 流程更新
+- 更新 Welcome wizard:Select Repo → Initialize `.supercrew/` directory(替代 `.team/`)
+- Init API 调用改为 `/api/projects/github/repos/:owner/:repo/init`,创建 `.supercrew/features/` 目录
+
+### 2.5 清理遗留页面
+- 移除 `/people`、`/knowledge`、`/decisions` 页面和底部导航对应入口
+- 底部导航简化为:**Board**(feature 看板)、**Features**(列表视图,可选)
+- 保留 dark/light theme 和 i18n
+
+---
+
+## Phase 3: AI 集成插件
+
+**目标:** 创建独立插件,在用户 repo 中自动管理 `.supercrew/` 目录。参考 superpowers 的 skills/hooks/commands 架构,但独立发布。
+
+### 3.1 插件目录结构
+```
+plugins/supercrew/
+├── .claude-plugin/marketplace.json # 发布到 Claude Code marketplace
+├── skills/
+│ ├── create-feature/SKILL.md # 创建 feature 目录 + 4 文件
+│ ├── update-status/SKILL.md # 状态流转
+│ ├── sync-plan/SKILL.md # 生成/更新 plan.md
+│ └── log-progress/SKILL.md # 追加 log.md
+├── commands/
+│ ├── new-feature.md # /new-feature slash command
+│ └── feature-status.md # /feature-status slash command
+├── hooks/
+│ ├── hooks.json # SessionStart hook
+│ └── session-start # 注入 .supercrew context
+├── agents/
+│ └── supercrew-manager.md # 综合管理 agent
+└── templates/
+ ├── meta.yaml.tmpl
+ ├── design.md.tmpl
+ ├── plan.md.tmpl
+ └── log.md.tmpl
+```
+
+### 3.2 Skills 实现
+
+- **`create-feature`**: 用户描述需求 → AI 通过 PRD 讨论提炼 → 生成 `meta.yaml`(自动填充 id、title、owner、priority、status=planning、dates)+ `design.md`(初始 draft 模板)+ `plan.md`(空结构)+ `log.md`(初始化记录)
+- **`update-status`**: 根据代码/commit 状态自动判断并更新 `meta.yaml` 中的 status 字段,遵循合法状态转换图
+- **`sync-plan`**: 在 design 完成后,基于 `design.md` 内容生成 `plan.md` 中的 task breakdown;coding 阶段持续更新 `completed_tasks`/`progress`
+- **`log-progress`**: 每次 session 结束时自动追加 `log.md`,记录本次工作内容、完成的 tasks、遇到的问题
+
+### 3.3 Hooks
+
+- **SessionStart**: 检测当前 repo 是否有 `.supercrew/features/` → 有则注入所有 feature 的 meta 信息到 context → 提示 AI 当前活跃 feature 和进度
+- **pre-commit hook**: 校验 `.supercrew/features/*/meta.yaml` 的 schema 合法性(必填字段、status 枚举值、priority 枚举值);校验 `plan.md` frontmatter 的 `total_tasks ≥ completed_tasks`
+
+### 3.4 Commands
+
+- **`/new-feature`**: 触发 `create-feature` skill,交互式创建新 feature
+- **`/feature-status`**: 显示所有 feature 的当前状态概览(表格形式:id | title | status | progress | owner)
+
+### 3.5 Agent
+
+- **`supercrew-manager`**: 综合 agent,可以执行所有 skills,负责在适当时机自动调用 `update-status`、`sync-plan`、`log-progress`
+
+---
+
+## Phase 4: 集成与测试
+
+### 4.1 后端测试
+- 为 supercrew-store 写单元测试(vitest):CRUD、status 流转校验、schema 校验
+- 为 features API 写集成测试:HTTP 层面的 CRUD + auth
+
+### 4.2 前端测试
+- Feature card 组件测试
+- Board 视图 + 拖拽测试
+- Feature 详情页 Tab 切换测试
+
+### 4.3 端到端集成测试
+- 用真实 GitHub repo 测试完整 flow:OAuth → init `.supercrew/` → create feature → update status → view on board
+- 用 Claude Code 测试插件 flow:安装插件 → `/new-feature` → coding → plan 自动更新 → commit(pre-commit hook 校验)
+
+### 4.4 部署验证
+- Vercel 部署验证:确保 GitHub store 正确读写 `.supercrew/` 路径
+- 运行 `kanban/scripts/verify-before-deploy.sh`
+
+---
+
+## Verification
+- `cd kanban && bun test` — 后端单元测试
+- `cd kanban/frontend && pnpm test` — 前端测试
+- 手动测试:选择一个 test repo → 通过 kanban FRE 初始化 `.supercrew/` → 创建 feature → 在看板上拖拽 → 查看详情页
+- 插件测试:在 Claude Code 中加载插件 → 执行 `/new-feature` → 验证文件生成 → commit 触发 pre-commit hook
+
+---
+
+## Decisions
+- **`.team/` 完全弃用**:MVP 不做兼容,直接替换。简化实现复杂度。
+- **Feature-centric 而非 Task-centric**:看板的最小单位是 feature,不再是 task。Task 作为 plan.md 内的 checklist 存在。
+- **插件独立于 superpowers**:降低耦合,独立发布到 marketplace。Post-MVP 可以与 superpowers 融合。
+- **Sprint/People/Knowledge/Decisions 移除**:MVP 聚焦 feature lifecycle,这些概念不在 `.supercrew/` schema 中,不保留。
+- **log.md 保留**:虽然讨论文档未提及,但 demo 分支已实现,作为 AI context 很有价值,保留。
+- **Design review 纳入 MVP**:`design.md` 的 `status/reviewer/approved_by` 字段保留,在详情页展示。在 pre-commit hook 中不强制校验。
From 7a414eb8b9a2564e22f2d87172a31bcaa4fba7ea Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 17:00:18 +0800
Subject: [PATCH 02/14] update prd
---
.tmp/prd.md | 255 ++++++++++++++++++++++++++++++++--------------------
1 file changed, 158 insertions(+), 97 deletions(-)
diff --git a/.tmp/prd.md b/.tmp/prd.md
index 6b1c2fb..ed4d1a2 100644
--- a/.tmp/prd.md
+++ b/.tmp/prd.md
@@ -1,87 +1,38 @@
# SuperCrew MVP — `.supercrew/` Schema + Kanban + AI Plugin
-**TL;DR:** 基于 `user/steinsz/supercrew_schema` 分支的 demo 实现,将 kanban 从 `.team/` 资源导向 完全迁移到 `.supercrew/features/` feature 导向的数据模型。MVP 包含三大模块:(1) 后端 store + API 替换为 `.supercrew/` schema,(2) 前端看板重构为 feature-centric 视图,(3) AI 集成插件(skills + hooks + pre-commit)实现 `.supercrew/` 目录的自动化管理。参考 [superpowers](https://github.com/obra/superpowers) 的插件架构和 [vibe-kanban](https://github.com/BloopAI/vibe-kanban) 的 issue→workspace 模式。
+**TL;DR:** 基于 `user/steinsz/supercrew_schema` 分支的 demo 实现,将 kanban 从 `.team/` 资源导向 完全迁移到 `.supercrew/features/` feature 导向的数据模型。MVP 包含三大模块:(1) AI 集成插件(skills + hooks + pre-commit)在用户 repo 中创建和管理 `.supercrew/` 目录,(2) 后端通过 GitHub API(OAuth)只读访问用户 repo 中的 `.supercrew/` 数据,(3) 前端看板以只读方式渲染 feature-centric 视图。参考 [superpowers](https://github.com/obra/superpowers) 的插件架构和 [vibe-kanban](https://github.com/BloopAI/vibe-kanban) 的 issue→workspace 模式。
----
-
-## Phase 1: Schema 基础设施 — 后端迁移
-
-**目标:** 用 `.supercrew/features/` 替换 `.team/`,后端只认 `.supercrew/`。
+### 数据流架构
-### 1.1 定义 TypeScript 类型与 Schema 校验
-- 基于 commit `62cd395f` 的 `SupercrewStatus`、`FeatureMeta` 类型,在 `kanban/backend/src/types/index.ts` 中替换现有 `Task`/`Sprint` 等类型
-- 新增类型:`FeatureMeta`(meta.yaml)、`DesignDoc`(design.md frontmatter + body)、`PlanDoc`(plan.md frontmatter + tasks breakdown)、`FeatureLog`(log.md)
-- 定义 `SupercrewStatus` 枚举:`planning → designing → ready → active → blocked → done`
-- 新增 `FeaturePriority`: `P0 | P1 | P2 | P3`
-- 使用 `zod` 做运行时校验(meta.yaml 必填字段:`id`, `title`, `status`, `owner`, `priority`)
-
-### 1.2 重写 Local Store
-- 将 `kanban/backend/src/store/index.ts` 改为读写 `.supercrew/features/` 目录
-- 每个子目录 = 一个 feature,读取 `meta.yaml`(用 `js-yaml`)、`design.md`(用 `gray-matter`)、`plan.md`(用 `gray-matter`)、`log.md`
-- CRUD:创建 feature = 创建子目录 + 4 个模板文件;更新 = 写入对应文件;删除 = 删除整个子目录
-- Status 流转逻辑放在 store 层(校验合法转换)
-
-### 1.3 重写 GitHub Store
-- 将 `kanban/backend/src/store/github-store.ts` 改为通过 GitHub Contents API 读写 `.supercrew/features/` 路径
-- 复用现有的 `ghGet`/`ghPut`/`ghDelete` pattern,路径从 `.team/tasks/` 改为 `.supercrew/features//`
-- Init 端点改为初始化 `.supercrew/features/` 目录(替代 `.team/`)
-
-### 1.4 重写 API Routes
-- 将 `kanban/backend/src/routes/` 下的 `tasks.ts`、`sprints.ts`、`people.ts`、`knowledge.ts`、`decisions.ts` 合并/替换为:
- - `features.ts`:`GET/POST/PATCH/DELETE /api/features`,`PUT /api/features/:id/status`
- - `GET /api/features/:id/design` — 获取 design.md
- - `GET /api/features/:id/plan` — 获取 plan.md(含 progress)
- - `GET /api/board` — 聚合 endpoint,将 features 按 status 映射到看板列
-- 保留 auth 路由(`auth.ts`)和 projects 路由不变
-- 移除 `SUPERCREW_DEMO` 环境变量守卫,`.supercrew/` 成为默认唯一模式
-- Init-status 改为检查 `.supercrew/features/` 是否存在
-
-### 1.5 删除遗留代码
-- 移除 `.team/` 相关的所有 store 逻辑、路由、类型
-- 移除 `Sprint`、`Person`、`KnowledgeEntry`、`Decision` 类型(MVP 阶段只聚焦 Feature)
-- 清理 `index.ts` 中的路由注册
-
----
-
-## Phase 2: 前端看板重构
-
-**目标:** 用 feature-centric 视图替代现有 task-centric 看板。
-
-### 2.1 数据层重构
-- 更新 `kanban/frontend/packages/app-core/src/types.ts`:用 `Feature`(含 meta + design status + plan progress)替代 `Task`/`Sprint` 等
-- 更新 `kanban/frontend/packages/app-core/src/api.ts`:`fetchFeatures()`、`createFeature()`、`updateFeature()`、`updateFeatureStatus()`、`deleteFeature()`、`fetchFeatureDesign()`、`fetchFeaturePlan()`
-- 更新 `useBoard()` hook:返回 `{ features, featuresByStatus, isLoading, error }`
-- 更新 `useMutations()`:feature CRUD + status 更新 + optimistic updates
-
-### 2.2 看板主视图
-- 重构 `kanban/frontend/packages/ui/` 中的 `KanbanBoard` 组件
-- 6 列布局对应 status:`Planning | Designing | Ready | Active | Blocked | Done`
-- Feature 卡片显示:`title`、`priority` badge(P0 红/P1 橙/P2 蓝/P3 灰)、`owner`、`teams` tags、plan `progress` 进度条
-- 拖拽:保留 `@hello-pangea/dnd`,拖拽 = status 流转(需校验合法转换)
-- 参考 vibe-kanban 的卡片 UI 风格:简洁、信息密度高
-
-### 2.3 Feature 详情页
-- 新建 `/features/:id` 路由,替代原 `/tasks/:id`
-- 三 Tab 布局:**Overview**(meta.yaml 渲染:owner、priority、teams、target_release、tags、dates)、**Design**(design.md markdown 渲染 + status/reviewer 信息)、**Plan**(plan.md 渲染:进度条 + task checklist 可视化,类似 societas floating todo bar)
-- Design tab 显示 review status badge(draft/in-review/approved/rejected)
-- Plan tab 显示 `completed_tasks/total_tasks` 进度 + 每个 workitem 的完成状态
-
-### 2.4 FRE 与 Init 流程更新
-- 更新 Welcome wizard:Select Repo → Initialize `.supercrew/` directory(替代 `.team/`)
-- Init API 调用改为 `/api/projects/github/repos/:owner/:repo/init`,创建 `.supercrew/features/` 目录
+```
+用户 Repo(数据源) Kanban 服务(只读展示)
+┌─────────────────────┐ ┌──────────────────────┐
+│ .supercrew/ │ │ Vercel (后端) │
+│ features/ │ │ │
+│ feature-a/ │ │ GitHub API ──读取──►│
+│ meta.yaml │ │ (OAuth) │
+│ design.md │ │ │
+│ plan.md │ │ 前端(只读看板) │
+│ log.md │ │ │
+└─────────────────────┘ └──────────────────────┘
+ ▲ ▲
+ │ │
+ Claude Code 插件 用户浏览器
+ (本地写入 → git push) (OAuth 登录 → 查看看板)
+```
-### 2.5 清理遗留页面
-- 移除 `/people`、`/knowledge`、`/decisions` 页面和底部导航对应入口
-- 底部导航简化为:**Board**(feature 看板)、**Features**(列表视图,可选)
-- 保留 dark/light theme 和 i18n
+**关键原则:**
+- **写入方唯一:** Claude Code 插件在用户本地 repo 操作 `.supercrew/`,通过 git commit + push 同步
+- **读取方唯一:** Kanban 服务通过 OAuth 获取的 GitHub access_token 调用 GitHub Contents API 读取
+- **Kanban 完全只读:** 不提供任何写入 API,不修改用户 repo 中的数据
---
-## Phase 3: AI 集成插件
+## Phase 1: AI 集成插件(数据写入方)
-**目标:** 创建独立插件,在用户 repo 中自动管理 `.supercrew/` 目录。参考 superpowers 的 skills/hooks/commands 架构,但独立发布。
+**目标:** 创建独立插件,在用户 repo 中自动创建和管理 `.supercrew/` 目录。这是唯一的数据写入方。参考 superpowers 的 skills/hooks/commands 架构,独立发布到 marketplace。
-### 3.1 插件目录结构
+### 1.1 插件目录结构
```
plugins/supercrew/
├── .claude-plugin/marketplace.json # 发布到 Claude Code marketplace
@@ -105,46 +56,152 @@ plugins/supercrew/
└── log.md.tmpl
```
-### 3.2 Skills 实现
-
-- **`create-feature`**: 用户描述需求 → AI 通过 PRD 讨论提炼 → 生成 `meta.yaml`(自动填充 id、title、owner、priority、status=planning、dates)+ `design.md`(初始 draft 模板)+ `plan.md`(空结构)+ `log.md`(初始化记录)
+### 1.2 Schema 定义(插件内共享)
+- 定义 `SupercrewStatus` 枚举:`planning → designing → ready → active → blocked → done`
+- 定义 `FeaturePriority`: `P0 | P1 | P2 | P3`
+- `.supercrew/features//` 下 4 个文件:
+ - `meta.yaml`:必填字段 `id`, `title`, `status`, `owner`, `priority`;可选 `teams`, `target_release`, `created`, `updated`, `tags`, `blocked_by`
+ - `design.md`:YAML frontmatter(`status: draft|in-review|approved|rejected`, `reviewers`, `approved_by`)+ markdown body
+ - `plan.md`:YAML frontmatter(`total_tasks`, `completed_tasks`, `progress`)+ workitem breakdown markdown
+ - `log.md`:纯 markdown 追加日志
+
+### 1.3 Skills 实现
+- **`create-feature`**: 用户描述需求 → AI 通过 PRD 讨论提炼 → 在 `.supercrew/features//` 下生成 `meta.yaml`(自动填充 id、title、owner、priority、status=planning、dates)+ `design.md`(初始 draft 模板)+ `plan.md`(空结构)+ `log.md`(初始化记录)
- **`update-status`**: 根据代码/commit 状态自动判断并更新 `meta.yaml` 中的 status 字段,遵循合法状态转换图
- **`sync-plan`**: 在 design 完成后,基于 `design.md` 内容生成 `plan.md` 中的 task breakdown;coding 阶段持续更新 `completed_tasks`/`progress`
- **`log-progress`**: 每次 session 结束时自动追加 `log.md`,记录本次工作内容、完成的 tasks、遇到的问题
-### 3.3 Hooks
-
+### 1.4 Hooks
- **SessionStart**: 检测当前 repo 是否有 `.supercrew/features/` → 有则注入所有 feature 的 meta 信息到 context → 提示 AI 当前活跃 feature 和进度
- **pre-commit hook**: 校验 `.supercrew/features/*/meta.yaml` 的 schema 合法性(必填字段、status 枚举值、priority 枚举值);校验 `plan.md` frontmatter 的 `total_tasks ≥ completed_tasks`
-### 3.4 Commands
-
+### 1.5 Commands
- **`/new-feature`**: 触发 `create-feature` skill,交互式创建新 feature
- **`/feature-status`**: 显示所有 feature 的当前状态概览(表格形式:id | title | status | progress | owner)
-### 3.5 Agent
-
+### 1.6 Agent
- **`supercrew-manager`**: 综合 agent,可以执行所有 skills,负责在适当时机自动调用 `update-status`、`sync-plan`、`log-progress`
---
+## Phase 2: Schema 基础设施 — 后端(只读)
+
+**目标:** Kanban 后端通过 GitHub API(OAuth)只读访问用户 repo 中的 `.supercrew/features/` 数据。不提供任何写入 API。
+
+### 2.1 定义 TypeScript 类型
+- 基于 commit `62cd395f` 的 `SupercrewStatus`、`FeatureMeta` 类型,在 `kanban/backend/src/types/index.ts` 中替换现有 `Task`/`Sprint` 等类型
+- 新增类型:`FeatureMeta`(meta.yaml)、`DesignDoc`(design.md frontmatter + body)、`PlanDoc`(plan.md frontmatter + tasks breakdown)、`FeatureLog`(log.md)
+- 定义 `SupercrewStatus`、`FeaturePriority` 类型(与插件 schema 保持一致)
+- 使用 `zod` 做读取时的运行时校验(解析 meta.yaml 时验证字段合法性)
+
+### 2.2 重写 GitHub Store(只读)
+- 将 `kanban/backend/src/store/github-store.ts` 改为通过 GitHub Contents API **只读** 访问 `.supercrew/features/` 路径
+- 复用现有的 `ghGet` pattern,路径从 `.team/tasks/` 改为 `.supercrew/features//`
+- 实现:`listFeatures()`(列出所有 feature 目录)、`getFeatureMeta(id)`、`getFeatureDesign(id)`、`getFeaturePlan(id)`、`getFeatureLog(id)`
+- 移除所有 `ghPut`/`ghDelete` 调用 — Kanban 不写入用户 repo
+
+### 2.3 重写 Local Store(只读,仅开发调试用)
+- 将 `kanban/backend/src/store/index.ts` 改为只读访问本地 `.supercrew/features/` 目录
+- 用于本地开发时 mock 数据(读取本地 `.supercrew/features/` 目录中的文件)
+- 不包含任何写入逻辑
+
+### 2.4 重写 API Routes(只读)
+- 将 `kanban/backend/src/routes/` 下的 `tasks.ts`、`sprints.ts`、`people.ts`、`knowledge.ts`、`decisions.ts` 合并/替换为:
+ - `features.ts`:**仅 GET 端点**
+ - `GET /api/features` — 列出所有 features(meta 摘要)
+ - `GET /api/features/:id` — 获取单个 feature 完整信息
+ - `GET /api/features/:id/design` — 获取 design.md
+ - `GET /api/features/:id/plan` — 获取 plan.md(含 progress)
+ - `GET /api/board` — 聚合 endpoint,将 features 按 status 映射到看板列
+- 保留 auth 路由(`auth.ts`)和 projects 路由(`projects.ts`:OAuth 绑定 repo)不变
+- 移除 `SUPERCREW_DEMO` 环境变量守卫
+- `GET /api/projects/github/repos/:owner/:repo/init-status` 改为检查 `.supercrew/features/` 是否存在
+- 移除 `POST /api/projects/github/repos/:owner/:repo/init` — 不再由 Kanban 服务初始化
+
+### 2.5 删除遗留代码
+- 移除 `.team/` 相关的所有 store 逻辑、路由、类型
+- 移除 `Sprint`、`Person`、`KnowledgeEntry`、`Decision` 类型(MVP 阶段只聚焦 Feature)
+- 清理 `index.ts` 中的路由注册
+
+---
+
+## Phase 3: 前端看板重构(只读)
+
+**目标:** 用 feature-centric 只读视图替代现有 task-centric 看板。不提供任何数据修改操作。
+
+### 3.1 数据层重构
+- 更新 `kanban/frontend/packages/app-core/src/types.ts`:用 `Feature`(含 meta + design status + plan progress)替代 `Task`/`Sprint` 等
+- 更新 `kanban/frontend/packages/app-core/src/api.ts`:仅保留只读 API 调用
+ - `fetchFeatures()` — 获取所有 features 列表
+ - `fetchFeature(id)` — 获取单个 feature 详情
+ - `fetchFeatureDesign(id)` — 获取 design.md
+ - `fetchFeaturePlan(id)` — 获取 plan.md
+ - `fetchBoard()` — 获取看板聚合数据
+- 移除所有 `create`/`update`/`delete` 相关的 API 调用和 mutations
+- 更新 `useBoard()` hook:返回 `{ features, featuresByStatus, isLoading, error }`
+- 移除 `useMutations()` hook — 看板无写操作
+
+### 3.2 看板主视图
+- 重构 `kanban/frontend/packages/ui/` 中的 `KanbanBoard` 组件
+- 6 列布局对应 status:`Planning | Designing | Ready | Active | Blocked | Done`
+- Feature 卡片显示:`title`、`priority` badge(P0 红/P1 橙/P2 蓝/P3 灰)、`owner`、`teams` tags、plan `progress` 进度条
+- **无拖拽功能** — 看板只读,status 变更由 Claude Code 插件在用户 repo 中完成
+- 参考 vibe-kanban 的卡片 UI 风格:简洁、信息密度高
+- 点击卡片 → 跳转 Feature 详情页
+
+### 3.3 Feature 详情页
+- 新建 `/features/:id` 路由,替代原 `/tasks/:id`
+- 三 Tab 布局:**Overview**(meta.yaml 渲染:owner、priority、teams、target_release、tags、dates)、**Design**(design.md markdown 渲染 + status/reviewer 信息)、**Plan**(plan.md 渲染:进度条 + task checklist 可视化,类似 societas floating todo bar)
+- Design tab 显示 review status badge(draft/in-review/approved/rejected)
+- Plan tab 显示 `completed_tasks/total_tasks` 进度 + 每个 workitem 的完成状态
+- 所有内容只读展示,不提供编辑功能
+
+### 3.4 FRE 与空状态处理
+- 更新 Welcome wizard:OAuth 登录 → Select Repo(绑定已有 repo)
+- **不再提供 Init 功能** — `.supercrew/` 目录由 Claude Code 插件创建
+- 空状态处理:
+ - repo 中不存在 `.supercrew/features/` → 显示空看板 + 引导提示:"请在该 repo 中安装 SuperCrew 插件并使用 `/new-feature` 创建第一个 feature"
+ - repo 中存在 `.supercrew/features/` 但内容为空 → 类似引导
+
+### 3.5 清理遗留页面
+- 移除 `/people`、`/knowledge`、`/decisions` 页面和底部导航对应入口
+- 移除拖拽相关组件和依赖(`@hello-pangea/dnd` 可移除)
+- 底部导航简化为:**Board**(feature 看板)
+- 保留 dark/light theme 和 i18n
+
+---
+
## Phase 4: 集成与测试
-### 4.1 后端测试
-- 为 supercrew-store 写单元测试(vitest):CRUD、status 流转校验、schema 校验
-- 为 features API 写集成测试:HTTP 层面的 CRUD + auth
+### 4.1 插件测试
+- 在 Claude Code 中加载插件 → 执行 `/new-feature` → 验证 `.supercrew/features//` 下 4 个文件正确生成
+- 测试 `/feature-status` 输出
+- 测试 `update-status`、`sync-plan`、`log-progress` skills
+- 测试 pre-commit hook schema 校验(故意写错 meta.yaml → 应拦截 commit)
+- 测试 SessionStart hook 注入 context
+
+### 4.2 后端测试
+- 为 supercrew GitHub store 写单元测试(vitest):只读列出 features、解析 meta.yaml/design.md/plan.md
+- 为 features API 写集成测试:只读 GET 端点 + auth
+- 测试 `.supercrew/` 不存在时返回空数组
-### 4.2 前端测试
+### 4.3 前端测试
- Feature card 组件测试
-- Board 视图 + 拖拽测试
+- Board 视图测试(6 列布局、正确分组)
- Feature 详情页 Tab 切换测试
-
-### 4.3 端到端集成测试
-- 用真实 GitHub repo 测试完整 flow:OAuth → init `.supercrew/` → create feature → update status → view on board
-- 用 Claude Code 测试插件 flow:安装插件 → `/new-feature` → coding → plan 自动更新 → commit(pre-commit hook 校验)
-
-### 4.4 部署验证
-- Vercel 部署验证:确保 GitHub store 正确读写 `.supercrew/` 路径
+- 空状态 UI 测试(无 `.supercrew/` 时的引导状态)
+
+### 4.4 端到端集成测试
+- 完整 flow:
+ 1. 用户 repo A 安装 Claude Code 插件
+ 2. 在 repo A 中使用 `/new-feature` 创建 feature
+ 3. `git commit && git push` 到 main
+ 4. 在 Kanban 网页中 OAuth 绑定 repo A
+ 5. 看板正确显示 feature 数据
+ 6. 在 repo A 中用插件更新 status/plan → push → 看板数据刷新
+
+### 4.5 部署验证
+- Vercel 部署验证:确保 GitHub store 正确只读访问 `.supercrew/` 路径
- 运行 `kanban/scripts/verify-before-deploy.sh`
---
@@ -152,8 +209,8 @@ plugins/supercrew/
## Verification
- `cd kanban && bun test` — 后端单元测试
- `cd kanban/frontend && pnpm test` — 前端测试
-- 手动测试:选择一个 test repo → 通过 kanban FRE 初始化 `.supercrew/` → 创建 feature → 在看板上拖拽 → 查看详情页
-- 插件测试:在 Claude Code 中加载插件 → 执行 `/new-feature` → 验证文件生成 → commit 触发 pre-commit hook
+- 插件测试:在 Claude Code 中加载插件 → 执行 `/new-feature` → 验证文件生成 → commit 触发 pre-commit hook → push 到 main
+- 端到端测试:在 test repo 中用插件创建 feature + push → 在 Kanban 网页 OAuth 绑定该 repo → 看板正确展示 feature 数据 → 查看详情页
---
@@ -164,3 +221,7 @@ plugins/supercrew/
- **Sprint/People/Knowledge/Decisions 移除**:MVP 聚焦 feature lifecycle,这些概念不在 `.supercrew/` schema 中,不保留。
- **log.md 保留**:虽然讨论文档未提及,但 demo 分支已实现,作为 AI context 很有价值,保留。
- **Design review 纳入 MVP**:`design.md` 的 `status/reviewer/approved_by` 字段保留,在详情页展示。在 pre-commit hook 中不强制校验。
+- **Kanban 完全只读**:看板服务不写入用户 repo,所有数据变更由 Claude Code 插件在本地完成后 push。
+- **插件优先开发**:Phase 顺序调整为插件→后端→前端,因为没有插件就没有数据可读。
+- **无 Init API**:Kanban 不负责初始化 `.supercrew/` 目录,由插件负责。看板对未初始化的 repo 显示空状态 + 引导。
+- **无拖拽**:看板只读,不提供拖拽修改 status 的功能。
From fea32c91cf7a2bc82a0ad2956d3cff2334638e78 Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 18:32:39 +0800
Subject: [PATCH 03/14] update prd
---
.tmp/prd.md | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 123 insertions(+)
diff --git a/.tmp/prd.md b/.tmp/prd.md
index ed4d1a2..27c4971 100644
--- a/.tmp/prd.md
+++ b/.tmp/prd.md
@@ -225,3 +225,126 @@ plugins/supercrew/
- **插件优先开发**:Phase 顺序调整为插件→后端→前端,因为没有插件就没有数据可读。
- **无 Init API**:Kanban 不负责初始化 `.supercrew/` 目录,由插件负责。看板对未初始化的 repo 显示空状态 + 引导。
- **无拖拽**:看板只读,不提供拖拽修改 status 的功能。
+- **MVP 不含 Sprint**:30 人团队未来需要时间节奏,但 MVP 先聚焦 feature lifecycle。Sprint 机制在 Post-MVP 迭代中引入(见 Next Steps)。
+- **上线/Release 协调 Post-MVP**:MVP 不包含 release train 或 deployment 协调功能。Post-MVP 根据团队实际需求决定是否引入。
+
+---
+
+## Next Steps — Post-MVP 迭代规划
+
+MVP 解决了 Layer 2(团队协调层)中"项目管理可见性"和"设计/文档强制性"两大核心缺口。以下迭代聚焦补齐剩余 gap:**跨组协调**、**时间节奏(Sprint)**、**Agent 能力深化**、**上线协调**。
+
+### Iteration 1: supercrew-manager Agent 能力增强
+
+MVP 的 `supercrew-manager` agent 描述过于简略。参考 `ddd-tech-lead` agent 的设计深度,迭代 1 补充完整的 agent prompt 设计:
+
+#### 1.1 决策指引框架
+- **Feature 识别**:用户描述需求时,自动判断是新建 feature 还是归属已有 feature
+- **状态推断规则**:根据代码变更、commit 内容、test 结果自动推断 status 转换(例:design.md status 从 draft → approved 后,自动建议 feature status 从 designing → ready)
+- **优先级升降规则**:根据 `blocked_by` 依赖链和 deadline 接近程度,主动提醒优先级调整
+- **Context 注入策略**:SessionStart 时不只列出 feature 列表,而是智能摘要——突出 blocked features、临近 deadline 的 features、长期无更新的 features
+
+#### 1.2 自检清单(Self-Verification)
+Agent 在每次操作前/后执行自检:
+1. 目标 feature 文件夹是否存在?不存在是否应创建?
+2. `meta.yaml` 中所有必填字段是否完整?
+3. `plan.md` 的 `completed_tasks` 是否与实际 checklist 一致?
+4. `log.md` 是否已记录本次 session 的工作内容?
+5. 是否有 `blocked_by` 指向的 feature 已经完成但未更新?
+6. 是否有跨 feature 的架构影响需要在 `design.md` 中记录?
+
+#### 1.3 主动行为(Proactive Behaviors)
+- 检测到用户长时间在某 feature 上工作但未更新 `log.md` → 主动提醒记录
+- 检测到 `plan.md` 中 `completed_tasks` 落后于实际 commit → 主动建议同步
+- 检测到多个 features 的 `blocked_by` 形成环形依赖 → 告警
+- Session 结束前自动执行 `log-progress` skill
+- 检测到新 feature 的 `design.md` 仍为 draft 但 status 已到 active → 警告跳过设计审查
+
+#### 1.4 沟通风格
+- 状态更新简洁直接,用结构化格式(表格、列表)
+- 关键决策需提供上下文说明
+- 需求模糊时主动提出澄清问题
+- 区分 Critical/Important/Minor 事项
+
+### Iteration 2: Sprint 机制引入
+
+为 30 人团队引入时间节奏,在 feature 下嵌套 Sprint 结构:
+
+#### 2.1 Schema 扩展
+```
+.supercrew/
+ features/
+ feature-a/
+ meta.yaml
+ design.md
+ plan.md
+ log.md
+ sprints/ # 新增
+ sprint_260303/ # YYMMDD 格式
+ goals.md # Sprint 目标
+ tasks.md # 本 Sprint 的 task breakdown + 状态
+ retro.md # Sprint 回顾(可选)
+```
+
+- `meta.yaml` 新增可选字段:`current_sprint: sprint_260303`
+- `tasks.md` 结构:YAML frontmatter(`sprint_start`, `sprint_end`, `velocity_planned`, `velocity_actual`)+ task checklist(每项含 assignee、status、estimate)
+- `goals.md`:本 Sprint 在该 feature 上要达成的目标
+- `retro.md`:Sprint 结束时由 AI 自动生成回顾摘要
+
+#### 2.2 插件新增 Skills
+- **`create-sprint`**:在指定 feature 下创建 `sprints/sprint_YYMMDD/` 目录 + 初始文件
+- **`close-sprint`**:汇总完成情况,生成 `retro.md`,更新 `plan.md` progress
+- **`sprint-status`**:展示当前 Sprint 的 task 完成情况
+
+#### 2.3 看板前端扩展
+- Feature 详情页新增 **Sprint** Tab:展示当前 Sprint 的 task 列表、进度、燃尽图
+- 看板卡片可展示当前 Sprint 进度(可选 toggle)
+- Sprint 历史视图:查看历次 Sprint 的 velocity 趋势
+
+#### 2.4 Commands
+- **`/new-sprint`**:在当前 feature 下创建新 Sprint
+- **`/sprint-review`**:展示当前 Sprint 摘要 + 建议关闭
+
+### Iteration 3: 跨 Feature 协调与依赖可视化
+
+解决"小组之间不通气"的核心问题:
+
+#### 3.1 依赖图可视化
+- 前端新增 **Dependencies** 视图:基于所有 features 的 `blocked_by` 字段,渲染有向依赖图
+- 高亮环形依赖(红色标注)
+- 高亮关键路径(影响最多下游 feature 的上游)
+
+#### 3.2 `notes.md` 引入
+- 在 feature 文件中新增 `notes.md`:用于非结构化的研究笔记、讨论记录、补充上下文(参考 DDD 的 `notes.md`)
+- `log.md` 保持时间线追加语义,`notes.md` 用于随意记录
+
+#### 3.3 跨 Feature 变更通知
+- 看板前端新增简单的 **Activity Feed**:聚合所有 features 的最近变更(基于 git commit 时间戳 + log.md 最新条目)
+- 按团队(`teams` 字段)筛选 feed,实现"看到其他组在做什么"
+
+#### 3.4 架构治理
+- 新增 `.supercrew/architecture/` 目录(可选):存放全局 ADR(Architecture Decision Records)
+- Agent 在 `design.md` 涉及跨 feature 架构变更时,自动建议创建/更新 ADR
+
+### Iteration 4: Release 协调
+
+解决"上线难度高"的问题:
+
+#### 4.1 Release 概念引入
+- 新增 `.supercrew/releases/` 目录:每个 release 一个文件夹
+- `release.yaml`:`version`, `target_date`, `features[]`(包含的 feature id 列表), `status`(planning/staging/released)
+- 看板新增 **Release** 视图:按 release 分组展示 features 及其就绪状态
+
+#### 4.2 Release Readiness 检查
+- Agent 新增 **`release-check`** skill:扫描 release 中所有 features,检查是否全部 `status=done`、`design.md` approved、`plan.md` progress=100%
+- 前端展示 release readiness dashboard(红/黄/绿信号灯)
+
+### 迭代优先级与时间线
+
+| 迭代 | 聚焦 | 解决的 Layer 2 问题 | 建议时间 |
+|---|---|---|---|
+| **MVP** | Feature lifecycle + 只读看板 | 项目管理、设计/文档 | 当前 |
+| **Iter 1** | Agent 能力增强 | 提升自动化程度,减少人工维护负担 | MVP 后 1-2 周 |
+| **Iter 2** | Sprint 机制 | 时间节奏、任务粒度管理 | Iter 1 后 2-3 周 |
+| **Iter 3** | 跨 Feature 协调 | 小组不通气、架构治理 | Iter 2 后 2-3 周 |
+| **Iter 4** | Release 协调 | 上线难度高 | Iter 3 后 2-3 周 |
From 6e07b8fa4e71265cc900184998609b6297b0e982 Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 19:18:26 +0800
Subject: [PATCH 04/14] update prd
---
.tmp/prd.md | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/.tmp/prd.md b/.tmp/prd.md
index 27c4971..deaf665 100644
--- a/.tmp/prd.md
+++ b/.tmp/prd.md
@@ -1,6 +1,6 @@
# SuperCrew MVP — `.supercrew/` Schema + Kanban + AI Plugin
-**TL;DR:** 基于 `user/steinsz/supercrew_schema` 分支的 demo 实现,将 kanban 从 `.team/` 资源导向 完全迁移到 `.supercrew/features/` feature 导向的数据模型。MVP 包含三大模块:(1) AI 集成插件(skills + hooks + pre-commit)在用户 repo 中创建和管理 `.supercrew/` 目录,(2) 后端通过 GitHub API(OAuth)只读访问用户 repo 中的 `.supercrew/` 数据,(3) 前端看板以只读方式渲染 feature-centric 视图。参考 [superpowers](https://github.com/obra/superpowers) 的插件架构和 [vibe-kanban](https://github.com/BloopAI/vibe-kanban) 的 issue→workspace 模式。
+**TL;DR:** 基于 `user/steinsz/supercrew_schema` 分支的 demo 实现,将 kanban 从 `.team/` 资源导向 完全迁移到 `.supercrew/features/` feature 导向的数据模型。MVP 包含三大模块:(1) AI 集成插件(skills + hooks + pre-commit)在用户 repo 中创建和管理 `.supercrew/` 目录,(2) 后端通过 GitHub API(OAuth)只读访问用户 repo 中的 `.supercrew/` 数据,(3) 前端看板以只读方式渲染 feature-centric 视图。参考 [superpowers](https://github.com/obra/superpowers) 的插件架构和 [vibe-kanban](https://github.com/BloopAI/vibe-kanban) 的 issue→workspace 模式。插件在 monorepo 的 `plugins/supercrew/` 子目录开发,MVP 阶段通过绝对路径加载(`/plugin marketplace add /path/to/supercrew/plugins/supercrew`),Post-MVP 抽取为独立 repo 后发布到 marketplace。
### 数据流架构
@@ -30,7 +30,12 @@
## Phase 1: AI 集成插件(数据写入方)
-**目标:** 创建独立插件,在用户 repo 中自动创建和管理 `.supercrew/` 目录。这是唯一的数据写入方。参考 superpowers 的 skills/hooks/commands 架构,独立发布到 marketplace。
+**目标:** 在 monorepo 的 `plugins/supercrew/` 子目录下创建 Claude Code 插件,在用户 repo 中自动创建和管理 `.supercrew/` 目录。这是唯一的数据写入方。参考 superpowers 的 skills/hooks/commands 架构。
+
+**Monorepo 策略:** 插件代码保留在 `plugins/supercrew/`,与 `kanban/` 共存于同一 repo。Claude Code marketplace 要求 plugin 为独立 repo(整个 repo = plugin 根目录),因此:
+- **MVP 阶段**:通过绝对路径加载 — `/plugin marketplace add /path/to/supercrew/plugins/supercrew`(在任意 repo 中均可安装),`plugins/supercrew/` 内含 `.claude-plugin/marketplace.json`(`"source": "./"`),结构与独立 repo 一致
+- **Post-MVP**:将 `plugins/supercrew/` 抽取为独立 repo(如 `supercrew-plugin`),注册到 marketplace,用户可通过 `/plugin install supercrew@marketplace` 安装
+- **目录结构已按独立 repo 标准设计**,抽取时无需重构
### 1.1 插件目录结构
```
@@ -217,7 +222,7 @@ plugins/supercrew/
## Decisions
- **`.team/` 完全弃用**:MVP 不做兼容,直接替换。简化实现复杂度。
- **Feature-centric 而非 Task-centric**:看板的最小单位是 feature,不再是 task。Task 作为 plan.md 内的 checklist 存在。
-- **插件独立于 superpowers**:降低耦合,独立发布到 marketplace。Post-MVP 可以与 superpowers 融合。
+- **插件在 monorepo 子目录开发**:`plugins/supercrew/` 保留在 monorepo 中,MVP 通过绝对路径加载 `/plugin marketplace add /path/to/supercrew/plugins/supercrew`(在任意 repo 中均可安装)。目录结构按独立 repo 标准设计(`.claude-plugin/` 在 `plugins/supercrew/` 根),Post-MVP 抽取为独立 repo 后可直接发布到 marketplace,无需重构。
- **Sprint/People/Knowledge/Decisions 移除**:MVP 聚焦 feature lifecycle,这些概念不在 `.supercrew/` schema 中,不保留。
- **log.md 保留**:虽然讨论文档未提及,但 demo 分支已实现,作为 AI context 很有价值,保留。
- **Design review 纳入 MVP**:`design.md` 的 `status/reviewer/approved_by` 字段保留,在详情页展示。在 pre-commit hook 中不强制校验。
From e89048baee61575c23f93153da5d982d8b5d3790 Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 20:17:41 +0800
Subject: [PATCH 05/14] update prd
---
.tmp/prd.md | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/.tmp/prd.md b/.tmp/prd.md
index deaf665..0e867b1 100644
--- a/.tmp/prd.md
+++ b/.tmp/prd.md
@@ -77,12 +77,18 @@ plugins/supercrew/
- **`log-progress`**: 每次 session 结束时自动追加 `log.md`,记录本次工作内容、完成的 tasks、遇到的问题
### 1.4 Hooks
-- **SessionStart**: 检测当前 repo 是否有 `.supercrew/features/` → 有则注入所有 feature 的 meta 信息到 context → 提示 AI 当前活跃 feature 和进度
+- **SessionStart**: 检测当前 repo 是否有 `.supercrew/features/` → 有则执行 **Active Feature 匹配**,确定当前 session 聚焦的 feature:
+ 1. **Git branch 名匹配**(优先):当前分支名 `feature/` → 自动关联 `.supercrew/features//`,注入该 feature 的完整 context(meta + design + plan progress + 最近 log)。无论是普通 checkout 还是 git worktree 均适用(均通过 `git branch --show-current` 读取)
+ 2. **用户显式选择**:无匹配时,列出所有 `status != done` 的 features 摘要表(id | title | status | progress),请求用户确认:"当前 session 聚焦哪个 feature?"
+ 3. 确认后,后续 `update-status`、`sync-plan`、`log-progress` 等 skill 自动作用于该 feature
+ 4. 始终注入所有 feature 的简要列表到 context(确保 AI 知道全局状态),但仅对 active feature 注入详细信息
+ - **注**:MVP 不强制使用 git worktree,branch 匹配对 checkout 和 worktree 均兼容。Worktree 自动化生命周期管理在 Post-MVP 引入(见 Next Steps Iteration 1)
- **pre-commit hook**: 校验 `.supercrew/features/*/meta.yaml` 的 schema 合法性(必填字段、status 枚举值、priority 枚举值);校验 `plan.md` frontmatter 的 `total_tasks ≥ completed_tasks`
### 1.5 Commands
- **`/new-feature`**: 触发 `create-feature` skill,交互式创建新 feature
- **`/feature-status`**: 显示所有 feature 的当前状态概览(表格形式:id | title | status | progress | owner)
+- **`/work-on `**: 切换当前 session 聚焦的 feature(覆盖 SessionStart 的自动匹配结果),后续所有 skill 操作自动作用于该 feature
### 1.6 Agent
- **`supercrew-manager`**: 综合 agent,可以执行所有 skills,负责在适当时机自动调用 `update-status`、`sync-plan`、`log-progress`
@@ -239,9 +245,9 @@ plugins/supercrew/
MVP 解决了 Layer 2(团队协调层)中"项目管理可见性"和"设计/文档强制性"两大核心缺口。以下迭代聚焦补齐剩余 gap:**跨组协调**、**时间节奏(Sprint)**、**Agent 能力深化**、**上线协调**。
-### Iteration 1: supercrew-manager Agent 能力增强
+### Iteration 1: supercrew-manager Agent 能力增强 + Worktree 自动化
-MVP 的 `supercrew-manager` agent 描述过于简略。参考 `ddd-tech-lead` agent 的设计深度,迭代 1 补充完整的 agent prompt 设计:
+MVP 的 `supercrew-manager` agent 描述过于简略。参考 `ddd-tech-lead` agent 的设计深度,迭代 1 补充完整的 agent prompt 设计。同时引入 git worktree 自动化,消除 MVP 阶段手动管理分支的摩擦。
#### 1.1 决策指引框架
- **Feature 识别**:用户描述需求时,自动判断是新建 feature 还是归属已有 feature
@@ -271,6 +277,13 @@ Agent 在每次操作前/后执行自检:
- 需求模糊时主动提出澄清问题
- 区分 Critical/Important/Minor 事项
+#### 1.5 Git Worktree 自动化
+MVP 阶段用户手动管理分支,Iter 1 引入 worktree 自动化生命周期管理,消除手动操作摩擦:
+- **`/new-feature` 增强**:创建 feature 时自动执行 `git worktree add .worktrees/ feature/` + 安装依赖 + 提示用户在新窗口打开该目录
+- **`/close-feature `**(新增 command):merge/PR + `git worktree remove` + 清理分支,用户无需了解 worktree 命令
+- **SessionStart hook** 在 worktree 下天然准确匹配 active feature(每个 worktree 锁定一个 branch,不存在 session 中途切分支的问题)
+- 兼容 superpowers 的 `using-git-worktrees` skill
+
### Iteration 2: Sprint 机制引入
为 30 人团队引入时间节奏,在 feature 下嵌套 Sprint 结构:
@@ -349,7 +362,7 @@ Agent 在每次操作前/后执行自检:
| 迭代 | 聚焦 | 解决的 Layer 2 问题 | 建议时间 |
|---|---|---|---|
| **MVP** | Feature lifecycle + 只读看板 | 项目管理、设计/文档 | 当前 |
-| **Iter 1** | Agent 能力增强 | 提升自动化程度,减少人工维护负担 | MVP 后 1-2 周 |
+| **Iter 1** | Agent 能力增强 + Worktree 自动化 | 提升自动化程度,减少人工维护负担,消除分支管理摩擦 | MVP 后 1-2 周 |
| **Iter 2** | Sprint 机制 | 时间节奏、任务粒度管理 | Iter 1 后 2-3 周 |
| **Iter 3** | 跨 Feature 协调 | 小组不通气、架构治理 | Iter 2 后 2-3 周 |
| **Iter 4** | Release 协调 | 上线难度高 | Iter 3 后 2-3 周 |
From 9b25b1fe2e9492ecaf279ab4806d4db6cb4cee6b Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 20:29:01 +0800
Subject: [PATCH 06/14] update prd
---
.tmp/prd.md | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/.tmp/prd.md b/.tmp/prd.md
index 0e867b1..e016cc9 100644
--- a/.tmp/prd.md
+++ b/.tmp/prd.md
@@ -45,15 +45,14 @@ plugins/supercrew/
│ ├── create-feature/SKILL.md # 创建 feature 目录 + 4 文件
│ ├── update-status/SKILL.md # 状态流转
│ ├── sync-plan/SKILL.md # 生成/更新 plan.md
-│ └── log-progress/SKILL.md # 追加 log.md
+│ ├── log-progress/SKILL.md # 追加 log.md
+│ └── managing-features/SKILL.md # 综合管理 skill,自动协调上述 skills
├── commands/
│ ├── new-feature.md # /new-feature slash command
│ └── feature-status.md # /feature-status slash command
├── hooks/
│ ├── hooks.json # SessionStart hook
│ └── session-start # 注入 .supercrew context
-├── agents/
-│ └── supercrew-manager.md # 综合管理 agent
└── templates/
├── meta.yaml.tmpl
├── design.md.tmpl
@@ -90,8 +89,12 @@ plugins/supercrew/
- **`/feature-status`**: 显示所有 feature 的当前状态概览(表格形式:id | title | status | progress | owner)
- **`/work-on `**: 切换当前 session 聚焦的 feature(覆盖 SessionStart 的自动匹配结果),后续所有 skill 操作自动作用于该 feature
-### 1.6 Agent
-- **`supercrew-manager`**: 综合 agent,可以执行所有 skills,负责在适当时机自动调用 `update-status`、`sync-plan`、`log-progress`
+### 1.6 Managing-Features Skill(综合管理)
+- **`managing-features`**: 综合管理 skill,当 Claude 检测到用户在含 `.supercrew/features/` 的 repo 中工作时自动触发。负责在适当时机协调调用 `update-status`、`sync-plan`、`log-progress` 等子 skill,包括:
+ - 代码变更后自动建议更新 feature status
+ - design 完成后自动建议生成 plan
+ - session 结束前自动提醒记录 log
+ - 检测到状态不一致时主动提醒(如 `plan.md` progress 与实际 checklist 不符)
---
From c83101e875067757d09fc67c48f85d4963d717f4 Mon Sep 17 00:00:00 2001
From: He Zhang
Date: Tue, 3 Mar 2026 21:17:16 +0800
Subject: [PATCH 07/14] base implementation for supercrew skills and hooks
---
.gitignore | 1 +
.../supercrew/.claude-plugin/marketplace.json | 15 ++
plugins/supercrew/.claude-plugin/plugin.json | 12 ++
plugins/supercrew/README.md | 97 +++++++++++++
plugins/supercrew/commands/feature-status.md | 16 ++
plugins/supercrew/commands/new-feature.md | 6 +
plugins/supercrew/commands/work-on.md | 21 +++
plugins/supercrew/hooks/hooks.json | 16 ++
plugins/supercrew/hooks/session-start | 137 ++++++++++++++++++
.../supercrew/skills/create-feature/SKILL.md | 126 ++++++++++++++++
.../supercrew/skills/log-progress/SKILL.md | 58 ++++++++
.../skills/managing-features/SKILL.md | 56 +++++++
plugins/supercrew/skills/sync-plan/SKILL.md | 69 +++++++++
.../supercrew/skills/update-status/SKILL.md | 70 +++++++++
.../supercrew/skills/using-supercrew/SKILL.md | 67 +++++++++
plugins/supercrew/templates/design.md.tmpl | 23 +++
plugins/supercrew/templates/log.md.tmpl | 7 +
plugins/supercrew/templates/meta.yaml.tmpl | 11 ++
plugins/supercrew/templates/plan.md.tmpl | 14 ++
19 files changed, 822 insertions(+)
create mode 100644 plugins/supercrew/.claude-plugin/marketplace.json
create mode 100644 plugins/supercrew/.claude-plugin/plugin.json
create mode 100644 plugins/supercrew/README.md
create mode 100644 plugins/supercrew/commands/feature-status.md
create mode 100644 plugins/supercrew/commands/new-feature.md
create mode 100644 plugins/supercrew/commands/work-on.md
create mode 100644 plugins/supercrew/hooks/hooks.json
create mode 100755 plugins/supercrew/hooks/session-start
create mode 100644 plugins/supercrew/skills/create-feature/SKILL.md
create mode 100644 plugins/supercrew/skills/log-progress/SKILL.md
create mode 100644 plugins/supercrew/skills/managing-features/SKILL.md
create mode 100644 plugins/supercrew/skills/sync-plan/SKILL.md
create mode 100644 plugins/supercrew/skills/update-status/SKILL.md
create mode 100644 plugins/supercrew/skills/using-supercrew/SKILL.md
create mode 100644 plugins/supercrew/templates/design.md.tmpl
create mode 100644 plugins/supercrew/templates/log.md.tmpl
create mode 100644 plugins/supercrew/templates/meta.yaml.tmpl
create mode 100644 plugins/supercrew/templates/plan.md.tmpl
diff --git a/.gitignore b/.gitignore
index cc14105..3881436 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ dist/
.env
.env.local
*.local
+.ref
diff --git a/plugins/supercrew/.claude-plugin/marketplace.json b/plugins/supercrew/.claude-plugin/marketplace.json
new file mode 100644
index 0000000..397d2a4
--- /dev/null
+++ b/plugins/supercrew/.claude-plugin/marketplace.json
@@ -0,0 +1,15 @@
+{
+ "name": "supercrew-dev",
+ "description": "Development marketplace for SuperCrew plugin — AI-driven feature lifecycle management",
+ "owner": {
+ "name": "steinsz"
+ },
+ "plugins": [
+ {
+ "name": "supercrew",
+ "description": "AI-driven feature lifecycle management. Creates and manages .supercrew/features/ directories with meta.yaml, design.md, plan.md, and log.md for structured feature development.",
+ "version": "0.1.0",
+ "source": "./"
+ }
+ ]
+}
diff --git a/plugins/supercrew/.claude-plugin/plugin.json b/plugins/supercrew/.claude-plugin/plugin.json
new file mode 100644
index 0000000..5bd04b6
--- /dev/null
+++ b/plugins/supercrew/.claude-plugin/plugin.json
@@ -0,0 +1,12 @@
+{
+ "name": "supercrew",
+ "description": "AI-driven feature lifecycle management. Creates and manages .supercrew/features/ directories with meta.yaml, design.md, plan.md, and log.md for structured feature development.",
+ "version": "0.1.0",
+ "author": {
+ "name": "steinsz"
+ },
+ "homepage": "https://github.com/nicepkg/supercrew",
+ "repository": "https://github.com/nicepkg/supercrew",
+ "license": "MIT",
+ "keywords": ["feature-management", "kanban", "lifecycle", "planning", "tracking"]
+}
diff --git a/plugins/supercrew/README.md b/plugins/supercrew/README.md
new file mode 100644
index 0000000..b842b97
--- /dev/null
+++ b/plugins/supercrew/README.md
@@ -0,0 +1,97 @@
+# SuperCrew Plugin
+
+AI-driven feature lifecycle management for Claude Code. Track features from idea to done using structured `.supercrew/features/` directories.
+
+## Quick Start
+
+### 1. Install the plugin
+
+```bash
+# In Claude Code, run these 3 commands in order:
+
+# 1) Add the local marketplace (use absolute path to plugins/supercrew)
+/plugin marketplace add /path/to/supercrew/plugins/supercrew
+
+# 2) Install the plugin from the local marketplace
+/plugin install supercrew@supercrew-dev
+
+# 3) Verify installation — you should see supercrew listed
+/plugin list
+```
+
+> Replace `/path/to/supercrew` with the actual absolute path to your supercrew repo clone.
+
+**Reinstall / Update:**
+
+```bash
+/plugin uninstall supercrew@supercrew-dev
+/plugin marketplace remove supercrew-dev
+/plugin marketplace add /path/to/supercrew/plugins/supercrew
+/plugin install supercrew@supercrew-dev
+```
+
+### 2. Create your first feature
+
+```
+/supercrew:new-feature
+```
+
+This creates `.supercrew/features//` with four files:
+
+| File | Purpose |
+|---|---|
+| `meta.yaml` | ID, title, status, priority, owner, dates |
+| `design.md` | Requirements, architecture, constraints |
+| `plan.md` | Task breakdown with checklist & progress |
+| `log.md` | Chronological progress entries |
+
+### 3. Work on a feature
+
+```
+/supercrew:work-on
+```
+
+Or simply check out a matching branch — the SessionStart hook auto-detects `feature/` branches:
+
+```bash
+git checkout -b feature/my-feature
+```
+
+### 4. Check status
+
+```
+/supercrew:feature-status
+```
+
+Displays a table of all tracked features with status, priority, and progress.
+
+## Feature Lifecycle
+
+```
+planning → designing → ready → active → blocked → done
+ ↑ |
+ └─────────┘
+```
+
+## Skills
+
+| Skill | Triggers on |
+|---|---|
+| **using-supercrew** | Injected at session start — establishes behavior rules |
+| **create-feature** | Creating a new feature |
+| **update-status** | Status transitions (e.g. "mark as ready") |
+| **sync-plan** | Generating or updating task breakdowns |
+| **log-progress** | Recording what was done |
+| **managing-features** | Auto-orchestrates lifecycle when `.supercrew/features/` exists |
+
+## Commands
+
+| Command | Description |
+|---|---|
+| `/supercrew:new-feature` | Create a new feature |
+| `/supercrew:feature-status` | Show all features status |
+| `/supercrew:work-on` | Switch active feature for this session |
+
+## Hooks
+
+- **SessionStart** — Scans `.supercrew/features/`, shows summary table, auto-loads active feature context based on current git branch.
diff --git a/plugins/supercrew/commands/feature-status.md b/plugins/supercrew/commands/feature-status.md
new file mode 100644
index 0000000..b8b7993
--- /dev/null
+++ b/plugins/supercrew/commands/feature-status.md
@@ -0,0 +1,16 @@
+---
+description: "Show the current status of all features tracked in .supercrew/features/. Displays a summary table with id, title, status, progress, priority, and owner."
+disable-model-invocation: true
+---
+
+List all features in `.supercrew/features/` and display them in a table format:
+
+| ID | Title | Status | Priority | Progress | Owner |
+|---|---|---|---|---|---|
+
+For each feature directory in `.supercrew/features/`:
+1. Read `meta.yaml` for id, title, status, priority, owner
+2. Read `plan.md` frontmatter for progress (completed_tasks/total_tasks)
+3. Display the row
+
+If no `.supercrew/features/` directory exists, tell the user to create their first feature with `/supercrew:new-feature`.
diff --git a/plugins/supercrew/commands/new-feature.md b/plugins/supercrew/commands/new-feature.md
new file mode 100644
index 0000000..9ad63de
--- /dev/null
+++ b/plugins/supercrew/commands/new-feature.md
@@ -0,0 +1,6 @@
+---
+description: "Create a new feature for tracking in .supercrew/features/. Guides through defining title, priority, owner, and generates meta.yaml, design.md, plan.md, and log.md."
+disable-model-invocation: true
+---
+
+Invoke the supercrew:create-feature skill and follow it exactly as presented to you.
diff --git a/plugins/supercrew/commands/work-on.md b/plugins/supercrew/commands/work-on.md
new file mode 100644
index 0000000..4ee6453
--- /dev/null
+++ b/plugins/supercrew/commands/work-on.md
@@ -0,0 +1,21 @@
+---
+description: "Switch the active feature for this session. Usage: /work-on . All subsequent supercrew skill operations will target this feature."
+disable-model-invocation: true
+---
+
+The user wants to switch the active feature for this session.
+
+1. Check if the user provided a feature ID argument. If not, list available features from `.supercrew/features/` and ask them to choose.
+2. Verify the feature directory `.supercrew/features//` exists.
+3. Read the feature's `meta.yaml`, `plan.md` progress, and last `log.md` entry.
+4. Confirm to the user:
+
+```
+🔄 Switched active feature to:
+📋 Title:
+🏷️ Status: | Priority: | Progress:
- {/* Tags */}
- {task.tags.length > 0 && (
+ {/* Tags + Teams */}
+ {((feature.tags && feature.tags.length > 0) || (feature.teams && feature.teams.length > 0)) && (
- {task.tags.slice(0, 3).map(t => (
- {t}
+ {(feature.teams ?? []).slice(0, 2).map(team => (
+ {team}
+ ))}
+ {(feature.tags ?? []).slice(0, 2).map(tag => (
+ {tag}
))}
)}
- {/* Assignee */}
- {task.assignee && (
+ {/* Owner */}
+ {feature.owner && (
- {task.assignee.charAt(0).toUpperCase()}
+ {feature.owner.charAt(0).toUpperCase()}
- {task.assignee}
+ {feature.owner}
)}
diff --git a/kanban/frontend/packages/local-web/src/routes/knowledge.tsx b/kanban/frontend/packages/local-web/src/routes/knowledge.tsx
deleted file mode 100644
index accc891..0000000
--- a/kanban/frontend/packages/local-web/src/routes/knowledge.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-import { useQuery } from '@tanstack/react-query'
-import { useTranslation } from 'react-i18next'
-import { fetchKnowledge } from '@app/api'
-import type { KnowledgeEntry } from '@app/types'
-
-function KnowledgePage() {
- const { t } = useTranslation()
- const { data: entries = [], isLoading } = useQuery({
- queryKey: ['knowledge'],
- queryFn: fetchKnowledge,
- })
-
- if (isLoading) {
- return (
-
- {t('knowledge.loading')}
-
- )
- }
-
- return (
-
-
-
- {t('knowledge.title')}
-
-
-
- {entries.map(entry =>
)}
- {entries.length === 0 && (
-
- {t('knowledge.empty')}
-
- )}
-
-
-
- )
-}
-
-function KnowledgeCard({ entry }: { entry: KnowledgeEntry }) {
- return (
-
- {/* Header row */}
-
-
- {entry.title}
-
-
- {entry.date}
-
-
-
- {/* Tags */}
- {entry.tags.length > 0 && (
-
- {entry.tags.map(t => (
- {t}
- ))}
-
- )}
-
- {/* Body excerpt */}
-
- {entry.body.slice(0, 400)}{entry.body.length > 400 && '…'}
-
-
- )
-}
-
-export const Route = createFileRoute('/knowledge')({ component: KnowledgePage })
diff --git a/kanban/frontend/packages/local-web/src/routes/people.tsx b/kanban/frontend/packages/local-web/src/routes/people.tsx
deleted file mode 100644
index e278a8f..0000000
--- a/kanban/frontend/packages/local-web/src/routes/people.tsx
+++ /dev/null
@@ -1,157 +0,0 @@
-import { createFileRoute } from '@tanstack/react-router'
-import { useTranslation } from 'react-i18next'
-import { useBoard } from '@app/hooks/useBoard'
-import type { Person, Task } from '@app/types'
-
-function PeoplePage() {
- const { people, tasks } = useBoard()
- const { t } = useTranslation()
-
- return (
-
-
-
- {t('people.title')}
-
-
-
- {people.map(person => (
-
- ))}
- {people.length === 0 && (
-
- {t('people.empty')}
-
- )}
-
-
-
- )
-}
-
-function PersonCard({ person, tasks }: { person: Person; tasks: Task[] }) {
- const { t } = useTranslation()
- const currentTask = tasks.find(task => task.id === person.current_task)
- const initial = person.name.charAt(0).toUpperCase()
-
- return (
-
- {/* Avatar + name */}
-
-
- {initial}
-
-
-
- {person.name}
-
-
-
- @{person.username}
-
- {person.team && (
- <>
- ·
-
- {person.team}
-
- >
- )}
-
-
-
-
- {/* Blocked */}
- {person.blocked_by && (
-
- ⊘
-
- {person.blocked_by}
-
-
- )}
-
- {/* Current task */}
- {currentTask && (
-
-
{t('people.workingOn')}
-
-
- {currentTask.id}
-
-
- {currentTask.title}
-
-
-
- )}
-
- {/* Completed today */}
- {person.completed_today.length > 0 && (
-
-
{t('people.today')}
-
- {person.completed_today.map((item, i) => (
- -
-
- {item}
-
- ))}
-
-
- )}
-
- )
-}
-
-export const Route = createFileRoute('/people')({ component: PeoplePage })
diff --git a/kanban/frontend/packages/local-web/src/routes/tasks.$id.tsx b/kanban/frontend/packages/local-web/src/routes/tasks.$id.tsx
deleted file mode 100644
index 5047a93..0000000
--- a/kanban/frontend/packages/local-web/src/routes/tasks.$id.tsx
+++ /dev/null
@@ -1,325 +0,0 @@
-import { createFileRoute, useNavigate } from '@tanstack/react-router'
-import { useState } from 'react'
-import { useTranslation } from 'react-i18next'
-import { XIcon, PencilSimpleIcon, CheckIcon } from '@phosphor-icons/react'
-import { useBoard } from '@app/hooks/useBoard'
-import { useUpdateTask, useUpdateTaskStatus } from '@app/hooks/useMutations'
-import type { TaskStatus, TaskPriority } from '@app/types'
-
-const STATUS_OPTIONS: TaskStatus[] = ['backlog', 'todo', 'in-progress', 'in-review', 'done']
-const PRIORITY_OPTIONS: TaskPriority[] = ['P0', 'P1', 'P2', 'P3']
-
-function getStatusKey(status: TaskStatus): string {
- if (status === 'in-progress') return 'progress'
- if (status === 'in-review') return 'review'
- return status
-}
-
-const PRIORITY_CLASS: Record = {
- P0: 'rb-p0', P1: 'rb-p1', P2: 'rb-p2', P3: 'rb-p3',
-}
-
-function TaskDetailPage() {
- const { id } = Route.useParams()
- const navigate = useNavigate()
- const { t } = useTranslation()
- const { tasks } = useBoard()
- const updateTask = useUpdateTask()
- const updateStatus = useUpdateTaskStatus()
-
- const task = tasks.find(tk => tk.id === id)
- const [editingTitle, setEditingTitle] = useState(false)
- const [titleDraft, setTitleDraft] = useState('')
-
- if (!task) {
- return (
-
- {t('task.notFound', { id })}
-
- )
- }
-
- const sk = getStatusKey(task.status)
-
- return (
-
-
-
- {/* ── Header ── */}
-
-
-
- {task.id}
-
-
- {editingTitle ? (
-
- setTitleDraft(e.target.value)}
- onKeyDown={e => {
- if (e.key === 'Enter') {
- updateTask.mutate({ id: task.id, patch: { title: titleDraft } })
- setEditingTitle(false)
- }
- if (e.key === 'Escape') setEditingTitle(false)
- }}
- />
-
-
- ) : (
-
{ setTitleDraft(task.title); setEditingTitle(true) }}
- title={t('task.clickToEdit')}
- >
- {task.title}
-
- )}
-
-
-
-
-
- {/* ── Properties grid ── */}
-
- {/* Status */}
-
-
-
-
-
-
-
- {/* Priority */}
-
-
-
-
- {/* Assignee */}
-
-
- {task.assignee ?? '—'}
-
-
-
- {/* Sprint */}
-
-
- {task.sprint != null ? t('task.sprintLabel', { n: task.sprint }) : '—'}
-
-
-
- {/* Tags */}
- {task.tags.length > 0 && (
-
-
- {task.tags.map(t => (
- {t}
- ))}
-
-
- )}
-
- {/* PR */}
- {task.pr_url && (
-
-
- {task.pr_url}
-
-
- )}
-
- {/* Blocked by */}
- {task.blocked_by.length > 0 && (
-
-
- {task.blocked_by.join(', ')}
-
-
- )}
-
- {/* Blocks */}
- {task.blocks.length > 0 && (
-
-
- {task.blocks.join(', ')}
-
-
- )}
-
-
- {/* ── Description ── */}
-
-
-
- {t('task.description')}
-
-
-
-
updateTask.mutate({ id: task.id, patch: { body } })}
- />
-
-
-
-
- )
-}
-
-// ─── PropCell ────────────────────────────────────────────────────────────────
-
-function PropCell({
- label,
- children,
- full,
-}: {
- label: string
- children: React.ReactNode
- full?: boolean
-}) {
- return (
-
- )
-}
-
-// ─── BodyEditor ──────────────────────────────────────────────────────────────
-
-function BodyEditor({ body, onSave }: { body: string; onSave: (body: string) => void }) {
- const { t } = useTranslation()
- const [editing, setEditing] = useState(false)
- const [draft, setDraft] = useState(body)
-
- if (!editing) {
- return (
- { setDraft(body); setEditing(true) }}
- >
- {body || {t('task.addDescription')}}
-
- )
- }
-
- return (
-
- )
-}
-
-export const Route = createFileRoute('/tasks/$id')({ component: TaskDetailPage })
diff --git a/kanban/frontend/packages/local-web/src/routes/welcome.tsx b/kanban/frontend/packages/local-web/src/routes/welcome.tsx
index 2285ffe..30e0d58 100644
--- a/kanban/frontend/packages/local-web/src/routes/welcome.tsx
+++ b/kanban/frontend/packages/local-web/src/routes/welcome.tsx
@@ -236,11 +236,11 @@ function StepSelectRepo({
)
}
-// ─── Step 3: 初始化确认 ───────────────────────────────────────────────────────
+// ─── Step 3: Bind repo ─────────────────────────────────────────────────────
-type InitStatus = 'loading' | 'success' | 'error'
+type BindStatus = 'loading' | 'success' | 'error'
-function StepInit({
+function StepBind({
repo,
onSuccess,
}: {
@@ -249,32 +249,13 @@ function StepInit({
}) {
const { t } = useTranslation()
const queryClient = useQueryClient()
- const [status, setStatus] = useState('loading')
+ const [status, setStatus] = useState('loading')
const [errorMsg, setErrorMsg] = useState('')
- const runInit = async () => {
+ const runBind = async () => {
setStatus('loading')
setErrorMsg('')
try {
- const [owner, repoName] = repo.full_name.split('/')
-
- const statusRes = await fetch(
- `/api/projects/github/repos/${owner}/${repoName}/init-status`,
- { headers: authHeaders() }
- )
- const { initialized } = await statusRes.json()
-
- if (!initialized) {
- const initRes = await fetch(`/api/projects/github/repos/${owner}/${repoName}/init`, {
- method: 'POST',
- headers: authHeaders(),
- })
- if (!initRes.ok) {
- const err = await initRes.json()
- throw new Error(err.error ?? t('welcome.step3.initFailed'))
- }
- }
-
await fetch('/api/projects', {
method: 'POST',
headers: { ...authHeaders(), 'Content-Type': 'application/json' },
@@ -290,7 +271,7 @@ function StepInit({
}
}
- useEffect(() => { runInit() }, [])
+ useEffect(() => { runBind() }, [])
return (
- {t('welcome.step3.initializing')}
+ {t('welcome.step3.binding')}
)}
@@ -335,7 +316,7 @@ function StepInit({
{errorMsg}