@dv.nghiem/flowdeck 0.1.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 (331) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +136 -0
  3. package/bin/flowdeck.js +108 -0
  4. package/dist/agents/architect.d.ts +3 -0
  5. package/dist/agents/architect.d.ts.map +1 -0
  6. package/dist/agents/code-explorer.d.ts +3 -0
  7. package/dist/agents/code-explorer.d.ts.map +1 -0
  8. package/dist/agents/coder.d.ts +3 -0
  9. package/dist/agents/coder.d.ts.map +1 -0
  10. package/dist/agents/debug.d.ts +4 -0
  11. package/dist/agents/debug.d.ts.map +1 -0
  12. package/dist/agents/doc-updater.d.ts +3 -0
  13. package/dist/agents/doc-updater.d.ts.map +1 -0
  14. package/dist/agents/flowdeck.d.ts +5 -0
  15. package/dist/agents/flowdeck.d.ts.map +1 -0
  16. package/dist/agents/index.d.ts +38 -0
  17. package/dist/agents/index.d.ts.map +1 -0
  18. package/dist/agents/mapper.d.ts +3 -0
  19. package/dist/agents/mapper.d.ts.map +1 -0
  20. package/dist/agents/orchestrator.d.ts +10 -0
  21. package/dist/agents/orchestrator.d.ts.map +1 -0
  22. package/dist/agents/performance.d.ts +4 -0
  23. package/dist/agents/performance.d.ts.map +1 -0
  24. package/dist/agents/planner.d.ts +3 -0
  25. package/dist/agents/planner.d.ts.map +1 -0
  26. package/dist/agents/policy-enforcer.d.ts +3 -0
  27. package/dist/agents/policy-enforcer.d.ts.map +1 -0
  28. package/dist/agents/researcher.d.ts +3 -0
  29. package/dist/agents/researcher.d.ts.map +1 -0
  30. package/dist/agents/reviewer.d.ts +3 -0
  31. package/dist/agents/reviewer.d.ts.map +1 -0
  32. package/dist/agents/risk-analyst.d.ts +3 -0
  33. package/dist/agents/risk-analyst.d.ts.map +1 -0
  34. package/dist/agents/security-auditor.d.ts +3 -0
  35. package/dist/agents/security-auditor.d.ts.map +1 -0
  36. package/dist/agents/specialist.d.ts +5 -0
  37. package/dist/agents/specialist.d.ts.map +1 -0
  38. package/dist/agents/tester.d.ts +3 -0
  39. package/dist/agents/tester.d.ts.map +1 -0
  40. package/dist/agents/types.d.ts +20 -0
  41. package/dist/agents/types.d.ts.map +1 -0
  42. package/dist/agents/writer.d.ts +3 -0
  43. package/dist/agents/writer.d.ts.map +1 -0
  44. package/dist/commands/analysis/analysis.test.d.ts +2 -0
  45. package/dist/commands/analysis/analysis.test.d.ts.map +1 -0
  46. package/dist/commands/analysis/analyze-change.d.ts +148 -0
  47. package/dist/commands/analysis/analyze-change.d.ts.map +1 -0
  48. package/dist/commands/analysis/evaluate-risk.d.ts +77 -0
  49. package/dist/commands/analysis/evaluate-risk.d.ts.map +1 -0
  50. package/dist/commands/analysis/guarded-edit.d.ts +72 -0
  51. package/dist/commands/analysis/guarded-edit.d.ts.map +1 -0
  52. package/dist/commands/execution/deploy-check.d.ts +91 -0
  53. package/dist/commands/execution/deploy-check.d.ts.map +1 -0
  54. package/dist/commands/execution/fix-bug.d.ts +187 -0
  55. package/dist/commands/execution/fix-bug.d.ts.map +1 -0
  56. package/dist/commands/execution/new-feature.d.ts +171 -0
  57. package/dist/commands/execution/new-feature.d.ts.map +1 -0
  58. package/dist/commands/execution/review-code.d.ts +130 -0
  59. package/dist/commands/execution/review-code.d.ts.map +1 -0
  60. package/dist/commands/execution/write-docs.d.ts +94 -0
  61. package/dist/commands/execution/write-docs.d.ts.map +1 -0
  62. package/dist/commands/governance/approve.d.ts +80 -0
  63. package/dist/commands/governance/approve.d.ts.map +1 -0
  64. package/dist/commands/intelligence/blast-radius.d.ts +67 -0
  65. package/dist/commands/intelligence/blast-radius.d.ts.map +1 -0
  66. package/dist/commands/intelligence/impact-radar.d.ts +71 -0
  67. package/dist/commands/intelligence/impact-radar.d.ts.map +1 -0
  68. package/dist/commands/intelligence/intelligence.test.d.ts +2 -0
  69. package/dist/commands/intelligence/intelligence.test.d.ts.map +1 -0
  70. package/dist/commands/intelligence/regression-predict.d.ts +75 -0
  71. package/dist/commands/intelligence/regression-predict.d.ts.map +1 -0
  72. package/dist/commands/intelligence/review-route.d.ts +65 -0
  73. package/dist/commands/intelligence/review-route.d.ts.map +1 -0
  74. package/dist/commands/intelligence/test-gap.d.ts +73 -0
  75. package/dist/commands/intelligence/test-gap.d.ts.map +1 -0
  76. package/dist/commands/intelligence/translate-intent.d.ts +87 -0
  77. package/dist/commands/intelligence/translate-intent.d.ts.map +1 -0
  78. package/dist/commands/intelligence/volatility-map-cmd.d.ts +68 -0
  79. package/dist/commands/intelligence/volatility-map-cmd.d.ts.map +1 -0
  80. package/dist/commands/planning/ask.d.ts +62 -0
  81. package/dist/commands/planning/ask.d.ts.map +1 -0
  82. package/dist/commands/planning/ask.test.d.ts +2 -0
  83. package/dist/commands/planning/ask.test.d.ts.map +1 -0
  84. package/dist/commands/planning/dashboard.d.ts +30 -0
  85. package/dist/commands/planning/dashboard.d.ts.map +1 -0
  86. package/dist/commands/planning/discuss.d.ts +39 -0
  87. package/dist/commands/planning/discuss.d.ts.map +1 -0
  88. package/dist/commands/planning/plan.d.ts +67 -0
  89. package/dist/commands/planning/plan.d.ts.map +1 -0
  90. package/dist/commands/planning/roadmap.d.ts +105 -0
  91. package/dist/commands/planning/roadmap.d.ts.map +1 -0
  92. package/dist/commands/setup/doctor.d.ts +10 -0
  93. package/dist/commands/setup/doctor.d.ts.map +1 -0
  94. package/dist/commands/setup/map-codebase.d.ts +62 -0
  95. package/dist/commands/setup/map-codebase.d.ts.map +1 -0
  96. package/dist/commands/setup/new-project.d.ts +19 -0
  97. package/dist/commands/setup/new-project.d.ts.map +1 -0
  98. package/dist/commands/setup/settings.d.ts +57 -0
  99. package/dist/commands/setup/settings.d.ts.map +1 -0
  100. package/dist/commands/state/checkpoint.d.ts +27 -0
  101. package/dist/commands/state/checkpoint.d.ts.map +1 -0
  102. package/dist/commands/state/multi-repo.d.ts +63 -0
  103. package/dist/commands/state/multi-repo.d.ts.map +1 -0
  104. package/dist/commands/state/progress.d.ts +57 -0
  105. package/dist/commands/state/progress.d.ts.map +1 -0
  106. package/dist/commands/state/resume.d.ts +11 -0
  107. package/dist/commands/state/resume.d.ts.map +1 -0
  108. package/dist/commands/state/workspace-commands.d.ts +207 -0
  109. package/dist/commands/state/workspace-commands.d.ts.map +1 -0
  110. package/dist/dashboard/lib/port-finder.d.ts +10 -0
  111. package/dist/dashboard/lib/port-finder.d.ts.map +1 -0
  112. package/dist/dashboard/lib/port-finder.test.d.ts +2 -0
  113. package/dist/dashboard/lib/port-finder.test.d.ts.map +1 -0
  114. package/dist/dashboard/lib/state-reader.d.ts +3 -0
  115. package/dist/dashboard/lib/state-reader.d.ts.map +1 -0
  116. package/dist/dashboard/server.d.ts +2 -0
  117. package/dist/dashboard/server.d.ts.map +1 -0
  118. package/dist/dashboard/server.mjs +13649 -0
  119. package/dist/dashboard/types.d.ts +72 -0
  120. package/dist/dashboard/types.d.ts.map +1 -0
  121. package/dist/dashboard/views/index.ejs +391 -0
  122. package/dist/dashboard/views/partials/blockers.ejs +10 -0
  123. package/dist/dashboard/views/partials/header.ejs +20 -0
  124. package/dist/dashboard/views/partials/phase-timeline.ejs +40 -0
  125. package/dist/dashboard/views/partials/progress.ejs +12 -0
  126. package/dist/hooks/approval-hook.d.ts +13 -0
  127. package/dist/hooks/approval-hook.d.ts.map +1 -0
  128. package/dist/hooks/compaction-hook.d.ts +23 -0
  129. package/dist/hooks/compaction-hook.d.ts.map +1 -0
  130. package/dist/hooks/context-window-monitor.d.ts +21 -0
  131. package/dist/hooks/context-window-monitor.d.ts.map +1 -0
  132. package/dist/hooks/decision-trace-hook.d.ts +13 -0
  133. package/dist/hooks/decision-trace-hook.d.ts.map +1 -0
  134. package/dist/hooks/file-tracker.d.ts +29 -0
  135. package/dist/hooks/file-tracker.d.ts.map +1 -0
  136. package/dist/hooks/guard-rails.d.ts +33 -0
  137. package/dist/hooks/guard-rails.d.ts.map +1 -0
  138. package/dist/hooks/index.d.ts +5 -0
  139. package/dist/hooks/index.d.ts.map +1 -0
  140. package/dist/hooks/notifications.d.ts +21 -0
  141. package/dist/hooks/notifications.d.ts.map +1 -0
  142. package/dist/hooks/patch-trust.d.ts +27 -0
  143. package/dist/hooks/patch-trust.d.ts.map +1 -0
  144. package/dist/hooks/patch-trust.test.d.ts +2 -0
  145. package/dist/hooks/patch-trust.test.d.ts.map +1 -0
  146. package/dist/hooks/session-events.d.ts +8 -0
  147. package/dist/hooks/session-events.d.ts.map +1 -0
  148. package/dist/hooks/session-idle-hook.d.ts +21 -0
  149. package/dist/hooks/session-idle-hook.d.ts.map +1 -0
  150. package/dist/hooks/session-start.d.ts +10 -0
  151. package/dist/hooks/session-start.d.ts.map +1 -0
  152. package/dist/hooks/shell-env-hook.d.ts +21 -0
  153. package/dist/hooks/shell-env-hook.d.ts.map +1 -0
  154. package/dist/hooks/telemetry-hook.d.ts +25 -0
  155. package/dist/hooks/telemetry-hook.d.ts.map +1 -0
  156. package/dist/hooks/todo-hook.d.ts +25 -0
  157. package/dist/hooks/todo-hook.d.ts.map +1 -0
  158. package/dist/hooks/tool-guard.d.ts +41 -0
  159. package/dist/hooks/tool-guard.d.ts.map +1 -0
  160. package/dist/hooks/tool-guard.test.d.ts +2 -0
  161. package/dist/hooks/tool-guard.test.d.ts.map +1 -0
  162. package/dist/index.d.ts +4 -0
  163. package/dist/index.d.ts.map +1 -0
  164. package/dist/index.js +6639 -0
  165. package/dist/lib/confirmation.d.ts +20 -0
  166. package/dist/lib/confirmation.d.ts.map +1 -0
  167. package/dist/lib/impact-radar.d.ts +35 -0
  168. package/dist/lib/impact-radar.d.ts.map +1 -0
  169. package/dist/lib/signatures.d.ts +12 -0
  170. package/dist/lib/signatures.d.ts.map +1 -0
  171. package/dist/lib/timestamps.d.ts +23 -0
  172. package/dist/lib/timestamps.d.ts.map +1 -0
  173. package/dist/mcp/index.d.ts +20 -0
  174. package/dist/mcp/index.d.ts.map +1 -0
  175. package/dist/services/agent-performance.d.ts +29 -0
  176. package/dist/services/agent-performance.d.ts.map +1 -0
  177. package/dist/services/approval-manager.d.ts +30 -0
  178. package/dist/services/approval-manager.d.ts.map +1 -0
  179. package/dist/services/index.d.ts +7 -0
  180. package/dist/services/index.d.ts.map +1 -0
  181. package/dist/services/model-router.d.ts +35 -0
  182. package/dist/services/model-router.d.ts.map +1 -0
  183. package/dist/services/policy-compiler.d.ts +27 -0
  184. package/dist/services/policy-compiler.d.ts.map +1 -0
  185. package/dist/services/run-trace.d.ts +34 -0
  186. package/dist/services/run-trace.d.ts.map +1 -0
  187. package/dist/services/services.test.d.ts +2 -0
  188. package/dist/services/services.test.d.ts.map +1 -0
  189. package/dist/services/telemetry.d.ts +34 -0
  190. package/dist/services/telemetry.d.ts.map +1 -0
  191. package/dist/tools/agent-dispatch.test.d.ts +2 -0
  192. package/dist/tools/agent-dispatch.test.d.ts.map +1 -0
  193. package/dist/tools/codebase-state.d.ts +4 -0
  194. package/dist/tools/codebase-state.d.ts.map +1 -0
  195. package/dist/tools/context-generator.d.ts +3 -0
  196. package/dist/tools/context-generator.d.ts.map +1 -0
  197. package/dist/tools/council.d.ts +4 -0
  198. package/dist/tools/council.d.ts.map +1 -0
  199. package/dist/tools/decision-trace.d.ts +16 -0
  200. package/dist/tools/decision-trace.d.ts.map +1 -0
  201. package/dist/tools/delegate.d.ts +4 -0
  202. package/dist/tools/delegate.d.ts.map +1 -0
  203. package/dist/tools/failure-replay.d.ts +19 -0
  204. package/dist/tools/failure-replay.d.ts.map +1 -0
  205. package/dist/tools/failure-replay.test.d.ts +2 -0
  206. package/dist/tools/failure-replay.test.d.ts.map +1 -0
  207. package/dist/tools/hash-edit.d.ts +3 -0
  208. package/dist/tools/hash-edit.d.ts.map +1 -0
  209. package/dist/tools/planning-state-lib.d.ts +65 -0
  210. package/dist/tools/planning-state-lib.d.ts.map +1 -0
  211. package/dist/tools/planning-state.d.ts +3 -0
  212. package/dist/tools/planning-state.d.ts.map +1 -0
  213. package/dist/tools/policy-engine.d.ts +19 -0
  214. package/dist/tools/policy-engine.d.ts.map +1 -0
  215. package/dist/tools/repo-memory.d.ts +20 -0
  216. package/dist/tools/repo-memory.d.ts.map +1 -0
  217. package/dist/tools/repo-memory.test.d.ts +2 -0
  218. package/dist/tools/repo-memory.test.d.ts.map +1 -0
  219. package/dist/tools/run-parallel.d.ts +4 -0
  220. package/dist/tools/run-parallel.d.ts.map +1 -0
  221. package/dist/tools/run-pipeline.d.ts +4 -0
  222. package/dist/tools/run-pipeline.d.ts.map +1 -0
  223. package/dist/tools/volatility-map.d.ts +18 -0
  224. package/dist/tools/volatility-map.d.ts.map +1 -0
  225. package/dist/tools/volatility-map.test.d.ts +2 -0
  226. package/dist/tools/volatility-map.test.d.ts.map +1 -0
  227. package/dist/tools/workspace-state.d.ts +3 -0
  228. package/dist/tools/workspace-state.d.ts.map +1 -0
  229. package/docs/USER_GUIDE.md +20 -0
  230. package/docs/agents.md +562 -0
  231. package/docs/best-practices.md +47 -0
  232. package/docs/command-migration.md +175 -0
  233. package/docs/commands/fd-analyze-change.md +107 -0
  234. package/docs/commands/fd-ask.md +51 -0
  235. package/docs/commands/fd-checkpoint.md +10 -0
  236. package/docs/commands/fd-dashboard.md +11 -0
  237. package/docs/commands/fd-deploy-check.md +11 -0
  238. package/docs/commands/fd-discuss.md +28 -0
  239. package/docs/commands/fd-evaluate-risk.md +134 -0
  240. package/docs/commands/fd-fix-bug.md +24 -0
  241. package/docs/commands/fd-guarded-edit.md +105 -0
  242. package/docs/commands/fd-map-codebase.md +27 -0
  243. package/docs/commands/fd-multi-repo.md +63 -0
  244. package/docs/commands/fd-new-feature.md +25 -0
  245. package/docs/commands/fd-new-project.md +24 -0
  246. package/docs/commands/fd-plan.md +33 -0
  247. package/docs/commands/fd-progress.md +11 -0
  248. package/docs/commands/fd-resume.md +10 -0
  249. package/docs/commands/fd-review-code.md +29 -0
  250. package/docs/commands/fd-roadmap.md +10 -0
  251. package/docs/commands/fd-settings.md +10 -0
  252. package/docs/commands/fd-write-docs.md +10 -0
  253. package/docs/commands.md +476 -0
  254. package/docs/configuration.md +211 -0
  255. package/docs/feature-integration-architecture.md +255 -0
  256. package/docs/index.md +75 -0
  257. package/docs/installation.md +134 -0
  258. package/docs/intelligence.md +294 -0
  259. package/docs/multi-repo.md +201 -0
  260. package/docs/notifications.md +170 -0
  261. package/docs/parallel-execution.md +227 -0
  262. package/docs/quick-start.md +174 -0
  263. package/docs/rules.md +459 -0
  264. package/docs/skills.md +408 -0
  265. package/docs/workflows.md +376 -0
  266. package/package.json +58 -0
  267. package/postinstall.mjs +102 -0
  268. package/src/rules/README.md +37 -0
  269. package/src/rules/common/agent-orchestration.md +86 -0
  270. package/src/rules/common/coding-style.md +120 -0
  271. package/src/rules/common/git-workflow.md +77 -0
  272. package/src/rules/common/security.md +94 -0
  273. package/src/rules/common/testing.md +105 -0
  274. package/src/rules/golang/patterns.md +187 -0
  275. package/src/rules/java/patterns.md +204 -0
  276. package/src/rules/python/patterns.md +141 -0
  277. package/src/rules/rust/patterns.md +210 -0
  278. package/src/rules/typescript/patterns.md +168 -0
  279. package/src/skills/api-design/SKILL.md +143 -0
  280. package/src/skills/arch-constraint-guard/SKILL.md +61 -0
  281. package/src/skills/blast-radius-preview/SKILL.md +65 -0
  282. package/src/skills/change-impact-radar/SKILL.md +63 -0
  283. package/src/skills/code-review/SKILL.md +108 -0
  284. package/src/skills/code-tour/SKILL.md +101 -0
  285. package/src/skills/codebase-mapping/SKILL.md +87 -0
  286. package/src/skills/codebase-onboarding/SKILL.md +133 -0
  287. package/src/skills/confidence-aware-planning/SKILL.md +67 -0
  288. package/src/skills/context-load/SKILL.md +63 -0
  289. package/src/skills/debug-flow/SKILL.md +75 -0
  290. package/src/skills/decision-trace/SKILL.md +72 -0
  291. package/src/skills/dependency-audit/SKILL.md +126 -0
  292. package/src/skills/deploy-check/SKILL.md +87 -0
  293. package/src/skills/documentation-writer/SKILL.md +154 -0
  294. package/src/skills/failure-replay-engine/SKILL.md +59 -0
  295. package/src/skills/git-release/SKILL.md +94 -0
  296. package/src/skills/git-workflow/SKILL.md +177 -0
  297. package/src/skills/golang-patterns/SKILL.md +511 -0
  298. package/src/skills/human-review-routing/SKILL.md +65 -0
  299. package/src/skills/intent-translator/SKILL.md +57 -0
  300. package/src/skills/java-patterns/SKILL.md +479 -0
  301. package/src/skills/multi-repo/SKILL.md +187 -0
  302. package/src/skills/parallel-execute/SKILL.md +92 -0
  303. package/src/skills/patch-trust-score/SKILL.md +44 -0
  304. package/src/skills/performance-profiling/SKILL.md +153 -0
  305. package/src/skills/plan-task/SKILL.md +101 -0
  306. package/src/skills/python-patterns/SKILL.md +529 -0
  307. package/src/skills/refactor-guide/SKILL.md +117 -0
  308. package/src/skills/regression-prediction/SKILL.md +57 -0
  309. package/src/skills/repo-memory-graph/SKILL.md +49 -0
  310. package/src/skills/rust-patterns/SKILL.md +492 -0
  311. package/src/skills/security-scan/SKILL.md +91 -0
  312. package/src/skills/self-healing-policies/SKILL.md +76 -0
  313. package/src/skills/tdd-workflow/SKILL.md +126 -0
  314. package/src/skills/test-coverage/SKILL.md +94 -0
  315. package/src/skills/test-gap-detector/SKILL.md +58 -0
  316. package/src/skills/volatility-map/SKILL.md +52 -0
  317. package/src/workflows/debug-flow.md +119 -0
  318. package/src/workflows/deploy-check-flow.md +98 -0
  319. package/src/workflows/discuss-flow.md +97 -0
  320. package/src/workflows/execute-flow.md +233 -0
  321. package/src/workflows/execute-phase.md +142 -0
  322. package/src/workflows/fix-bug-flow.md +210 -0
  323. package/src/workflows/map-codebase-flow.md +92 -0
  324. package/src/workflows/multi-repo-flow.md +226 -0
  325. package/src/workflows/parallel-execution-flow.md +236 -0
  326. package/src/workflows/plan-flow.md +126 -0
  327. package/src/workflows/plan-phase.md +101 -0
  328. package/src/workflows/refactor-flow.md +122 -0
  329. package/src/workflows/review-code-flow.md +105 -0
  330. package/src/workflows/spec-driven-flow.md +43 -0
  331. package/src/workflows/write-docs-flow.md +95 -0
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: codebase-mapping
3
+ description: Systematic codebase exploration and documentation for agent context. Maps architecture, conventions, and file structure into .codebase/ files. Use when onboarding to a new project or before deep feature work.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Codebase Mapping Skill
8
+
9
+ Produces structured documentation of a codebase that agents can read to answer "how does this project work?" without re-scanning every time.
10
+
11
+ ## When to Activate
12
+
13
+ - Starting work on an unfamiliar codebase
14
+ - Before a major feature that spans multiple modules
15
+ - When `/map-codebase` command is invoked
16
+ - When `.codebase/` is missing or stale
17
+
18
+ ## Output Files
19
+
20
+ All outputs go to `.codebase/`:
21
+
22
+ | File | Contents |
23
+ |------|----------|
24
+ | `ARCHITECTURE.md` | System design: layers, modules, data flow |
25
+ | `CONVENTIONS.md` | Naming, style, patterns specific to this project |
26
+ | `DEPENDENCIES.md` | Key external packages and what they do |
27
+ | `INDEX.md` | File-by-file inventory |
28
+ | `ENTRY_POINTS.md` | How the application starts and key entry files |
29
+
30
+ ## Mapping Sequence
31
+
32
+ ### Step 1: Start from the outside
33
+
34
+ Read in this order:
35
+ 1. `package.json` / `pyproject.toml` / `Cargo.toml` — dependencies, scripts, metadata
36
+ 2. `README.md` — stated purpose and architecture
37
+ 3. Entry point files (main, index, app, server)
38
+ 4. Configuration files (env examples, config schemas)
39
+
40
+ ### Step 2: Map the directory structure
41
+
42
+ Document each top-level directory's purpose:
43
+ ```
44
+ src/
45
+ api/ — HTTP route handlers
46
+ services/ — Business logic
47
+ models/ — Database schemas and queries
48
+ utils/ — Shared helpers
49
+ tests/ — Test files (mirror of src/)
50
+ scripts/ — Build and deployment scripts
51
+ ```
52
+
53
+ Do not guess. Read the files to confirm what each directory contains.
54
+
55
+ ### Step 3: Document key conventions
56
+
57
+ Find examples in the code:
58
+ - How are errors handled? (throw? return Result? error callback?)
59
+ - How are modules exported? (default export? named exports?)
60
+ - What is the naming pattern for files? (`UserService.ts`? `user-service.ts`?)
61
+ - Where do interfaces/types live?
62
+ - How is dependency injection done?
63
+
64
+ Write 1-2 examples for each pattern, not a generic description.
65
+
66
+ ### Step 4: Document entry points
67
+
68
+ ```markdown
69
+ ## Entry Points
70
+
71
+ - `src/index.ts` — Application bootstrap, registers routes and middleware
72
+ - `src/workers/queue.ts` — Background job processor, runs independently
73
+ - `scripts/migrate.ts` — Database migration runner
74
+ ```
75
+
76
+ ### Step 5: List key dependencies
77
+
78
+ For each significant dependency, document:
79
+ - What it is used for in this project
80
+ - Where in the codebase it is used
81
+ - Version (note if pinned due to known issues)
82
+
83
+ ## Accuracy rules
84
+
85
+ - Only document what you have read — never document by assumption
86
+ - If a file's purpose is unclear, note "purpose unclear — investigate before modifying"
87
+ - Timestamp the mapping: `Last updated: [date]`
@@ -0,0 +1,133 @@
1
+ ---
2
+ name: codebase-onboarding
3
+ description: Systematically explores and documents an unfamiliar codebase. Use when joining a new project, setting up for the first time, or generating project documentation.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Codebase Onboarding Skill
8
+
9
+ Systematically maps an unfamiliar codebase into structured documentation. Factual only — no speculation.
10
+
11
+ ## When to Activate
12
+
13
+ Activate when:
14
+ - Joining a new project for the first time
15
+ - A new AI agent needs to understand the codebase
16
+ - Project documentation is out of date or missing
17
+ - Before making major architectural changes
18
+
19
+ ## Core Principles
20
+
21
+ - **Reconnaissance before action** — fully understand before touching anything
22
+ - **Factual, not speculative** — if uncertain, write `UNKNOWN — needs verification`
23
+ - **Document as you explore** — write findings immediately, before moving on
24
+
25
+ ## Phase 1: Reconnaissance
26
+
27
+ ```bash
28
+ # 1. Top-level structure
29
+ ls -la
30
+
31
+ # 2. Package manifest
32
+ cat package.json # Node.js
33
+ cat go.mod # Go
34
+ cat Cargo.toml # Rust
35
+ cat requirements.txt # Python
36
+
37
+ # 3. Entry points
38
+ find . -name "index.*" -o -name "main.*" | grep -v node_modules | grep -v dist | grep -v .git
39
+
40
+ # 4. Directory structure
41
+ find . -maxdepth 2 -type d | grep -v node_modules | grep -v .git | grep -v dist
42
+
43
+ # 5. Test structure
44
+ find . -name "*.test.*" -o -name "*.spec.*" | grep -v node_modules | head -20
45
+ ```
46
+
47
+ Findings:
48
+ - What framework is this? (Express, Next.js, FastAPI, etc.)
49
+ - Where does execution start?
50
+ - Where are the tests?
51
+
52
+ ## Phase 2: Architecture Mapping
53
+
54
+ Read the most important files:
55
+ 1. Main entry point — understand startup sequence
56
+ 2. Route definitions — what APIs/endpoints exist?
57
+ 3. Core data models — what are the key entities?
58
+ 4. Database setup — what database, what ORM?
59
+ 5. Auth setup — how is authentication handled?
60
+
61
+ Produce a component diagram:
62
+
63
+ ```
64
+ Client
65
+ → HTTP (port 3000)
66
+ → Express Router (src/routes/)
67
+ → Services (src/services/)
68
+ → Repository (src/db/)
69
+ → PostgreSQL
70
+ ```
71
+
72
+ ## Phase 3: Convention Detection
73
+
74
+ Read 5-10 source files and note patterns:
75
+
76
+ ```bash
77
+ # Naming conventions
78
+ grep -n "export function\|export const\|export class" src/ -r | head -20
79
+
80
+ # Error handling
81
+ grep -n "catch\|throw\|Error(" src/ -r | head -20
82
+
83
+ # Async patterns
84
+ grep -n "async\|await\|Promise" src/ -r | head -20
85
+ ```
86
+
87
+ Conventions to identify:
88
+ - Variable naming: camelCase, snake_case, or mixed?
89
+ - Import style: relative paths, aliases, or barrel exports?
90
+ - Error handling: throw, return Result, or callback?
91
+ - Async pattern: async/await, promises, or callbacks?
92
+
93
+ ## Output Format
94
+
95
+ ```markdown
96
+ # Codebase Onboarding: [Project Name]
97
+
98
+ ## Phase 1: Reconnaissance
99
+
100
+ **Runtime**: Node.js v20 / Python 3.11 / Go 1.21
101
+ **Framework**: Express 4.18 / FastAPI / Echo
102
+ **Package manager**: npm / pip / cargo
103
+ **Entry point**: `src/index.ts:1`
104
+ **Test framework**: vitest / pytest / go test
105
+
106
+ ## Phase 2: Architecture
107
+
108
+ **Pattern**: Layered (Routes → Services → Repository → Database)
109
+ **Database**: PostgreSQL via Prisma ORM
110
+ **Auth**: JWT via `src/middleware/auth.ts`
111
+
112
+ **Component Diagram**:
113
+ ```
114
+ [diagram]
115
+ ```
116
+
117
+ **Key Files**:
118
+ | File | Purpose |
119
+ |------|---------|
120
+ | `src/index.ts` | HTTP server startup |
121
+ | `src/routes/` | Route definitions |
122
+ | `src/services/` | Business logic |
123
+
124
+ ## Phase 3: Conventions
125
+
126
+ **Naming**: camelCase for variables, PascalCase for types
127
+ **Imports**: relative paths within module, `@/` alias for cross-module
128
+ **Error handling**: throws `AppError` with code, caught by middleware
129
+ **Async**: async/await throughout
130
+
131
+ ## Unknown / Needs Investigation
132
+ - [Things you could not determine from reading the code]
133
+ ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: confidence-aware-planning
3
+ description: Plan differently when the agent has low certainty — ask for clarification or narrow scope instead of pretending full understanding.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Confidence-Aware Planning
8
+
9
+ Not every task comes with complete information. This skill enforces honest uncertainty signaling and adaptive planning when confidence is low.
10
+
11
+ ## Confidence Levels
12
+
13
+ | Level | Meaning | Action |
14
+ |-------|---------|--------|
15
+ | HIGH (≥80%) | Well-understood scope, clear precedent in codebase | Proceed to plan normally |
16
+ | MEDIUM (40–79%) | Partial understanding, some unknowns | Surface assumptions, narrow scope, flag for review |
17
+ | LOW (<40%) | Significant unknowns, no clear precedent | Ask clarifying questions first, do not plan until answered |
18
+
19
+ ## Signals That Lower Confidence
20
+
21
+ - Codebase section not covered in `.codebase/ARCHITECTURE.md`
22
+ - No prior DISCUSS.md for this feature area
23
+ - Request touches 5+ files with unclear dependencies
24
+ - Request uses domain jargon that doesn't appear in codebase
25
+ - No test coverage in the affected area (no test files found)
26
+ - File is in a volatile or critical zone per `.codebase/VOLATILITY.json`
27
+
28
+ ## Workflow
29
+
30
+ Before planning ANY task:
31
+
32
+ 1. Read relevant codebase docs (ARCHITECTURE.md, STACK.md, CONVENTIONS.md)
33
+ 2. Scan affected files for context
34
+ 3. Estimate confidence level
35
+ 4. Act based on level:
36
+ - HIGH: proceed to `/plan`
37
+ - MEDIUM: write explicit assumptions at the top of PLAN.md, flag 3 highest risks
38
+ - LOW: stop, ask clarifying questions, do not write PLAN.md until answered
39
+
40
+ ## Clarifying Question Format
41
+
42
+ When confidence is LOW, ask in this format:
43
+ ```
44
+ Before I can plan this, I need to understand:
45
+
46
+ 1. [Question about scope/behavior]
47
+ 2. [Question about constraint or requirement]
48
+ 3. [Question about existing system behavior]
49
+
50
+ I have LOW confidence because: [specific reason]
51
+ ```
52
+
53
+ ## Assumption Declaration Format
54
+
55
+ When confidence is MEDIUM, include at the top of every plan:
56
+ ```markdown
57
+ ## Assumptions (MEDIUM confidence)
58
+ - A1: [assumption] — if wrong, [consequence]
59
+ - A2: [assumption] — if wrong, [consequence]
60
+
61
+ ## Risks
62
+ 1. [risk]: [mitigation]
63
+ ```
64
+
65
+ ## Non-negotiable
66
+
67
+ Never write a plan that pretends HIGH confidence when the agent actually has LOW confidence. False certainty leads to wrong implementations and wasted effort.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: context-load
3
+ description: Load full project context at session start. Read STATE.md, PLAN.md, PROJECT.md, CONVENTIONS.md, and ARCHITECTURE.md to brief any agent on where work stands.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Context Load Skill
8
+
9
+ Gets any agent up to speed in under 30 seconds. Loads the minimum set of project files needed to understand what phase the work is in and what comes next.
10
+
11
+ ## When to Activate
12
+
13
+ Activate at the start of every session, or when:
14
+ - Starting a new OpenCode session
15
+ - An agent seems unaware of the current project state
16
+ - You want to brief a new agent on the project
17
+
18
+ ## Core Principles
19
+
20
+ - Load context before asking any agent to do work
21
+ - Read in dependency order: state first, then plan, then code conventions
22
+ - Surface blockers immediately — don't proceed if STATE.md shows a blocker
23
+
24
+ ## Workflow
25
+
26
+ 1. **Read STATE.md** — current phase, active plan, completed steps, blockers
27
+ 2. **Read active PLAN.md** — (path from STATE.md) next tasks and success criteria
28
+ 3. **Read .planning/PROJECT.md** — project name, stack, constraints
29
+ 4. **Read .codebase/CONVENTIONS.md** — naming patterns, import style, error handling
30
+ 5. **Read .codebase/ARCHITECTURE.md** — component layout and data flow
31
+
32
+ ## Context Files
33
+
34
+ | File | Contains | Load Order |
35
+ |------|---------|-----------|
36
+ | `STATE.md` | Current phase, active plan, completed steps | 1st |
37
+ | `.planning/phases/phase-N/PLAN.md` | Tasks, success criteria | 2nd |
38
+ | `.planning/PROJECT.md` | Project context, constraints | 3rd |
39
+ | `.codebase/CONVENTIONS.md` | Naming, imports, patterns | 4th |
40
+ | `.codebase/ARCHITECTURE.md` | System design, components | 5th |
41
+
42
+ ## Output Format
43
+
44
+ After loading context, produce this briefing:
45
+
46
+ ```markdown
47
+ ## Project Context Loaded
48
+
49
+ **Project**: [name from PROJECT.md]
50
+ **Phase**: [N] — [phase name]
51
+ **Status**: [discuss | plan | execute | review]
52
+ **Active Plan**: [path to PLAN.md]
53
+
54
+ **Completed Steps**: [N of M]
55
+ **Next Step**: [next incomplete step from PLAN.md]
56
+
57
+ **Blockers**: [none | description]
58
+
59
+ **Stack**: [from PROJECT.md or CONVENTIONS.md]
60
+ **Key Conventions**: [2-3 most important patterns]
61
+ ```
62
+
63
+ If any file is missing, note it: "STATE.md not found — run `/new-project` to initialize."
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: debug-flow
3
+ description: Systematic debugging workflow. Reproduce the issue, isolate root cause, write a failing test, fix, verify. Use when diagnosing bugs or unexpected behavior.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Debug Flow Skill
8
+
9
+ Finds root causes through systematic investigation. Does not guess. Does not fix symptoms.
10
+
11
+ ## When to Activate
12
+
13
+ Activate when:
14
+ - A bug has been reported
15
+ - Code is producing unexpected output
16
+ - Tests are failing intermittently
17
+ - An error is occurring in production
18
+
19
+ ## Core Principles
20
+
21
+ - Read stack traces completely — never skip to the middle
22
+ - Fix root causes, not symptoms
23
+ - Check recent changes first — `git log --oneline -20`
24
+ - Reproduce before fixing — if you can't reproduce it, you don't understand it
25
+
26
+ ## Workflow
27
+
28
+ 1. **Reproduce** — confirm you can make the bug happen reliably
29
+ 2. **Read the full stack trace** — start from the top (error), trace to the origin
30
+ 3. **Check recent changes** — `git log --oneline -20` to find what changed
31
+ 4. **Trace execution backward** — what called the failing function? What state did it receive?
32
+ 5. **Identify root cause** — the earliest point where invariants are violated
33
+ 6. **Write a failing test** — one test that fails with the bug present
34
+ 7. **Fix** — change the minimum code to make the test pass
35
+ 8. **Verify** — run the full test suite
36
+
37
+ ## Common Root Causes
38
+
39
+ | Symptom | Likely Cause | Investigation |
40
+ |---------|-------------|---------------|
41
+ | `Cannot read property of undefined` | Missing null check upstream | Trace where undefined enters |
42
+ | Wrong calculation result | Type coercion (`"5" + 3 = "53"`) | Check input types |
43
+ | Race condition / intermittent | Missing `await` | Find async functions called without await |
44
+ | Auth bypass | Missing middleware | Check route definition vs working routes |
45
+ | Infinite loop | Wrong termination condition | Log loop counter, check exit logic |
46
+ | Memory leak | Event listener not cleaned up | Check `useEffect` returns, `removeListener` calls |
47
+ | Promise rejection unhandled | Missing `.catch()` or `try/catch` | Check all async call sites |
48
+ | Type error at runtime | `as any` hiding real type | Find where the cast was added |
49
+ | Stale data in UI | Cache not invalidated | Check cache keys and invalidation logic |
50
+ | Import error | Circular dependency or missing export | `npx madge --circular src/` |
51
+
52
+ ## Bisect for Regressions
53
+
54
+ When something worked before but is broken now:
55
+
56
+ ```bash
57
+ git bisect start
58
+ git bisect bad # current is broken
59
+ git bisect good [last-good-sha] # last known working commit
60
+ npm test # run after each checkout
61
+ git bisect good # or: git bisect bad
62
+ git bisect reset # when done
63
+ ```
64
+
65
+ ## Output Format
66
+
67
+ ```markdown
68
+ ## Debug Report
69
+
70
+ **Root Cause**: [one sentence]
71
+ **Evidence**: `path/to/file.ts:42` — [what the code does wrong]
72
+ **Call Path**: request → controller → service → ❌ null dereference at line 42
73
+ **Fix**: [specific change to make]
74
+ **Test**: [name of the failing test that reproduces the bug]
75
+ ```
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: decision-trace
3
+ description: Record why the agent changed something, what evidence was used, and what assumptions were made — so code reviews become much faster.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Decision Trace
8
+
9
+ Every non-trivial edit should be recorded in `.codebase/DECISIONS.jsonl`. This creates an append-only audit trail that makes code review and debugging faster.
10
+
11
+ ## When to Record a Decision
12
+
13
+ Record when:
14
+ - Editing a file that affects behavior (not just formatting/comments)
15
+ - Choosing between two or more implementation approaches
16
+ - Making an assumption about a requirement
17
+ - Fixing a bug or regression
18
+ - Changing an API contract or schema
19
+
20
+ ## How to Record
21
+
22
+ Use the `decision-trace` tool:
23
+
24
+ ```json
25
+ {
26
+ "action": "record",
27
+ "entry": {
28
+ "id": "auth-refactor-2024-05-01",
29
+ "file_path": "src/services/auth.ts",
30
+ "change_type": "edit",
31
+ "rationale": "Refactored token validation to use constant-time comparison to prevent timing attacks",
32
+ "evidence": [
33
+ "OWASP: timing attacks on string comparison",
34
+ "Prior failure: auth-timing-2024-03 in FAILURES.json"
35
+ ],
36
+ "assumptions": [
37
+ "Token format remains base64-encoded JWT",
38
+ "Redis cache is available for token blacklist"
39
+ ],
40
+ "alternatives_considered": [
41
+ "Keep string comparison (rejected: timing attack risk)",
42
+ "Move validation to edge (rejected: adds latency)"
43
+ ],
44
+ "risk_level": "medium",
45
+ "agent": "coder"
46
+ }
47
+ }
48
+ ```
49
+
50
+ ## Automatic Recording
51
+
52
+ The `decision-trace-hook` auto-records a minimal entry for every write/edit. The full entry (with rationale, evidence, assumptions) should be added by the agent explicitly using the tool above.
53
+
54
+ ## Querying Decisions
55
+
56
+ ```json
57
+ // Get all decisions for a file
58
+ { "action": "get_for_file", "file_path": "src/services/auth.ts" }
59
+
60
+ // Get all high-risk decisions
61
+ { "action": "query", "query": { "risk_level": "high", "limit": 10 } }
62
+ ```
63
+
64
+ ## Review Acceleration
65
+
66
+ When reviewing a PR, query DECISIONS.jsonl for all files in the diff. For each entry, reviewers can quickly see the "why" without asking the author.
67
+
68
+ ## Guidance
69
+
70
+ - Rationale should answer: "why this approach and not the obvious alternative?"
71
+ - Evidence should be checkable: a doc URL, a failure ID, a test result
72
+ - Assumptions should be explicit: if an assumption breaks, so does the change
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: dependency-audit
3
+ description: Audits npm/pip/cargo dependencies for known vulnerabilities, outdated packages, and license issues. Activate before releases or when CVE alerts are received.
4
+ origin: FlowDeck
5
+ ---
6
+
7
+ # Dependency Audit Skill
8
+
9
+ Checks dependencies for security vulnerabilities, outdated versions, and license issues before they cause problems in production.
10
+
11
+ ## When to Activate
12
+
13
+ Activate when:
14
+ - Preparing a production release
15
+ - Receiving a CVE alert for a dependency
16
+ - Adding a major new dependency
17
+ - It has been more than 30 days since last audit
18
+
19
+ ## Core Principles
20
+
21
+ - **Security over convenience** — patch vulnerabilities before releasing
22
+ - **Patch before releasing** — critical and high findings block deployment
23
+ - **License compliance matters** — GPL in a commercial product can create legal problems
24
+
25
+ ## Workflow
26
+
27
+ 1. Run security audit commands
28
+ 2. Triage findings by severity
29
+ 3. Check for outdated packages
30
+ 4. Check licenses of key dependencies
31
+ 5. Produce report with recommended actions
32
+
33
+ ## Audit Commands
34
+
35
+ ```bash
36
+ # npm
37
+ npm audit # all vulnerabilities
38
+ npm audit --audit-level=moderate # moderate and above
39
+ npm audit fix # auto-fix safe upgrades
40
+ npm audit fix --force # force fix (may break things — test first)
41
+
42
+ # Check outdated packages
43
+ npm outdated
44
+
45
+ # Snyk (more comprehensive)
46
+ npx snyk test
47
+ npx snyk monitor
48
+
49
+ # Python
50
+ pip-audit # install: pip install pip-audit
51
+ pip list --outdated
52
+
53
+ # Rust
54
+ cargo audit # install: cargo install cargo-audit
55
+
56
+ # Check licenses
57
+ npx license-checker --summary
58
+ npx license-checker --onlyAllow 'MIT;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC'
59
+ ```
60
+
61
+ ## Severity Triage
62
+
63
+ | Severity | Action | Timeline |
64
+ |----------|--------|---------|
65
+ | Critical | Fix immediately — do not deploy | Before next commit |
66
+ | High | Fix before release | Before next deployment |
67
+ | Moderate | Fix in next sprint | Within 2 weeks |
68
+ | Low | Track and fix eventually | Next maintenance window |
69
+
70
+ ## Common Vulnerability Patterns
71
+
72
+ - **Prototype pollution** — lodash <4.17.21, merge-deep <3.0.3
73
+ - **Path traversal** — file utility packages that accept user-controlled paths
74
+ - **ReDoS** — regex-based parsers (moment.js, validator.js older versions)
75
+ - **Command injection** — packages that shell out with user-controlled input
76
+
77
+ ## Update Strategy
78
+
79
+ | Change Type | Safety | Action |
80
+ |-------------|--------|--------|
81
+ | Patch (x.y.Z) | Very safe | Update immediately |
82
+ | Minor (x.Y.z) | Safe with tests | Update, run full test suite |
83
+ | Major (X.y.z) | Breaking changes likely | Read changelog, test thoroughly |
84
+
85
+ ```bash
86
+ # Safe patch/minor updates
87
+ npm update # updates within version constraints
88
+ npx npm-check-updates -u --target patch # update only patches
89
+ ```
90
+
91
+ ## License Audit
92
+
93
+ | License | Commercial Use | Notes |
94
+ |---------|---------------|-------|
95
+ | MIT | ✅ Safe | Most permissive |
96
+ | Apache 2.0 | ✅ Safe | Patent grant included |
97
+ | BSD-2/3 | ✅ Safe | Attribution required |
98
+ | ISC | ✅ Safe | MIT equivalent |
99
+ | LGPL | ⚠️ Check | OK if only linking to it |
100
+ | GPL | ❌ Risky | Legal review required for commercial |
101
+ | AGPL | ❌ Risky | Strongest copyleft — legal review required |
102
+ | Unknown | ❌ Investigate | Do not ship until license is known |
103
+
104
+ ## Output Format
105
+
106
+ ```markdown
107
+ ## Dependency Audit Report
108
+
109
+ ### Vulnerabilities
110
+ | Package | Severity | CVE | Fix |
111
+ |---------|----------|-----|-----|
112
+ | lodash@4.17.19 | High | CVE-2021-23337 | Upgrade to 4.17.21 |
113
+
114
+ ### Outdated Packages (Major Versions)
115
+ | Package | Current | Latest | Breaking Changes |
116
+ |---------|---------|--------|-----------------|
117
+ | express | 4.17.3 | 5.0.0 | Yes — read changelog |
118
+
119
+ ### License Issues
120
+ | Package | License | Issue |
121
+ |---------|---------|-------|
122
+ | some-pkg | GPL-3.0 | Requires legal review for commercial use |
123
+
124
+ ### Verdict: PASS ✅ | FAIL ❌
125
+ FAIL if any Critical or High vulnerabilities remain unfixed.
126
+ ```