@keystrokehq/skills 0.0.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/AGENTS-blurb.md +123 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/keystroke-agent-authoring/SKILL.md +225 -0
- package/keystroke-agent-authoring/evals/evals.json +29 -0
- package/keystroke-agent-authoring/references/messaging-gateways.md +242 -0
- package/keystroke-agent-authoring/references/patterns.md +417 -0
- package/keystroke-agent-authoring/references/prebuilt-integrations.md +879 -0
- package/keystroke-agent-authoring/references/sandbox-and-mcp.md +214 -0
- package/keystroke-agent-authoring/references/source-map.md +182 -0
- package/keystroke-agent-authoring/references/testing.md +85 -0
- package/keystroke-cli-workspace/SKILL.md +93 -0
- package/keystroke-cli-workspace/evals/evals.json +23 -0
- package/keystroke-cli-workspace/references/command-map.md +50 -0
- package/keystroke-cli-workspace/references/credentials-and-connect.md +79 -0
- package/keystroke-cli-workspace/references/project-lifecycle.md +85 -0
- package/keystroke-credential-binding/SKILL.md +509 -0
- package/keystroke-credential-binding/evals/evals.json +29 -0
- package/keystroke-credential-binding/references/cli.md +85 -0
- package/keystroke-credential-binding/references/patterns.md +878 -0
- package/keystroke-credential-binding/references/source-map.md +69 -0
- package/keystroke-data-toolkit/SKILL.md +59 -0
- package/keystroke-data-toolkit/evals/evals.json +23 -0
- package/keystroke-data-toolkit/references/usage.md +79 -0
- package/keystroke-task-authoring/SKILL.md +124 -0
- package/keystroke-task-authoring/evals/evals.json +23 -0
- package/keystroke-task-authoring/references/patterns.md +132 -0
- package/keystroke-task-authoring/references/source-map.md +61 -0
- package/keystroke-trigger-authoring/SKILL.md +189 -0
- package/keystroke-trigger-authoring/evals/evals.json +29 -0
- package/keystroke-trigger-authoring/references/patterns.md +265 -0
- package/keystroke-trigger-authoring/references/source-map.md +128 -0
- package/keystroke-trigger-authoring/references/testing.md +148 -0
- package/keystroke-workflow-as-tool-debugging/SKILL.md +52 -0
- package/keystroke-workflow-as-tool-debugging/evals/evals.json +23 -0
- package/keystroke-workflow-as-tool-debugging/references/playbook.md +77 -0
- package/keystroke-workflow-authoring/SKILL.md +234 -0
- package/keystroke-workflow-authoring/evals/evals.json +29 -0
- package/keystroke-workflow-authoring/references/patterns.md +265 -0
- package/keystroke-workflow-authoring/references/prebuilt-integrations.md +811 -0
- package/keystroke-workflow-authoring/references/runtime-helpers.md +264 -0
- package/keystroke-workflow-authoring/references/source-map.md +108 -0
- package/keystroke-workflow-authoring/references/testing.md +108 -0
- package/package.json +26 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Sandbox And MCP Examples
|
|
2
|
+
|
|
3
|
+
Read this file when the user asks about coding agents, filesystem access, MCP servers, or sandbox setup.
|
|
4
|
+
|
|
5
|
+
Every Keystroke agent already gets a persistent sandbox by default. Create a custom `Sandbox` primitive only when the default sandbox needs customization such as extra dependencies, file sources, setup commands, or runtime options.
|
|
6
|
+
|
|
7
|
+
## Bash and runtime boundary
|
|
8
|
+
|
|
9
|
+
Teach this contrast explicitly:
|
|
10
|
+
- agents can run bash commands when they have the appropriate agent tools and sandbox runtime
|
|
11
|
+
- if an agent needs Python, `jq`, or another binary, that tool must already exist in the sandbox image or be installed through `setupCommands` or runtime preparation
|
|
12
|
+
- if the user needs shell-heavy work, prefer an agent over a workflow or step
|
|
13
|
+
|
|
14
|
+
File layout reminder:
|
|
15
|
+
|
|
16
|
+
- keep each exported sandbox in its own `*.sandbox.ts` file
|
|
17
|
+
- keep each exported MCP server in its own `*.mcp-server.ts` file
|
|
18
|
+
- keep each exported agent in its own `*.agent.ts` file
|
|
19
|
+
- keep any credential set used by an MCP server in its own `*.credential-set.ts` file
|
|
20
|
+
|
|
21
|
+
## `Sandbox`
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { Sandbox } from '@keystrokehq/core';
|
|
25
|
+
|
|
26
|
+
export const repoSandbox = new Sandbox({
|
|
27
|
+
id: 'repo-sandbox',
|
|
28
|
+
name: 'Repo Sandbox',
|
|
29
|
+
description: 'Checks out a repo and prepares it for a coding agent.',
|
|
30
|
+
fileSources: [
|
|
31
|
+
{ type: 'git', url: 'https://github.com/acme/demo-repo.git', branch: 'main' },
|
|
32
|
+
{ type: 'local', path: './fixtures/shared-files' },
|
|
33
|
+
],
|
|
34
|
+
setupCommands: ['pnpm install'],
|
|
35
|
+
runtime: {
|
|
36
|
+
env: {
|
|
37
|
+
NODE_ENV: 'development',
|
|
38
|
+
},
|
|
39
|
+
runCommands: ['pnpm test:unit'],
|
|
40
|
+
workdir: '/workspace/demo-repo',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
What these fields do:
|
|
46
|
+
|
|
47
|
+
- `id`: stable sandbox identifier
|
|
48
|
+
- `name`: human-readable sandbox name
|
|
49
|
+
- `description`: what the sandbox is for
|
|
50
|
+
- `fileSources`: files or repos to place into the sandbox
|
|
51
|
+
- `setupCommands`: commands to prepare the environment
|
|
52
|
+
- `runtime.env`: environment variables inside the sandbox runtime
|
|
53
|
+
- `runtime.runCommands`: commands the runtime may execute
|
|
54
|
+
- `runtime.workdir`: default working directory in the sandbox
|
|
55
|
+
|
|
56
|
+
## `Agent` with `sandbox`
|
|
57
|
+
|
|
58
|
+
This example reuses `repoSandbox` from the previous snippet.
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { anthropic } from '@keystroke/integration-ai';
|
|
62
|
+
import { Agent } from '@keystrokehq/core';
|
|
63
|
+
|
|
64
|
+
export const codingAgent = new Agent({
|
|
65
|
+
id: 'coding-agent',
|
|
66
|
+
name: 'Coding Agent',
|
|
67
|
+
systemPrompt: 'Inspect the repo, make the requested change, and explain the result.',
|
|
68
|
+
model: 'anthropic/claude-sonnet-4-20250514',
|
|
69
|
+
credentialSets: [anthropic],
|
|
70
|
+
sandbox: repoSandbox,
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Use this shape when the default persistent sandbox is not enough and the agent should work inside a prepared project or coding environment.
|
|
75
|
+
|
|
76
|
+
## `McpServer` with `stdio` transport
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { McpServer } from '@keystrokehq/core';
|
|
80
|
+
|
|
81
|
+
export const localDocsServer = new McpServer({
|
|
82
|
+
id: 'local-docs',
|
|
83
|
+
name: 'Local Docs',
|
|
84
|
+
transport: {
|
|
85
|
+
type: 'stdio',
|
|
86
|
+
command: 'node',
|
|
87
|
+
args: ['./scripts/mcp-docs-server.js'],
|
|
88
|
+
env: {
|
|
89
|
+
DOCS_ROOT: '/workspace/docs',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Use `stdio` transport when the MCP server is started as a local process.
|
|
96
|
+
|
|
97
|
+
## `McpServer` with `http` transport
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
const remoteHttpServer = new McpServer({
|
|
101
|
+
id: 'remote-http',
|
|
102
|
+
transport: {
|
|
103
|
+
type: 'http',
|
|
104
|
+
url: 'https://mcp.example.com',
|
|
105
|
+
headers: {
|
|
106
|
+
Authorization: 'Bearer static-token',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Use `http` transport when the MCP server is available at a normal HTTP endpoint.
|
|
113
|
+
|
|
114
|
+
## `McpServer` with `sse` transport
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const remoteSseServer = new McpServer({
|
|
118
|
+
id: 'remote-sse',
|
|
119
|
+
transport: {
|
|
120
|
+
type: 'sse',
|
|
121
|
+
url: 'https://mcp.example.com/sse',
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Use `sse` transport when the MCP server communicates over server-sent events.
|
|
127
|
+
|
|
128
|
+
## `McpServer` with credentials
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
import { CredentialSet, McpServer } from '@keystrokehq/core';
|
|
132
|
+
import { z } from 'zod';
|
|
133
|
+
|
|
134
|
+
const apiCredentials = new CredentialSet({
|
|
135
|
+
id: 'mcpApi',
|
|
136
|
+
auth: z.object({
|
|
137
|
+
token: z.string(),
|
|
138
|
+
}),
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export const securedServer = new McpServer({
|
|
142
|
+
id: 'secured-server',
|
|
143
|
+
transport: {
|
|
144
|
+
type: 'http',
|
|
145
|
+
url: 'https://mcp.example.com',
|
|
146
|
+
},
|
|
147
|
+
credentialSets: [apiCredentials],
|
|
148
|
+
credentialMapper: (credentials) => ({
|
|
149
|
+
headers: {
|
|
150
|
+
Authorization: `Bearer ${credentials.mcpApi.token}`,
|
|
151
|
+
},
|
|
152
|
+
}),
|
|
153
|
+
});
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`credentialMapper` is where typed Keystroke credentials are converted into the transport configuration the MCP server needs, such as headers or env vars.
|
|
157
|
+
|
|
158
|
+
## `Agent` with `mcpServers`
|
|
159
|
+
|
|
160
|
+
This example reuses `localDocsServer` and `securedServer` from the previous snippets.
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
import { anthropic } from '@keystroke/integration-ai';
|
|
164
|
+
import { Agent } from '@keystrokehq/core';
|
|
165
|
+
|
|
166
|
+
export const docsAgent = new Agent({
|
|
167
|
+
id: 'docs-agent',
|
|
168
|
+
name: 'Docs Agent',
|
|
169
|
+
systemPrompt: 'Use the MCP server before answering documentation questions.',
|
|
170
|
+
model: 'anthropic/claude-sonnet-4-20250514',
|
|
171
|
+
credentialSets: [anthropic],
|
|
172
|
+
mcpServers: [localDocsServer, securedServer],
|
|
173
|
+
maxSteps: 8,
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Use `mcpServers` when the agent should use MCP-exposed capabilities instead of only normal tools.
|
|
178
|
+
|
|
179
|
+
## `Sandbox.configure(...)`
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
const ciSandbox = repoSandbox.configure({
|
|
183
|
+
name: 'Repo Sandbox CI',
|
|
184
|
+
setupCommands: ['pnpm install', 'pnpm build'],
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Use `configure(...)` to create a new sandbox instance with adjusted metadata or runtime setup.
|
|
189
|
+
|
|
190
|
+
## `McpServer.configure(...)`
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
const renamedServer = securedServer.configure({
|
|
194
|
+
name: 'Secured Docs Server',
|
|
195
|
+
description: 'Authenticated MCP docs endpoint.',
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Use `configure(...)` to create a new MCP server instance with adjusted metadata.
|
|
200
|
+
|
|
201
|
+
## `describe()` and `toManifest()`
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
const sandboxSummary = repoSandbox.describe();
|
|
205
|
+
const sandboxManifest = repoSandbox.toManifest();
|
|
206
|
+
const serverSummary = securedServer.describe();
|
|
207
|
+
const serverManifest = securedServer.toManifest();
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Gotchas
|
|
211
|
+
|
|
212
|
+
- Do not add both normal tools and MCP servers unless the task genuinely needs both.
|
|
213
|
+
- Put sandbox details on the sandbox or agent config, not inside the system prompt.
|
|
214
|
+
- Keep workflow orchestration outside the agent.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Agent Feature Map
|
|
2
|
+
|
|
3
|
+
Use only the public imports a user repo can rely on:
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { anthropic } from '@keystroke/integration-ai';
|
|
7
|
+
import {
|
|
8
|
+
Agent,
|
|
9
|
+
CredentialSet,
|
|
10
|
+
McpServer,
|
|
11
|
+
MessagingGateway,
|
|
12
|
+
Operation,
|
|
13
|
+
Sandbox,
|
|
14
|
+
Tool,
|
|
15
|
+
} from '@keystrokehq/core';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`Operation`, `Step`, and `Tool` are aliases for the same class. In this agent skill, prefer `Tool` for custom examples and explanations, but `Operation` is equally valid for shared or integration-oriented code.
|
|
19
|
+
|
|
20
|
+
## `Agent` fields
|
|
21
|
+
|
|
22
|
+
- `id`
|
|
23
|
+
- `name`
|
|
24
|
+
- `description`
|
|
25
|
+
- `systemPrompt`
|
|
26
|
+
- `model`
|
|
27
|
+
- `sandbox`
|
|
28
|
+
- `skills`
|
|
29
|
+
- `tools`
|
|
30
|
+
- `credentialSets`
|
|
31
|
+
- `mcpServers`
|
|
32
|
+
- `maxSteps`
|
|
33
|
+
- `hooks`
|
|
34
|
+
|
|
35
|
+
### What they are used for
|
|
36
|
+
|
|
37
|
+
- `id`: stable agent identifier
|
|
38
|
+
- `name`: human-readable name
|
|
39
|
+
- `description`: short explanation of the agent's job
|
|
40
|
+
- `systemPrompt`: operating instructions for the model
|
|
41
|
+
- `model`: model selector
|
|
42
|
+
- `sandbox`: attach a sandbox runtime
|
|
43
|
+
- `skills`: make skills available to the agent runtime
|
|
44
|
+
- `tools`: attach operations
|
|
45
|
+
- `credentialSets`: credentials the agent itself needs
|
|
46
|
+
- `mcpServers`: attach MCP servers
|
|
47
|
+
- `maxSteps`: limit tool/model turns
|
|
48
|
+
- `hooks`: observe or gate tool and step execution
|
|
49
|
+
|
|
50
|
+
## Raw `Agent` fields
|
|
51
|
+
|
|
52
|
+
- `id`
|
|
53
|
+
- `name`
|
|
54
|
+
- `description`
|
|
55
|
+
- `systemPrompt`
|
|
56
|
+
- `model`
|
|
57
|
+
- `input`
|
|
58
|
+
- `output`
|
|
59
|
+
- `credentialSets`
|
|
60
|
+
- `tools`
|
|
61
|
+
- `mcpServers`
|
|
62
|
+
- `sandbox`
|
|
63
|
+
- `skills`
|
|
64
|
+
- `maxSteps`
|
|
65
|
+
- `hooks`
|
|
66
|
+
- `run`
|
|
67
|
+
- `stream`
|
|
68
|
+
|
|
69
|
+
## `Agent` instance properties and methods
|
|
70
|
+
|
|
71
|
+
- `credentialSets`
|
|
72
|
+
- `allCredentialSets`
|
|
73
|
+
- `tools`
|
|
74
|
+
- `mcpServers`
|
|
75
|
+
- `sandbox`
|
|
76
|
+
- `messaging`
|
|
77
|
+
- `skills`
|
|
78
|
+
- `maxSteps`
|
|
79
|
+
- `hooks`
|
|
80
|
+
- `runtimeKind`
|
|
81
|
+
- `workflowSafeReference`
|
|
82
|
+
- `run(input, options?)`
|
|
83
|
+
- `stream(input, options?)`
|
|
84
|
+
- `configure(overrides)`
|
|
85
|
+
- `describe()`
|
|
86
|
+
- `toManifest()`
|
|
87
|
+
|
|
88
|
+
### What they are used for
|
|
89
|
+
|
|
90
|
+
- `credentialSets`: credentials attached directly to the agent
|
|
91
|
+
- `allCredentialSets`: combined credential surface from the agent, its tools, its MCP servers, and its messaging gateways
|
|
92
|
+
- `messaging`: `MessagingGateway[]` conversational entry configuration
|
|
93
|
+
- `runtimeKind`: whether the agent is declarative-only or has `run` / `stream` implementations
|
|
94
|
+
- `workflowSafeReference`: stable reference shape used by other primitives such as `Task`
|
|
95
|
+
- `run(...)`: execute the agent and return an `AgentResult`
|
|
96
|
+
- `stream(...)`: stream `AgentEvent` values during execution
|
|
97
|
+
- `configure(...)`: create a new agent instance with changed metadata or hooks
|
|
98
|
+
- `describe()`: return a human-readable summary string
|
|
99
|
+
- `toManifest()`: return the agent manifest description
|
|
100
|
+
|
|
101
|
+
## `Operation` / `Tool` fields
|
|
102
|
+
|
|
103
|
+
- `name`
|
|
104
|
+
- `description`
|
|
105
|
+
- `input`
|
|
106
|
+
- `output`
|
|
107
|
+
- `needsApproval`
|
|
108
|
+
- `credentialSets`
|
|
109
|
+
- `workflowGlobals`
|
|
110
|
+
- `run`
|
|
111
|
+
|
|
112
|
+
## `Operation` / `Tool` instance methods
|
|
113
|
+
|
|
114
|
+
- `run(input, ctx?)`
|
|
115
|
+
- `withTimeout(duration)`
|
|
116
|
+
- `retry(policy)`
|
|
117
|
+
- `configure(overrides)`
|
|
118
|
+
- `mapInput(schema, fn)`
|
|
119
|
+
- `mapOutput(schema, fn)`
|
|
120
|
+
- `describe()`
|
|
121
|
+
- `toManifest()`
|
|
122
|
+
|
|
123
|
+
## `MessagingGateway` fields
|
|
124
|
+
|
|
125
|
+
- `id`
|
|
126
|
+
- `name`
|
|
127
|
+
- `description`
|
|
128
|
+
- `provider`
|
|
129
|
+
- `mode`
|
|
130
|
+
- `credentialSet`
|
|
131
|
+
- `credentialScope`
|
|
132
|
+
- `appRef`
|
|
133
|
+
|
|
134
|
+
## `MessagingGateway` instance methods
|
|
135
|
+
|
|
136
|
+
- `describe()`
|
|
137
|
+
- `toManifest()`
|
|
138
|
+
|
|
139
|
+
## Messaging notes
|
|
140
|
+
|
|
141
|
+
- `MessagingGateway` belongs on `Agent.messaging`
|
|
142
|
+
- gateways are conversation entrypoints, not workflow triggers
|
|
143
|
+
- default to `mode: 'platform'` (Keystroke-owned app the user installs) unless the user explicitly wants a custom app
|
|
144
|
+
- use `mode: 'custom'` with `appRef` only when the user creates or manages their own app
|
|
145
|
+
- use the agent skill plus `messaging-gateways.md` when the user asks for Slack, GitHub, or Linear conversational agent entry
|
|
146
|
+
|
|
147
|
+
## `Sandbox` fields
|
|
148
|
+
|
|
149
|
+
- `id`
|
|
150
|
+
- `name`
|
|
151
|
+
- `description`
|
|
152
|
+
- `runtime`
|
|
153
|
+
- `fileSources`
|
|
154
|
+
- `setupCommands`
|
|
155
|
+
|
|
156
|
+
## `Sandbox` instance methods
|
|
157
|
+
|
|
158
|
+
- `configure(overrides)`
|
|
159
|
+
- `describe()`
|
|
160
|
+
- `toManifest()`
|
|
161
|
+
|
|
162
|
+
## `McpServer` fields
|
|
163
|
+
|
|
164
|
+
- `id`
|
|
165
|
+
- `name`
|
|
166
|
+
- `description`
|
|
167
|
+
- `transport`
|
|
168
|
+
- `credentialSets`
|
|
169
|
+
- `credentialMapper`
|
|
170
|
+
|
|
171
|
+
## `McpServer` instance methods
|
|
172
|
+
|
|
173
|
+
- `configure(overrides)`
|
|
174
|
+
- `describe()`
|
|
175
|
+
- `toManifest()`
|
|
176
|
+
|
|
177
|
+
## Where to read next
|
|
178
|
+
|
|
179
|
+
- `patterns.md` for agent, raw `Agent`, and `Tool` / `Operation` examples
|
|
180
|
+
- `messaging-gateways.md` for gateway-specific examples
|
|
181
|
+
- `sandbox-and-mcp.md` for `Sandbox`, `McpServer`, bash/runtime setup, and hook examples
|
|
182
|
+
- `testing.md` for agent and tool test patterns
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Agent Testing Patterns
|
|
2
|
+
|
|
3
|
+
Read this file when the user asks how to test Keystroke agents or tools.
|
|
4
|
+
|
|
5
|
+
## What to test
|
|
6
|
+
|
|
7
|
+
Default testing targets:
|
|
8
|
+
- tool input and output behavior
|
|
9
|
+
- credential access in tools
|
|
10
|
+
- agent construction and configuration
|
|
11
|
+
- gateway wiring when an agent uses `messaging`
|
|
12
|
+
- sandbox or MCP setup when the authored config depends on them
|
|
13
|
+
|
|
14
|
+
## Vitest setup
|
|
15
|
+
|
|
16
|
+
`keystrokeTestPlugin()` adds the core test setup file to Vitest, which is required for credential resolution and sandbox mocks.
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { defineConfig } from 'vitest/config';
|
|
20
|
+
import { keystrokeTestPlugin } from '@keystrokehq/core/vitest';
|
|
21
|
+
|
|
22
|
+
export default defineConfig({
|
|
23
|
+
plugins: [keystrokeTestPlugin()],
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Test tools directly
|
|
28
|
+
|
|
29
|
+
For testing tools in isolation, use the specialized `runTool` helper from `@keystrokehq/core/vitest` which automatically creates the appropriate tool context.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { runTool } from '@keystrokehq/core/vitest';
|
|
33
|
+
|
|
34
|
+
const result = await runTool(
|
|
35
|
+
lookupCustomerTool,
|
|
36
|
+
{ email: 'user@example.com' },
|
|
37
|
+
{
|
|
38
|
+
credentials: {
|
|
39
|
+
crmApi: {
|
|
40
|
+
apiKey: 'secret',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Test agent construction
|
|
48
|
+
|
|
49
|
+
For many agent changes, the high-value test is verifying the configured agent surface:
|
|
50
|
+
- `id`
|
|
51
|
+
- `model`
|
|
52
|
+
- `tools`
|
|
53
|
+
- `credentialSets`
|
|
54
|
+
- `allCredentialSets`
|
|
55
|
+
- `messaging`
|
|
56
|
+
- `sandbox`
|
|
57
|
+
- `mcpServers`
|
|
58
|
+
|
|
59
|
+
This is especially useful when the task is about wiring rather than full runtime execution.
|
|
60
|
+
|
|
61
|
+
## Test prompt shaping separately
|
|
62
|
+
|
|
63
|
+
If the agent depends on complex prompt assembly, test the prompt-building helpers directly instead of overfitting a full model-runtime test.
|
|
64
|
+
|
|
65
|
+
## Test sandbox or MCP config
|
|
66
|
+
|
|
67
|
+
When the change is about runtime configuration, assert the authored configuration rather than trying to reproduce the full hosted runtime:
|
|
68
|
+
- sandbox `runtime`
|
|
69
|
+
- sandbox `setupCommands`
|
|
70
|
+
- MCP transport shape
|
|
71
|
+
- MCP credential mapper behavior
|
|
72
|
+
|
|
73
|
+
## Gateway tests
|
|
74
|
+
|
|
75
|
+
When an agent uses `messaging`, test:
|
|
76
|
+
- the gateway config fields
|
|
77
|
+
- the chosen `provider`
|
|
78
|
+
- the chosen `mode`
|
|
79
|
+
- credential scope or `appRef` when relevant
|
|
80
|
+
|
|
81
|
+
## Gotchas
|
|
82
|
+
|
|
83
|
+
- Do not invent an unrelated custom harness if direct primitive tests are enough.
|
|
84
|
+
- Test custom tools directly before reaching for a full agent runtime test.
|
|
85
|
+
- Keep workflow-orchestration tests in the workflow skill.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: keystroke-cli-workspace
|
|
3
|
+
description: Use the Keystroke CLI to initialize projects, inspect commands, build workflows, deploy workflows or tasks, manage credentials, connect integrations, and debug authoring work. Use when the user needs Keystroke CLI usage or project lifecycle guidance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Keystroke CLI Workspace
|
|
7
|
+
|
|
8
|
+
Use this skill when an agent needs to use the Keystroke CLI while authoring or operating a Keystroke project.
|
|
9
|
+
|
|
10
|
+
This skill is operational and procedural:
|
|
11
|
+
- use it for project setup, build, validate, deploy, connect, credentials, logs, and skills sync
|
|
12
|
+
- use the workflow, agent, task, and trigger skills for the authored code itself
|
|
13
|
+
|
|
14
|
+
## First rule: inspect `--help`
|
|
15
|
+
|
|
16
|
+
Before running a Keystroke CLI command, inspect the live command surface first.
|
|
17
|
+
|
|
18
|
+
Teach this as a hard rule:
|
|
19
|
+
- run `keystroke --help` before exploring the CLI
|
|
20
|
+
- run `keystroke <command> --help` before using a specific command
|
|
21
|
+
- run `keystroke <command> <subcommand> --help` before using a nested command
|
|
22
|
+
- treat `--help` as the source of truth for supported flags and subcommands
|
|
23
|
+
|
|
24
|
+
Common examples:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
keystroke --help
|
|
28
|
+
keystroke workflows --help
|
|
29
|
+
keystroke deploy --help
|
|
30
|
+
keystroke credentials upload --help
|
|
31
|
+
keystroke connect --help
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## What the CLI is for
|
|
35
|
+
|
|
36
|
+
Teach the CLI as the operational companion to authored code:
|
|
37
|
+
- initialize a project
|
|
38
|
+
- inspect and validate workflows
|
|
39
|
+
- deploy workflows, agents, and tasks
|
|
40
|
+
- connect official integrations
|
|
41
|
+
- inspect and upload credentials
|
|
42
|
+
- sync Keystroke-authored skills into local IDE skill directories
|
|
43
|
+
|
|
44
|
+
The CLI does not replace primitive authoring:
|
|
45
|
+
- workflow code still lives in workflow and step files
|
|
46
|
+
- agent code still lives in agent and tool files
|
|
47
|
+
- trigger, task, and messaging-gateway code still live in authored project files
|
|
48
|
+
|
|
49
|
+
## Command groups to teach
|
|
50
|
+
|
|
51
|
+
Teach these groups first:
|
|
52
|
+
- `auth`
|
|
53
|
+
- `api-keys`
|
|
54
|
+
- `org`
|
|
55
|
+
- `init`
|
|
56
|
+
- `projects`
|
|
57
|
+
- `connect`
|
|
58
|
+
- `credentials`
|
|
59
|
+
- `workflows`
|
|
60
|
+
- `deploy`
|
|
61
|
+
- `sync`
|
|
62
|
+
- `skills`
|
|
63
|
+
- `logs`
|
|
64
|
+
|
|
65
|
+
Important distinctions:
|
|
66
|
+
- `keystroke deploy` is the unified project deployment flow for workflows, agents, and tasks
|
|
67
|
+
- `keystroke deploy --target <file>` deploys a focused workflow, agent, or task source file
|
|
68
|
+
- `keystroke logs` is CLI diagnostics
|
|
69
|
+
- `keystroke workflows logs` is workflow run inspection
|
|
70
|
+
|
|
71
|
+
## Default CLI process
|
|
72
|
+
|
|
73
|
+
1. Inspect the command with `--help`.
|
|
74
|
+
2. Initialize the project if needed.
|
|
75
|
+
3. Build or validate authored workflows.
|
|
76
|
+
4. Check credentials or connect integrations when required.
|
|
77
|
+
5. Deploy the project or focused target with the right command.
|
|
78
|
+
6. Use logs and inspect commands for debugging.
|
|
79
|
+
|
|
80
|
+
## CLI rules
|
|
81
|
+
|
|
82
|
+
- Prefer exact commands shown by `--help` over stale prose or memory.
|
|
83
|
+
- Use `--json` when machine-readable output helps the current task.
|
|
84
|
+
- Use `keystroke connect <integration>` for official integration connection flows.
|
|
85
|
+
- Use `keystroke credentials ...` for credential inspection and upload flows.
|
|
86
|
+
- Use `keystroke skills sync` to copy `@keystrokehq/skills` into local editor skill directories.
|
|
87
|
+
|
|
88
|
+
## References
|
|
89
|
+
|
|
90
|
+
Read these files as needed:
|
|
91
|
+
- `references/command-map.md` for the command tree
|
|
92
|
+
- `references/project-lifecycle.md` for common setup, build, deploy, and debug flows
|
|
93
|
+
- `references/credentials-and-connect.md` for connection and credential workflows
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "keystroke-cli-workspace",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "I need to deploy a Keystroke task. What command should I use, and how should I inspect the available flags before running it?",
|
|
7
|
+
"expected_output": "Uses the CLI skill, chooses `keystroke deploy --target <task.task.ts>`, and tells the agent to inspect `keystroke deploy --help` first.",
|
|
8
|
+
"files": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 2,
|
|
12
|
+
"prompt": "How do I set up a new Keystroke project and make the Keystroke-authored skills available in Cursor?",
|
|
13
|
+
"expected_output": "Uses `keystroke init`, explains `keystroke skills sync`, and tells the agent to inspect command help first.",
|
|
14
|
+
"files": []
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": 3,
|
|
18
|
+
"prompt": "I need to figure out which CLI options exist for uploading credentials. What should I do before running the upload command?",
|
|
19
|
+
"expected_output": "Explicitly uses `keystroke credentials upload --help` before describing the upload flow.",
|
|
20
|
+
"files": []
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Keystroke CLI Command Map
|
|
2
|
+
|
|
3
|
+
Use this file when the user needs a quick map of the Keystroke CLI surface.
|
|
4
|
+
|
|
5
|
+
## Root rule
|
|
6
|
+
|
|
7
|
+
Always inspect the live command surface first:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
keystroke --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Then inspect the exact command:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
keystroke workflows --help
|
|
17
|
+
keystroke deploy --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Global flags
|
|
21
|
+
|
|
22
|
+
Global flags are defined at the root program and include:
|
|
23
|
+
- `--api-key`
|
|
24
|
+
- `--server-url`
|
|
25
|
+
- `--org`
|
|
26
|
+
- `--debug`
|
|
27
|
+
|
|
28
|
+
Root help shows these directly. Subcommand help focuses on the local flags for that command.
|
|
29
|
+
|
|
30
|
+
## Command groups
|
|
31
|
+
|
|
32
|
+
- `auth`: sign in, clear credentials, inspect auth status
|
|
33
|
+
- `api-keys`: list and delete API keys
|
|
34
|
+
- `org`: list, inspect, and switch organization context
|
|
35
|
+
- `init`: initialize a Keystroke project
|
|
36
|
+
- `projects`: inspect cached project state
|
|
37
|
+
- `connect`: connect official integrations through OAuth
|
|
38
|
+
- `credentials`: list requirements and upload credentials
|
|
39
|
+
- `workflows`: build, validate, inspect, diff, env, logs, paused, try-deploy
|
|
40
|
+
- `test`: test workflows and agent-callable tools
|
|
41
|
+
- `deploy`: deploy workflows, agents, tasks, or focused targets via `--target <file>`
|
|
42
|
+
- `sync`: local sync operations
|
|
43
|
+
- `skills`: Keystroke skills sync flows
|
|
44
|
+
- `logs`: CLI diagnostic logs
|
|
45
|
+
|
|
46
|
+
## Command notes
|
|
47
|
+
|
|
48
|
+
- `keystroke workflows logs` is different from `keystroke logs`
|
|
49
|
+
- `keystroke deploy --target <file>` is the focused deploy path
|
|
50
|
+
- many commands support `--json`
|