cd /news/ai-agents/athallarizky-agentic-workflow Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-50747] src=gist.github.com β†— pub= topic=ai-agents verified=true sentiment=Β· neutral

athallarizky-agentic-workflow

A developer has published a structured workflow for running software projects with an AI agent, covering the entire process from PRD to production. The workflow includes phases for discovery, sprint planning, iterative development, and retro, with templates for documentation and task tracking. It aims to provide a reusable starting point for any project using AI agents.

read11 min views1 publishedJul 8, 2026

How to run a software project with an AI agent β€” from PRD to production. Use this as a starting point for any project.

PRD / Idea
    β”‚
    β–Ό
Phase 0 β€” Discovery & Exploration
    β”œβ”€β”€ Read existing docs, explore codebase
    β”œβ”€β”€ Ask clarifying questions (what's missing, what's ambiguous)
    β”œβ”€β”€ Check what exists vs what needs building
    └── Run any existing tools to study actual output/behavior
    β”‚
    β–Ό
Sprint Planning (docs/sprint-N/)
    β”œβ”€β”€ plan.md           β€” Sprint goal, scope, decisions, phasing
    β”œβ”€β”€ tasks.md          β€” Task breakdown + difficulty + dependencies + status
    β”œβ”€β”€ final-report.md   β€” Final sprint summary + handoff
    β”œβ”€β”€ AGENTS.md         β€” Delegation guide (for handing off to another LLM)
    └── resources/
        β”œβ”€β”€ architecture.md   β€” Tech stack decisions with pros/cons
        β”œβ”€β”€ data-design.md    β€” Data models, schemas, API contracts
        β”œβ”€β”€ ux-flow.md        β€” Screen designs, user journey (if UI)
        └── api-contract.md   β€” REST/API endpoints, request/response shapes
    β”‚
    β–Ό
Phase 1 β†’ Phase 2 β†’ ... β†’ Phase N
    Each phase:
    β”œβ”€β”€ 1. Build the code
    β”œβ”€β”€ 2. Test it (run it, verify output)
    β”œβ”€β”€ 3. Write a phase report (reports/phase-N-report.md)
    β”œβ”€β”€ 4. Update tasks.md (mark completed + add findings)
    β”œβ”€β”€ 5. Ask for commit confirmation
    └── 6. Commit + push
    β”‚
    β”œβ”€β”€ (when a gnarly bug burns >2 debug cycles) β†’ write an RCA
    β”‚   docs/sprint-N/rca/YYYY-MM-DD-<slug>.md
    β”‚
    β–Ό
Retro / Ideas
    └── docs/ideas/future-enhancements.md β€” backlog for post-MVP

Goal: Understand the problem, the existing codebase, and what needs building.

Read the PRDβ€” understand the goal, components, dependencies** Explore existing code**β€” check what's already built, what's missing** Run existing tools**β€” clone repos, build binaries, test with real data** Ask clarifying questions**β€” identify gaps, ambiguities, and decisions to make** Study real output**β€” run scrapers/APIs to understand actual data shapes

  • Are there existing repos that need to be cloned? Where?
  • What tech stack? Is it decided or needs discussion?
  • What's the monorepo structure?
  • What's the deployment target? Local? Cloud?
  • What data does the system produce/consume?
  • What's the MVP scope vs future enhancements?
docs/sprint-N/reports/phase-0-report.md

Containing:

  • Manual run instructions
  • Test results with real data
  • Data structure analysis
  • Key findings (surprises, limitations)
  • Decisions made

> Status: 🟑 Planning | Created: YYYY-MM-DD
> Companion: [`tasks.md`](./tasks.md) Β· previous: [`../sprint-<N-1>/final-report.md`](../sprint-<N-1>/final-report.md) Β· root [`../../AGENTS.md`](../../AGENTS.md)

---

## Context

<What already exists, what the previous sprint delivered, what this sprint builds on.>

## 1. Sprint goal

<One sentence describing what this sprint delivers.>

## 2. Scope

**In scope:**
- ...

**Out of scope:**
- ...

## 3. Key decisions

| Decision | Rationale |
|----------|-----------|

## 4. Phasing

- **Phase 0 β€” Discovery:** ...
- **Phase 1 β€” ...:** ...

