@dv.nghiem/flowdeck 0.3.9 → 0.4.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 (124) hide show
  1. package/README.md +13 -21
  2. package/dist/agents/code-explorer.d.ts.map +1 -1
  3. package/dist/agents/mapper.d.ts.map +1 -1
  4. package/dist/agents/orchestrator.d.ts.map +1 -1
  5. package/dist/agents/planner.d.ts.map +1 -1
  6. package/dist/agents/specialist.d.ts.map +1 -1
  7. package/dist/dashboard/server.mjs +12 -2
  8. package/dist/hooks/compaction-hook.d.ts +1 -2
  9. package/dist/hooks/compaction-hook.d.ts.map +1 -1
  10. package/dist/hooks/file-tracker.d.ts +6 -0
  11. package/dist/hooks/file-tracker.d.ts.map +1 -1
  12. package/dist/hooks/notifications.d.ts.map +1 -1
  13. package/dist/hooks/session-start.d.ts.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +742 -794
  16. package/dist/lib/completion-validator.d.ts +51 -0
  17. package/dist/lib/completion-validator.d.ts.map +1 -0
  18. package/dist/lib/recommended-question.d.ts +24 -0
  19. package/dist/lib/recommended-question.d.ts.map +1 -0
  20. package/dist/lib/research-gate.d.ts +97 -0
  21. package/dist/lib/research-gate.d.ts.map +1 -0
  22. package/dist/lib/research-gate.test.d.ts +2 -0
  23. package/dist/lib/research-gate.test.d.ts.map +1 -0
  24. package/dist/mcp/index.d.ts +12 -2
  25. package/dist/mcp/index.d.ts.map +1 -1
  26. package/dist/services/codegraph.d.ts +36 -0
  27. package/dist/services/codegraph.d.ts.map +1 -0
  28. package/dist/services/codegraph.test.d.ts +2 -0
  29. package/dist/services/codegraph.test.d.ts.map +1 -0
  30. package/dist/services/question-guard.d.ts +4 -0
  31. package/dist/services/question-guard.d.ts.map +1 -1
  32. package/dist/services/recommended-question.test.d.ts +2 -0
  33. package/dist/services/recommended-question.test.d.ts.map +1 -0
  34. package/dist/services/supervisor-binding.d.ts +3 -1
  35. package/dist/services/supervisor-binding.d.ts.map +1 -1
  36. package/dist/tools/codebase-index.d.ts +30 -0
  37. package/dist/tools/codebase-index.d.ts.map +1 -0
  38. package/dist/tools/codebase-index.test.d.ts +2 -0
  39. package/dist/tools/codebase-index.test.d.ts.map +1 -0
  40. package/dist/tools/codegraph-tool.d.ts +3 -0
  41. package/dist/tools/codegraph-tool.d.ts.map +1 -0
  42. package/dist/tools/planning-state-lib.d.ts +23 -0
  43. package/dist/tools/planning-state-lib.d.ts.map +1 -1
  44. package/docs/agents/index.md +154 -0
  45. package/docs/commands/fd-ask.md +71 -39
  46. package/docs/commands/fd-checkpoint.md +63 -8
  47. package/docs/commands/fd-deploy-check.md +166 -9
  48. package/docs/commands/fd-design.md +101 -0
  49. package/docs/commands/fd-discuss.md +87 -20
  50. package/docs/commands/fd-doctor.md +100 -13
  51. package/docs/commands/fd-done.md +215 -0
  52. package/docs/commands/fd-execute.md +104 -0
  53. package/docs/commands/fd-fix-bug.md +144 -24
  54. package/docs/commands/fd-map-codebase.md +85 -21
  55. package/docs/commands/fd-multi-repo.md +155 -40
  56. package/docs/commands/fd-new-feature.md +63 -19
  57. package/docs/commands/fd-plan.md +80 -27
  58. package/docs/commands/fd-quick.md +143 -29
  59. package/docs/commands/fd-reflect.md +81 -13
  60. package/docs/commands/fd-resume.md +65 -8
  61. package/docs/commands/fd-status.md +80 -12
  62. package/docs/commands/fd-suggest.md +114 -0
  63. package/docs/commands/fd-translate-intent.md +69 -9
  64. package/docs/commands/fd-verify.md +71 -14
  65. package/docs/commands/fd-write-docs.md +121 -8
  66. package/docs/concepts/architecture.md +163 -0
  67. package/docs/concepts/governance.md +242 -0
  68. package/docs/concepts/intelligence.md +145 -0
  69. package/docs/concepts/multi-repo.md +227 -0
  70. package/docs/concepts/workflows.md +205 -0
  71. package/docs/configuration/index.md +208 -0
  72. package/docs/configuration/opencode-settings.md +98 -0
  73. package/docs/getting-started/first-project.md +126 -0
  74. package/docs/getting-started/installation.md +73 -0
  75. package/docs/getting-started/quick-start.md +74 -0
  76. package/docs/index.md +36 -72
  77. package/docs/reference/hooks.md +176 -0
  78. package/docs/reference/rules.md +109 -0
  79. package/docs/skills/code-review.md +47 -0
  80. package/docs/skills/index.md +148 -0
  81. package/docs/skills/planning.md +39 -0
  82. package/package.json +1 -1
  83. package/src/commands/fd-discuss.md +74 -10
  84. package/src/commands/fd-done.md +196 -0
  85. package/src/commands/fd-execute.md +43 -6
  86. package/src/commands/fd-fix-bug.md +43 -6
  87. package/src/commands/fd-map-codebase.md +99 -19
  88. package/src/commands/fd-new-feature.md +14 -5
  89. package/src/commands/fd-plan.md +38 -1
  90. package/src/commands/fd-quick.md +1 -1
  91. package/src/commands/fd-resume.md +1 -1
  92. package/src/commands/fd-status.md +1 -1
  93. package/src/commands/fd-verify.md +16 -2
  94. package/src/commands/fd-write-docs.md +30 -5
  95. package/src/skills/context-load/SKILL.md +1 -1
  96. package/dist/hooks/memory-hook.d.ts +0 -28
  97. package/dist/hooks/memory-hook.d.ts.map +0 -1
  98. package/dist/services/memory-store.d.ts +0 -73
  99. package/dist/services/memory-store.d.ts.map +0 -1
  100. package/dist/services/memory-store.test.d.ts +0 -2
  101. package/dist/services/memory-store.test.d.ts.map +0 -1
  102. package/dist/tools/memory-search.d.ts +0 -3
  103. package/dist/tools/memory-search.d.ts.map +0 -1
  104. package/dist/tools/memory-status.d.ts +0 -3
  105. package/dist/tools/memory-status.d.ts.map +0 -1
  106. package/docs/USER_GUIDE.md +0 -20
  107. package/docs/agents.md +0 -544
  108. package/docs/best-practices.md +0 -47
  109. package/docs/commands/fd-new-project.md +0 -24
  110. package/docs/commands.md +0 -557
  111. package/docs/configuration.md +0 -325
  112. package/docs/design-first-workflow.md +0 -94
  113. package/docs/feature-integration-architecture.md +0 -227
  114. package/docs/installation.md +0 -123
  115. package/docs/intelligence.md +0 -370
  116. package/docs/memory.md +0 -69
  117. package/docs/multi-repo.md +0 -201
  118. package/docs/notifications.md +0 -170
  119. package/docs/optimization-baseline.md +0 -21
  120. package/docs/quick-start.md +0 -197
  121. package/docs/rules.md +0 -432
  122. package/docs/skills.md +0 -417
  123. package/docs/workflows.md +0 -134
  124. package/src/commands/fd-new-project.md +0 -114
