Skip to content

AWS AI-DLC Workflows

AWS AI-DLC Workflows là bộ steering/rules files để áp dụng AI-Driven Development Life Cycle trong AI coding tools. Nó sinh documents, theo dõi state, hỏi human quyết định, và đưa công việc qua Inception, Construction và hướng tới Operations.

Nếu Spec Kit là spec compiler, AWS AI-DLC Workflows là delivery governance cockpit.

mermaid
flowchart TB
    I[Intent] --> A[Adaptive assessment]
    A --> B[Questions]
    B --> C[Inception artifacts]
    C --> D[Human approval]
    D --> E[Construction artifacts]
    E --> F[Code and tests]
    F --> G[Verification]
    G --> H[Audit trail]

Mental model

Workflow xem AI như development partner nhưng phải đi qua gates:

  1. Hiểu project type và complexity.
  2. Hỏi các câu còn thiếu.
  3. Sinh Inception artifacts.
  4. Chờ human review.
  5. Chia scope thành units of work.
  6. Sinh construction plans.
  7. Implement.
  8. Build/test.
  9. Update state và audit records.

Artifact model

AWS AI-DLC Workflows thường sinh nội dung dưới aidlc-docs/.

ArtifactVai trò
aidlc-state.mdTrạng thái workflow hiện tại
audit.mdQuyết định, approval và stage movement
RequirementsBusiness và functional requirements
User storiesActor, goal và acceptance
Application designCấu trúc solution cấp cao
Reverse engineering docsHiểu brownfield codebase
Units of workChia scope thành phần executable
Functional designThiết kế chi tiết theo unit
NFR designSecurity, performance, reliability, scalability
Infrastructure designCloud resources và deployment architecture
Code generation planAgent sẽ implement thế nào
Build/test instructionsVerify kết quả thế nào

Workflow chi tiết

mermaid
flowchart TB
    A[User intent] --> B[Classify work]
    B --> C{Project type}
    C -->|Greenfield| D[Requirements and design]
    C -->|Brownfield| E[Reverse engineering]
    E --> D
    D --> F[Questions to human]
    F --> G[Human answers]
    G --> H[Update inception docs]
    H --> I{Approval?}
    I -->|No| F
    I -->|Yes| J[Units of work]
    J --> K[Construction design]
    K --> L[NFR and infrastructure]
    L --> M[Code generation]
    M --> N[Build and tests]
    N --> O[Audit and state update]

Điểm mạnh

  1. Human oversight được thiết kế vào workflow. AI hỏi, chờ, update và yêu cầu review.
  2. Enterprise-ready hơn các framework còn lại. Approval, traceability, NFR, infrastructure và audit là first-class concerns.
  3. Hỗ trợ brownfield rõ. Reverse engineering giảm rủi ro sửa hệ thống agent chưa hiểu.
  4. Adaptive. Không nên chạy cùng một mức ceremony cho mọi task; depth phải scale theo risk.
  5. Hợp với solution architecture. Buộc nghĩ về application design, NFR và infrastructure trước implementation.

Điểm yếu

Điểm yếuHệ quả thực tế
Nặng với task nhỏTeam có thể ghét framework nếu bug nhỏ cũng full ceremony
Operations cần bổ sungCần thêm CI/CD, observability, rollback, SLO, runbook
Review burden thật sự lớnGenerated docs chỉ hữu ích nếu human đọc
Có thể xung đột docs hiện cóPhải map authority giữa aidlc-docs/, ADRs, specs và issue tracker
Có thể thành AI bureaucracyNhiều tài liệu không tự động tạo quyết định tốt

Use case tốt nhất

Use caseVì sao AWS AI-DLC hợp
Enterprise application deliveryCần gates, approval, NFR và architecture
Brownfield modernizationCần reverse engineering trước thay đổi
Regulated hoặc high-risk systemsCần audit trail và decision records
Multi-team deliveryShared artifacts align product, engineering, security, ops
Cloud-heavy architectureInfrastructure design là một phần workflow
Feature nhạy cảm securityRisk review phải xảy ra trước code

Ví dụ: forgot password

AWS AI-DLC mở rộng feature vượt khỏi "thêm endpoint":

Góc nhìnCâu hỏi được lộ ra
BusinessLoại user nào được reset? Có tenant scope không?
SecurityTránh user enumeration thế nào? Token lifetime?
PrivacyEmail reset chứa gì? Có lộ data nhạy cảm không?
InfrastructureEmail provider nào? Retry? Dead-letter?
OperationsMonitor abuse và delivery failure thế nào?
AuditGhi event nào để compliance/investigation?

Giá trị là lifecycle control, không chỉ code generation.

Adoption guidance

Phân loại công việc trước:

CategoryPath đề xuất
TrivialKhông dùng full AI-DLC; dùng normal code review
SmallLightweight questions và test evidence
MediumInception + construction artifacts
High-riskFull AI-DLC với architecture/security/ops approval rõ

Hướng dẫn triển khai cấp chuyên gia

