@jakkrichm/create-nexus-devflow 2.2.2 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/bin/create-nexus-devflow.js +9 -1
  2. package/dist/bin/create-nexus-devflow.js.map +1 -1
  3. package/dist/lib/command-catalog.js +1 -1
  4. package/dist/lib/command-catalog.js.map +1 -1
  5. package/dist/lib/dashboard-page.d.ts +1 -1
  6. package/dist/lib/dashboard-page.js +42 -20
  7. package/dist/lib/dashboard-page.js.map +1 -1
  8. package/dist/lib/dashboard-snapshot.js +16 -12
  9. package/dist/lib/dashboard-snapshot.js.map +1 -1
  10. package/dist/lib/dashboard.js +10 -1
  11. package/dist/lib/dashboard.js.map +1 -1
  12. package/dist/lib/doctor.js +1 -1
  13. package/dist/lib/gatekeeper.d.ts +4 -0
  14. package/dist/lib/gatekeeper.js +2 -2
  15. package/dist/lib/gatekeeper.js.map +1 -1
  16. package/dist/lib/git-status.d.ts +10 -2
  17. package/dist/lib/git-status.js +57 -29
  18. package/dist/lib/git-status.js.map +1 -1
  19. package/dist/lib/swarm-orchestrator.d.ts +4 -1
  20. package/dist/lib/swarm-orchestrator.js +2 -2
  21. package/dist/lib/swarm-orchestrator.js.map +1 -1
  22. package/dist/lib/version-check.js +1 -1
  23. package/dist/lib/workflow-state.js +19 -32
  24. package/dist/lib/workflow-state.js.map +1 -1
  25. package/package.json +1 -1
  26. package/template/.agents/skills/complete/SKILL.md +47 -36
  27. package/template/.agents/skills/devflow/SKILL.md +51 -79
  28. package/template/.claude/skills/complete/SKILL.md +47 -36
  29. package/template/.claude/skills/devflow/SKILL.md +51 -79
  30. package/template/AGENTS.md +21 -30
  31. package/template/devflow/build-plan.md +9 -0
  32. package/template/devflow/context/ai-interaction.md +38 -39
  33. package/template/devflow/context/findings.md +8 -11
  34. package/template/devflow/context/glossary.md +31 -0
  35. package/template/devflow/reference/build-plan-template.md +65 -0
  36. package/template/devflow/reference/feature-spec-template.md +110 -0
  37. package/template/devflow/reference/project-plan-template.md +128 -0
  38. package/template/devflow/reference/running-id-contract.md +12 -11
  39. package/template/.agents/skills/10-define/SKILL.md +0 -54
  40. package/template/.agents/skills/20-spec/SKILL.md +0 -155
  41. package/template/.agents/skills/30-plan/SKILL.md +0 -226
  42. package/template/.agents/skills/40-execute/SKILL.md +0 -158
  43. package/template/.agents/skills/50-verify/SKILL.md +0 -62
  44. package/template/.agents/skills/60-report/SKILL.md +0 -57
  45. package/template/.agents/skills/70-deliver/SKILL.md +0 -72
  46. package/template/.claude/skills/10-define/SKILL.md +0 -54
  47. package/template/.claude/skills/20-spec/SKILL.md +0 -155
  48. package/template/.claude/skills/30-plan/SKILL.md +0 -226
  49. package/template/.claude/skills/40-execute/SKILL.md +0 -158
  50. package/template/.claude/skills/50-verify/SKILL.md +0 -62
  51. package/template/.claude/skills/60-report/SKILL.md +0 -57
  52. package/template/.claude/skills/70-deliver/SKILL.md +0 -72
