Skip to content

The AI-Augmented "Docs as Code" Workflow

Document Version: 1.0
Date: 2025-09-10

1. Introduction & Vision

This document outlines the standardized, AI-augmented software development lifecycle (SDLC) for this project. It is designed to fulfill the vision of using a generative AI model as a core assistant for every role in the development team, as detailed in the project's README.md.

Our guiding principle is AI as a Co-pilot, Not an Autopilot. Human experts define the why, what, and how, while the AI agent accelerates the implementation. This workflow treats all project artifacts—requirements, technical specifications, test plans, and executable tasks—as version-controlled code, creating a single, cohesive, and intelligent development environment.

2. Core Artifacts & Their Roles

This workflow relies on a set of version-controlled artifacts, each with a distinct purpose.

Artifact Location Purpose & Role Owner(s)
GitHub Issue GitHub UI Human-Facing Task Hub: The starting point for any feature. Used for high-level tracking, discussion, and linking all related work. BA, SA
Feature Docs docs/features/ The "WHY" & "WHAT": Contains the BRD, Use Cases, and Test Plan. Defines the business goals and testing requirements. BA, QA
System Specs (TRD) docs/system_spec/ The Target State: The technical blueprint. Describes the final, desired state of the system's architecture (DB schema, API contracts). SA
AI Task File tasks/ The Machine-Readable "HOW": A structured YAML file that provides the AI agent with explicit, step-by-step instructions for implementation. SA
Pull Request (PR) GitHub UI Human Review Workspace: The collaborative space where the team reviews, refines, and approves the AI agent's generated code and document changes. Developer

3. The End-to-End Feature Lifecycle

This section details the step-by-step process for developing a new feature, from ideation to production deployment.

Phase 1: Human-Led Planning & AI Instruction (Days 1-3)

Goal: To translate a business need into a complete, machine-readable set of instructions for the AI agent.

Step Role Action Input(s) Output(s)
1.1 BA Initiate Feature: Creates a GitHub Issue for the new feature (e.g., #123). Creates a corresponding Git branch (feature/123-name). Business Need GitHub Issue; Git Branch
1.2 BA Define "WHY": Commits the BRD and Use Case documents to the feature branch. GitHub Issue docs/features/\<feature-name>/index.md, use_case.md
1.3 SA Define Target State: Checks out the branch and commits the necessary changes to the TRD files to reflect the feature's technical impact. BRD, Use Case Changes to docs/system_spec/
1.4 QA Define Test Requirements: On the same branch, commits the Test Plan, detailing unit and integration test requirements based on the BRD and TRD. BRD, TRD docs/features/\<feature-name>/test_plan.md
1.5 SA Define "HOW" for AI: Creates and commits a new, detailed AI Task File (e.g., tasks/task-123.yml). This file links all context documents and lists the exact files the AI should create or modify. All docs from steps 1.2-1.4 tasks/task-123-name.yml
1.6 SA Plan Work: Adds the GitHub Issue (#123) to the team's Project board and moves it to the To Do column. GitHub Issue Updated Project Board

Phase 2: AI-Driven Implementation (Days 4-6)

Goal: The AI agent autonomously generates a first draft of the required code and tests based on its instructions.

Step Role Action Input(s) Output(s)
2.1 AI Agent Trigger: Detects the new file in the /tasks directory on the feature branch. tasks/task-123-name.yml AI task begins execution.
2.2 AI Agent Context Ingestion: Parses the task file and reads all documents and code files listed in the context_files section. All linked context files. Internal understanding of the task.
2.3 AI Agent Code Generation: Iteratively generates or modifies all files listed in the deliverables section, following the provided instructions. This includes application code, unit tests, integration tests, and migration scripts. Instructions from task file. Code and test files committed to the feature/123-name branch.
2.4 AI Agent Task Completion: After generating all deliverables, the AI updates its task file (status: awaiting_review) and creates a Draft Pull Request from the feature branch to main, referencing the source Issue (#123). Generated code. A Draft PR ready for human review.

Phase 3: Human-Supervised Review & Refinement (Days 7-8)

Goal: The Developer acts as a high-level reviewer and refiner, ensuring the AI's output meets quality standards and business objectives.

Step Role Action Input(s) Output(s)
3.1 Developer Begin Review: Receives notification for the new PR. Opens the PR and the linked Issue/Task File to understand the full context. The AI-generated PR. -
3.2 Developer Code Review & Refinement: Reviews the AI-generated code for correctness, style, and efficiency. The Developer's job is not to write code, but to improve it. They refactor, fix subtle bugs, and add comments. AI-generated code. Refinement commits pushed to the same feature branch.
3.3 Developer Request Team Review: Once satisfied with the quality, changes the PR status from "Draft" to "Ready for Review" and requests reviews from SA, QA, and peers. The refined code. PR is now in the formal review stage.
3.4 Team Holistic Review: The entire team reviews the PR, ensuring alignment between all artifacts (BRD, TRD, Code, Tests). The PR. Feedback, comments, and final approvals on the PR.

Phase 4: Automated Validation & Deployment (Days 9-10)

Goal: To safely and automatically merge, test, and deploy the completed feature.

Step Role Action Input(s) Output(s)
4.1 Developer/SA Merge to Main: After receiving all approvals, merges the Pull Request into the main branch. Approved PR. main branch is updated. Issue #123 is auto-closed.
4.2 DevOps/CI CI & Staging Deploy: The merge triggers the CI/CD pipeline. It runs all unit and integration tests, builds artifacts, and deploys to the Staging environment. Update to main branch. A successful deployment to Staging.
4.3 QA Staging Validation: Performs UAT and regression testing on the Staging environment to provide the final quality gate sign-off. Feature on Staging. A Go/No-Go decision for production.
4.4 DevOps/CD Production Deploy: Upon receiving QA sign-off, triggers the final pipeline to deploy the feature to the Production environment. QA sign-off. Feature is live.