@kokorolx/ai-sandbox-wrapper 3.4.3 → 4.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.
@@ -1,9 +0,0 @@
1
- FROM ai-base:latest
2
-
3
- USER root
4
- RUN curl -fsSL https://opencode.ai/install | bash && \
5
- mv /home/agent/.opencode/bin/opencode /usr/local/bin/opencode && \
6
- rm -rf /home/agent/.opencode
7
-
8
- USER agent
9
- ENTRYPOINT ["opencode"]
@@ -1,103 +0,0 @@
1
- ---
2
- name: rtk
3
- description: "Token optimizer for AI coding agents. Wraps common CLI commands with rtk to reduce LLM token consumption by 60-90%."
4
- compatibility: "OpenCode with RTK binary installed"
5
- metadata:
6
- author: Sisyphus
7
- version: "1.0.0"
8
- ---
9
-
10
- # RTK — Rust Token Killer
11
-
12
- **Purpose**: Reduce token consumption by 60-90% on shell commands. RTK filters and compresses command output before it reaches your context.
13
-
14
- ## When This Skill Activates
15
-
16
- This skill is loaded automatically. Once active, **always** prefix supported commands with `rtk`.
17
-
18
- ## Command Mappings (MANDATORY)
19
-
20
- When running shell commands via Bash tool, use `rtk` prefix for these commands:
21
-
22
- | Instead of | Use | Savings |
23
- |-----------|-----|---------|
24
- | `git status` | `rtk git status` | ~80% |
25
- | `git diff` | `rtk git diff` | ~75% |
26
- | `git log` | `rtk git log` | ~80% |
27
- | `git add/commit/push/pull` | `rtk git add/commit/push/pull` | ~90% |
28
- | `ls` / `ls -la` | `rtk ls` | ~80% |
29
- | `cat file` | `rtk read file` | ~70% |
30
- | `grep pattern .` | `rtk grep pattern .` | ~80% |
31
- | `rg pattern` | `rtk grep pattern .` | ~80% |
32
- | `npm test` / `cargo test` / `pytest` | `rtk test <cmd>` | ~90% |
33
- | `npm run build` / `cargo build` | `rtk err <cmd>` | ~80% |
34
- | `gh pr list/view` | `rtk gh pr list/view` | ~70% |
35
- | `docker ps` | `rtk docker ps` | ~80% |
36
- | `eslint` / `tsc` | `rtk lint` / `rtk tsc` | ~80% |
37
-
38
- ## Searching Inside `node_modules` / Ignored Directories
39
-
40
- By default, `rtk grep` respects `.gitignore` rules — meaning `node_modules`, `.nuxt`, `dist`, etc. are **excluded**. This is the right behavior 99% of the time.
41
-
42
- When you **need** to search inside ignored directories (debugging a library, checking an API signature, tracing a dependency bug):
43
-
44
- ```bash
45
- # Search all files including node_modules (--no-ignore bypasses .gitignore)
46
- rtk grep "defineStore" . --no-ignore
47
-
48
- # Search a specific package only (combine --no-ignore with --glob)
49
- rtk grep "defineStore" . --no-ignore --glob 'node_modules/pinia/**'
50
- ```
51
-
52
- **What does NOT work:**
53
- - `rtk grep "pattern" node_modules/pinia/` — still excluded even with direct path
54
- - `rtk grep "pattern" . --glob 'node_modules/**'` — glob alone doesn't override .gitignore
55
-
56
- **Key flag: `--no-ignore`** — this is the ONLY way to search ignored directories with rtk grep.
57
-
58
- ### Other useful `rtk grep` flags
59
-
60
- ```bash
61
- rtk grep "pattern" . -t ts # Filter by file type (ts, py, rust, etc.)
62
- rtk grep "pattern" . -m 100 # Increase max results (default: 50)
63
- rtk grep "pattern" . -u # Ultra-compact mode (even fewer tokens)
64
- rtk grep "pattern" . -l 120 # Max line length before truncation (default: 80)
65
- ```
66
-
67
- ## Commands to NOT Wrap
68
-
69
- Do NOT prefix these with `rtk` (unsupported or counterproductive):
70
-
71
- - `npx`, `npm install`, `pip install` (package managers)
72
- - `node`, `python3`, `ruby` (interpreters)
73
- - `nano-brain`, `openspec`, `opencode` (custom tools)
74
- - Heredocs (`<<EOF`)
75
- - Piped commands (`cmd1 | cmd2`) — wrap only the first command if applicable
76
- - Commands already prefixed with `rtk`
77
-
78
- ## How RTK Works
79
-
80
- ```
81
- Without RTK: git status → 50 lines raw output → 2,000 tokens
82
- With RTK: rtk git status → "3 modified, 1 untracked ✓" → 200 tokens
83
- ```
84
-
85
- RTK runs the real command, then filters/compresses the output. The agent sees a compact summary instead of verbose raw output.
86
-
87
- ## Detection
88
-
89
- Before using RTK commands, verify it's installed:
90
- ```bash
91
- rtk --version
92
- ```
93
-
94
- If `rtk` is not found, skip this skill — run commands normally without the `rtk` prefix.
95
-
96
- ## Token Savings Reference
97
-
98
- Typical 30-min coding session:
99
- - Without RTK: ~150,000 tokens
100
- - With RTK: ~45,000 tokens
101
- - **Savings: ~70%**
102
-
103
- Biggest wins: test output (`rtk test` — 90%), git operations (`rtk git` — 80%), file reading (`rtk read` — 70%).
@@ -1,118 +0,0 @@
1
- ---
2
- name: rtk-setup
3
- description: "One-time setup + ongoing enforcement of RTK (Rust Token Killer) across sessions and subagents. Persists RTK instructions to AGENTS.md and propagates to delegated tasks."
4
- compatibility: "OpenCode with RTK binary installed"
5
- metadata:
6
- author: Sisyphus
7
- version: "1.0.0"
8
- ---
9
-
10
- # RTK Setup — Persistent RTK Enforcement
11
-
12
- This skill performs **setup** (persist RTK instructions) and **ongoing enforcement** (use rtk, propagate to subagents).
13
-
14
- ## Phase 1: Detection (ALWAYS run first)
15
-
16
- Run these checks before anything else:
17
-
18
- ```bash
19
- rtk --version
20
- ```
21
-
22
- - If `rtk` is NOT found → **STOP**. Tell the user: "RTK is not installed. Install it first: `cargo install --git https://github.com/rtk-ai/rtk --locked`". Do NOT proceed with setup.
23
- - If `rtk` IS found → continue.
24
-
25
- ### Check oh-my-opencode
26
-
27
- ```bash
28
- ls ~/.config/opencode/oh-my-opencode.json 2>/dev/null
29
- ```
30
-
31
- - If found → omo is installed. Note this for Phase 2.
32
- - If not found → skip omo-specific steps.
33
-
34
- ## Phase 2: Setup (persist to AGENTS.md)
35
-
36
- Check BOTH of these files for the RTK managed block:
37
-
38
- 1. **User-level**: `~/.config/opencode/AGENTS.md`
39
- 2. **Project-level**: `./AGENTS.md` (current workspace)
40
-
41
- For EACH file, check if `<!-- RTK:START -->` exists. If it does NOT exist, **append** the following managed block to the file (create the file if it doesn't exist). NEVER replace existing content — only append.
42
-
43
- ```markdown
44
- <!-- RTK:START -->
45
- <!-- Managed block - do not edit manually. Updated by: rtk-setup skill -->
46
-
47
- ## RTK Token Optimizer
48
-
49
- This project uses **RTK** (Rust Token Killer) to reduce LLM token consumption by 60-90%.
50
-
51
- ### Rules for ALL agents (including subagents)
52
-
53
- **ALWAYS** prefix these commands with `rtk`:
54
-
55
- | Command | Use instead |
56
- |---------|-------------|
57
- | `git status/diff/log/add/commit/push/pull` | `rtk git ...` |
58
- | `ls`, `ls -la` | `rtk ls` |
59
- | `cat file` | `rtk read file` |
60
- | `grep pattern .` / `rg pattern` | `rtk grep pattern .` |
61
- | `npm test` / `cargo test` / `pytest` | `rtk test <cmd>` |
62
- | `npm run build` / `cargo build` | `rtk err <cmd>` |
63
- | `gh pr list/view` | `rtk gh pr list/view` |
64
- | `docker ps` | `rtk docker ps` |
65
- | `eslint` / `tsc` | `rtk lint` / `rtk tsc` |
66
-
67
- **Do NOT** prefix: `npx`, `npm install`, `pip install`, `node`, `python3`, heredocs, piped commands.
68
-
69
- <!-- RTK:END -->
70
- ```
71
-
72
- ### If oh-my-opencode is installed
73
-
74
- After updating AGENTS.md files, check if the omo config at `~/.config/opencode/oh-my-opencode.json` has `prompt_append` fields on agents. If it does, inform the user:
75
-
76
- > "omo is installed. For maximum coverage, you can add RTK instructions to agent `prompt_append` fields in `oh-my-opencode.json`. This ensures subagents always use rtk even when AGENTS.md is not loaded. Want me to do this?"
77
-
78
- **Only modify `oh-my-opencode.json` if the user explicitly confirms.** If they confirm, append this line to the `prompt_append` of `sisyphus-junior` agent (the primary coder):
79
-
80
- ```
81
- \n\nRTK: ALWAYS prefix shell commands with `rtk` when available (git, ls, grep, test, build). Example: `rtk git status` not `git status`.
82
- ```
83
-
84
- Do NOT modify other agents' prompt_append unless asked.
85
-
86
- ## Phase 3: Ongoing Enforcement (EVERY time this skill is loaded)
87
-
88
- ### For the current agent
89
-
90
- From this point forward in this session, **you MUST**:
91
-
92
- 1. **Use `rtk` prefix** for all supported shell commands (see table above)
93
- 2. **Verify rtk is available** before first use: `rtk --version`
94
- 3. If rtk is not available in the current environment, fall back to normal commands silently
95
-
96
- ### For subagent delegation
97
-
98
- When delegating ANY task that involves shell commands (via `task()`, `delegate_task()`, or any delegation mechanism), **ALWAYS** add this to the `MUST DO` section of the delegation prompt:
99
-
100
- ```
101
- - Use `rtk` prefix for shell commands when available (git, ls, grep, test, build). Run `rtk --version` first to check. If not installed, use normal commands. Examples: `rtk git status`, `rtk ls`, `rtk grep pattern .`, `rtk test npm test`.
102
- ```
103
-
104
- This is NON-NEGOTIABLE. Subagents do not read AGENTS.md, so RTK instructions MUST be passed explicitly in every delegation prompt.
105
-
106
- ### Quick reference for subagent prompts
107
-
108
- Copy-paste this one-liner into MUST DO sections:
109
-
110
- > Use `rtk` prefix for all shell commands (git, ls, grep, test, build, docker). Example: `rtk git status` not `git status`. If `rtk` is not found, use normal commands.
111
-
112
- ## Summary
113
-
114
- | Phase | When | What |
115
- |-------|------|------|
116
- | Detection | Always first | Check rtk installed, check omo |
117
- | Setup | Once (idempotent) | Append RTK block to AGENTS.md (user + project) |
118
- | Enforcement | Every session | Use rtk yourself, propagate to all subagents |