opencodekit 0.21.1 → 0.21.3

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 (28) hide show
  1. package/dist/index.js +4 -4
  2. package/dist/template/.opencode/.template-manifest.json +721 -0
  3. package/dist/template/.opencode/.version +1 -1
  4. package/dist/template/.opencode/AGENTS.md +39 -29
  5. package/dist/template/.opencode/agent/vision.md +0 -1
  6. package/dist/template/.opencode/memory.db +0 -0
  7. package/dist/template/.opencode/memory.db-shm +0 -0
  8. package/dist/template/.opencode/memory.db-wal +0 -0
  9. package/dist/template/.opencode/opencode.json +1311 -1134
  10. package/dist/template/.opencode/plugin/README.md +10 -6
  11. package/dist/template/.opencode/plugin/rtk.ts +43 -0
  12. package/dist/template/.opencode/pnpm-lock.yaml +140 -706
  13. package/dist/template/.opencode/skill/agent-evals/SKILL.md +208 -0
  14. package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +76 -0
  15. package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +222 -0
  16. package/dist/template/.opencode/skill/context-condensation/SKILL.md +149 -0
  17. package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +139 -0
  18. package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +253 -0
  19. package/dist/template/.opencode/skill/html-deck-export/SKILL.md +189 -0
  20. package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +134 -0
  21. package/dist/template/.opencode/skill/test-driven-development/SKILL.md +15 -0
  22. package/package.json +1 -1
  23. package/dist/template/.opencode/package.json +0 -22
  24. package/dist/template/.opencode/plugin/package.json +0 -7
  25. package/dist/template/.opencode/plugin/stitch.ts +0 -307
  26. package/dist/template/.opencode/skill/stitch/SKILL.md +0 -164
  27. package/dist/template/.opencode/skill/stitch-design-taste/DESIGN.md +0 -121
  28. package/dist/template/.opencode/skill/stitch-design-taste/SKILL.md +0 -197
@@ -9,7 +9,8 @@ plugin/
9
9
  ├── memory.ts # 4-tier automated memory system (capture → distill → curate → inject)
10
10
  ├── sessions.ts # Session search tools (find/read)
11
11
  ├── copilot-auth.ts # GitHub Copilot provider/auth integration
12
- ├── stitch.ts # Google Stitch UI generation (8 tools via @google/stitch-sdk)
12
+ ├── prompt-leverage.ts # Prompt pre-processing with structured execution framing
13
+ ├── rtk.ts # Optional RTK command-output compression hook
13
14
  ├── skill-mcp.ts # Skill-scoped MCP bridge (skill_mcp tools)
14
15
  └── lib/
15
16
  ├── memory-tools.ts # 6 core memory tools (observation, search, get, read, update, timeline)
@@ -59,11 +60,14 @@ plugin/
59
60
  - Handles GitHub Copilot OAuth/device flow
60
61
  - Adds model/provider request shaping for compatible reasoning behavior
61
62
 
62
- - `stitch.ts`
63
- - Google Stitch UI generation via `@google/stitch-sdk`
64
- - 8 tools: create_project, get_project, list_projects, list_screens, get_screen, generate_screen, edit_screens, generate_variants
65
- - Direct HTTP to `stitch.googleapis.com/mcp` (no MCP subprocess)
66
- - Auth: STITCH_API_KEY or STITCH_ACCESS_TOKEN env var
63
+ - `prompt-leverage.ts`
64
+ - Upgrades user prompts with objective, context, tool rules, verification, and done criteria
65
+ - Runs through `experimental.chat.messages.transform`
66
+
67
+ - `rtk.ts`
68
+ - Optional OpenCode hook for RTK command-output compression
69
+ - Rewrites low-risk `bash`/`shell` commands through `rtk rewrite`
70
+ - Keeps an idempotency guard for symlinked global/project config double-loading
67
71
 
68
72
  ## Notes
69
73
 
@@ -0,0 +1,43 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+
3
+ // RTK OpenCode plugin — rewrites commands to use rtk for token savings.
4
+ // Requires: rtk >= 0.23.0 in PATH.
5
+ //
6
+ // This is a thin delegating plugin: all rewrite logic lives in `rtk rewrite`,
7
+ // which is the single source of truth (src/discover/registry.rs).
8
+ // To add or change rewrite rules, edit the Rust registry — not this file.
9
+
10
+ export const RtkOpenCodePlugin: Plugin = async ({ $ }) => {
11
+ try {
12
+ await $`which rtk`.quiet();
13
+ } catch {
14
+ console.warn("[rtk] rtk binary not found in PATH — plugin disabled");
15
+ return {};
16
+ }
17
+
18
+ return {
19
+ "tool.execute.before": async (input, output) => {
20
+ const tool = String(input?.tool ?? "").toLowerCase();
21
+ if (tool !== "bash" && tool !== "shell") return;
22
+ const args = output?.args;
23
+ if (!args || typeof args !== "object") return;
24
+
25
+ const command = (args as Record<string, unknown>).command;
26
+ if (typeof command !== "string" || !command) return;
27
+ // This config is symlinked as both global and project OpenCode config.
28
+ // OpenCode may load this plugin twice in that layout, so avoid rewriting
29
+ // commands that have already been routed through rtk.
30
+ if (/^\s*(?:RTK_[A-Z_]+=\S+\s+)*rtk\b/.test(command)) return;
31
+
32
+ try {
33
+ const result = await $`rtk rewrite ${command}`.quiet().nothrow();
34
+ const rewritten = String(result.stdout).trim();
35
+ if (rewritten && rewritten !== command) {
36
+ (args as Record<string, unknown>).command = rewritten;
37
+ }
38
+ } catch {
39
+ // rtk rewrite failed — pass through unchanged
40
+ }
41
+ },
42
+ };
43
+ };