PROJECT 02

Task Management App

Full-stack with all 10 roles โ€” database, UI, auth, security, 2 sprints

โฑ ~90 min ยท 2 Sprints ยท Solo Mode ยท Intermediate

What's New in This Project

๐Ÿ†• Building on Project 01

Project 01 taught the core loop with 7 roles. This project adds the 3 remaining roles: ๐Ÿ—„๏ธ @dba for database schema design, ๐ŸŽจ @ux for accessible frontend, and ๐Ÿ›ก๏ธ @sec for security hardening. You'll also learn story splitting, sprint refinement, and mid-sprint status tracking.

All 10 Roles in Action

RoleWhat they do in this projectWhen
๐Ÿ“‹ @poCreates stories from your requirements, splits oversized stories, accepts completed workStory creation, sprint review, acceptance
๐Ÿ”„ @smFacilitates 2 sprints, tracks velocity across sprints, runs retrosSprint ceremonies
๐Ÿ—๏ธ @archEvaluates full-stack architecture (API + DB + frontend), checks architecture impact during refinementProject setup, sprint refinement
๐Ÿ‘จโ€๐Ÿ’ป @leadReviews code quality, assesses story feasibility during refinementCode review, sprint refinement
โŒจ๏ธ @devImplements auth, CRUD, frontend with TDDImplementation
๐Ÿงช @qaVerifies Definition of Done, checks coverage across 6 storiesDoD verification
๐Ÿš€ @devopsRuns CI pipeline, handles deployment of full-stack appCI/CD, deploy
๐Ÿ—„๏ธ @dbaDesigns users and tasks schema, writes migrations, validates foreign keys and indexesBefore coding starts
๐ŸŽจ @uxEnsures WCAG AA accessibility, keyboard navigation, responsive design on all formsFrontend stories
๐Ÿ›ก๏ธ @secScans dependencies for CVEs, reviews auth code for vulnerabilities, enforces password hashingSecurity review story

Phase 1: Project Setup (~5 min)

Same flow as Project 01 โ€” create the project, initialize memory, scaffold the stack. Abbreviated here.

Step 1: Tell Claude what you want to build

๐Ÿ’ฌ You say

"I want to build a task management web app with user auth, a web frontend, and a database. Users should register, log in, create/edit/delete tasks, organize by lists, and filter by status."

Step 2: @arch evaluates architecture โ€” /agile-explore-brainstorm

๐Ÿ’ฌ You type

/agile-explore-brainstorm I need a full-stack task management app: REST API with auth, a web frontend, and a relational database. Should support registration, login with JWT, and CRUD on tasks. Needs to be testable and deployable.

๐Ÿ—๏ธ @arch responds with a scoring matrix:

## /agile-explore-brainstorm โ€” Results

### Problem Statement
Full-stack task management app with auth, REST API,
relational DB, and web frontend. Constraints: testable,
deployable, JWT auth.

### Scoring Matrix

| Approach               | Feasibility | Maintainability | Performance | Risk | Total |
|------------------------|------------|-----------------|-------------|------|-------|
| Express + PostgreSQL   | 9/10       | 9/10            | 8/10        | 8/10 | 34    |
| + Vanilla HTML/CSS/JS  |            |                 |             |      |       |
| Fastify + PostgreSQL   | 8/10       | 8/10            | 9/10        | 7/10 | 32    |
| + React SPA            |            |                 |             |      |       |
| Django + PostgreSQL     | 8/10       | 9/10            | 7/10        | 8/10 | 32    |
| + Django Templates     |            |                 |             |      |       |
| Go + PostgreSQL        | 7/10       | 9/10            | 10/10       | 6/10 | 32    |
| + HTMX                 |            |                 |             |      |       |

### Recommendation
Express + PostgreSQL + Vanilla frontend scores highest.
Simple stack, easy to test, no build step for frontend.

### What Would Change This
- If you need rich interactivity โ†’ React SPA
- If you prefer Python โ†’ Django
- If performance is critical โ†’ Go + HTMX
โœ… You decide

"Let's go with Express + PostgreSQL + Vanilla HTML/CSS/JS. I want to keep the frontend simple."

Step 3: Scaffold and initialize

๐Ÿ’ฌ "Set up the Express + PostgreSQL project with a vanilla
   frontend, bcrypt for passwords, and JWT for auth.
   Then run /agile-setup-init."

โ†’ @dev scaffolds: package.json, src/, public/, db/migrations/
โ†’ /agile-setup-init scans and populates memory files

### Detected Stack
- Language: JavaScript (Node.js 20)
- Framework: Express 4.x
- Database: PostgreSQL 16
- Frontend: Vanilla HTML/CSS/JS (in public/)
- Auth: bcrypt + jsonwebtoken
- Test Framework: Jest + Supertest
- Package Manager: npm

/agile-setup-onboard    โ†’ Generates coding rules
/agile-setup-health     โ†’ โœ… All checks pass

Phase 1 complete. Scaffolded project, initialized memory, coding rules set. Zero features built yet โ€” Sprint 0 is about foundations.

Phase 2: Sprint 1 โ€” User Auth + Task CRUD

๐Ÿšซ Reminder

/agile-story-create does NOT invent features. You describe what you need, and @po structures it. This hasn't changed from Project 01.

Step 4: Create stories from YOUR requirements

๐Ÿ’ฌ You type

/agile-story-create Users need to register with email and password, with validation โ€” email must be unique, password at least 8 characters

๐Ÿ“‹ @po creates the story:

๐Ÿ“‹ @po responds:

## /agile-story-create โ€” Story Created

### Story US-001
**As a** new user,
**I want** to register with email and password,
**so that** I can create an account and start managing tasks.

### Acceptance Criteria

**AC-1: Happy path โ€” register with valid credentials**
- **Given** the API is running
- **When** I send POST /auth/register with
  {"email": "alice@example.com", "password": "securepass123"}
- **Then** I receive 201 with user ID and email (no password
  in response)

**AC-2: Edge case โ€” duplicate email**
- **Given** alice@example.com already exists
- **When** I send POST /auth/register with the same email
- **Then** I receive 409 with "email already registered"