@@ -0,0 +1,110 @@
1
+ # [ID-slug] Feature Title
2
+
3
+ > **Template Type**: Single Living Spec (DevFlow 2.5.0)
4
+ > **Active Location**: `devflow/context/current-feature.md`
5
+ > **Archive Location**: `devflow/history/{features|fixes|rollbacks}/{ID-slug}.md`
6
+
7
+ - **Feature ID**: `{xxx-slug}`
8
+ - **Category**: `features` | `fixes` | `rollbacks`
9
+ - **Target Branch**: `feature/{xxx-slug}`
10
+ - **Status**: `Spec Ready` | `In-Progress` | `Verified` | `Completed`
11
+ - **Track**: `Unified Fast-Track`
12
+ - **Discovery Ref**: `devflow/discoveries/DISC-xxx.md` (Optional)
13
+ - **ADR Ref**: `devflow/decisions/ADR-xxx.md` (Optional)
14
+
15
+ ---
16
+
17
+ ## 🎯 1. Define & Boundaries
18
+
19
+ ### Problem Statement & Goal
20
+ - **Problem**: อธิบายปัญหาที่พบ หรือสิ่งที่ต้องการแก้ไข/ปรับปรุง
21
+ - **Goal**: ผลลัพธ์หรือเป้าหมายที่ต้องการให้เกิดขึ้น
22
+
23
+ ### In-Scope & Out-of-Scope
24
+ - **In-Scope**:
25
+ - สิ่งที่ต้องทำในรอบนี้
26
+ - **Out-of-Scope**:
27
+ - สิ่งที่ไม่ทำในรอบนี้ หรือยกยอดไปทำในเฟสถัดไป
28
+
29
+ ### Risk & Mitigation Matrix
30
+ | Risk | Severity | Mitigation |
31
+ | :--- | :--- | :--- |
32
+ | ความเสี่ยงที่อาจเกิดขึ้น | Low/Medium/High | แนวทางป้องกันหรือรับมือ |
33
+
34
+ ### Success Criteria
35
+ 1. เกณฑ์ชี้วัดความสำเร็จข้อที่ 1
36
+ 2. เกณฑ์ชี้วัดความสำเร็จข้อที่ 2
37
+
38
+ ---
39
+
40
+ ## 📐 2. Technical Spec & Contracts
41
+
42
+ ### Architecture & Component Design
43
+ - อธิบายโครงสร้างหรือ Flow การทำงานของ Component/Module
44
+
45
+ ### Data Models & Schemas
46
+ ```typescript
47
+ // Interface หรือ Type Definition
48
+ ```
49
+
50
+ ### API & Interface Contracts
51
+ - **Endpoint / Function**: `methodName(params: Type): ReturnType`
52
+ - **Error Handling**: รายละเอียด Error Codes และวิธีจัดการ
53
+
54
+ ### Non-Functional Constraints
55
+ - **Security**: การตรวจสอบ Input, การจัดการสิทธิ์, Secrets
56
+ - **Performance**: ข้อจำกัดเรื่องความเร็ว หรือ Resource Usage
57
+
58
+ ### Acceptance Criteria (AC)
59
+ - [ ] **AC-1**: เงื่อนไขการยอมรับข้อที่ 1
60
+ - [ ] **AC-2**: เงื่อนไขการยอมรับข้อที่ 2
61
+
62
+ ---
63
+
64
+ ## 📋 3. Execution Plan & TDD Checklist
65
+
66
+ - [ ] **Task 1: Core Foundation & Types**
67
+ - [ ] 1.1 `[TDD-Red]` เขียน Unit Test สำหรับ Logic ส่วนที่ 1
68
+ - [ ] 1.2 `[TDD-Green]` Implement Logic ให้ผ่าน Test
69
+ - [ ] 1.3 `[TDD-Refactor]` Clean up และ Optimize โค้ด
70
+
71
+ - [ ] **Task 2: Feature Implementation**
72
+ - [ ] 2.1 `[TDD-Red]` เขียน Test ครอบคลุม Edge Cases
73
+ - [ ] 2.2 `[TDD-Green]` Implement Feature ตาม Contract
74
+ - [ ] 2.3 `[TDD-Refactor]` ตรวจสอบความถูกต้องและ Architecture
75
+
76
+ - [ ] **Task 3: Integration & QA Verification**
77
+ - [ ] 3.1 `[TDD-Green]` เชื่อมต่อ UI/API และตรวจสอบ End-to-End
78
+
79
+ ---
80
+
81
+ ## ⚡ 4. Implementation Log & Evidence
82
+
83
+ *(จะถูกบันทึกและอัปเดตความคืบหน้าระหว่างรันคำสั่ง `/implement`)*
84
+
85
+ - **Step 1**: ...
86
+ - **Checkpoint Commit**: `feat(scope): ...`
87
+
88
+ ---
89
+
90
+ ## 🧪 5. Multi-Lane Verification Matrix
91
+
92
+ *(จะถูกบันทึกผลการตรวจสอบระหว่างรันคำสั่ง `/check`)*
93
+
94
+ | Lane | Command / Verification Target | Result | Notes / Proof |
95
+ | :--- | :--- | :--- | :--- |
96
+ | **Typecheck** | `npm run typecheck` | ⏳ PENDING | |
97
+ | **Lint** | `npm run lint` | ⏳ PENDING | |
98
+ | **Unit Tests** | `npm test` | ⏳ PENDING | |
99
+ | **Manual Proof** | UI / CLI Behavioral Verification | ⏳ PENDING | |
100
+
101
+ ---
102
+
103
+ ## 📦 6. Release Digest & Retrospective
104
+
105
+ *(จะถูกสรุปและบันทึกอัตโนมัติก่อนทำการ Squash Merge ในคำสั่ง `/complete`)*
106
+
107
+ - **What Changed**: สรุปสิ่งที่เปลี่ยนแปลง
108
+ - **Key Decisions**: การตัดสินใจสำคัญระหว่างพัฒนา
109
+ - **Lessons Learned**: บทเรียนที่ได้รับ
110
+ - **Known Limitations**: ข้อจำกัดที่ทราบและข้อเสนอแนะในอนาคต
@@ -0,0 +1,128 @@
1
+ # Project Plan
2
+
3
+ > **Document Type**: Project Plan (User-Owned)
4
+ > **Purpose**: แหล่งความจริงหลัก (Single Source of Truth) สำหรับวิสัยทัศน์ผลิตภัณฑ์ สถาปัตยกรรมระบบ ขอบเขตการทำงาน และข้อกำหนดทางเทคนิค
5
+ > **Workflow**: กรอกข้อมูลให้ครบถ้วนแล้วรัน `/overview` เพื่อประมวลผลเป็น `project-overview.md`
6
+
7
+ ---
8
+
9
+ ## 1. Problem - What problem are we solving?
10
+ <!--
11
+ อธิบายปัญหาที่ระบบนี้เข้ามาแก้ไข วัตถุประสงค์หลัก และทำไมโปรเจกต์นี้จึงควรมีอยู่ (2-4 ประโยค)
12
+ - ปัญหาในปัจจุบันคืออะไร ทำไมวิธีเดิมถึงไม่ตอบโจทย์
13
+ - ผลลัพธ์ที่ต้องการ (Desired Outcome) หลังระบบนี้สร้างเสร็จ
14
+ -->
15
+
16
+ - **Core Problem**: [ระบุปัญหาหลักที่ผู้ใช้กำลังเผชิญ เช่น การทำงานแบบ Manual ที่เสียเวลาและผิดพลาดง่าย]
17
+ - **Main Purpose**: [ระบุเป้าหมายหลักของระบบ เช่น แปลง Input 3 อย่างเป็นผลลัพธ์พร้อมใช้งานในไม่กี่วินาที]
18
+
19
+ ---
20
+
21
+ ## 2. Users - Who is this for?
22
+ <!--
23
+ กลุ่มผู้ใช้งานเป้าหมายและ Use Cases หลัก
24
+ - Primary Users: ผู้ใช้งานหลักกลุ่มแรก
25
+ - Secondary / Later: กลุ่มผู้ใช้ในอนาคต
26
+ - Access Tiers: สิทธิ์การเข้าถึง เช่น Guest / Registered / Admin
27
+ -->
28
+
29
+ - **Primary Audience**: [เช่น Solo Developers, Content Creators, นักเรียน/นักศึกษา]
30
+ - **Secondary Audience (Later)**: [เช่น ทีมงานองค์กร, ลูกค้าปลายทาง]
31
+ - **User Personas & Access Tiers**:
32
+ - `Anonymous / Guest`: [สิทธิ์การใช้งานทั่วไป เช่น ดูข้อมูลสาธารณะ, ทดลองเล่นแบบจำกัด]
33
+ - `Authenticated User`: [สิทธิ์การใช้งานหลัก เช่น จัดการข้อมูลตนเอง, บันทึกประวัติ]
34
+ - `Admin`: [สิทธิ์การจัดการระบบ เช่น ดูแลผู้ใช้, ตรวจสอบ Log]
35
+
36
+ ---
37
+
38
+ ## 3. Features - What does v1 need?
39
+ <!--
40
+ รายการฟีเจอร์ระดับสูงสำหรับเวอร์ชันแรก (MVP / v1)
41
+ - เขียนสรุปสั้นๆ บรรทัดละ 1 ข้อ ไม่ต้องลงรายละเอียดทางเทคนิคลึก
42
+ - แยกส่วน Out of Scope / Later ให้ชัดเจนเพื่อคุมขอบเขต (Prevent Scope Creep)
43
+ -->
44
+
45
+ ### Core MVP Features (v1):
46
+ - **Feature 1**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
47
+ - **Feature 2**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
48
+ - **Feature 3**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
49
+ - **Feature 4**: [คำอธิบายสั้นๆ เกี่ยวกับสิ่งที่ฟีเจอร์นี้ทำ]
50
+
51
+ ### Later / Post-MVP (Not in v1):
52
+ <!-- สิ่งที่เก็บไว้ทำในอนาคต แต่ยังไม่ทำในรอบแรก -->
53
+ - [เช่น ระบบสมัครสมาชิกและจัดการ Billing ผ่าน Stripe]
54
+ - [เช่น การส่งออกข้อมูลปริมาณมากแบบ Batch/CSV]
55
+ - [เช่น Cloud Sync และการแชร์ข้อมูลข้ามอุปกรณ์]
56
+
57
+ ---
58
+
59
+ ## 4. Data - What are we storing?
60
+ <!--
61
+ โครงสร้างข้อมูลและ Entity หลักที่ระบบต้องจัดเก็บ
62
+ - ข้อมูลที่อยู่ใน Code (Static / Config)
63
+ - ข้อมูลที่เก็บใน Browser (LocalStorage / Session / Cookies)
64
+ - ข้อมูลที่เก็บใน Database (Entities, Fields, Relationships)
65
+ -->
66
+
67
+ - **In-Code / Static**: [เช่น Template Definitions, App Constants, Fixed Options]
68
+ - **Client Storage (LocalStorage/Session)**: [เช่น User Preferences, Form Draft, UI Settings]
69
+ - **Database Entities (If applicable)**:
70
+ - **`User`**: `id` (String/UUID), `email` (String, Unique), `name` (String), `role` (Enum), `createdAt` (DateTime)
71
+ - **`Resource`**: `id` (UUID), `userId` (FK -> User.id), `title` (String), `status` (Enum), `metadata` (JSON), `updatedAt` (DateTime)
72
+ - **Relationships**:
73
+ - `User` 1-to-Many `Resource`
74
+
75
+ ---
76
+
77
+ ## 5. Tech - What stack are we using?
78
+ <!--
79
+ เทคโนโลยี ไลบรารี และเครื่องมือที่เลือกใช้ พร้อมระบุหน้าที่
80
+ -->
81
+
82
+ - **Framework & Runtime**: [เช่น Next.js 15 (App Router), TypeScript, Node.js >=20]
83
+ - **Styling & UI**: [เช่น Tailwind CSS v4, Shadcn UI / Radix Primitives, Lucide Icons]
84
+ - **State & Data Access**: [เช่น Zustand, TanStack Query, Prisma ORM / Drizzle]
85
+ - **Database**: [เช่น PostgreSQL on Neon / Supabase, SQLite on LibSQL]
86
+ - **Authentication**: [เช่น NextAuth.js (Auth.js), Clerk, Supabase Auth, หรือ None in v1]
87
+ - **Validation**: [เช่น Zod for Schema & Input Validation]
88
+ - **Special Engines / Libraries**: [เช่น Puppeteer for Headless PDF/Image Export, Sharp for Image Processing]
89
+
90
+ ---
91
+
92
+ ## 6. Monetize - How will this make money?
93
+ <!--
94
+ โมเดลทางธุรกิจหรือแผนการสร้างรายได้ (หากเป็น Free Tool หรือ Internal App ให้ระบุให้ชัด)
95
+ -->
96
+
97
+ - **Model in v1**: [เช่น Free / Open-Source / Internal Utility (ไม่มีการเก็บเงินใน v1)]
98
+ - **Future Monetization (If applicable)**: [เช่น Freemium, Subscription $10/mo, Usage-based API credits]
99
+
100
+ ---
101
+
102
+ ## 7. UI/UX - How should this look and feel?
103
+ <!--
104
+ ธีม โครงสร้างหน้าจอ สไตล์การออกแบบ และประสบการณ์ผู้ใช้
105
+ -->
106
+
107
+ - **Design Aesthetic**: [เช่น Clean & Modern, Dark-Mode First, Glassmorphism, Minimalist]
108
+ - **Layout Structure**: [เช่น Single-page dashboard with Split View (Form on left, Live Preview on right)]
109
+ - **Key Routes / Screens**:
110
+ - `/`: [หน้า Landing & Main Generator Workflow]
111
+ - `/dashboard`: [หน้าจัดการ Resource และดูประวัติย้อนหลัง]
112
+ - `/settings`: [หน้าตั้งค่า Profile และ Preferences]
113
+
114
+ ---
115
+
116
+ ## 8. Deployment - Where and how will this ship?
117
+ <!--
118
+ เป้าหมายการ Deploy, คำสั่ง Build/Start, และ Environment Variables
119
+ -->
120
+
121
+ - **Target Platform**: [เช่น Vercel, Render, Cloudflare Pages, Fly.io, Self-hosted Docker]
122
+ - **Build Command**: `npm run build`
123
+ - **Start Command / Output**: `npm run start` (หรือ Static Output `out/`)
124
+ - **Required Environment Variables**:
125
+ - `DATABASE_URL`: Connection string สำหรับ Database
126
+ - `NEXTAUTH_SECRET`: Secret key สำหรับ Session signing
127
+ - `API_KEY`: Key สำหรับเชื่อมต่อ Third-party Service
128
+ - **Health Check Endpoint**: `/api/health`
@@ -1,4 +1,4 @@
1
- # DevFlow 2.0 Running ID & 3-Pillars Workspace Contract
1
+ # DevFlow 2.5.0 Running ID & 3-Pillars Workspace Contract
2
2
 