package/docs/rules.md DELETED
@@ -1,432 +0,0 @@
1
- # FlowDeck Rules
2
-
3
- Rules are coding standards used by FlowDeck agents for style, testing, security, and language-specific guidance.
4
-
5
- ## How Rules Load
6
-
7
- FlowDeck loads all markdown files under `src/rules/` automatically through plugin startup. You do not need to manually copy or symlink rule files.
8
-
9
- ## Precedence
10
-
11
- When guidance conflicts, precedence is:
12
-
13
- 1. `AGENTS.md` and `CLAUDE.md` in the repository
14
- 2. FlowDeck plugin rules in `src/rules/**`
15
- 3. Runtime policy rules in `.codebase/POLICIES.json`
16
-
17
- This keeps repository-specific conventions authoritative and lets policy learning add guardrails without overriding project intent.
18
-
19
- ---
20
-
21
- ## Rules Structure
22
-
23
- ```
24
- rules/
25
- common/
26
- coding-style.md ← Universal principles: names, simplicity, comments
27
- testing.md ← Coverage, naming, isolation, AAA pattern
28
- security.md ← Prohibited patterns, credentials, input validation
29
- git-workflow.md ← Branch strategy, Conventional Commits, PR standards
30
- agent-orchestration.md ← When to use which agent, parallel execution gates
31
- python/
32
- patterns.md ← Type hints, asyncio, pytest, pitfalls
33
- golang/
34
- patterns.md ← Error handling, goroutines, interfaces, testing
35
- java/
36
- patterns.md ← Modern Java 17+, Spring Boot, JPA, testing
37
- rust/
38
- patterns.md ← Ownership, traits, Tokio async, error handling
39
- typescript/
40
- patterns.md ← Strict mode, interfaces, async patterns, naming
41
- ```
42
-
43
- ---
44
-
45
- ## Common Rules Reference
46
-
47
- ### coding-style.md
48
-
49
- Applies to all languages and frameworks.
50
-
51
- **Key rules:**
52
-
53
- - **Names that explain intent.** Variables, functions, and types should read like prose. `getUserById` is acceptable; `getU` is not. If you need a comment to explain what a name means, rename it instead.
54
- - **Functions under 20 lines.** If a function exceeds 20 lines, it is doing too much. Extract sub-functions with descriptive names. Exceptions require an inline comment explaining why the complexity is necessary.
55
- - **Comments explain why, not what.** The code already shows what is happening. Comments are for decisions that are not obvious from reading the code: trade-offs, workarounds, business rules that contradict the obvious approach.
56
- - **No dead code in pull requests.** Commented-out code, unused variables, and unreachable branches must be removed before a PR is opened. Use version control to recover deleted code if needed.
57
- - **Match existing style exactly.** If the file uses tabs, use tabs. If the module uses a particular naming convention, follow it — even if your preference differs. Consistency across a file matters more than personal style.
58
-
59
- ---
60
-
61
- ### testing.md
62
-
63
- Applies to all automated test suites.
64
-
65
- **Key rules:**
66
-
67
- - **TDD first.** Write the failing test before writing the implementation. The test defines the contract; the implementation satisfies it. This produces smaller, more focused implementations.
68
- - **Coverage ≥ 80% for new code.** All new code introduced in a PR must achieve at least 80% line coverage. This is a floor, not a target — critical paths should aim for 100%.
69
- - **Test names describe the scenario.** Test names follow the pattern `<subject>_<condition>_<expected outcome>`. For example: `createUser_withDuplicateEmail_returnsConflictError`. The name should be readable without opening the test body.
70
- - **No implementation details in tests.** Tests assert on outputs and observable behavior — not on private methods, internal state, or call counts that are not part of the contract. Testing internals makes refactoring painful.
71
- - **Integration tests at every external boundary.** Any code that touches a database, external API, file system, or message queue must have at least one integration test. Unit tests alone are insufficient at these boundaries.
72
-
73
- ---
74
-
75
- ### security.md
76
-
77
- Applies to all code that handles user input, credentials, or external communication.
78
-
79
- **Key rules:**
80
-
81
- - **Never store secrets in code.** No API keys, passwords, connection strings, or tokens in source files — including comments. Use environment variables or a secrets manager. The `.planning/config.json` stores settings, not credentials.
82
- - **Validate all inputs.** Every value that originates outside the current process (HTTP request, CLI argument, file content, environment variable) must be validated for type, length, format, and range before use.
83
- - **Use parameterized queries.** String-concatenated SQL is prohibited regardless of context. Use your framework's parameterized query or ORM interface for every database interaction.
84
- - **HTTPS only for external communication.** No HTTP calls to external services in production code. Certificate verification must not be disabled.
85
- - **Log security events.** Authentication successes, authentication failures, authorization denials, and privilege escalations must be logged with enough context to reconstruct the event. Do not log passwords, tokens, or PII.
86
- - **No `eval()` or dynamic code execution.** `eval`, `exec`, `Function()`, and their equivalents are prohibited. If a use case seems to require them, escalate to `@architect` for a safer alternative.
87
-
88
- ---
89
-
90
- ### git-workflow.md
91
-
92
- Applies to all commits, branches, and pull requests in FlowDeck-managed projects.
93
-
94
- **Key rules:**
95
-
96
- - **Conventional Commits format.** All commit messages must follow the format `<type>(<scope>): <subject>`. Types: `feat`, `fix`, `chore`, `docs`, `refactor`, `test`, `perf`. Example: `feat(auth): add JWT refresh token rotation`.
97
- - **Branch naming: `<type>/issue-<number>-<short-description>`.** Example: `feat/issue-123-user-preferences`. The issue number creates a traceable link; the description makes the branch list scannable.
98
- - **Squash before merge.** Work-in-progress commits (`wip: trying approach`, `fix typo`) must be squashed before a PR is merged. The squashed commit message must follow Conventional Commits.
99
- - **Every PR requires a description.** The PR body must include: what changed, why it changed, how to test it, and any migration steps. A blank PR description blocks review.
100
- - **No force-push to shared branches.** `main`, `develop`, and release branches are protected. Force-push is only permitted on personal feature branches before a PR is opened.
101
-
102
- ---
103
-
104
- ### agent-orchestration.md
105
-
106
- Governs how FlowDeck agents are selected and coordinated.
107
-
108
- **Key rules:**
109
-
110
- - **Use `@orchestrator` for multi-step work.** Any task that spans more than one agent or involves sequencing should be delegated to `@orchestrator`. Do not manually chain agents — let `@orchestrator` manage handoffs and error recovery.
111
- - **Run `@task-splitter` before `/fd-new-feature` on large scope.** If a feature description spans more than a few hours of work, invoke `@task-splitter` first to break it into independent sub-features. Attempting to implement large scope in one `/fd-new-feature` call produces lower-quality output.
112
- - **`@reviewer` is mandatory before merge.** Every code-producing command (`/fd-new-feature`, `/fd-fix-bug`) must be followed by at least one `@reviewer` pass. This is enforced when guard mode is enabled in `.planning/config.json`.
113
- - **`@security-auditor` is mandatory for auth, payment, and PII code.** Any change to authentication flows, payment processing, or code that stores or transmits personally identifiable information must be audited by `@security-auditor` before merge — regardless of the change size.
114
- - **Wave gates are not optional.** In parallel execution, Wave 3 (`@backend-coder` + `@tester`) must not begin until Wave 2 (`@architect`) has produced its output. Starting implementation before design is complete produces rework.
115
-
116
- ---
117
-
118
- ## Language Rules Reference
119
-
120
- ### Python — `rules/python/patterns.md`
121
-
122
- **Key rules:**
123
-
124
- 1. **Type annotations on all public functions.**
125
-
126
- ```python
127
- # Required
128
- def get_user(user_id: int) -> User | None:
129
- ...
130
-
131
- # Not allowed
132
- def get_user(user_id):
133
- ...
134
- ```
135
-
136
- 2. **Never use mutable default arguments.**
137
-
138
- ```python
139
- # Required
140
- def append_item(item: str, items: list[str] | None = None) -> list[str]:
141
- items = items or []
142
- items.append(item)
143
- return items
144
-
145
- # Not allowed — items persists across calls
146
- def append_item(item: str, items: list[str] = []) -> list[str]:
147
- items.append(item)
148
- return items
149
- ```
150
-
151
- 3. **Use f-strings for string formatting.**
152
-
153
- ```python
154
- # Required
155
- message = f"User {user.name} logged in at {timestamp}"
156
-
157
- # Not allowed
158
- message = "User %s logged in at %s" % (user.name, timestamp)
159
- message = "User {} logged in at {}".format(user.name, timestamp)
160
- ```
161
-
162
- 4. **Use `pathlib.Path`, not `os.path`.**
163
-
164
- ```python
165
- # Required
166
- from pathlib import Path
167
- config_path = Path("~/.config/opencode").expanduser() / "settings.json"
168
-
169
- # Not allowed
170
- import os
171
- config_path = os.path.join(os.path.expanduser("~"), ".config", "opencode", "settings.json")
172
- ```
173
-
174
- 5. **Use pytest for all tests.** No `unittest.TestCase` in new code. Use `pytest.fixture` for setup, `pytest.mark.parametrize` for table-driven tests.
175
-
176
- ```python
177
- import pytest
178
-
179
- @pytest.mark.parametrize("email,expected", [
180
- ("valid@example.com", True),
181
- ("not-an-email", False),
182
- ("", False),
183
- ])
184
- def test_validate_email(email: str, expected: bool) -> None:
185
- assert validate_email(email) == expected
186
- ```
187
-
188
- ---
189
-
190
- ### Go — `rules/golang/patterns.md`
191
-
192
- **Key rules:**
193
-
194
- 1. **Always handle errors explicitly. Never discard with `_`.**
195
-
196
- ```go
197
- // Required
198
- result, err := db.Query(ctx, query)
199
- if err != nil {
200
- return fmt.Errorf("querying users: %w", err)
201
- }
202
-
203
- // Not allowed
204
- result, _ := db.Query(ctx, query)
205
- ```
206
-
207
- 2. **Error strings: lowercase, no trailing punctuation.**
208
-
209
- ```go
210
- // Required
211
- return fmt.Errorf("user not found: id %d", userID)
212
-
213
- // Not allowed
214
- return fmt.Errorf("User not found: id %d.", userID)
215
- ```
216
-
217
- 3. **Pass `context.Context` as the first argument for any cancellable operation.**
218
-
219
- ```go
220
- // Required
221
- func FetchUser(ctx context.Context, id int) (*User, error) {
222
- return db.QueryRowContext(ctx, "SELECT * FROM users WHERE id = $1", id)
223
- }
224
- ```
225
-
226
- 4. **Table-driven tests for functions with multiple cases.**
227
-
228
- ```go
229
- func TestValidateEmail(t *testing.T) {
230
- cases := []struct {
231
- name string
232
- input string
233
- wantOK bool
234
- }{
235
- {"valid", "user@example.com", true},
236
- {"missing at", "userexample.com", false},
237
- {"empty", "", false},
238
- }
239
- for _, tc := range cases {
240
- t.Run(tc.name, func(t *testing.T) {
241
- got := validateEmail(tc.input)
242
- if got != tc.wantOK {
243
- t.Errorf("validateEmail(%q) = %v, want %v", tc.input, got, tc.wantOK)
244
- }
245
- })
246
- }
247
- }
248
- ```
249
-
250
- 5. **No `panic` for expected error conditions.** Use `panic` only for programmer errors (nil pointer in invariant-violation scenarios). All expected failures return an `error`.
251
-
252
- ---
253
-
254
- ### Java — `rules/java/patterns.md`
255
-
256
- Targets Java 17+ with Spring Boot.
257
-
258
- **Key rules:**
259
-
260
- 1. **Constructor injection only. Never `@Autowired` on a field.**
261
-
262
- ```java
263
- // Required
264
- @Service
265
- public class UserService {
266
- private final UserRepository userRepository;
267
-
268
- public UserService(UserRepository userRepository) {
269
- this.userRepository = userRepository;
270
- }
271
- }
272
-
273
- // Not allowed
274
- @Service
275
- public class UserService {
276
- @Autowired
277
- private UserRepository userRepository;
278
- }
279
- ```
280
-
281
- 2. **Never return `null` from a public method.** Return `Optional<T>` for values that may be absent, or throw a typed exception.
282
-
283
- ```java
284
- // Required
285
- public Optional<User> findById(long id) {
286
- return userRepository.findById(id);
287
- }
288
- ```
289
-
290
- 3. **All DTOs are Java records.**
291
-
292
- ```java
293
- // Required
294
- public record CreateUserRequest(String email, String displayName) {}
295
-
296
- // Not allowed
297
- public class CreateUserRequest {
298
- private String email;
299
- // getters, setters, constructors...
300
- }
301
- ```
302
-
303
- 4. **No checked exceptions in new code.** Wrap checked exceptions in unchecked runtime exceptions at integration boundaries.
304
-
305
- ```java
306
- // Required
307
- try {
308
- Files.readString(path);
309
- } catch (IOException e) {
310
- throw new StorageException("Failed to read config file: " + path, e);
311
- }
312
- ```
313
-
314
- 5. **`@Transactional` on the service layer only.** Never place `@Transactional` on repository methods or controller methods.
315
-
316
- ---
317
-
318
- ### Rust — `rules/rust/patterns.md`
319
-
320
- **Key rules:**
321
-
322
- 1. **Return `Result<T, E>` from library code. Never `panic`.**
323
-
324
- ```rust
325
- // Required
326
- pub fn parse_config(path: &Path) -> Result<Config, ConfigError> {
327
- let content = fs::read_to_string(path)
328
- .map_err(|e| ConfigError::Io { path: path.to_owned(), source: e })?;
329
- toml::from_str(&content).map_err(ConfigError::Parse)
330
- }
331
- ```
332
-
333
- 2. **Use `expect()` with a descriptive message. Never bare `unwrap()`.**
334
-
335
- ```rust
336
- // Required
337
- let port: u16 = env::var("PORT")
338
- .expect("PORT environment variable must be set")
339
- .parse()
340
- .expect("PORT must be a valid u16");
341
-
342
- // Not allowed
343
- let port: u16 = env::var("PORT").unwrap().parse().unwrap();
344
- ```
345
-
346
- 3. **All public items have rustdoc comments.**
347
-
348
- ```rust
349
- /// Fetches a user by their unique identifier.
350
- ///
351
- /// Returns `None` if no user with the given `id` exists.
352
- pub async fn get_user(id: UserId) -> Option<User> {
353
- ...
354
- }
355
- ```
356
-
357
- 4. **`clippy` must pass with no warnings before review.** Run `cargo clippy -- -D warnings` as part of the PR process. Suppress specific lints only with a comment explaining why.
358
-
359
- 5. **`#[cfg(test)]` for unit tests; `tests/` for integration tests.** Unit tests live in the same file as the code they test. Integration tests that require external services live under `tests/`.
360
-
361
- ---
362
-
363
- ### TypeScript — `rules/typescript/patterns.md`
364
-
365
- **Key rules:**
366
-
367
- 1. **`strict: true` is always enabled.** No exceptions. If `strict` is disabled in a `tsconfig.json`, that is a bug.
368
-
369
- ```json
370
- {
371
- "compilerOptions": {
372
- "strict": true
373
- }
374
- }
375
- ```
376
-
377
- 2. **Prefer `interface` over `type` aliases for object shapes.**
378
-
379
- ```typescript
380
- // Required
381
- interface UserProfile {
382
- id: string;
383
- email: string;
384
- displayName: string;
385
- }
386
-
387
- // Acceptable for unions and intersections only
388
- type UserOrAdmin = User | Admin;
389
- ```
390
-
391
- 3. **`async`/`await` over `.then()` chains.**
392
-
393
- ```typescript
394
- // Required
395
- async function fetchUser(id: string): Promise<User> {
396
- const response = await fetch(`/api/users/${id}`);
397
- if (!response.ok) throw new ApiError(response.status);
398
- return response.json() as Promise<User>;
399
- }
400
-
401
- // Not allowed
402
- function fetchUser(id: string): Promise<User> {
403
- return fetch(`/api/users/${id}`)
404
- .then(response => { if (!response.ok) throw new ApiError(response.status); return response; })
405
- .then(response => response.json());
406
- }
407
- ```
408
-
409
- 4. **Use `unknown` over `any`.** If you do not know the type, use `unknown` and narrow it before use. `any` disables type checking and is banned except in test utilities.
410
-
411
- ```typescript
412
- // Required
413
- function parseResponse(data: unknown): User {
414
- if (!isUser(data)) throw new TypeError("Invalid user shape");
415
- return data;
416
- }
417
- ```
418
-
419
- 5. **Named exports preferred over default exports.** Named exports are tree-shakeable and produce better refactoring tooling support.
420
-
421
- ```typescript
422
- // Required
423
- export function createUser(email: string): User { ... }
424
- export interface UserRepository { ... }
425
-
426
- // Avoid
427
- export default function createUser(email: string): User { ... }
428
- ```
429
-
430
- ---
431
-
432
- ← [Back to Index](index.md)