@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.
Files changed (53) hide show
  1. package/.github/CODEOWNERS +25 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.yml +93 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.yml +54 -0
  5. package/.github/ISSUE_TEMPLATE/platform_request.yml +55 -0
  6. package/.github/PULL_REQUEST_TEMPLATE.md +53 -0
  7. package/.github/SETUP.md +65 -0
  8. package/.github/workflows/ci.yml +85 -0
  9. package/AGENTS.md +68 -0
  10. package/BACKLOG.md +55 -0
  11. package/CODE_OF_CONDUCT.md +43 -0
  12. package/CONTRIBUTING.md +136 -0
  13. package/LICENSE +201 -0
  14. package/README.md +112 -0
  15. package/SECURITY.md +42 -0
  16. package/bin/agentshift.js +4 -0
  17. package/examples/pregnancy-companion/AGENTS.md +212 -0
  18. package/examples/pregnancy-companion/BOOTSTRAP.md +55 -0
  19. package/examples/pregnancy-companion/SKILL.md +88 -0
  20. package/examples/pregnancy-companion/data/appointments.md +5 -0
  21. package/examples/pregnancy-companion/data/questions-for-doctor.md +7 -0
  22. package/examples/pregnancy-companion/data/symptoms-log.md +5 -0
  23. package/examples/pregnancy-companion/data/weight-log.md +6 -0
  24. package/examples/pregnancy-companion/knowledge/appointments.md +122 -0
  25. package/examples/pregnancy-companion/knowledge/exercise.md +114 -0
  26. package/examples/pregnancy-companion/knowledge/nutrition.md +112 -0
  27. package/examples/pregnancy-companion/knowledge/warning-signs.md +80 -0
  28. package/examples/pregnancy-companion/knowledge/week-by-week.md +198 -0
  29. package/index.js +4 -0
  30. package/package.json +18 -0
  31. package/pyproject.toml +72 -0
  32. package/specs/claude-code-format.md +397 -0
  33. package/specs/ir-schema.json +438 -0
  34. package/specs/ir-schema.md +370 -0
  35. package/specs/openclaw-skill-format.md +483 -0
  36. package/src/agentshift/__init__.py +3 -0
  37. package/src/agentshift/cli.py +44 -0
  38. package/src/agentshift/emitters/__init__.py +1 -0
  39. package/src/agentshift/ir.py +134 -0
  40. package/src/agentshift/parsers/__init__.py +1 -0
  41. package/tests/__init__.py +0 -0
  42. package/tests/fixtures/pregnancy-companion/AGENTS.md +212 -0
  43. package/tests/fixtures/pregnancy-companion/BOOTSTRAP.md +55 -0
  44. package/tests/fixtures/pregnancy-companion/SKILL.md +88 -0
  45. package/tests/fixtures/pregnancy-companion/data/appointments.md +5 -0
  46. package/tests/fixtures/pregnancy-companion/data/questions-for-doctor.md +7 -0
  47. package/tests/fixtures/pregnancy-companion/data/symptoms-log.md +5 -0
  48. package/tests/fixtures/pregnancy-companion/data/weight-log.md +6 -0
  49. package/tests/fixtures/pregnancy-companion/knowledge/appointments.md +122 -0
  50. package/tests/fixtures/pregnancy-companion/knowledge/exercise.md +114 -0
  51. package/tests/fixtures/pregnancy-companion/knowledge/nutrition.md +112 -0
  52. package/tests/fixtures/pregnancy-companion/knowledge/warning-signs.md +80 -0
  53. package/tests/fixtures/pregnancy-companion/knowledge/week-by-week.md +198 -0
