TUTORIAL 01

Project Setup

Initialize the agile workflow framework in an existing project and verify everything works

⏱ ~10 min · Hands-on

What You'll Learn

By the end of this tutorial, your project will have a fully configured agile workflow with auto-detected conventions, populated memory files, and a clean health check.

/agile-setup-init /agile-setup-onboard /agile-setup-health Memory Files Convention Detection
Prerequisites

The Scenario

You've just started working on TaskFlow β€” a Node.js/Express REST API backed by PostgreSQL with Jest for testing. The codebase exists but has no structured workflow. You want to bring in the agile framework so your AI assistant understands the project's architecture, conventions, and can help you ship features efficiently.

Step 1: Copy the Framework into Your Project

The agile workflow lives inside a .claude/ directory at your project root. Copy the framework files there:

cp -r agile/* your-project/.claude/

This gives you the command definitions, memory templates, and workflow protocols. The memory files start as templates β€” the next step fills them in automatically.

What gets copied?

The .claude/ directory contains: command definitions (setup, sprint, story, code, ship, memory), empty memory templates, and the workflow engine configuration. No project files are modified.

Step 2: Run /agile-setup-init

This is the most important command. It scans your entire codebase and populates all memory files with real information about your project.

/agile-setup-init

The AI analyzes your project and produces output like this:

πŸ” Scanning project structure...

Detected stack:
  Runtime:    Node.js 20.x
  Framework:  Express 4.18
  Database:   PostgreSQL 15 (via pg + knex)
  Testing:    Jest 29 + supertest
  Linting:    ESLint + Prettier
  CI/CD:      GitHub Actions

Detected patterns:
  Architecture:  Controller β†’ Service β†’ Repository (3-layer)
  API style:     RESTful, versioned (/api/v1/*)
  Auth:          JWT with refresh tokens
  Error handling: Centralized middleware (errorHandler.js)

πŸ“ Populating memory files...
  βœ… .memory/semantic/project.md     β€” name, description, tech stack
  βœ… architecture.md        β€” 3-layer architecture, data flow
  βœ… conventions.md         β€” naming, imports, error patterns
  βœ… .memory/semantic/codebase.md    β€” 47 files mapped across 12 directories
  βœ… testing.md             β€” Jest config, coverage thresholds
  βœ… deployment.md          β€” GitHub Actions β†’ AWS ECS
  βœ… .memory/semantic/conventions.md  β€” naming, imports, error patterns, commit conventions
  βœ… .memory/semantic/domain/api.md  β€” 14 endpoints documented
  βœ… .memory/semantic/domain/database.md β€” 8 tables, relationships mapped

βœ… Setup complete β€” 10 memory files populated.
What just happened?

The AI read every file in your project β€” source code, configs, package.json, Dockerfiles, CI configs, SQL migrations β€” and extracted structured knowledge into memory files. This is how it "understands" your project without you explaining everything manually.

Step 3: Review What Was Created

Open .memory/MEMORY_INDEX.md to see the summary of all memory files:

## Memory Index

| File | Summary | Last Verified |
|------|---------|---------------|
| .memory/semantic/project.md | TaskFlow: REST API for task management. Node/Express/PostgreSQL. | 2026-04-04 |
| .memory/semantic/architecture.md | 3-layer (Controller→Service→Repository). JWT auth. Centralized errors. | 2026-04-04 |
| .memory/semantic/conventions.md | camelCase, ESM imports, async/await, Prettier enforced. GitFlow branch strategy. Conventional commits. | 2026-04-04 |
| .memory/semantic/codebase.md | 47 files. src/{controllers,services,repositories,middleware,utils}. | 2026-04-04 |
| .memory/semantic/testing.md | Jest 29. Unit + integration. 80% coverage threshold. | 2026-04-04 |
| .memory/semantic/deployment.md | GitHub Actions β†’ Docker β†’ AWS ECS. Staging + production. | 2026-04-04 |
| .memory/episodic/decisions.md | ADR-001: chose Knex over Prisma. ADR-002: JWT over sessions. | 2026-04-04 |
Memory = source of truth

Every future command reads from these memory files. When the AI plans a feature, it knows your architecture. When it writes code, it follows your conventions. When it creates a PR, it uses your branch strategy. Keep memory files accurate.

Step 4: Run /agile-setup-onboard

This command generates project-specific coding rules from your codebase patterns:

/agile-setup-onboard
πŸ“‹ Generating project conventions...

Naming:
  Variables/functions: camelCase
  Classes:            PascalCase
  Files:              kebab-case.js
  DB columns:         snake_case

Import order:
  1. Node built-ins (path, fs, crypto)
  2. External packages (express, knex, joi)
  3. Internal modules (relative paths)

Error handling:
  Pattern:   async/await with try-catch
  Errors:    Extend AppError base class
  HTTP codes: Mapped via errorHandler middleware

Testing:
  Unit tests:        *.test.js next to source
  Integration tests: __tests__/integration/
  Naming:            describe('ClassName') β†’ it('should_do_thing')

βœ… Conventions saved to .memory/semantic/conventions.md
Why this matters

Without onboarding, the AI might write code using different patterns than your team uses β€” wrong naming, wrong file locations, wrong error handling. After onboarding, every generated line of code matches your existing style.

Step 5: Run /agile-setup-health

Verify everything is configured correctly with a health check:

/agile-setup-health
πŸ₯ Agile Workflow Health Check
═══════════════════════════════

Memory Files:
  βœ… .memory/semantic/project.md     β€” current (verified today)
  βœ… .memory/semantic/architecture.md β€” current (verified today)
  βœ… .memory/semantic/conventions.md β€” current (verified today)
  βœ… .memory/semantic/codebase.md    β€” current (verified today)
  βœ… .memory/semantic/testing.md     β€” current (verified today)
  βœ… .memory/semantic/deployment.md  β€” current (verified today)
  βœ… .memory/episodic/decisions.md  β€” current (verified today)

Framework:
  βœ… All command files present (43/43)
  βœ… Workflow definitions intact
  βœ… No orphaned memory references

Overall: βœ… HEALTHY β€” All systems operational.
When health checks fail

If you see a ⚠️ stale warning (file not verified in 30+ days) or a ❌ missing file, re-run /agile-setup-init to refresh. After major refactors, always run /agile-setup-health to catch drift between code and memory.

The Setup Flow

πŸ“
Copy Framework cp -r agile/* .claude/
πŸ”
/agile-setup-init Scan & populate memory
πŸ“‹
/agile-setup-onboard Generate conventions
πŸ₯
/agile-setup-health Verify everything

Knowledge Check

What is the first command to run after copying the framework into your project?

What You Learned