AgentSkillsCN

pm-close

标记任务为已完成或已取消。更新任务状态,添加结案日志条目,同步更新变更日志。当任务完成后,可使用此功能。

SKILL.md
--- frontmatter
name: pm-close
description: Marks a task as completed or cancelled. Updates status, adds closing log entry, updates changelog. Use when task is finished.
argument-hint: "<TASK-ID> [--cancel]"
allowed-tools: Bash, Read, Write, Edit

Close Task

Closes a task by updating its status to completed (or cancelled) and recording the closure.

Workflow

  1. Get task ID:

    • From $ARGUMENTS
    • Or extract from current git branch name
    • Or ask user to specify
  2. Read task file: Load markdown from Obsidian directory

    • Validate task exists
    • Check current status
  3. Validate completion:

    • Warn if unchecked completion criteria remain
    • For --cancel flag, skip validation (cancelled tasks don't need criteria met)
  4. Update status:

    • Default: task_status: ✅ completed
    • With --cancel: task_status: ❌ cancelled
    • Update updated field to current date
    • Set completed_time to current timestamp (YYYY-MM-DD HH:mm)
  5. Add closing log entry under #### 🧮 Content::

    markdown
    ##### YYYY-MM-DD
    - Task completed: [summary of work]
    - Total commits: N
    - All completion criteria met
    

    For cancelled tasks:

    markdown
    ##### YYYY-MM-DD
    - Task cancelled: [reason for cancellation]
    
  6. Update changelog: Add entry to changelog.md

    • Completed: - ✅ Completed [[TASK-NNN]]: <title>
    • Cancelled: - ❌ Cancelled [[TASK-NNN]]: <title>
  7. Suggest cleanup commands:

    bash
    git checkout main
    git branch -d feat/TASK-NNN-slug
    

Example Usage

Complete a task:

bash
/pm-close TASK-001

Cancel a task:

bash
/pm-close TASK-002 --cancel

Status Transitions

  • Any status → ✅ completed (if criteria met)
  • Any status → ❌ cancelled (with --cancel flag)