> Status: 🟑 Planning | Created: YYYY-MM-DD
>
> Status legend: ⬜ pending | πŸ”΅ in_progress | βœ… completed | ❌ blocked

---

## Phase 1 β€” <Phase Name>

| ID   | Task                           | Difficulty | Dependencies | Status |
|------|--------------------------------|------------|-------------|--------|
| 1.1  | <Task description>             | Easy       | β€”           | ⬜     |
| 1.2  | <Task description>             | Medium     | 1.1         | ⬜     |
| 1.3  | <Task description>             | Hard       | 0.2, 1.2    | ⬜     |

### Service Summary

- **Runtime:** <Python/Node/Go>
- **Files:** `src/a.py`, `src/b.py`
- **Key output:** <what was produced>

> πŸ“„ Full report: [`reports/phase-1-report.md`](./reports/phase-1-report.md)

---

## Dependency Graph

Phase 0 ─────────────────────────────────────┐ 0.1 ──► 0.3 ──► 0.5 β”‚ 0.2 ──► 0.4 β”‚ β”‚ Phase 1 ──────────────────────────────────────── 0.2 ──► 1.1 ──► 1.2 ──► 1.5 β”‚

## Summary

| Phase        | Tasks | Est. Hours | Status |
|-------------|-------|-----------|--------|
| 0 β€” Setup   | 6     | 1h        | ⬜     |
| 1 β€” Core    | 5     | 4h        | ⬜     |
| **Total**   | **11** | **5h**    |        |

Rules:

  • Every task has an ID, difficulty (Easy/Medium/Hard), dependencies, and status
  • Status emoji: ⬜ πŸ”΅ βœ… ❌
  • Only one in_progress

at a time - Mark completed when tested AND working

  • Add a dependency graph showing the order
  • After each phase completes, add a "Service Summary" with key facts

## 1. Project Structure

project/ β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ service-a/ # β€” β”‚ └── service-b/ # β€” β”œβ”€β”€ api/ # Entry point β”œβ”€β”€ data/ # Shared data (gitignored) └── docs/

## 2. Tech Stack Decisions

### Decision Matrix

| Service    | Language | Key Libraries     | Why                           |
|-----------|----------|-------------------|-------------------------------|
| service-a | Node.js  | Fastify, Fuse.js  | <reason>                      |
| service-b | Python   | pandas            | <reason>                      |

### Why NOT Alternatives

| Rejected       | Reason                                |
|---------------|---------------------------------------|
| Python for X  | Would need to port existing library   |

## 3. Service Boundaries

### Service-A
- **Input:** <what it receives>
- **Output:** <what it produces>
- **Does NOT:** <responsibilities it avoids>

## 4. Key Architectural Decisions

### Decision 1: <Title>
**Decision:** <What we chose>
**Reasoning:**
- <Point 1>
- <Point 2>

Rules:

  • Always explain WHY, not just WHAT
  • Include rejected alternatives with reasons
  • Document service boundaries (what each service does NOT do)
  • Keep it concise β€” this is for agents to understand context, not a novel

## 1. Input Data Format

### Source: <API / scraper / CSV>
<description>

| Field      | Type   | Notes                |
|-----------|--------|----------------------|
| field_a   | string |                      |
| field_b   | int    |                      |

## 2. Data Pipeline

Raw Data β†’ [Stage 1] β†’ [Stage 2] β†’ Output

### Stage 1 β€” <Name>
- **Input:** <what>
- **Processing:** <how>
- **Output:** <what>

## 3. Output Schema

``` json
{
  "field": "value"
}
Field Type Indexed Notes
id str primary
embedding vector HNSW 1024-dim
**Rules:**
- Show the data at each pipeline stage
- Include actual schema definitions (not just descriptions)
- Note any quirks (duplicate keys, mixed casing, null handling)
- Document what gets embedded vs what goes to metadata

---

### `ux-flow.md` (UI Projects Only)

``` markdown

## 1. Navigation

Home (/) β†’ Search (/search) β†’ Settings (/settings)

## 2. Screen 1 β€” <Screen Name>
**Behavior:**

