AgentSkillsCN

work-unit

为工单执行一次完整的工作循环迭代

SKILL.md
--- frontmatter
name: work-unit
description: Execute one complete work loop iteration for a ticket
argument-hint: "[ticket-id, e.g., 02-004]"
disable-model-invocation: true

Work Unit: Complete Implementation Cycle

You are executing the MANDATORY work loop for TICKET-$ARGUMENTS.

PHASE 1: TICKET LOAD ─────────────────────────────────────────

Load the ticket context first:

  1. Find and read: sprints/sprint-*/TICKET-$ARGUMENTS*.md
  2. Verify all dependencies are satisfied
  3. If blocked, STOP and report the blocker

PHASE 2: PLANNING ────────────────────────────────────────────

Before writing any code:

  1. Use the Plan agent if the ticket is complexity M or L
  2. Document the implementation approach
  3. Identify all files to create/modify
  4. Identify all test files needed

PHASE 3: TEST FIRST ──────────────────────────────────────────

Write tests BEFORE implementation:

  1. Create test file(s) in appropriate location
  2. Write tests that cover ALL acceptance criteria
  3. Tests should FAIL initially (no implementation yet)
  4. Run cargo test to confirm tests exist and fail appropriately

COMMIT CHECKPOINT:

bash
git add -A
git commit -m "test: add tests for TICKET-$ARGUMENTS

- <list what tests cover>
"

PHASE 4: IMPLEMENT ───────────────────────────────────────────

Now implement to pass the tests:

  1. Create/modify files as specified in ticket
  2. Follow the Technical Details section exactly
  3. Write minimal code to pass tests
  4. Use Explore agent if you need to find patterns in codebase

PHASE 5: VERIFY ──────────────────────────────────────────────

All verification must pass before proceeding:

bash
cargo test                # All tests pass
cargo clippy              # No warnings
cargo fmt --check         # Formatting correct

If any verification fails:

  1. Fix the issue
  2. Re-run verification
  3. Do NOT proceed until all pass

PHASE 6: COMMIT IMPLEMENTATION ───────────────────────────────

COMMIT CHECKPOINT:

bash
git add -A
git commit -m "feat: implement TICKET-$ARGUMENTS

<brief description of implementation>

- <key change 1>
- <key change 2>
"

PHASE 7: UPDATE DOCUMENTATION ────────────────────────────────

Documentation updates are MANDATORY:

  1. Sprint README (sprints/sprint-XX-*/README.md):

    • Change ticket status: 🔴 → 🟢
  2. Ticket file (if needed):

    • Check off completed acceptance criteria
    • Note any deviations or discoveries
  3. SPRINT_TRACKER.md (if milestone reached):

    • Update sprint status
    • Add to Recent Updates

COMMIT CHECKPOINT:

bash
git add -A
git commit -m "docs: mark TICKET-$ARGUMENTS complete

- Updated sprint README status
- Checked acceptance criteria
"

PHASE 8: SUMMARY ─────────────────────────────────────────────

Provide a summary:

code
# Work Unit Complete: TICKET-$ARGUMENTS

## Implementation Summary
- Files created: X
- Files modified: Y
- Tests added: Z

## Commits Made
1. test: add tests for TICKET-$ARGUMENTS
2. feat: implement TICKET-$ARGUMENTS
3. docs: mark TICKET-$ARGUMENTS complete

## Verification
- ✓ All tests pass
- ✓ Clippy clean
- ✓ Documentation updated

## Next Ticket
Use /next-ticket to find the next available work

CRITICAL REMINDERS

  • NEVER skip the test phase - tests come first
  • NEVER skip verification - all checks must pass
  • NEVER skip documentation - update status after every ticket
  • COMMIT at each checkpoint - small, focused commits
  • Use sub-agents - Explore for research, Plan for design