implement
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/implement - Implementation Agent
/implement - 实现Agent
Model: opus (complex coding requires advanced reasoning)
模型: opus(复杂编码需要高级推理能力)
Command Flags
命令参数
| Flag | Short | Description |
|---|---|---|
| | Show available commands and options |
| | Show workflow skills version |
| | Multi-task mode: spawn parallel agents |
| Enable auto-chain (test → document → ship) |
| Flag | Short | 说明 |
|---|---|---|
| | 显示可用命令和选项 |
| | 显示工作流技能版本 |
| | 多任务模式:生成并行Agent |
| 启用自动链路(测试→文档→发布) |
Flag Handling
参数处理
On or :
-h--help/implement - Implementation Agent
Usage:
/implement {ID} Implement a single task
/implement auto {ID} Implement with auto-chain enabled
/implement -m {ID1} {ID2} ... Implement multiple tasks in parallel
/implement auto -m {ID1} {ID2} Multi-task with auto-chain
/implement -h, --help Show this help message
/implement -v, --version Show version
Arguments:
{ID} Task ID (number) or task filename (e.g., 001-auth-jwt)
Options:
auto After implementation, automatically chain through:
test → document → ship
-m Spawn parallel agents for each task
Examples:
/implement 1 # Implement task #1
/implement 001-auth-jwt # Using task filename
/implement auto 1 # With auto-chain
/implement -m 1 2 3 # Three tasks in parallel
Next: /test {ID}On or :
Display:
-v--versionWorkflow Skills v1.4.1
https://github.com/eljun/claude-skills触发或时:
-h--help/implement - Implementation Agent
Usage:
/implement {ID} Implement a single task
/implement auto {ID} Implement with auto-chain enabled
/implement -m {ID1} {ID2} ... Implement multiple tasks in parallel
/implement auto -m {ID1} {ID2} Multi-task with auto-chain
/implement -h, --help Show this help message
/implement -v, --version Show version
Arguments:
{ID} Task ID (number) or task filename (e.g., 001-auth-jwt)
Options:
auto After implementation, automatically chain through:
test → document → ship
-m Spawn parallel agents for each task
Examples:
/implement 1 # Implement task #1
/implement 001-auth-jwt # Using task filename
/implement auto 1 # With auto-chain
/implement -m 1 2 3 # Three tasks in parallel
Next: /test {ID}触发或时:
显示:
-v--versionWorkflow Skills v1.4.1
https://github.com/eljun/claude-skillsWhen to Use
使用场景
Invoke when:
/implement {ID}- A task document exists in
docs/task/ - Task is in "Planned" status in TASKS.md
- Ready to start coding
Example: or
/implement 1/implement 001-dashboard-redesign满足以下条件时调用:
/implement {ID}- 目录下存在对应的任务文档
docs/task/ - 任务在TASKS.md中处于"Planned"状态
- 准备好开始编码
示例: 或
/implement 1/implement 001-dashboard-redesignInvocation Options
调用选项
| Command | Mode | Behavior |
|---|---|---|
| Manual | Implement single task, then notify user to run |
| Automated | Implement, then auto-chain through test → document → ship |
| Multi-task | Spawn parallel agents for each task |
| Multi-task | Same as |
| Multi + Auto | Parallel tasks with auto-chain |
| 命令 | 模式 | 行为 |
|---|---|---|
| 手动 | 实现单个任务,完成后通知用户运行 |
| 自动 | 实现完成后自动执行测试→文档→发布全链路 |
| 多任务 | 为每个任务生成并行Agent |
| 多任务 | 与 |
| 多任务+自动 | 并行任务同时启用自动链路 |
Task ID Resolution
任务ID解析规则
The can be:
{ID}- Numeric ID: ,
1,2→ Looks up in TASKS.md, finds matching task document3 - Padded ID: ,
001→ Same as numeric002 - Full filename: → Direct file reference
001-dashboard-redesign
Resolution process:
- If numeric → Read TASKS.md, find row with matching ID, get task doc path
- If filename → Look for directly
docs/task/{filename}.md
{ID}- 数字ID: 、
1、2→ 在TASKS.md中查找匹配ID的任务文档3 - 补零ID: 、
001→ 与数字ID规则相同002 - 完整文件名: → 直接引用对应文件
001-dashboard-redesign
解析流程:
- 如果是数字 → 读取TASKS.md,查找匹配ID的行,获取任务文档路径
- 如果是文件名 → 直接查找
docs/task/{filename}.md
Auto Mode
自动模式
When invoked with , the implement skill:
auto- Sets in the task document (overrides any existing value)
Automation: auto - Implements the task as normal
- After completion, automatically spawns (haiku)
/test {ID} - The pipeline continues: test → document → ship
This lets you skip and trigger the full pipeline from implement:
/task auto/implement auto {ID} → implement code
↓
/test (haiku)
│
PASS → /document → /ship → PR + notify
FAIL → /implement (with test report) → retry使用参数调用时,实现技能会:
auto- 在任务文档中设置(覆盖现有值)
Automation: auto - 正常执行任务实现
- 完成后自动生成任务(使用haiku模型)
/test {ID} - 流水线继续执行:测试→文档→发布
此功能让你可以跳过,直接从实现环节触发完整流水线:
/task auto/implement auto {ID} → implement code
↓
/test (haiku)
│
PASS → /document → /ship → PR + notify
FAIL → /implement (with test report) → retryMulti-Task Mode
多任务模式
When invoked with or , the implement skill spawns parallel agents:
-m--multi/implement -m 1 2 3
│
├── Validate all tasks exist in TASKS.md
├── Check for file overlap warnings
│
└── Spawn in parallel (using Task tool):
├── Agent-1: /implement 1
├── Agent-2: /implement 2
└── Agent-3: /implement 3
│
└── Wait for all agents to complete
└── Report combined statusMulti-task with auto mode:
/implement auto -m 1 2 3Each spawned agent runs with auto mode, chaining to test → document → ship.
使用或参数调用时,实现技能会生成并行Agent:
-m--multi/implement -m 1 2 3
│
├── 验证所有任务在TASKS.md中存在
├── 检查文件重叠警告
│
└── 并行生成任务(使用Task工具):
├── Agent-1: /implement 1
├── Agent-2: /implement 2
└── Agent-3: /implement 3
│
└── 等待所有Agent执行完成
└── 输出合并状态报告自动模式多任务:
/implement auto -m 1 2 3每个生成的Agent都会以自动模式运行,自动链接到测试→文档→发布流程。
Pre-Flight Checks for Multi-Task
多任务前置检查
CRITICAL: Background agents cannot prompt for permissions interactively. You MUST complete all checks and get user approval BEFORE spawning agents.
重要提示: 后台Agent无法交互式申请权限。生成Agent前必须完成所有检查并获得用户批准。
Step 1: Validate Tasks Exist
步骤1:验证任务存在
✓ Task 1: 001-auth-jwt.md (found)
✓ Task 2: 002-fix-portal.md (found)
✗ Task 3: Not found in TASKS.md → STOP if any missing✓ Task 1: 001-auth-jwt.md (found)
✓ Task 2: 002-fix-portal.md (found)
✗ Task 3: Not found in TASKS.md → STOP if any missingStep 2: Check for File Overlap
步骤2:检查文件重叠
Read each task's "File Changes" section:
⚠️ Warning: Tasks 1 and 2 both modify src/auth/middleware.ts
Options:
1. Continue anyway (may need manual conflict resolution)
2. Run sequentially instead
3. Cancel读取每个任务的"File Changes"部分:
⚠️ Warning: Tasks 1 and 2 both modify src/auth/middleware.ts
Options:
1. Continue anyway (may need manual conflict resolution)
2. Run sequentially instead
3. CancelStep 3: Check Dependencies
步骤3:检查依赖关系
⚠️ Task 2 is blocked by Task 1
Recommendation: Run sequentially or resolve dependency first⚠️ Task 2 is blocked by Task 1
Recommendation: Run sequentially or resolve dependency firstStep 4: Scan for Dangerous Operations
步骤4:扫描危险操作
Read each task document and scan for these keywords:
| Keywords Found | Risk Level | Action |
|---|---|---|
| ⚠️ Database | Require explicit approval |
| 🚫 Deletion | Block - user must do manually |
| 🚫 Data loss | Block - user must do manually |
| 🚫 Destructive | Block |
| ⚠️ Sensitive | Warn user |
| 🚫 System | Block |
读取每个任务文档,扫描以下关键词:
| 发现关键词 | 风险等级 | 操作 |
|---|---|---|
| ⚠️ 数据库 | 需要明确批准 |
| 🚫 删除操作 | 阻止 - 用户必须手动执行 |
| 🚫 数据丢失 | 阻止 - 用户必须手动执行 |
| 🚫 破坏性操作 | 阻止 |
| ⚠️ 敏感信息 | 警告用户 |
| 🚫 系统操作 | 阻止 |
Step 5: Permission Approval (REQUIRED)
步骤5:权限审批(必填)
Display this prompt and WAIT for user confirmation:
═══════════════════════════════════════════════════════════════
MULTI-TASK PERMISSION CHECK
═══════════════════════════════════════════════════════════════
Tasks to implement in parallel:
#1 {Task 1 name}
#2 {Task 2 name}
#3 {Task 3 name}
PERMISSIONS FOR BACKGROUND AGENTS
───────────────────────────────────────────────────────────────
✅ GRANTED (safe operations):
• Read, Edit, Write files
• Glob, Grep (search)
• Git: add, commit, status, diff, checkout -b, log
• npm/npx: install, run, build, test, lint
⚠️ REQUIRES APPROVAL (detected in tasks):
• {e.g., "Database migration in Task #2"}
• {e.g., "Schema changes in Task #1"}
• (None detected)
🚫 BLOCKED (agents will stop if needed):
• File deletion (rm, unlink, rimraf)
• Destructive git (push --force, reset --hard, clean -f)
• Database destruction (DROP, TRUNCATE)
• System commands (sudo, chmod)
───────────────────────────────────────────────────────────────
If agents encounter blocked operations, they will STOP and
report back. You can then perform those manually.
═══════════════════════════════════════════════════════════════
Approve and start parallel implementation? (yes/no)DO NOT spawn agents until user types "yes" or confirms.
显示以下提示并等待用户确认:
═══════════════════════════════════════════════════════════════
MULTI-TASK PERMISSION CHECK
═══════════════════════════════════════════════════════════════
Tasks to implement in parallel:
#1 {Task 1 name}
#2 {Task 2 name}
#3 {Task 3 name}
PERMISSIONS FOR BACKGROUND AGENTS
───────────────────────────────────────────────────────────────
✅ GRANTED (safe operations):
• Read, Edit, Write files
• Glob, Grep (search)
• Git: add, commit, status, diff, checkout -b, log
• npm/npx: install, run, build, test, lint
⚠️ REQUIRES APPROVAL (detected in tasks):
• {e.g., "Database migration in Task #2"}
• {e.g., "Schema changes in Task #1"}
• (None detected)
🚫 BLOCKED (agents will stop if needed):
• File deletion (rm, unlink, rimraf)
• Destructive git (push --force, reset --hard, clean -f)
• Database destruction (DROP, TRUNCATE)
• System commands (sudo, chmod)
───────────────────────────────────────────────────────────────
If agents encounter blocked operations, they will STOP and
report back. You can then perform those manually.
═══════════════════════════════════════════════════════════════
Approve and start parallel implementation? (yes/no)在用户输入"yes"或确认前,不得生成Agent。
Step 6: Spawn Agents with Pre-Authorized Tools
步骤6:生成预授权工具的Agent
Only after user approval, spawn agents with these allowed tools:
Task({
subagent_type: "general-purpose",
model: "opus",
prompt: "/implement {ID}",
run_in_background: true,
allowed_tools: [
"Read",
"Edit",
"Write",
"Glob",
"Grep",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git status)",
"Bash(git diff *)",
"Bash(git checkout -b *)",
"Bash(git log *)",
"Bash(npm install *)",
"Bash(npm run *)",
"Bash(npx *)"
]
})Note: Dangerous operations are NOT in allowed_tools, so agents physically cannot perform them.
仅在获得用户批准后,使用以下允许的工具生成Agent:
Task({
subagent_type: "general-purpose",
model: "opus",
prompt: "/implement {ID}",
run_in_background: true,
allowed_tools: [
"Read",
"Edit",
"Write",
"Glob",
"Grep",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git status)",
"Bash(git diff *)",
"Bash(git checkout -b *)",
"Bash(git log *)",
"Bash(npm install *)",
"Bash(npm run *)",
"Bash(npx *)"
]
})注意: 危险操作不在允许工具列表中,因此Agent无法执行此类操作。
Workflow
工作流程
/implement [auto] [-m] {ID} [{ID2} ...]
↓
1. Parse arguments: detect "auto" flag, "-m/--multi" flag, task ID(s)
2. If multi-task → Run pre-flight checks, spawn parallel agents, exit
3. Resolve task ID → find docs/task/{ID}-{name}.md
4. Read task document
5. If "auto" flag → set Automation: auto in task doc
6. Check Automation field (manual | auto)
7. Move task to "## In Progress" in TASKS.md
8. ⚠️ MANDATORY: Invoke specialized skills (see Step 2 below)
└── /vercel-react-best-practices (if installed + React code)
└── /supabase-postgres-best-practices (if installed + DB code)
9. Implement following task document steps
10. Commit with [task-{ID}] prefix for traceability
11. Update status to "TESTING" when complete
↓
┌─── Automation Mode? ───┐
│ │
▼ Manual ▼ Auto
Notify user Invoke /test {ID}
Ready for /test⚠️ GUARDRAIL: Step 8 is NOT optional. If specialized skills are installed and relevant to the task, they MUST be invoked BEFORE writing any code. See "Step 2: Invoke Specialized Skills" below for details.
/implement [auto] [-m] {ID} [{ID2} ...]
↓
1. 解析参数:检测"auto"参数、"-m/--multi"参数、任务ID
2. 如果是多任务 → 执行前置检查,生成并行Agent,退出
3. 解析任务ID → 查找docs/task/{ID}-{name}.md
4. 读取任务文档
5. 如果有"auto"参数 → 在任务文档中设置Automation: auto
6. 检查Automation字段(manual | auto)
7. 在TASKS.md中将任务移动到"## In Progress"部分
8. ⚠️ 强制要求:调用专业技能(见下文步骤2)
└── /vercel-react-best-practices(如果已安装且涉及React代码)
└── /supabase-postgres-best-practices(如果已安装且涉及数据库代码)
9. 按照任务文档步骤执行实现
10. 提交时使用[task-{ID}]前缀便于追溯
11. 完成后将状态更新为"TESTING"
↓
┌─── 自动化模式? ───┐
│ │
▼ 手动 ▼ 自动
通知用户 调用/test {ID}
准备执行/test⚠️ 防护规则: 步骤8不是可选步骤。如果专业技能已安装且与任务相关,必须在编写代码前调用。详情见下文"步骤2:调用专业技能"。
Auto Mode Behavior
自动模式行为
When invoked with OR task document has :
/implement auto {ID}Automation: auto- If invoked with argument, update the task document to set
autoAutomation: auto - After implementation completes, automatically invoke
/test {ID}
当使用调用,或任务文档包含时:
/implement auto {ID}Automation: auto- 如果通过参数调用,更新任务文档设置
autoAutomation: auto - 实现完成后,自动调用
/test {ID}
Pre-Implementation Checklist
实现前检查清单
Before writing ANY code:
编写任何代码前:
0. Parse Arguments
0. 解析参数
Check for flags and task ID(s):
- or
-m→ Multi-task mode (spawn parallel agents)--multi - → Set automation mode
auto - Remaining args → Task ID(s)
Examples:
- → Single task, manual mode
/implement 1 - → Single task, auto mode
/implement auto 1 - → Multi-task, manual mode
/implement -m 1 2 3 - → Multi-task, auto mode
/implement auto -m 1 2
If is detected, update the task document header:
automarkdown
> **Automation:** auto检查参数和任务ID:
- 或
-m→ 多任务模式(生成并行Agent)--multi - → 设置自动化模式
auto - 剩余参数 → 任务ID
示例:
- → 单任务,手动模式
/implement 1 - → 单任务,自动模式
/implement auto 1 - → 多任务,手动模式
/implement -m 1 2 3 - → 多任务,自动模式
/implement auto -m 1 2
如果检测到参数,更新任务文档头部:
automarkdown
> **Automation:** auto1. Resolve Task ID
1. 解析任务ID
Convert the task ID to the task document path:
- Read TASKS.md
- Find the row with matching ID in the first column
- Get the task doc path from that row
- Verify the file exists in
docs/task/
Example:
Input: /implement 1
TASKS.md row: | 1 | Dashboard Redesign | HIGH | [001-dashboard-redesign.md](...) |
Resolved: docs/task/001-dashboard-redesign.md将任务ID转换为任务文档路径:
- 读取TASKS.md
- 在第一列中查找匹配ID的行
- 从该行获取任务文档路径
- 验证目录下存在该文件
docs/task/
示例:
Input: /implement 1
TASKS.md row: | 1 | Dashboard Redesign | HIGH | [001-dashboard-redesign.md](...) |
Resolved: docs/task/001-dashboard-redesign.md2. Read the Task Document (Primary Context Source)
2. 读取任务文档(主要上下文来源)
docs/task/{ID}-{task-name}.mdIMPORTANT — Context Efficiency:
The task document was created by the agent, which already performed a thorough codebase analysis. The task document contains all the context you need: requirements, file paths, implementation steps, and architectural decisions.
/task- DO trust the task document as your primary source of truth
- DO read the specific files listed in the task document's "Files to Modify" or implementation steps
- DO NOT perform broad codebase exploration (scanning directories, reading unrelated files, trying to "understand the entire codebase")
- DO NOT re-analyze architecture that the plan agent already documented
If the task document references specific files, read only those files. This keeps your context window efficient and avoids redundant exploration.
Understand:
- Task ID (for commit messages)
- Requirements (must have vs nice to have)
- Proposed solution
- File changes needed
- Implementation steps
docs/task/{ID}-{task-name}.md重要提示 - 上下文效率:
任务文档由Agent创建,已经过全面的代码库分析。任务文档包含你需要的所有上下文:需求、文件路径、实现步骤和架构决策。
/task- 务必将任务文档作为主要事实来源
- 务必读取任务文档"Files to Modify"或实现步骤中列出的特定文件
- 不要进行广泛的代码库探索(扫描目录、读取无关文件、尝试"理解整个代码库")
- 不要重新分析规划Agent已经记录的架构
如果任务文档引用了特定文件,仅读取这些文件。这可以保持上下文窗口高效,避免冗余探索。
需要理解的内容:
- 任务ID(用于提交信息)
- 需求(必选 vs 可选)
- 提议的解决方案
- 需要修改的文件
- 实现步骤
3. Invoke Specialized Skills (MANDATORY - DO NOT SKIP)
3. 调用专业技能(强制要求 - 不得跳过)
CRITICAL GUARDRAIL: Before writing ANY code, you MUST check for and invoke specialized skills. This is NOT optional.
关键防护规则: 编写任何代码前,必须检查并调用专业技能,这不是可选步骤。
Step 3a: Detect Installed Skills
步骤3a:检测已安装的技能
Check if these skills are available by looking for them in the available skills/tools:
| Skill | Detection | Invoke When |
|---|---|---|
| Skill is listed in available tools | ANY React/Next.js/TypeScript code |
| Skill is listed in available tools | ANY database queries, RLS, schema, Supabase code |
通过查看可用技能/工具列表,检查是否存在以下技能:
| 技能 | 检测方式 | 调用时机 |
|---|---|---|
| 可用工具中列出该技能 | 涉及任何React/Next.js/TypeScript代码时 |
| 可用工具中列出该技能 | 涉及任何数据库查询、RLS、schema、Supabase代码时 |
Step 3b: Invoke BEFORE Writing Code
步骤3b:编写代码前调用
If skill is detected → MUST invoke it FIRST, before writing any code.
undefined如果检测到对应技能 → 必须首先调用,然后再编写任何代码。
undefinedFor React/Next.js projects:
对于React/Next.js项目:
/vercel-react-best-practices
/vercel-react-best-practices
For Supabase/PostgreSQL projects:
对于Supabase/PostgreSQL项目:
/supabase-postgres-best-practices
undefined/supabase-postgres-best-practices
undefinedStep 3c: Verification Checklist
步骤3c:验证清单
Before proceeding to Step 4, confirm:
- Checked if is available
/vercel-react-best-practices - If available AND task involves React/Next.js → Invoked it
- Checked if is available
/supabase-postgres-best-practices - If available AND task involves database → Invoked it
进入步骤4前,确认:
- 已检查是否可用
/vercel-react-best-practices - 如果可用且任务涉及React/Next.js → 已调用该技能
- 已检查是否可用
/supabase-postgres-best-practices - 如果可用且任务涉及数据库 → 已调用该技能
HARD STOP - Do NOT Proceed If:
强制停止 - 出现以下情况不得继续:
⛔ STOP: You detected a specialized skill is installed but did not invoke it.
This is a guardrail violation. You MUST:
1. Invoke the skill NOW before writing any code
2. Apply the best practices from the skill to your implementation
3. Only then proceed to Step 3
Skipping specialized skills leads to:
- Suboptimal code patterns
- Performance issues
- Security vulnerabilities
- Technical debtWhy this matters: These skills contain critical best practices from Vercel and Supabase engineers. Skipping them means writing code that may have performance issues, security vulnerabilities, or anti-patterns that will need to be fixed later.
⛔ STOP: You detected a specialized skill is installed but did not invoke it.
This is a guardrail violation. You MUST:
1. Invoke the skill NOW before writing any code
2. Apply the best practices from the skill to your implementation
3. Only then proceed to Step 3
Skipping specialized skills leads to:
- Suboptimal code patterns
- Performance issues
- Security vulnerabilities
- Technical debt重要性说明: 这些技能包含Vercel和Supabase工程师总结的关键最佳实践。跳过这些技能可能导致代码存在性能问题、安全漏洞或反模式,后续需要修复。
4. Update TASKS.md
4. 更新TASKS.md
Move task from "Planned" to "In Progress":
markdown
undefined将任务从"Planned"移动到"In Progress":
markdown
undefinedIn Progress
In Progress
| ID | Task | Started | Task Doc | Status |
|---|---|---|---|---|
| 1 | Quick Actions Redesign | Jan 25 | 001-quick-actions.md | Implementing |
undefined| ID | Task | Started | Task Doc | Status |
|---|---|---|---|---|
| 1 | Quick Actions Redesign | Jan 25 | 001-quick-actions.md | Implementing |
undefined5. Verify Dependencies
5. 验证依赖
Check that all prerequisites exist:
- Required API endpoints
- Required types/interfaces
- Required packages installed
- No blocking tasks
检查所有前置条件是否满足:
- 所需API端点存在
- 所需类型/接口存在
- 所需包已安装
- 无阻塞任务
Commit Convention
提交规范
IMPORTANT: All commits must include the task ID prefix for traceability.
重要提示: 所有提交必须包含任务ID前缀,便于追溯。
Format
格式
[task-{ID}] {type}: {description}
{optional body}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>[task-{ID}] {type}: {description}
{optional body}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>Examples
示例
bash
undefinedbash
undefinedFeature commit
功能提交
git commit -m "[task-1] feat: Add JWT authentication middleware
Implements token validation and refresh logic.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com"
git commit -m "[task-1] feat: Add JWT authentication middleware
Implements token validation and refresh logic.
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com"
Fix commit
修复提交
git commit -m "[task-2] fix: Resolve portal login redirect issue
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com"
undefinedgit commit -m "[task-2] fix: Resolve portal login redirect issue
Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com"
undefinedWhy This Matters
重要性说明
The prefix enables:
[task-{ID}]- Traceability: Easy to see which commits belong to which task
- Multi-task support: When multiple agents work in parallel, can identify task-specific changes
/ship - Filtering: shows all commits for task 1
git log --grep="\[task-1\]" - PR generation: can create accurate PR descriptions
/ship
[task-{ID}]- 可追溯性: 轻松查看哪些提交属于哪个任务
- 多任务支持: 多个Agent并行工作时,可以识别特定任务的变更
/ship - 过滤: 可以显示任务1的所有提交
git log --grep="\[task-1\]" - PR生成: 可以生成准确的PR描述
/ship
Implementation Guidelines
实现指南
Follow the Task Document
遵循任务文档
The task document is your spec. Follow it step by step:
- Step 1 → Complete → Verify
- Step 2 → Complete → Verify
- Continue until all steps done
任务文档是你的规范,逐步执行:
- 步骤1 → 完成 → 验证
- 步骤2 → 完成 → 验证
- 继续直到所有步骤完成
Invoke Skills When Applicable (MUST Use If Installed)
适用时调用技能(已安装则必须使用)
| Situation | Skill (Required If Installed) |
|---|---|
| React/Next.js code | |
| Database work | |
| Need clarification | Ask user |
| 场景 | 技能(已安装则必须使用) |
|---|---|
| React/Next.js代码 | |
| 数据库工作 | |
| 需要澄清 | 询问用户 |
Quality Standards
质量标准
- No types - use proper TypeScript types
any - All hooks before early returns
- AbortController in useEffect with fetches
- Clean, readable code
- Handle loading/error/empty states
- 不使用类型 - 使用正确的TypeScript类型
any - 所有Hook放在提前返回之前
- 在带请求的useEffect中使用AbortController
- 代码简洁可读
- 处理加载/错误/空状态
Track Progress
进度跟踪
Update the task document as you go:
- Check off completed requirements
- Note any deviations from plan
- Document blockers encountered
随时更新任务文档:
- 勾选已完成的需求
- 记录任何与计划的偏差
- 记录遇到的阻塞问题
Common Implementation Patterns
常见实现模式
Creating New Files
创建新文件
typescript
// 1. Create the file
// 2. Add to index exports if needed
// 3. Import where usedtypescript
// 1. 创建文件
// 2. 如需则添加到index导出
// 3. 在使用位置导入Modifying Existing Files
修改现有文件
typescript
// 1. Read the file first (always!)
// 2. Understand existing patterns
// 3. Make minimal, focused changes
// 4. Don't refactor unrelated codetypescript
// 1. 首先读取文件(必须!)
// 2. 理解现有模式
// 3. 进行最小化、聚焦的变更
// 4. 不要重构无关代码Web Development
Web开发
- Check project's CLAUDE.md for patterns
- Follow existing code patterns
- Use proper authentication
- Use ORM for database queries, not raw SQL
- 查看项目的CLAUDE.md了解模式
- 遵循现有代码模式
- 使用正确的认证方式
- 使用ORM进行数据库查询,不使用原生SQL
Completion Checklist
完成检查清单
Before marking as ready for testing:
标记为准备测试前:
Code Quality
代码质量
- Code compiles without errors
- No TypeScript errors
- Follows existing patterns
- No unnecessary complexity
- 代码编译无错误
- 无TypeScript错误
- 遵循现有模式
- 无不必要的复杂度
Functionality
功能
- All "Must Have" requirements implemented
- Happy path works
- Loading states handled
- Error states handled
- Empty states handled
- 所有"必选"需求已实现
- 正常流程运行正常
- 加载状态已处理
- 错误状态已处理
- 空状态已处理
Task Document
任务文档
- Requirements checked off
- Any deviations documented
- Notes added for tester
- 需求已勾选
- 所有偏差已记录
- 已添加测试人员注意事项
Update Status to TESTING
更新状态为TESTING
When implementation is complete:
实现完成后:
1. Update TASKS.md
1. 更新TASKS.md
Move to "Testing" section:
markdown
undefined移动到"Testing"部分:
markdown
undefinedTesting
Testing
| ID | Task | Task Doc | Test Report | Status |
|---|---|---|---|---|
| 1 | Quick Actions Redesign | 001-quick-actions.md | Pending | Ready for test |
undefined| ID | Task | Task Doc | Test Report | Status |
|---|---|---|---|---|
| 1 | Quick Actions Redesign | 001-quick-actions.md | Pending | Ready for test |
undefined2. Update Task Document
2. 更新任务文档
Add completion notes:
markdown
> **Status:** TESTING
> **Completed:** {Date}
> **Implementation Notes:** {Any important notes for tester}添加完成说明:
markdown
> **Status:** TESTING
> **Completed:** {Date}
> **Implementation Notes:** {Any important notes for tester}3. Pre-Completion Verification (REQUIRED)
3. 完成前验证(必填)
Before marking implementation complete, verify:
┌─────────────────────────────────────────────────────────────┐
│ ⚠️ SPECIALIZED SKILLS VERIFICATION │
├─────────────────────────────────────────────────────────────┤
│ □ Did task involve React/Next.js code? │
│ → If YES: Did you invoke /vercel-react-best-practices? │
│ │
│ □ Did task involve database/Supabase code? │
│ → If YES: Did you invoke /supabase-postgres-best-practices│
│ │
│ □ If skill was available but NOT invoked: │
│ → STOP. Go back and invoke it. Apply best practices. │
│ → Then return here to complete. │
└─────────────────────────────────────────────────────────────┘If you skipped a specialized skill: You must go back, invoke it, review your code against the best practices, and make any necessary corrections before proceeding.
标记实现完成前,验证:
┌─────────────────────────────────────────────────────────────┐
│ ⚠️ SPECIALIZED SKILLS VERIFICATION │
├─────────────────────────────────────────────────────────────┤
│ □ Did task involve React/Next.js code? │
│ → If YES: Did you invoke /vercel-react-best-practices? │
│ │
│ □ Did task involve database/Supabase code? │
│ → If YES: Did you invoke /supabase-postgres-best-practices│
│ │
│ □ If skill was available but NOT invoked: │
│ → STOP. Go back and invoke it. Apply best practices. │
│ → Then return here to complete. │
└─────────────────────────────────────────────────────────────┘如果你跳过了专业技能: 必须返回,调用该技能,根据最佳实践检查代码,进行必要的修正后再继续。
4. Inform User / Chain to Next Skill
4. 通知用户 / 链接到下一个技能
Check the task document for field.
Automation: auto检查任务文档的字段。
Automation: autoManual Mode (or if Automation field is missing)
手动模式(或缺少Automation字段)
Implementation complete for: #{ID} - {Task Title}
Files changed:
- path/to/file1.tsx (created)
- path/to/file2.tsx (modified)
Commits made:
- [task-{ID}] feat: Add authentication middleware
- [task-{ID}] feat: Add token refresh logic
Next Steps:
/test {ID} # e.g., /test 1
/test {ID}-{task-name} # e.g., /test 001-auth-jwtImplementation complete for: #{ID} - {Task Title}
Files changed:
- path/to/file1.tsx (created)
- path/to/file2.tsx (modified)
Commits made:
- [task-{ID}] feat: Add authentication middleware
- [task-{ID}] feat: Add token refresh logic
Next Steps:
/test {ID} # e.g., /test 1
/test {ID}-{task-name} # e.g., /test 001-auth-jwtAuto Mode
自动模式
Implementation complete for: #{ID} - {Task Title}
Files changed:
- path/to/file1.tsx (created)
- path/to/file2.tsx (modified)
[AUTO] Spawning /test with haiku model...Use Task tool to spawn test agent with model: haiku:
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/test {ID}" })Implementation complete for: #{ID} - {Task Title}
Files changed:
- path/to/file1.tsx (created)
- path/to/file2.tsx (modified)
[AUTO] Spawning /test with haiku model...使用Task工具生成模型:haiku的测试Agent:
Task({ subagent_type: "general-purpose", model: "haiku", prompt: "/test {ID}" })Multi-Task Completion
多任务完成
When all parallel agents complete:
Multi-task implementation complete!
Results:
├── Task #1: ✓ Complete (3 commits)
├── Task #2: ✓ Complete (2 commits)
└── Task #3: ✗ Failed (blocked by missing API)
Next Steps (for successful tasks):
/test 1 # Test task #1
/test 2 # Test task #2
/test 001-auth-jwt # Using task name
Failed task requires attention:
Task #3: See docs/task/003-feature-name.md for blocker details所有并行Agent完成后:
Multi-task implementation complete!
Results:
├── Task #1: ✓ Complete (3 commits)
├── Task #2: ✓ Complete (2 commits)
└── Task #3: ✗ Failed (blocked by missing API)
Next Steps (for successful tasks):
/test 1 # Test task #1
/test 2 # Test task #2
/test 001-auth-jwt # Using task name
Failed task requires attention:
Task #3: See docs/task/003-feature-name.md for blocker detailsHandling Issues
问题处理
Blocked by Missing Dependency
缺少依赖被阻塞
- Document the blocker in task document
- Update TASKS.md status to "Blocked"
- Inform user with specific blocker details
- Create sub-task if needed via
/task
- 在任务文档中记录阻塞问题
- 将TASKS.md状态更新为"Blocked"
- 向用户提供具体的阻塞详情
- 如需可通过创建子任务
/task
Requirement Unclear
需求不明确
- Ask user for clarification
- Update task document with clarified requirements
- Continue implementation
- 向用户请求澄清
- 更新任务文档,记录澄清后的需求
- 继续实现
Scope Creep
范围蔓延
- Stick to task document scope
- Note additional ideas in "Nice to Have" or separate task
- Don't expand scope without user approval
- 严格遵循任务文档范围
- 将额外想法记录在"Nice to Have"或单独任务中
- 未经用户批准不得扩大范围
Specialized Skills (MANDATORY When Installed)
专业技能(安装后必须调用)
These plugins must be installed separately. Once installed, invocation is MANDATORY — not optional.
| Plugin | Install From | When to Invoke |
|---|---|---|
| vercel-labs/agent-skills | ANY React/Next.js/TypeScript code |
| supabase/agent-skills | ANY database queries, RLS, schema, Supabase code |
这些插件需要单独安装。安装后必须调用,不是可选步骤。
| 插件 | 安装来源 | 调用时机 |
|---|---|---|
| vercel-labs/agent-skills | 涉及任何React/Next.js/TypeScript代码时 |
| supabase/agent-skills | 涉及任何数据库查询、RLS、schema、Supabase代码时 |
Enforcement Summary
执行总结
┌────────────────────────────────────────────────────────────────┐
│ SPECIALIZED SKILLS ARE NOT OPTIONAL ONCE INSTALLED │
├────────────────────────────────────────────────────────────────┤
│ 1. BEFORE writing code → Check if skills are available │
│ 2. IF available AND relevant → INVOKE immediately │
│ 3. APPLY best practices to your implementation │
│ 4. BEFORE completing → Verify you invoked required skills │
│ 5. IF skipped → Go back, invoke, review code, fix issues │
└────────────────────────────────────────────────────────────────┘Failure to invoke specialized skills when available leads to:
- Code that violates best practices
- Performance issues that need fixing later
- Security vulnerabilities
- Technical debt and rework
┌────────────────────────────────────────────────────────────────┐
│ SPECIALIZED SKILLS ARE NOT OPTIONAL ONCE INSTALLED │
├────────────────────────────────────────────────────────────────┤
│ 1. BEFORE writing code → Check if skills are available │
│ 2. IF available AND relevant → INVOKE immediately │
│ 3. APPLY best practices to your implementation │
│ 4. BEFORE completing → Verify you invoked required skills │
│ 5. IF skipped → Go back, invoke, review code, fix issues │
└────────────────────────────────────────────────────────────────┘可用时未调用专业技能会导致:
- 代码违反最佳实践
- 后续需要修复的性能问题
- 安全漏洞
- 技术债务和返工