Dùng AWS AI-DLC Workflows khi bạn cần nhiều hơn code generation: bạn cần delivery lifecycle có kiểm soát và human ownership rõ.

Bước 1: Chọn kiểu tích hợp

Upstream hỗ trợ nhiều coding environments qua project rules hoặc steering files. Pattern chung:

  1. Download hoặc copy AI-DLC rules.
  2. Đặt core workflow rules vào nơi agent đọc project rules.
  3. Đặt rule details cạnh đó để core workflow tham chiếu inception, construction, extension và operations guidance.
  4. Kiểm tra agent có đọc được rules.
  5. Bắt đầu conversation bằng Using AI-DLC, ....

Với tool kiểu Cursor, project rule thường tốt hơn global rule vì workflow gắn với repo. Với agent generic, đặt rule vào AGENTS.md có thể là fallback đơn giản nhất.

Bước 2: Định nghĩa governance map trước khi chạy

AI-DLC chỉ hiệu quả khi approval model rõ.

Quyết địnhOwner
Business scopeProduct owner
Architecture directionSolution architect hoặc tech lead
Security/privacy riskSecurity owner
NFR acceptanceArchitect + operations
Release readinessEngineering lead + operations
Residual riskAccountable business/technical owner

Ghi ownership model này trong repo trước khi chạy workflow high-risk.

Bước 3: Bắt đầu bằng activation prompt tốt

Prompt yếu:

text
Using AI-DLC, build forgot password.

Prompt tốt hơn:

text
Using AI-DLC, implement a forgot password flow for our multi-tenant SaaS app.
The feature must avoid user enumeration, support token expiry, rate-limit requests,
send email through our existing provider, and produce test evidence for API and UI flows.
Ask questions before creating the execution plan.

Mục tiêu không phải trả lời hết từ đầu. Mục tiêu là cho đủ context để AI-DLC hỏi đúng.

Bước 4: Chạy Inception như design review

Inception nên tạo:

OutputAcceptance check
RequirementsCó testable và scoped không?
User storiesActor và outcome rõ không?
Application designCó tôn trọng architecture hiện tại không?
Units of workCó implement/review độc lập được không?
Risk assessmentSecurity, data, migration, operational risks đã lộ chưa?

Đừng approve Inception nếu team chưa thể giải thích solution mà không đọc generated code.

Bước 5: Chạy Construction theo unit of work

Cho mỗi unit:

  1. Review functional design.
  2. Review NFR impact.
  3. Review infrastructure changes.
  4. Review code generation plan.
  5. Approve implementation scope.
  6. Cho agent implement.
  7. Yêu cầu build/test evidence.
  8. Update audit và state.
mermaid
flowchart LR
    A[Unit of work] --> B[Functional design]
    B --> C[NFR and infra impact]
    C --> D[Code generation plan]
    D --> E[Human approval]
    E --> F[Implementation]
    F --> G[Build and tests]
    G --> H[Audit update]

Bước 6: Mở rộng Operations có chủ đích

Default workflow cho hướng đi, nhưng production team nên thêm operations checklist:

Operations concernEvidence cần có
DeploymentCI/CD job, environment config, rollback path
ObservabilityLogs, metrics, traces, dashboards
ReliabilityHealth checks, retry behavior, failure modes
SecuritySecrets, IAM, audit events, abuse monitoring
SupportRunbook, alert owner, incident triage steps
CostExpected resource usage và budget guardrails

Bước 7: Giữ audit trail hữu ích

Audit entry nên ghi quyết định, không ghi noise.

Audit tốt:

text
Decision: Token lifetime set to 15 minutes.
Reason: Reduces account takeover window while preserving normal email delivery latency.
Approver: Security owner.
Evidence: API tests cover expired token and reused token.

Audit yếu:

text
Approved plan.

Playbook tối ưu

Cho low-risk work

Dùng AI-DLC nhẹ:

  • Questions.
  • Small plan.
  • Test evidence.
  • Short approval.

Không cần full generated docs cho typo fix.

Cho high-risk work

Bắt buộc:

  • Inception approval.
  • Architecture approval.
  • Security review.
  • NFR checklist.
  • Operations checklist.
  • Audit trail có named approvers.

Cho brownfield modernization

Thêm reverse-engineering stage bắt buộc:

  1. Map system boundaries.
  2. Identify integration points.
  3. Identify data ownership.
  4. Identify test coverage.
  5. Identify deployment constraints.
  6. Sau đó mới generate units of work.

Definition of done cho AI-DLC

Work done khi:

  1. aidlc-docs/ state khớp với work thực tế.
  2. Inception artifacts được approve theo risk level.
  3. Construction artifacts tồn tại cho từng unit of work.
  4. Code và tests link được với units of work.
  5. Security/NFR/infra concerns được xử lý hoặc accept rõ.
  6. Build/test evidence được ghi lại.
  7. Operations readiness hoàn thành cho production work.
  8. Audit entries giải thích material decisions.

Built as a static bilingual AI engineering stack guide.