This skill executes backend tasks using TDD, writing failing tests first and implementing minimal code to pass them efficiently.
npx playbooks add skill yellinzero/aico --skill aico-backend-implement
Before generating any content, check aico.json in project root for language field to determine the output language. If not set, default to English.
docs/reference/backend/tasks/story-{story-name}.md with task numberstandalone-{task-name}.md with task numberdocs/reference/backend/constraints.md - Tech stack, patterns- [ ] → - [x]pending to completed> Story: field from file headerdocs/reference/pm/stories/- [x]See [Task File Template](../task-breakdown/references/task-file-template.md) for complete structure.
Both story-based and standalone tasks use the same file structure - the only difference is the filename:
story-{story-name}.md (from PM story breakdown)standalone-{task-name}.md (from plan/ad-hoc requirements)Usage Examples:
implement story-user-api Task 1implement standalone-fix-auth Task 1Read Task File
↓
Read Constraints (constraints.md)
↓
Execute Step 1 → Verify → Pass? → Continue
↓
Fail → Fix → Retry
↓
Execute Step 2 → Verify → Pass? → Continue
↓
...
↓
Run Unit Tests
↓
Run Build Check
↓
Update Task File (mark AC completed, update status)
↓
Show Completion Summary
// ❌ Wrong: Ignore error handling pattern
const user = await db.users.findOne({ id });
// ✅ Right: Follow established patterns from constraints
const user = await userRepository.findById(id);
if (!user) throw new NotFoundError('User not found');
Each step has a Verify section - MUST run it and confirm expected output before moving on.
npm test [component]npm run build- [x]completed| Error Type | Action |
| -------------------- | -------------------------------------- |
| TypeScript error | Fix type issues, re-verify |
| Test failure | Debug test, fix implementation or test |
| Build failure | Check imports, fix errors |
| Constraint violation | Re-read constraints, align code |
After successful implementation, update the task file. Both story-based and standalone files use the same format, so the update process is identical:
1. Mark Task's Acceptance Criteria as Completed
## Task 1: Define Types
> **Status**: completed ← Changed from pending
### Acceptance Criteria
- [x] Types defined correctly ← Changed from [ ]
- [x] Exported from index ← Changed from [ ]
- [x] No type errors ← Changed from [ ]
2. Update Progress Section
## Progress
- Total tasks: 6
- Completed: 1 ← Changed from 0
- In progress: 0
- Pending: 5 ← Changed from 6
**Next task**: Task 2: Database Schema ← Update this
3. Update Story File Checkboxes (story-based only)
If this is a story-based task, update the PM story file at docs/reference/pm/stories/:
### Backend Tasks
- [x] Task 1: Define Types ← Changed from [ ]
- [ ] Task 2: Database Schema
- [ ] Task 3: Repository Layer
---
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
Write code before the test? Delete it. Start over.
RED → Verify Fails → GREEN → Verify Passes → REFACTOR → Repeat
test('UserService creates user with hashed password', async () => {
const userData = { email: 'test@example.com', password: 'password123' };
const user = await userService.create(userData);
expect(user.email).toBe('test@example.com');
expect(user.password).not.toBe('password123');
});
npm test -- --watch user.service
Write simplest code to pass the test. Don't add features not in test.
Only after green. Keep tests passing.
| Component Type | Required Tests |
| -------------- | ---------------------------------- |
| Service | Business logic, error handling |
| Repository | CRUD operations, query methods |
| Controller | Request handling, response format |
| Middleware | Request processing, error handling |
---
# User: "Implement story-user-api Task 1"
1. ✓ Read task: docs/reference/backend/tasks/story-user-api.md
2. ✓ Read constraints:
- constraints.md
3. ✓ Execute Step 1: Define data types
→ Run: npx tsc --noEmit
→ ✓ Pass
4. ✓ Execute Step 2: Create database schema
→ Run: npm run migrate
→ ✓ Pass
5. ✓ Execute Step 3: Implement repository layer
→ Run: npm test user.repository
→ ✓ Pass
6. ✓ Execute Step 4: Add unit tests
→ Run: npm test user
→ ✓ 5 tests passed
7. ✓ Run full test suite
→ Run: npm test
→ ✓ All tests passed
8. ✓ Run build
→ Run: npm run build
→ ✓ Build successful
9. ✓ Update task file:
- Marked all AC as completed
- Status: completed
10. ✓ Task completed!
NO CODE WITHOUT TASK FILE
This rule is non-negotiable. Before writing code:
| Excuse | Reality |
| ------------------------------ | ------------------------------------------- |
| "It's a simple change" | Simple changes often have hidden complexity |
| "I'll document after coding" | Post-hoc documentation is always incomplete |
| "Tests can wait until later" | Untested code is broken code |
| "I know what needs to be done" | Assumptions without validation cause bugs |
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.