ndomo 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 (247) hide show
  1. package/.bun-version +1 -0
  2. package/.dockerignore +79 -0
  3. package/.editorconfig +18 -0
  4. package/.env.example +19 -0
  5. package/.github/CODEOWNERS +8 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.yml +62 -0
  7. package/.github/ISSUE_TEMPLATE/config.yml +2 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.yml +34 -0
  9. package/.github/dependabot.yml +36 -0
  10. package/.github/pull_request_template.md +24 -0
  11. package/.github/release.yml +30 -0
  12. package/.github/workflows/gitleaks.yml +28 -0
  13. package/.github/workflows/release-please.yml +27 -0
  14. package/.github/workflows/smoke.yml +29 -0
  15. package/.husky/commit-msg +1 -0
  16. package/CHANGELOG.md +114 -0
  17. package/Dockerfile +32 -0
  18. package/README.es.md +174 -0
  19. package/README.md +187 -0
  20. package/agents/chronicler.md +98 -0
  21. package/agents/ci-smith.md +136 -0
  22. package/agents/craftsman.md +341 -0
  23. package/agents/deploy-smith.md +138 -0
  24. package/agents/foreman.md +377 -0
  25. package/agents/go-smith.md +164 -0
  26. package/agents/guild.md +188 -0
  27. package/agents/inspector.md +83 -0
  28. package/agents/js-smith.md +127 -0
  29. package/agents/ops-scout.md +173 -0
  30. package/agents/painter.md +200 -0
  31. package/agents/python-smith.md +120 -0
  32. package/agents/ranger.md +307 -0
  33. package/agents/release-smith.md +165 -0
  34. package/agents/rust-smith.md +159 -0
  35. package/agents/sage.md +178 -0
  36. package/agents/scout.md +144 -0
  37. package/agents/scribe.md +156 -0
  38. package/agents/smith.md +201 -0
  39. package/agents/vue-smith.md +155 -0
  40. package/agents/warden.md +216 -0
  41. package/agents/zig-smith.md +156 -0
  42. package/bin/ndomo-analyses.ts +4 -0
  43. package/bin/ndomo-status.ts +4 -0
  44. package/biome.json +57 -0
  45. package/bun.lock +514 -0
  46. package/commitlint.config.js +3 -0
  47. package/config/ndomo.config.json +258 -0
  48. package/config/ndomo.schema.json +166 -0
  49. package/docs/agents.md +375 -0
  50. package/docs/bugs/plan-create-orphan-fk.md +131 -0
  51. package/docs/bugs/task_create_batch-order-index-collision.md +158 -0
  52. package/docs/configuration.md +276 -0
  53. package/docs/database.md +364 -0
  54. package/docs/features/feature-flexible-builder-v1.md +724 -0
  55. package/docs/features/feature-flexible-builder-v2.md +882 -0
  56. package/docs/features/feature-flexible-builder.md +974 -0
  57. package/docs/http-server.md +244 -0
  58. package/docs/installation.md +259 -0
  59. package/docs/integrations.md +129 -0
  60. package/docs/operations/anti-pattern-sub-agent-verify-2026-06-21.md +32 -0
  61. package/docs/operations/audit-v1.md +417 -0
  62. package/docs/operations/audit-v2.md +197 -0
  63. package/docs/operations/audit-v3.md +306 -0
  64. package/docs/operations/db-optimize-foundations.md +123 -0
  65. package/docs/operations/verify-gate-architecture.md +82 -0
  66. package/docs/workflows.md +448 -0
  67. package/opencode.json +5 -0
  68. package/package.json +65 -0
  69. package/release-please-config.json +11 -0
  70. package/scripts/dev-bust-cache.sh +164 -0
  71. package/scripts/install.sh +688 -0
  72. package/scripts/smoke-e2e.ts +704 -0
  73. package/scripts/smoke-hot.ts +417 -0
  74. package/scripts/smoke-http.sh +228 -0
  75. package/scripts/smoke-v4.ts +256 -0
  76. package/scripts/smoke-v5.ts +397 -0
  77. package/scripts/smoke.sh +9 -0
  78. package/scripts/uninstall.sh +224 -0
  79. package/skills/api-security-best-practices/SKILL.md +915 -0
  80. package/skills/bash-scripting/SKILL.md +201 -0
  81. package/skills/bun/SKILL.md +313 -0
  82. package/skills/cavecrew/SKILL.md +82 -0
  83. package/skills/caveman/SKILL.md +74 -0
  84. package/skills/caveman-review/README.md +33 -0
  85. package/skills/caveman-review/SKILL.md +55 -0
  86. package/skills/find-skills/SKILL.md +142 -0
  87. package/skills/frontend-design/LICENSE.txt +177 -0
  88. package/skills/frontend-design/SKILL.md +55 -0
  89. package/skills/golang-patterns/SKILL.md +674 -0
  90. package/skills/golang-security/SKILL.md +185 -0
  91. package/skills/golang-security/evals/evals.json +595 -0
  92. package/skills/golang-security/references/architecture.md +268 -0
  93. package/skills/golang-security/references/checklist.md +80 -0
  94. package/skills/golang-security/references/cookies.md +200 -0
  95. package/skills/golang-security/references/cryptography.md +424 -0
  96. package/skills/golang-security/references/filesystem.md +285 -0
  97. package/skills/golang-security/references/injection.md +315 -0
  98. package/skills/golang-security/references/logging.md +163 -0
  99. package/skills/golang-security/references/memory-safety.md +241 -0
  100. package/skills/golang-security/references/network.md +253 -0
  101. package/skills/golang-security/references/secrets.md +189 -0
  102. package/skills/golang-security/references/third-party.md +159 -0
  103. package/skills/golang-security/references/threat-modeling.md +189 -0
  104. package/skills/golang-testing/SKILL.md +720 -0
  105. package/skills/grill-me/SKILL.md +7 -0
  106. package/skills/javascript-testing-patterns/SKILL.md +537 -0
  107. package/skills/javascript-testing-patterns/references/advanced-testing-patterns.md +513 -0
  108. package/skills/modern-javascript-patterns/SKILL.md +43 -0
  109. package/skills/modern-javascript-patterns/references/advanced-patterns.md +487 -0
  110. package/skills/modern-javascript-patterns/references/details.md +457 -0
  111. package/skills/python-anti-patterns/SKILL.md +349 -0
  112. package/skills/python-design-patterns/SKILL.md +85 -0
  113. package/skills/python-design-patterns/references/details.md +353 -0
  114. package/skills/python-error-handling/SKILL.md +193 -0
  115. package/skills/python-error-handling/references/details.md +171 -0
  116. package/skills/python-testing-patterns/SKILL.md +278 -0
  117. package/skills/python-testing-patterns/references/advanced-patterns.md +411 -0
  118. package/skills/python-testing-patterns/references/details.md +349 -0
  119. package/skills/rust-patterns/SKILL.md +500 -0
  120. package/skills/rust-testing/SKILL.md +501 -0
  121. package/skills/security-review/SKILL.md +504 -0
  122. package/skills/security-review/cloud-infrastructure-security.md +361 -0
  123. package/skills/vue-best-practices/SKILL.md +154 -0
  124. package/skills/vue-best-practices/references/animation-class-based-technique.md +254 -0
  125. package/skills/vue-best-practices/references/animation-state-driven-technique.md +291 -0
  126. package/skills/vue-best-practices/references/component-async.md +97 -0
  127. package/skills/vue-best-practices/references/component-data-flow.md +307 -0
  128. package/skills/vue-best-practices/references/component-fallthrough-attrs.md +174 -0
  129. package/skills/vue-best-practices/references/component-keep-alive.md +137 -0
  130. package/skills/vue-best-practices/references/component-slots.md +216 -0
  131. package/skills/vue-best-practices/references/component-suspense.md +228 -0
  132. package/skills/vue-best-practices/references/component-teleport.md +108 -0
  133. package/skills/vue-best-practices/references/component-transition-group.md +128 -0
  134. package/skills/vue-best-practices/references/component-transition.md +125 -0
  135. package/skills/vue-best-practices/references/composables.md +290 -0
  136. package/skills/vue-best-practices/references/directives.md +162 -0
  137. package/skills/vue-best-practices/references/perf-avoid-component-abstraction-in-lists.md +159 -0
  138. package/skills/vue-best-practices/references/perf-v-once-v-memo-directives.md +182 -0
  139. package/skills/vue-best-practices/references/perf-virtualize-large-lists.md +187 -0
  140. package/skills/vue-best-practices/references/plugins.md +166 -0
  141. package/skills/vue-best-practices/references/reactivity.md +344 -0
  142. package/skills/vue-best-practices/references/render-functions.md +201 -0
  143. package/skills/vue-best-practices/references/sfc.md +310 -0
  144. package/skills/vue-best-practices/references/state-management.md +135 -0
  145. package/skills/vue-best-practices/references/updated-hook-performance.md +187 -0
  146. package/skills/vue-pinia-best-practices/SKILL.md +21 -0
  147. package/skills/vue-pinia-best-practices/reference/pinia-no-active-pinia-error.md +248 -0
  148. package/skills/vue-pinia-best-practices/reference/pinia-setup-store-return-all-state.md +227 -0
  149. package/skills/vue-pinia-best-practices/reference/pinia-store-destructuring-breaks-reactivity.md +193 -0
  150. package/skills/vue-pinia-best-practices/reference/state-url-for-ephemeral-filters.md +238 -0
  151. package/skills/vue-pinia-best-practices/reference/state-use-pinia-for-large-apps.md +262 -0
  152. package/skills/vue-pinia-best-practices/reference/store-method-binding-parentheses.md +191 -0
  153. package/skills/zig-0.16/SKILL.md +840 -0
  154. package/skills/zig-0.16/scripts/check-zig-version.sh +21 -0
  155. package/src/cli/analyses.ts +280 -0
  156. package/src/cli/index.ts +108 -0
  157. package/src/cli/serve.ts +192 -0
  158. package/src/cli/smoke.ts +131 -0
  159. package/src/cli/status.test.ts +204 -0
  160. package/src/cli/status.ts +263 -0
  161. package/src/cli/vacuum.test.ts +82 -0
  162. package/src/cli/vacuum.ts +96 -0
  163. package/src/config/schema.test.ts +88 -0
  164. package/src/config/schema.ts +64 -0
  165. package/src/db/analyses-migration.test.ts +210 -0
  166. package/src/db/analyses.test.ts +466 -0
  167. package/src/db/analyses.ts +375 -0
  168. package/src/db/auto-checkpoint.ts +131 -0
  169. package/src/db/client.test.ts +129 -0
  170. package/src/db/client.ts +55 -0
  171. package/src/db/fts-escape.ts +20 -0
  172. package/src/db/incidents.test.ts +201 -0
  173. package/src/db/incidents.ts +93 -0
  174. package/src/db/index.ts +86 -0
  175. package/src/db/migrations-v13.test.ts +141 -0
  176. package/src/db/migrations-v8.test.ts +301 -0
  177. package/src/db/migrations.ts +147 -0
  178. package/src/db/plan-archive.test.ts +180 -0
  179. package/src/db/plan-archive.ts +274 -0
  180. package/src/db/plan-create.test.ts +276 -0
  181. package/src/db/plan-create.ts +78 -0
  182. package/src/db/plan-files.test.ts +289 -0
  183. package/src/db/plan-update-status.ts +287 -0
  184. package/src/db/plans.test.ts +490 -0
  185. package/src/db/plans.ts +534 -0
  186. package/src/db/resolve-project-dir.test.ts +143 -0
  187. package/src/db/resolve-project-dir.ts +75 -0
  188. package/src/db/rollbacks.test.ts +150 -0
  189. package/src/db/rollbacks.ts +67 -0
  190. package/src/db/schema.ts +907 -0
  191. package/src/db/sessions.test.ts +80 -0
  192. package/src/db/sessions.ts +135 -0
  193. package/src/db/shutdown.test.ts +147 -0
  194. package/src/db/shutdown.ts +45 -0
  195. package/src/db/tasks.test.ts +921 -0
  196. package/src/db/tasks.ts +747 -0
  197. package/src/db/types.ts +619 -0
  198. package/src/http/__tests__/auth.test.ts +196 -0
  199. package/src/http/__tests__/routes.test.ts +465 -0
  200. package/src/http/__tests__/sse.test.ts +317 -0
  201. package/src/http/auth.ts +72 -0
  202. package/src/http/middleware/cors.ts +53 -0
  203. package/src/http/middleware/security-headers.ts +21 -0
  204. package/src/http/routes/events.ts +112 -0
  205. package/src/http/routes/health.ts +51 -0
  206. package/src/http/routes/plans.ts +66 -0
  207. package/src/http/routes/sessions.ts +50 -0
  208. package/src/http/routes/tasks.ts +60 -0
  209. package/src/http/server.ts +95 -0
  210. package/src/http/sse.ts +116 -0
  211. package/src/index.ts +37 -0
  212. package/src/lib.ts +65 -0
  213. package/src/mem/scoped.ts +65 -0
  214. package/src/orchestrator/background.test.ts +268 -0
  215. package/src/orchestrator/background.ts +293 -0
  216. package/src/orchestrator/memory-hook.ts +182 -0
  217. package/src/orchestrator/reconciler.ts +123 -0
  218. package/src/orchestrator/scheduler.test.ts +300 -0
  219. package/src/orchestrator/scheduler.ts +243 -0
  220. package/src/plugin.test.ts +2574 -0
  221. package/src/plugin.ts +1690 -0
  222. package/src/sdk/client.ts +66 -0
  223. package/src/worktrees/manager.ts +236 -0
  224. package/src/worktrees/state.ts +87 -0
  225. package/tests/integration/ranger-flow.test.ts +257 -0
  226. package/tools/analysis_archive.ts +28 -0
  227. package/tools/analysis_create.ts +55 -0
  228. package/tools/analysis_get.ts +33 -0
  229. package/tools/analysis_link_plan.ts +44 -0
  230. package/tools/analysis_list.ts +48 -0
  231. package/tools/analysis_search.ts +36 -0
  232. package/tools/analysis_update.ts +44 -0
  233. package/tools/plan_approve.ts +31 -0
  234. package/tools/plan_create.ts +58 -0
  235. package/tools/plan_get.ts +40 -0
  236. package/tools/plan_list.ts +37 -0
  237. package/tools/plan_search.ts +34 -0
  238. package/tools/plan_update_status.ts +71 -0
  239. package/tools/session_checkpoint.ts +31 -0
  240. package/tools/session_end.ts +26 -0
  241. package/tools/session_start.ts +43 -0
  242. package/tools/task_create_batch.ts +70 -0
  243. package/tools/task_list.ts +35 -0
  244. package/tools/task_next_for_agent.ts +30 -0
  245. package/tools/task_search.ts +34 -0
  246. package/tools/task_update_status.ts +37 -0
  247. package/tsconfig.json +31 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: bash-scripting
