Agentic Architect 101

Synaptic AI Consulting

Hands-On Mini-Project - Build Phase

Module 06: Hands-On Mini-Project - Build Phase

Estimated time: ~45 minutes
Outcome: Execute a Tier-0 Build phase using the Development Crew to transform PRD into working code
Framework version: AAMAD v0.7.5 (simplified path — see CHECKLIST.md for the full workflow)


Learning Objectives

By the end of this module, you will be able to:


Prerequisites


Build Phase Overview

The Build phase transforms your PRD into working software through coordinated multi-agent execution. As an Agentic Architect, you’ll wear your Technical Hat to orchestrate the Development Crew, ensuring:

Tier-0 Development Crew order (simplified):

  1. @system.arch — Creates project-context/1.define/sad.md
  2. @backend.eng — Implements Application Crew → backend.md (core of this mini-project)
  3. @frontend.eng — Builds minimal UI → frontend.md
  4. @integration.eng — Wires components → integration.md
  5. @qa.eng — Smoke tests → qa.md

Note: Full AAMAD projects also use @project.mgrsetup.md and recommended @security.engsecurity.md. This Tier-0 path folds env/scaffold into Step 1 below. Optionally run aamad validate --phase build after QA.


Step 1: Configure Environment Variables

Before starting development, configure the required environment variables.

Create .env File

  1. In your project root, create a .env file:

    cd ~/projects/recruitment-assistant
    touch .env
    
  2. Add the following environment variables:

    # OpenAI API Configuration
    OPENAI_API_KEY=your_openai_api_key_here
       
    # Optional: Use your preferred model
    OPENAI_MODEL=gpt-4o
       
    # AAMAD runtime target (default for this course)
    AAMAD_TARGET_RUNTIME=crewai
       
    # Application Configuration
    APP_NAME=Recruitment Assistant
    APP_ENV=development
       
    # CrewAI Configuration (if needed)
    CREWAI_TELEMETRY_OPT_OUT=true
    
  3. Important: Add .env to .gitignore to avoid committing secrets:

    echo ".env" >> .gitignore
    
  4. Create a .env.example file as a template (commit this, not .env):

    cp .env .env.example
    # Edit .env.example to remove actual API keys, replace with placeholders
    

Verify Environment Setup

Test that your environment variables are accessible:

# In Python
python -c "import os; from dotenv import load_dotenv; load_dotenv(); print('API Key set:', bool(os.getenv('OPENAI_API_KEY'))); print('Runtime:', os.getenv('AAMAD_TARGET_RUNTIME'))"

Note: You may need to install python-dotenv:

pip install python-dotenv

Full projects: Invoke @project.mgr with *setup-project to scaffold directories, install dependencies, and document everything in project-context/2.build/setup.md. For Tier 0, the manual .env setup above is enough.


Step 2: System Architect - Create Solution Architecture Document (SAD)

The System Architect designs the technical architecture based on your PRD.

2.1 Create Architecture Branch

git checkout -b feature/architecture

2.2 Invoke System Architect Persona

Start a NEW chat session (this is important for context isolation):

  1. Open a new chat in Cursor (or your AI assistant)
  2. Reference the System Architect persona:

    @system.arch
       
    I need you to create a Solution Architecture Document (SAD) for the 
    recruitment assistant application. Please:
       
    1. Review the PRD: project-context/1.define/prd.md
    2. Create a comprehensive SAD using the template: .cursor/templates/sad-template.md
       (or run *create-sad / *create-sad --mvp)
    3. Design the architecture for:
       - Application Crew (Researcher, Evaluator, Recommender agents using CrewAI)
       - Frontend interface (simple web UI or CLI)
       - Backend API (FastAPI or Flask)
       - Integration points
    4. Set / confirm AAMAD_TARGET_RUNTIME=crewai and record it in the SAD Audit section
    5. Save the SAD as: project-context/1.define/sad.md
    

2.3 Review and Iterate

Wearing your Technical Hat, review the SAD:

If adjustments are needed:

2.4 Validate and Commit

Once the SAD is complete and reviewed:

