@ogkranthi/agentshift 0.1.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.
- package/.github/CODEOWNERS +25 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +93 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +54 -0
- package/.github/ISSUE_TEMPLATE/platform_request.yml +55 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +53 -0
- package/.github/SETUP.md +65 -0
- package/.github/workflows/ci.yml +85 -0
- package/AGENTS.md +68 -0
- package/BACKLOG.md +55 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +136 -0
- package/LICENSE +201 -0
- package/README.md +112 -0
- package/SECURITY.md +42 -0
- package/bin/agentshift.js +4 -0
- package/examples/pregnancy-companion/AGENTS.md +212 -0
- package/examples/pregnancy-companion/BOOTSTRAP.md +55 -0
- package/examples/pregnancy-companion/SKILL.md +88 -0
- package/examples/pregnancy-companion/data/appointments.md +5 -0
- package/examples/pregnancy-companion/data/questions-for-doctor.md +7 -0
- package/examples/pregnancy-companion/data/symptoms-log.md +5 -0
- package/examples/pregnancy-companion/data/weight-log.md +6 -0
- package/examples/pregnancy-companion/knowledge/appointments.md +122 -0
- package/examples/pregnancy-companion/knowledge/exercise.md +114 -0
- package/examples/pregnancy-companion/knowledge/nutrition.md +112 -0
- package/examples/pregnancy-companion/knowledge/warning-signs.md +80 -0
- package/examples/pregnancy-companion/knowledge/week-by-week.md +198 -0
- package/index.js +4 -0
- package/package.json +18 -0
- package/pyproject.toml +72 -0
- package/specs/claude-code-format.md +397 -0
- package/specs/ir-schema.json +438 -0
- package/specs/ir-schema.md +370 -0
- package/specs/openclaw-skill-format.md +483 -0
- package/src/agentshift/__init__.py +3 -0
- package/src/agentshift/cli.py +44 -0
- package/src/agentshift/emitters/__init__.py +1 -0
- package/src/agentshift/ir.py +134 -0
- package/src/agentshift/parsers/__init__.py +1 -0
- package/tests/__init__.py +0 -0
- package/tests/fixtures/pregnancy-companion/AGENTS.md +212 -0
- package/tests/fixtures/pregnancy-companion/BOOTSTRAP.md +55 -0
- package/tests/fixtures/pregnancy-companion/SKILL.md +88 -0
- package/tests/fixtures/pregnancy-companion/data/appointments.md +5 -0
- package/tests/fixtures/pregnancy-companion/data/questions-for-doctor.md +7 -0
- package/tests/fixtures/pregnancy-companion/data/symptoms-log.md +5 -0
- package/tests/fixtures/pregnancy-companion/data/weight-log.md +6 -0
- package/tests/fixtures/pregnancy-companion/knowledge/appointments.md +122 -0
- package/tests/fixtures/pregnancy-companion/knowledge/exercise.md +114 -0
- package/tests/fixtures/pregnancy-companion/knowledge/nutrition.md +112 -0
- package/tests/fixtures/pregnancy-companion/knowledge/warning-signs.md +80 -0
- package/tests/fixtures/pregnancy-companion/knowledge/week-by-week.md +198 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# AgentShift IR — Intermediate Representation Schema
|
|
2
|
+
|
|
3
|
+
**File:** `specs/ir-schema.json`
|
|
4
|
+
**Version:** 1.0
|
|
5
|
+
**Status:** Canonical
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Purpose
|
|
10
|
+
|
|
11
|
+
The IR is the universal agent model that sits between all parsers and emitters in AgentShift. Every source parser (OpenClaw, Claude Code, Copilot, Bedrock, Vertex AI) converts its native format into an IR. Every emitter converts IR into the target platform's native format.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
OpenClaw SKILL.md ──┐
|
|
15
|
+
Claude Code CLAUDE.md ─┤ ┌─► OpenClaw SKILL.md
|
|
16
|
+
Copilot manifest ──┤──► IR (JSON) ──►─┤── Claude Code SKILL.md
|
|
17
|
+
Bedrock instruction ┤ └─► Copilot manifest
|
|
18
|
+
Vertex AI config ──┘ Bedrock instruction
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Top-Level Fields
|
|
24
|
+
|
|
25
|
+
| Field | Type | Required | Description |
|
|
26
|
+
|-------|------|----------|-------------|
|
|
27
|
+
| `ir_version` | `"1.0"` | ✅ | Always `"1.0"` |
|
|
28
|
+
| `name` | string | ✅ | Slug identifier. Lowercase + hyphens. e.g. `pregnancy-companion` |
|
|
29
|
+
| `description` | string | ✅ | What the agent does. Used as skill trigger text in OpenClaw/Claude Code |
|
|
30
|
+
| `version` | string | — | Semver of this agent definition. Default `"1.0.0"` |
|
|
31
|
+
| `author` | string | — | Author/owner |
|
|
32
|
+
| `homepage` | URI | — | Docs or tool homepage |
|
|
33
|
+
| `persona` | object | — | System prompt + personality |
|
|
34
|
+
| `tools` | array | — | Capabilities available to the agent |
|
|
35
|
+
| `knowledge` | array | — | Knowledge sources |
|
|
36
|
+
| `triggers` | array | — | Cron, webhook, message, or event triggers |
|
|
37
|
+
| `constraints` | object | — | Platform limits and guardrails |
|
|
38
|
+
| `install` | array | — | Dependency install steps |
|
|
39
|
+
| `metadata` | object | — | Provenance and platform annotations |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## `persona`
|
|
44
|
+
|
|
45
|
+
The agent's system prompt and behavioral identity.
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"persona": {
|
|
50
|
+
"system_prompt": "You are a warm, knowledgeable pregnancy companion...",
|
|
51
|
+
"personality_notes": "Warm and supportive. Use simple language.",
|
|
52
|
+
"language": "en"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Field | Description |
|
|
58
|
+
|-------|-------------|
|
|
59
|
+
| `system_prompt` | Full instruction text passed to the model. This is the SKILL.md body (OpenClaw), CLAUDE.md content, Bedrock instruction, or Copilot system_prompt |
|
|
60
|
+
| `personality_notes` | Informational tone/style notes. May be embedded in system_prompt |
|
|
61
|
+
| `language` | BCP-47 language code. Default `"en"` |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## `tools[]`
|
|
66
|
+
|
|
67
|
+
Each tool the agent can invoke.
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"tools": [
|
|
72
|
+
{
|
|
73
|
+
"name": "bash",
|
|
74
|
+
"description": "Run shell commands on the host",
|
|
75
|
+
"kind": "shell",
|
|
76
|
+
"platform_availability": ["openclaw", "claude-code"]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "get_weather",
|
|
80
|
+
"description": "Fetch current weather for a location",
|
|
81
|
+
"kind": "function",
|
|
82
|
+
"parameters": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"properties": {
|
|
85
|
+
"location": { "type": "string", "description": "City name or airport code" },
|
|
86
|
+
"units": { "type": "string", "enum": ["metric", "imperial"], "default": "metric" }
|
|
87
|
+
},
|
|
88
|
+
"required": ["location"]
|
|
89
|
+
},
|
|
90
|
+
"auth": {
|
|
91
|
+
"type": "api_key",
|
|
92
|
+
"env_var": "OPENWEATHER_API_KEY"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "slack",
|
|
97
|
+
"description": "Send and read Slack messages via the slack MCP tool",
|
|
98
|
+
"kind": "mcp",
|
|
99
|
+
"auth": {
|
|
100
|
+
"type": "config_key",
|
|
101
|
+
"config_key": "channels.slack"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### `Tool.kind` values
|
|
109
|
+
|
|
110
|
+
| Kind | Description | Example |
|
|
111
|
+
|------|-------------|---------|
|
|
112
|
+
| `mcp` | Model Context Protocol server | `slack`, `github` OpenClaw tools |
|
|
113
|
+
| `openapi` | REST/OpenAPI action group | Bedrock action groups, Copilot plugins |
|
|
114
|
+
| `shell` | CLI subprocess | `bash` in OpenClaw/Claude Code |
|
|
115
|
+
| `builtin` | Platform-native tool | `Bash`, `Read`, `WebSearch` in Claude Code |
|
|
116
|
+
| `function` | LLM function-calling definition | OpenAI-style function tools |
|
|
117
|
+
| `unknown` | Unclassified | Fallback |
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## `knowledge[]`
|
|
122
|
+
|
|
123
|
+
Data sources the agent can read for grounding.
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"knowledge": [
|
|
128
|
+
{
|
|
129
|
+
"name": "week-by-week",
|
|
130
|
+
"kind": "file",
|
|
131
|
+
"path": "~/.openclaw/skills/pregnancy-companion/knowledge/week-by-week.md",
|
|
132
|
+
"description": "Baby development and symptoms by pregnancy week",
|
|
133
|
+
"format": "markdown",
|
|
134
|
+
"load_mode": "on_demand"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"name": "product-docs",
|
|
138
|
+
"kind": "vector_store",
|
|
139
|
+
"path": "s3://my-bucket/embeddings/product-docs",
|
|
140
|
+
"description": "Product documentation for RAG",
|
|
141
|
+
"load_mode": "indexed"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### `KnowledgeSource.load_mode` values
|
|
148
|
+
|
|
149
|
+
| Mode | Description |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| `always` | Inject full content into every session context |
|
|
152
|
+
| `on_demand` | Agent reads the file when it needs it |
|
|
153
|
+
| `indexed` | Content is embedded in a vector store for retrieval |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## `triggers[]`
|
|
158
|
+
|
|
159
|
+
When and how the agent activates automatically.
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"triggers": [
|
|
164
|
+
{
|
|
165
|
+
"id": "morning-checkin",
|
|
166
|
+
"kind": "cron",
|
|
167
|
+
"cron_expr": "0 9 * * *",
|
|
168
|
+
"message": "Good morning! Give today's pregnancy tip and check for upcoming appointments.",
|
|
169
|
+
"session_target": "isolated",
|
|
170
|
+
"delivery": {
|
|
171
|
+
"mode": "announce",
|
|
172
|
+
"channel": "telegram",
|
|
173
|
+
"to": "123456789"
|
|
174
|
+
},
|
|
175
|
+
"enabled": true
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "pr-opened",
|
|
179
|
+
"kind": "event",
|
|
180
|
+
"event_name": "pr.opened",
|
|
181
|
+
"message": "A new PR was opened. Review it and post a summary.",
|
|
182
|
+
"session_target": "isolated"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### `Trigger.kind` values
|
|
189
|
+
|
|
190
|
+
| Kind | Description | Key Fields |
|
|
191
|
+
|------|-------------|------------|
|
|
192
|
+
| `cron` | Scheduled by time | `cron_expr` or `every` |
|
|
193
|
+
| `webhook` | HTTP POST from external service | `webhook_path` |
|
|
194
|
+
| `message` | Incoming chat message | `event_name` (optional filter) |
|
|
195
|
+
| `event` | Platform event | `event_name` |
|
|
196
|
+
| `manual` | User-initiated only | — |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## `constraints`
|
|
201
|
+
|
|
202
|
+
Platform limits and behavioral guardrails.
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"constraints": {
|
|
207
|
+
"supported_os": ["darwin", "linux"],
|
|
208
|
+
"required_bins": ["curl"],
|
|
209
|
+
"any_required_bins": ["claude", "codex"],
|
|
210
|
+
"required_config_keys": ["channels.slack"],
|
|
211
|
+
"guardrails": ["no-diagnose", "no-prescribe"],
|
|
212
|
+
"topic_restrictions": ["financial advice", "legal advice"],
|
|
213
|
+
"max_instruction_chars": 4000
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Platform instruction limits
|
|
219
|
+
|
|
220
|
+
| Platform | Approx. Limit |
|
|
221
|
+
|----------|---------------|
|
|
222
|
+
| AWS Bedrock | 4,000 chars |
|
|
223
|
+
| Vertex AI Agent Builder | 8,000 chars |
|
|
224
|
+
| Microsoft Copilot | ~32,000 chars |
|
|
225
|
+
| OpenClaw / Claude Code | No hard limit (context window) |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## `install[]`
|
|
230
|
+
|
|
231
|
+
Dependency installation steps (multiple = fallback options).
|
|
232
|
+
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"install": [
|
|
236
|
+
{
|
|
237
|
+
"id": "brew",
|
|
238
|
+
"kind": "brew",
|
|
239
|
+
"formula": "gh",
|
|
240
|
+
"bins": ["gh"],
|
|
241
|
+
"label": "Install GitHub CLI (brew)"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"id": "apt",
|
|
245
|
+
"kind": "apt",
|
|
246
|
+
"package": "gh",
|
|
247
|
+
"bins": ["gh"],
|
|
248
|
+
"label": "Install GitHub CLI (apt)"
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## `metadata`
|
|
257
|
+
|
|
258
|
+
Provenance and platform-specific extensions.
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"metadata": {
|
|
263
|
+
"source_platform": "openclaw",
|
|
264
|
+
"target_platforms": ["claude-code", "bedrock"],
|
|
265
|
+
"created_at": "2026-03-23T10:00:00Z",
|
|
266
|
+
"updated_at": "2026-03-23T10:00:00Z",
|
|
267
|
+
"source_file": "~/.openclaw/skills/weather/SKILL.md",
|
|
268
|
+
"emoji": "☔",
|
|
269
|
+
"tags": ["weather", "productivity"],
|
|
270
|
+
"platform_extensions": {
|
|
271
|
+
"openclaw": {
|
|
272
|
+
"requires": { "bins": ["curl"] }
|
|
273
|
+
},
|
|
274
|
+
"bedrock": {
|
|
275
|
+
"agent_id": "ABCDEF1234",
|
|
276
|
+
"alias_id": "TSTALIASID"
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
`platform_extensions` is a catch-all for platform-specific data that has no IR equivalent. It is preserved round-trip so no information is lost.
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Complete Example — pregnancy-companion
|
|
288
|
+
|
|
289
|
+
```json
|
|
290
|
+
{
|
|
291
|
+
"ir_version": "1.0",
|
|
292
|
+
"name": "pregnancy-companion",
|
|
293
|
+
"description": "24/7 pregnancy companion — answers questions, tracks symptoms, gives weekly updates, and supports a healthy pregnancy journey",
|
|
294
|
+
"version": "1.0.0",
|
|
295
|
+
"persona": {
|
|
296
|
+
"system_prompt": "You are a warm, knowledgeable pregnancy companion...",
|
|
297
|
+
"personality_notes": "Warm, supportive, and encouraging. Never clinical.",
|
|
298
|
+
"language": "en"
|
|
299
|
+
},
|
|
300
|
+
"tools": [
|
|
301
|
+
{
|
|
302
|
+
"name": "bash",
|
|
303
|
+
"description": "Read/write tracking files (symptoms, weight, appointments)",
|
|
304
|
+
"kind": "shell"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"knowledge": [
|
|
308
|
+
{
|
|
309
|
+
"name": "week-by-week",
|
|
310
|
+
"kind": "file",
|
|
311
|
+
"path": "~/.openclaw/skills/pregnancy-companion/knowledge/week-by-week.md",
|
|
312
|
+
"description": "Baby development and symptoms by week",
|
|
313
|
+
"format": "markdown",
|
|
314
|
+
"load_mode": "on_demand"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "nutrition",
|
|
318
|
+
"kind": "file",
|
|
319
|
+
"path": "~/.openclaw/skills/pregnancy-companion/knowledge/nutrition.md",
|
|
320
|
+
"description": "Pregnancy nutrition guide by trimester",
|
|
321
|
+
"format": "markdown",
|
|
322
|
+
"load_mode": "on_demand"
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"triggers": [
|
|
326
|
+
{
|
|
327
|
+
"id": "daily-tip",
|
|
328
|
+
"kind": "cron",
|
|
329
|
+
"cron_expr": "0 9 * * *",
|
|
330
|
+
"message": "Give today's pregnancy tip based on the current week.",
|
|
331
|
+
"session_target": "isolated",
|
|
332
|
+
"delivery": {
|
|
333
|
+
"mode": "announce",
|
|
334
|
+
"channel": "telegram",
|
|
335
|
+
"to": "123456789"
|
|
336
|
+
},
|
|
337
|
+
"enabled": true
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"constraints": {
|
|
341
|
+
"supported_os": ["darwin", "linux"],
|
|
342
|
+
"guardrails": ["no-diagnose", "no-prescribe"]
|
|
343
|
+
},
|
|
344
|
+
"metadata": {
|
|
345
|
+
"source_platform": "openclaw",
|
|
346
|
+
"target_platforms": ["claude-code"],
|
|
347
|
+
"created_at": "2026-03-23T00:00:00Z",
|
|
348
|
+
"emoji": "🤰",
|
|
349
|
+
"tags": ["health", "pregnancy"]
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Platform Mapping Reference
|
|
357
|
+
|
|
358
|
+
| IR Field | OpenClaw | Claude Code | Copilot | Bedrock | Vertex AI |
|
|
359
|
+
|----------|----------|-------------|---------|---------|-----------|
|
|
360
|
+
| `name` | `name` (frontmatter) | `name` (frontmatter) | `name` (manifest) | Agent name | Agent display name |
|
|
361
|
+
| `description` | `description` (frontmatter) | `description` (frontmatter) | `description` | Agent description | Agent description |
|
|
362
|
+
| `persona.system_prompt` | SKILL.md body | SKILL.md body / CLAUDE.md | `system_prompt` | `instruction` | Default model settings / instruction |
|
|
363
|
+
| `tools[].name` | Implied by MCP server / shell cmds | Allowed tool list | Plugin actions | Action group operations | Tool definitions |
|
|
364
|
+
| `tools[].kind=mcp` | Tool name in conversation | MCP server config | — | — | — |
|
|
365
|
+
| `triggers[].cron_expr` | `openclaw cron` jobs.json | External cron + claude CLI | Scheduled invocation | EventBridge / Lambda trigger | Cloud Scheduler |
|
|
366
|
+
| `constraints.max_instruction_chars` | None | None | ~32k | 4,000 | 8,000 |
|
|
367
|
+
| `constraints.required_bins` | `metadata.openclaw.requires.bins` | Implied by tool usage | N/A | N/A | N/A |
|
|
368
|
+
| `knowledge[].kind=file` | SKILL.md references to files | `Read` tool + CLAUDE.md | `capabilities.localization_settings` | Knowledge base S3 source | Data store |
|
|
369
|
+
| `metadata.emoji` | `metadata.openclaw.emoji` | — (not natively supported) | — | — | — |
|
|
370
|
+
| `install[]` | `metadata.openclaw.install` | — | — | — | — |
|