opencodekit 0.16.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +64 -3
  3. package/dist/template/.opencode/command/create.md +34 -0
  4. package/dist/template/.opencode/command/design.md +35 -0
  5. package/dist/template/.opencode/command/handoff.md +15 -0
  6. package/dist/template/.opencode/command/init.md +40 -47
  7. package/dist/template/.opencode/command/plan.md +1 -0
  8. package/dist/template/.opencode/command/pr.md +15 -0
  9. package/dist/template/.opencode/command/research.md +3 -0
  10. package/dist/template/.opencode/command/resume.md +1 -0
  11. package/dist/template/.opencode/command/review-codebase.md +30 -0
  12. package/dist/template/.opencode/command/ship.md +43 -0
  13. package/dist/template/.opencode/command/start.md +1 -0
  14. package/dist/template/.opencode/command/status.md +24 -1
  15. package/dist/template/.opencode/command/ui-review.md +31 -0
  16. package/dist/template/.opencode/command/verify.md +35 -7
  17. package/dist/template/.opencode/memory/project/tech-stack.md +25 -22
  18. package/dist/template/.opencode/memory.db +0 -0
  19. package/dist/template/.opencode/memory.db-shm +0 -0
  20. package/dist/template/.opencode/memory.db-wal +0 -0
  21. package/dist/template/.opencode/opencode.json +817 -916
  22. package/dist/template/.opencode/package.json +1 -0
  23. package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +418 -0
  24. package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +170 -0
  25. package/dist/template/.opencode/plans/1770013678126-witty-planet.md +278 -0
  26. package/dist/template/.opencode/plugin/lib/memory-db.ts +828 -0
  27. package/dist/template/.opencode/plugin/memory.ts +38 -1
  28. package/dist/template/.opencode/skill/index-knowledge/SKILL.md +76 -31
  29. package/dist/template/.opencode/skill/memory-system/SKILL.md +110 -55
  30. package/dist/template/.opencode/tool/memory-get.ts +143 -0
  31. package/dist/template/.opencode/tool/memory-maintain.ts +167 -0
  32. package/dist/template/.opencode/tool/memory-migrate.ts +319 -0
  33. package/dist/template/.opencode/tool/memory-read.ts +17 -46
  34. package/dist/template/.opencode/tool/memory-search.ts +131 -28
  35. package/dist/template/.opencode/tool/memory-timeline.ts +105 -0
  36. package/dist/template/.opencode/tool/memory-update.ts +21 -26
  37. package/dist/template/.opencode/tool/observation.ts +112 -100
  38. package/dist/template/.opencode/tsconfig.json +19 -19
  39. package/package.json +1 -1
  40. package/dist/template/.opencode/memory/_templates/README.md +0 -73
  41. package/dist/template/.opencode/memory/_templates/observation.md +0 -39
  42. package/dist/template/.opencode/memory/_templates/prompt-engineering.md +0 -333
  43. package/dist/template/.opencode/memory/observations/2026-01-22-decision-agents-md-prompt-engineering-improvement.md +0 -29
  44. package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +0 -14
  45. package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +0 -20
  46. package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +0 -14
  47. package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +0 -15
  48. package/dist/template/.opencode/memory/observations/2026-01-28-decision-created-deep-research-skill-for-thorough.md +0 -29
  49. package/dist/template/.opencode/memory/observations/2026-01-28-decision-gh-grep-mcp-wrapper-vs-native-grep-searc.md +0 -21
  50. package/dist/template/.opencode/memory/observations/2026-01-28-decision-oracle-tool-optimal-usage-patterns.md +0 -32
  51. package/dist/template/.opencode/memory/observations/2026-01-28-learning-ampcode-deep-mode-research-integration-w.md +0 -42
  52. package/dist/template/.opencode/memory/observations/2026-01-28-pattern-research-delegation-pattern-explore-for-.md +0 -32
  53. package/dist/template/.opencode/memory/observations/2026-01-29-decision-copilot-auth-plugin-rate-limit-handling.md +0 -27
  54. package/dist/template/.opencode/memory/observations/2026-01-29-decision-spec-driven-approach-for-opencodekit.md +0 -21
  55. package/dist/template/.opencode/memory/observations/2026-01-29-learning-karpathy-llm-coding-insights-dec-2025.md +0 -44
  56. package/dist/template/.opencode/memory/observations/2026-01-30-decision-github-copilot-claude-routing-keep-disab.md +0 -32
  57. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-context-management-research-critical-gap.md +0 -14
  58. package/dist/template/.opencode/memory/observations/2026-01-30-discovery-kimi-k2-5-agent-swarm-architecture-patte.md +0 -45
  59. package/dist/template/.opencode/memory/observations/2026-01-30-pattern-swarm-tools-architecture.md +0 -28
  60. package/dist/template/.opencode/memory/observations/2026-01-31-decision-copilot-auth-plugin-updated-with-baseurl.md +0 -63
  61. package/dist/template/.opencode/memory/observations/2026-01-31-decision-created-dedicated-worker-agent-for-swarm.md +0 -20
  62. package/dist/template/.opencode/memory/observations/2026-01-31-decision-rollback-to-v1-1-47-for-copilot-claude-r.md +0 -21
  63. package/dist/template/.opencode/memory/observations/2026-01-31-decision-simplified-swarm-to-task-tool-pattern.md +0 -44
  64. package/dist/template/.opencode/memory/observations/2026-01-31-decision-swarm-architecture-task-tool-over-tmux.md +0 -33
  65. package/dist/template/.opencode/memory/observations/2026-01-31-decision-worker-skills-defined-for-swarm-delegati.md +0 -30
  66. package/dist/template/.opencode/memory/observations/2026-01-31-learning-gpt-reasoning-config-for-github-copilot.md +0 -51
  67. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-auth-comparison-finding.md +0 -61
  68. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-copilot-reasoning-architecture-.md +0 -66
  69. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-custom-tools-api.md +0 -48
  70. package/dist/template/.opencode/memory/observations/2026-01-31-learning-opencode-v1-1-48-skills-as-slash-command.md +0 -21
  71. package/dist/template/.opencode/memory/observations/2026-01-31-learning-swarm-system-simplified-removed-mailbox-.md +0 -30
  72. package/dist/template/.opencode/memory/observations/2026-01-31-learning-v1-1-48-native-copilot-reasoning-via-pr-.md +0 -45
  73. package/dist/template/.opencode/memory/observations/2026-01-31-warning-cannot-add-custom-config-to-opencode-jso.md +0 -18
  74. package/dist/template/.opencode/memory/observations/2026-01-31-warning-copilot-claude-v1-endpoint-returns-404-c.md +0 -48
  75. package/dist/template/.opencode/memory/observations/2026-01-31-warning-opencode-v1-1-48-claude-thinking-block-s.md +0 -51
  76. package/dist/template/.opencode/memory/observations/2026-02-01-decision-add-skills-vs-commands-to-global-agents-.md +0 -15
  77. package/dist/template/.opencode/memory/observations/2026-02-01-decision-build-agent-auto-loads-skills-contextual.md +0 -31
  78. package/dist/template/.opencode/memory/observations/2026-02-01-decision-fixed-agent-configuration-for-opencodeki.md +0 -25
  79. package/dist/template/.opencode/memory/observations/2026-02-01-decision-focused-agents-md-upgrade-for-opencode-k.md +0 -14
  80. package/dist/template/.opencode/memory/observations/2026-02-01-decision-implement-tier-1-permission-upgrades.md +0 -15
  81. package/dist/template/.opencode/memory/observations/2026-02-01-decision-instructions-config-explicit-paths-not-w.md +0 -40
  82. package/dist/template/.opencode/memory/observations/2026-02-01-decision-merged-context-into-memory-project-singl.md +0 -42
  83. package/dist/template/.opencode/memory/observations/2026-02-01-decision-oracle-tool-should-use-review-agent-not-.md +0 -14
  84. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-agent-auto-loads-skills-contextuall.md +0 -31
  85. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-phased-oracle-command-merge-into-ne.md +0 -14
  86. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prd-workflow-uses-prd-and-prd-task-skill.md +0 -23
  87. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prefer-review-agent-via-opencode-cli-ove.md +0 -14
  88. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-add-ship-command-with.md +0 -14
  89. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command-.md +0 -14
  90. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command.md +0 -14
  91. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-skills-vs-commands-section-from-a.md +0 -14
  92. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-tool-with-ship-command-fl.md +0 -14
  93. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-with-ship-command-workflo.md +0 -14
  94. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-proxypal-oracle-with-cli-review-.md +0 -14
  95. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-dist-template-only-tech-stack.md +0 -50
  96. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-templates-only-tech-stack-md.md +0 -26
  97. package/dist/template/.opencode/memory/observations/2026-02-01-decision-subagents-load-minimal-skills-stay-lean.md +0 -29
  98. package/dist/template/.opencode/memory/observations/2026-02-01-decision-user-approved-permission-upgrades-in-ope.md +0 -15
  99. package/dist/template/.opencode/memory/observations/2026-02-01-discovery-verify-command-already-implemented.md +0 -28
  100. package/dist/template/.opencode/memory/observations/2026-02-01-feature-openspec-phase-b-complete-template-upgra.md +0 -43
  101. package/dist/template/.opencode/memory/observations/2026-02-01-learning-build-agent-should-use-dynamic-lsp-not-f.md +0 -14
  102. package/dist/template/.opencode/memory/observations/2026-02-01-learning-kimi-k2-5-model-requires-temperature-1-0.md +0 -22
  103. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-already-imple.md +0 -27
  104. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-uses-instruct.md +0 -35
  105. package/dist/template/.opencode/memory/observations/2026-02-01-learning-update-build-agent-prompt-to-use-context.md +0 -14
  106. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-using-opencode-expert-.md +0 -14
  107. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-g.md +0 -14
  108. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-r.md +0 -14
  109. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-prefers-copilot-gpt-5-2-codex-mediu.md +0 -14
  110. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-contextu.md +0 -15
  111. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-reviewed.md +0 -15
  112. package/dist/template/.opencode/memory/project/architecture.md +0 -60
  113. package/dist/template/.opencode/memory/project/command-rules.md +0 -122
  114. package/dist/template/.opencode/memory/project/commands.md +0 -72
  115. package/dist/template/.opencode/memory/project/conventions.md +0 -68
  116. package/dist/template/.opencode/memory/project/gotchas.md +0 -41
  117. /package/dist/template/.opencode/memory/_templates/{project/tech-stack.md → tech-stack.md} +0 -0
  118. /package/dist/template/.opencode/memory/{user.example.md → _templates/user.md} +0 -0
  119. /package/dist/template/.opencode/memory/{user.md → project/user.md} +0 -0