**AC-3: Error case โ€” weak password**
- **Given** the API is running
- **When** I send POST /auth/register with
  {"email": "bob@example.com", "password": "123"}
- **Then** I receive 400 with "password must be at least
  8 characters"

### INVEST Check: โœ… All pass
### Estimate: 3 points
> Added to: .memory/backlog/product.md
๐Ÿ’ฌ You type

/agile-story-create Users need to log in and receive a JWT token for API access. Invalid credentials should return a clear error.

๐Ÿ“‹ @po responds:

### Story US-002 (3 pts)
**As a** registered user,
**I want** to log in with my email and password and receive
a JWT token,
**so that** I can authenticate subsequent API requests.

### Acceptance Criteria
- AC-1: Valid login returns 200 + JWT token
- AC-2: Wrong password returns 401 "invalid credentials"
- AC-3: Non-existent email returns 401 "invalid credentials"
  (same message โ€” no email enumeration)

### INVEST Check: โœ… All pass
> Added to: .memory/backlog/product.md
๐Ÿ’ฌ You type

/agile-story-create I need CRUD endpoints for tasks: create, list, update status, delete. Each task belongs to a user and requires auth. Tasks have a title, description, and status (pending/in-progress/done).

๐Ÿ“‹ @po responds:

### Story US-003 (13 pts) โš ๏ธ TOO LARGE
**As a** logged-in user,
**I want** to create, list, update, and delete tasks,
**so that** I can manage my work.

### INVEST Check
| Criterion   | Status |
|-------------|--------|
| Independent | โœ…     |
| Negotiable  | โœ…     |
| Valuable    | โœ…     |
| Estimable   | โœ…     |
| Small       | โŒ 13 pts exceeds 8 pt limit |
| Testable    | โœ…     |

โš ๏ธ Recommendation: Split this story. 13 points covers
4 distinct operations โ€” too much for one story.

Step 5: Split the oversized story โ€” /agile-story-split

๐Ÿ’ฌ You type

/agile-story-split US-003 --strategy workflow-steps

๐Ÿ“‹ @po splits US-003 into independently deliverable sub-stories:

๐Ÿ“‹ @po responds:

## /agile-story-split โ€” Results

### Original: US-003 (13 pts) โ€” RETIRED

### Split Strategy: workflow-steps
Each sub-story covers one workflow step that delivers
value independently.

---

### US-003a: Create task (3 pts)
**As a** logged-in user,
**I want** to create a new task with title and description,
**so that** I can track work I need to do.

**Acceptance Criteria:**
- AC-1: POST /tasks with valid JWT creates task โ†’ 201
- AC-2: Task is linked to authenticated user
- AC-3: Missing title โ†’ 400
- AC-4: No JWT โ†’ 401

**INVEST Check:**
| I | N | V | E | S | T |
|---|---|---|---|---|---|
| โœ… | โœ… | โœ… | โœ… | โœ… | โœ… |

---

### US-003b: List and filter tasks (2 pts)
**As a** logged-in user,
**I want** to list my tasks and filter by status,
**so that** I can focus on what matters now.

**Acceptance Criteria:**
- AC-1: GET /tasks returns only MY tasks โ†’ 200
- AC-2: GET /tasks?status=done filters correctly
- AC-3: No JWT โ†’ 401

**INVEST Check:**
| I | N | V | E | S | T |
|---|---|---|---|---|---|
| โœ… | โœ… | โœ… | โœ… | โœ… | โœ… |

---

### US-003c: Update and delete tasks (3 pts)
**As a** logged-in user,
**I want** to update a task's status and delete tasks,
**so that** I can track progress and clean up.

**Acceptance Criteria:**
- AC-1: PUT /tasks/:id updates status โ†’ 200
- AC-2: DELETE /tasks/:id removes task โ†’ 204
- AC-3: Updating/deleting another user's task โ†’ 403
- AC-4: Task not found โ†’ 404

**INVEST Check:**
| I | N | V | E | S | T |
|---|---|---|---|---|---|
| โœ… | โœ… | โœ… | โœ… | โœ… | โœ… |

---

### Split Summary
| Story  | Points | Status     |
|--------|--------|------------|
| US-003 | 13     | โŒ Retired |
| US-003a| 3      | โœ… Ready   |
| US-003b| 2      | โœ… Ready   |
| US-003c| 3      | โœ… Ready   |
| Total  | 8      | (was 13)   |

Splitting also refined the estimates โ€” total dropped from
13 to 8 because the uncertainty was in the combined scope.
โœ… Key Insight

Splitting isn't just about size โ€” it reduces uncertainty. The original 13-point estimate included risk padding for "too many unknowns in one story." Once split, each piece is clear and the total drops to 8 points.

Step 6: Estimate and plan Sprint 1

๐Ÿ’ฌ You type

/agile-story-estimate

## /agile-story-estimate โ€” Results

| Story   | Title                 | Points |
|---------|-----------------------|--------|
| US-001  | User registration     | 3      |
| US-002  | Login + JWT           | 3      |
| US-003a | Create task           | 3      |
| US-003b | List and filter tasks | 2      |
| US-003c | Update and delete     | 3      |

**Total backlog**: 14 points
๐Ÿ’ฌ You type

/agile-sprint-planning

๐Ÿ”„ @sm facilitates:

## Sprint Planning Output

### Sprint 1 Goal
"Deliver user registration, login, and full task CRUD
behind authentication"

### Sprint Backlog
| Story   | Title                 | Points | Priority |
|---------|-----------------------|--------|----------|
| US-001  | User registration     | 3      | P1       |
| US-002  | Login + JWT           | 3      | P1       |
| US-003a | Create task           | 3      | P1       |
| US-003b | List and filter tasks | 2      | P2       |
| US-003c | Update and delete     | 3      | P2       |

### Capacity Check
- Team velocity (first sprint): 14 points (aggressive)
- Committed this sprint: 14 points
- Capacity utilization: 100%

