Add tasks checklist

From brabos-ai/code-addiction · View interactive version

Add tasks checklist is an AI agent skill from the GitHub repository brabos-ai/code-addiction. Schema and tick rules for tasks.md across plan/build/review.

How to use this skill

Skill file

tasks.md Checklist Schema

<!-- uses:

-->

Overview

tasks.md is the single source of progress truth for a feature (or subfeature, in epics). plan.md is the frozen spec; tasks.md is the developer's activity breakdown that absorbs all tick state — area work, contract validation, TDD evidence, and quality gates.

When to Use

When NOT to Use

Canonical Structure

tasks.md has 6 sections in this exact order with these exact headings (validators parse by exact text). The 6th section (## Validation Gates) is conditional — present only when AGENTS.md exposes a validation_gates block.

The file opens with a minimal frontmatter — type: tasks and schema: {{doc-schema}} — above the # Tasks: heading. This skill owns it: every writer of a new tasks.md carries the block from here, and a command that updates an existing file never rewrites it (see add--doc-schemas → Schema Version).

---
type: tasks
schema: {{doc-schema}}
---

# Tasks: [feature or SF name]

## Metadata

| Field | Value |
|-------|-------|
| Complexity | SIMPLE / STANDARD / COMPLEX |
| Total tasks | [N] |
| Services | database, backend, frontend, test |

## Requirements Coverage

- [ ] RF01 — [requirement title]
- [ ] RF02 — [requirement title]
- [ ] RN01 — [rule title]

## TDD

- [ ] T-TEST-01 Contract test for RF01 — `path/file.spec.ts`
- [ ] T-TEST-02 Contract test for RN01 — `path/file.spec.ts`

## Execution

- [ ] T01 [max 10 words description]
  - Service: database
  - Files: `path/file.ts`
  - Deps: -
  - Consumes: -
  - Produces: `UserRepository.insert(row: NewUser): Promise<User>`
  - Verify: `<migration command from AGENTS.md>` against the local test database
- [ ] T02 [max 10 words description]
  - Service: backend
  - Files: `path/a.ts`, `path/b.ts`
  - Deps: T01
  - Consumes: `UserRepository.insert(row: NewUser): Promise<User>` (T01)
  - Produces: `UsersService.create(dto: CreateUserDto): Promise<UserDto>`
  - Verify: `<validation_gates.test>` scoped to `path/a.spec.ts`

## Acceptance Checklist

- [ ] Route `POST /users` returns 201 on valid signup (RF01)
- [ ] DTO `UserDto` exposes `id`, `email`, `createdAt` (RF01)
- [ ] Service `UsersService.create` enforces unique email (RN01)
- [ ] Queue `user.signup` published on success (RF01)

## Validation Gates

- [ ] Run `npm run lint` and fix failures in files touched by this work
- [ ] Run `npm run typecheck` and fix failures in files touched by this work
- [ ] Run `npm test` and fix failures in files touched by this work
- [ ] Run `npm run build` and fix failures
- [ ] Run `npm run format:check` and fix failures in files touched by this work

The exact items above are auto-derived from AGENTS.md validation_gates. The example shows a Node project; for Python the items would read Run \pytest\ …, for .NET Run \dotnet test\ …, etc. — language-agnostic.

Delivery Boundary

A delivery is code, migration files and tests, landing in one merge. Deploying it is not part of the delivery: the project's own deploy process runs after /add-done.

This section owns the rule. Every other artefact points here instead of restating it.

IF A TASK OR ACCEPTANCE ITEM WOULD APPLY MIGRATIONS TO, DEPLOY TO OR PUBLISH TO A SHARED, STAGING OR PRODUCTION ENVIRONMENT:
  ⛔ DO NOT: Write it as an Execution task, an Acceptance item or a `Verify:` line
  ⛔ DO NOT: Phase the work around an intermediate deploy (migrate, then deploy, then switch on)
  ✅ DO: Deliver the migration FILE and its tests; the deploy process applies it after the merge

Section Rules

`## Requirements Coverage`

`## TDD`

`## Execution`

`## Acceptance Checklist`

`## Validation Gates`

Failure Marker `[!]`

When a tick attempt detects a problem, replace [ ] with [!] and append an inline reason:

- [!] T03 Implement signup endpoint — REASON: route handler missing email uniqueness check
- [!] Route POST /users returns 201 (RF01) — REASON: returns 200 on success, not 201

Rules:

"Non-Trivial Change" Definition

A diff change to a file counts as non-trivial when at least one of these holds:

A change is trivial (does NOT count) when it is exclusively:

Tick Authority (who writes ticks)

| Section | add-build |

|---------|-------------|

| §1 Requirements Coverage | derived after validator writes |

| §2 TDD | per-area validator |

| §3 Execution | per-area validator |

| §4 Acceptance Checklist | per-area validator |

| §5 Validation Gates | post-validator final step (must run real commands) |

| [!] setting | per-area validator |

add-build is the sole coordinator for tasks.md: only it writes. Area validators emit a structured report and it performs a single merge-write per batch — this avoids parallel-write contention without locks.

Validator Report Shape

Per-area validators MUST return a JSON-shaped report. The dispatching command owns the tasks.md write — add-build, the sole coordinator:

{
  "area": "backend",
  "ticks": {
    "tdd": [{"id": "T-TEST-02", "status": "x"}],
    "execution": [{"id": "T03", "status": "x"}, {"id": "T04", "status": "!", "reason": "missing uniqueness check on email"}],
    "acceptance": [{"key": "Route POST /users returns 201", "status": "x", "rf": ["RF01"]}]
  },
  "files_inspected": ["src/api/users.ts", "src/services/users.ts"]
}

The coordinator merges all area reports, recomputes derived ## Requirements Coverage state, and writes tasks.md once.

Architect Subagent Prompt Template

When add-plan STEP add-plan.tasks dispatches the architect subagent, use this prompt template:

You are the ARCHITECT for feature ${FEATURE_ID} (subfeature ${EPIC_CURRENT_SF} if epic).

## CONTEXT
Read these files in order:
1. ${PLAN_DIR}/plan.md  — PRIMARY: technical contracts (prose)
2. ${PLAN_DIR}/about.md — Scope, RF/RN, acceptance criteria
3. .codeadd/docs/features/${FEATURE_ID}/discovery.md — Constraints
4. ${PLAN_DIR}/plan-test-spec.md — Test specifications (if exists)
5. {{addpath:wiki/workflows.md}}, its Test Workflow section — ONLY if WIKI:present. Names which
   tests are local (unit) vs CI-tier (integration/e2e) vs manual. Skip silently if the wiki, or that
   section, is absent — see the `Verify:` rule below.

## TASK
Compose the tasks document following the canonical schema defined in
the `add--tasks-checklist` skill. Use the EXACT section headings:
  ## Metadata
  ## Requirements Coverage
  ## TDD
  ## Execution
  ## Acceptance Checklist
  ## Validation Gates    (omit entirely if AGENTS.md has no validation_gates block)

## RULES
Follow the Section Rules defined in the `add--tasks-checklist` skill. All
checkboxes start as `[ ]` — do NOT pre-tick anything. Complexity scoring:
SIMPLE ≤5 tasks, STANDARD 6–12, COMPLEX 13+ (warn: should be split as epic).
Service order (TDD ordering): test → database → backend → frontend.
Follow `## Delivery Boundary`: no task or Acceptance item deploys, publishes or applies migrations outside local/test unless the user asked as that section says, and every `Verify:` is local.

**`Verify:` tier rule.** If a task's `Files` include a test spec that `wiki/workflows.md`'s Test
Workflow section names as CI-tier (integration/e2e), write that task's `Verify:` line scoped to that
one file — NEVER the whole suite command. A task whose test file is local-tier, or whose tier cannot
be determined (no wiki, or no Test Workflow section), keeps today's behavior: `Verify:` names
whatever command actually proves that task, unscoped.

## OUTPUT
Return the complete tasks document in your report. Write NO file — you are
read-only, and the dispatching step writes `${PLAN_DIR}/tasks.md` from what you
return. Return the document alone, with no commentary wrapped around it.

⛔ The architect is @architecture-agent, which declares readonly: true. A template telling it

to write is a template it can only refuse. add-plan STEP add-plan.tasks is the writer.

Resume vs Rerun Procedure

Used at the start of add-build TASKS MODE (and any consumer that re-enters a feature mid-flight). Follow these steps exactly:

  1. Read tasks.md from the feature/subfeature directory.
  2. Count items across §2 TDD + §3 Execution + §4 Acceptance Checklist (do NOT count §1 or §5):
  1. Present counts to the user (e.g., "5 pending, 8 done, 1 failed") and ask:

> "Resume (re-execute only [ ] and [!] items) or rerun all (re-execute everything regardless of state)?"

  1. Resolve user response conversationally (e.g., "resume", "continue", "rerun", "do all") — no CLI flags. On silence or headless mode, default to resume.
  2. Set RESUME_MODE = resume | rerun_all for the consumer to filter the §3 Execution task list.

resume filter rule: include §3 Execution items with state [ ] or [!]; skip [x].

rerun_all filter rule: include all §3 Execution items regardless of state.

Tick Application Procedure (per area validator)

Used by the per-area validator subagent under add-build. **The

validator is read-only: it emits a tick report and the dispatching command writes tasks.md

once.** Follow exactly:

  1. Inspect diff: run git diff against the feature branch base. This is the source of truth for what changed — NOT any FILES_CREATED/FILES_MODIFIED list, which can lie.
  2. Filter tasks.md items for the CURRENT AREA:
  1. Apply tick rules per §Section Rules above (TDD, Execution, Acceptance).
  2. Route divergent items (wrong status code, missing field, etc.) as rows for the correction agent; tick them [!] with the reason. ⛔ You do not fix them yourself — you are read-only.
  3. Output: emit the JSON validator report (see "Validator Report Shape"). The dispatching command — add-build — merges every area report and writes tasks.md.
  4. Set SPEC_STATUS = INCOMPLETE if any §3 or §4 item for this area is [!] or [ ].

Coordinator Merge Procedure

Used by the dispatching command after collecting all per-area validator reports. add-build is the SOLE writer of tasks.md.

  1. Collect the JSON tick report from every area validator.
  2. Merge ticks across areas (no conflicts expected — areas don't overlap on §3 tasks; if conflict, last-writer-wins is acceptable since both must agree on diff state).
  3. Recompute §1 Requirements Coverage: a RF/RN line ticks [x] only if ALL §3 Execution AND §4 Acceptance items referencing it (via (RFNN/RNNN)) are [x].
  4. Write tasks.md ONCE per batch with all merged ticks.

Validation Gates Procedure (end of build / loop / review)

Used by add-build (or add-review) AFTER all area validators complete. This is where ## Validation Gates items get ticked. Self-attestation is forbidden. Every tick must correspond to an actual command invocation captured in this session.

Pre-condition: migration nudge

Read AGENTS.md. If no validation_gates JSON block exists, emit ONE single line to the user:

Note: validation_gates not detected in AGENTS.md. Run /add-wiki to enable validation gates.

Do NOT auto-run wiki generation. Do NOT block. Skip the rest of this procedure when the block is absent (no gates to enforce). When the block is present but ## Validation Gates is missing from tasks.md, that is a planning bug — surface it but still run the gates from AGENTS.md.

Steps

  1. Parse validation_gates from AGENTS.md → ordered list of (intent, command) pairs.
  2. Compute TOUCHED_FILES = git diff --name-only <feature-base>...HEAD (plus uncommitted changes for add-build).
  3. For EACH (intent, command): invoke per §Section Rules → ## Validation Gates (build / loop coordinator tick rule). On red touched-file failures after fix-and-rerun, set [!] with reason. Append untouched failures to ### Known Issues (cap 10; truncate with - +N more (run \<command>\ for full list)).
  4. Recompute ## Requirements Coverage derived state one final time.
  5. Single write to tasks.md.

Review variant (independent re-run)

When invoked by add-review, ignore any pre-existing [x] ticks on ## Validation Gates — re-run every gate command from scratch. The review's job is to verify, not to trust.

Backwards-compatibility note: §5 was renamed ## Quality Gates → ## Validation Gates. Consumers should treat both headings as the same section during the transition window; new writes always use ## Validation Gates.

Validation Checklist

[ ] All 6 section headings present and exact text (§6 omitted if no validation_gates block)
[ ] Every RF/RN in §1 is referenced by ≥1 §4 item
[ ] ## Execution tasks have all 6 metadata sub-bullets, ≤3 files each
[ ] Every ## Execution Consumes matches a Produces on an earlier task, character for character
[ ] All checkboxes initialized as [ ]
[ ] No tick lives in plan.md (plan.md is frozen)
[ ] No task or Acceptance item deploys, publishes or applies migrations outside local/test unless the user asked, and every Verify: is local
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.