@@ -0,0 +1,278 @@
1
+ # Plan: Implement `/init` Command for OpenCodeKit
2
+
3
+ ## Summary
4
+
5
+ Implement the `/init` slash command that provides one-command project onboarding. This command creates project-root `AGENTS.md` and populates memory files with detected project information. The command is defined in `.opencode/command/init.md` and executed by the `@plan` agent.
6
+
7
+ ## Current State
8
+
9
+ - **CLI `ock init`**: Already exists in `src/commands/init.ts` - bootstraps `.opencode/` directory
10
+ - **Slash `/init`**: Defined in `.opencode/command/init.md` - AI-assisted project analysis workflow
11
+ - **Templates**: Exist in `.opencode/memory/_templates/` (user.md, tech-stack.md)
12
+ - **Memory system**: SQLite-based with tools in `.opencode/tool/`
13
+
14
+ ## Phases
15
+
16
+ ### Phase 1: Verify Command Registration
17
+
18
+ **Owner**: @build
19
+ **Deliverable**: Ensure `/init` command is properly registered and accessible
20
+ **Files**:
21
+
22
+ - `.opencode/command/init.md` (exists, verify content)
23
+ - `.opencode/opencode.json` (verify command registration)
24
+
25
+ **Validation**:
26
+
27
+ - [ ] Command appears in `ock command list`
28
+ - [ ] Command has correct frontmatter (agent: plan, subtask: true)
29
+ - [ ] Command description is accurate
30
+
31
+ ### Phase 2: Enhance Project Detection Logic
32
+
33
+ **Owner**: @build
34
+ **Deliverable**: Robust project detection with comprehensive tech stack identification
35
+ **Files**:
36
+
37
+ - `.opencode/command/init.md` (enhance Phase 2 section)
38
+ - Create utility functions for detection if needed
39
+
40
+ **Implementation Details**:
41
+
42
+ 1. Detect tech stack from:
43
+ - `package.json` → Node.js/Bun/JavaScript projects
44
+ - `go.mod` → Go projects
45
+ - `pyproject.toml`, `requirements.txt` → Python projects
46
+ - `Cargo.toml` → Rust projects
47
+ - `composer.json` → PHP projects
48
+ - `Gemfile` → Ruby projects
49
+ - `pom.xml`, `build.gradle` → Java projects
50
+
51
+ 2. Extract key information:
52
+ - Language & version
53
+ - Framework & version
54
+ - Build tool
55
+ - Test command
56
+ - Lint command
57
+ - Key dependencies
58
+
59
+ 3. Validate commands by attempting to run them
60
+
61
+ **Validation**:
62
+
63
+ - [ ] Correctly detects this project's stack (Bun, TypeScript)
64
+ - [ ] Correctly detects various project types in test scenarios
65
+ - [ ] Command validation works (build, test, lint)
66
+
67
+ ### Phase 3: Implement AGENTS.md Generation
68
+
69
+ **Owner**: @build
70
+ **Deliverable**: Template-based AGENTS.md generation with project-specific content
71
+ **Files**:
72
+
73
+ - `.opencode/command/init.md` (enhance Phase 3 section)
74
+ - Potentially create template files
75
+
76
+ **Implementation Details**:
77
+
78
+ 1. Create AGENTS.md template structure:
79
+ - Project name (from package.json or directory name)
80
+ - Tech stack section (from Phase 2 detection)
81
+ - File structure section
82
+ - Commands section (validated commands)
83
+ - Code examples section (extract from actual codebase)
84
+ - Testing section
85
+ - Boundaries section (Always/Ask First/Never rules)
86
+ - Gotchas section
87
+
88
+ 2. Target: <60 lines (max 150 lines)
89
+
90
+ 3. If AGENTS.md exists:
91
+ - Read existing content
92
+ - Merge/improve rather than overwrite
93
+ - Preserve user-added sections
94
+
95
+ **Validation**:
96
+
97
+ - [ ] Generated AGENTS.md is <60 lines
98
+ - [ ] Contains accurate tech stack
99
+ - [ ] Commands are validated and working
100
+ - [ ] Includes at least one code example from codebase
101
+ - [ ] Has proper Boundaries section with Never rules
102
+
103
+ ### Phase 4: Implement Memory File Population
104
+
105
+ **Owner**: @build
106
+ **Deliverable**: Populate `.opencode/memory/project/user.md` and `tech-stack.md`
107
+ **Files**:
108
+
109
+ - `.opencode/command/init.md` (enhance Phase 5 section)
110
+ - `.opencode/memory/_templates/user.md`
111
+ - `.opencode/memory/_templates/tech-stack.md`
112
+
113
+ **Implementation Details**:
114
+
115
+ 1. Load templates from `_templates/`
116
+
117
+ 2. Populate `user.md` from Phase 1 answers:
118
+ - Identity (name, git contributor)
119
+ - Communication preferences (terse/detailed)
120
+ - Workflow preferences (auto-commit/ask-first)
121
+ - Custom rules
122
+
123
+ 3. Populate `tech-stack.md` from Phase 2 detection:
124
+ - Framework & version
125
+ - Language & runtime
126
+ - Key dependencies with versions
127
+ - Key constraints
128
+ - Active integrations
129
+
130
+ **Validation**:
131
+
132
+ - [ ] user.md created with accurate information
133
+ - [ ] tech-stack.md created with detected stack
134
+ - [ ] Templates are properly used as base
135
+
136
+ ### Phase 5: Implement Optional Beads Initialization
137
+
138
+ **Owner**: @build
139
+ **Deliverable**: Initialize `.beads/` directory when user opts in
140
+ **Files**:
141
+
142
+ - `.opencode/command/init.md` (enhance Phase 6 section)
143
+
144
+ **Implementation Details**:
145
+
146
+ 1. If user says yes to beads:
147
+ - Run `bd init` if available
148
+ - Or create basic structure manually:
149
+ - `.beads/config.yaml`
150
+ - `.beads/issues.jsonl`
151
+ - `.beads/metadata.json`
152
+
153
+ **Validation**:
154
+
155
+ - [ ] Beads initializes correctly when requested
156
+ - [ ] No errors if beads already exists
157
+
158
+ ### Phase 6: Add --deep Mode Support
159
+
160
+ **Owner**: @build
161
+ **Deliverable**: Comprehensive research mode with subsystem detection
162
+ **Files**:
163
+
164
+ - `.opencode/command/init.md` (enhance Phase 4 section)
165
+
166
+ **Implementation Details**:
167
+
168
+ 1. When `--deep` flag is passed:
169
+ - Git history analysis (contributors, commit conventions)
170
+ - Branching strategy detection
171
+ - Source file pattern analysis
172
+ - Subsystem identification for nested AGENTS.md
173
+
174
+ 2. Suggest nested AGENTS.md for:
175
+ - `packages/*/` in monorepos
176
+ - `src/` vs `tests/` if patterns differ
177
+ - `frontend/` vs `backend/` directories
178
+
179
+ **Validation**:
180
+
181
+ - [ ] --deep flag triggers additional research
182
+ - [ ] Subsystem detection works for monorepos
183
+ - [ ] Suggestions are relevant and actionable
184
+
185
+ ### Phase 7: Testing & Validation
186
+
187
+ **Owner**: @build
188
+ **Deliverable**: End-to-end testing of the `/init` command
189
+ **Files**:
190
+
191
+ - Test in a fresh project directory
192
+ - Test in existing project with AGENTS.md
193
+ - Test with --deep flag
194
+
195
+ **Test Scenarios**:
196
+
197
+ 1. Fresh project (no AGENTS.md):
198
+ - [ ] Asks upfront questions
199
+ - [ ] Detects tech stack correctly
200
+ - [ ] Creates AGENTS.md
201
+ - [ ] Populates memory files
202
+ - [ ] Shows completion summary
203
+
204
+ 2. Existing project (with AGENTS.md):
205
+ - [ ] Reads existing AGENTS.md
206
+ - [ ] Merges/improves rather than overwriting
207
+ - [ ] Preserves user content
208
+
209
+ 3. With --deep flag:
210
+ - [ ] Performs git analysis
211
+ - [ ] Detects subsystems
212
+ - [ ] Suggests nested AGENTS.md
213
+
214
+ 4. With --skip-questions:
215
+ - [ ] Skips upfront questions
216
+ - [ ] Infers identity from git config
217
+
218
+ **Validation**:
219
+
220
+ - [ ] All test scenarios pass
221
+ - [ ] Generated files are valid and useful
222
+ - [ ] Command completes without errors
223
+
224
+ ## Dependencies
225
+
226
+ - Phase 2 depends on Phase 1 (command registration verification)
227
+ - Phase 3 depends on Phase 2 (tech stack detection)
228
+ - Phase 4 depends on Phase 1 (templates exist) and Phase 2 (detection data)
229
+ - Phase 5 is independent but uses Phase 1 answers
230
+ - Phase 6 is optional enhancement
231
+ - Phase 7 depends on all previous phases
232
+
233
+ ## Risks
234
+
235
+ | Risk | Likelihood | Impact | Mitigation |
236
+ | ------------------------------------------------- | ---------- | ------ | ---------------------------------------------------- |
237
+ | Command detection fails for exotic project types | Medium | Medium | Fallback to generic templates, allow manual override |
238
+ | AGENTS.md generation produces stale code examples | Low | Medium | Use pointers instead of inline code where possible |
239
+ | Memory file templates change structure | Low | Low | Version templates, update command accordingly |
240
+ | User preferences not captured correctly | Low | Medium | Validate with user before writing files |
241
+ | --deep mode takes too long | Medium | Low | Add progress indicators, allow cancellation |
242
+
243
+ ## Acceptance Criteria
244
+
245
+ - [ ] `/init` command is accessible and runs without errors
246
+ - [ ] Creates `./AGENTS.md` with project-specific information (<60 lines target)
247
+ - [ ] Populates `.opencode/memory/project/user.md` with user preferences
248
+ - [ ] Populates `.opencode/memory/project/tech-stack.md` with detected stack
249
+ - [ ] Validates commands (build, test, lint) actually work
250
+ - [ ] Handles existing AGENTS.md gracefully (merges/improves)
251
+ - [ ] Supports `--deep` flag for comprehensive analysis
252
+ - [ ] Supports `--skip-questions` flag for non-interactive use
253
+ - [ ] Optional beads initialization works
254
+ - [ ] Shows clear completion summary with next steps
255
+
256
+ ## Questions
257
+
258
+ 1. Should we add a `--dry-run` flag to preview what would be created without writing files?
259
+ 2. Should we support importing from existing `.cursorrules` or `.github/copilot-instructions.md` files?
260
+ 3. Should the command suggest running `/review-codebase` after initialization?
261
+
262
+ ## Implementation Notes
263
+
264
+ The `/init` command is already defined in `.opencode/command/init.md`. The implementation involves:
265
+
266
+ 1. **Verifying** the command definition is complete and accurate
267
+ 2. **Enhancing** the command instructions with robust detection logic
268
+ 3. **Testing** the command end-to-end in various scenarios
269
+
270
+ The command uses the `@plan` agent (subtask: true) which means it runs as a separate planning task. The instructions in the markdown file guide the AI through the 8-phase process.
271
+
272
+ Key files to verify/modify:
273
+
274
+ - `.opencode/command/init.md` - Main command definition
275
+ - `.opencode/memory/_templates/user.md` - User profile template
276
+ - `.opencode/memory/_templates/tech-stack.md` - Tech stack template
277
+
278
+ No new CLI commands needed - this is a slash command enhancement.