AgentSkillsCN

dod

运行全部 10 项“完成定义”门,并报告通过或未通过的结果。

SKILL.md
--- frontmatter
name: dod
description: Run all 10 Definition of Done gates and report pass/fail.
argument-hint: "<task-id>"
allowed-tools: Read, Glob, Grep, Bash, Task
model: sonnet

/dod — Run All DoD Gates

Run all gates for task: $ARGUMENTS

Gates

Gate 1: Implementation Complete

bash
grep -rn "TODO\|FIXME\|HACK" src/ --include="*.py" --include="*.ts" --include="*.js"

FAIL if any TODO/FIXME/HACK found without issue reference. (Exit code 1 = matches found = FAIL. Exit code 1 with no output = no matches = PASS.)

Gate 2: Linting

bash
pre-commit run --all-files

FAIL if any hook fails.

Gate 3: Unit Tests

bash
pytest tests/unit/ -v --tb=short --cov=src --cov-report=term-missing --cov-fail-under=90

FAIL if any test fails or coverage < 90%.

Gate 4: Integration Tests

bash
pytest tests/integration/ -v --tb=short

FAIL if any test fails. SKIP if no integration tests exist.

Gate 5: E2E Tests

bash
npx playwright test

SKIP if no e2e tests exist.

Gate 6: Security

bash
gitleaks detect --source . --no-banner

FAIL if secrets detected.

Gate 7: Performance

Check for N+1 queries, unbounded loops, missing pagination. (Agent review)

Gate 8: Documentation

Check public functions have docstrings, API endpoints documented.

Gate 9: Pipeline & PR Status

9a. CI Status:

bash
gh run list --branch $(git branch --show-current) --limit 1 --json status,conclusion --jq '.[0]' 2>/dev/null

FAIL if latest CI run is not successful. SKIP if no CI runs exist yet (tell user to push and re-run).

9b. PR Status (if branch is pushed):

bash
gh pr view --json state,reviewDecision,statusCheckRollup --jq '{state: .state, review: .reviewDecision, checks: [(.statusCheckRollup // [])[].conclusion]}' 2>/dev/null

Check:

  • PR exists and is OPEN
  • Review decision is APPROVED (or no reviews required)
  • All status checks passed

SKIP if no PR exists (not all workflows use PRs). FAIL if PR exists but has failing checks or CHANGES_REQUESTED review.

Gate 10: Agent Review

Launch an opus subagent for final review.

Summary Table

GateStatusDetails
1. Implementation?
2. Linting?
3. Unit Tests?
4. Integration?
5. E2E?
6. Security?
7. Performance?
8. Documentation?
9. Pipeline?
10. Review?

ALL pass → DONE. Any fail → list fixes.