git add project-context/1.define/sad.md
git commit -m "feat: Add Solution Architecture Document (SAD)

- System Architect created comprehensive SAD
- Runtime target crewai recorded in Audit
- Architecture reviewed and approved"

2.5 Merge to Main

git checkout main
git merge feature/architecture
git branch -d feature/architecture

Step 3: Backend Engineer - Implement Application Crew (core)

The Backend Engineer implements the Application Crew and backend services. For this mini-project, do backend first—the Application Crew is the product’s intelligence.

3.1 Create Backend Branch

git checkout -b feature/backend

3.2 Invoke Backend Engineer Persona

Start a NEW chat session:

@backend.eng

I need you to implement the backend for the recruitment assistant. Please:

1. Review the PRD: project-context/1.define/prd.md
2. Review the SAD: project-context/1.define/sad.md
3. Follow adapter-crewai conventions (AAMAD_TARGET_RUNTIME=crewai)
4. Implement the Application Crew using CrewAI:
   - Researcher Agent
   - Evaluator Agent
   - Recommender Agent
5. Implement API endpoints (FastAPI or Flask)
6. Document all work in: project-context/2.build/backend.md
   (use *develop-be if available)

3.3 Review Backend Artifact

Review project-context/2.build/backend.md:

Iterate with @backend.eng if needed.

3.4 Implementation

The Backend Engineer will:

Key Implementation Notes:

3.5 Review Implementation

Wearing your Technical Hat, review:

3.6 Validate and Commit

git add project-context/2.build/backend.md src/backend/ src/
git commit -m "feat: Add backend implementation

- Backend Engineer implemented Application Crew (CrewAI)
- API endpoints created
- backend.md documented"

3.7 Merge to Main

git checkout main
git merge feature/backend
git branch -d feature/backend

Step 4: Frontend Engineer - Build UI Components

The Frontend Engineer creates a minimal user interface for the recruitment assistant.

4.1 Create Frontend Branch

git checkout -b feature/frontend

4.2 Invoke Frontend Engineer Persona

Start a NEW chat session:

@frontend.eng

I need you to build the frontend for the recruitment assistant. Please:

1. Review the PRD: project-context/1.define/prd.md
2. Review the SAD: project-context/1.define/sad.md
3. Implement a simple web interface (HTML/CSS/JS or React) or CLI interface
4. Document decisions and status in: project-context/2.build/frontend.md
   (use *develop-fe if available)

4.3 Review and Implement

Review frontend.md and the code:

git add project-context/2.build/frontend.md src/frontend/
git commit -m "feat: Add frontend implementation

- Frontend Engineer created UI components
- UI matches PRD requirements
- frontend.md documented"
git checkout main
git merge feature/frontend
git branch -d feature/frontend

Step 5: Integration Engineer - Wire Up Components

The Integration Engineer connects frontend, backend, and external services.

5.1 Create Integration Branch

git checkout -b feature/integration

5.2 Invoke Integration Engineer Persona

Start a NEW chat session:

@integration.eng

I need you to integrate all components of the recruitment assistant. Please:

1. Review the PRD: project-context/1.define/prd.md
2. Review the SAD: project-context/1.define/sad.md
3. Review: project-context/2.build/frontend.md
4. Review: project-context/2.build/backend.md
5. Wire frontend to backend API and verify a basic round-trip
6. Document integration and known issues in: project-context/2.build/integration.md
   (use *integrate-api if available)

5.3 Review Integration

Wearing your Technical Hat, verify:

git add project-context/2.build/integration.md
git commit -m "feat: Integrate frontend and backend components

- Integration Engineer wired up all components
- End-to-end data flow verified
- integration.md documented"
git checkout main
git merge feature/integration
git branch -d feature/integration

Step 6: QA Engineer - Smoke Test End-to-End

The QA Engineer ensures the MVP works for the core flow.

6.1 Create QA Branch

git checkout -b feature/qa

6.2 Invoke QA Engineer Persona

Start a NEW chat session:

@qa.eng

I need you to smoke-test the recruitment assistant application. Please:

1. Review the PRD: project-context/1.define/prd.md
2. Review the SAD: project-context/1.define/sad.md
3. Review: project-context/2.build/frontend.md, backend.md, integration.md
4. Run smoke / acceptance checks on the main chat/recruitment flow
5. Log issues, known gaps, and future work in: project-context/2.build/qa.md
   (use *qa / *verify-flow if available)

Go deeper (optional): Full AAMAD QA includes *test-unit and *test-integration with AC-* traceability. For Tier 0, a documented smoke pass is enough.

6.3 Fix Issues and Commit

If issues are found:

  1. Create a fix branch: git checkout -b fix/issue-description
  2. Work with the appropriate engineer persona to fix
  3. Re-test with @qa.eng
  4. Commit fixes and merge to main
git add project-context/2.build/qa.md
git commit -m "feat: Add QA smoke test results

- QA Engineer executed smoke tests
- Test results documented in qa.md
- Application validated against PRD MVP scope"
git checkout main
git merge feature/qa
git branch -d feature/qa

Optional quality gate:

aamad validate --phase build

Step 7: Final Review and Documentation

7.1 Review All Artifacts

As an Agentic Architect, review all Build phase artifacts:

7.2 Update Project README

Update your project README with:

7.3 Final Commit

git add README.md
git commit -m "docs: Update README with Build phase completion

- All Build phase artifacts complete
- Application ready for Deliver phase"

Exercise Summary

Complete the Build phase by:

  1. ✅ Configure environment variables (.env with AAMAD_TARGET_RUNTIME=crewai)
  2. @system.arch: Create SAD in 1.define/sad.md
  3. @backend.eng: Implement Application Crew and backend.md
  4. @frontend.eng: Build UI and frontend.md
  5. @integration.eng: Wire components and integration.md
  6. @qa.eng: Smoke test and qa.md
  7. ✅ Review all artifacts and update documentation

Key Practices Applied:


Deliverables

By the end of this module, you should have:

  1. .env file configured (not committed) with AAMAD_TARGET_RUNTIME=crewai
  2. .env.example template (committed)
  3. project-context/1.define/sad.md — Solution Architecture Document
  4. project-context/2.build/backend.md — Backend / Application Crew notes
  5. project-context/2.build/frontend.md — Frontend notes
  6. project-context/2.build/integration.md — Integration notes
  7. project-context/2.build/qa.md — QA smoke results
  8. ✅ Working frontend code
  9. ✅ Working backend code with Application Crew
  10. ✅ Integrated application
  11. ✅ All code committed and merged to main
  12. ✅ Updated README.md

Check Your Understanding

  1. Why use independent chat sessions for each persona?
    • What happens if you use the same chat session for all personas?
  2. Why use canonical artifacts (backend.md, qa.md) instead of chat memory?
    • How do these enable asynchronous development and handoffs?
  3. Why use git branches for each step?
    • What are the benefits of incremental commits and merges?
  4. How does the Technical Hat help in the Build phase?
    • What decisions do you make as an Agentic Architect that the personas don’t?
  5. What does AAMAD_TARGET_RUNTIME=crewai control?
    • What does it not change about Define → Build → Deliver?

Troubleshooting

Issue: Environment variables not loading

Issue: Agent persona not following instructions

Issue: Git merge conflicts

Issue: Application Crew agents not working

Issue: Frontend can’t connect to backend


Best Practices Applied

Throughout this module, you’ve applied key software development best practices:

  1. Single Responsibility Principle: Each persona has one clear job
  2. Incremental Development: Build in small, validated steps
  3. Context Isolation: Independent chat sessions prevent context pollution
  4. Documentation: Canonical artifacts under project-context/
  5. Version Control: Git branches enable safe experimentation
  6. Quality Gates: Review and validation at each step
  7. Asynchronous Work: Artifacts enable parallel development

Next Steps

Once the Build phase is complete:

  1. Review all artifacts - Ensure everything is documented
  2. Test the application - Run it end-to-end
  3. Commit all work - Ensure main branch is up to date
  4. Proceed to Module 07 - Deliver phase (@devops.engdeploy.md)

Continue to Module 07: Hands-On Mini-Project - Deliver Phase


Additional Resources