### Risks
- First sprint โ€” no historical velocity
- Auth stories must complete before task stories can
  be tested end-to-end

Step 7: ๐Ÿ—„๏ธ @dba designs the database schema

This is new! Before any coding starts, @dba designs the schema with migrations. In Project 01, the database was a simple SQLite file. Here, we need a proper relational schema with foreign keys, indexes, and migration scripts.

๐Ÿ’ฌ You say

"We need tables for users and tasks. Design the schema. Users have email and password. Tasks have title, description, status, and belong to a user."

๐Ÿ—„๏ธ @dba designs the full schema with migrations:

๐Ÿ—„๏ธ @dba responds:

## Database Schema Design

### Table: users
| Column        | Type          | Constraints                     |
|---------------|---------------|---------------------------------|
| id            | SERIAL        | PRIMARY KEY                     |
| email         | VARCHAR(255)  | UNIQUE, NOT NULL                |
| password_hash | VARCHAR(255)  | NOT NULL                        |
| created_at    | TIMESTAMPTZ   | NOT NULL DEFAULT NOW()          |

### Table: tasks
| Column      | Type          | Constraints                       |
|-------------|---------------|-----------------------------------|
| id          | SERIAL        | PRIMARY KEY                       |
| user_id     | INTEGER       | NOT NULL, FK โ†’ users(id) ON DELETE CASCADE |
| title       | VARCHAR(255)  | NOT NULL                          |
| description | TEXT          | NULLABLE                          |
| status      | VARCHAR(20)   | NOT NULL DEFAULT 'pending'        |
|             |               | CHECK (status IN ('pending',      |
|             |               |   'in-progress', 'done'))         |
| created_at  | TIMESTAMPTZ   | NOT NULL DEFAULT NOW()            |

### Indexes
- users(email) โ€” UNIQUE index (implicit from constraint)
- tasks(user_id) โ€” speeds up "list my tasks" queries
- tasks(user_id, status) โ€” composite for filtered queries

