@iamnishankhan/opencode-kit-grok 1.0.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 (198) hide show
  1. package/bin/cli.js +46 -0
  2. package/kit/.opencode/AGENTS.md +392 -0
  3. package/kit/.opencode/README.md +71 -0
  4. package/kit/.opencode/USAGE.md +405 -0
  5. package/kit/.opencode/agents/backend-specialist.md +278 -0
  6. package/kit/.opencode/agents/code-archaeologist.md +114 -0
  7. package/kit/.opencode/agents/database-architect.md +233 -0
  8. package/kit/.opencode/agents/debugger.md +234 -0
  9. package/kit/.opencode/agents/devops-engineer.md +252 -0
  10. package/kit/.opencode/agents/documentation-writer.md +111 -0
  11. package/kit/.opencode/agents/explorer-agent.md +83 -0
  12. package/kit/.opencode/agents/frontend-specialist.md +606 -0
  13. package/kit/.opencode/agents/game-developer.md +169 -0
  14. package/kit/.opencode/agents/mobile-developer.md +385 -0
  15. package/kit/.opencode/agents/orchestrator.md +213 -0
  16. package/kit/.opencode/agents/penetration-tester.md +197 -0
  17. package/kit/.opencode/agents/performance-optimizer.md +194 -0
  18. package/kit/.opencode/agents/product-manager.md +120 -0
  19. package/kit/.opencode/agents/product-owner.md +103 -0
  20. package/kit/.opencode/agents/project-planner.md +418 -0
  21. package/kit/.opencode/agents/qa-automation-engineer.md +113 -0
  22. package/kit/.opencode/agents/security-auditor.md +179 -0
  23. package/kit/.opencode/agents/seo-specialist.md +119 -0
  24. package/kit/.opencode/agents/test-engineer.md +169 -0
  25. package/kit/.opencode/commands/brainstorm.md +113 -0
  26. package/kit/.opencode/commands/coordinate.md +72 -0
  27. package/kit/.opencode/commands/create.md +63 -0
  28. package/kit/.opencode/commands/debug.md +102 -0
  29. package/kit/.opencode/commands/deploy.md +175 -0
  30. package/kit/.opencode/commands/enhance.md +62 -0
  31. package/kit/.opencode/commands/orchestrate.md +241 -0
  32. package/kit/.opencode/commands/plan.md +89 -0
  33. package/kit/.opencode/commands/preview.md +80 -0
  34. package/kit/.opencode/commands/remember.md +67 -0
  35. package/kit/.opencode/commands/status.md +86 -0
  36. package/kit/.opencode/commands/test.md +143 -0
  37. package/kit/.opencode/commands/verify.md +71 -0
  38. package/kit/.opencode/memory/MEMORY.md +6 -0
  39. package/kit/.opencode/memory/feedback-history.md +9 -0
  40. package/kit/.opencode/memory/project-conventions.md +16 -0
  41. package/kit/.opencode/memory/tech-decisions.md +10 -0
  42. package/kit/.opencode/memory/user-preferences.md +9 -0
  43. package/kit/.opencode/opencode.json +15 -0
  44. package/kit/.opencode/scripts/README.md +95 -0
  45. package/kit/.opencode/scripts/auto_preview.py +149 -0
  46. package/kit/.opencode/scripts/checklist.py +75 -0
  47. package/kit/.opencode/scripts/component_registry.py +238 -0
  48. package/kit/.opencode/scripts/dependency_graph.py +73 -0
  49. package/kit/.opencode/scripts/generate_manifest.py +44 -0
  50. package/kit/.opencode/scripts/session_manager.py +120 -0
  51. package/kit/.opencode/scripts/tests/test_toolkit.py +238 -0
  52. package/kit/.opencode/scripts/validate_kit.py +397 -0
  53. package/kit/.opencode/scripts/validation_runner.py +216 -0
  54. package/kit/.opencode/scripts/verify_all.py +85 -0
  55. package/kit/.opencode/skills/api-patterns/SKILL.md +83 -0
  56. package/kit/.opencode/skills/api-patterns/api-style.md +42 -0
  57. package/kit/.opencode/skills/api-patterns/auth.md +24 -0
  58. package/kit/.opencode/skills/api-patterns/documentation.md +26 -0
  59. package/kit/.opencode/skills/api-patterns/graphql.md +41 -0
  60. package/kit/.opencode/skills/api-patterns/rate-limiting.md +31 -0
  61. package/kit/.opencode/skills/api-patterns/response.md +37 -0
  62. package/kit/.opencode/skills/api-patterns/rest.md +40 -0
  63. package/kit/.opencode/skills/api-patterns/scripts/api_validator.py +211 -0
  64. package/kit/.opencode/skills/api-patterns/security-testing.md +122 -0
  65. package/kit/.opencode/skills/api-patterns/trpc.md +41 -0
  66. package/kit/.opencode/skills/api-patterns/versioning.md +22 -0
  67. package/kit/.opencode/skills/app-builder/SKILL.md +78 -0
  68. package/kit/.opencode/skills/app-builder/agent-coordination.md +71 -0
  69. package/kit/.opencode/skills/app-builder/feature-building.md +53 -0
  70. package/kit/.opencode/skills/app-builder/project-detection.md +45 -0
  71. package/kit/.opencode/skills/app-builder/scaffolding.md +110 -0
  72. package/kit/.opencode/skills/app-builder/tech-stack.md +41 -0
  73. package/kit/.opencode/skills/app-builder/templates/SKILL.md +39 -0
  74. package/kit/.opencode/skills/app-builder/templates/astro-static/TEMPLATE.md +78 -0
  75. package/kit/.opencode/skills/app-builder/templates/chrome-extension/TEMPLATE.md +96 -0
  76. package/kit/.opencode/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
  77. package/kit/.opencode/skills/app-builder/templates/electron-desktop/TEMPLATE.md +97 -0
  78. package/kit/.opencode/skills/app-builder/templates/express-api/TEMPLATE.md +89 -0
  79. package/kit/.opencode/skills/app-builder/templates/flutter-app/TEMPLATE.md +93 -0
  80. package/kit/.opencode/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +97 -0
  81. package/kit/.opencode/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +126 -0
  82. package/kit/.opencode/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +125 -0
  83. package/kit/.opencode/skills/app-builder/templates/nextjs-static/TEMPLATE.md +174 -0
  84. package/kit/.opencode/skills/app-builder/templates/nuxt-app/TEMPLATE.md +127 -0
  85. package/kit/.opencode/skills/app-builder/templates/python-fastapi/TEMPLATE.md +94 -0
  86. package/kit/.opencode/skills/app-builder/templates/react-native-app/TEMPLATE.md +121 -0
  87. package/kit/.opencode/skills/architecture/SKILL.md +57 -0
  88. package/kit/.opencode/skills/architecture/context-discovery.md +43 -0
  89. package/kit/.opencode/skills/architecture/examples.md +94 -0
  90. package/kit/.opencode/skills/architecture/pattern-selection.md +68 -0
  91. package/kit/.opencode/skills/architecture/patterns-reference.md +50 -0
  92. package/kit/.opencode/skills/architecture/trade-off-analysis.md +77 -0
  93. package/kit/.opencode/skills/bash-linux/SKILL.md +201 -0
  94. package/kit/.opencode/skills/batch-operations/SKILL.md +105 -0
  95. package/kit/.opencode/skills/behavioral-modes/SKILL.md +253 -0
  96. package/kit/.opencode/skills/brainstorming/SKILL.md +178 -0
  97. package/kit/.opencode/skills/brainstorming/dynamic-questioning.md +350 -0
  98. package/kit/.opencode/skills/clean-code/SKILL.md +201 -0
  99. package/kit/.opencode/skills/code-review-checklist/SKILL.md +111 -0
  100. package/kit/.opencode/skills/code-review-graph/SKILL.md +305 -0
  101. package/kit/.opencode/skills/context-compression/SKILL.md +145 -0
  102. package/kit/.opencode/skills/coordinator-mode/SKILL.md +208 -0
  103. package/kit/.opencode/skills/database-design/SKILL.md +54 -0
  104. package/kit/.opencode/skills/database-design/database-selection.md +43 -0
  105. package/kit/.opencode/skills/database-design/indexing.md +39 -0
  106. package/kit/.opencode/skills/database-design/migrations.md +48 -0
  107. package/kit/.opencode/skills/database-design/optimization.md +36 -0
  108. package/kit/.opencode/skills/database-design/orm-selection.md +30 -0
  109. package/kit/.opencode/skills/database-design/schema-design.md +56 -0
  110. package/kit/.opencode/skills/database-design/scripts/schema_validator.py +172 -0
  111. package/kit/.opencode/skills/deployment-procedures/SKILL.md +243 -0
  112. package/kit/.opencode/skills/design-spec/SKILL.md +185 -0
  113. package/kit/.opencode/skills/design-spec/collection.md +106 -0
  114. package/kit/.opencode/skills/documentation-templates/SKILL.md +196 -0
  115. package/kit/.opencode/skills/frontend-architecture/SKILL.md +245 -0
  116. package/kit/.opencode/skills/frontend-design/SKILL.md +1222 -0
  117. package/kit/.opencode/skills/frontend-design/redesign.md +178 -0
  118. package/kit/.opencode/skills/frontend-design/scripts/accessibility_checker.py +145 -0
  119. package/kit/.opencode/skills/frontend-design/scripts/ux_audit.py +722 -0
  120. package/kit/.opencode/skills/frontend-design/style-brutalist.md +92 -0
  121. package/kit/.opencode/skills/frontend-design/style-minimalist.md +85 -0
  122. package/kit/.opencode/skills/game-development/2d-games/SKILL.md +118 -0
  123. package/kit/.opencode/skills/game-development/3d-games/SKILL.md +134 -0
  124. package/kit/.opencode/skills/game-development/SKILL.md +169 -0
  125. package/kit/.opencode/skills/game-development/game-art/SKILL.md +184 -0
  126. package/kit/.opencode/skills/game-development/game-audio/SKILL.md +189 -0
  127. package/kit/.opencode/skills/game-development/game-design/SKILL.md +128 -0
  128. package/kit/.opencode/skills/game-development/mobile-games/SKILL.md +107 -0
  129. package/kit/.opencode/skills/game-development/multiplayer/SKILL.md +131 -0
  130. package/kit/.opencode/skills/game-development/pc-games/SKILL.md +143 -0
  131. package/kit/.opencode/skills/game-development/vr-ar/SKILL.md +122 -0
  132. package/kit/.opencode/skills/game-development/web-games/SKILL.md +149 -0
  133. package/kit/.opencode/skills/geo-fundamentals/SKILL.md +158 -0
  134. package/kit/.opencode/skills/geo-fundamentals/scripts/geo_checker.py +273 -0
  135. package/kit/.opencode/skills/i18n-localization/SKILL.md +156 -0
  136. package/kit/.opencode/skills/i18n-localization/scripts/i18n_checker.py +223 -0
  137. package/kit/.opencode/skills/intelligent-routing/SKILL.md +337 -0
  138. package/kit/.opencode/skills/lint-and-validate/SKILL.md +47 -0
  139. package/kit/.opencode/skills/lint-and-validate/scripts/lint_runner.py +184 -0
  140. package/kit/.opencode/skills/lint-and-validate/scripts/type_coverage.py +245 -0
  141. package/kit/.opencode/skills/mcp-builder/SKILL.md +205 -0
  142. package/kit/.opencode/skills/memory-system/SKILL.md +181 -0
  143. package/kit/.opencode/skills/mobile-design/SKILL.md +396 -0
  144. package/kit/.opencode/skills/mobile-design/decision-trees.md +516 -0
  145. package/kit/.opencode/skills/mobile-design/mobile-backend.md +491 -0
  146. package/kit/.opencode/skills/mobile-design/mobile-color-system.md +420 -0
  147. package/kit/.opencode/skills/mobile-design/mobile-debugging.md +122 -0
  148. package/kit/.opencode/skills/mobile-design/mobile-design-thinking.md +357 -0
  149. package/kit/.opencode/skills/mobile-design/mobile-navigation.md +458 -0
  150. package/kit/.opencode/skills/mobile-design/mobile-performance.md +767 -0
  151. package/kit/.opencode/skills/mobile-design/mobile-testing.md +356 -0
  152. package/kit/.opencode/skills/mobile-design/mobile-typography.md +433 -0
  153. package/kit/.opencode/skills/mobile-design/platform-android.md +666 -0
  154. package/kit/.opencode/skills/mobile-design/platform-ios.md +561 -0
  155. package/kit/.opencode/skills/mobile-design/scripts/mobile_audit.py +670 -0
  156. package/kit/.opencode/skills/mobile-design/touch-psychology.md +537 -0
  157. package/kit/.opencode/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
  158. package/kit/.opencode/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
  159. package/kit/.opencode/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
  160. package/kit/.opencode/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
  161. package/kit/.opencode/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
  162. package/kit/.opencode/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
  163. package/kit/.opencode/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
  164. package/kit/.opencode/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
  165. package/kit/.opencode/skills/nextjs-react-expert/9-cache-components.md +103 -0
  166. package/kit/.opencode/skills/nextjs-react-expert/SKILL.md +293 -0
  167. package/kit/.opencode/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
  168. package/kit/.opencode/skills/nextjs-react-expert/scripts/react_performance_checker.py +281 -0
  169. package/kit/.opencode/skills/nodejs-best-practices/SKILL.md +336 -0
  170. package/kit/.opencode/skills/parallel-agents/SKILL.md +192 -0
  171. package/kit/.opencode/skills/performance-profiling/SKILL.md +145 -0
  172. package/kit/.opencode/skills/performance-profiling/scripts/bundle_analyzer.py +120 -0
  173. package/kit/.opencode/skills/performance-profiling/scripts/lighthouse_audit.py +108 -0
  174. package/kit/.opencode/skills/plan-writing/SKILL.md +153 -0
  175. package/kit/.opencode/skills/powershell-windows/SKILL.md +169 -0
  176. package/kit/.opencode/skills/python-patterns/SKILL.md +443 -0
  177. package/kit/.opencode/skills/red-team-tactics/SKILL.md +201 -0
  178. package/kit/.opencode/skills/rust-pro/SKILL.md +177 -0
  179. package/kit/.opencode/skills/seo-fundamentals/SKILL.md +131 -0
  180. package/kit/.opencode/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
  181. package/kit/.opencode/skills/server-management/SKILL.md +163 -0
  182. package/kit/.opencode/skills/simplify-code/SKILL.md +131 -0
  183. package/kit/.opencode/skills/skillify/SKILL.md +115 -0
  184. package/kit/.opencode/skills/systematic-debugging/SKILL.md +111 -0
  185. package/kit/.opencode/skills/tailwind-patterns/SKILL.md +271 -0
  186. package/kit/.opencode/skills/tdd-workflow/SKILL.md +151 -0
  187. package/kit/.opencode/skills/testing-patterns/SKILL.md +180 -0
  188. package/kit/.opencode/skills/testing-patterns/scripts/test_runner.py +219 -0
  189. package/kit/.opencode/skills/verify-changes/SKILL.md +127 -0
  190. package/kit/.opencode/skills/vulnerability-scanner/SKILL.md +278 -0
  191. package/kit/.opencode/skills/vulnerability-scanner/checklists.md +124 -0
  192. package/kit/.opencode/skills/vulnerability-scanner/scripts/dependency_analyzer.py +144 -0
  193. package/kit/.opencode/skills/vulnerability-scanner/scripts/security_scan.py +410 -0
  194. package/kit/.opencode/skills/web-design-guidelines/SKILL.md +56 -0
  195. package/kit/.opencode/skills/webapp-testing/SKILL.md +189 -0
  196. package/kit/.opencode/skills/webapp-testing/scripts/playwright_runner.py +123 -0
  197. package/lib/init.js +61 -0
  198. package/package.json +21 -0