@@ -0,0 +1,438 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://agentshift.dev/schemas/ir/v1.json",
4
+ "title": "AgentShift Intermediate Representation (IR)",
5
+ "description": "Universal agent model for cross-platform agent portability. Represents agents from OpenClaw, Claude Code, Copilot, Bedrock, and Vertex AI in a single canonical format.",
6
+ "type": "object",
7
+ "required": ["ir_version", "name", "description"],
8
+ "additionalProperties": false,
9
+
10
+ "properties": {
11
+
12
+ "ir_version": {
13
+ "type": "string",
14
+ "const": "1.0",
15
+ "description": "IR schema version. Always '1.0' for this revision."
16
+ },
17
+
18
+ "name": {
19
+ "type": "string",
20
+ "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$",
21
+ "maxLength": 64,
22
+ "description": "Canonical slug identifier for the agent. Lowercase, hyphens only. e.g. 'pregnancy-companion'."
23
+ },
24
+
25
+ "description": {
26
+ "type": "string",
27
+ "maxLength": 1000,
28
+ "description": "Human-readable summary of what the agent does and when to invoke it. Used as a skill trigger description for Claude Code and OpenClaw."
29
+ },
30
+
31
+ "version": {
32
+ "type": "string",
33
+ "pattern": "^\\d+\\.\\d+\\.\\d+$",
34
+ "description": "Semantic version of this agent definition. e.g. '1.0.0'.",
35
+ "default": "1.0.0"
36
+ },
37
+
38
+ "author": {
39
+ "type": "string",
40
+ "description": "Author or owner of this agent definition. Free text."
41
+ },
42
+
43
+ "homepage": {
44
+ "type": "string",
45
+ "format": "uri",
46
+ "description": "Optional URL for documentation or the tool this agent wraps."
47
+ },
48
+
49
+ "persona": {
50
+ "type": "object",
51
+ "description": "The agent's identity and behavioral instructions — the system prompt layer.",
52
+ "additionalProperties": false,
53
+ "properties": {
54
+ "system_prompt": {
55
+ "type": "string",
56
+ "description": "The full system / instruction prompt passed to the model at session start. Maps to: OpenClaw SKILL.md body, Claude Code CLAUDE.md, Copilot system_prompt, Bedrock instruction, Vertex AI agent instruction."
57
+ },
58
+ "personality_notes": {
59
+ "type": "string",
60
+ "description": "Human-readable prose describing tone, style, and personality. Informational only; may be embedded in system_prompt."
61
+ },
62
+ "language": {
63
+ "type": "string",
64
+ "description": "Primary language for responses. BCP-47 code. e.g. 'en', 'es'.",
65
+ "default": "en"
66
+ }
67
+ }
68
+ },
69
+
70
+ "tools": {
71
+ "type": "array",
72
+ "description": "Capabilities / tools available to the agent. Covers MCP tools, OpenAPI action groups, shell commands, and built-in platform tools.",
73
+ "items": {
74
+ "$ref": "#/definitions/Tool"
75
+ },
76
+ "default": []
77
+ },
78
+
79
+ "knowledge": {
80
+ "type": "array",
81
+ "description": "Knowledge sources the agent consults — local files, vector stores, URLs, or databases.",
82
+ "items": {
83
+ "$ref": "#/definitions/KnowledgeSource"
84
+ },
85
+ "default": []
86
+ },
87
+
88
+ "triggers": {
89
+ "type": "array",
90
+ "description": "Conditions that activate the agent: cron schedules, webhooks, messages, or platform events.",
91
+ "items": {
92
+ "$ref": "#/definitions/Trigger"
93
+ },
94
+ "default": []
95
+ },
96
+
97
+ "constraints": {
98
+ "type": "object",
99
+ "description": "Platform limits, guardrails, and behavioral restrictions.",
100
+ "additionalProperties": false,
101
+ "properties": {
102
+ "max_instruction_chars": {
103
+ "type": "integer",
104
+ "description": "Maximum character length of the system prompt (varies by platform). Bedrock: 4000. Copilot: ~32k. Vertex: 8000+."
105
+ },
106
+ "supported_os": {
107
+ "type": "array",
108
+ "items": { "type": "string", "enum": ["darwin", "linux", "windows"] },
109
+ "description": "Operating systems this agent can run on. Maps to OpenClaw 'os' frontmatter field."
110
+ },
111
+ "required_bins": {
112
+ "type": "array",
113
+ "items": { "type": "string" },
114
+ "description": "CLI binaries that must be present (e.g. ['gh', 'curl']). Maps to OpenClaw metadata.openclaw.requires.bins."
115
+ },
116
+ "any_required_bins": {
117
+ "type": "array",
118
+ "items": { "type": "string" },
119
+ "description": "At least one of these binaries must be present. Maps to OpenClaw metadata.openclaw.requires.anyBins."
120
+ },
121
+ "required_config_keys": {
122
+ "type": "array",
123
+ "items": { "type": "string" },
124
+ "description": "OpenClaw config keys that must be set. e.g. ['channels.slack']."
125
+ },
126
+ "guardrails": {
127
+ "type": "array",
128
+ "items": { "type": "string" },
129
+ "description": "Named safety guardrails to apply. e.g. ['no-diagnose', 'no-prescribe', 'no-harmful-content']."
130
+ },
131
+ "topic_restrictions": {
132
+ "type": "array",
133
+ "items": { "type": "string" },
134
+ "description": "Topics the agent must refuse. Free text. Maps to Bedrock/Copilot guardrails."
135
+ }
136
+ }
137
+ },
138
+
139
+ "install": {
140
+ "type": "array",
141
+ "description": "Installation instructions for agent dependencies. Maps to OpenClaw metadata.openclaw.install.",
142
+ "items": {
143
+ "$ref": "#/definitions/InstallStep"
144
+ },
145
+ "default": []
146
+ },
147
+
148
+ "metadata": {
149
+ "type": "object",
150
+ "description": "Source provenance and target platform annotations. Preserved across conversions.",
151
+ "additionalProperties": false,
152
+ "properties": {
153
+ "source_platform": {
154
+ "type": "string",
155
+ "enum": ["openclaw", "claude-code", "copilot", "bedrock", "vertex-ai", "unknown"],
156
+ "description": "Platform this IR was originally parsed from."
157
+ },
158
+ "target_platforms": {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "string",
162
+ "enum": ["openclaw", "claude-code", "copilot", "bedrock", "vertex-ai"]
163
+ },
164
+ "description": "Intended emission targets."
165
+ },
166
+ "created_at": {
167
+ "type": "string",
168
+ "format": "date-time",
169
+ "description": "ISO 8601 timestamp when this IR was first created."
170
+ },
171
+ "updated_at": {
172
+ "type": "string",
173
+ "format": "date-time",
174
+ "description": "ISO 8601 timestamp of most recent modification."
175
+ },
176
+ "source_file": {
177
+ "type": "string",
178
+ "description": "Path or URI of the original source file (e.g. '~/.openclaw/skills/weather/SKILL.md')."
179
+ },
180
+ "emoji": {
181
+ "type": "string",
182
+ "description": "Display emoji for the agent. Maps to OpenClaw metadata.openclaw.emoji."
183
+ },
184
+ "tags": {
185
+ "type": "array",
186
+ "items": { "type": "string" },
187
+ "description": "Arbitrary classification tags."
188
+ },
189
+ "platform_extensions": {
190
+ "type": "object",
191
+ "description": "Platform-specific data that has no IR equivalent. Keyed by platform slug. Preserved round-trip.",
192
+ "additionalProperties": {
193
+ "type": "object"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ },
199
+
200
+ "definitions": {
201
+
202
+ "Tool": {
203
+ "type": "object",
204
+ "required": ["name", "description"],
205
+ "additionalProperties": false,
206
+ "description": "A capability the agent can invoke — an MCP tool, OpenAPI endpoint, shell command, or platform built-in.",
207
+ "properties": {
208
+ "name": {
209
+ "type": "string",
210
+ "description": "Tool identifier. e.g. 'slack', 'bash', 'get_weather', 'Bash'."
211
+ },
212
+ "description": {
213
+ "type": "string",
214
+ "description": "What this tool does and when to use it."
215
+ },
216
+ "kind": {
217
+ "type": "string",
218
+ "enum": ["mcp", "openapi", "shell", "builtin", "function", "unknown"],
219
+ "default": "unknown",
220
+ "description": "Tool protocol type. 'mcp' = Model Context Protocol server. 'openapi' = REST/OpenAPI action group (Bedrock/Copilot). 'shell' = CLI subprocess. 'builtin' = platform-native tool (Bash, Read, WebSearch in Claude Code). 'function' = LLM function-calling definition."
221
+ },
222
+ "parameters": {
223
+ "type": "object",
224
+ "description": "JSON Schema object describing tool input parameters. Maps to MCP inputSchema, OpenAPI requestBody, or function call parameters.",
225
+ "properties": {
226
+ "type": { "type": "string", "const": "object" },
227
+ "properties": { "type": "object" },
228
+ "required": { "type": "array", "items": { "type": "string" } }
229
+ }
230
+ },
231
+ "auth": {
232
+ "$ref": "#/definitions/ToolAuth"
233
+ },
234
+ "endpoint": {
235
+ "type": "string",
236
+ "description": "For 'openapi' kind: base URL. For 'mcp' kind: server URI or command."
237
+ },
238
+ "platform_availability": {
239
+ "type": "array",
240
+ "items": {
241
+ "type": "string",
242
+ "enum": ["openclaw", "claude-code", "copilot", "bedrock", "vertex-ai"]
243
+ },
244
+ "description": "Platforms on which this tool is available. Empty = all platforms."
245
+ }
246
+ }
247
+ },
248
+
249
+ "ToolAuth": {
250
+ "type": "object",
251
+ "additionalProperties": false,
252
+ "description": "Authentication requirements for a tool.",
253
+ "properties": {
254
+ "type": {
255
+ "type": "string",
256
+ "enum": ["none", "api_key", "oauth2", "bearer", "basic", "config_key"],
257
+ "default": "none"
258
+ },
259
+ "env_var": {
260
+ "type": "string",
261
+ "description": "Environment variable holding the credential. e.g. 'SLACK_BOT_TOKEN'."
262
+ },
263
+ "config_key": {
264
+ "type": "string",
265
+ "description": "OpenClaw config key. e.g. 'channels.slack'."
266
+ },
267
+ "scopes": {
268
+ "type": "array",
269
+ "items": { "type": "string" },
270
+ "description": "OAuth2 scopes required."
271
+ },
272
+ "notes": {
273
+ "type": "string",
274
+ "description": "Human-readable auth setup instructions."
275
+ }
276
+ }
277
+ },
278
+
279
+ "KnowledgeSource": {
280
+ "type": "object",
281
+ "required": ["name", "kind"],
282
+ "additionalProperties": false,
283
+ "description": "A data source the agent reads from for grounding.",
284
+ "properties": {
285
+ "name": {
286
+ "type": "string",
287
+ "description": "Logical name for this knowledge source. e.g. 'week-by-week'."
288
+ },
289
+ "kind": {
290
+ "type": "string",
291
+ "enum": ["file", "directory", "url", "vector_store", "database", "s3"],
292
+ "description": "Storage type."
293
+ },
294
+ "path": {
295
+ "type": "string",
296
+ "description": "File path, directory path, or URI. May use ~ for home dir. e.g. '~/.openclaw/skills/pregnancy-companion/knowledge/week-by-week.md'."
297
+ },
298
+ "description": {
299
+ "type": "string",
300
+ "description": "What this knowledge source contains."
301
+ },
302
+ "format": {
303
+ "type": "string",
304
+ "enum": ["markdown", "json", "yaml", "text", "pdf", "html", "unknown"],
305
+ "default": "unknown"
306
+ },
307
+ "load_mode": {
308
+ "type": "string",
309
+ "enum": ["always", "on_demand", "indexed"],
310
+ "default": "on_demand",
311
+ "description": "'always' = inject into every session. 'on_demand' = agent reads when needed. 'indexed' = embedded in vector store."
312
+ }
313
+ }
314
+ },
315
+
316
+ "Trigger": {
317
+ "type": "object",
318
+ "required": ["kind"],
319
+ "additionalProperties": false,
320
+ "description": "An event or schedule that activates the agent.",
321
+ "properties": {
322
+ "id": {
323
+ "type": "string",
324
+ "description": "Unique trigger identifier."
325
+ },
326
+ "kind": {
327
+ "type": "string",
328
+ "enum": ["cron", "webhook", "message", "event", "manual"],
329
+ "description": "Trigger type."
330
+ },
331
+ "cron_expr": {
332
+ "type": "string",
333
+ "description": "Standard cron expression (5-field). e.g. '0 9 * * 1' = Monday 9am. Required when kind='cron'."
334
+ },
335
+ "every": {
336
+ "type": "string",
337
+ "description": "Human-readable interval shorthand. e.g. '30m', '2h', '1d'. Alternative to cron_expr.",
338
+ "pattern": "^\\d+[smhd]$"
339
+ },
340
+ "message": {
341
+ "type": "string",
342
+ "description": "Prompt or instruction injected when the trigger fires. Maps to OpenClaw cron payload.message."
343
+ },
344
+ "webhook_path": {
345
+ "type": "string",
346
+ "description": "URL path for webhook triggers. e.g. '/webhooks/github'."
347
+ },
348
+ "event_name": {
349
+ "type": "string",
350
+ "description": "Platform event name. e.g. 'pr.opened', 'message.received'."
351
+ },
352
+ "delivery": {
353
+ "$ref": "#/definitions/TriggerDelivery"
354
+ },
355
+ "session_target": {
356
+ "type": "string",
357
+ "enum": ["isolated", "main", "thread"],
358
+ "default": "isolated",
359
+ "description": "Session context for the triggered run. 'isolated' = fresh session each time."
360
+ },
361
+ "enabled": {
362
+ "type": "boolean",
363
+ "default": true
364
+ }
365
+ }
366
+ },
367
+
368
+ "TriggerDelivery": {
369
+ "type": "object",
370
+ "additionalProperties": false,
371
+ "description": "Where to send the trigger's output.",
372
+ "properties": {
373
+ "mode": {
374
+ "type": "string",
375
+ "enum": ["announce", "silent", "reply"],
376
+ "default": "announce"
377
+ },
378
+ "channel": {
379
+ "type": "string",
380
+ "enum": ["telegram", "slack", "discord", "email", "webhook", "stdout"],
381
+ "description": "Output channel."
382
+ },
383
+ "to": {
384
+ "type": "string",
385
+ "description": "Destination identifier: chat_id, user_id, channel_id, email address, etc."
386
+ },
387
+ "account_id": {
388
+ "type": "string",
389
+ "description": "OpenClaw account/bot identifier for multi-account setups."
390
+ }
391
+ }
392
+ },
393
+
394
+ "InstallStep": {
395
+ "type": "object",
396
+ "required": ["id", "kind"],
397
+ "additionalProperties": false,
398
+ "description": "One installation method for a dependency. Multiple methods give fallback options.",
399
+ "properties": {
400
+ "id": {
401
+ "type": "string",
402
+ "description": "Unique id for this install method. e.g. 'brew', 'apt', 'go', 'npm'."
403
+ },
404
+ "kind": {
405
+ "type": "string",
406
+ "enum": ["brew", "apt", "go", "npm", "pip", "cargo", "script", "manual"],
407
+ "description": "Package manager or install mechanism."
408
+ },
409
+ "formula": {
410
+ "type": "string",
411
+ "description": "Homebrew formula name."
412
+ },
413
+ "package": {
414
+ "type": "string",
415
+ "description": "apt/npm/pip/cargo package name."
416
+ },
417
+ "module": {
418
+ "type": "string",
419
+ "description": "Go module path. e.g. 'github.com/foo/bar/cmd/baz@latest'."
420
+ },
421
+ "script_url": {
422
+ "type": "string",
423
+ "format": "uri",
424
+ "description": "URL for curl-pipe install scripts."
425
+ },
426
+ "bins": {
427
+ "type": "array",
428
+ "items": { "type": "string" },
429
+ "description": "Binary names installed by this step."
430
+ },
431
+ "label": {
432
+ "type": "string",
433
+ "description": "Human-readable label for this install option."
434
+ }
435
+ }
436
+ }
437
+ }
438
+ }