create-theokit 1.11.1 → 1.11.2
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/package.json +1 -1
- package/templates/default/agents/skills/daily-briefing.ts +3 -3
- package/templates/default/docs/ARCHITECTURE.md +3 -3
- package/templates/default/docs/CUSTOMIZATION.md +1 -1
- package/templates/default/dot-claude/skills/theokit-agents/SKILL.md +2 -2
- package/templates/default/package.json.tmpl +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Skill } from '@theokit/sdk'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* A real, code-defined skill (`
|
|
4
|
+
* A real, code-defined skill (`Skill.create`) — a documented procedure the MODEL can pull in on demand.
|
|
5
5
|
*
|
|
6
6
|
* Unlike a loose Markdown note, this is wired into the agent: `agents/chat.ts` passes it to
|
|
7
7
|
* `.skills([dailyBriefingSkill])`. That one call lists the skill's name + description in a `<skills>`
|
|
@@ -10,7 +10,7 @@ import { createSkill } from '@theokit/sdk'
|
|
|
10
10
|
*
|
|
11
11
|
* Lives in `agents/skills/` — a semantic folder the route scanner skips, so it never becomes an endpoint.
|
|
12
12
|
*/
|
|
13
|
-
export const dailyBriefingSkill =
|
|
13
|
+
export const dailyBriefingSkill = Skill.create({
|
|
14
14
|
name: 'daily-briefing',
|
|
15
15
|
description:
|
|
16
16
|
"Produce a short 'good morning' briefing (today's date, the weather, and a one-line nudge).",
|
|
@@ -15,7 +15,7 @@ folders it composes (prompts, tools, skills) live together under `agents/`, with
|
|
|
15
15
|
│ ├── tools/ # tools the agent can call
|
|
16
16
|
│ │ ├── weather.ts # remote — current weather via open-meteo (HTTP)
|
|
17
17
|
│ │ └── current-time.ts # local — date/time in an IANA timezone (no network)
|
|
18
|
-
│ └── skills/ # procedures the model loads on demand (
|
|
18
|
+
│ └── skills/ # procedures the model loads on demand (Skill.create)
|
|
19
19
|
│ └── daily-briefing.ts # a real skill: time → weather → a one-line nudge
|
|
20
20
|
├── app/ # Frontend (web surface). tui → tui/, desktop → frontend/
|
|
21
21
|
│ ├── page.tsx # the `/` route — composition root (lays out the components + the hook)
|
|
@@ -59,13 +59,13 @@ export default agent()
|
|
|
59
59
|
.system(BASE_INSTRUCTIONS) // agents/prompts/instructions.ts
|
|
60
60
|
.tool(weatherTool) // agents/tools/weather.ts
|
|
61
61
|
.tool(currentTimeTool) // agents/tools/current-time.ts
|
|
62
|
-
.
|
|
62
|
+
.skills([dailyBriefingSkill]) // agents/skills/daily-briefing.ts
|
|
63
63
|
.build()
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
Grow the agent by editing its neighbours, not by inflating `chat.ts`: persona → `prompts/instructions.ts`,
|
|
67
67
|
a new capability → `tools/<name>.ts` (then `.tool(<name>Tool)`), a documented procedure → a
|
|
68
|
-
`
|
|
68
|
+
`Skill.create(...)` in `skills/<name>.ts` (add it to the `.skills([...])` list). A **skill** is
|
|
69
69
|
loaded by the model on demand via the `skill_read` tool, so long procedures don't bloat every prompt. Add a
|
|
70
70
|
**second agent** as another `agents/<name>.ts`.
|
|
71
71
|
|
|
@@ -7,7 +7,7 @@ Common changes, and where they go. See [ARCHITECTURE](./ARCHITECTURE.md) for the
|
|
|
7
7
|
| Change the model | `agents/chat.ts` (`.model(...)`) + the label in `shared/agent.ts` |
|
|
8
8
|
| Change the persona / rules | `agents/prompts/instructions.ts` |
|
|
9
9
|
| Add a tool (an action the agent can take) | new `agents/tools/<name>.ts`, then `.tool(<name>Tool)` in `agents/chat.ts` |
|
|
10
|
-
| Add a skill (a procedure the model loads on demand) | `
|
|
10
|
+
| Add a skill (a procedure the model loads on demand) | `Skill.create(...)` in `agents/skills/<name>.ts`, then add it to `.skills([...])` in `agents/chat.ts` |
|
|
11
11
|
| Add a second agent | new `agents/<name>.ts` → auto-served at `/api/agents/<name>`, bind with `useAgent('<name>')` |
|
|
12
12
|
| Change the greeting / app name | `shared/agent.ts` |
|
|
13
13
|
| Add a backend route | `server/routes/<name>.ts` |
|
|
@@ -156,12 +156,12 @@ Before writing custom tools, check if they already exist:
|
|
|
156
156
|
|
|
157
157
|
| Package | What it provides | When to use |
|
|
158
158
|
|---------|-----------------|-------------|
|
|
159
|
-
| `@theokit/sdk` | `Agent.create()`, `
|
|
159
|
+
| `@theokit/sdk` | `Agent.create()`, `Tool.create()` (primitive), `Run.stream()` | Core agent runtime — always installed |
|
|
160
160
|
| `@theokit/sdk-tools` | Ready-made tools: `createReadFileTool`, `createWriteFileTool`, `createSearchTextTool`, `createGlobTool`, `createShellTool`, etc. | **Check here FIRST** before writing custom tools for coding agents |
|
|
161
161
|
| `@theokit/di-agent` | DI-powered agent with decorator injection | When using dependency injection pattern |
|
|
162
162
|
| `@theokit/di` | Core DI container (`@Injectable`, `@Inject`) | When `@theokit/di-agent` needs explicit bindings |
|
|
163
163
|
|
|
164
|
-
**`
|
|
164
|
+
**`Tool.create()` in `@theokit/sdk` is the primitive API.** For coding agents, `@theokit/sdk-tools` has batteries-included tools that wrap `Tool.create()` with file system access, search, shell execution, etc. Don't reimplement what `sdk-tools` already provides.
|
|
165
165
|
|
|
166
166
|
## Rules
|
|
167
167
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"typecheck": "tsc --noEmit"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"theokit": "^0.
|
|
19
|
-
"@theokit/agents": "^0.
|
|
18
|
+
"theokit": "^0.40.0",
|
|
19
|
+
"@theokit/agents": "^0.39.0",
|
|
20
20
|
"@theokit/sdk": "^2.25.0",
|
|
21
21
|
"@theokit/ui": "^1.0.0",
|
|
22
22
|
"@usetheo/ui": "^0.14.0",
|