用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill archive-task命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | archive-task |
| description | Atomically update todo.md and changelog.md when completing a task |
| allowed-tools | Bash, Read, Edit, Write |
Purpose: Atomically update todo.md (mark task complete) and changelog.md (add changes) in a single commit when task is complete.
Performance: Prevents split commits, ensures atomic task archival
# Checks:
- Task in COMPLETE state (task.json)
- Task merged to main (git log check)
- User approval flag exists
# REMOVES task entry completely (do NOT mark with [x]):
BEFORE: - [ ] implement-formatter-api
- **Dependencies**: None
- **Blocks**: None
...
AFTER: (entire entry deleted)
CRITICAL: Tasks are REMOVED from todo.md, NOT marked with [x]. The [x] pattern is a common mistake
that violates the archival protocol.
# Adds entry with changes:
## [YYYY-MM-DD] - implement-formatter-api
- Added FormattingRule interface
- Implemented RuleEngine class
- Added comprehensive tests
- Documented public API
# Single commit with both files:
git add todo.md changelog.md
git commit -m "Archive task: implement-formatter-api
Removed task entry from todo.md.
Added changelog entry:
- Added FormattingRule interface
- Implemented RuleEngine class
- Added comprehensive tests
- Documented public API
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>"
# After task merged to main
TASK_NAME="implement-formatter-api"
CHANGES="Added FormattingRule interface
Implemented RuleEngine class
Added comprehensive tests
Documented public API"
/workspace/main/.claude/scripts/archive-task.sh \
--task "$TASK_NAME" \
--changes "$CHANGES"
# Automatically extract changes from merge commit
TASK_NAME="implement-formatter-api"
/workspace/main/.claude/scripts/archive-task.sh \
--task "$TASK_NAME" \
--auto-extract-changes true
# Single commit updates both files
Edit: todo.md (mark task complete)
Edit: changelog.md (add entry)
git add todo.md changelog.md
git commit -m "Update todo.md: Mark task complete
Added changelog entry: ...
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>"
Result: One commit, both files updated together
# First commit: todo.md only
Edit: todo.md
git add todo.md
git commit -m "Mark task complete"
# Second commit: changelog.md
Edit: changelog.md
git add changelog.md
git commit -m "Update changelog"
Problem: Two commits instead of atomic update (protocol violation)
## [YYYY-MM-DD] - {task-name}
- Change description line 1
- Change description line 2
- Change description line 3
## [YYYY-MM-DD] - {task-name}
### Added
- New feature X
- New API Y
### Changed
- Improved performance of Z
### Fixed
- Bug in edge case handling
## [YYYY-MM-DD] - {task-name}
- Implemented FormattingRule interface (architect)
- Added comprehensive test suite (tester)
- Documented public API with JavaDoc (formatter)
Commit: abc123
User approves changes (AWAITING_USER_APPROVAL)
↓
[archive-task skill] ← THIS SKILL (BEFORE merge)
↓
Update todo.md (mark complete)
↓
Update changelog.md (add entry)
↓
Amend task branch commit to include archival
↓
Merge to main with --ff-only
↓
[update-dependent-tasks skill: Unblock dependent tasks] ← MANDATORY
↓
[task-cleanup skill: Remove branches/worktrees]
⚠️ CRITICAL: After archiving, you MUST invoke update-dependent-tasks skill
When a task is marked complete, other tasks that depend on it may become unblocked. Failure to update dependent tasks leaves todo.md in an inconsistent state where tasks remain marked BLOCKED even though their dependencies are satisfied.
Script returns JSON:
{
"status": "success",
"message": "Task archived successfully",
"task_name": "implement-formatter-api",
"todo_updated": true,
"changelog_updated": true,
"commit_sha": "abc123def456",
"files_changed": ["todo.md", "changelog.md"],
"atomic_commit": true,
"timestamp": "2025-11-11T12:34:56-05:00"
}
# Extract from squash merge commit message
git log --format=%B -n 1 HEAD | grep "^-"
# Summarize file changes
git diff --stat main~1..main
# Use original task description from todo.md
# and agent requirement reports to summarize
# User explicitly provides change summary
--changes "Added feature X, Fixed bug Y"
On any error:
Recovery: Safe to retry after fixing issue
CRITICAL: Tasks are REMOVED completely from todo.md, NOT marked with [x].
The [x] checkbox pattern is WRONG and violates the archival protocol.
BEFORE:
- [ ] implement-formatter-api
AFTER:
(entire entry deleted from todo.md)
BEFORE:
- [ ] implement-formatter-api
- Dependencies: None
- Blocks: Other tasks
- Estimated Effort: 2 days
- Purpose: Description here
AFTER:
(entire entry including all sub-items deleted from todo.md)
❌ WRONG - Do NOT mark with [x]:
- [x] implement-formatter-api
✅ CORRECT - DELETE the entire entry:
(entry no longer exists in todo.md)
# Changelog
## [2025-11-11] - implement-formatter-api ← NEW ENTRY
- Added FormattingRule interface
...
## [2025-11-10] - previous-task
...
Rationale: Latest changes at top, easy to see recent work
# Changelog
## [2025-11-01] - old-task
...
## [2025-11-11] - implement-formatter-api ← NEW ENTRY
...
Rationale: Chronological order, but latest buried
# Check current state
jq -r '.state' /workspace/tasks/{task-name}/task.json
# If not COMPLETE:
# 1. Ensure validation passed
# 2. Get user approval
# 3. Merge to main
# 4. Transition to COMPLETE
# 5. Retry archival
# Check if task merged
git log --oneline --all --grep="{task-name}"
# If not merged:
# 1. Complete VALIDATION phase
# 2. Get user approval
# 3. Squash merge to main
# 4. Retry archival
# Task name doesn't match todo.md entry
# Options:
1. Verify exact task name in todo.md
2. Check for typos or different casing
3. Manually locate entry and provide line number
4. Retry with correct task name
# Task already archived (duplicate)
# Options:
1. Skip changelog update (only update todo.md)
2. Update existing entry if changes incomplete
3. Do nothing if already complete
# Simple feature implementation
archive-task \
--task "implement-api" \
--changes "Added public API for feature X"
# Bug fix task
archive-task \
--task "fix-edge-case-bug" \
--changes "Fixed edge case in validation logic
Affected: Parser.validate() method
Impact: Prevents NPE on null input"
# Task touching multiple areas
archive-task \
--task "refactor-validation" \
--changes "Refactored validation logic:
- Extracted ValidationRule interface
- Implemented DefaultValidator
- Added ValidationContext for error reporting
- Updated 15 call sites"
The archive-task script performs:
Validation Phase
Change Extraction Phase
Todo Update Phase
Changelog Update Phase
Commit Phase
Verification Phase