3
3
  ## The 3-Pillars Workspace Architecture
4
4
 
@@ -11,19 +11,20 @@ devflow/
11
11
  ├── ⚡ context/ # [2. Present / Active] Living Source of Truth & Active Work
12
12
  │ ├── project-overview.md # Primary source of truth for project architecture and tech stack
13
13
  │ ├── coding-standards.md # Engineering, code quality, TDD, and testing standards
14
- │ ├── ai-interaction.md # AI agent interaction rules, dual-track flow, and Thai defaults
14
+ │ ├── ai-interaction.md # AI agent interaction rules, unified living spec flow, and Thai defaults
15
15
  │ ├── findings.md # Open and resolved audit findings ledger (P0-P3)
16
+ │ ├── glossary.md # Domain glossary and architecture vocabulary
16
17
  │ ├── current-stage.md # Active state pointer and run tracker
17
- ├── current-feature.md # Fast-Track Single Living Spec (Active work / stub when idle)
18
- │ └── current-run/ # Deep-Track Active Run folder (Temporary during 10-70 execution)
18
+ └── current-feature.md # Single Living Spec (Active work / stub when idle)
19
19
 
20
20
  ├── 📦 history/ # [3. Past / Completed] Permanent Delivery & Release Archives
21
- │ ├── features/ # Completed features, architecture migrations, tooling (xxx-slug.md or xxx-slug/)
21
+ │ ├── features/ # Completed features, architecture migrations, tooling (xxx-slug.md)
22
22
  │ ├── fixes/ # Completed bug fixes, hotfixes, security patches (xxx-slug.md)
