@nano-step/skill-manager 5.2.0 → 5.2.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.
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/skills/rtk-setup/SKILL.md +118 -0
- package/skills/rtk-setup/skill.json +14 -0
package/dist/utils.d.ts
CHANGED
package/dist/utils.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.writeText = writeText;
|
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const os_1 = __importDefault(require("os"));
|
|
15
15
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
16
|
-
exports.MANAGER_VERSION = "5.2.
|
|
16
|
+
exports.MANAGER_VERSION = "5.2.1";
|
|
17
17
|
async function detectOpenCodePaths() {
|
|
18
18
|
const homeConfig = path_1.default.join(os_1.default.homedir(), ".config", "opencode");
|
|
19
19
|
const cwd = process.cwd();
|
package/package.json
CHANGED
|
@@ -0,0 +1,118 @@
|
|
|
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 |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rtk-setup",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "One-time setup + ongoing enforcement of RTK (Rust Token Killer) across sessions and subagents \u2014 reduces token consumption by 60-90%",
|
|
5
|
+
"compatibility": "OpenCode with RTK binary installed",
|
|
6
|
+
"agent": null,
|
|
7
|
+
"commands": [],
|
|
8
|
+
"tags": [
|
|
9
|
+
"rtk",
|
|
10
|
+
"token-saving",
|
|
11
|
+
"optimization",
|
|
12
|
+
"setup"
|
|
13
|
+
]
|
|
14
|
+
}
|