Roger MT commited on
Commit
5c3da19
·
1 Parent(s): e4e4da5

add skills for kilo agent

Browse files
SKILLS/kilo_agent/SKILL.md ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ ---
4
+
5
+ # **SKILL.md — Kilo Connection Modes**
6
+
7
+ This skill defines three supported methods for interacting with Kilo:
8
+
9
+ 1. **Gateway API (OpenAI‑compatible SDK)**
10
+ 2. **Local CLI Server (Headless Attach)**
11
+ 3. **Python HTTP Requests to Local Server**
12
+
13
+ Each mode is independent and serves different runtime environments.
14
+
15
+ ---
16
+
17
+ ## **1. Gateway API (SDK / API Key)**
18
+ Use this mode when calling Kilo’s hosted Gateway service.
19
+ Requires a **KILO_API_KEY** and internet access.
20
+
21
+ ### **Client Setup**
22
+ ```python
23
+ import os
24
+ from openai import OpenAI
25
+
26
+ client = OpenAI(
27
+ api_key=os.getenv("KILO_API_KEY"),
28
+ base_url="https://api.kilo.ai/api/gateway",
29
+ )
30
+ ```
31
+
32
+ ### **Completion**
33
+ ```python
34
+ response = client.chat.completions.create(
35
+ model="anthropic/claude-sonnet-4.5",
36
+ messages=[{"role": "user", "content": "Explain quantum entanglement simply."}],
37
+ )
38
+
39
+ print(response.choices[0].message.content)
40
+ ```
41
+
42
+ ### **Streaming**
43
+ ```python
44
+ stream = client.chat.completions.create(
45
+ model="anthropic/claude-sonnet-4.5",
46
+ messages=[{"role": "user", "content": "Write a poem about the ocean."}],
47
+ stream=True,
48
+ )
49
+
50
+ for chunk in stream:
51
+ delta = chunk.choices[0].delta.content
52
+ if delta:
53
+ print(delta, end="", flush=True)
54
+ ```
55
+
56
+ ---
57
+
58
+ ## **2. Local CLI Server (Headless Attach)**
59
+ Use this mode when running Kilo locally for agent development or offline work.
60
+
61
+ ### **Start Local Server**
62
+ ```bash
63
+ KILO_SERVER_PASSWORD=$(openssl rand -hex 16) \
64
+ bun dev serve --port 0 >/tmp/kilo-serve.log 2>&1 &
65
+ echo $! >/tmp/kilo-serve.pid
66
+
67
+ while ! grep -q "kilo server listening" /tmp/kilo-serve.log; do sleep 0.1; done
68
+
69
+ PORT=$(grep -oE "listening on http://[^:]+:[0-9]+" /tmp/kilo-serve.log | grep -oE "[0-9]+$")
70
+ SERVER_URL="http://127.0.0.1:$PORT"
71
+ ```
72
+
73
+ ### **Attach**
74
+ ```bash
75
+ kilo attach "$SERVER_URL" --password "$KILO_SERVER_PASSWORD"
76
+ ```
77
+
78
+ ### **Attach Options**
79
+ - `--dir <path>`
80
+ - `--continue`
81
+ - `--session <id>`
82
+ - `--fork`
83
+ - `--cloud-fork`
84
+ - `--password`
85
+
86
+ ---
87
+
88
+ ## **3. Python HTTP Requests to Local Server**
89
+ Use this mode when you want to call the **local kilo server directly** without the SDK.
90
+
91
+ ### **Example (POST request)**
92
+ ```python
93
+ import requests
94
+
95
+ SERVER_URL = "http://127.0.0.1:PORT" # replace with actual port
96
+
97
+ payload = {
98
+ "model": "anthropic/claude-sonnet-4.5",
99
+ "messages": [
100
+ {"role": "user", "content": "Explain quantum entanglement simply."}
101
+ ]
102
+ }
103
+
104
+ response = requests.post(f"{SERVER_URL}/v1/chat/completions", json=payload)
105
+ print(response.json())
106
+ ```
107
+
108
+ ### **Streaming Example**
109
+ ```python
110
+ import requests
111
+
112
+ with requests.post(
113
+ f"{SERVER_URL}/v1/chat/completions",
114
+ json=payload,
115
+ stream=True,
116
+ ) as r:
117
+ for line in r.iter_lines():
118
+ if line:
119
+ print(line.decode(), flush=True)
120
+ ```
121
+
122
+ ### **Notes**
123
+ - Local server exposes an OpenAI‑compatible API
124
+ - No API key required unless server started with password
125
+ - Ideal for offline or local agent workflows
126
+
127
+ ---
128
+
129
+ ## **Summary Table**
130
+
131
+ | Mode | Description | Auth | Use Case |
132
+ |------|-------------|------|----------|
133
+ | **Gateway API (SDK)** | Cloud endpoint via OpenAI‑compatible SDK | API key | Production, cloud workloads |
134
+ | **CLI Headless** | Attach to local kilo serve | Password (optional) | Local agent runtime |
135
+ | **Python HTTP → Local Server** | Direct HTTP calls to local server | None or password | Offline, custom tooling |
136
+
137
+ ---
138
+
139
+ If you want, I can also generate:
140
+
141
+ - `skill.json`
142
+ - a Python wrapper (`kilo_call()`)
143
+ - a full `/skills/kilo/` folder layout
144
+ - or a minimal version for ARC‑style agent runners.
145
+
146
+ Just tell me which one you want next.Alright, Roger — **now I’ve got it exactly**.
147
+ You want a **formal SKILL.md** that documents the **three correct connection modes**, with **no mixing**, no confusion, no extra fluff.
148
+
149
+ ### ✅ The three modes you want documented:
150
+
151
+ 1. **SDK / API Gateway (OpenAI‑compatible, requires API key)**
152
+ 2. **CLI Headless Mode (attach to local kilo server)**
153
+ 3. **Python HTTP Requests directly to the local kilo server**
154
+
155
+ Here is the **clean, formal, repo‑ready SKILL.md** with ONLY those three modes, clearly separated.
156
+
157
+ ---
158
+
159
+ # **SKILL.md — Kilo Connection Modes**
160
+
161
+ This skill defines three supported methods for interacting with Kilo:
162
+
163
+ 1. **Gateway API (OpenAI‑compatible SDK)**
164
+ 2. **Local CLI Server (Headless Attach)**
165
+ 3. **Python HTTP Requests to Local Server**
166
+
167
+ Each mode is independent and serves different runtime environments.
168
+
169
+ ---
170
+
171
+ ## **1. Gateway API (SDK / API Key)**
172
+ Use this mode when calling Kilo’s hosted Gateway service.
173
+ Requires a **KILO_API_KEY** and internet access.
174
+
175
+ ### **Client Setup**
176
+ ```python
177
+ import os
178
+ from openai import OpenAI
179
+
180
+ client = OpenAI(
181
+ api_key=os.getenv("KILO_API_KEY"),
182
+ base_url="https://api.kilo.ai/api/gateway",
183
+ )
184
+ ```
185
+
186
+ ### **Completion**
187
+ ```python
188
+ response = client.chat.completions.create(
189
+ model="anthropic/claude-sonnet-4.5",
190
+ messages=[{"role": "user", "content": "Explain quantum entanglement simply."}],
191
+ )
192
+
193
+ print(response.choices[0].message.content)
194
+ ```
195
+
196
+ ### **Streaming**
197
+ ```python
198
+ stream = client.chat.completions.create(
199
+ model="anthropic/claude-sonnet-4.5",
200
+ messages=[{"role": "user", "content": "Write a poem about the ocean."}],
201
+ stream=True,
202
+ )
203
+
204
+ for chunk in stream:
205
+ delta = chunk.choices[0].delta.content
206
+ if delta:
207
+ print(delta, end="", flush=True)
208
+ ```
209
+
210
+ ---
211
+
212
+ ## **2. Local CLI Server (Headless Attach)**
213
+ Use this mode when running Kilo locally for agent development or offline work.
214
+
215
+ ### **Start Local Server**
216
+ ```bash
217
+ KILO_SERVER_PASSWORD=$(openssl rand -hex 16) \
218
+ bun dev serve --port 0 >/tmp/kilo-serve.log 2>&1 &
219
+ echo $! >/tmp/kilo-serve.pid
220
+
221
+ while ! grep -q "kilo server listening" /tmp/kilo-serve.log; do sleep 0.1; done
222
+
223
+ PORT=$(grep -oE "listening on http://[^:]+:[0-9]+" /tmp/kilo-serve.log | grep -oE "[0-9]+$")
224
+ SERVER_URL="http://127.0.0.1:$PORT"
225
+ ```
226
+
227
+ ### **Attach**
228
+ ```bash
229
+ kilo attach "$SERVER_URL" --password "$KILO_SERVER_PASSWORD"
230
+ ```
231
+
232
+ ### **Attach Options**
233
+ - `--dir <path>`
234
+ - `--continue`
235
+ - `--session <id>`
236
+ - `--fork`
237
+ - `--cloud-fork`
238
+ - `--password`
239
+
240
+ ---
241
+
242
+ ## **3. Python HTTP Requests to Local Server**
243
+ Use this mode when you want to call the **local kilo server directly** without the SDK.
244
+
245
+ ### **Example (POST request)**
246
+ ```python
247
+ import requests
248
+
249
+ SERVER_URL = "http://127.0.0.1:PORT" # replace with actual port
250
+
251
+ payload = {
252
+ "model": "anthropic/claude-sonnet-4.5",
253
+ "messages": [
254
+ {"role": "user", "content": "Explain quantum entanglement simply."}
255
+ ]
256
+ }
257
+
258
+ response = requests.post(f"{SERVER_URL}/v1/chat/completions", json=payload)
259
+ print(response.json())
260
+ ```
261
+
262
+ ### **Streaming Example**
263
+ ```python
264
+ import requests
265
+
266
+ with requests.post(
267
+ f"{SERVER_URL}/v1/chat/completions",
268
+ json=payload,
269
+ stream=True,
270
+ ) as r:
271
+ for line in r.iter_lines():
272
+ if line:
273
+ print(line.decode(), flush=True)
274
+ ```
275
+
276
+ ### **Notes**
277
+ - Local server exposes an OpenAI‑compatible API
278
+ - No API key required unless server started with password
279
+ - Ideal for offline or local agent workflows
280
+
281
+ ---
282
+
283
+ ## **Summary Table**
284
+
285
+ | Mode | Description | Auth | Use Case |
286
+ |------|-------------|------|----------|
287
+ | **Gateway API (SDK)** | Cloud endpoint via OpenAI‑compatible SDK | API key | Production, cloud workloads |
288
+ | **CLI Headless** | Attach to local kilo serve | Password (optional) | Local agent runtime |
289
+ | **Python HTTP → Local Server** | Direct HTTP calls to local server | None or password | Offline, custom tooling |
290
+
291
+ ---
292
+
293
+ If you want, I can also generate:
294
+
295
+ - `skill.json`
296
+ - a Python wrapper (`kilo_call()`)
297
+ - a full `/skills/kilo/` folder layout
298
+ - or a minimal version for ARC‑style agent runners.
299
+
300
+ Just tell me which one you want next.
SKILLS/kilo_agent/references/CLI Command Reference.pdf ADDED
Binary file (90.4 kB). View file