### Migration: UP (001_create_users_and_tasks.sql)
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  password_hash VARCHAR(255) NOT NULL,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE TABLE tasks (
  id SERIAL PRIMARY KEY,
  user_id INTEGER NOT NULL
    REFERENCES users(id) ON DELETE CASCADE,
  title VARCHAR(255) NOT NULL,
  description TEXT,
  status VARCHAR(20) NOT NULL DEFAULT 'pending'
    CHECK (status IN ('pending','in-progress','done')),
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE INDEX idx_tasks_user_id ON tasks(user_id);
CREATE INDEX idx_tasks_user_status
  ON tasks(user_id, status);

### Migration: DOWN
DROP TABLE IF EXISTS tasks;
DROP TABLE IF EXISTS users;

### Validation
| Check                  | Status |
|------------------------|--------|
| Reversibility (down)   | โœ… Clean drop in correct order    |
| Data types             | โœ… VARCHAR for bounded, TEXT for unbounded |
| Naming conventions     | โœ… snake_case, singular table names |
| Foreign keys           | โœ… ON DELETE CASCADE โ€” tasks removed with user |
| Indexes                | โœ… Covers primary query patterns   |
| Password storage       | โœ… Column is password_hash, not password |
โœ… Why @dba matters

@dba caught three things you might have missed: the composite index for filtered queries, the CHECK constraint on status values, and ON DELETE CASCADE so orphaned tasks don't pile up. Schema design before coding prevents painful migrations later.

Step 8: Build US-001 โ€” Registration (full loop)

๐Ÿ’ฌ You type

/agile-code-branch feature US-001 user-registration

โŒจ๏ธ @dev: Branch created
- Branch: feature/US-001-user-registration
- From: develop (up to date)
- Linked to: US-001
๐Ÿ’ฌ You type

/agile-story-plan US-001

๐Ÿ‘จโ€๐Ÿ’ป @lead: Implementation Plan for US-001

Phase 1: Run migration
- Execute 001_create_users_and_tasks.sql

Phase 2: Auth middleware
- JWT verification middleware for protected routes

Phase 3: Registration endpoint
- POST /auth/register route
- Hash password with bcrypt (cost 12)
- Check email uniqueness (handle DB constraint error)
- Return 201 with user ID + email (never return hash)

Phase 4: Validation
- Email format validation
- Password length check (min 8)
- Return 400 with specific error messages

Confidence: 9/10
๐Ÿ’ฌ You type

/agile-code-tdd US-001

๐Ÿ”ด RED โ€” Write failing test for AC-1

// test/auth.test.js
test('POST /auth/register creates user', async () => {
  const res = await request(app)
    .post('/auth/register')
    .send({ email: 'alice@example.com',
            password: 'securepass123' });

  expect(res.status).toBe(201);
  expect(res.body).toHaveProperty('id');
  expect(res.body.email).toBe('alice@example.com');
  expect(res.body).not.toHaveProperty('password');
  expect(res.body).not.toHaveProperty('password_hash');
});

// Result: โŒ FAIL โ€” route doesn't exist yet

๐ŸŸข GREEN โ€” Write minimum code to pass

// src/routes/auth.js
router.post('/register', async (req, res) => {
  const { email, password } = req.body;
  const hash = await bcrypt.hash(password, 12);
  const result = await db.query(
    'INSERT INTO users (email, password_hash) VALUES ($1, $2) RETURNING id, email',
    [email, hash]
  );
  res.status(201).json(result.rows[0]);
});

// Result: โœ… PASS

๐Ÿ”ต REFACTOR โ€” Extract to service layer

// Extract bcrypt + DB logic to UserService
// Tests still pass โœ…

โŒจ๏ธ @dev repeats Red โ†’ Green โ†’ Refactor for AC-2 (duplicate email โ†’ 409) and AC-3 (weak password โ†’ 400).

/agile-code-ci           โ†’ โœ… All green (8/8 tests pass)
/agile-code-commit       โ†’ feat(auth): add user registration endpoint
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved (Score: 9/10)
  (๐Ÿ”ต S3: consider adding email format validation with regex)
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE (coverage 91%)
/agile-story-accept      โ†’ โœ… ACCEPTED (3 points)

Step 9: Build US-002 โ€” Login + JWT (abbreviated)

US-002: Login + JWT (3 pts)

/agile-code-branch feature US-002 login-jwt
/agile-story-plan US-002
/agile-code-tdd US-002
  ๐Ÿ”ด Test: POST /auth/login with valid creds โ†’ 200 + token โ†’ โŒ
  ๐ŸŸข Implement: compare bcrypt hash, sign JWT โ†’ โœ…
  ๐Ÿ”ด Test: Wrong password โ†’ 401 "invalid credentials" โ†’ โŒ
  ๐ŸŸข Add check โ†’ โœ…
  ๐Ÿ”ด Test: Non-existent email โ†’ 401 (same message) โ†’ โŒ
  ๐ŸŸข Add check (no email enumeration) โ†’ โœ…
/agile-code-ci           โ†’ โœ… All green (14/14 tests)
/agile-code-commit       โ†’ feat(auth): add login endpoint with JWT
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved (Score: 8/10)
  (๐ŸŸก S2: JWT secret should come from env var, not hardcoded)
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (3 points)

Step 10: Build US-003a โ€” Create Task (abbreviated)

US-003a: Create task (3 pts)

/agile-code-branch feature US-003a create-task
/agile-story-plan US-003a
/agile-code-tdd US-003a
  ๐Ÿ”ด Test: POST /tasks with JWT creates task โ†’ โŒ
  ๐ŸŸข Implement route + JWT middleware โ†’ โœ…
  ๐Ÿ”ด Test: Task linked to authenticated user โ†’ โŒ
  ๐ŸŸข Extract user_id from JWT payload โ†’ โœ…
  ๐Ÿ”ด Test: No JWT โ†’ 401 โ†’ โŒ
  ๐ŸŸข Auth middleware rejects โ†’ โœ…

๐Ÿ—„๏ธ @dba reviews the task creation query:

๐Ÿ—„๏ธ @dba: Query Review
  โœ… Parameterized query ($1, $2, $3) โ€” no SQL injection
  โœ… user_id from JWT, not from request body
  โœ… RETURNING clause avoids extra SELECT
/agile-code-ci           โ†’ โœ… All green (20/20 tests)
/agile-code-commit       โ†’ feat(tasks): add create task endpoint
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (3 points)

Step 11: Build US-003b + US-003c (abbreviated)

US-003b: List and filter tasks (2 pts)

/agile-code-branch feature US-003b list-filter-tasks
/agile-story-plan US-003b
/agile-code-tdd US-003b
  ๐Ÿ”ด Test: GET /tasks returns only MY tasks โ†’ โŒ
  ๐ŸŸข WHERE user_id = $1 โ†’ โœ…
  ๐Ÿ”ด Test: GET /tasks?status=done filters โ†’ โŒ
  ๐ŸŸข Add optional WHERE clause โ†’ โœ…
/agile-code-ci           โ†’ โœ… All green
/agile-code-commit       โ†’ feat(tasks): add list and filter endpoints
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (2 points)

US-003c: Update and delete tasks (3 pts)

/agile-code-branch feature US-003c update-delete-tasks
/agile-story-plan US-003c
/agile-code-tdd US-003c
  ๐Ÿ”ด Test: PUT /tasks/:id updates status โ†’ โŒ
  ๐ŸŸข Implement update handler โ†’ โœ…
  ๐Ÿ”ด Test: DELETE /tasks/:id removes task โ†’ โŒ
  ๐ŸŸข Implement delete handler โ†’ โœ…
  ๐Ÿ”ด Test: Update another user's task โ†’ 403 โ†’ โŒ
  ๐ŸŸข Add ownership check โ†’ โœ…
  ๐Ÿ”ด Test: Task not found โ†’ 404 โ†’ โŒ
  ๐ŸŸข Add not-found check โ†’ โœ…
/agile-code-ci           โ†’ โœ… All green (32/32 tests)
/agile-code-commit       โ†’ feat(tasks): add update and delete endpoints
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved
  (๐ŸŸก S2: extract ownership check to reusable middleware)
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (3 points)

Step 12: Sprint 1 ceremonies

Daily standup โ€” /agile-sprint-daily

๐Ÿ’ฌ You type

/agile-sprint-daily

๐Ÿ”„ @sm: Daily Standup โ€” Sprint 1, Day 3

### Progress
- โœ… US-001 (Registration) โ€” ACCEPTED
- โœ… US-002 (Login + JWT) โ€” ACCEPTED
- ๐Ÿ”„ US-003a (Create task) โ€” IN PROGRESS (TDD phase)
- ๐Ÿ“‹ US-003b (List/filter) โ€” TODO
- ๐Ÿ“‹ US-003c (Update/delete) โ€” TODO

### Burndown
Day 1: 14 pts remaining
Day 2: 8 pts remaining (US-001 + US-002 done)
Day 3: 5 pts remaining (US-003a almost done)

### Blockers: None

Sprint status โ€” /agile-sprint-status

๐Ÿ’ฌ You type

/agile-sprint-status

๐Ÿ”„ @sm provides a mid-sprint dashboard:

๐Ÿ”„ @sm responds:

## /agile-sprint-status โ€” Sprint 1 Dashboard

### Sprint Health
| Metric            | Value          | Status |
|-------------------|----------------|--------|
| Sprint Goal       | Auth + CRUD API| ๐ŸŸข     |
| Days Elapsed      | 3 / 5         |        |
| Points Completed  | 9 / 14        | ๐ŸŸข     |
| Points Remaining  | 5              |        |
| Stories Done       | 3 / 5         |        |
| Burndown Trend    | On track       | ๐ŸŸข     |

### Story Status
| Story   | Title              | Pts | Status      |
|---------|--------------------|-----|-------------|
| US-001  | Registration       | 3   | โœ… Accepted  |
| US-002  | Login + JWT        | 3   | โœ… Accepted  |
| US-003a | Create task        | 3   | โœ… Accepted  |
| US-003b | List/filter tasks  | 2   | ๐Ÿ”„ In Progress |
| US-003c | Update/delete      | 3   | ๐Ÿ“‹ Todo      |

### Risks
- None โ€” on track to complete all stories

Sprint review โ€” /agile-sprint-review

๐Ÿ’ฌ You type

/agile-sprint-review

## Sprint 1 Review

### Sprint Goal: "Auth + Task CRUD API"
### Sprint Goal Met: โœ… Yes

| Story   | Title              | Pts | Status      |
|---------|--------------------|-----|-------------|
| US-001  | Registration       | 3   | โœ… Accepted  |
| US-002  | Login + JWT        | 3   | โœ… Accepted  |
| US-003a | Create task        | 3   | โœ… Accepted  |
| US-003b | List/filter tasks  | 2   | โœ… Accepted  |
| US-003c | Update/delete      | 3   | โœ… Accepted  |

### Velocity
- Committed: 14 points
- Completed: 14 points (100%)
- First sprint โ€” this becomes the baseline

### Demo Summary (โŒจ๏ธ @dev)
- Registration: POST /auth/register โ†’ 201
- Login: POST /auth/login โ†’ 200 + JWT
- Create task: POST /tasks (with JWT) โ†’ 201
- List tasks: GET /tasks?status=pending โ†’ 200
- Update: PUT /tasks/1 โ†’ 200
- Delete: DELETE /tasks/1 โ†’ 204
- All endpoints require auth except register/login

Retrospective โ€” /agile-sprint-retro

๐Ÿ’ฌ You type

/agile-sprint-retro

## Sprint 1 Retrospective

### What Went Well
- Story splitting reduced US-003 from 13 to 8 pts
- @dba schema design prevented migration issues
- TDD caught the email enumeration issue early (US-002)

### What To Improve
- No frontend yet โ€” users can't interact without curl
- JWT secret was hardcoded (caught in PR review)
- No security review done yet

### Action Items
| Action                        | Owner  | Due       |
|-------------------------------|--------|-----------|
| Move JWT secret to env var    | @dev   | Sprint 2  |
| Build frontend                | @dev   | Sprint 2  |
| Security review before ship   | @sec   | Sprint 2  |

Save learnings โ€” /agile-memory-learn

๐Ÿ”„ @sm: Learnings captured
  โ†’ Saved to: .memory/episodic/learnings.md
  - Sprint 1 velocity: 14 points
  - Story splitting effectiveness: 13 pts โ†’ 8 pts (3 stories)
  - @dba schema-first approach saved rework
  - Action items tracked for Sprint 2

Phase 3: Sprint 2 โ€” Frontend + Security

Step 13: Refine stories before planning โ€” /agile-sprint-refine

This is new! Before Sprint 2 planning, the team refines upcoming stories to make sure they're "Ready" โ€” clear enough to start immediately.

๐Ÿ’ฌ You type

/agile-sprint-refine

Multiple roles collaborate during refinement:

๐Ÿ“‹ @po + ๐Ÿ‘จโ€๐Ÿ’ป @lead + ๐Ÿ—๏ธ @arch respond:

## /agile-sprint-refine โ€” Refinement Session

### ๐Ÿ“‹ @po presents upcoming stories:
Three stories are candidates for Sprint 2:
1. Auth UI (login + registration forms)
2. Task dashboard (list, filter, create, edit, delete)
3. Security review (auth, data handling, dependencies)

### ๐Ÿ‘จโ€๐Ÿ’ป @lead assesses feasibility:
| Story      | Feasibility | Concerns                     |
|------------|-------------|------------------------------|
| Auth UI    | ๐ŸŸข High     | Straightforward forms        |
| Dashboard  | ๐ŸŸข High     | More complex but well-scoped |
| Security   | ๐ŸŸข High     | Review + fix, not new code   |

### ๐Ÿ—๏ธ @arch checks architecture impact:
- Auth UI: No backend changes โ€” consumes existing API
- Dashboard: No backend changes โ€” consumes existing API
- Security: May require backend fixes (depends on
  findings)
- Frontend files go in public/ โ€” no build step needed

### Refinement Outcome
| Story      | Previous Status | New Status  |
|------------|-----------------|-------------|
| Auth UI    | Unrefined       | โœ… Ready    |
| Dashboard  | Unrefined       | โœ… Ready    |
| Security   | Unrefined       | โœ… Ready    |

All 3 stories are Ready for Sprint 2 planning.

Step 14: Create Sprint 2 stories

๐Ÿ’ฌ You type

/agile-story-create I need a login page and registration form that works on mobile and is accessible โ€” proper labels, keyboard navigation, error messages visible to screen readers

๐Ÿ“‹ @po: Story US-004 created (5 pts)
**As a** user,
**I want** a login and registration page that is accessible
and works on mobile,
**so that** I can use the app from any device.

Acceptance Criteria:
- AC-1: Registration form with email, password, confirm password
- AC-2: Login form with email, password
- AC-3: Form validation with visible error messages
- AC-4: WCAG AA compliant (contrast, labels, focus)
- AC-5: Works on screens 320px and above
๐Ÿ’ฌ You type

/agile-story-create I need a task dashboard showing all tasks with filter by status and ability to create, edit, and delete tasks. Should be responsive.

๐Ÿ“‹ @po: Story US-005 created (5 pts)
**As a** logged-in user,
**I want** a task dashboard where I can see, filter, create,
edit, and delete tasks,
**so that** I can manage my work visually.

Acceptance Criteria:
- AC-1: Dashboard shows all user's tasks
- AC-2: Filter dropdown for status (all, pending, in-progress, done)
- AC-3: "New Task" button opens create form
- AC-4: Edit button on each task
- AC-5: Delete button with confirmation
- AC-6: Responsive layout (mobile โ†’ desktop)
๐Ÿ’ฌ You type

/agile-story-create The app needs a security review before we can ship โ€” check auth implementation, data handling, and dependencies for known vulnerabilities

๐Ÿ“‹ @po: Story US-006 created (3 pts)
**As a** product owner,
**I want** a security review of auth, data handling, and
dependencies,
**so that** we can ship with confidence.

Acceptance Criteria:
- AC-1: Dependency scan โ€” no critical CVEs
- AC-2: Auth code reviewed โ€” no credential leaks
- AC-3: All S0/S1 findings fixed and re-verified

Step 15: Sprint 2 planning

๐Ÿ’ฌ You type

/agile-sprint-planning

๐Ÿ”„ @sm facilitates:

## Sprint 2 Planning

### Sprint 2 Goal
"Deliver usable frontend with auth UI, task dashboard,
and pass security review"

### Sprint Backlog
| Story  | Title              | Pts | Priority |
|--------|--------------------|-----|----------|
| US-004 | Auth UI            | 5   | P1       |
| US-005 | Task dashboard     | 5   | P1       |
| US-006 | Security review    | 3   | P1       |

### Capacity Check
- Historical velocity (Sprint 1): 14 points
- Committed this sprint: 13 points
- Capacity utilization: 93%
- Buffer for security fixes: โœ… Available

Step 16: Build US-004 โ€” Auth UI with ๐ŸŽจ @ux

๐Ÿ’ฌ You type

/agile-code-branch feature US-004 auth-ui

โŒจ๏ธ @dev: Branch created
- Branch: feature/US-004-auth-ui
- From: develop (up to date)
- Linked to: US-004
๐Ÿ’ฌ You type

/agile-story-plan US-004

๐Ÿ‘จโ€๐Ÿ’ป @lead + ๐ŸŽจ @ux: Implementation Plan for US-004

Phase 1: HTML structure
- Semantic HTML: form, fieldset, label, input
- Registration form + login form (two pages or tabs)

Phase 2: CSS styling
- Mobile-first responsive design
- WCAG AA color contrast (4.5:1 minimum)
- Focus-visible styles for keyboard nav

Phase 3: JavaScript
- Form validation with aria-describedby for errors
- Fetch API calls to /auth/register and /auth/login
- Store JWT in memory (not localStorage โ€” XSS risk)
- Redirect to dashboard on success

Phase 4: Accessibility
- All inputs have associated labels
- Error messages linked with aria-describedby
- Focus management on form submission errors

Confidence: 8/10
๐Ÿ’ฌ You type

/agile-code-tdd US-004

โŒจ๏ธ @dev implements the auth UI with TDD. After implementation, ๐ŸŽจ @ux performs the accessibility review. This is the key new content:

๐ŸŽจ @ux: Accessibility Review โ€” US-004

## Accessibility Audit Report

### WCAG AA Compliance Checklist
| #  | Criterion                  | Status | Detail                          |
|----|----------------------------|--------|---------------------------------|
| 1  | Color contrast (text)      | โœ…     | 7.2:1 ratio (exceeds 4.5:1)    |
| 2  | Color contrast (UI)        | โœ…     | 4.8:1 ratio (exceeds 3:1)      |
| 3  | Keyboard navigation        | โœ…     | Tab order: email โ†’ password โ†’   |
|    |                            |        | confirm โ†’ submit. Logical flow. |
| 4  | Focus indicator visible    | โœ…     | 3px solid outline on :focus-    |
|    |                            |        | visible                         |
| 5  | Screen reader              | โœ…     | All inputs have <label for="">  |
|    |                            |        | Error messages use aria-        |
|    |                            |        | describedby + role="alert"      |
| 6  | Semantic HTML              | โœ…     | <form>, <fieldset>, <legend>,   |
|    |                            |        | <label>, <button type="submit"> |
| 7  | Form labels                | โœ…     | Every input has explicit label  |
| 8  | Error messages             | โœ…     | Inline, visible, linked to     |
|    |                            |        | input via aria-describedby      |
| 9  | Focus management           | โœ…     | On error: focus moves to first |
|    |                            |        | invalid field                   |
| 10 | No reliance on color alone | โœ…     | Errors use icon + text + color  |

### Responsive Verification
| Breakpoint | Layout         | Status |
|------------|----------------|--------|
| 320px      | Single column  | โœ…     |
| 768px      | Single column  | โœ…     |
| 1024px     | Centered card  | โœ…     |
| 1280px     | Centered card  | โœ…     |
| 1920px     | Centered card  | โœ…     |

### Overall Score: 10/10 โ€” WCAG AA Compliant
No accessibility issues found.
/agile-code-ci           โ†’ โœ… All green
/agile-code-commit       โ†’ feat(ui): add accessible auth pages
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved (Score: 9/10)
  ๐Ÿ‘จโ€๐Ÿ’ป @lead: Clean semantic HTML, good separation
  ๐ŸŽจ @ux: Accessibility checklist passed
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (5 points)

Step 17: Build US-005 โ€” Task Dashboard (abbreviated, with @ux)

US-005: Task Dashboard (5 pts)

/agile-code-branch feature US-005 task-dashboard
/agile-story-plan US-005
/agile-code-tdd US-005
  ๐Ÿ”ด Test: Dashboard renders task list โ†’ โŒ
  ๐ŸŸข Implement fetch + render โ†’ โœ…
  ๐Ÿ”ด Test: Filter dropdown filters tasks โ†’ โŒ
  ๐ŸŸข Add filter logic โ†’ โœ…
  ๐Ÿ”ด Test: Create task form submits โ†’ โŒ
  ๐ŸŸข Add create form + API call โ†’ โœ…
  ๐Ÿ”ด Test: Delete button removes task โ†’ โŒ
  ๐ŸŸข Add delete with confirmation โ†’ โœ…

๐ŸŽจ @ux: Accessibility Review โ€” US-005

### WCAG AA Compliance Checklist
| Criterion              | Status | Detail                        |
|------------------------|--------|-------------------------------|
| Color contrast         | โœ…     | All text meets 4.5:1          |
| Keyboard navigation    | โœ…     | Tab through tasks, filter,    |
|                        |        | action buttons                |
| Screen reader          | โœ…     | Task list uses role="list",   |
|                        |        | status changes announced      |
|                        |        | via aria-live="polite"        |
| Delete confirmation    | โœ…     | Dialog uses role="alertdialog"|
|                        |        | focus trapped inside          |
| Filter dropdown        | โœ…     | <select> with <label>         |

### Responsive Verification
| 320px | 768px | 1024px | 1280px | 1920px |
|-------|-------|--------|--------|--------|
| โœ…    | โœ…    | โœ…     | โœ…     | โœ…     |

Score: 10/10 โ€” Accessible
/agile-code-ci           โ†’ โœ… All green
/agile-code-commit       โ†’ feat(ui): add task dashboard with filters
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (5 points)

Step 18: Build US-006 โ€” Security Review with ๐Ÿ›ก๏ธ @sec

This is new! ๐Ÿ›ก๏ธ @sec performs two types of security checks: dependency scanning and code review.

๐Ÿ’ฌ You type

/agile-code-branch feature US-006 security-review

โŒจ๏ธ @dev: Branch created
- Branch: feature/US-006-security-review
- From: develop (up to date)
- Linked to: US-006

Dependency scan โ€” /agile-security-scan

๐Ÿ’ฌ You type

/agile-security-scan

๐Ÿ›ก๏ธ @sec responds:

## /agile-security-scan โ€” Dependency Audit

### Scan Summary
- Packages scanned: 147
- Direct dependencies: 12
- Transitive dependencies: 135

### Findings
| #  | Package        | Severity | CVE            | Finding                    | Fix                   |
|----|----------------|----------|----------------|----------------------------|-----------------------|
| 1  | lodash@4.17.20 | ๐Ÿ”ด HIGH  | CVE-2021-23337 | Prototype pollution via    | Upgrade to โ‰ฅ4.17.21  |
|    |                |          |                | template function          |                       |
| 2  | express@4.18.1 | ๐ŸŸก MED   | CVE-2024-29041 | Path traversal in static   | Upgrade to โ‰ฅ4.19.2   |
|    |                |          |                | file serving               |                       |

### Recommended Actions
1. npm audit fix (resolves both)
2. Add npm audit to CI pipeline
3. Pin major versions in package.json

### Post-Fix Verification
After fix: 0 vulnerabilities found โœ…

Auth code review โ€” /agile-security-review

๐Ÿ’ฌ You type

/agile-security-review

๐Ÿ›ก๏ธ @sec responds:

## /agile-security-review โ€” Code Audit

### Scope
Files reviewed: src/routes/auth.js, src/middleware/jwt.js,
src/services/UserService.js, public/js/auth.js

### Findings

| #  | Severity | File                    | Line | Finding                                | Recommendation                           |
|----|----------|-------------------------|------|----------------------------------------|------------------------------------------|
| 1  | ๐Ÿ”ด S0    | src/routes/auth.js      | 14   | Password stored as plain text in        | MUST use bcrypt.hash() before INSERT.    |
|    |          |                         |      | development seed script                 | Remove seed script or hash seed          |
|    |          |                         |      |                                        | passwords.                               |
| 2  | ๐ŸŸก S2    | src/routes/auth.js      | 28   | No rate limiting on POST /auth/login   | Add express-rate-limit: max 5            |
|    |          |                         |      |                                        | attempts per 15 minutes per IP.          |
| 3  | ๐ŸŸก S2    | src/middleware/jwt.js    | 7    | JWT expiry set to 30 days              | Reduce to 1 hour with refresh token,     |
|    |          |                         |      |                                        | or 24 hours without.                     |
| 4  | ๐Ÿ”ต S3    | public/js/auth.js       | 22   | JWT stored in localStorage             | Store in httpOnly cookie or memory       |
|    |          |                         |      |                                        | only. localStorage is XSS-accessible.   |

### Severity Summary
| Severity | Count | Action Required          |
|----------|-------|--------------------------|
| ๐Ÿ”ด S0   | 1     | MUST fix before release  |
| ๐ŸŸก S2   | 2     | SHOULD fix this sprint   |
| ๐Ÿ”ต S3   | 1     | COULD fix (improvement)  |

### Verdict: โŒ BLOCKED โ€” 1 S0 finding must be resolved
๐Ÿ”ด S0 Finding: Plain Text Passwords

The seed script inserts test users with unhashed passwords directly into the database. This is a critical security flaw โ€” if the seed script ever runs in production, passwords are exposed. @sec blocks the release until this is fixed.

Fix the S0 finding with TDD

๐Ÿ’ฌ You say

"Fix the S0 finding โ€” hash all passwords in the seed script. Use TDD."

โŒจ๏ธ @dev fixes with TDD:
  ๐Ÿ”ด Test: seed users have bcrypt-hashed passwords โ†’ โŒ
  ๐ŸŸข Update seed script to use bcrypt.hash() โ†’ โœ…
  ๐Ÿ”ด Test: seed users can log in โ†’ โŒ
  ๐ŸŸข Verify login works with hashed seed passwords โ†’ โœ…

Also fixes S2 findings:
  - Added express-rate-limit to login endpoint
  - Reduced JWT expiry to 24 hours

Re-review after fix

๐Ÿ’ฌ You type

/agile-security-review

๐Ÿ›ก๏ธ @sec: Re-review Results

| # | Previous Finding         | Status           |
|---|--------------------------|------------------|
| 1 | ๐Ÿ”ด S0: Plain text passwords | โœ… FIXED โ€” bcrypt |
| 2 | ๐ŸŸก S2: No rate limiting     | โœ… FIXED โ€” 5/15min|
| 3 | ๐ŸŸก S2: JWT 30-day expiry    | โœ… FIXED โ€” 24 hrs |
| 4 | ๐Ÿ”ต S3: localStorage JWT     | โณ Deferred      |

### Verdict: โœ… PASSED โ€” No S0/S1 findings remain
S3 finding accepted as known risk for v1.0.0.
/agile-code-ci           โ†’ โœ… All green
/agile-code-commit       โ†’ fix(security): hash seed passwords,
                           add rate limiting, reduce JWT expiry
/agile-code-pr           โ†’ PR created
/agile-code-pr-review    โ†’ โœ… Approved
  ๐Ÿ›ก๏ธ @sec: Security review passed
  ๐Ÿ‘จโ€๐Ÿ’ป @lead: Code quality good
/agile-code-merge        โ†’ Squash merged to develop
/agile-story-dod         โ†’ โœ… DONE
/agile-story-accept      โ†’ โœ… ACCEPTED (3 points)

Step 19: Sprint 2 ceremonies (abbreviated)

๐Ÿ’ฌ You type

/agile-sprint-status

๐Ÿ”„ @sm: Sprint 2 Dashboard
- Sprint Goal Met: โœ… Yes
- Points Completed: 13/13 (100%)
- All 3 stories accepted
๐Ÿ’ฌ You type

/agile-sprint-review

## Sprint 2 Review

### Sprint Goal: "Frontend + Security Review"
### Sprint Goal Met: โœ… Yes

| Story  | Title              | Pts | Status      |
|--------|--------------------|-----|-------------|
| US-004 | Auth UI            | 5   | โœ… Accepted  |
| US-005 | Task dashboard     | 5   | โœ… Accepted  |
| US-006 | Security review    | 3   | โœ… Accepted  |

### Velocity
- Sprint 1: 14 points
- Sprint 2: 13 points
- Average: 13.5 points/sprint
๐Ÿ’ฌ You type

/agile-sprint-retro

## Sprint 2 Retrospective

### What Went Well
- @ux caught accessibility issues during planning (not after)
- @sec found the plain text password flaw before release
- Story refinement made Sprint 2 planning fast

### What To Improve
- Should run /agile-security-scan earlier (Sprint 1)
- localStorage JWT deferred โ€” needs follow-up

### Action Items
| Action                          | Owner | Due     |
|---------------------------------|-------|---------|
| Move JWT to httpOnly cookie     | @dev  | v1.1.0  |
| Add /agile-security-scan to CI  | @devops| v1.1.0 |
๐Ÿ’ฌ You type

/agile-memory-learn

๐Ÿ”„ @sm: Learnings captured
  โ†’ Saved to: .memory/episodic/learnings.md
  - Sprint 2 velocity: 13 points
  - @sec caught S0 flaw โ€” validates security review step
  - @ux accessibility-first approach works better than
    retrofitting
  - Average velocity: 13.5 pts/sprint

Phase 4: Release

Step 20: Generate changelog โ€” /agile-ship-changelog

๐Ÿ’ฌ You type

/agile-ship-changelog

## Changelog: v1.0.0 โ€” 2026-04-04

### Added
- POST /auth/register โ€” user registration with
  validation (US-001)
- POST /auth/login โ€” JWT authentication (US-002)
- POST /tasks โ€” create task (US-003a)
- GET /tasks โ€” list tasks with status filter (US-003b)
- PUT /tasks/:id โ€” update task status (US-003c)
- DELETE /tasks/:id โ€” delete task (US-003c)
- Login and registration UI โ€” accessible, responsive
  (US-004)
- Task dashboard UI โ€” filter, create, edit, delete
  (US-005)

### Security
- Dependency audit โ€” 0 vulnerabilities (US-006)
- Password hashing with bcrypt (cost 12)
- Rate limiting on login endpoint (5/15min)
- JWT expiry reduced to 24 hours

Step 21: Cut release โ€” /agile-ship-release

๐Ÿ’ฌ You type

/agile-ship-release v1.0.0

๐Ÿš€ @devops: Release v1.0.0
  Branch: release/v1.0.0 from develop
  CI: โœ… Green (all 48 tests pass)
  Merged to main โœ…
  Tagged: v1.0.0 โœ…
  Back-merged to develop โœ…

Step 22: Deploy โ€” /agile-ship-deploy

๐Ÿ’ฌ You type

/agile-ship-deploy

๐Ÿš€ @devops: Deployed v1.0.0
  Database migration: โœ… Applied
  API health check: โœ… /health โ†’ 200
  Frontend served: โœ… Static files at /
  Smoke tests: โœ… Register โ†’ Login โ†’ Create task โ†’ List โ†’ Done

What You Built

MetricValue
Sprints completed2
Stories completed8/8 (including 3 from split)
Story points delivered27 (Sprint 1: 14, Sprint 2: 13)
Sprint goals metโœ… Both
Release versionv1.0.0
Test count48 tests
Security findings fixed3 (1 S0, 2 S2)
Accessibility scoreWCAG AA compliant
Roles involvedAll 10: @po, @sm, @arch, @lead, @dev, @qa, @devops, @dba, @ux, @sec

Commands New in This Project

These commands were used here but NOT in Project 01:

CommandWhat It DoesWhere Used
โœ… /agile-story-splitSplits oversized stories into independently deliverable sub-storiesUS-003 โ†’ US-003a/b/c
โœ… /agile-sprint-refineRefines upcoming stories to "Ready" status before planningBefore Sprint 2 planning
โœ… /agile-sprint-statusShows mid-sprint dashboard with burndown, story statusesDuring Sprint 1 and Sprint 2
โœ… /agile-security-scanScans dependencies for known CVEsUS-006 security review
โœ… /agile-security-reviewReviews code for security vulnerabilitiesUS-006 security review
โœ… Key Takeaway

All 10 roles contributed. ๐Ÿ—„๏ธ @dba designed the schema before a single line of code was written โ€” proper foreign keys, indexes, and migrations prevented rework. ๐ŸŽจ @ux ensured every form is accessible โ€” keyboard navigation, screen reader support, responsive down to 320px. ๐Ÿ›ก๏ธ @sec caught a critical password storage flaw before it shipped โ€” plain text passwords in the seed script would have been a real vulnerability.

Each role has a specific job โ€” and together they produce software that's correct, secure, accessible, and well-structured. The framework doesn't add ceremony for ceremony's sake. Every check exists because it catches real problems.

๐Ÿง  Knowledge Check

What does @dba do before coding starts?

๐Ÿง  Knowledge Check

What does @ux check that @lead doesn't?

๐Ÿง  Knowledge Check

Why did US-003 need splitting?