@jakkrichm/create-nexus-devflow 2.13.0 โ†’ 2.15.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 (65) hide show
  1. package/README.md +4 -4
  2. package/dist/bin/create-nexus-devflow.d.ts +1 -1
  3. package/dist/bin/create-nexus-devflow.js +4 -3
  4. package/dist/bin/create-nexus-devflow.js.map +1 -1
  5. package/dist/lib/branch-context.d.ts +1 -0
  6. package/dist/lib/branch-context.js +8 -3
  7. package/dist/lib/branch-context.js.map +1 -1
  8. package/dist/lib/dashboard-page.d.ts +5 -2
  9. package/dist/lib/dashboard-page.js +7 -388
  10. package/dist/lib/dashboard-page.js.map +1 -1
  11. package/dist/lib/dashboard-snapshot.d.ts +22 -3
  12. package/dist/lib/dashboard-snapshot.js +154 -3
  13. package/dist/lib/dashboard-snapshot.js.map +1 -1
  14. package/dist/lib/delivery-lifecycle-engine.d.ts +1 -1
  15. package/dist/lib/delivery-lifecycle-engine.js +1 -1
  16. package/dist/lib/delivery-lifecycle-engine.js.map +1 -1
  17. package/dist/lib/mcp-server-engine.d.ts +57 -0
  18. package/dist/lib/mcp-server-engine.js +678 -0
  19. package/dist/lib/mcp-server-engine.js.map +1 -0
  20. package/dist/lib/mcp.d.ts +15 -27
  21. package/dist/lib/mcp.js +20 -646
  22. package/dist/lib/mcp.js.map +1 -1
  23. package/dist/lib/project-status-engine.d.ts +110 -0
  24. package/dist/lib/project-status-engine.js +493 -0
  25. package/dist/lib/project-status-engine.js.map +1 -0
  26. package/dist/lib/skill-manager.d.ts +2 -82
  27. package/dist/lib/skill-manager.js +15 -856
  28. package/dist/lib/skill-manager.js.map +1 -1
  29. package/dist/lib/skill-registry-engine.d.ts +121 -0
  30. package/dist/lib/skill-registry-engine.js +824 -0
  31. package/dist/lib/skill-registry-engine.js.map +1 -0
  32. package/dist/lib/status.d.ts +1 -90
  33. package/dist/lib/status.js +7 -467
  34. package/dist/lib/status.js.map +1 -1
  35. package/dist/lib/studio-view-renderer.d.ts +17 -1
  36. package/dist/lib/studio-view-renderer.js +855 -3
  37. package/dist/lib/studio-view-renderer.js.map +1 -1
  38. package/dist/lib/tooling/commands/scan-doc-contract.js +1 -0
  39. package/dist/lib/tooling/commands/scan-doc-contract.js.map +1 -1
  40. package/dist/lib/update.js +1 -1
  41. package/dist/lib/update.js.map +1 -1
  42. package/package.json +1 -1
  43. package/template/.agents/skills/complete/SKILL.md +14 -13
  44. package/template/.agents/skills/implement/SKILL.md +36 -2
  45. package/template/.claude/skills/complete/SKILL.md +14 -13
  46. package/template/.claude/skills/implement/SKILL.md +36 -2
  47. package/template/AGENTS.md +1 -1
  48. package/template/devflow/build-plan.md +5 -4
  49. package/template/devflow/context/ai-interaction.md +4 -2
  50. package/template/devflow/docs/USAGE.md +145 -0
  51. package/template/devflow/docs/diagrams/nexus-devflow-architecture.html +14821 -0
  52. package/template/devflow/docs/diagrams/nexus-devflow-architecture.json +80 -0
  53. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.html +14860 -0
  54. package/template/devflow/docs/diagrams/nexus-devflow-lifecycle.json +88 -0
  55. package/template/devflow/docs/examples/living-spec/adr.example.md +43 -0
  56. package/template/devflow/docs/examples/living-spec/current-feature.example.md +113 -0
  57. package/template/devflow/docs/examples/living-spec/discovery.example.md +45 -0
  58. package/template/devflow/docs/examples/living-spec/ideas.example.md +22 -0
  59. package/template/devflow/docs/governance-rules.md +39 -0
  60. package/template/devflow/docs/manual-review-workflow-spec.md +116 -0
  61. package/template/devflow/docs/markdown-metadata-contract.md +140 -0
  62. package/template/devflow/docs/quickstart.md +119 -0
  63. package/template/devflow/docs/release-process.md +52 -0
  64. package/template/devflow/docs/skill-selection-policy.md +64 -0
  65. package/template/devflow/docs/workflow-surface-map.md +85 -0