- <Error/empty states>

  1. User lands on Home
  2. User types query β†’ navigates to Search
  3. Results populate β†’ user filters
  4. User clicks item β†’ detail expands Rules:
  • ASCII wireframes are good enough β€” no Figma needed for agent understanding
  • Describe behavior, not just layout
  • Include all states: , empty, error, success
  • Show the happy path AND edge cases

final-report.md


> Status: βœ… Delivered | YYYY-MM-DD
> Audience: sprint-(N+1) context. Read this + [`AGENTS.md`](../../AGENTS.md) before starting sprint-(N+1).

---

## 1. Sprint goal & outcome

<What we set out to build and what was delivered.>

## 2. Final structure
| Item | Count | Notes |
|---|

| Decision | Rationale |
|---|

| Phase | Tasks | Status |
|---|

πŸ“„ Full reports:

`reports/`

<commands>


<What the next sprint needs to know β€” integration points, unresolved items, data dependencies.>

AGENTS.md (For Delegating to Another LLM)

This is the most critical document. It's a self-contained implementation guide.


> **For:** Any LLM agent implementing <project>.
> **Context:** <what was already built, what exists, what NOT to rebuild>

---

## 0. What Already Exists (Do NOT Rebuild)
**Endpoints ready to use:**

`POST /search`

β€”`GET /health`

β€”

| Layer | Technology |
|---|---|
| Frontend | Astro + React |
| Styling | Tailwind CSS |

<directory tree of files the agent must create>


<numbered list of steps, each with brief code snippet if critical>

Code snippet showing the exact pattern:

