majiayu000/ac-lock
Phase 4.0 — Acceptance Criteria lock checkpoint before implementation. Consolidates all ACs from PRD, TechSpec, and Tasks, presents to user for confirmation, and saves the locked AC list to accepted-criteria.md. Implementation only starts after explicit user confirmation.
npx skills add https://github.com/majiayu000/claude-skill-registry --skill ac-lock
Runs automatically as Phase 4.0, after Tasks Validation and before the first implementation task.
Purpose: give the user one final explicit confirmation that the Acceptance Criteria represent what they actually want — before any implementation begins.
[Tasks Validation]
↓
[AC Lock Checkpoint] ← THIS SKILL
↓
Per-Task: implementation
prd.md, techspec.md, and tasks.md must exist in tasks/prd-{slug}/accepted-criteria.md in .claude/feature-state/{slug}/accepted-criteria.md already exists (resume case): skip extraction, ask user to confirm current locked ACs or unlock to re-confirmRead ACs from all three documents:
From prd.md:
From techspec.md:
From tasks.md:
Merge near-duplicate ACs (same intent, slightly different wording):
Group ACs into three categories:
Present the consolidated list with clear formatting before any implementation starts:
✋ AC Lock Checkpoint — Confirm Before Implementation
This feature will be considered DONE when all of the following are true:
**Functional**
1. [ ] Personal trainer can see all linked students in /cms/students
2. [ ] Student appears in trainer's list after successful Firestore connection
3. [ ] trainerId is persisted on student document in Firestore
**Technical**
4. [ ] POST /api/students saves trainerId field from auth context
5. [ ] GET /api/students filters by authenticated trainer's uid
6. [ ] Firestore security rules allow trainer to read their students only
**Quality**
7. [ ] All new use cases have unit tests
8. [ ] No breaking changes to existing /api/students consumers
---
Does this accurately capture what you want?
yes → Lock these ACs and start implementation
adjust N → Edit AC number N (e.g., "adjust 3")
add → Add a missing AC
remove N → Remove AC number N
show-sources → Show which document each AC came from
Allow the user to modify the AC list before locking:
Current AC-3: "trainerId is persisted on student document in Firestore"
New AC-3: [user input]
Replace the AC in the list and re-present the relevant section.
Enter new AC (describe what must be true when the feature is done):
[user input]
Category: functional / technical / quality?
Append to the appropriate category.
Removing AC-5: "GET /api/students filters by authenticated trainer's uid"
Are you sure? This requirement won't be tracked. (yes/no)
AC-1 → prd.md: Goals section
AC-4 → techspec.md: Validation & Testing Plan
AC-7 → tasks.md: Task 6 - "Done When" criteria
After user confirms with yes:
Save to .claude/feature-state/{slug}/accepted-criteria.md:
## Accepted Criteria — Locked
Feature: {slug}
Locked: {timestamp}
Locked by: user confirmation
> ⚠️ This file is immutable during implementation.
> Do not edit after locking.
### Functional
- [ ] AC-1: Personal trainer can see all linked students in /cms/students
- [ ] AC-2: Student appears in trainer's list after successful Firestore connection
- [ ] AC-3: trainerId is persisted on student document in Firestore
### Technical
- [ ] AC-4: POST /api/students saves trainerId field from auth context
- [ ] AC-5: GET /api/students filters by authenticated trainer's uid
- [ ] AC-6: Firestore security rules allow trainer to read their students only
### Quality
- [ ] AC-7: All new use cases have unit tests
- [ ] AC-8: No breaking changes to existing /api/students consumers
### Sources
| AC | Source |
|----|--------|
| AC-1 | prd.md: Goals |
| AC-4 | techspec.md: Validation & Testing Plan |
| AC-7 | tasks.md: Task 6 |
During Phase 5 (Commit & PR), read accepted-criteria.md and check which ACs are covered:
For each AC, check if implementation tasks have been completed that address it:
[x] in the coverage report## Definition of Done
**Covered by this PR:**
- [x] AC-1: Personal trainer can see all linked students in /cms/students
- [x] AC-2: Student appears in trainer's list after Firestore connection
- [x] AC-4: POST /api/students saves trainerId field
**Known gaps (not covered):**
- [ ] AC-7: Unit tests — partial (3 of 5 use cases tested)
> Full AC list: .claude/feature-state/{slug}/accepted-criteria.md
If all ACs are covered → no "Known gaps" section.
| State | Behavior |
|-------|----------|
| accepted-criteria.md does not exist | Run full AC Lock flow |
| File exists, --resume flag | Show locked ACs, ask to confirm or unlock |
| File exists, --force-relock flag | Re-run extraction, allow new confirmation |
| User skips (emergency) | Warn, log "AC Lock bypassed", proceed without file |
If the user explicitly wants to skip AC Lock (e.g., rapid prototype):
⚠️ AC Lock bypassed — implementation will proceed without locked ACs.
PR will not include a "Definition of Done" section.
Type "skip-ac-lock" to confirm.
Log the bypass in .claude/feature-state/{slug}/checkpoint.json.
Take majiayu000/ac-lock from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.