@dv.nghiem/flowdeck 0.3.2 → 0.3.4

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 (44) hide show
  1. package/README.md +18 -13
  2. package/dist/hooks/orchestrator-guard-hook.d.ts +4 -1
  3. package/dist/hooks/orchestrator-guard-hook.d.ts.map +1 -1
  4. package/dist/hooks/session-idle-hook.d.ts.map +1 -1
  5. package/dist/hooks/telemetry-hook.d.ts +14 -1
  6. package/dist/hooks/telemetry-hook.d.ts.map +1 -1
  7. package/dist/hooks/telemetry-hook.test.d.ts +2 -0
  8. package/dist/hooks/telemetry-hook.test.d.ts.map +1 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +583 -240
  11. package/dist/tools/council.d.ts.map +1 -1
  12. package/dist/tools/delegate.d.ts.map +1 -1
  13. package/dist/tools/dispatch-routing.d.ts +6 -0
  14. package/dist/tools/dispatch-routing.d.ts.map +1 -0
  15. package/dist/tools/memory-status.d.ts +3 -0
  16. package/dist/tools/memory-status.d.ts.map +1 -0
  17. package/dist/tools/run-pipeline.d.ts.map +1 -1
  18. package/docs/commands.md +102 -9
  19. package/docs/installation.md +6 -17
  20. package/docs/intelligence.md +18 -33
  21. package/docs/optimization-baseline.md +21 -0
  22. package/docs/quick-start.md +44 -23
  23. package/docs/rules.md +9 -36
  24. package/docs/workflows.md +18 -17
  25. package/package.json +4 -2
  26. package/src/commands/fd-execute.md +192 -0
  27. package/src/commands/fd-new-feature.md +44 -157
  28. package/src/commands/fd-new-project.md +1 -2
  29. package/src/commands/fd-plan.md +1 -1
  30. package/src/commands/fd-suggest.md +84 -0
  31. package/src/commands/fd-verify.md +126 -0
  32. package/src/rules/README.md +10 -0
  33. package/src/rules/common/agent-orchestration.md +5 -5
  34. package/src/rules/common/coding-style.md +17 -0
  35. package/src/rules/typescript/patterns.md +1 -1
  36. package/src/skills/backend-patterns/SKILL.md +6 -0
  37. package/src/skills/clean-architecture/SKILL.md +6 -0
  38. package/src/skills/cqrs/SKILL.md +6 -0
  39. package/src/skills/ddd-architecture/SKILL.md +6 -0
  40. package/src/skills/event-driven-architecture/SKILL.md +6 -0
  41. package/src/skills/hexagonal-architecture/SKILL.md +6 -0
  42. package/src/skills/layered-architecture/SKILL.md +6 -0
  43. package/src/skills/postgres-patterns/SKILL.md +6 -0
  44. package/src/skills/saga-architecture/SKILL.md +6 -0