@@ -0,0 +1,201 @@
1
+ ---
2
+ name: bash-linux
3
+ description: Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.
4
+ compatibility: opencode
5
+ metadata:
6
+ when_to_use: "\"When working on macOS or Linux systems, writing bash scripts, or using terminal commands. NOT for Windows/PowerShell environments.\""
7
+ version: "1.0.0"
8
+ ---
9
+ # Bash Linux Patterns
10
+
11
+ > Essential patterns for Bash on Linux/macOS.
12
+
13
+ ---
14
+
15
+ ## 1. Operator Syntax
16
+
17
+ ### Chaining Commands
18
+
19
+ | Operator | Meaning | Example |
20
+ |----------|---------|---------|
21
+ | `;` | Run sequentially | `cmd1; cmd2` |
22
+ | `&&` | Run if previous succeeded | `npm install && npm run dev` |
23
+ | `\|\|` | Run if previous failed | `npm test \|\| echo "Tests failed"` |
24
+ | `\|` | Pipe output | `ls \| grep ".js"` |
25
+
26
+ ---
27
+
28
+ ## 2. File Operations
29
+
30
+ ### Essential Commands
31
+
32
+ | Task | Command |
33
+ |------|---------|
34
+ | List all | `ls -la` |
35
+ | Find files | `find . -name "*.js" -type f` |
36
+ | File content | `cat file.txt` |
37
+ | First N lines | `head -n 20 file.txt` |
38
+ | Last N lines | `tail -n 20 file.txt` |
39
+ | Follow log | `tail -f log.txt` |
40
+ | Search in files | `grep -r "pattern" --include="*.js"` |
41
+ | File size | `du -sh *` |
42
+ | Disk usage | `df -h` |
43
+
44
+ ---
45
+
46
+ ## 3. Process Management
47
+
48
+ | Task | Command |
49
+ |------|---------|
50
+ | List processes | `ps aux` |
51
+ | Find by name | `ps aux \| grep node` |
52
+ | Kill by PID | `kill -9 <PID>` |
53
+ | Find port user | `lsof -i :3000` |
54
+ | Kill port | `kill -9 $(lsof -t -i :3000)` |
55
+ | Background | `npm run dev &` |
56
+ | Jobs | `jobs -l` |
57
+ | Bring to front | `fg %1` |
58
+
59
+ ---
60
+
61
+ ## 4. Text Processing
62
+
63
+ ### Core Tools
64
+
65
+ | Tool | Purpose | Example |
66
+ |------|---------|---------|
67
+ | `grep` | Search | `grep -rn "TODO" src/` |
68
+ | `sed` | Replace | `sed -i 's/old/new/g' file.txt` |
69
+ | `awk` | Extract columns | `awk '{print $1}' file.txt` |
70
+ | `cut` | Cut fields | `cut -d',' -f1 data.csv` |
71
+ | `sort` | Sort lines | `sort -u file.txt` |
72
+ | `uniq` | Unique lines | `sort file.txt \| uniq -c` |
73
+ | `wc` | Count | `wc -l file.txt` |
74
+
75
+ ---
76
+
77
+ ## 5. Environment Variables
78
+
79
+ | Task | Command |
80
+ |------|---------|
81
+ | View all | `env` or `printenv` |
82
+ | View one | `echo $PATH` |
83
+ | Set temporary | `export VAR="value"` |
84
+ | Set in script | `VAR="value" command` |
85
+ | Add to PATH | `export PATH="$PATH:/new/path"` |
86
+
87
+ ---
88
+
89
+ ## 6. Network
90
+
91
+ | Task | Command |
92
+ |------|---------|
93
+ | Download | `curl -O https://example.com/file` |
94
+ | API request | `curl -X GET https://api.example.com` |
95
+ | POST JSON | `curl -X POST -H "Content-Type: application/json" -d '{"key":"value"}' URL` |
96
+ | Check port | `nc -zv localhost 3000` |
97
+ | Network info | `ifconfig` or `ip addr` |
98
+
99
+ ---
100
+
101
+ ## 7. Script Template
102
+
103
+ ```bash
104
+ #!/bin/bash
105
+ set -euo pipefail # Exit on error, undefined var, pipe fail
106
+
107
+ # Colors (optional)
108
+ RED='\033[0;31m'
109
+ GREEN='\033[0;32m'
110
+ NC='\033[0m'
111
+
112
+ # Script directory
113
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
114
+
115
+ # Functions
116
+ log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
117
+ log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }
118
+
119
+ # Main
120
+ main() {
121
+ log_info "Starting..."
122
+ # Your logic here
123
+ log_info "Done!"
124
+ }
125
+
126
+ main "$@"
127
+ ```
128
+
129
+ ---
130
+
131
+ ## 8. Common Patterns
132
+
133
+ ### Check if command exists
134
+
135
+ ```bash
136
+ if command -v node &> /dev/null; then
137
+ echo "Node is installed"
138
+ fi
139
+ ```
140
+
141
+ ### Default variable value
142
+
143
+ ```bash
144
+ NAME=${1:-"default_value"}
145
+ ```
146
+
147
+ ### Read file line by line
148
+
149
+ ```bash
150
+ while IFS= read -r line; do
151
+ echo "$line"
152
+ done < file.txt
153
+ ```
154
+
155
+ ### Loop over files
156
+
157
+ ```bash
158
+ for file in *.js; do
159
+ echo "Processing $file"
160
+ done
161
+ ```
162
+
163
+ ---
164
+
165
+ ## 9. Differences from PowerShell
166
+
167
+ | Task | PowerShell | Bash |
168
+ |------|------------|------|
169
+ | List files | `Get-ChildItem` | `ls -la` |
170
+ | Find files | `Get-ChildItem -Recurse` | `find . -type f` |
171
+ | Environment | `$env:VAR` | `$VAR` |
172
+ | String concat | `"$a$b"` | `"$a$b"` (same) |
173
+ | Null check | `if ($x)` | `if [ -n "$x" ]` |
174
+ | Pipeline | Object-based | Text-based |
175
+
176
+ ---
177
+
178
+ ## 10. Error Handling
179
+
180
+ ### Set options
181
+
182
+ ```bash
183
+ set -e # Exit on error
184
+ set -u # Exit on undefined variable
185
+ set -o pipefail # Exit on pipe failure
186
+ set -x # Debug: print commands
187
+ ```
188
+
189
+ ### Trap for cleanup
190
+
191
+ ```bash
192
+ cleanup() {
193
+ echo "Cleaning up..."
194
+ rm -f /tmp/tempfile
195
+ }
196
+ trap cleanup EXIT
197
+ ```
198
+
199
+ ---
200
+
201
+ > **Remember:** Bash is text-based. Use `&&` for success chains, `set -e` for safety, and quote your variables!
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: batch-operations
3
+ description: Apply operations across multiple files simultaneously. Pattern-based bulk modifications, search-and-replace across codebases, consistent changes to many files at once.
4
+ compatibility: opencode
5
+ metadata:
6
+ when_to_use: "\"When the user needs to change multiple files with the same pattern, rename across a codebase, add imports to many files, update versions, or apply consistent modifications. NOT for single-file edits."
7
+ version: "1.0.0"
8
+ ---
9
+ # Batch Operations β€” Multi-File Changes
10
+
11
+ > Apply consistent changes across many files at once. One pattern, many targets.
12
+
13
+ ## When to Use
14
+
15
+ βœ… **Good for:**
16
+ - Renaming a function/component across all files that use it
17
+ - Adding an import to every file in a directory
18
+ - Updating version numbers across package files
19
+ - Applying the same code pattern to multiple similar files
20
+ - Migrating from one API to another across the codebase
21
+ - Adding/removing a field from all similar data structures
22
+
23
+ ❌ **Not for:**
24
+ - Single-file edits (use direct editing)
25
+ - Unique changes per file (handle individually)
26
+ - Changes that need per-file judgment (use an agent per domain)
27
+
28
+ ---
29
+
30
+ ## Batch Operation Protocol
31
+
32
+ ### Step 1: Define the Pattern
33
+ ```
34
+ What: [exact text/pattern to find]
35
+ Replace: [exact replacement text]
36
+ Scope: [file glob pattern, e.g., "src/**/*.tsx"]
37
+ Exclude: [files to skip, e.g., "**/*.test.tsx"]
38
+ ```
39
+
40
+ ### Step 2: Preview Before Executing
41
+ ```bash
42
+ # Find all affected files FIRST
43
+ grep -rl "oldPattern" src/ --include="*.ts"
44
+
45
+ # Count matches
46
+ grep -rc "oldPattern" src/ --include="*.ts" | grep -v ":0$"
47
+
48
+ # Show context for each match
49
+ grep -rn "oldPattern" src/ --include="*.ts"
50
+ ```
51
+
52
+ > πŸ”΄ **NEVER batch-modify without previewing first.** Show the user what will change.
53
+
54
+ ### Step 3: Execute the Batch
55
+
56
+ For text replacements:
57
+ ```bash
58
+ # On Linux/macOS
59
+ find src -name "*.ts" -exec sed -i 's/oldPattern/newPattern/g' {} +
60
+
61
+ # On Windows (PowerShell)
62
+ Get-ChildItem -Path src -Recurse -Filter *.ts |
63
+ ForEach-Object { (Get-Content $_) -replace 'oldPattern','newPattern' | Set-Content $_ }
64
+ ```
65
+
66
+ For structural changes (adding imports, wrapping code):
67
+ - Use the Edit tool on each file
68
+ - Process files in a consistent order (alphabetical or by dependency)
69
+
70
+ ### Step 4: Verify the Batch
71
+ ```bash
72
+ # Confirm no missed instances
73
+ grep -rl "oldPattern" src/ --include="*.ts"
74
+ # Should return empty
75
+
76
+ # Confirm replacements are correct
77
+ grep -rn "newPattern" src/ --include="*.ts" | head -5
78
+
79
+ # Run tests to catch breakage
80
+ npm run test
81
+ npm run build
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Common Batch Patterns
87
+
88
+ | Operation | Command Pattern |
89
+ |---|---|
90
+ | **Rename import** | Find all `import { X }` β†’ replace with `import { Y }` |
91
+ | **Update version** | Find `"version": "1.0"` β†’ replace across all package.json |
92
+ | **Add export** | Append `export { X }` to all index files |
93
+ | **Remove deprecated** | Find `deprecatedFn()` β†’ replace with `newFn()` |
94
+ | **Add header** | Prepend license header to all source files |
95
+ | **Type migration** | Find `interface X` β†’ replace with `type X =` |
96
+
97
+ ---
98
+
99
+ ## Safety Rules
100
+
101
+ 1. **Preview first** β€” always show affected files before modifying
102
+ 2. **Git safety** β€” ensure clean working directory (`git stash` or commit first)
103
+ 3. **Exclude tests** β€” often tests need different treatment than source
104
+ 4. **Verify after** β€” run build + tests after every batch operation
105
+ 5. **Report changes** β€” list every file modified with change summary
@@ -0,0 +1,253 @@
1
+ ---
2
+ name: behavioral-modes
3
+ description: AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate). Use to adapt behavior based on task type.
4
+ compatibility: opencode
5
+ metadata:
6
+ when_to_use: "\"When adapting AI behavior for specific task types: brainstorm, implement, debug, review, teach, ship, or orchestrate modes.\""
7
+ version: "1.0.0"
8
+ ---
9
+ # Behavioral Modes - Adaptive AI Operating Modes
10
+
11
+ ## Purpose
12
+ This skill defines distinct behavioral modes that optimize AI performance for specific tasks. Modes change how the AI approaches problems, communicates, and prioritizes.
13
+
14
+ ---
15
+
16
+ ## Available Modes
17
+
18
+ ### 1. 🧠 BRAINSTORM Mode
19
+
20
+ **When to use:** Early project planning, feature ideation, architecture decisions
21
+
22
+ **Behavior:**
23
+ - Ask clarifying questions before assumptions
24
+ - Offer multiple alternatives (at least 3)
25
+ - Think divergently - explore unconventional solutions
26
+ - No code yet - focus on ideas and options
27
+ - Use visual diagrams (mermaid) to explain concepts
28
+
29
+ **Output style:**
30
+ ```
31
+ "Let's explore this together. Here are some approaches:
32
+
33
+ Option A: [description]
34
+ βœ… Pros: ...
35
+ ❌ Cons: ...
36
+
37
+ Option B: [description]
38
+ βœ… Pros: ...
39
+ ❌ Cons: ...
40
+
41
+ What resonates with you? Or should we explore a different direction?"
42
+ ```
43
+
44
+ ---
45
+
46
+ ### 2. ⚑ IMPLEMENT Mode
47
+
48
+ **When to use:** Writing code, building features, executing plans
49
+
50
+ **Behavior:**
51
+ - **CRITICAL: Use `clean-code` skill standards** - concise, direct, no verbose explanations
52
+ - Fast execution - minimize questions
53
+ - Use established patterns and best practices
54
+ - Write complete, production-ready code
55
+ - Include error handling and edge cases
56
+ - **NO tutorial-style explanations** - just code
57
+ - **NO unnecessary comments** - let code self-document
58
+ - **NO over-engineering** - solve the problem directly
59
+ - **NO RUSHING** - Quality > Speed. Read ALL references before coding.
60
+
61
+ **Output style:**
62
+ ```
63
+ [Code block]
64
+
65
+ [Brief summary, max 1-2 sentences]
66
+ ```
67
+
68
+ **NOT:**
69
+ ```
70
+ "Building [feature]...
71
+
72
+ βœ“ Created [file1]
73
+ βœ“ Created [file2]
74
+ βœ“ Updated [file3]
75
+
76
+ [long explanation]
77
+
78
+ Run `npm run dev` to test."
79
+ ```
80
+
81
+ ---
82
+
83
+ ### 3. πŸ” DEBUG Mode
84
+
85
+ **When to use:** Fixing bugs, troubleshooting errors, investigating issues
86
+
87
+ **Behavior:**
88
+ - Ask for error messages and reproduction steps
89
+ - Think systematically - check logs, trace data flow
90
+ - Form hypothesis β†’ test β†’ verify
91
+ - Explain the root cause, not just the fix
92
+ - Prevent future occurrences
93
+
94
+ **Output style:**
95
+ ```
96
+ "Investigating...
97
+
98
+ πŸ” Symptom: [what's happening]
99
+ 🎯 Root cause: [why it's happening]
100
+ βœ… Fix: [the solution]
101
+ πŸ›‘οΈ Prevention: [how to avoid in future]
102
+ ```
103
+
104
+ ---
105
+
106
+ ### 4. πŸ“‹ REVIEW Mode
107
+
108
+ **When to use:** Code review, architecture review, security audit
109
+
110
+ **Behavior:**
111
+ - Be thorough but constructive
112
+ - Categorize by severity (Critical/High/Medium/Low)
113
+ - Explain the "why" behind suggestions
114
+ - Offer improved code examples
115
+ - Acknowledge what's done well
116
+
117
+ **Output style:**
118
+ ```
119
+ ## Code Review: [file/feature]
120
+
121
+ ### πŸ”΄ Critical
122
+ - [issue with explanation]
123
+
124
+ ### 🟠 Improvements
125
+ - [suggestion with example]
126
+
127
+ ### 🟒 Good
128
+ - [positive observation]
129
+ ```
130
+
131
+ ---
132
+
133
+ ### 5. πŸ“š TEACH Mode
134
+
135
+ **When to use:** Explaining concepts, documentation, onboarding
136
+
137
+ **Behavior:**
138
+ - Explain from fundamentals
139
+ - Use analogies and examples
140
+ - Progress from simple to complex
141
+ - Include practical exercises
142
+ - Check understanding
143
+
144
+ **Output style:**
145
+ ```
146
+ ## Understanding [Concept]
147
+
148
+ ### What is it?
149
+ [Simple explanation with analogy]
150
+
151
+ ### How it works
152
+ [Technical explanation with diagram]
153
+
154
+ ### Example
155
+ [Code example with comments]
156
+
157
+ ### Try it yourself
158
+ [Exercise or task]
159
+ ```
160
+
161
+ ---
162
+
163
+ ### 6. πŸš€ SHIP Mode
164
+
165
+ **When to use:** Production deployment, final polish, release preparation
166
+
167
+ **Behavior:**
168
+ - Focus on stability over features
169
+ - Check for missing error handling
170
+ - Verify environment configs
171
+ - Run all tests
172
+ - Create deployment checklist
173
+
174
+ **Output style:**
175
+ ```
176
+ ## Pre-Ship Checklist
177
+
178
+ ### βœ… Code Quality
179
+ - [ ] No TypeScript errors
180
+ - [ ] ESLint passing
181
+ - [ ] All tests passing
182
+
183
+ ### βœ… Security
184
+ - [ ] No exposed secrets
185
+ - [ ] Input validation complete
186
+
187
+ ### βœ… Performance
188
+ - [ ] Bundle size acceptable
189
+ - [ ] No console.logs
190
+
191
+ ### πŸš€ Ready to deploy
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Mode Detection
197
+
198
+ The AI should automatically detect the appropriate mode based on:
199
+
200
+ | Trigger | Mode |
201
+ |---------|------|
202
+ | "what if", "ideas", "options" | BRAINSTORM |
203
+ | "build", "create", "add" | IMPLEMENT |
204
+ | "not working", "error", "bug" | DEBUG |
205
+ | "review", "check", "audit" | REVIEW |
206
+ | "explain", "how does", "learn" | TEACH |
207
+ | "deploy", "release", "production" | SHIP |
208
+
209
+ ---
210
+
211
+ ## Multi-Agent Collaboration Patterns
212
+
213
+ Modern architectures optimized for agent-to-agent collaboration:
214
+
215
+ ### 1. πŸ”­ EXPLORE Mode
216
+ **Role:** Discovery and Analysis (Explorer Agent)
217
+ **Behavior:** Socratic questioning, deep-dive code reading, dependency mapping.
218
+ **Output:** `discovery-report.json`, architectural visualization.
219
+
220
+ ### 2. πŸ—ΊοΈ PLAN-EXECUTE-CRITIC (PEC)
221
+ Cyclic mode transitions for high-complexity tasks:
222
+ 1. **Planner:** Decomposes the task into atomic steps (`task.md`).
223
+ 2. **Executor:** Performs the actual coding (`IMPLEMENT`).
224
+ 3. **Critic:** Reviews the code, performs security and performance checks (`REVIEW`).
225
+
226
+ ### 3. 🧠 MENTAL MODEL SYNC
227
+ Behavior for creating and loading "Mental Model" summaries to preserve context between sessions.
228
+
229
+ ---
230
+
231
+ ## Combining Modes
232
+
233
+ Modes are not exclusive β€” most real tasks chain several in sequence:
234
+
235
+ | Flow | Mode Chain |
236
+ |------|------------|
237
+ | New feature | BRAINSTORM β†’ PLAN-EXECUTE-CRITIC β†’ IMPLEMENT β†’ REVIEW β†’ SHIP |
238
+ | Bug fix | EXPLORE β†’ DEBUG β†’ IMPLEMENT β†’ REVIEW |
239
+ | Unfamiliar codebase | EXPLORE β†’ TEACH β†’ BRAINSTORM |
240
+ | Risky refactor | EXPLORE β†’ PLAN-EXECUTE-CRITIC β†’ IMPLEMENT β†’ REVIEW |
241
+
242
+ Switch modes when the work changes shape (e.g. drop from IMPLEMENT to DEBUG the moment a test fails), and carry context forward with MENTAL MODEL SYNC across long sessions.
243
+
244
+ ## Manual Mode Switching
245
+
246
+ Users can explicitly request a mode:
247
+
248
+ ```
249
+ /brainstorm new feature ideas
250
+ /implement the user profile page
251
+ /debug why login fails
252
+ /review this pull request
253
+ ```