function ComponentName({ props }: Props) { // implementation hint } interface RequestType { ... } interface ResponseType { ... }


| Source | What to Copy |
|---|---|
| path/to/file | pattern to reuse |

| Reference | This Project | Why |
|---|

- Task 1
- Task 2

cd service && npm run dev


- <Checklist of what "done" looks like>

Rules for AGENTS.md:

  • Include EXACT code snippets for critical logic
  • List reference files the agent can copy-paste from
  • Include a numbered checklist β€” agents follow checklists better than prose
  • Mention what NOT to do (deviations from reference)
  • Include "Done Criteria" so the agent can self-validate

reports/phase-N-report.md (Per-Phase Report)


> Completed: YYYY-MM-DD

---

## 1. How to Run

``` bash
<exact commands to run this phase>
<diagram showing component layout>
Metric Value
... ...

| Decision | Reason | |---|

File Purpose
... ...
### `rca/YYYY-MM-DD-<slug>.md` (Root Cause Analysis)

Write one **whenever a non-trivial bug burns more than ~2 debug cycles** (or
anything in prod breaks) β€” not for trivial fixes, but for the gnarly ones where
"what we thought was the cause wasn't." File under the **current sprint** at
`docs/sprint-N/rca/YYYY-MM-DD-<short-slug>.md`.

```` markdown

> **Date:** YYYY-MM-DD Β· **Severity:** Low/Med/High Β· **Component:** <where>
> **Status:** βœ… Resolved

## 1. Summary
<2-3 sentences: what happened + the ACTUAL root cause, up top. No burying the lede.>

## 2. Impact
<who/what affected, data or prod impact, duration>

## 3. Symptoms (observed)
| Signal | Value |
|---|---|

## 4. Timeline
| # | Attempt | Outcome | Verdict |
|---|---------|---------|---------|
| 1 | <what we tried> | <result> | real fix / red herring / the cause |

## 5. Root cause
<The actual cause + evidence (file/line, sizes, logs). Be concrete.>

## 6. The fix
``` diff
- <before>
+ <after>

| Metric | Before | After | |---|

<misleading signals, red herrings, what masked the real cause>

  • <preventive change / process tweak>

<doc URLs, issue links, file paths>

**Rules for RCA:**
- **Lead with the root cause** in the Summary β€” don't make the reader wait.
- **Tag every Timeline row** (*real fix* / *red herring* / *the cause*) β€” the red herrings are the most valuable part for future-you.
- **Capture the symptom signature** (e.g., "X loads 200 but doesn't apply") so the same class of bug is recognizable next time.
- Write it **the same day**, while the debug trail is fresh.
- File under `docs/sprint-N/rca/YYYY-MM-DD-<slug>.md`

> **Note:** `architecture.md`, `data-design.md`, `ux-flow.md`, and `api-contract.md`
> live inside `docs/sprint-N/resources/`. Only `plan.md`, `tasks.md`,
> `final-report.md`, and `AGENTS.md` sit at the sprint root.

---

## 4. Communication Patterns

### Do

- **Ask before committing** β€” "Confirm and I'll commit"
- **Ask before design decisions** β€” "Here's my recommendation, thoughts?"
- **Break down tasks before building** β€” "Let me split this into smaller tasks"
- **Test immediately after building** β€” run the code, show the output
- **Update docs after every phase** β€” report + tasks.md update
- **Document findings, not just results** β€” what surprised you, what failed
- **Write an RCA for gnarly bugs** β€” if a bug burns >~2 debug cycles (or breaks prod), file `docs/sprint-N/rca/YYYY-MM-DD-<slug>.md`; lead with the root cause and tag red herrings

### Don't

- Never commit without confirmation
- Never assume a library is available β€” check first
- Never skip the "study real output" step in Phase 0
- Never leave broken tasks marked as βœ…
- Never skip writing the phase report
- **Never keep blind-guessing on a stuck bug** β€” after ~2 failed attempts, stop and read the actual docs/issues/canonical source, then write an RCA

---

## 5. Difficulty Levels

| Level  | Meaning                                          | Example                                    |
|--------|--------------------------------------------------|--------------------------------------------|
| Easy   | ≀30 min, no unknowns, mostly wiring             | "Add endpoint", "Create file structure"    |
| Medium | 1-2h, some design decisions, integration work   | "Build wrapper", "Normalize data"          |
| Hard   | 3h+, complex logic, multiple edge cases         | "Facility extraction", "SSE streaming"     |

---

## 6. Startup Checklist (New Project)

When starting a new project with this workflow:

1. [ ] Create the monorepo structure
2. [ ] Write the PRD or confirm existing one
3. [ ] Run Phase 0 β€” clone deps, test tools, study real output
4. [ ] Create `docs/sprint-1/` with all planning docs
5. [ ] Break tasks into phases with difficulty + dependencies
6. [ ] Start Phase 1 β€” build β†’ test β†’ report β†’ commit
7. [ ] After each phase, update `tasks.md` and write `reports/phase-N-report.md`
8. [ ] When delegating, create `AGENTS.md` with checklist + code snippets
9. [ ] After sprint, write `docs/ideas/future-enhancements.md` for backlog

---

## 7. Complete Directory Structure

project/ β”œβ”€β”€ docs/ β”‚ β”œβ”€β”€ prd.md # Original requirements β”‚ β”œβ”€β”€ ideas/ β”‚ β”‚ └── future-enhancements.md # Backlog for later β”‚ └── sprint-<N>/ β”‚ β”œβ”€β”€ plan.md # Sprint goal, scope, decisions, phasing β”‚ β”œβ”€β”€ tasks.md # Task breakdown + status β”‚ β”œβ”€β”€ final-report.md # Final sprint summary + handoff β”‚ β”œβ”€β”€ AGENTS.md # Delegation guide β”‚ β”œβ”€β”€ reports/ β”‚ β”‚ β”œβ”€β”€ phase-0-report.md # Discovery findings β”‚ β”‚ β”œβ”€β”€ phase-1-report.md # Per-phase reports β”‚ β”‚ └── ... β”‚ β”œβ”€β”€ resources/ β”‚ β”‚ β”œβ”€β”€ architecture.md # Tech decisions + structure β”‚ β”‚ β”œβ”€β”€ data-design.md # Schemas + pipelines β”‚ β”‚ β”œβ”€β”€ ux-flow.md # Screens + interaction (UI projects) β”‚ β”‚ └── api-contract.md # REST endpoints + shapes β”‚ └── rca/ # Root-cause analyses β”œβ”€β”€ services/ # Monorepo services β”œβ”€β”€ api/ # API layer β”œβ”€β”€ web/ # Frontend (if applicable) β”œβ”€β”€ data/ # Runtime data (gitignored) └── .gitignore


---
── more in #ai-agents 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/athallarizky-agentic…] indexed:0 read:11min 2026-07-08 Β· β€”