fix template, remove okr, use casan.*

This commit is contained in:
thanhnv
2026-07-18 16:45:31 +07:00
parent 0dfd1742d3
commit 13fae3e6c3
249 changed files with 4881 additions and 5702 deletions
+44 -42
View File
@@ -4,6 +4,7 @@ AI-SDLC (AI Software Development Life Cycle) - Applying AI to the software devel
> **Bắt đầu từ đây nếu bạn muốn dùng CASAN:**
> [Dùng CASAN để làm dự án — giải thích thực tế, dễ hiểu](docs/guides/CASAN_USING_FOR_REAL_PROJECTS_VI.md).
> [Tạo project shell production đa dự án](docs/guides/CASAN_PROJECT_SHELL_PRODUCTION.md).
> CASAN core không phụ thuộc Codex, VS Code hay Claude Code; các agent được mô tả
> dưới đây là flow demo/legacy có thể đặt phía sau CASAN governance.
@@ -11,6 +12,7 @@ AI-SDLC (AI Software Development Life Cycle) - Applying AI to the software devel
- [Project Objectives](#project-objectives)
- [Dùng CASAN cho dự án thực tế](docs/guides/CASAN_USING_FOR_REAL_PROJECTS_VI.md)
- [CASAN Project Shell production](docs/guides/CASAN_PROJECT_SHELL_PRODUCTION.md)
- [Requirements](#requirements)
- [Input for Flow](#input-for-flow)
- [Output for FLow](#output-for-flow)
@@ -68,25 +70,25 @@ Apply AI to the SDLC process to automate and optimize the creation of software p
## Full AI-SDLC Flow
The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all steps automatically from start to finish.
The entire flow is orchestrated by **`casan.pipeline`**, which executes all steps automatically from start to finish.
### Flow Steps
| Step | Agent | Output | Category |
|------|-------|--------|----------|
| **STEP 1** | `okr.srs` | SRS (ソフトウェア要件定義書) | 📄 IPA Doc Gen |
| **STEP 2** | `okr.bd` | BD — 外部設計 (Basic Design) | 📄 IPA Doc Gen |
| **STEP 1** | `casan.srs` | SRS (ソフトウェア要件定義書) | 📄 IPA Doc Gen |
| **STEP 2** | `casan.bd` | BD — 外部設計 (Basic Design) | 📄 IPA Doc Gen |
| **STEP 3** | `speckit.specify` | `spec.md` | 📝 Spec-Kit |
| **STEP 4** | `speckit.clarify` | Resolve ambiguities (NO PAUSE) | 📝 Spec-Kit |
| **STEP 5** | `okr.reviewspec` 🔄 | Spec review (auto-retry) | 🔍 Agent Review |
| **STEP 5** | `casan.reviewspec` 🔄 | Spec review (auto-retry) | 🔍 Agent Review |
| **STEP 6** | `speckit.plan` | `plan.md` + data-model + contracts | 📝 Spec-Kit |
| **STEP 7** | `okr.reviewplan` 🔄 | Plan review (auto-retry) | 🔍 Agent Review |
| **STEP 8** | `okr.dd` | DD — 内部設計 (Detail Design) | 📄 IPA Doc Gen |
| **STEP 8b** | `okr.testkit` | Test cases (`gen-testcases`) | 🧪 Test |
| **STEP 7** | `casan.reviewplan` 🔄 | Plan review (auto-retry) | 🔍 Agent Review |
| **STEP 8** | `casan.dd` | DD — 内部設計 (Detail Design) | 📄 IPA Doc Gen |
| **STEP 8b** | `casan.testkit` | Test cases (`gen-testcases`) | 🧪 Test |
| **STEP 9** | `speckit.tasks` | `tasks.md` | 📝 Spec-Kit |
| **STEP 10** | `speckit.implement` 🔄 | Implementation + build & fix (auto-retry) | 📝 Spec-Kit |
| **STEP 11** | `okr.reviewcode` 🔄 | Code review + DB data check (auto-retry) | 🔍 Agent Review |
| **STEP 12** | `okr.testkit` 🔄 | Run tests (`run-tests`) — BACK-TO-PLAN on fail | 🧪 Test |
| **STEP 11** | `casan.reviewcode` 🔄 | Code review + DB data check (auto-retry) | 🔍 Agent Review |
| **STEP 12** | `casan.testkit` 🔄 | Run tests (`run-tests`) — BACK-TO-PLAN on fail | 🧪 Test |
| **STEP 13** | Boss (direct) | Build BE + connect DB + Build FE + Launch UI → `open_browser_page` | 🚀 Deploy |
### Flow Diagram
@@ -98,40 +100,40 @@ The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all ste
└──────────────────────────────┬──────────────────────────────┘
│
┌────────────────────┴──── (one-time, pre-flow) ────┐
│ okr.srsallsystem → docs/output/srs-systems/ │
│ casan.srs → docs/output/srs-systems/ │
└────────────────────┬──────────────────────────────┘
│
╔════════════════════════════╧══════════════════════════════════╗
║ okr.bossbuiltin (Orchestrator) ║
║ casan.pipeline (Orchestrator) ║
║ ║
║ ┌─── IPA Doc Gen ───────────────────────────────────────┐ ║
║ │ STEP 1 okr.srs → SRS │ ║
║ │ STEP 2 okr.bd → BD (外部設計) │ ║
║ │ STEP 1 casan.srs → SRS │ ║
║ │ STEP 2 casan.bd → BD (外部設計) │ ║
║ └───────────────────────────────────────────────────────┘ ║
║ │ ║
║ ▼ ║
║ ┌─── Spec-Kit + Review Loop ────────────────────────────┐ ║
║ │ STEP 3 speckit.specify → spec.md │ ║
║ │ STEP 4 speckit.clarify → resolve ambiguities │ ║
║ │ STEP 5 okr.reviewspec 🔄 auto-retry │ ║
║ │ STEP 5 casan.reviewspec 🔄 auto-retry │ ║
║ │ │ │ ║
║ │ ▼ │ ║
║ │ STEP 6 speckit.plan → plan.md + data-model │ ║
║ │ STEP 7 okr.reviewplan 🔄 auto-retry │ ║
║ │ STEP 7 casan.reviewplan 🔄 auto-retry │ ║
║ └───────────────────────────────────────────────────────┘ ║
║ │ ║
║ ▼ ║
║ ┌─── IPA Doc Gen (Detail) ──────────────────────────────┐ ║
║ │ STEP 8 okr.dd → DD (内部設計) │ ║
║ │ STEP 8b okr.testkit → gen-testcases │ ║
║ │ STEP 8 casan.dd → DD (内部設計) │ ║
║ │ STEP 8b casan.testkit → gen-testcases │ ║
║ └───────────────────────────────────────────────────────┘ ║
║ │ ║
║ ▼ ║
║ ┌─── Implementation ───────────────────────────────────┐ ║
║ │ STEP 9 speckit.tasks → tasks.md │ ║
║ │ STEP 10 speckit.implement 🔄 build & fix │ ║
║ │ STEP 11 okr.reviewcode 🔄 code review │ ║
║ │ STEP 12 okr.testkit 🔄 run-tests │ ║
║ │ STEP 11 casan.reviewcode 🔄 code review │ ║
║ │ STEP 12 casan.testkit 🔄 run-tests │ ║
║ │ (BACK-TO-PLAN on fail) │ ║
║ └──────────────────────────────────────────────────────┘ ║
║ │ ║
@@ -171,15 +173,15 @@ The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all ste
| Agent | Description |
|-------|-------------|
| `okr.bossbuiltin` | **Orchestrator** — runs all 13 steps end-to-end automatically |
| `okr.srs` | Generate SRS (ソフトウェア要件定義書) per module → `docs/output/ipa-docs/` |
| `okr.bd` | Generate BD / 外部設計 (Basic Design) per module → `docs/output/ipa-docs/` |
| `okr.dd` | Generate DD / 内部設計 (Detail Design) per module → `docs/output/ipa-docs/` |
| `okr.srsallsystem` | Generate system-wide SRS (one-time, pre-flow) → `docs/output/srs-systems/` |
| `okr.reviewspec` | **Review** — validate `spec.md` quality and completeness |
| `okr.reviewplan` | **Review** — validate `plan.md` conformance to spec |
| `okr.reviewcode` | **Review** — code review + DB data check |
| `okr.testkit` | **Test** — generate test cases from SRS + BD + DD; run automated tests |
| `casan.pipeline` | **Orchestrator** — runs all 13 steps end-to-end automatically |
| `casan.srs` | Generate SRS (ソフトウェア要件定義書) per module → `docs/output/ipa-docs/` |
| `casan.bd` | Generate BD / 外部設計 (Basic Design) per module → `docs/output/ipa-docs/` |
| `casan.dd` | Generate DD / 内部設計 (Detail Design) per module → `docs/output/ipa-docs/` |
| `casan.srs` | Generate system-wide SRS (one-time, pre-flow) → `docs/output/srs-systems/` |
| `casan.reviewspec` | **Review** — validate `spec.md` quality and completeness |
| `casan.reviewplan` | **Review** — validate `plan.md` conformance to spec |
| `casan.reviewcode` | **Review** — code review + DB data check |
| `casan.testkit` | **Test** — generate test cases from SRS + BD + DD; run automated tests |
| `Flow-Agent` | General-purpose flow agent |
---
@@ -188,8 +190,8 @@ The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all ste
1. **Prepare Input**: Place raw requirements in `apps/okr/domain/input/okr-requirement.md` and tech stack in `docs/technical_architecture.md`
2. **Configuration**: Set up the project constitution first, keep specifications focused on what and why, and only decide technical stack where the input explicitly requires it
3. **(One-time) Generate System SRS**: Run `okr.srsallsystem` to generate system-wide SRS → `docs/output/srs-systems/`
4. **Run AI Flow**: Invoke `okr.bossbuiltin` to execute the full 13-step flow automatically, with strict TDD enforced across specification, planning, task generation, and implementation
3. **(One-time) Generate System SRS**: Run `casan.srs` to generate system-wide SRS → `docs/output/srs-systems/`
4. **Run AI Flow**: Invoke `casan.pipeline` to execute the full 13-step flow automatically, with strict TDD enforced across specification, planning, task generation, and implementation
5. **Output**:
- `docs/output/ipa-docs/` — IPA design documents (SRS, BD, DD, Test Cases)
- `docs/output/output_logs/` — AI agent execution logs
@@ -204,16 +206,16 @@ The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all ste
```
├── .claude/
│ ├── agents/ # All agent definitions (subagents)
│ │ ├── okr.bossbuiltin.md # Boss orchestrator agent
│ │ ├── casan.pipeline.md # Boss orchestrator agent
│ │ ├── speckit.*.md # Spec-Kit agents (specify, clarify, plan, tasks, implement, analyze, checklist, taskstoissues)
│ │ ├── okr.*.md # FPT-defined agents (srs, bd, dd, reviewspec, reviewplan, reviewcode, srsallsystem, testkit)
│ │ ├── casan.*.md # Reusable CASAN agents (srs, bd, dd, reviews, testkit, pipeline)
│ │ ├── protocols/ # Shared protocols (auto-resolve, gate-retry, logging, pipeline-context, etc.)
│ │ ├── steps/ # Step definitions for orchestrator (steps-01-04, steps-05-07, etc.)
│ │ └── templates/ # Agent output templates (pipeline-completion, report-templates)
│ └── commands/ # Claude Code slash commands
│ ├── okr.bossbuiltin.md # Run full pipeline (/okr.bossbuiltin)
│ ├── casan.pipeline.md # Run full pipeline (/casan.pipeline)
│ ├── speckit.*.md # Spec-Kit slash commands
│ └── okr.*.md # OKR agent slash commands
│ └── casan.*.md # Reusable CASAN commands
│
├── CLAUDE.md # Global Claude Code project instructions
│
@@ -270,15 +272,15 @@ The entire flow is orchestrated by **`okr.bossbuiltin`**, which executes all ste
### Directory Details
#### `.claude/agents/`
Contains all agent definition files used by Claude Code. This includes both **Spec-Kit agents** (core flow: `speckit.specify`, `speckit.clarify`, `speckit.plan`, `speckit.tasks`, `speckit.implement`, plus utility agents `speckit.analyze`, `speckit.checklist`, `speckit.taskstoissues`) and **FPT-defined agents** (`okr.*`):
- **IPA Doc Gen agents** — `okr.srs`, `okr.bd`, `okr.dd`: generate IPA-standard design documents (SRS, BD, DD) per module, output to `docs/output/ipa-docs/`.
- **Review agents** — `okr.reviewspec`, `okr.reviewplan`, `okr.reviewcode`: validate the quality of Spec-Kit artifacts (`spec.md`, `plan.md`, source code) with auto-retry loops.
- **Orchestrator** — `okr.bossbuiltin`: runs the full 13-step flow end-to-end automatically.
- **Test agent** — `okr.testkit`: generates test cases from SRS + BD + DD and executes automated tests (Jest / Playwright).
Contains all agent definition files used by Claude Code. This includes both **Spec-Kit agents** (core flow: `speckit.specify`, `speckit.clarify`, `speckit.plan`, `speckit.tasks`, `speckit.implement`, plus utility agents `speckit.analyze`, `speckit.checklist`, `speckit.taskstoissues`) and reusable **CASAN agents** (`casan.*`):
- **IPA Doc Gen agents** — `casan.srs`, `casan.bd`, `casan.dd`: generate IPA-standard design documents (SRS, BD, DD) per module, output to `docs/output/ipa-docs/`.
- **Review agents** — `casan.reviewspec`, `casan.reviewplan`, `casan.reviewcode`: validate the quality of Spec-Kit artifacts (`spec.md`, `plan.md`, source code) with auto-retry loops.
- **Orchestrator** — `casan.pipeline`: runs the full 13-step flow end-to-end automatically.
- **Test agent** — `casan.testkit`: generates test cases from SRS + BD + DD and executes automated tests (Jest / Playwright).
- **Subdirectories** — `protocols/` (shared protocols for auto-resolve, gate-retry, logging, etc.), `steps/` (orchestrator step definitions), `templates/` (output report templates).
#### `.claude/commands/`
Claude Code slash commands that invoke the corresponding agents. Type `/speckit.specify`, `/okr.bossbuiltin`, etc. in Claude Code to trigger the pipeline.
Claude Code slash commands that invoke the corresponding agents. Type `/speckit.specify`, `/casan.pipeline`, etc. in Claude Code to trigger the pipeline.
#### `.specify/`
Spec-Kit configuration directory. Stores project-wide principles, scripts, and all templates:
@@ -299,9 +301,9 @@ Change requests applied during the project lifecycle (e.g., `change-0406.md`).
#### `docs/output/`
All artifacts produced by the AI-SDLC process:
- **`ipa-docs/`** — IPA design documents organized in subdirectories: `srs/`, `bd/`, `dd/`, `testcase/`, `testreport/`. Generated by `okr.srs`, `okr.bd`, `okr.dd`, and `okr.testkit`. Each subdirectory contains per-module documents.
- **`ipa-docs/`** — IPA design documents organized in subdirectories: `srs/`, `bd/`, `dd/`, `testcase/`, `testreport/`. Generated by `casan.srs`, `casan.bd`, `casan.dd`, and `casan.testkit`. Each subdirectory contains per-module documents.
- **`output_logs/`** — Execution logs from AI agents organized per feature (e.g., `000-system-srs/`, `001-access-authentication/`, etc.), useful for debugging and auditing the generation process.
- **`srs-systems/`** — System-wide SRS generated once at the beginning by `okr.srsallsystem`. Contains per-module SRS overviews (`mod01-access-authentication/`, `mod02-workspace-dashboard/`, etc.) plus `srs-overview-system.md`. Not part of the 13-step flow.
- **`srs-systems/`** — System-wide SRS generated once at the beginning by `casan.srs`. Contains per-module SRS overviews (`mod01-access-authentication/`, `mod02-workspace-dashboard/`, etc.) plus `srs-overview-system.md`. Not part of the 13-step flow.
#### `specs/`