@@ -0,0 +1,88 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "lifecycle",
4
+ "meta": {
5
+ "title": "Nexus-DevFlow Living Spec Lifecycle",
6
+ "output": "devflow/docs/diagrams/nexus-devflow-lifecycle.html",
7
+ "viewBox": [980, 680],
8
+ "animation": "trace",
9
+ "visual_preset": "signal-flow",
10
+ "quality_profile": "showcase",
11
+ "views": [
12
+ {
13
+ "id": "delivery-rail",
14
+ "label": "Delivery rail",
15
+ "focus": ["queued", "implementing", "verifying", "completing", "shipped"],
16
+ "note": "Follow the 4-stage progressive lifecycle from spec creation to squash-merge."
17
+ },
18
+ {
19
+ "id": "quality-gates",
20
+ "label": "Quality and review gates",
21
+ "focus": ["verifying", "findings_blocked", "rejected", "completing", "review_pause"],
22
+ "note": "Safety gates where living spec review pauses and P0/P1 findings block release."
23
+ },
24
+ {
25
+ "id": "reversals",
26
+ "label": "Post-delivery rollback",
27
+ "focus": ["shipped", "reversal_plan", "rolled_back"],
28
+ "note": "Safe reversibility of completed features using categorized history and git commits."
29
+ }
30
+ ]
31
+ },
32
+ "lanes": [
33
+ { "id": "main", "label": "4-Stage Living Spec Phases" },
34
+ { "id": "waiting", "label": "Quality & Approval Gates" },
35
+ { "id": "terminal", "label": "Terminal Exits & Reversals" }
36
+ ],
37
+ "states": [
38
+ { "id": "queued", "type": "start", "label": "1. /feature (/fix)", "sublabel": "Task-Isolated spec.md", "lane": "main", "col": 0, "step": "01", "tag": "spec" },
39
+ { "id": "implementing", "type": "active", "label": "2. /implement", "sublabel": "Strict TDD build", "lane": "main", "col": 1, "step": "02", "tag": "build" },
40
+ { "id": "verifying", "type": "decision", "label": "3. /check & /audit", "sublabel": "Multi-Lane QA Matrix", "lane": "main", "col": 2, "step": "03", "tag": "gate" },
41
+ { "id": "completing", "type": "waiting", "label": "4. /complete", "sublabel": "Release & Merge Gate", "lane": "main", "col": 3, "step": "04", "tag": "ready" },
42
+ { "id": "shipped", "type": "success", "label": "Shipped & Merged", "sublabel": "devflow/history/ & Git", "lane": "main", "col": 4, "step": "05", "tag": "merged" },
43
+ { "id": "findings_blocked", "type": "waiting", "label": "Findings Ledger", "sublabel": "P0/P1 Blocker gate", "lane": "waiting", "col": 0, "tag": "blocked" },
44
+ { "id": "review_pause", "type": "waiting", "label": "Merge Approval Gate", "sublabel": "Human decision", "lane": "waiting", "col": 1, "tag": "pause" },
45
+ { "id": "reversal_plan", "type": "waiting", "label": "/rollback", "sublabel": "Safe Reversal Spec", "lane": "waiting", "col": 2, "tag": "reversal" },
46
+ { "id": "rejected", "type": "failure", "label": "Rejected / Waived", "sublabel": "Blocker unresolved", "lane": "terminal", "col": 0, "tag": "terminal" },
47
+ { "id": "cancelled", "type": "failure", "label": "Cancelled", "sublabel": "Merge aborted", "lane": "terminal", "col": 1, "tag": "terminal" },
48
+ { "id": "rolled_back", "type": "success", "label": "Rolled Back", "sublabel": "Safely reversed", "lane": "terminal", "col": 2, "tag": "terminal" }
49
+ ],
50
+ "transitions": [
51
+ { "from": "verifying", "to": "findings_blocked", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
52
+ { "from": "findings_blocked", "to": "rejected", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
53
+ { "from": "completing", "to": "review_pause", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
54
+ { "from": "review_pause", "to": "cancelled", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
55
+ { "from": "shipped", "to": "reversal_plan", "variant": "dashed", "route": "straight", "fromSide": "bottom", "toSide": "top" },
56
+ { "from": "reversal_plan", "to": "rolled_back", "variant": "emphasis", "route": "straight", "fromSide": "bottom", "toSide": "top" }
57
+ ],
58
+ "cards": [
59
+ {
60
+ "dot": "emerald",
61
+ "title": "4-Stage Progressive Rail",
62
+ "items": [
63
+ "/feature drafts task-isolated spec (spec.md) and pauses for review",
64
+ "/implement progresses sequentially with strict Red-Green-Refactor TDD",
65
+ "/check evaluates dual-axis verification and records empirical proof",
66
+ "/complete archives to devflow/history/ and executes squash-merge"
67
+ ]
68
+ },
69
+ {
70
+ "dot": "amber",
71
+ "title": "Quality & Approval Gates",
72
+ "items": [
73
+ "Spec review pause ensures requirements are locked before code is written",
74
+ "Findings ledger (findings.md) tracks all audit issues with durable IDs",
75
+ "Unresolved P0/P1 blockers strictly prevent /complete merge"
76
+ ]
77
+ },
78
+ {
79
+ "dot": "rose",
80
+ "title": "Reversals & Exits",
81
+ "items": [
82
+ "Rejected specs exit cleanly without cluttering repository state",
83
+ "/rollback creates reversible spec using archived git commits",
84
+ "Zero regression debt through durable 3-Pillars history"
85
+ ]
86
+ }
87
+ ]
88
+ }
@@ -0,0 +1,43 @@
1
+ ---
2
+ id: "ADR-001-auth-architecture"
3
+ title: "ADR: Authentication Engine Selection"
4
+ doc_type: "decision"
5
+ status: "accepted"
6
+ deciders: ["Lead Architect", "Security Auditor"]
7
+ created: "2026-08-25"
8
+ updated: "2026-08-25"
9
+ source_discovery: "DISC-20260825-001-user-auth"
10
+ related_files: ["src/lib/auth.ts", "src/db/schema/auth.ts"]
11
+ ---
12
+
13
+ # ADR-001: Authentication Engine Selection
14
+
15
+ ## Context & Problem Statement
16
+ เธฃเธฐเธšเธšเธ•เน‰เธญเธ‡เธเธฒเธฃเธฃเธญเธ‡เธฃเธฑเธšเธ—เธฑเน‰เธ‡ Email/Password เนเธฅเธฐ OAuth2 SSO (Google, GitHub, Microsoft) เธชเธณเธซเธฃเธฑเธšเธฅเธนเธเธ„เน‰เธฒเธญเธ‡เธ„เนŒเธเธฃ เน‚เธ”เธขเธ•เน‰เธญเธ‡เธกเธต Type safety เนเธฅเธฐเธ—เธณเธ‡เธฒเธ™เธฃเนˆเธงเธกเธเธฑเธš Edge/Node.js runtime เน„เธ”เน‰
17
+
18
+ ## Decision Drivers
19
+ - Type-safe Client & Server APIs
20
+ - Zero-leak Security Boundary
21
+ - Minimal Third-party Vendor Lock-in
22
+ - Native Support for PostgreSQL + Redis Session Store
23
+
24
+ ## Considered Options
25
+ 1. **Option 1**: NextAuth / Auth.js
26
+ 2. **Option 2**: Better-Auth
27
+ 3. **Option 3**: In-house Custom JWT Implementation
28
+
29
+ ## Decision Outcome
30
+ - **Chosen Option**: **Option 2 (Better-Auth)**
31
+ - **Rationale**: เธกเธตเน‚เธ„เธฃเธ‡เธชเธฃเน‰เธฒเธ‡เน‚เธกเธ”เธนเธฅเธ—เธตเนˆเนเธขเธ Layer เธŠเธฑเธ”เน€เธˆเธ™ (Deep Module), เธฃเธญเธ‡เธฃเธฑเธš TypeScript เนเธšเธš 100% strict, เนเธฅเธฐเธกเธต built-in rate-limiting เธฃเธงเธกเธ–เธถเธ‡ CSRF protection
32
+
33
+ ## Consequences & Trade-offs
34
+ ### Positive
35
+ - เธ›เธฃเธฐเธซเธขเธฑเธ”เน€เธงเธฅเธฒเนƒเธ™เธเธฒเธฃเธžเธฑเธ’เธ™เธฒ Security middleware
36
+ - Audit เธœเนˆเธฒเธ™เน„เธ”เน‰เธ‡เนˆเธฒเธขเน€เธ™เธทเนˆเธญเธ‡เธˆเธฒเธเน€เธ›เน‡เธ™ Open-source เธ—เธตเนˆเธœเนˆเธฒเธ™เธเธฒเธฃเธ—เธ”เธชเธญเธš
37
+ ### Negative
38
+ - เธ—เธตเธกเธ•เน‰เธญเธ‡เน€เธฃเธตเธขเธ™เธฃเธนเน‰ Plugin API เธ‚เธญเธ‡เน€เธŸเธฃเธกเน€เธงเธดเธฃเนŒเธเนƒเธซเธกเนˆ
39
+
40
+ ## Technical Implementation Rules
41
+ - เน€เธเน‡เธš Secrets เธ—เธฑเน‰เธ‡เธซเธกเธ”เนƒเธ™ Environment Variables (`.env`)
42
+ - เนƒเธŠเน‰เธ‡เธฒเธ™ Database Adapter เธœเนˆเธฒเธ™ Drizzle ORM
43
+ - เธซเน‰เธฒเธก Bypass Session verification middleware เน€เธ”เน‡เธ”เธ‚เธฒเธ”
@@ -0,0 +1,113 @@
1
+ ---
2
+ id: "{running_id}"
3
+ title: "{Work Title}"
4
+ doc_type: "spec"
5
+ stage: "current-feature"
6
+ created: "{YYYY-MM-DD}"
7
+ updated: "{YYYY-MM-DD}"
8
+ owner: "{Owner/AI}"
9
+ status: "in-progress"
10
+ artifact_language: "th"
11
+ related_run: "{running_id}"
12
+ source_discovery: "{DISC-ID or null}"
13
+ source_idea: "{IDEA-ID or null}"
14
+ dependencies: []
15
+ related_files: []
16
+ ---
17
+
18
+ # Feature: {Work Title}
19
+
20
+ ## ๐ŸŽฏ 1. Define & Boundaries
21
+
22
+ ### Problem Statement
23
+ - เธ„เธณเธญเธ˜เธดเธšเธฒเธขเธ›เธฑเธเธซเธฒเธซเธฃเธทเธญเธ„เธงเธฒเธกเธ•เน‰เธญเธ‡เธเธฒเธฃเธ—เธฒเธ‡เธ˜เธธเธฃเธเธดเธˆเธ—เธตเนˆเธŠเธฑเธ”เน€เธˆเธ™
24
+
25
+ ### Proposed Solution
26
+ - เธชเธฃเธธเธ›เนเธ™เธงเธ—เธฒเธ‡เนเธเน‰เน„เธ‚เน€เธŠเธดเธ‡เธชเธ–เธฒเธ›เธฑเธ•เธขเธเธฃเธฃเธกเนเธฅเธฐเน€เธ—เธ„เน‚เธ™เน‚เธฅเธขเธตเธ—เธตเนˆเนƒเธŠเน‰
27
+
28
+ ### In-Scope & Boundaries
29
+ - [x] เธ‚เธญเธšเน€เธ‚เธ•เธ—เธตเนˆเธ•เน‰เธญเธ‡เธชเนˆเธ‡เธกเธญเธšเนƒเธ™เธ‡เธฒเธ™เธ™เธตเน‰ (In-scope item 1)
30
+ - [x] เธ‚เธญเธšเน€เธ‚เธ•เธ—เธตเนˆเธ•เน‰เธญเธ‡เธชเนˆเธ‡เธกเธญเธšเนƒเธ™เธ‡เธฒเธ™เธ™เธตเน‰ (In-scope item 2)
31
+
32
+ ### Non-Goals (Out of Scope)
33
+ - เธชเธดเนˆเธ‡เธ—เธตเนˆเน„เธกเนˆเธ—เธณเนƒเธ™เธ‡เธฒเธ™เธ™เธตเน‰ (Out-of-scope item 1)
34
+ - เธชเธดเนˆเธ‡เธ—เธตเนˆเธˆเธฐเธขเธเธขเธญเธ”เน„เธ›เธฃเธญเธšเธ–เธฑเธ”เน„เธ› (Deferred item 2)
35
+
36
+ ### Invariants (เธชเธดเนˆเธ‡เธ—เธตเนˆเธซเน‰เธฒเธกเธžเธฑเธ‡เน€เธ”เน‡เธ”เธ‚เธฒเธ”)
37
+ - เธฃเธฐเธšเธšเน€เธ”เธดเธกเธชเนˆเธงเธ™เน„เธซเธ™เธ—เธตเนˆเธ•เน‰เธญเธ‡เธ—เธณเธ‡เธฒเธ™เน„เธ”เน‰เธ•เธฒเธกเธ›เธเธ•เธด 100%
38
+
39
+ ---
40
+
41
+ ## ๐Ÿ“ 2. Technical Spec & Contracts
42
+
43
+ ### Architecture & Data Contracts
44
+ ```typescript
45
+ export interface ExampleDataContract {
46
+ id: string;
47
+ name: string;
48
+ status: 'active' | 'inactive';
49
+ createdAt: string;
50
+ }
51
+ ```
52
+
53
+ ### Acceptance Criteria (AC)
54
+ - [ ] **AC-1**: เน€เธ‡เธทเนˆเธญเธ™เน„เธ‚เธ„เธงเธฒเธกเธชเธณเน€เธฃเน‡เธˆเธ‚เน‰เธญเธ—เธตเนˆ 1 (เธชเธฒเธกเธฒเธฃเธ–เธ•เธฃเธงเธˆเธชเธญเธšเนเธฅเธฐเธ—เธ”เธชเธญเธšเน„เธ”เน‰)
55
+ - [ ] **AC-2**: เน€เธ‡เธทเนˆเธญเธ™เน„เธ‚เธ„เธงเธฒเธกเธชเธณเน€เธฃเน‡เธˆเธ‚เน‰เธญเธ—เธตเนˆ 2 (เธ„เธฃเธญเธšเธ„เธฅเธธเธก Error handling / Edge cases)
56
+ - [ ] **AC-3**: เธเธฒเธฃเธœเธชเธฒเธ™เธฃเธงเธกเนเธฅเธฐเธเธฒเธฃเธ—เธณเธ‡เธฒเธ™เธฃเนˆเธงเธกเธเธฑเธšเธชเนˆเธงเธ™เธญเธทเนˆเธ™เน„เธกเนˆเธกเธตเธเธฒเธฃเน€เธเธดเธ” Regression
57
+
58
+ ---
59
+
60
+ ## ๐Ÿ“‹ 3. Execution Plan & TDD Checklist
61
+
62
+ - [ ] **Task 1: Setup & Domain Model**
63
+ - [ ] `[TDD-Red]` เน€เธ‚เธตเธขเธ™ Unit test เธชเธณเธซเธฃเธฑเธšเธ—เธ”เธชเธญเธš Domain Model เธ—เธตเนˆเธขเธฑเธ‡เน„เธกเนˆเธœเนˆเธฒเธ™
64
+ - [ ] `[TDD-Green]` เธชเธฃเน‰เธฒเธ‡ Entity เนเธฅเธฐ Type definitions เธˆเธ™ Test เธœเนˆเธฒเธ™
65
+ - [ ] `[TDD-Refactor]` เธ›เธฃเธฑเธšเน‚เธ„เธฃเธ‡เธชเธฃเน‰เธฒเธ‡เน‚เธ„เน‰เธ”เนƒเธซเน‰เธชเธฐเธญเธฒเธ”เนเธฅเธฐเน€เธ›เน‡เธ™ Deep Module
66
+
67
+ - [ ] **Task 2: Core Service Implementation**
68
+ - [ ] `[TDD-Red]` เน€เธ‚เธตเธขเธ™ Service integration test เธ”เธฑเธ edge cases
69
+ - [ ] `[TDD-Green]` เธžเธฑเธ’เธ™เธฒ Service logic เธ‚เธฑเน‰เธ™เธ•เนˆเธณเนƒเธซเน‰ Test เธœเนˆเธฒเธ™
70
+ - [ ] `[TDD-Refactor]` เน€เธžเธดเนˆเธก error logging เนเธฅเธฐเนเธขเธ helper functions
71
+
72
+ - [ ] **Task 3: Verification & Integration Gate**
73
+ - [ ] `[TDD-Red]` เน€เธ‚เธตเธขเธ™ End-to-end เธซเธฃเธทเธญ Component smoke test
74
+ - [ ] `[TDD-Green]` เน€เธŠเธทเนˆเธญเธกเธ•เนˆเธญ UI/API เน€เธ‚เน‰เธฒเธเธฑเธš Core service
75
+ - [ ] `[TDD-Refactor]` เธฃเธฑเธ™ typecheck, linting เนเธฅเธฐ polish เน‚เธ„เน‰เธ”
76
+
77
+ ---
78
+
79
+ ## โšก 4. Implementation Log & Evidence
80
+
81
+ ### Step 1: {Step Title}
82
+ - **Action**: เธญเธ˜เธดเธšเธฒเธขเธเธฒเธฃเธฅเธ‡เธกเธทเธญเน€เธ‚เธตเธขเธ™เน‚เธ„เน‰เธ”เนเธฅเธฐเน„เธŸเธฅเนŒเธ—เธตเนˆเนเธเน‰เน„เธ‚
83
+ - **Files Modified**: `src/services/example.ts`, `src/types/example.ts`
84
+ - **Diff Summary**:
85
+ ```diff
86
+ + export function processData(input: InputData): Result {
87
+ + return { status: 'success' };
88
+ + }
89
+ ```
90
+
91
+ ---
92
+
93
+ ## ๐Ÿงช 5. Multi-Lane Verification Matrix
94
+
95
+ | Lane | Command | Result | Evidence / Notes |
96
+ | :--- | :--- | :--- | :--- |
97
+ | **Typecheck** | `npm run typecheck` | `PASS` | 0 errors |
98
+ | **Lint** | `npm run lint` | `PASS` | Clean syntax |
99
+ | **Unit Tests** | `npm test` | `PASS` | 14 tests passing |
100
+ | **Manual Proof** | UI / CLI inspection | `PASS` | Verified in browser / terminal |
101
+
102
+ ---
103
+
104
+ ## ๐Ÿ“ฆ 6. Release Digest & Retrospective
105
+
106
+ ### Release Summary
107
+ - เธชเธฃเธธเธ›เธœเธฅเธ‡เธฒเธ™เธ—เธตเนˆเธชเนˆเธ‡เธกเธญเธšเนเธฅเธฐเธ„เธธเธ“เธ„เนˆเธฒเธ—เธตเนˆเน„เธ”เน‰เธฃเธฑเธš
108
+
109
+ ### Architectural Decisions
110
+ - เธฅเธดเธ‡เธเนŒเน„เธ›เธขเธฑเธ‡ ADR เธ—เธตเนˆเน€เธเธตเนˆเธขเธงเธ‚เน‰เธญเธ‡ (เน€เธŠเนˆเธ™ `devflow/decisions/ADR-001.md`)
111
+
112
+ ### Retrospective & Lessons Learned
113
+ - เธชเธดเนˆเธ‡เธ—เธตเนˆเธ—เธณเน„เธ”เน‰เธ”เธตเนเธฅเธฐเธ‚เน‰เธญเธ„เธงเธฃเธฃเธฐเธงเธฑเธ‡เธชเธณเธซเธฃเธฑเธšเธ‡เธฒเธ™เนƒเธ™เธญเธ™เธฒเธ„เธ•
@@ -0,0 +1,45 @@
1
+ ---
2
+ id: "DISC-20260825-001-user-auth"
3
+ title: "Discovery: Modern Authentication & SSO Integration"
4
+ doc_type: "discovery"
5
+ stage: "discovery"
6
+ created: "2026-08-25"
7
+ updated: "2026-08-25"
8
+ owner: "Lead Architect"
9
+ status: "completed"
10
+ decision: "Proceed"
11
+ selected_route: "Direct"
12
+ related_ideas: ["IDEA-012"]
13
+ related_runs: ["001-user-auth"]
14
+ related_files: []
15
+ ---
16
+
17
+ # Discovery: Modern Authentication & SSO Integration
18
+
19
+ ## 1. Request Summary & Problem Statement
20
+ - **Objective**: เธชเธณเธฃเธงเธˆเนเธ™เธงเธ—เธฒเธ‡เธเธฒเธฃเธœเธชเธฒเธ™เธฃเธงเธกเธฃเธฐเธšเธšเธขเธทเธ™เธขเธฑเธ™เธ•เธฑเธงเธ•เธ™ (Authentication) เธฃเนˆเธงเธกเธเธฑเธš OAuth2 / SSO เธชเธณเธซเธฃเธฑเธšเธญเธ‡เธ„เนŒเธเธฃ
21
+ - **Context**: เธฃเธฐเธšเธšเน€เธ”เธดเธกเนƒเธŠเน‰ Local Basic Auth เธ‹เธถเนˆเธ‡เธ‚เธฒเธ”เธ„เธงเธฒเธกเธ›เธฅเธญเธ”เธ เธฑเธขเนเธฅเธฐเธเธฒเธฃเธšเธฃเธดเธซเธฒเธฃเธˆเธฑเธ”เธเธฒเธฃเธชเธดเธ—เธ˜เธดเนŒเนเธšเธšเธฃเธงเธกเธจเธนเธ™เธขเนŒ
22
+
23
+ ## 2. Decision-Blocking Unknowns & Feasibility
24
+ - [x] **Unknown 1**: เน‚เธ„เธฃเธ‡เธชเธฃเน‰เธฒเธ‡ Database Schema เธฃเธญเธ‡เธฃเธฑเธš Multi-tenant OAuth provider เธซเธฃเธทเธญเน„เธกเนˆ?
25
+ - *Finding*: เธฃเธญเธ‡เธฃเธฑเธšเน„เธ”เน‰เน‚เธ”เธขเน€เธžเธดเนˆเธกเธ•เธฒเธฃเธฒเธ‡ `accounts` เนเธฅเธฐ `sessions` เนเธšเธš decouple
26
+ - [x] **Unknown 2**: เธ›เธฃเธฐเธชเธดเธ—เธ˜เธดเธ เธฒเธžเนเธฅเธฐเธเธฒเธฃเธˆเธฑเธ”เน€เธเน‡เธš Token เนƒเธ™ Redis
27
+ - *Finding*: เธ—เธ”เธชเธญเธš Session cache lookup เนƒเธŠเน‰เน€เธงเธฅเธฒเน€เธ‰เธฅเธตเนˆเธข < 2ms
28
+
29
+ ## 3. Candidate Architectural Routes
30
+ | Route | Pros | Cons | Verdict |
31
+ | :--- | :--- | :--- | :--- |
32
+ | **Custom OAuth2 Provider** | เธ„เธงเธšเธ„เธธเธกเน„เธ”เน‰เธ—เธฑเน‰เธ‡เธซเธกเธ” 100% | Maintenance เธชเธนเธ‡, เธ„เธงเธฒเธกเน€เธชเธตเนˆเธขเธ‡ Security | โŒ Reject |
33
+ | **Auth.js / Better-Auth** | เธกเธฒเธ•เธฃเธเธฒเธ™เธ„เธงเธฒเธกเธ›เธฅเธญเธ”เธ เธฑเธขเธชเธนเธ‡, Type-safe, Zero-config DB adapters | เธ•เน‰เธญเธ‡ Migrate Session เน€เธ”เธดเธก | โœ… Recommended |
34
+
35
+ ## 4. Architectural Recommendation & Decisions
36
+ - เน€เธฅเธทเธญเธเนƒเธŠเน‰ **Better-Auth** เธฃเนˆเธงเธกเธเธฑเธš PostgreSQL เนเธฅเธฐ Redis
37
+ - เธšเธฑเธ™เธ—เธถเธเธฃเธฒเธขเธฅเธฐเน€เธญเธตเธขเธ”เธเธฒเธฃเธ•เธฑเธ”เธชเธดเธ™เนƒเธˆเธฅเธ‡เนƒเธ™ [ADR-001-auth-architecture.md](file:///d:/Projects/devtools/nexus-devflow/devflow/decisions/ADR-001-auth-architecture.md)
38
+
39
+ ## 5. Delivery Slices & Plan Handoff
40
+ - **Slice 1 (Run 001)**: Core Auth Schema & OAuth2 Providers (`/feature "Core Auth Schema and OAuth2"`)
41
+ - **Slice 2 (Run 002)**: Session Management & Middleware (`/feature "Session Middleware"`)
42
+
43
+ ## 6. Decision & Human Sign-off
44
+ - **Status**: `Proceed`
45
+ - **Next Allowed Command**: `/feature 001-user-auth`
@@ -0,0 +1,22 @@
1
+ # Idea Inbox & AI Feasibility Scoring
2
+
3
+ Centralized repository for new feature proposals, refactoring ideas, and architectural enhancements.
4
+
5
+ ---
6
+
7
+ ## ๐Ÿ”ฎ Active Backlog Ideas
8
+
9
+ | ID | Date | Category | Proposal & Core Value | Feasibility | Effort | Value | Status | Source |
10
+ | :--- | :--- | :--- | :--- | :---: | :---: | :---: | :---: | :--- |
11
+ | `[IDEA-001]` | 2026-08-25 | `Security` | **OAuth2 & SSO Integration**: Enterprise Google/GitHub SSO login | `High` | `Medium` | `High` | `In-Progress` | User Request |
12
+ | `[IDEA-002]` | 2026-08-25 | `Performance` | **Single-Flight Git Caching**: Coalescing Git CLI reads to < 120ms | `High` | `Low` | `High` | `Delivered` | Team Review |
13
+ | `[IDEA-003]` | 2026-08-25 | `UI/UX` | **Multi-Agent Swarm Visualizer**: Live role monitoring dashboard | `Medium` | `Medium` | `High` | `Delivered` | Architecture |
14
+ | `[IDEA-004]` | 2026-08-25 | `Tooling` | **MCP Server Hub**: Native 12 tools for IDE integrations | `High` | `Low` | `Medium` | `Ready` | Backlog |
15
+
16
+ ---
17
+
18
+ ## ๐Ÿ’ก How to Capture Ideas
19
+
20
+ - **Via Slash Command**: `/idea "Implement webhook retry queue with exponential backoff"`
21
+ - **Direct Edit**: Add new rows to the table above.
22
+ - **Convert to Feature**: Run `/feature IDEA-004` to consume an idea directly into a Single Living Spec.
@@ -0,0 +1,39 @@
1
+ # Governance Rules
2
+
3
+ Use these rules when changing the Nexus-DevFlow framework itself. Keep them practical. If a change does not need a new public surface, do not create one.
4
+
5
+ ---
6
+
7
+ ## 1. Public Surface Rule
8
+
9
+ - The public workflow surface consists of the **4-stage Living Spec lifecycle** (`/feature`, `/implement`, `/check`, `/complete`) plus the declared **companion skills** (e.g. `/idea`, `/grill`, `/discovery`, `/devflow`, `/doctor`, `/audit`, `/rollback`).
10
+ - Do not introduce a new public command, alternate workflow track, or renamed companion unless the framework truly needs a new user-facing surface.
11
+ - Internal helpers may exist, but they should stay internal until the framework explicitly promotes them.
12
+
13
+ Example:
14
+ - `/debug` supports root-cause analysis before `/fix` or `/implement`, but it does not replace the delivery lifecycle.
15
+
16
+ ---
17
+
18
+ ## 2. Placement Rules
19
+
20
+ - **Workflow Stage**: Add or modify a lifecycle stage when the behavior owns a public lifecycle state, required stage artifact, or next-step contract in the active living spec (`devflow/context/{xxx-slug}/spec.md`).
21
+ - **Skill**: Add a skill under `.agents/skills/` and `.claude/skills/` when the behavior is a reusable method that can support multiple workflows or AI agents.
22
+ - **Script**: Add a script under `scripts/` when the change reduces repetition, performs workspace setup, or supports validation without changing the public workflow model.
23
+ - **Validation**: Add validation to `scripts/validate-framework.ts` when the rule is stable, repeated, and important enough that drift should fail fast in CI.
24
+
25
+ ---
26
+
27
+ ## 3. Documentation Placement Rule
28
+
29
+ - Update `README.md`, `README.th.md`, and `USAGE.md` only when maintainers or users need the change to be discoverable from a high-surface entry point.
30
+ - Put maintainer-operating detail in focused docs under `devflow/docs/` instead of expanding public onboarding pages.
31
+ - Keep `AGENTS.md` aligned with workflow, agent, and skill boundaries, but avoid turning it into a full maintainer manual.
32
+
33
+ ---
34
+
35
+ ## 4. Decision Bias
36
+
37
+ - Prefer the smallest surface that preserves clarity.
38
+ - Prefer updating an existing doc, skill, script, or validation rule before creating a new one.
39
+ - If two placements seem possible, choose the one that keeps public behavior stable across all supported AI IDEs.
@@ -0,0 +1,116 @@
1
+ ---
2
+ title: Nexus-DevFlow 2.13.0 Manual Review & Quality Gate Specification
3
+ status: active
4
+ updated: 2026-09-07
5
+ owner: Nexus-DevFlow Core Team
6
+ ---
7
+
8
+ # Nexus-DevFlow 2.13.0 Manual Review & Quality Gate Specification
9
+
10
+ ## 1. Purpose & Overview
11
+
12
+ This specification defines the **Manual Review, Verification Gates, and Audit Discipline** for **Nexus-DevFlow 2.13.0 (The 3-Pillars & Pure Task-Isolated Living Spec Model)**.
13
+
14
+ In production-grade software development, AI coding assistants should not blindly write code without human alignment. Nexus-DevFlow treats human review as **explicit, non-bypassable gates** throughout the 4-stage delivery lifecycle:
15
+
16
+ ```text
17
+ /feature (or /fix) โ”€โ”€โ–ถ [Spec Gate] โ”€โ”€โ–ถ /implement โ”€โ”€โ–ถ [TDD Checkpoint] โ”€โ”€โ–ถ /check โ”€โ”€โ–ถ [QA Gate] โ”€โ”€โ–ถ /complete โ”€โ”€โ–ถ [Delivery Gate]
18
+ ```
19
+
20
+ ---
21
+
22
+ ## 2. The 4 Essential Human Review Gates
23
+
24
+ ### ๐Ÿšช Gate 1: The Spec Review Gate (`/feature` / `/fix`)
25
+ - **When**: Triggered immediately after the AI creates or updates `devflow/context/{xxx-slug}/spec.md`.
26
+ - **AI Action**: Defines problem statement, boundaries, data contracts, acceptance criteria (AC-1..AC-N), and TDD execution plan, then **pauses**.
27
+ - **Human Verification Checklist**:
28
+ 1. Are scope boundaries and non-goals explicitly defined?
29
+ 2. Are invariants (what must not break) protected?
30
+ 3. Are acceptance criteria testable and unambiguous?
31
+ 4. Is the TDD execution plan granular (`[TDD-Red]`, `[TDD-Green]`, `[TDD-Refactor]`)?
32
+ - **Approval Rule**: AI does not write application code until the developer reviews and approves the spec.
33
+
34
+ ---
35
+
36
+ ### ๐Ÿšช Gate 2: The TDD Implementation Checkpoint (`/implement`)
37
+ - **When**: During task execution in `devflow/context/{xxx-slug}/spec.md`.
38
+ - **AI Action**: Implements tasks one by one under strict Red-Green-Refactor discipline, recording diffs and test logs into the implementation checklist and evidence sections.
39
+ - **Human Verification Checklist**:
40
+ 1. Did each behavior change start with a failing test (`[TDD-Red]`)?
41
+ 2. Is the code diff minimal, clean, and adhering to `coding-standards.md`?
42
+ 3. Were refactoring steps performed without changing public contracts?
43
+ - **Approval Rule**: Optional commit checkpoints on the feature branch after each passing step.
44
+
45
+ ---
46
+
47
+ ### ๐Ÿšช Gate 3: Senior QA Verification Gate (`/check`)
48
+ - **When**: After all implementation tasks in the living spec are checked off.
49
+ - **AI Action**: Assumes the role of an independent Senior QA engineer, running the multi-lane verification matrix (Typecheck, Lint, Test suites, and behavioral manual proof).
50
+ - **Human Verification Checklist**:
51
+ 1. Did all lanes in the matrix achieve `PASS`?
52
+ 2. Are test assertions testing behavior rather than mock implementation details?
53
+ 3. Has manual behavioral proof (browser/terminal/API) been recorded?
54
+ - **Approval Rule**: Passing checks recorded as empirical evidence in `devflow/context/{xxx-slug}/spec.md` and any findings logged in `findings.md`.
55
+
56
+ ---
57
+
58
+ ### ๐Ÿšช Gate 4: The Findings & Git Delivery Gate (`/audit` + `/complete`)
59
+ - **When**: Final step before closing the work item.
60
+ - **AI Action**:
61
+ - `/audit current` inspects the complete feature branch delta and records findings in `devflow/context/{xxx-slug}/findings.md`.
62
+ - `/complete` compiles the Release Digest, updates `HISTORY.md` and `build-plan.md`, archives the living spec to `devflow/history/features/`, cleanly tears down the active task directory, and asks for approval before merging.
63
+ - **Human Verification Checklist**:
64
+ 1. Are all P0 (Critical) and P1 (High) findings in `findings.md` resolved and verified (`closed`) or explicitly waived (`accepted`)?
65
+ 2. Is the Release Digest accurate and complete?
66
+ - **Approval Rule**: Mandatory human confirmation before squash-merging the feature branch into `main` and deleting the branch.
67
+
68
+ ---
69
+
70
+ ## 3. Artifact Placement & State Contracts (The 3-Pillars)
71
+
72
+ ```text
73
+ devflow/
74
+ โ”œโ”€โ”€ ideas.md # ๐Ÿ”ฎ Future (Backlog): Idea Inbox with AI scoring
75
+ โ”œโ”€โ”€ project-plan.md # ๐Ÿ”ฎ Future (Backlog): Product Vision & Architectural Roadmap
76
+ โ”œโ”€โ”€ build-plan.md # ๐Ÿ”ฎ Future (Backlog): Master Feature Delivery Sequence
77
+ โ”œโ”€โ”€ context/ # โšก Present (Active Context): Global Truth & Task Workspaces
78
+ โ”‚ โ”œโ”€โ”€ project-overview.md # Single Source of Truth
79
+ โ”‚ โ”œโ”€โ”€ coding-standards.md # Engineering standards & conventions
80
+ โ”‚ โ”œโ”€โ”€ ai-interaction.md # AI interaction guidelines
81
+ โ”‚ โ”œโ”€โ”€ glossary.md # Domain glossary & architecture terms
82
+ โ”‚ โ””โ”€โ”€ {xxx-slug}/ # Active Task-Isolated Workspace
83
+ โ”‚ โ”œโ”€โ”€ spec.md # Living Spec & Task Breakdown
84
+ โ”‚ โ”œโ”€โ”€ stage.md # Stage pointer & status
85
+ โ”‚ โ””โ”€โ”€ findings.md # Dedicated audit & quality ledger
86
+ โ”œโ”€โ”€ decisions/ # ๐Ÿ›๏ธ Decisions: Architecture Decision Records (ADR-xxx.md)
87
+ โ”œโ”€โ”€ history/ # ๐Ÿ“ฆ Past (History Archive): Categorized delivery archives
88
+ โ”‚ โ”œโ”€โ”€ features/ # Shipped features ({xxx-slug}.md)
89
+ โ”‚ โ”œโ”€โ”€ fixes/ # Resolved bug fixes ({xxx-slug}.md)
90
+ โ”‚ โ”œโ”€โ”€ rollbacks/ # Reversal audit logs (YYYY-MM-DD-{xxx-slug}.md)
91
+ โ”‚ โ””โ”€โ”€ HISTORY.md # Master release ledger
92
+ โ””โ”€โ”€ discoveries/ # ๐Ÿ” Discoveries: Pre-delivery discovery records (DISC-xxx.md)
93
+ ```
94
+
95
+ ---
96
+
97
+ ## 4. Task-Isolated Living Spec Contract (`spec.md`)
98
+
99
+ Every delivery run operates on `devflow/context/{xxx-slug}/spec.md`, structured into **6 standard sections**:
100
+
101
+ 1. **๐ŸŽฏ 1. Define & Boundaries**: Problem statement, proposed solution, scope boundaries, and non-breaking invariants.
102
+ 2. **๐Ÿ“ 2. Technical Spec & Contracts**: Data contracts, API schemas, and testable Acceptance Criteria (AC-1..AC-N).
103
+ 3. **๐Ÿ“‹ 3. Execution Plan & TDD Checklist**: Sequential task breakdown with granular `[TDD-Red]`, `[TDD-Green]`, and `[TDD-Refactor]` sub-tasks.
104
+ 4. **โšก 4. Implementation Log & Evidence**: Live engineering log recording step-by-step implementation evidence and diffs.
105
+ 5. **๐Ÿงช 5. Multi-Lane Verification Matrix**: Empirical test logs, benchmark data, and manual proof verification.
106
+ 6. **๐Ÿ“ฆ 6. Release Digest & Retrospective**: Release summary, key architectural decisions, and retrospective notes.
107
+
108
+ ---
109
+
110
+ ## 5. Reference Examples
111
+
112
+ For complete markdown templates and living spec examples, refer to:
113
+ - [`devflow/docs/examples/living-spec/current-feature.example.md`](examples/living-spec/current-feature.example.md)
114
+ - [`devflow/docs/examples/living-spec/discovery.example.md`](examples/living-spec/discovery.example.md)
115
+ - [`devflow/docs/examples/living-spec/adr.example.md`](examples/living-spec/adr.example.md)
116
+ - [`devflow/docs/examples/living-spec/ideas.example.md`](examples/living-spec/ideas.example.md)
@@ -0,0 +1,140 @@
1
+ # Markdown Metadata Contract
2
+
3
+ This contract defines the default metadata and heading-tag standard for every Markdown file generated by Nexus-DevFlow agents, workflows, and templates.
4
+
5
+ The goal is to keep Markdown useful in three places simultaneously:
6
+ 1. Human reading in GitHub, code editors, and PR reviews.
7
+ 2. Obsidian vault navigation, graph search, and Dataview-style querying.
8
+ 3. Agent and script indexing without forcing every report type into an unnatural shape.
9
+
10
+ ---
11
+
12
+ ## 1. Core Rule
13
+
14
+ Every generated `.md` file should use a hybrid metadata model:
15
+ 1. A shared **YAML frontmatter core** at the top of the file.
16
+ 2. Optional **type-specific frontmatter fields** based on `doc_type` and `category`.
17
+ 3. **Obsidian-compatible heading tags** at the end of headings for section-level semantic meaning.
18
+
19
+ ---
20
+
21
+ ## 2. Required Frontmatter Core
22
+
23
+ ```yaml
24
+ ---
25
+ id: "md-YYYY-MM-DD-slug"
26
+ title: "Human-readable title"
27
+ doc_type: "report"
28
+ category: "general"
29
+ status: "draft"
30
+ created: "YYYY-MM-DD"
31
+ updated: "YYYY-MM-DD"
32
+ owner: "agent-or-human"
33
+ source_workflow: null
34
+ related_task: null
35
+ related_files: []
36
+ tags:
37
+ - nexus-devflow
38
+ aliases: []
39
+ summary: "One or two sentence summary."
40
+ metadata_version: 1
41
+ ---
42
+ ```
43
+
44
+ ### Required Field Meanings:
45
+
46
+ | Field | Type | Meaning |
47
+ | :--- | :--- | :--- |
48
+ | `id` | string | Stable unique identifier for this document (e.g. `001-user-auth`, `DISC-20260825-001`, `ADR-001`). |
49
+ | `title` | string | Human-readable document title matching or mirroring H1. |
50
+ | `doc_type` | string | Broad document kind (`spec`, `plan`, `discovery`, `decision`, `report`, `guide`, `changelog`). |
51
+ | `category` | string | Workflow category (`planning`, `qa`, `security`, `release`, `architecture`). |
52
+ | `status` | string | Lifecycle state (`draft`, `in-progress`, `completed`, `accepted`, `archived`). |
53
+ | `created` | string | Creation date in `YYYY-MM-DD` format. |
54
+ | `updated` | string | Last update date in `YYYY-MM-DD` format. |
55
+ | `owner` | string | Responsible agent role or human developer. |
56
+ | `source_workflow` | string \| null | Command that produced the document (e.g. `/feature`, `/audit`, `/grill`). |
57
+ | `related_task` | string \| null | Task ID, issue ID, or PR ID. |
58
+ | `related_files` | string[] | Array of repository paths described or affected. |
59
+ | `tags` | string[] | Obsidian tags without `#`. |
60
+ | `aliases` | string[] | Alternative note aliases. |
61
+ | `summary` | string | Short summary for search and index tables. |
62
+ | `metadata_version`| number | Contract version (`1`). |
63
+
64
+ ---
65
+
66
+ ## 3. Optional Frontmatter By Document Type
67
+
68
+ ### A. Living Spec (`current-feature.md`)
69
+ ```yaml
70
+ doc_type: "spec"
71
+ category: "planning"
72
+ stage: "current-feature"
73
+ source_discovery: "DISC-20260825-001"
74
+ source_idea: "IDEA-001"
75
+ ```
76
+
77
+ ### B. Pre-Flight Discovery (`discovery.md`)
78
+ ```yaml
79
+ doc_type: "discovery"
80
+ category: "architecture"
81
+ decision: "Proceed"
82
+ selected_route: "Direct"
83
+ related_ideas: ["IDEA-001"]
84
+ ```
85
+
86
+ ### C. Architecture Decision Record (`ADR-xxx.md`)
87
+ ```yaml
88
+ doc_type: "decision"
89
+ category: "architecture"
90
+ status: "accepted"
91
+ deciders: ["Lead Architect", "Security Auditor"]
92
+ ```
93
+
94
+ ### D. QA Verification & Audit Report
95
+ ```yaml
96
+ doc_type: "report"
97
+ category: "qa"
98
+ qa_result: "pass"
99
+ risk_level: "low"
100
+ finding_count: 0
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 4. Heading Tag Contract
106
+
107
+ Heading tags describe section semantics in Markdown body text (placed at the end of heading lines):
108
+
109
+ ```markdown
110
+ # Living Spec: User Authentication #doc/spec
111
+
112
+ ## ๐ŸŽฏ 1. Define & Boundaries #section/scope
113
+
114
+ ## ๐Ÿ“ 2. Technical Spec & Contracts #section/contracts
115
+
116
+ ## ๐Ÿ“‹ 3. Execution Plan & TDD Checklist #section/tasks
117
+
118
+ ## โšก 4. Implementation Log & Evidence #section/evidence
119
+
120
+ ## ๐Ÿงช 5. Multi-Lane Verification Matrix #section/verification
121
+
122
+ ## ๐Ÿ“ฆ 6. Release Digest & Retrospective #section/summary
123
+ ```
124
+
125
+ ### Standard Section Tags:
126
+ - `#section/summary`, `#section/scope`, `#section/contracts`, `#section/tasks`
127
+ - `#section/evidence`, `#section/verification`, `#section/findings`
128
+ - `#finding/bug`, `#finding/security`, `#finding/performance`, `#finding/gap`
129
+ - `#priority/critical`, `#priority/high`, `#priority/medium`, `#priority/low`
130
+
131
+ ---
132
+
133
+ ## 5. Agent Authoring Checklist
134
+
135
+ Before creating or updating any generated Markdown file:
136
+ - [x] Include the required YAML frontmatter core at the top.
137
+ - [x] Use appropriate `doc_type` and `category`.
138
+ - [x] Ensure tags in frontmatter do not include `#`, while heading tags do include `#`.
139
+ - [x] Keep `updated` timestamp synchronized upon edits.
140
+ - [x] Use relative Markdown file links for cross-document navigation.