@@ -0,0 +1,126 @@
1
+ ---
2
+ description: Verify feature completion — run full test suite, reviewer, and deploy check against the current phase
3
+ argument-hint: [--phase=N] [--env=staging|production]
4
+ ---
5
+
6
+ # Verify
7
+
8
+ Run the full verification pipeline for the current feature: tests, code review, and deploy check.
9
+
10
+ **Input:** $ARGUMENTS — optional `--phase=N` to target a specific phase, `--env` for deploy check environment
11
+
12
+ ## Pre-flight
13
+
14
+ 1. Check `.planning/STATE.md` exists — if not, error: "Run /fd-new-project first."
15
+ 2. Read current phase N from STATE.md.
16
+ 3. Confirm `steps_complete` in STATE.md is non-empty — if empty, warn: "No steps completed yet. Run /fd-execute first."
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Gather Scope
21
+
22
+ Collect files changed in the current feature:
23
+ ```bash
24
+ git diff --name-only HEAD
25
+ ```
26
+
27
+ If no changed files, use all files in the current phase directory as scope.
28
+
29
+ ### Step 2: Run Checks in Parallel
30
+
31
+ Launch all four checks simultaneously:
32
+
33
+ **Check A: Full Test Suite (@tester)**
34
+ ```bash
35
+ npm test
36
+ ```
37
+ All tests must pass. No failures, no unexplained skips.
38
+
39
+ **Check B: Code Review (@reviewer)**
40
+ Review all changed files:
41
+ - Security: secrets, injection vulnerabilities, auth gaps
42
+ - Quality: critical bugs, missing error handling, TDD discipline
43
+ - Conventions: naming, patterns, import style
44
+ - Test coverage >= 80% for changed files — flag as HIGH if below
45
+
46
+ **Check C: Security Scan (@security-auditor)**
47
+ - No hardcoded secrets
48
+ - Input validation at trust boundaries
49
+ - Auth/authz on all protected routes
50
+ - No CRITICAL or HIGH vulnerabilities
51
+
52
+ **Check D: Deploy Check**
53
+ Run pre-deployment suite:
54
+ ```bash
55
+ npm audit --audit-level=high
56
+ npm run build
57
+ ```
58
+ No HIGH/CRITICAL CVEs. Build must succeed.
59
+
60
+ ### Step 3: Aggregate Results
61
+
62
+ Present consolidated report:
63
+
64
+ ```
65
+ ════════════════════════════════════════════════════
66
+ VERIFICATION: Phase <N> — <feature name>
67
+ ════════════════════════════════════════════════════
68
+
69
+ | Check | Status | Details |
70
+ |---------------|------------------|----------------------|
71
+ | Tests | ✅ PASS / ❌ FAIL | N/N passed |
72
+ | Code Review | ✅ PASS / ❌ FAIL | [findings summary] |
73
+ | Security | ✅ PASS / ❌ FAIL | [findings summary] |
74
+ | CVE Audit | ✅ PASS / ❌ FAIL | [vulnerabilities] |
75
+ | Build | ✅ PASS / ❌ FAIL | [errors] |
76
+
77
+ ────────────────────────────────────────────────────
78
+ Verdict: ✅ VERIFIED | ❌ NOT VERIFIED
79
+ ════════════════════════════════════════════════════
80
+ ```
81
+
82
+ ### Step 4: Go / No-Go
83
+
84
+ **✅ VERIFIED** — all checks pass:
85
+ - Update STATE.md: set `status` to `verified`, `last_action` to `"Phase N verified"`
86
+ - Report next steps (deploy, increment phase, etc.)
87
+
88
+ **❌ NOT VERIFIED** — one or more checks failed:
89
+ ```
90
+ Verdict: NOT VERIFIED
91
+
92
+ Required fixes:
93
+ - [ ] [fix 1]
94
+ - [ ] [fix 2]
95
+
96
+ Run /fd-verify again after fixing.
97
+ ```
98
+ Do NOT update STATE.md to verified status.
99
+
100
+ ## No-Go Conditions (automatic)
101
+
102
+ Any of these → automatic NOT VERIFIED:
103
+ - Test failures
104
+ - CRITICAL security vulnerability
105
+ - HIGH/CRITICAL CVE unpatched
106
+ - Build error
107
+ - Code review CRITICAL finding
108
+
109
+ ## State Update on Success
110
+
111
+ ```yaml
112
+ status: verified
113
+ last_action: "Phase N verified — all checks passed"
114
+ verified_at: "<timestamp>"
115
+ ```
116
+
117
+ ## Error Handling
118
+
119
+ - If `.planning/` not found: error "Run /fd-new-project first."
120
+ - If STATE.md not found: error "Project not initialized."
121
+ - If test runner not found: error with remediation (e.g., "No test script in package.json")
122
+ - No partial state update on error.
123
+
124
+ ## Completion
125
+
126
+ Report: verification result, check statuses, any required fixes, and suggested next step.
@@ -6,6 +6,16 @@ Coding standards for projects using FlowDeck. These define conventions that Flow
6
6
 
7
7
  Rules are loaded **automatically** by the FlowDeck plugin. No manual configuration is needed — when FlowDeck is installed, all rule files in this directory are injected into OpenCode's `instructions` at startup.
8
8
 
9
+ ## Rule Precedence
10
+
11
+ When guidance conflicts, FlowDeck resolves precedence in this order:
12
+
13
+ 1. Repository governance files (`AGENTS.md`, `CLAUDE.md`)
14
+ 2. FlowDeck plugin rules from `src/rules/**`
15
+ 3. Runtime policies from `.codebase/POLICIES.json`
16
+
17
+ This keeps repository-specific expectations authoritative while still allowing runtime policy learning.
18
+
9
19
  ## Selective Rules (Optional)
10
20
 
11
21
  If you want to override the default set and load only specific rules, add them to `opencode.json` under `instructions`:
@@ -15,7 +15,7 @@ FlowDeck provides 23 specialist agents. Each has a specific role. Using the righ
15
15
  | `@discusser` | Extract requirements via Q&A | Starting a new feature or phase |
16
16
  | `@doc-updater` | Update docs after code changes | After implementation completes |
17
17
  | `@plan-checker` | Review PLAN.md before execution | Before executing any plan |
18
- | `@mapper` | Map codebase to .codebase/ docs | Running /map-codebase |
18
+ | `@mapper` | Map codebase to .codebase/ docs | Running /fd-map-codebase |
19
19
  | `@orchestrator` | Coordinate multi-agent execution | Managing a full feature delivery |
