@dv.nghiem/flowdeck 0.3.9 → 0.4.1
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.
- package/README.md +13 -21
- package/dist/agents/code-explorer.d.ts.map +1 -1
- package/dist/agents/mapper.d.ts.map +1 -1
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/planner.d.ts.map +1 -1
- package/dist/agents/specialist.d.ts.map +1 -1
- package/dist/dashboard/server.mjs +12 -2
- package/dist/hooks/compaction-hook.d.ts +1 -2
- package/dist/hooks/compaction-hook.d.ts.map +1 -1
- package/dist/hooks/file-tracker.d.ts +6 -0
- package/dist/hooks/file-tracker.d.ts.map +1 -1
- package/dist/hooks/notifications.d.ts +73 -8
- package/dist/hooks/notifications.d.ts.map +1 -1
- package/dist/hooks/notifications.test.d.ts +14 -0
- package/dist/hooks/notifications.test.d.ts.map +1 -0
- package/dist/hooks/session-idle-hook.d.ts +5 -3
- package/dist/hooks/session-idle-hook.d.ts.map +1 -1
- package/dist/hooks/session-start.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +822 -796
- package/dist/lib/completion-validator.d.ts +51 -0
- package/dist/lib/completion-validator.d.ts.map +1 -0
- package/dist/lib/recommended-question.d.ts +24 -0
- package/dist/lib/recommended-question.d.ts.map +1 -0
- package/dist/lib/research-gate.d.ts +97 -0
- package/dist/lib/research-gate.d.ts.map +1 -0
- package/dist/lib/research-gate.test.d.ts +2 -0
- package/dist/lib/research-gate.test.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +12 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/services/codegraph.d.ts +36 -0
- package/dist/services/codegraph.d.ts.map +1 -0
- package/dist/services/codegraph.test.d.ts +2 -0
- package/dist/services/codegraph.test.d.ts.map +1 -0
- package/dist/services/question-guard.d.ts +4 -0
- package/dist/services/question-guard.d.ts.map +1 -1
- package/dist/services/recommended-question.test.d.ts +2 -0
- package/dist/services/recommended-question.test.d.ts.map +1 -0
- package/dist/services/supervisor-binding.d.ts +3 -1
- package/dist/services/supervisor-binding.d.ts.map +1 -1
- package/dist/tools/codebase-index.d.ts +30 -0
- package/dist/tools/codebase-index.d.ts.map +1 -0
- package/dist/tools/codebase-index.test.d.ts +2 -0
- package/dist/tools/codebase-index.test.d.ts.map +1 -0
- package/dist/tools/codegraph-tool.d.ts +3 -0
- package/dist/tools/codegraph-tool.d.ts.map +1 -0
- package/dist/tools/planning-state-lib.d.ts +23 -0
- package/dist/tools/planning-state-lib.d.ts.map +1 -1
- package/docs/agents/index.md +154 -0
- package/docs/commands/fd-ask.md +71 -39
- package/docs/commands/fd-checkpoint.md +63 -8
- package/docs/commands/fd-deploy-check.md +166 -9
- package/docs/commands/fd-design.md +101 -0
- package/docs/commands/fd-discuss.md +87 -20
- package/docs/commands/fd-doctor.md +100 -13
- package/docs/commands/fd-done.md +215 -0
- package/docs/commands/fd-execute.md +104 -0
- package/docs/commands/fd-fix-bug.md +144 -24
- package/docs/commands/fd-map-codebase.md +85 -21
- package/docs/commands/fd-multi-repo.md +155 -40
- package/docs/commands/fd-new-feature.md +63 -19
- package/docs/commands/fd-plan.md +80 -27
- package/docs/commands/fd-quick.md +143 -29
- package/docs/commands/fd-reflect.md +81 -13
- package/docs/commands/fd-resume.md +65 -8
- package/docs/commands/fd-status.md +80 -12
- package/docs/commands/fd-suggest.md +114 -0
- package/docs/commands/fd-translate-intent.md +69 -9
- package/docs/commands/fd-verify.md +71 -14
- package/docs/commands/fd-write-docs.md +121 -8
- package/docs/concepts/architecture.md +163 -0
- package/docs/concepts/governance.md +242 -0
- package/docs/concepts/intelligence.md +145 -0
- package/docs/concepts/multi-repo.md +227 -0
- package/docs/concepts/workflows.md +205 -0
- package/docs/configuration/index.md +208 -0
- package/docs/configuration/opencode-settings.md +98 -0
- package/docs/getting-started/first-project.md +126 -0
- package/docs/getting-started/installation.md +73 -0
- package/docs/getting-started/quick-start.md +74 -0
- package/docs/index.md +36 -72
- package/docs/reference/hooks.md +176 -0
- package/docs/reference/rules.md +109 -0
- package/docs/skills/code-review.md +47 -0
- package/docs/skills/index.md +148 -0
- package/docs/skills/planning.md +39 -0
- package/package.json +1 -1
- package/src/commands/fd-discuss.md +74 -10
- package/src/commands/fd-done.md +196 -0
- package/src/commands/fd-execute.md +43 -6
- package/src/commands/fd-fix-bug.md +43 -6
- package/src/commands/fd-map-codebase.md +99 -19
- package/src/commands/fd-new-feature.md +14 -5
- package/src/commands/fd-plan.md +38 -1
- package/src/commands/fd-quick.md +1 -1
- package/src/commands/fd-resume.md +1 -1
- package/src/commands/fd-status.md +1 -1
- package/src/commands/fd-verify.md +16 -2
- package/src/commands/fd-write-docs.md +30 -5
- package/src/skills/context-load/SKILL.md +1 -1
- package/dist/hooks/memory-hook.d.ts +0 -28
- package/dist/hooks/memory-hook.d.ts.map +0 -1
- package/dist/services/memory-store.d.ts +0 -73
- package/dist/services/memory-store.d.ts.map +0 -1
- package/dist/services/memory-store.test.d.ts +0 -2
- package/dist/services/memory-store.test.d.ts.map +0 -1
- package/dist/tools/memory-search.d.ts +0 -3
- package/dist/tools/memory-search.d.ts.map +0 -1
- package/dist/tools/memory-status.d.ts +0 -3
- package/dist/tools/memory-status.d.ts.map +0 -1
- package/docs/USER_GUIDE.md +0 -20
- package/docs/agents.md +0 -544
- package/docs/best-practices.md +0 -47
- package/docs/commands/fd-new-project.md +0 -24
- package/docs/commands.md +0 -557
- package/docs/configuration.md +0 -325
- package/docs/design-first-workflow.md +0 -94
- package/docs/feature-integration-architecture.md +0 -227
- package/docs/installation.md +0 -123
- package/docs/intelligence.md +0 -370
- package/docs/memory.md +0 -69
- package/docs/multi-repo.md +0 -201
- package/docs/notifications.md +0 -170
- package/docs/optimization-baseline.md +0 -21
- package/docs/quick-start.md +0 -197
- package/docs/rules.md +0 -432
- package/docs/skills.md +0 -417
- package/docs/workflows.md +0 -134
- package/src/commands/fd-new-project.md +0 -114
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# System Hooks Reference
|
|
2
|
+
|
|
3
|
+
FlowDeck implements deep system hooks that react to OpenCode lifecycle events. These hooks maintain session state, inject environment context, monitor resource usage, and send notifications without requiring any explicit commands.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Hooks Overview
|
|
8
|
+
|
|
9
|
+
| Hook | Fires On | Purpose |
|
|
10
|
+
|------|----------|---------|
|
|
11
|
+
| `session-start` | `session.created` | Loads and injects prior planning state into the new session |
|
|
12
|
+
| `compaction` | `experimental.session.compacting` | Preserves planning context before context window compaction |
|
|
13
|
+
| `shell-env` | Every `bash` tool execution | Injects FlowDeck environment variables |
|
|
14
|
+
| `context-window-monitor` | `message.updated`, `tool.execute.after` | Warns when context usage exceeds 70% of the token limit |
|
|
15
|
+
| `session-idle` | `session.idle` (when files edited) | Desktop notification and edits summary logging |
|
|
16
|
+
| `notifications` | Various | Desktop notification dispatch |
|
|
17
|
+
| `file-tracker` | During session | Tracks edited file paths across agent turns |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## `session-start` Hook
|
|
22
|
+
|
|
23
|
+
**File:** `src/hooks/session-start.ts`
|
|
24
|
+
|
|
25
|
+
**Fires:** `session.created` — when a new OpenCode session starts.
|
|
26
|
+
|
|
27
|
+
**What it does:**
|
|
28
|
+
|
|
29
|
+
Reads `.planning/STATE.md` from the workspace and injects the following context keys:
|
|
30
|
+
|
|
31
|
+
| Context Key | Source | Description |
|
|
32
|
+
|------------|--------|-------------|
|
|
33
|
+
| `flowdeck_phase` | `current_phase.phase` in STATE.md | Current planning phase or `null` if fresh |
|
|
34
|
+
| `flowdeck_status` | `current_phase.status` in STATE.md | Phase status or `null` |
|
|
35
|
+
| `flowdeck_steps_pending` | `current_phase.steps_pending` in STATE.md | Pending steps or `null` |
|
|
36
|
+
| `flowdeck_last_action` | `current_phase.last_action` in STATE.md | Last executed action or `null` |
|
|
37
|
+
| `flowdeck_has_codebase` | — | Whether `.codebase/` directory exists |
|
|
38
|
+
| `flowdeck_workspace_root` | `opencode.json` workspace config | Workspace root if multi-repo detected |
|
|
39
|
+
| `flowdeck_sub_repos` | `opencode.json` workspace config | List of sub-repositories |
|
|
40
|
+
| `flowdeck_workspace_mode` | `opencode.json` workspace config | Workspace mode |
|
|
41
|
+
|
|
42
|
+
**State read:**
|
|
43
|
+
- `.planning/STATE.md`
|
|
44
|
+
- `.codebase/` (existence check only)
|
|
45
|
+
- `opencode.json` (workspace config, if present)
|
|
46
|
+
|
|
47
|
+
**Errors:** If the state file is unreadable, the hook returns with `flowdeck_status: "error"` and a warning message — it does not block session startup.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## `compaction` Hook
|
|
52
|
+
|
|
53
|
+
**File:** `src/hooks/compaction-hook.ts`
|
|
54
|
+
|
|
55
|
+
**Fires:** `experimental.session.compacting` — when OpenCode triggers context window compaction.
|
|
56
|
+
|
|
57
|
+
**What it does:**
|
|
58
|
+
|
|
59
|
+
Injects a structured 8-section summary into the compaction context so the LLM summarization preserves FlowDeck-specific state:
|
|
60
|
+
|
|
61
|
+
1. **Planning State** — First 1500 characters of `.planning/STATE.md`
|
|
62
|
+
2. **Codebase Index** — First 800 characters of `.planning/CODEBASE_INDEX.md` (if present)
|
|
63
|
+
3. **Recently Edited Files** — Up to 20 files from `SessionFileTracker`
|
|
64
|
+
|
|
65
|
+
Then replaces the default summarization prompt with a structured template that requires the summary to include:
|
|
66
|
+
- User requests (verbatim)
|
|
67
|
+
- Final goal
|
|
68
|
+
- Work completed
|
|
69
|
+
- Remaining tasks
|
|
70
|
+
- Active working context
|
|
71
|
+
- Explicit constraints (verbatim)
|
|
72
|
+
- Verification state
|
|
73
|
+
- Delegated agent sessions (with `session_id` for resume)
|
|
74
|
+
|
|
75
|
+
**State read:**
|
|
76
|
+
- `.planning/STATE.md`
|
|
77
|
+
- `.planning/CODEBASE_INDEX.md`
|
|
78
|
+
- In-memory `SessionFileTracker` (edited paths ring buffer)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## `shell-env` Hook
|
|
83
|
+
|
|
84
|
+
**File:** `src/hooks/shell-env-hook.ts`
|
|
85
|
+
|
|
86
|
+
**Fires:** Every `bash` tool execution.
|
|
87
|
+
|
|
88
|
+
**What it does:**
|
|
89
|
+
|
|
90
|
+
Injects the following environment variables into every bash tool execution:
|
|
91
|
+
|
|
92
|
+
| Env Var | Source | Description |
|
|
93
|
+
|---------|--------|-------------|
|
|
94
|
+
| `FLOWDECK_VERSION` | `package.json` | Installed FlowDeck version |
|
|
95
|
+
| `FLOWDECK_PLUGIN` | `"true"` (constant) | Plugin activation flag |
|
|
96
|
+
| `PROJECT_ROOT` | `worktree` or `directory` | Resolved project root |
|
|
97
|
+
| `PACKAGE_MANAGER` | Detected lockfile | `npm`, `yarn`, `pnpm`, or `bun` |
|
|
98
|
+
| `DETECTED_LANGUAGES` | Marker files scan | Comma-separated list (e.g., `typescript,python`) |
|
|
99
|
+
| `PRIMARY_LANGUAGE` | Marker files scan | First detected language |
|
|
100
|
+
| `FLOWDECK_PHASE` | `STATE.md` phase field | Current FlowDeck planning phase |
|
|
101
|
+
|
|
102
|
+
Language detection uses marker files: `tsconfig.json` (TypeScript), `go.mod` (Go), `pyproject.toml`/`requirements.txt` (Python), `Cargo.toml` (Rust), `build.gradle`/`pom.xml` (Java).
|
|
103
|
+
|
|
104
|
+
**State read:** `package.json`, lockfiles, marker files, `.planning/STATE.md`
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## `context-window-monitor` Hook
|
|
109
|
+
|
|
110
|
+
**File:** `src/hooks/context-window-monitor.ts`
|
|
111
|
+
|
|
112
|
+
**Fires:** `message.updated` (assistant messages with token info), `tool.execute.after`.
|
|
113
|
+
|
|
114
|
+
**What it does:**
|
|
115
|
+
|
|
116
|
+
Tracks token usage per session. When input token usage exceeds 70% of `FLOWDECK_CONTEXT_LIMIT` (default: 200,000 tokens), appends a warning to the next tool output:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
[FlowDeck Context Monitor]
|
|
120
|
+
Context: 71.4% used (142,800/200,000 tokens), 28.6% remaining.
|
|
121
|
+
You still have context remaining — do NOT rush or skip tasks. Work thoroughly.
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The warning fires once per session (tracked by `sessionID`).
|
|
125
|
+
|
|
126
|
+
**Token limit override:** Set `FLOWDECK_CONTEXT_LIMIT` env var (e.g., `FLOWDECK_CONTEXT_LIMIT=150000`).
|
|
127
|
+
|
|
128
|
+
**State read:** Per-session token cache from `message.updated` events.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## `session-idle` Hook
|
|
133
|
+
|
|
134
|
+
**File:** `src/hooks/session-idle-hook.ts`
|
|
135
|
+
|
|
136
|
+
**Fires:** `session.idle` — when OpenCode's session becomes idle after a task is completed.
|
|
137
|
+
|
|
138
|
+
**Fires only when:** At least one file has been edited during the session (empty idle events are ignored).
|
|
139
|
+
|
|
140
|
+
**What it does:**
|
|
141
|
+
|
|
142
|
+
1. Sends a desktop notification via `notifySessionIdle()`
|
|
143
|
+
2. Logs a session summary via `client.app.log` (up to 10 edited files, then `… and N more`)
|
|
144
|
+
|
|
145
|
+
**State read:** In-memory `SessionFileTracker` (edited paths ring buffer).
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## `file-tracker`
|
|
150
|
+
|
|
151
|
+
**File:** `src/hooks/file-tracker.ts`
|
|
152
|
+
|
|
153
|
+
**When it runs:** Continuously during session, tracking every file path edited by agents.
|
|
154
|
+
|
|
155
|
+
**What it does:**
|
|
156
|
+
|
|
157
|
+
Maintains a ring buffer of edited file paths. Consumed by the `compaction` hook (recently edited files) and `session-idle` hook (edited summary).
|
|
158
|
+
|
|
159
|
+
Implements a windowed snapshot of edited paths per session — consumed by compaction hook and idle hook.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Other Hooks
|
|
164
|
+
|
|
165
|
+
| Hook | File | Purpose |
|
|
166
|
+
|------|------|---------|
|
|
167
|
+
| `approval-hook` | `approval-hook.ts` | Phase/project-level approval gates |
|
|
168
|
+
| `orchestrator-guard-hook` | `orchestrator-guard-hook.ts` | Guarding orchestrator delegation patterns |
|
|
169
|
+
| `decision-trace-hook` | `decision-trace-hook.ts` | Decision audit trail |
|
|
170
|
+
| `telemetry-hook` | `telemetry-hook.ts` | Workflow telemetry |
|
|
171
|
+
| `patch-trust` | `patch-trust.ts` | AI safety: patch trust scoring |
|
|
172
|
+
| `tool-guard` | `tool-guard.ts` | Tool usage guardrails |
|
|
173
|
+
| `auto-learn-hook` | `auto-learn-hook.ts` | Runtime policy learning |
|
|
174
|
+
| `todo-hook` | `todo-hook.ts` | Todo tracking integration |
|
|
175
|
+
|
|
176
|
+
These hooks are internal governance and safety mechanisms. The five hooks described above are the ones users interact with most directly.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Language Rules
|
|
2
|
+
|
|
3
|
+
FlowDeck agents follow coding standards defined in `src/rules/`. Rules are loaded automatically at startup — no manual configuration required. They are injected into OpenCode's instructions as language-agnostic and language-specific guidance.
|
|
4
|
+
|
|
5
|
+
## Rule Precedence
|
|
6
|
+
|
|
7
|
+
When guidance conflicts, FlowDeck resolves precedence in this order:
|
|
8
|
+
|
|
9
|
+
1. Repository governance files (`AGENTS.md`, `CLAUDE.md`)
|
|
10
|
+
2. FlowDeck plugin rules from `src/rules/**`
|
|
11
|
+
3. Runtime policies from `.codebase/POLICIES.json`
|
|
12
|
+
|
|
13
|
+
## Common Rules (All Languages)
|
|
14
|
+
|
|
15
|
+
Language-agnostic rules are in `src/rules/common/`:
|
|
16
|
+
|
|
17
|
+
| File | Description |
|
|
18
|
+
|------|-------------|
|
|
19
|
+
| `common/agent-orchestration.md` | When to use each FlowDeck agent and parallel execution patterns |
|
|
20
|
+
| `common/coding-style.md` | Immutability, KISS/DRY/YAGNI, file organization, error handling, naming |
|
|
21
|
+
| `common/testing.md` | TDD workflow, coverage thresholds, test types, AAA pattern |
|
|
22
|
+
| `common/security.md` | Pre-commit security checklist, secret management, OWASP Top 10 |
|
|
23
|
+
| `common/git-workflow.md` | Conventional commits, branch naming, PR workflow, rebase vs merge |
|
|
24
|
+
| `common/behavioral.md` | Agent behavioral expectations and interaction patterns |
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## TypeScript / JavaScript
|
|
29
|
+
|
|
30
|
+
**Location:** `src/rules/typescript/`
|
|
31
|
+
|
|
32
|
+
**Framework conventions:** API response format, custom hooks, repository pattern, Result types.
|
|
33
|
+
|
|
34
|
+
| File | Description |
|
|
35
|
+
|------|-------------|
|
|
36
|
+
| `typescript/patterns.md` | TypeScript API response format, custom hooks, repository pattern, Result types |
|
|
37
|
+
|
|
38
|
+
FlowDeck TypeScript rules apply to all `.ts` and `.tsx` files in your project.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Python
|
|
43
|
+
|
|
44
|
+
**Location:** `src/rules/python/`
|
|
45
|
+
|
|
46
|
+
**Framework conventions:** Pythonic patterns, typing, async conventions.
|
|
47
|
+
|
|
48
|
+
| File | Description |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| `python/patterns.md` | Pythonic API design, typing, async patterns |
|
|
51
|
+
|
|
52
|
+
FlowDeck Python rules apply to all `.py` files in your project.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Go
|
|
57
|
+
|
|
58
|
+
**Location:** `src/rules/golang/`
|
|
59
|
+
|
|
60
|
+
**Framework conventions:** Go idiom conventions, error handling, concurrency patterns.
|
|
61
|
+
|
|
62
|
+
| File | Description |
|
|
63
|
+
|------|-------------|
|
|
64
|
+
| `golang/patterns.md` | Go idioms, error wrapping, goroutine patterns, module layout |
|
|
65
|
+
|
|
66
|
+
FlowDeck Go rules apply to all `.go` files in your project.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Rust
|
|
71
|
+
|
|
72
|
+
**Location:** `src/rules/rust/`
|
|
73
|
+
|
|
74
|
+
**Framework conventions:** Rust idiom conventions, ownership, lifetimes, Result types.
|
|
75
|
+
|
|
76
|
+
| File | Description |
|
|
77
|
+
|------|-------------|
|
|
78
|
+
| `rust/patterns.md` | Rust idioms, ownership model, error handling with `Result`, lifetime annotations |
|
|
79
|
+
|
|
80
|
+
FlowDeck Rust rules apply to all `.rs` files in your project.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Java
|
|
85
|
+
|
|
86
|
+
**Location:** `src/rules/java/`
|
|
87
|
+
|
|
88
|
+
**Framework conventions:** Java idiom conventions, OOP patterns, exception handling.
|
|
89
|
+
|
|
90
|
+
| File | Description |
|
|
91
|
+
|------|-------------|
|
|
92
|
+
| `java/patterns.md` | Java idioms, OOP conventions, exception handling, package layout |
|
|
93
|
+
|
|
94
|
+
FlowDeck Java rules apply to all `.java` files in your project.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Overriding Default Rules
|
|
99
|
+
|
|
100
|
+
To load only specific rules, add them to the `instructions` array in `opencode.json`:
|
|
101
|
+
|
|
102
|
+
```json
|
|
103
|
+
{
|
|
104
|
+
"instructions": [
|
|
105
|
+
"node_modules/@dv.nghiem/flowdeck/src/rules/common/coding-style.md",
|
|
106
|
+
"node_modules/@dv.nghiem/flowdeck/src/rules/typescript/patterns.md"
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Code Quality Skills
|
|
2
|
+
|
|
3
|
+
These skills enforce FlowDeck's "working code only" guarantee — systematic review, test-driven discipline, and coverage enforcement that catches real problems before they reach production.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## code-review
|
|
8
|
+
|
|
9
|
+
Systematic review with security checklist and severity-ranked findings.
|
|
10
|
+
|
|
11
|
+
Reviews only changed code, reports only confirmed issues (80%+ confidence), and provides actionable fixes for every finding. Findings are ranked Critical then High then Medium then Pass. Security checklist runs first — SQL injection, XSS, hardcoded credentials, path traversal — before quality and performance checks.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## tdd-workflow
|
|
16
|
+
|
|
17
|
+
Red-green-refactor discipline with 80%+ coverage enforcement.
|
|
18
|
+
|
|
19
|
+
Tests before code. Always. The workflow: write a failing test (Red), write minimum code to pass (Green), then refactor while keeping tests green. Coverage threshold is 80% line coverage — non-negotiable. Unit tests for every function, integration tests for every API route, E2E only for critical paths.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## test-coverage
|
|
24
|
+
|
|
25
|
+
Coverage enforcement with pass/fail thresholds and actionable failure output.
|
|
26
|
+
|
|
27
|
+
Drives the write-test-then-implement cycle. Enforces 80% minimum line coverage. When coverage drops below threshold or a gap is found, the report identifies exact uncovered lines with file and line number so the agent knows exactly what to add.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## test-gap-detector
|
|
32
|
+
|
|
33
|
+
Identifies uncovered edge cases and suggests minimum viable test sets.
|
|
34
|
+
|
|
35
|
+
Runs before implementing a feature or fix. Checks whether modified files have test counterparts, scans for untested if/else/catch branches, flags integration gaps for external calls (db, fetch, email), and cross-references `.codebase/FAILURES.json` for regression risk. Output is a ranked gap list and 3-5 suggested test skeletons.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## refactor-guide
|
|
40
|
+
|
|
41
|
+
Safe refactoring one transformation at a time — tests must stay green throughout.
|
|
42
|
+
|
|
43
|
+
One transformation per commit. No features in refactor commits. If any test breaks, undo and try a smaller step. Applies the extract-function, extract-variable, and rename patterns. Danger signs that stop the refactor immediately: tests breaking during refactor, adding features during refactor, renaming and moving in the same commit.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
Source: `src/skills/<name>/SKILL.md` in the project repository.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Skills
|
|
2
|
+
|
|
3
|
+
Skills are reusable workflow patterns that encode FlowDeck's best practices into automated agents. Each skill is a self-contained unit with activation triggers, core principles, and step-by-step workflows.
|
|
4
|
+
|
|
5
|
+
## How to Activate
|
|
6
|
+
|
|
7
|
+
Skills activate in two ways:
|
|
8
|
+
|
|
9
|
+
- **Slash command**: Type `/<skill-name>` (e.g., `/fd-plan`, `/fd-code-review`)
|
|
10
|
+
- **Auto-trigger**: FlowDeck hooks can invoke skills automatically based on context (e.g., `code-review` triggers after every code write, `deploy-check` before any deploy)
|
|
11
|
+
|
|
12
|
+
## Skill Taxonomy
|
|
13
|
+
|
|
14
|
+
### Planning & Requirements
|
|
15
|
+
|
|
16
|
+
| Skill | Description |
|
|
17
|
+
|-------|-------------|
|
|
18
|
+
| `plan-task` | Wave-structured task breakdown for multi-file features |
|
|
19
|
+
| `confidence-aware-planning` | Uncertainty-aware estimates — asks clarifying questions when confidence is low |
|
|
20
|
+
| `intent-translator` | Converts vague requests ("make it faster") into ranked implementation options with tradeoffs |
|
|
21
|
+
| `decision-trace` | Records why changes were made, what evidence was used, and what assumptions were made |
|
|
22
|
+
|
|
23
|
+
Source files live in `src/skills/<name>/SKILL.md` in the project repository.
|
|
24
|
+
|
|
25
|
+
### Architecture
|
|
26
|
+
|
|
27
|
+
| Skill | Description |
|
|
28
|
+
|-------|-------------|
|
|
29
|
+
| `clean-architecture` | Layered architecture with independent use cases |
|
|
30
|
+
| `hexagonal-architecture` | Ports-and-adapters pattern for testable business logic |
|
|
31
|
+
| `layered-architecture` | Traditional UI / business logic / data layer separation |
|
|
32
|
+
| `ddd-architecture` | Domain-driven design with bounded contexts and aggregates |
|
|
33
|
+
| `saga-architecture` | Distributed transaction pattern for microservices |
|
|
34
|
+
| `event-driven-architecture` | Event-based decoupling between services |
|
|
35
|
+
| `cqrs` | Command-query responsibility segregation for read/write optimization |
|
|
36
|
+
|
|
37
|
+
### Code Quality
|
|
38
|
+
|
|
39
|
+
| Skill | Description |
|
|
40
|
+
|-------|-------------|
|
|
41
|
+
| `code-review` | Systematic review with security checklist and severity-ranked findings |
|
|
42
|
+
| `tdd-workflow` | Red-green-refactor discipline with 80%+ coverage enforcement |
|
|
43
|
+
| `test-coverage` | Coverage enforcement with pass/fail thresholds |
|
|
44
|
+
| `test-gap-detector` | Identifies uncovered edge cases and suggests minimum viable test sets |
|
|
45
|
+
| `refactor-guide` | Safe refactoring patterns — one transformation per commit, tests stay green |
|
|
46
|
+
|
|
47
|
+
Source files live in `src/skills/<name>/SKILL.md` in the project repository.
|
|
48
|
+
|
|
49
|
+
### Security
|
|
50
|
+
|
|
51
|
+
| Skill | Description |
|
|
52
|
+
|-------|-------------|
|
|
53
|
+
| `security-scan` | Scans for OWASP vulnerabilities, injection risks, and credential leakage |
|
|
54
|
+
| `patch-trust-score` | Scores patch reliability based on changelog, age, and publisher reputation |
|
|
55
|
+
| `arch-constraint-guard` | Enforces architectural constraints at commit time |
|
|
56
|
+
| `self-healing-policies` | Automatic rollback and recovery policies for failed deployments |
|
|
57
|
+
|
|
58
|
+
### Deployment
|
|
59
|
+
|
|
60
|
+
| Skill | Description |
|
|
61
|
+
|-------|-------------|
|
|
62
|
+
| `deploy-check` | Pre-deploy safety verification — runs tests, checks coverage, validates config |
|
|
63
|
+
| `git-release` | Semantic version tagging and CHANGELOG generation for releases |
|
|
64
|
+
|
|
65
|
+
### Performance
|
|
66
|
+
|
|
67
|
+
| Skill | Description |
|
|
68
|
+
|-------|-------------|
|
|
69
|
+
| `performance-profiling` | Identifies hot paths and memory bottlenecks from profiling data |
|
|
70
|
+
| `volatility-map` | Maps codebase areas by change frequency to predict impact zones |
|
|
71
|
+
| `blast-radius-preview` | Estimates blast radius of a proposed change before it is merged |
|
|
72
|
+
| `dependency-audit` | Scans for outdated, vulnerable, or circular dependencies |
|
|
73
|
+
|
|
74
|
+
### Frontend
|
|
75
|
+
|
|
76
|
+
| Skill | Description |
|
|
77
|
+
|-------|-------------|
|
|
78
|
+
| `frontend-pattern` | General frontend implementation patterns |
|
|
79
|
+
| `ui-design` | Component-level UI design patterns |
|
|
80
|
+
| `landing-page-design` | Landing page layout and conversion patterns |
|
|
81
|
+
| `dashboard-design` | Dashboard layout and data visualization patterns |
|
|
82
|
+
| `design-tokens` | Design tokens for consistent theming |
|
|
83
|
+
| `app-shell-design` | Application shell and navigation patterns |
|
|
84
|
+
| `wireframe-planning` | Low-fidelity wireframe to structured layout planning |
|
|
85
|
+
| `design-audit` | Design consistency and accessibility review |
|
|
86
|
+
| `ui-ux-planning` | Full UI/UX planning from user flow to component specs |
|
|
87
|
+
| `responsive-review` | Responsive design verification across breakpoints |
|
|
88
|
+
| `frontend-handoff` | Design-to-code handoff specification |
|
|
89
|
+
|
|
90
|
+
### Backend
|
|
91
|
+
|
|
92
|
+
| Skill | Description |
|
|
93
|
+
|-------|-------------|
|
|
94
|
+
| `backend-patterns` | General backend service patterns |
|
|
95
|
+
| `golang-patterns` | Go-specific patterns (goroutines, channels, error handling) |
|
|
96
|
+
| `java-patterns` | Java/JVM patterns (Spring, concurrency) |
|
|
97
|
+
| `python-patterns` | Python patterns (async, dataclasses, typing) |
|
|
98
|
+
| `rust-patterns` | Rust patterns (ownership, traits, concurrency) |
|
|
99
|
+
| `postgres-patterns` | PostgreSQL schema, query, and indexing patterns |
|
|
100
|
+
| `django-patterns` | Django-specific patterns (ORM, views, middleware) |
|
|
101
|
+
| `django-tdd` | Django test-driven development workflow |
|
|
102
|
+
|
|
103
|
+
### Intelligence
|
|
104
|
+
|
|
105
|
+
| Skill | Description |
|
|
106
|
+
|-------|-------------|
|
|
107
|
+
| `failure-replay-engine` | Replays past failures to understand root causes |
|
|
108
|
+
| `regression-prediction` | Predicts which files are likely to break from a given change |
|
|
109
|
+
| `repo-memory-graph` | Builds a semantic graph of codebase knowledge |
|
|
110
|
+
| `decision-trace` | Records decision rationale for future review |
|
|
111
|
+
| `volatility-map` | Maps change frequency to identify stable vs. volatile areas |
|
|
112
|
+
|
|
113
|
+
### Workflow
|
|
114
|
+
|
|
115
|
+
| Skill | Description |
|
|
116
|
+
|-------|-------------|
|
|
117
|
+
| `git-workflow` | Git branch strategy, commit conventions, and PR workflow |
|
|
118
|
+
| `agent-harness-construction` | How to construct and wire agents together |
|
|
119
|
+
| `context-load` | Strategies for loading context efficiently |
|
|
120
|
+
| `debug-flow` | Systematic debugging workflow |
|
|
121
|
+
| `documentation-writer` | Generates documentation from code structure |
|
|
122
|
+
| `human-review-routing` | Routes review requests to appropriate reviewers |
|
|
123
|
+
|
|
124
|
+
### More
|
|
125
|
+
|
|
126
|
+
Additional skills: `api-design`, `codebase-mapping`, `codebase-onboarding`, `code-tour`, `design-system-definition`, `multi-repo`.
|
|
127
|
+
|
|
128
|
+
## Skill File Structure
|
|
129
|
+
|
|
130
|
+
Each skill lives in `src/skills/<name>/SKILL.md` with YAML frontmatter:
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
---
|
|
134
|
+
name: skill-name
|
|
135
|
+
description: One-line description of what the skill does
|
|
136
|
+
origin: FlowDeck
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
# Skill Title
|
|
140
|
+
|
|
141
|
+
Step-by-step workflow description...
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Adding New Skills
|
|
145
|
+
|
|
146
|
+
1. Create `src/skills/<name>/SKILL.md` with frontmatter
|
|
147
|
+
2. Add the skill path to the OpenCode plugin config in `src/index.ts`
|
|
148
|
+
3. Skills become available immediately — no rebuild required
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Planning Skills
|
|
2
|
+
|
|
3
|
+
These skills handle the "thinking before coding" phase — turning vague requests into concrete, executable plans with verifiable success criteria.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## plan-task
|
|
8
|
+
|
|
9
|
+
Wave-structured task breakdown for multi-file features.
|
|
10
|
+
|
|
11
|
+
Breaks complex features into phased wave-based plans. Each step maps to a file, has a verification check, and fits within a working session. Foundation-first ordering: types then data then services then routes then UI.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## confidence-aware-planning
|
|
16
|
+
|
|
17
|
+
Uncertainty-aware estimates that signal low confidence instead of guessing.
|
|
18
|
+
|
|
19
|
+
Adjusts planning behavior based on how certain the agent is. HIGH confidence proceeds normally. MEDIUM confidence surfaces explicit assumptions and risks. LOW confidence stops and asks clarifying questions before writing a plan.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## intent-translator
|
|
24
|
+
|
|
25
|
+
Converts vague requests into ranked implementation options with tradeoffs.
|
|
26
|
+
|
|
27
|
+
Takes input like "make checkout faster" and produces a ranked menu of 3-5 concrete options with file scope, effort estimates, risk ratings, and explicit tradeoffs — before any code is written. Stops and asks clarifying questions when intent is genuinely ambiguous.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## decision-trace
|
|
32
|
+
|
|
33
|
+
Records why the agent changed something, what evidence was used, and what assumptions were made.
|
|
34
|
+
|
|
35
|
+
Creates an append-only audit trail in `.codebase/DECISIONS.jsonl` for every non-trivial edit. Code reviewers can query decisions for any file in the diff and immediately understand the "why" without asking the author. Rationale answers "why this approach and not the obvious alternative?"
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
Source: `src/skills/<name>/SKILL.md` in the project repository.
|
package/package.json
CHANGED
|
@@ -11,17 +11,57 @@ Run a structured requirements discussion session and capture decisions.
|
|
|
11
11
|
|
|
12
12
|
## Pre-flight
|
|
13
13
|
|
|
14
|
-
1. Check `.planning/STATE.md` exists — if not, return error: "Run
|
|
14
|
+
1. Check `.planning/STATE.md` exists — if not, return error: "No active feature. Run `/fd-map-codebase` then `/fd-new-feature` to start a feature."
|
|
15
15
|
2. Read current phase from STATE.md.
|
|
16
16
|
3. Create `.planning/phases/phase-<N>/` directory if it does not exist.
|
|
17
17
|
|
|
18
18
|
## Process
|
|
19
19
|
|
|
20
|
-
### Step 0:
|
|
20
|
+
### Step 0: CodeGraph Intelligence Check
|
|
21
|
+
|
|
22
|
+
**Before any exploration**, check if codegraph provides existing code understanding:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
codegraph action=check
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- **If codegraph is installed and indexed (fresh)**: Use codegraph MCP tools to answer architecture, structure, and pattern questions directly. Prefer `codegraph_context`, `codegraph_search`, `codegraph_explore` over file reads.
|
|
29
|
+
- Log: "codegraph available — using code intelligence index for preflight exploration"
|
|
30
|
+
- **If codegraph index is stale or has changed files**: Log "codegraph index may be stale — prefer direct verification for recent changes"
|
|
31
|
+
- **If codegraph is not installed or not indexed**: Log "codegraph not available — will explore via @code-explorer"
|
|
32
|
+
|
|
33
|
+
Use codegraph status to decide how Step 0 autonomous exploration is performed.
|
|
34
|
+
|
|
35
|
+
### Step 0b: Autonomous Codebase Exploration
|
|
21
36
|
|
|
22
37
|
**Before asking the user any question**, explore the repository to gather evidence.
|
|
23
38
|
|
|
39
|
+
**If codegraph is available (indexed and fresh):**
|
|
40
|
+
Use codegraph MCP tools directly for:
|
|
41
|
+
1. **Project structure** — `codegraph_context` to map entry points and module layout
|
|
42
|
+
2. **Tech stack detection** — `codegraph_files` and `codegraph_explore` on package manifests
|
|
43
|
+
3. **Implementation patterns** — `codegraph_explore` on `src/` for service/component patterns
|
|
44
|
+
4. Skip or minimally use @code-explorer — codegraph already provides the index
|
|
45
|
+
|
|
46
|
+
**If codegraph is NOT available:**
|
|
24
47
|
Invoke `@code-explorer` to inspect:
|
|
48
|
+
1. **Project files** — `.planning/PROJECT.md` (goals, tech stack, constraints)
|
|
49
|
+
2. **Session state** — `.planning/STATE.md` (current phase, prior decisions)
|
|
50
|
+
3. **Prior discussions** — `.planning/phases/*/DISCUSS.md` (already-captured decisions)
|
|
51
|
+
4. **Tech stack** — `package.json`, `go.mod`, `Cargo.toml`, `pyproject.toml`
|
|
52
|
+
5. **Implementation patterns** — `src/` directory structure (services, components, api, etc.)
|
|
53
|
+
6. **AGENTS.md / rules** — any project-level constraints or conventions
|
|
54
|
+
7. **Relevant source files** — files matching keywords in `$ARGUMENTS`
|
|
55
|
+
|
|
56
|
+
In both cases, read:
|
|
57
|
+
- `.planning/phases/*/DISCUSS.md` for prior decisions
|
|
58
|
+
- `.codebase/CODEGRAPH.md` for codegraph index metadata if available
|
|
59
|
+
|
|
60
|
+
Store exploration findings in the discussion context. These will be used to:
|
|
61
|
+
- Skip questions whose answers are already known from the codebase
|
|
62
|
+
- Inform the `@discusser` agent with concrete evidence
|
|
63
|
+
- Prevent worker agents from emitting questions to the user
|
|
64
|
+
|
|
25
65
|
|
|
26
66
|
1. **Project files** — `.planning/PROJECT.md` (goals, tech stack, constraints)
|
|
27
67
|
2. **Session state** — `.planning/STATE.md` (current phase, prior decisions)
|
|
@@ -66,17 +106,30 @@ Decisions will be saved to `.planning/phases/phase-{N}/DISCUSS.md`.
|
|
|
66
106
|
Spawn @discusser agent with:
|
|
67
107
|
- Project context (from PROJECT.md)
|
|
68
108
|
- Current phase number
|
|
69
|
-
- **Preflight exploration findings**
|
|
70
|
-
-
|
|
109
|
+
- **Preflight exploration findings** — the full ExplorationResult from Step 0, including:
|
|
110
|
+
- `techStack`: detected tech stack (e.g. ["Node.js / JavaScript / TypeScript"])
|
|
111
|
+
- `availableAgents`: list of registered agents
|
|
112
|
+
- `availableCommands`: list of available commands
|
|
113
|
+
- `implementationPatterns`: detected patterns (e.g. ["service layer", "agent architecture"])
|
|
114
|
+
- `evidenceItems`: evidence that can answer common questions
|
|
115
|
+
- `hasPriorDiscussions`: whether prior DISCUSS.md files exist
|
|
116
|
+
- Instructions to ask ONE question per turn using the RecommendedQuestion format
|
|
71
117
|
- Instructions to skip questions already answered by exploration evidence
|
|
72
118
|
|
|
73
119
|
### Step 4: Q&A Loop
|
|
74
120
|
|
|
75
|
-
The @discusser agent asks one question at a time.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
-
|
|
121
|
+
The @discusser agent asks one question at a time using the RecommendedQuestion format.
|
|
122
|
+
|
|
123
|
+
Before each question:
|
|
124
|
+
1. Question guard check:
|
|
125
|
+
- If the question can be answered from exploration evidence → skip it, record as suppressed
|
|
126
|
+
- If the question was already asked in a prior session for this phase → skip it
|
|
127
|
+
- Otherwise → proceed to validation
|
|
128
|
+
2. Recommendation validation:
|
|
129
|
+
- Parse the question block with `parseQuestionBlocks()`
|
|
130
|
+
- Validate with `validateRecommendedQuestion()`
|
|
131
|
+
- If validation fails (bare question, missing fields) → return a rewrite hint to @discusser
|
|
132
|
+
- If validation passes → format with `formatRecommendedQuestion()` and present to the user
|
|
80
133
|
|
|
81
134
|
After each user response:
|
|
82
135
|
- Assign D-XX number to any new decision
|
|
@@ -119,6 +172,17 @@ D-01: [Topic] — [Decision] ([Rationale])
|
|
|
119
172
|
D-02: [Topic] — [Decision] ([Rationale])
|
|
120
173
|
...
|
|
121
174
|
|
|
175
|
+
## Answered Recommendations
|
|
176
|
+
|
|
177
|
+
RQ-01: [question]
|
|
178
|
+
Recommendation: [the recommended answer]
|
|
179
|
+
User choice: [what they said]
|
|
180
|
+
Rationale: [why the system recommended it]
|
|
181
|
+
Asked by: discusser
|
|
182
|
+
Stage: discuss
|
|
183
|
+
Timestamp: <ISO 8601>
|
|
184
|
+
...
|
|
185
|
+
|
|
122
186
|
## Suppressed Questions
|
|
123
187
|
|
|
124
188
|
(Questions that were answered by repo evidence and not asked of the user)
|
|
@@ -151,7 +215,7 @@ If UI-heavy, also suggest running `/fd-design --mode=draft` before `/fd-execute`
|
|
|
151
215
|
## Error Handling
|
|
152
216
|
|
|
153
217
|
D-03: Fail fast with clear error
|
|
154
|
-
- If PROJECT.md not found:
|
|
218
|
+
- If PROJECT.md not found: proceed without it (PROJECT.md is optional in the new flow; codebase context is provided by `.codebase/`)
|
|
155
219
|
- If STATE.md not found: error with "Project not initialized"
|
|
156
220
|
- If @discusser fails: error with "Discusser agent unavailable"
|
|
157
221
|
- If @code-explorer fails during preflight: proceed with reduced evidence (log warning)
|