23
23
  │ ├── rollbacks/ # Completed feature reversals (YYYY-MM-DD-xxx-slug.md)
24
24
  │ └── HISTORY.md # Master release ledger summary table
25
25
 
26
- └── 🔍 discoveries/ # Pre-delivery discovery records (DISC-YYYYMMDD-NNN-slug/00-explore.md)
26
+ ├── 🔍 discoveries/ # Pre-delivery discovery records (DISC-YYYYMMDD-NNN-slug/discovery.md)
27
+ └── 🏛️ decisions/ # Architecture Decision Records (ADR-xxx-slug.md)
27
28
  ```
28
29
 
29
30
  ---
@@ -31,9 +32,9 @@ devflow/
31
32
  ## Running ID Naming Convention
32
33
 
33
34
  ### 1. Standard Running IDs
34
- - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `021-categorized-history-and-clean-living-spec-architecture`)
35
+ - **Format**: `xxx-slug` (e.g. `001-setup-auth`, `053-unify-deep-and-fast-track-model`)
35
36
  - **Prefix Removal**: The legacy `RUN-` prefix is discontinued in favor of clean 3-digit sequential numbering.
36
- - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}`.
37
+ - **Git Branch Standard**: `feature/{xxx-slug}` or `fix/{xxx-slug}` (or specific release branches such as `2.5.0`).
37
38
 