3
+ description: "Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing."
4
+ category: granular-workflow-bundle
5
+ risk: safe
6
+ source: personal
7
+ date_added: "2026-02-27"
8
+ ---
9
+
10
+ # Bash Scripting Workflow
11
+
12
+ ## Overview
13
+
14
+ Specialized workflow for creating robust, production-ready bash scripts with defensive programming patterns, comprehensive error handling, and automated testing.
15
+
16
+ ## When to Use This Workflow
17
+
18
+ Use this workflow when:
19
+ - Creating automation scripts
20
+ - Writing system administration tools
21
+ - Building deployment scripts
22
+ - Developing backup solutions
23
+ - Creating CI/CD scripts
24
+
25
+ ## Workflow Phases
26
+
27
+ ### Phase 1: Script Design
28
+
29
+ #### Skills to Invoke
30
+ - `bash-pro` - Professional scripting
31
+ - `bash-defensive-patterns` - Defensive patterns
32
+
33
+ #### Actions
34
+ 1. Define script purpose
35
+ 2. Identify inputs/outputs
36
+ 3. Plan error handling
37
+ 4. Design logging strategy
38
+ 5. Document requirements
39
+
40
+ #### Copy-Paste Prompts
41
+ ```
42
+ Use @bash-pro to design production-ready bash script
43
+ ```
44
+
45
+ ### Phase 2: Script Structure
46
+
47
+ #### Skills to Invoke
48
+ - `bash-pro` - Script structure
49
+ - `bash-defensive-patterns` - Safety patterns
50
+
51
+ #### Actions
52
+ 1. Add shebang and strict mode
53
+ 2. Create usage function
54
+ 3. Implement argument parsing
55
+ 4. Set up logging
56
+ 5. Add cleanup handlers
57
+
58
+ #### Copy-Paste Prompts
59
+ ```
60
+ Use @bash-defensive-patterns to implement strict mode and error handling
61
+ ```
62
+
63
+ ### Phase 3: Core Implementation
64
+
65
+ #### Skills to Invoke
66
+ - `bash-linux` - Linux commands
67
+ - `linux-shell-scripting` - Shell scripting
68
+
69
+ #### Actions
70
+ 1. Implement main functions
71
+ 2. Add input validation
72
+ 3. Create helper functions
73
+ 4. Handle edge cases
74
+ 5. Add progress indicators
75
+
76
+ #### Copy-Paste Prompts
77
+ ```
78
+ Use @bash-linux to implement system commands
79
+ ```
80
+
81
+ ### Phase 4: Error Handling
82
+
83
+ #### Skills to Invoke
84
+ - `bash-defensive-patterns` - Error handling
85
+ - `error-handling-patterns` - Error patterns
86
+
87
+ #### Actions
88
+ 1. Add trap handlers
89
+ 2. Implement retry logic
90
+ 3. Create error messages
91
+ 4. Set up exit codes
92
+ 5. Add rollback capability
93
+
94
+ #### Copy-Paste Prompts
95
+ ```
96
+ Use @bash-defensive-patterns to add comprehensive error handling
97
+ ```
98
+
99
+ ### Phase 5: Logging
100
+
101
+ #### Skills to Invoke
102
+ - `bash-pro` - Logging patterns
103
+
104
+ #### Actions
105
+ 1. Create logging function
106
+ 2. Add log levels
107
+ 3. Implement timestamps
108
+ 4. Configure log rotation
109
+ 5. Add debug mode
110
+
111
+ #### Copy-Paste Prompts
112
+ ```
113
+ Use @bash-pro to implement structured logging
114
+ ```
115
+
116
+ ### Phase 6: Testing
117
+
118
+ #### Skills to Invoke
119
+ - `bats-testing-patterns` - Bats testing
120
+ - `shellcheck-configuration` - ShellCheck
121
+
122
+ #### Actions
123
+ 1. Write Bats tests
124
+ 2. Run ShellCheck
125
+ 3. Test edge cases
126
+ 4. Verify error handling
127
+ 5. Test with different inputs
128
+
129
+ #### Copy-Paste Prompts
130
+ ```
131
+ Use @bats-testing-patterns to write script tests
132
+ ```
133
+
134
+ ```
135
+ Use @shellcheck-configuration to lint bash script
136
+ ```
137
+
138
+ ### Phase 7: Documentation
139
+
140
+ #### Skills to Invoke
141
+ - `documentation-templates` - Documentation
142
+
143
+ #### Actions
144
+ 1. Add script header
145
+ 2. Document functions
146
+ 3. Create usage examples
147
+ 4. List dependencies
148
+ 5. Add troubleshooting section
149
+
150
+ #### Copy-Paste Prompts
151
+ ```
152
+ Use @documentation-templates to document bash script
153
+ ```
154
+
155
+ ## Script Template
156
+
157
+ ```bash
158
+ #!/usr/bin/env bash
159
+ set -euo pipefail
160
+
161
+ readonly SCRIPT_NAME=$(basename "$0")
162
+ readonly SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
163
+
164
+ log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
165
+ error() { log "ERROR: $*" >&2; exit 1; }
166
+
167
+ usage() { cat <<EOF
168
+ Usage: $SCRIPT_NAME [OPTIONS]
169
+ Options:
170
+ -h, --help Show help
171
+ -v, --verbose Verbose output
172
+ EOF
173
+ }
174
+
175
+ main() {
176
+ log "Script started"
177
+ # Implementation
178
+ log "Script completed"
179
+ }
180
+
181
+ main "$@"
182
+ ```
183
+
184
+ ## Quality Gates
185
+
186
+ - [ ] ShellCheck passes
187
+ - [ ] Bats tests pass
188
+ - [ ] Error handling works
189
+ - [ ] Logging functional
190
+ - [ ] Documentation complete
191
+
192
+ ## Related Workflow Bundles
193
+
194
+ - `os-scripting` - OS scripting
195
+ - `linux-troubleshooting` - Linux troubleshooting
196
+ - `cloud-devops` - DevOps automation
197
+
198
+ ## Limitations
199
+ - Use this skill only when the task clearly matches the scope described above.
200
+ - Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
201
+ - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
@@ -0,0 +1,313 @@
1
+ ---
2
+ name: Bun
3
+ description: Use when building, running, testing, or bundling JavaScript/TypeScript applications. Reach for Bun when you need to execute scripts, manage dependencies, run tests, or bundle code for production. Bun is a drop-in replacement for Node.js with integrated package manager, test runner, and bundler.
4
+ metadata:
5
+ mintlify-proj: bun
6
+ version: "1.0"
7
+ ---
8
+
9
+ # Bun Skill Reference
10
+
11
+ ## Product Summary
12
+
13
+ Bun is an all-in-one JavaScript/TypeScript toolkit that replaces Node.js, npm, Jest, and esbuild. It ships as a single binary and includes:
14
+
15
+ - **Runtime**: Execute `.js`, `.ts`, `.jsx`, `.tsx` files with native transpilation (4x faster startup than Node.js)
16
+ - **Package Manager**: `bun install` (25x faster than npm) with workspaces, lockfiles, and global cache
17
+ - **Test Runner**: Jest-compatible `bun test` with snapshots, mocking, and watch mode
18
+ - **Bundler**: `bun build` for browsers, servers, and standalone executables
19
+
20
+ Key files and commands:
21
+ - `bunfig.toml` — Configuration file (optional, zero-config by default)
22
+ - `bun run <script>` — Execute package.json scripts or files
23
+ - `bun install` — Install dependencies
24
+ - `bun test` — Run tests
25
+ - `bun build` — Bundle code
26
+ - `package.json` — Standard Node.js manifest (Bun reads this)
27
+
28
+ Primary docs: https://bun.com/docs
29
+
30
+ ---
31
+
32
+ ## When to Use
33
+
34
+ **Use Bun when:**
35
+ - Running TypeScript/JSX files directly without compilation overhead
36
+ - Installing packages and managing dependencies (faster than npm/yarn/pnpm)
37
+ - Writing and running tests (Jest-compatible API)
38
+ - Bundling applications for production or deployment
39
+ - Building full-stack applications with server and client code
40
+ - Creating standalone executables from JavaScript/TypeScript
41
+ - Working in monorepos with workspaces
42
+ - Needing HTTP servers with `Bun.serve()`
43
+
44
+ **Bun replaces:**
45
+ - Node.js (runtime)
46
+ - npm/yarn/pnpm (package manager)
47
+ - Jest (test runner)
48
+ - esbuild/webpack (bundler)
49
+
50
+ ---
51
+
52
+ ## Quick Reference
53
+
54
+ ### Runtime Commands
55
+
56
+ | Command | Purpose |
57
+ |---------|---------|
58
+ | `bun run file.ts` | Execute a TypeScript/JavaScript file |
59
+ | `bun run script-name` | Run a package.json script |
60
+ | `bun --watch run file.ts` | Watch mode (re-run on file changes) |
61
+ | `bun run -` | Read and execute code from stdin |
62
+ | `bun --bun run script` | Force script to use Bun instead of Node.js |
63
+
64
+ ### Package Manager Commands
65
+
66
+ | Command | Purpose |
67
+ |---------|---------|
68
+ | `bun install` | Install all dependencies from package.json |
69
+ | `bun add <pkg>` | Add a package to dependencies |
70
+ | `bun add -d <pkg>` | Add as dev dependency |
71
+ | `bun add -g <pkg>` | Install globally |
72
+ | `bun remove <pkg>` | Remove a package |
73
+ | `bun update` | Update packages |
74
+ | `bun install --frozen-lockfile` | CI mode: fail if lockfile out of sync |
75
+ | `bun ci` | Equivalent to `bun install --frozen-lockfile` |
76
+
77
+ ### Test Runner Commands
78
+
79
+ | Command | Purpose |
80
+ |---------|---------|
81
+ | `bun test` | Run all tests |
82
+ | `bun test --watch` | Watch mode |
83
+ | `bun test --test-name-pattern <pattern>` | Filter tests by name |
84
+ | `bun test --concurrent` | Run tests in parallel |
85
+ | `bun test --coverage` | Generate coverage report |
86
+ | `bun test --update-snapshots` | Update snapshot files |
87
+
88
+ ### Bundler Commands
89
+
90
+ | Command | Purpose |
91
+ |---------|---------|
92
+ | `bun build ./index.ts --outdir ./dist` | Bundle for browser (default) |
93
+ | `bun build ./index.ts --target bun --outdir ./dist` | Bundle for Bun runtime |
94
+ | `bun build ./index.ts --target node --outdir ./dist` | Bundle for Node.js |
95
+ | `bun build ./index.ts --outfile ./cli --compile` | Create standalone executable |
96
+ | `bun build ./index.ts --watch` | Watch mode |
97
+
98
+ ### Configuration File (bunfig.toml)
99
+
100
+ ```toml
101
+ # Runtime settings
102
+ preload = ["./setup.ts"]
103
+ jsx = "react"
104
+ logLevel = "debug"
105
+
106
+ # Package manager
107
+ [install]
108
+ optional = true
109
+ dev = true
110
+ peer = true
111
+ linker = "hoisted" # or "isolated"
112
+
113
+ # Test runner
114
+ [test]
115
+ root = "./__tests__"
116
+ coverage = true
117
+ coverageThreshold = 0.9
118
+
119
+ # Server defaults
120
+ [serve]
121
+ port = 3000
122
+
123
+ # Script execution
124
+ [run]
125
+ shell = "system" # or "bun"
126
+ bun = true # alias node to bun
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Decision Guidance
132
+
133
+ ### When to use `bun run` vs `bun`
134
+
135
+ | Scenario | Use |
136
+ |----------|-----|
137
+ | Running a file: `bun run index.ts` | `bun run` (explicit) |
138
+ | Running a package.json script | `bun run script-name` (required) |
139
+ | Executing a file directly | `bun index.ts` (shorthand, same as `bun run`) |
140
+ | Running a system command | `bun run ls` (via `bun run`) |
141
+
142
+ ### Installation strategy: hoisted vs isolated
143
+
144
+ | Strategy | Use When |
145
+ |----------|----------|
146
+ | `hoisted` (default for single packages) | Traditional npm behavior; dependencies flattened in `node_modules` |
147
+ | `isolated` (default for workspaces) | Strict dependency isolation; prevents phantom dependencies (pnpm-like) |
148
+
149
+ Set in `bunfig.toml`: `[install] linker = "hoisted"` or `"isolated"`
150
+
151
+ ### Bundler target selection
152
+
153
+ | Target | Use For |
154
+ |--------|---------|
155
+ | `browser` (default) | Client-side code; prioritizes `"browser"` export condition |
156
+ | `bun` | Server-side code; optimized for Bun runtime; enables full-stack builds |
157
+ | `node` | Node.js compatibility; outputs `.mjs` with Node export conditions |
158
+
159
+ ### Test execution: serial vs concurrent
160
+
161
+ | Mode | Use When |
162
+ |------|----------|
163
+ | Sequential (default) | Tests have shared state or order dependencies |
164
+ | `test.concurrent()` | Tests are independent and can run in parallel |
165
+ | `test.serial()` | Force sequential even with `--concurrent` flag |
166
+
167
+ ---
168
+
169
+ ## Workflow
170
+
171
+ ### 1. Initialize a Project
172
+
173
+ ```bash
174
+ bun init my-app
175
+ cd my-app
176
+ ```
177
+
178
+ Bun creates `package.json`, `tsconfig.json`, and a starter file. Choose template: Blank, React, or Library.
179
+
180
+ ### 2. Install Dependencies
181
+
182
+ ```bash
183
+ bun install
184
+ # or add a specific package
185
+ bun add react
186
+ bun add -d @types/react
187
+ ```
188
+
189
+ Bun creates `bun.lock` (text-based lockfile) and `node_modules/`.
190
+
191
+ ### 3. Configure (Optional)
192
+
193
+ Create `bunfig.toml` in project root for Bun-specific settings. Most projects work without it.
194
+
195
+ ```toml
196
+ [install]
197
+ linker = "isolated"
198
+
199
+ [test]
200
+ coverage = true
201
+ ```
202
+
203
+ ### 4. Run Code
204
+
205
+ Execute TypeScript/JavaScript directly:
206
+
207
+ ```bash
208
+ bun run src/index.ts
209
+ # or via package.json script
210
+ bun run dev
211
+ ```
212
+
213
+ ### 5. Write Tests
214
+
215
+ Create `*.test.ts` or `*.spec.ts` files:
216
+
217
+ ```ts
218
+ import { test, expect } from "bun:test";
219
+
220
+ test("addition", () => {
221
+ expect(2 + 2).toBe(4);
222
+ });
223
+ ```
224
+
225
+ Run tests:
226
+
227
+ ```bash
228
+ bun test
229
+ bun test --watch
230
+ bun test --coverage
231
+ ```
232
+
233
+ ### 6. Bundle for Production
234
+
235
+ ```bash
236
+ # Browser bundle
237
+ bun build ./src/index.tsx --outdir ./dist
238
+
239
+ # Server bundle
240
+ bun build ./src/server.ts --target bun --outdir ./dist
241
+
242
+ # Standalone executable
243
+ bun build ./cli.ts --outfile ./mycli --compile
244
+ ```
245
+
246
+ ### 7. Deploy
247
+
248
+ Commit `bun.lock` to version control. In CI/CD:
249
+
250
+ ```bash
251
+ bun ci # Install with frozen lockfile
252
+ bun run build
253
+ bun test
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Common Gotchas
259
+
260
+ **Lockfile format**: Bun v1.2+ uses text-based `bun.lock` by default. Old projects may have binary `bun.lockb`. Migrate with: `bun install --save-text-lockfile --frozen-lockfile --lockfile-only`
261
+
262
+ **Lifecycle scripts**: Bun does NOT run `postinstall` scripts for security. Add trusted packages to `package.json`: `"trustedDependencies": ["package-name"]`
263
+
264
+ **Node.js compatibility**: Bun aims for Node.js compatibility but is not 100% complete. Check [compatibility page](/runtime/nodejs-compat) for built-in modules and globals.
265
+
266
+ **TypeScript types**: If you see `Bun` global errors, install `@types/bun`: `bun add -d @types/bun` and configure `tsconfig.json` with `"lib": ["ESNext"]`
267
+
268
+ **Shebang handling**: Scripts with `#!/usr/bin/env node` run with Node.js by default. Use `bun run --bun script` to force Bun, or set `[run] bun = true` in `bunfig.toml`
269
+
270
+ **Test discovery**: Tests must match patterns: `*.test.ts`, `*_test.ts`, `*.spec.ts`, `*_spec.ts`. Nested in subdirectories is fine.
271
+
272
+ **Bundler output**: Without `--outdir`, bundles are returned in memory (JavaScript API only). Always specify `--outdir` for CLI.
273
+
274
+ **Environment variables**: Bun auto-loads `.env`, `.env.local`, `.env.[NODE_ENV]`. Disable with `[env] file = false` in `bunfig.toml`
275
+
276
+ **Watch mode flags**: Put Bun flags immediately after `bun`: `bun --watch run dev` ✓, not `bun run dev --watch` ✗
277
+
278
+ **Monorepo filtering**: Use `--filter` with glob patterns: `bun install --filter 'packages/*'` or `bun run --filter 'ba*' test`
279
+
280
+ ---
281
+
282
+ ## Verification Checklist
283
+
284
+ Before submitting work with Bun:
285
+
286
+ - [ ] `bun install` runs without errors and creates `bun.lock`
287
+ - [ ] `bun run <script>` executes the intended code
288
+ - [ ] `bun test` passes all tests (or `bun test --coverage` meets threshold)
289
+ - [ ] `bun build` produces output files in `--outdir` without errors
290
+ - [ ] `bunfig.toml` is valid TOML (if present) and matches intended config
291
+ - [ ] `package.json` has correct `"scripts"`, `"dependencies"`, `"devDependencies"`
292
+ - [ ] TypeScript files have no type errors (use `tsc --noEmit` or IDE)
293
+ - [ ] Lockfile (`bun.lock`) is committed to version control
294
+ - [ ] No hardcoded paths; use relative imports or environment variables
295
+ - [ ] Test files follow naming convention: `*.test.ts` or `*.spec.ts`
296
+ - [ ] Bundled output is minified/optimized for production (use `--minify` if needed)
297
+ - [ ] Executable builds work: `./mycli --help` (if using `--compile`)
298
+
299
+ ---
300
+
301
+ ## Resources
302
+
303
+ **Comprehensive navigation**: https://bun.com/docs/llms.txt
304
+
305
+ **Critical documentation pages**:
306
+ 1. [Runtime](https://bun.com/docs/runtime) — Execute files and scripts
307
+ 2. [Package Manager](https://bun.com/docs/pm/cli/install) — Install and manage dependencies
308
+ 3. [Test Runner](https://bun.com/docs/test) — Write and run tests
309
+ 4. [Bundler](https://bun.com/docs/bundler) — Bundle code for production
310
+
311
+ ---
312
+
313
+ > For additional documentation and navigation, see: https://bun.com/docs/llms.txt
@@ -0,0 +1,82 @@
1
+ ---
2
+ name: cavecrew
3
+ description: >
4
+ Decision guide for delegating to caveman-style subagents. Tells the main
5
+ thread WHEN to spawn `cavecrew-investigator` (locate code), `cavecrew-builder`
6
+ (1-2 file edit), or `cavecrew-reviewer` (diff review) instead of doing the
7
+ work inline or using vanilla `Explore`. Subagent output is caveman-compressed
8
+ so the tool-result injected back into main context is ~60% smaller — main
9
+ context lasts longer across long sessions.
10
+ Trigger: "delegate to subagent", "use cavecrew", "spawn investigator/builder/reviewer",
11
+ "save context", "compressed agent output".
12
+ ---
13
+
14
+ Cavecrew = three subagent presets that emit caveman output. Same job as Anthropic defaults (`Explore`, edit-style agents, reviewer); difference is the tool-result they return is compressed, so main context shrinks per delegation.
15
+
16
+ ## When to use cavecrew vs alternatives
17
+
18
+ | Task | Use |
19
+ |---|---|
20
+ | "Where is X defined / what calls Y / list uses of Z" | `cavecrew-investigator` |
21
+ | Same but you also want suggestions/architecture commentary | `Explore` (vanilla) |
22
+ | Surgical edit, ≤2 files, scope obvious | `cavecrew-builder` |
23
+ | New feature / 3+ files / cross-cutting refactor | Main thread or `feature-dev:code-architect` |
24
+ | Review diff, branch, or file for bugs | `cavecrew-reviewer` |
25
+ | Deep code review with rationale + alternatives | `Code Reviewer` (vanilla) |
26
+ | One-line answer you already know | Main thread, no subagent |
27
+
28
+ Rule of thumb: **if you'd want the subagent's output in 1/3 the tokens, pick cavecrew. If you'd want prose, pick vanilla.**
29
+
30
+ ## Why this exists (the real win)
31
+
32
+ Subagent tool results get injected into main context verbatim. A vanilla `Explore` that returns 2k tokens of prose costs 2k tokens of main-context budget every time. The same finding from `cavecrew-investigator` returns ~700 tokens. Across 20 delegations in one session that's the difference between context exhaustion and finishing the task.
33
+
34
+ ## Output contracts
35
+
36
+ What main thread can rely on per agent:
37
+
38
+ **`cavecrew-investigator`**
39
+ ```
40
+ <Header>:
41
+ - path:line — `symbol` — short note
42
+ totals: <counts>.
43
+ ```
44
+ Or `No match.` Always file-path-first, line-number-attached, backticked symbols. Safe to grep with `path:\d+`.
45
+
46
+ **`cavecrew-builder`**
47
+ ```
48
+ <path:line-range> — <change ≤10 words>.
49
+ verified: <re-read OK | mismatch @ path:line>.
50
+ ```
51
+ Or one of: `too-big.` / `needs-confirm.` / `ambiguous.` / `regressed.` (terminal first token).
52
+
53
+ **`cavecrew-reviewer`**
54
+ ```
55
+ path:line: <emoji> <severity>: <problem>. <fix>.
56
+ totals: N🔴 N🟡 N🔵 N❓
57
+ ```
58
+ Or `No issues.` Findings sorted file → line ascending.
59
+
60
+ ## Chaining patterns
61
+
62
+ **Locate → fix → verify** (most common):
63
+ 1. `cavecrew-investigator` returns site list.
64
+ 2. Main thread picks 1-2 sites, hands paths to `cavecrew-builder`.
65
+ 3. `cavecrew-reviewer` audits the diff.
66
+
67
+ **Parallel scout** (when investigation is broad):
68
+ Spawn 2-3 `cavecrew-investigator` calls in one message (different angles: defs vs callers vs tests). Aggregate in main thread.
69
+
70
+ **Single-shot edit** (when site is already known):
71
+ Skip investigator. Hand exact path:line to `cavecrew-builder` directly.
72
+
73
+ ## What NOT to do
74
+
75
+ - Don't use `cavecrew-builder` when you don't already know the file. Spawn investigator first or main thread will eat tokens passing context.
76
+ - Don't chain `cavecrew-investigator → cavecrew-builder` for a 5-file refactor. Builder will return `too-big.` and you'll have wasted a turn.
77
+ - Don't ask `cavecrew-reviewer` for "general feedback" — it returns findings only, no architecture opinions. Use `Code Reviewer` for that.
78
+ - Don't expect prose. Cavecrew output is structured, sometimes terse to the point of cryptic. If a human will read it directly, paraphrase.
79
+
80
+ ## Auto-clarity (inherited)
81
+
82
+ Subagents drop caveman → normal English for security warnings, irreversible-action confirmations, and any output where fragment ambiguity could be misread. Resume caveman after.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: caveman
3
+ description: >
4
+ Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman
5
+ while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra,
6
+ wenyan-lite, wenyan-full, wenyan-ultra.
7
+ Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens",
8
+ "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
9
+ ---
10
+
11
+ Respond terse like smart caveman. All technical substance stay. Only fluff die.
12
+
13
+ ## Persistence
14
+
15
+ ACTIVE EVERY RESPONSE. No revert after many turns. No filler drift. Still active if unsure. Off only: "stop caveman" / "normal mode".
16
+
17
+ Default: **full**. Switch: `/caveman lite|full|ultra`.
18
+
19
+ ## Rules
20
+
21
+ Drop: articles (a/an/the), filler (just/really/basically/actually/simply), pleasantries (sure/certainly/of course/happy to), hedging. Fragments OK. Short synonyms (big not extensive, fix not "implement a solution for"). Technical terms exact. Code blocks unchanged. Errors quoted exact.
22
+
23
+ Pattern: `[thing] [action] [reason]. [next step].`
24
+
25
+ Not: "Sure! I'd be happy to help you with that. The issue you're experiencing is likely caused by..."
26
+ Yes: "Bug in auth middleware. Token expiry check use `<` not `<=`. Fix:"
27
+
28
+ ## Intensity
29
+
30
+ | Level | What change |
31
+ |-------|------------|
32
+ | **lite** | No filler/hedging. Keep articles + full sentences. Professional but tight |
33
+ | **full** | Drop articles, fragments OK, short synonyms. Classic caveman |
34
+ | **ultra** | Abbreviate prose words (DB/auth/config/req/res/fn/impl), strip conjunctions, arrows for causality (X → Y), one word when one word enough. Code symbols, function names, API names, error strings: never abbreviate |
35
+ | **wenyan-lite** | Semi-classical. Drop filler/hedging but keep grammar structure, classical register |
36
+ | **wenyan-full** | Maximum classical terseness. Fully 文言文. 80-90% character reduction. Classical sentence patterns, verbs precede objects, subjects often omitted, classical particles (之/乃/為/其) |
37
+ | **wenyan-ultra** | Extreme abbreviation while keeping classical Chinese feel. Maximum compression, ultra terse |
38
+
39
+ Example — "Why React component re-render?"
40
+ - lite: "Your component re-renders because you create a new object reference each render. Wrap it in `useMemo`."
41
+ - full: "New object ref each render. Inline object prop = new ref = re-render. Wrap in `useMemo`."
42
+ - ultra: "Inline obj prop → new ref → re-render. `useMemo`."
43
+ - wenyan-lite: "組件頻重繪,以每繪新生對象參照故。以 useMemo 包之。"
44
+ - wenyan-full: "物出新參照,致重繪。useMemo .Wrap之。"
45
+ - wenyan-ultra: "新參照→重繪。useMemo Wrap。"
46
+
47
+ Example — "Explain database connection pooling."
48
+ - lite: "Connection pooling reuses open connections instead of creating new ones per request. Avoids repeated handshake overhead."
49
+ - full: "Pool reuse open DB connections. No new connection per request. Skip handshake overhead."
50
+ - ultra: "Pool = reuse DB conn. Skip handshake → fast under load."
51
+ - wenyan-full: "池reuse open connection。不每req新開。skip handshake overhead。"
52
+ - wenyan-ultra: "池reuse conn。skip handshake → fast。"
53
+
54
+ ## Auto-Clarity
55
+
56
+ Drop caveman when:
57
+ - Security warnings
58
+ - Irreversible action confirmations
59
+ - Multi-step sequences where fragment order or omitted conjunctions risk misread
60
+ - Compression itself creates technical ambiguity (e.g., `"migrate table drop column backup first"` — order unclear without articles/conjunctions)
61
+ - User asks to clarify or repeats question
62
+
63
+ Resume caveman after clear part done.
64
+
65
+ Example — destructive op:
66
+ > **Warning:** This will permanently delete all rows in the `users` table and cannot be undone.
67
+ > ```sql
68
+ > DROP TABLE users;
69
+ > ```
70
+ > Caveman resume. Verify backup exist first.
71
+
72
+ ## Boundaries
73
+
74
+ Code/commits/PRs: write normal. "stop caveman" or "normal mode": revert. Level persist until changed or session end.
@@ -0,0 +1,33 @@
1
+ # caveman-review
2
+
3
+ One-line PR comments. Location, problem, fix. No throat-clearing.
4
+
5
+ ## What it does
6
+
7
+ Generates code review comments in `L<line>: <severity> <problem>. <fix>.` format. One line per finding. Severity emoji: 🔴 bug, 🟡 risk, 🔵 nit, ❓ question. Drops "I noticed that...", hedging, and restating what the diff already shows. Keeps exact line numbers, backticked symbols, and concrete fixes.
8
+
9
+ Auto-clarity: drops terse mode for CVE-class security findings, architectural disagreements, and onboarding contexts where the author needs the *why*. Resumes terse for the rest.
10
+
11
+ Output only — does not approve, request changes, or run linters.
12
+
13
+ ## How to invoke
14
+
15
+ ```
16
+ /caveman-review
17
+ ```
18
+
19
+ Also triggers on "review this PR", "code review", "review the diff".
20
+
21
+ ## Example output
22
+
23
+ ```
24
+ L42: 🔴 bug: user can be null after .find(). Add guard before .email.
25
+ L88-140: 🔵 nit: 50-line fn does 4 things. Extract validate/normalize/persist.
26
+ L23: 🟡 risk: no retry on 429. Wrap in withBackoff(3).
27
+ L107: ❓ q: why drop the cache here? Reads on next request will miss.
28
+ ```
29
+
30
+ ## See also
31
+
32
+ - [`SKILL.md`](./SKILL.md) — full LLM-facing instructions
33
+ - [Caveman README](../../README.md) — repo overview