Use case thực tế
Trang này đưa ra các pattern step-by-step để áp dụng framework trong tình huống delivery thực tế.
Use case 1: SaaS feature có tác động product rõ
Ví dụ: thêm team invitation flow với role selection.
Combo khuyến nghị: Spec Kit + Superpowers.
Vì sao
- Feature cần behavior rõ.
- Roles và permissions tạo nhiều edge cases.
- Implementation nên test-driven.
- Full enterprise lifecycle có thể quá nặng.
Step-by-step
- Tạo hoặc update Spec Kit constitution.
- Viết feature spec:
- actors: owner, admin, invited user.
- acceptance criteria.
- non-goals.
- permission rules.
- Chạy clarification:
- Admin có invite owner được không?
- Invitation expire sau bao lâu?
- Re-invite behavior?
- Email delivery failure xử lý thế nào?
- Generate implementation plan:
- database changes.
- API endpoints.
- email integration.
- UI states.
- Generate tasks.
- Dùng Superpowers TDD cho backend invitation creation.
- Thêm tests cho permission denial, duplicate invite, expired invite.
- Implement UI flow.
- Request code review.
- Update spec nếu behavior đổi trong lúc implement.
Done khi
- Spec có role matrix.
- Tests cover permission edges.
- Invite email path verified.
- UI có loading/error/success states.
- Review findings resolved.
Use case 2: Enterprise brownfield modernization
Ví dụ: migrate legacy order-processing module sang service boundary mới.
Combo khuyến nghị: AWS AI-DLC + Superpowers.
Vì sao
- Cần hiểu brownfield.
- Architecture, data và operations risk cao.
- Audit và approval quan trọng.
- TDD bảo vệ behavior trong migration.
Step-by-step
- Cài AI-DLC rules. Tham khảo: awslabs/aidlc-workflows.
- Định nghĩa approvers:
- product owner.
- architect.
- security owner.
- operations owner.
- Bắt đầu:
Using AI-DLC, reverse engineer the order-processing module and propose modernization units of work.
Do not change code until inception artifacts are approved.- Generate reverse-engineering docs:
- data flow.
- integrations.
- failure modes.
- deployment constraints.
- Approve requirements và application design.
- Chia units of work:
- read-only adapter.
- event publishing.
- migration path.
- compatibility tests.
- Với mỗi unit, dùng Superpowers TDD.
- Thêm characterization tests trước khi đổi behavior.
- Chạy construction verification.
- Update AI-DLC audit với decisions và evidence.
- Hoàn tất operations checklist trước rollout.
Done khi
- Reverse-engineering docs approved.
- Behavior compatibility tests pass.
- Rollback path tồn tại.
- Observability có sẵn.
- Audit giải thích key trade-offs.
Use case 3: Startup MVP trong hai tuần
Ví dụ: build lightweight customer support portal.
Combo khuyến nghị: GSD + selective Spec Kit + Superpowers.
Vì sao
- Work kéo dài nhiều session.
- Founder cần momentum và memory.
- Không phải feature nào cũng cần full spec.
- Flow quan trọng vẫn cần clarity và tests.
Step-by-step
- Cài GSD. Tham khảo: open-gsd/gsd-core.
- Tạo
.planning/PROJECT.md,ROADMAP.md,STATE.md. - Chia MVP thành phases:
- authentication.
- ticket list.
- ticket detail and reply.
- admin assignment.
- deployment polish.
- Với phase đơn giản, dùng GSD discuss/plan/execute/verify/ship.
- Với flow phức tạp, dùng Spec Kit để viết spec hẹp trước.
- Dùng Superpowers TDD cho behavior-heavy backend tasks.
- Giữ phase reviewable: một user outcome mỗi phase.
- Ship sau mỗi verified phase.
Done khi
.planning/STATE.mdthể hiện tiến độ hiện tại.- Mỗi shipped phase có test evidence.
- Next phase rõ.
- Không phase nào chứa unrelated refactor.
Use case 4: Thay đổi authentication nhạy cảm security
Ví dụ: password reset, MFA enrollment hoặc session revocation.
Combo khuyến nghị: AWS AI-DLC + Spec Kit concepts + Superpowers.
Vì sao
- Security risk cao.
- Requirement phải explicit.
- TDD hữu ích cho abuse cases.
- Audit trail quan trọng.
Step-by-step
- Bắt đầu với AI-DLC, không dùng GSD automation trước.
- Định nghĩa security approver.
- Viết security-focused requirements:
- no user enumeration.
- token expiration.
- replay prevention.
- rate limit.
- audit event.
- Dùng acceptance criteria kiểu Spec Kit trong AI-DLC requirement artifact.
- Approve threat model.
- Implement với Superpowers TDD:
- expired token test.
- reused token test.
- invalid user test.
- rate limit test.
- Chạy code review tập trung vào auth boundaries.
- Ghi decisions vào audit.
- Thêm monitoring cho abuse hoặc failure spikes.
Done khi
- Security tests pass.
- Threat model reviewed.
- Logs/audit events tồn tại.
- UI/email không leak sensitive info.
- Rollback path rõ.
Use case 5: Refactor lớn không đổi behavior
Ví dụ: split shared UI module hoặc extract service layer.
Combo khuyến nghị: Superpowers + Spec Kit cho behavior contract.
Step-by-step
- Document expected behavior bằng lightweight spec.
- Thêm characterization tests.
- Tạo worktree.
- Plan các refactor steps nhỏ.
- Chạy baseline tests.
- Implement một refactor slice.
- Chạy tests.
- Request review.
- Lặp đến khi hoàn tất.
- Update docs chỉ nếu public behavior hoặc architecture đổi.
Done khi
- Behavior tests pass trước và sau.
- Diff reviewable.
- Không thêm dependency mới nếu không có lý do.
- Public APIs vẫn compatible hoặc có migration guide.
Use case 6: Brownfield feature iterative trong app hiện có
Ví dụ: thêm export filters vào customer list hiện có.
Combo khuyến nghị: OpenSpec + Superpowers.
Vì sao
- App đã tồn tại.
- Bạn muốn proposed-change folder nhẹ.
- Change có thể evolve khi inspect code hiện có.
- Vẫn cần tests và review.
Step-by-step
- Cài OpenSpec:
npm install -g @fission-ai/openspec@latest
openspec init- Explore behavior hiện tại:
/opsx:explore customer list export filters- Tạo change:
/opsx:propose add-customer-export-filters- Review artifacts trong
openspec/changes/add-customer-export-filters/. - Chỉnh
design.mdsau khi inspect code list/filter hiện có. - Dùng Superpowers TDD cho filter logic và export behavior.
- Apply implementation bằng
/opsx:apply. - Verify behavior thủ công hoặc bằng expanded
/opsx:verify. - Sync và archive:
/opsx:sync
/opsx:archiveDone khi
- Proposed change được review trước implementation.
- Tests cover old behavior và new filter behavior.
- Current specs trong
openspec/specs/phản ánh shipped behavior. - Change folder được archive.
Use case 7: Internal AI coding platform
Ví dụ: platform team muốn self-host hoặc customize coding agent cho internal repositories.
Stack khuyến nghị: Hermes + OpenSpec + Superpowers-like discipline.
Vì sao
- Hermes cung cấp runtime, memory, tools, skills và subagent capabilities.
- OpenSpec cung cấp lightweight change artifacts.
- Superpowers-like skills cung cấp TDD và review discipline.
Step-by-step
- Chọn model strategy:
- hosted API;
- self-hosted model;
- model router.
- Cài và chạy Hermes trong môi trường kiểm soát.
- Thêm minimum tools:
- file read/write;
- git;
- shell;
- test runner.
- Chỉ thêm internal tools sau pilot đầu:
- issue tracker;
- docs search;
- CI API;
- deployment metadata.
- Initialize OpenSpec trong một pilot repo.
- Định nghĩa safety boundaries:
- commands cần approval;
- files/directories read-only;
- secrets policy;
- max runtime/task duration.
- Chạy một OpenSpec change với Hermes làm executor.
- Bắt buộc TDD/review behavior cho code changes.
- Ghi lại tool calls và test evidence.
- So sánh với Codex CLI hoặc Claude Code trên cùng task.
Done khi
- Hermes có lợi thế rõ so với CLI hiện có.
- Tool permissions được document.
- Memory retention policy tồn tại.
- Test evidence được capture.
- Human có thể stop execution.
Use case 8: Enterprise AI delivery với custom runtime
Stack khuyến nghị: Hermes + AI-DLC + Superpowers.
Step-by-step
- Hermes làm execution harness.
- AI-DLC sở hữu lifecycle state, questions, approvals và audit.
- Superpowers cung cấp TDD/review discipline trong construction units.
- Platform team sở hữu tool permissions và model routing.
- Security team review secrets, memory retention và tool audit.
- Operations team định nghĩa release readiness.
- Pilot một internal service medium-risk trước khi mở rộng.
Done khi
- AI-DLC audit ghi material decisions.
- Hermes tool calls được log.
- Superpowers-style tests/review được enforce.
- Operations checklist complete.
- Runtime có safety controls và kill switch.
Use case 9: RAG chatbot product feature
Ví dụ: build internal knowledge assistant trên product docs.
Stack khuyến nghị: LangChain + OpenSpec + Superpowers.
Step-by-step
- Tạo OpenSpec change:
/opsx:propose add-internal-knowledge-chatbot- Định nghĩa acceptance criteria:
- answers cite sources;
- refuses unknown answers;
- supports top product-doc collections;
- logs retrieval failures.
- Implement LangChain retriever và prompt.
- Thêm model/tool configuration.
- Thêm eval cases cho:
- known answer;
- unknown answer;
- stale document;
- source citation.
- Dùng Superpowers-style review cho prompt, retrieval, error handling.
- Chạy tests/evals trong CI.
- Sync/archive OpenSpec change.
Done khi
- Retrieval quality được evaluate.
- Prompt behavior được test.
- Sources hiển thị.
- Unknowns được xử lý an toàn.
- Cost và latency được đo.
Use case 10: Long-running support agent
Ví dụ: build agent triage support tickets, draft responses và escalate risky cases cho human.
Stack khuyến nghị: LangGraph + AI-DLC + Superpowers.
Step-by-step
- Chạy AI-DLC inception cho business risk, privacy và NFR.
- Thiết kế LangGraph state:
- ticket;
- customer context;
- classification;
- draft response;
- escalation reason;
- human approval state.
- Tạo nodes:
- classify;
- retrieve context;
- draft;
- policy check;
- human approval;
- send or escalate.
- Thêm checkpoints.
- Thêm human-in-the-loop gates cho sensitive replies.
- Thêm tests/evals theo node.
- Thêm monitoring và audit logs.
- Dùng Superpowers cho implementation review và test discipline.
- Hoàn tất AI-DLC operations readiness.
Done khi
- State graph được document.
- Human approval gates được enforce.
- Evals cover high-risk scenarios.
- Operations và rollback rõ.
- AI-DLC audit ghi material decisions.