38
39
  ### 2. Sub-Feature Running IDs (`xxx[a-z]-slug`)
39
40
  - **Format**: `xxx[a-z]-slug` (e.g. `038a-backend-schema-and-api`, `038b-frontend-ui-and-state`)
@@ -56,6 +57,6 @@ When detected during `/feature` or `/brief`, the AI triggers the **Interactive S
56
57
 
57
58
  ## Single Active Run Rule (One Thing at a Time)
58
59
 
59
- 1. Only **one active run** is permitted at any given time across both Fast-Track and Deep-Track.
60
- 2. Before opening a new run (`/feature`, `/fix`, or `10-define`), the AI checks `current-stage.md` and `current-feature.md`.
61
- 3. If an active run is in progress, the AI **blocks** starting a new task and requires closing the active run via `/complete` or `70-deliver` (or explicitly cancelling/rolling back).
60
+ 1. Only **one active run** is permitted at any given time in `current-feature.md`.
61
+ 2. Before opening a new run (`/feature` or `/fix`), the AI checks `current-stage.md` and `current-feature.md`.
62
+ 3. If an active run is in progress, the AI **blocks** starting a new task and requires closing the active run via `/complete` (or explicitly cancelling/rolling back).
@@ -1,54 +0,0 @@
1
- ---
2
- name: 10-define
3
- description: "[devflow][D] Define stage in DevFlow 2.0 - turn an approved discovery into a bounded delivery run in context/current-run with stable scope."
4
- argument-hint: "{approved discovery-id, discovery path, running-id, or run path}"
5
- ---
6
-
7
- # Phase 10: Define
8
-
9
- $ARGUMENTS
10
-
11
- Convert an approved `Proceed` discovery into a bounded delivery run. Checks the Single Active Run Guardrail, allocates a sequential ID without prefix (`xxx-slug`), and writes `devflow/context/current-run/10-define.md`.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 10-define {discovery-id or discovery path}
17
- 10-define {id or run path}
18
- ```
19
-
20
- ## Markdown-First Contract
21
-
22
- For the active delivery run, write:
23
-
24
- ```text
25
- devflow/context/current-run/10-define.md
26
- ```
27
-
28
- using:
29
-
30
- ```text
31
- .agent/resources/schemas/define.template.md
32
- ```
33
-
34
- ## Process & Quality Gates
35
-
36
- ### 1. Single Active Run Guardrail (One Thing at a Time)
37
- 1. Inspect `devflow/context/current-stage.md`, `devflow/context/current-feature.md`, and `devflow/context/current-run/`.
38
- 2. If an active uncompleted run exists:
39
- - **HALT and reject opening a new define stage**.
40
- - Warn the user to complete or close the active run with `/complete` or `70-deliver` first.
41
-
42
- ### 2. Validate The Discovery Gate
43
- Require:
44
- - `Decision: Proceed`
45
- - `Approval Status: Approved`
46
- - A resolvable Discovery ID and `discovery.md` (or legacy `00-explore.md`)
47
-
48
- ### 3. Allocate Sequential ID
49
- - Inspect `devflow/history/HISTORY.md` and allocate sequential ID without prefix (e.g. `022-{slug}`).
50
- - Create directory `devflow/context/current-run/` if it does not exist.
51
- - Write `devflow/context/current-run/10-define.md`.
52
- - Update `devflow/context/current-stage.md`:
53
- - `Active Running ID`: `{ID}`
54
- - `Current Stage`: `10-define (Completed -> Ready for 20-spec)`
@@ -1,155 +0,0 @@
1
- ---
2
- name: 20-spec
3
- description: "[devflow][D] Spec stage in DevFlow 2.0 - write the formal markdown-first specification from a stable definition."
4
- argument-hint: "{running-id or workspace path}"
5
- ---
6
-
7
- # Phase 20: Spec
8
-
9
- $ARGUMENTS
10
-
11
- Turn the defined work into a specification that is concrete enough for planning and explicit enough to serve as the delivery contract.
12
-
13
- ## Usage
14
-
15
- ```text
16
- 20-spec {running-id or workspace path}
17
- ```
18
-
19
- Use this when:
20
-
21
- - the goal and scope are stable
22
- - the team needs testable or reviewable requirements
23
- - planning should not start until the contract is explicit
24
-
25
- ## Markdown-First Contract
26
-
27
- Write the primary stage artifact to:
28
-
29
- ```text
30
- devflow/runs/{ID}-{slug}20-spec.md
31
- ```
32
-
33
- using:
34
-
35
- ```text
36
- .agent/resources/schemas/spec.template.md
37
- ```
38
-
39
- Before writing `20-spec.md`, read `artifact_language` from `spec.template.md` and produce the artifact in that language.
40
-
41
- ## Required Section Content
42
-
43
- Before completing any generated artifact:
44
-
45
- - preserve every heading required by the selected template
46
- - write concrete information under every heading
47
- - when no information exists or the section does not apply, write exactly `-`
48
- - never leave a heading immediately followed by another heading with no body content
49
- - remove template placeholders from the final artifact
50
- - do not invent facts merely to avoid using `-`
51
- - re-read the saved artifact and verify every heading satisfies this rule
52
-
53
- ## Process
54
-
55
- ### Loop Contract
56
-
57
- Run specification as a contract-hardening loop, not as a prose expansion of the definition.
58
-
59
- - **Intent**: produce requirements and acceptance criteria that are concrete enough for planning and review.
60
- - **Context**: read the run's `10-define.md`, follow its `source_discovery` link when original framing matters, and read relevant research, hard constraints, and domain or codebase decisions that shape this run's delivery contract.
61
- - **Action**: write requirements, acceptance criteria, constraints, and out-of-scope items, then inspect whether each requirement is testable and unambiguous.
62
- - **Observation**: use concrete evidence such as ambiguous wording, unchecked assumptions, edge cases, missing acceptance criteria, conflicting constraints, and implementation details that are not true constraints.
63
- - **Adjustment**: if facts are missing, route to `Research`; if requirements need stress-testing, use `grill-with-docs`; if module or interface boundaries affect the contract, use `codebase-design`; if scope is unstable or still contains multiple independently deliverable contracts, return to `10-define` and split the run before continuing.
64
- - **Stop Condition**: stop when every requirement has checkable acceptance criteria, hard constraints are explicit, out-of-scope items are visible, and `30-plan` can break the work down without inventing intent.
65
- - **Handoff**: `20-spec.md` must tell `30-plan` what must be delivered, how success will be checked, what constraints cannot move, and what is intentionally excluded.
66
-
67
- ### 1. Read Definition Artifacts
68
-
69
- Read:
70
-
71
- - `10-define.md`
72
- - the shared `00-explore.md` referenced by `source_discovery` when the original framing still matters
73
- - research notes if they impose real constraints
74
-
75
- ### 2. Write The Specification
76
-
77
- Define:
78
-
79
- - core requirements
80
- - acceptance criteria
81
- - hard constraints
82
- - explicit out-of-scope items
83
-
84
- The spec should be strong enough that planning can break it into executable units without guessing intent.
85
-
86
- ### 3. Handle Missing Certainty
87
-
88
- If the spec cannot be written confidently:
89
-
90
- - call `Research` when facts are missing
91
- - use `grill-with-docs` when requirements, acceptance criteria, constraints, or out-of-scope items need to be stress-tested against scenarios and domain language
92
- - use `codebase-design` when requirements imply module boundaries, interface contracts, seams, or testability constraints
93
- - record assumptions explicitly when they are unavoidable
94
-
95
- Do not hide uncertainty inside vague requirement text.
96
-
97
- Do not combine sibling Running IDs into one spec. If this run still contains multiple independent acceptance, release, ownership, or context boundaries, stop and return to `10-define {running_id}` for an explicit split.
98
-
99
- ### 4. Finalize `20-spec.md`
100
-
101
- - preserve the template headings
102
- - follow the `artifact_language` configured in `spec.template.md`
103
- - replace all placeholders
104
- - keep implementation details out unless they are true constraints
105
- - make sure the acceptance criteria can actually be checked
106
-
107
- ### 5. Manual Review Soft Gate
108
-
109
- Before recommending `30-plan`, check whether the delivery contract has been human-reviewed.
110
- If `Approval Status` is not approved yet:
111
-
112
- - warn that planning may drift if the spec is still under review
113
- - recommend review of requirements, exclusions, and acceptance criteria first
114
- - keep `30-plan` as a soft recommendation only
115
-
116
- ## Output
117
-
118
- Report:
119
-
120
- - core requirements
121
- - acceptance criteria
122
- - hard constraints
123
- - out-of-scope items
124
- - manual review warnings when the contract is still pending
125
- - recommended next step
126
-
127
- ## Relationship To DevFlow 2.0
128
-
129
- - Classification: Mainline workflow
130
- - Previous state: `10-define`
131
- - Next state: `30-plan` when the contract is implementation-ready
132
- - Common companion commands: `PRD`, `Spec-Research`, `Competitor`, `Spec-Orchestrate` when product or integration context is still incomplete; support skills: `grill-with-docs`, `domain-modeling`, and `codebase-design` when the spec depends on precise domain language, durable decisions, or module/interface constraints
133
-
134
- ## Sources
135
-
136
- - `AGENTS.md`
137
- - `docs/workspace-artifacts.md`
138
- - `.agent/resources/schemas/spec.template.md`
139
- - Related commands: `10-define`, `PRD`, `Spec-Research`, `Competitor`, `Spec-Orchestrate`, `30-plan`
140
-
141
- ## Next Workflow Recommendation
142
-
143
- - **Primary**: `30-plan`
144
- - **Why**: The specification is now concrete enough to break into executable work.
145
- - **Alternatives**:
146
- - `Research` - choose this when the spec still depends on missing facts.
147
- - `grill-with-docs` - choose this when the spec is readable but not yet tough enough to plan from.
148
- - `codebase-design` - choose this when interface shape or testability constraints must be settled before planning.
149
- - `10-define` - choose this when the scope itself is still unstable.
150
-
151
- ## Nexus Event
152
-
153
- - Use `Research` when a requirement, rule, or integration constraint still lacks evidence.
154
- - Use `Spec-Research`, `Competitor`, or `PRD` when the contract needs stronger external, product, or market framing before planning.
155
- - Use `grill-with-docs` when available if clarification could materially change acceptance criteria, edge cases, exclusions, or rules.