20
20
  | `@parallel-coordinator` | Run parallel agent workstreams | When tasks can run simultaneously |
21
21
  | `@performance-optimizer` | Profile and fix performance issues | When app is slow or before release |
@@ -76,9 +76,9 @@ discuss → plan → execute → review
76
76
 
77
77
  | Phase | Agent | Command |
78
78
  |-------|-------|---------|
79
- | discuss | `@discusser` | `/discuss` |
80
- | plan | `@planner` → `@plan-checker` | `/plan` |
81
- | execute | `@orchestrator` → `@coder`, `@tester`, etc. | `/new-feature` |
82
- | review | `@reviewer` + `@security-auditor` | `/review-code` |
79
+ | discuss | `@discusser` | `/fd-discuss` |
80
+ | plan | `@planner` → `@plan-checker` | `/fd-plan` |
81
+ | execute | `@orchestrator` → `@coder`, `@tester`, etc. | `/fd-new-feature` |
82
+ | review | `@reviewer` + `@security-auditor` | `/fd-review-code` |
83
83
 
84
84
  Do not skip phases. The orchestrator enforces phase gating automatically.
@@ -2,6 +2,23 @@
2
2
 
3
3
  Language-agnostic coding conventions followed by all FlowDeck agents.
4
4
 
5
+ ## Core Principles
6
+
7
+ | # | Rule | Description |
8
+ |---|------|-------------|
9
+ | 1 | **No Redundant Code** | No redundant arguments, methods, or attributes. Each piece of code must serve a purpose. |
10
+ | 2 | **Simplicity** | Code should be simple and easy to understand. Prefer clarity over cleverness. |
11
+ | 3 | **Clear Commands** | Code should have clear, explicit commands. No ambiguity in intent. |
12
+ | 4 | **Extensibility** | Prefer minimal designs for current requirements. Add extension points only when required by active scope. |
13
+ | 5 | **Documentation** | Add comments when needed to explain non-obvious tradeoffs or constraints; avoid boilerplate file headers. |
14
+ | 6 | **Information Security** | Comply with information security best practices. No secrets, no injections, no XSS. |
15
+ | 7 | **Memory Optimization** | Optimize memory usage to the minimum possible. Avoid unnecessary allocations. |
16
+ | 8 | **Speed** | Process speed should be as fast as possible. Prefer efficient algorithms and data structures. |
17
+ | 9 | **Single Responsibility** | Each function/class does one thing well. Easier to test, debug, and extend. |
18
+ | 10 | **Testability** | Code should be easy to test in isolation. Avoid hidden dependencies and global state. |
19
+ | 11 | **Consistency** | Follow existing patterns in the codebase. Consistency over personal preference. |
20
+ | 12 | **Resource Cleanup** | Always release resources (connections, file handles, timers). Use try-finally or defer. |
21
+
5
22
  ## Immutability
6
23
 
7
24
  Always create new objects and arrays. Never mutate parameters.
@@ -102,7 +102,7 @@ class UserService {
102
102
 
103
103
  ## Result Types for Error Handling
104
104
 
105
- Never throw in business logic. Use Result types.
105
+ Prefer explicit error contracts (Result types or typed exceptions) for business logic. Use one pattern consistently within a module.
106
106
 
107
107
  ```typescript
108
108
  type Ok<T> = { ok: true; value: T };
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: backend-patterns
3
+ description: Backend architecture patterns for services, APIs, data access, and middleware design.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # backend-patterns
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: clean-architecture
3
+ description: Apply Clean Architecture boundaries to keep domain logic isolated from frameworks and infrastructure.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # clean-architecture
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: cqrs
3
+ description: Command Query Responsibility Segregation patterns for separating write and read models.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # CQRS (Command Query Responsibility Segregation)
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: ddd-architecture
3
+ description: Domain-Driven Design patterns for bounded contexts, aggregates, and ubiquitous language.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # ddd-architecture
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: event-driven-architecture
3
+ description: Event-driven architecture patterns for asynchronous workflows and decoupled services.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # Event-Driven Architecture
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: hexagonal-architecture
3
+ description: Ports-and-adapters architecture patterns for testable, framework-independent domain logic.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # hexagonal-architecture
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: layered-architecture
3
+ description: Layered architecture patterns for separating presentation, application, domain, and data layers.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # layered-architecture
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: postgres-patterns
3
+ description: PostgreSQL schema, query, indexing, and performance patterns.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # postgres-patterns
2
8
 
3
9
  ## When to Activate
@@ -1,3 +1,9 @@
1
+ ---
2
+ name: saga-architecture
3
+ description: Saga coordination patterns for distributed transactions with compensating actions.
4
+ origin: FlowDeck
5
+ ---
6
+
1
7
  # saga-architecture
2
8
 
3
9
  ## When to Activate