@kafbit/irsim-connectors 0.6.0 → 0.7.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/bin/irsim-connectors.mjs +45 -0
- package/harnesses/antigravity/assets/logo.svg +1 -0
- package/harnesses/antigravity/hooks.json +25 -0
- package/harnesses/antigravity/mcp_config.json +8 -0
- package/harnesses/antigravity/plugin.json +21 -0
- package/harnesses/antigravity/skills/irsim/SKILL.md +14 -0
- package/harnesses/antigravity/skills/irsim-comments/SKILL.md +11 -0
- package/harnesses/antigravity/skills/irsim-design/SKILL.md +152 -0
- package/harnesses/antigravity/skills/irsim-doctor/SKILL.md +11 -0
- package/harnesses/antigravity/skills/irsim-stop/SKILL.md +11 -0
- package/harnesses/antigravity/skills/irsim-workflow/SKILL.md +45 -0
- package/package.json +5 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process'
|
|
3
|
+
import { existsSync, realpathSync } from 'node:fs'
|
|
4
|
+
import { dirname, join, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const PKG_ROOT = resolve(dirname(realpathSync(fileURLToPath(import.meta.url))), '..')
|
|
8
|
+
const USAGE = `usage: irsim-connectors antigravity [--uninstall]\n`
|
|
9
|
+
|
|
10
|
+
const fail = (message, code = 1) => {
|
|
11
|
+
console.error(`irsim-connectors: ${message}`)
|
|
12
|
+
process.exit(code)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const args = process.argv.slice(2)
|
|
16
|
+
if (args.length === 0 || args.includes('-h') || args.includes('--help')) {
|
|
17
|
+
process.stdout.write(USAGE)
|
|
18
|
+
process.exit(0)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let uninstall = false
|
|
22
|
+
const positional = []
|
|
23
|
+
for (const arg of args) {
|
|
24
|
+
if (arg === '--uninstall') uninstall = true
|
|
25
|
+
else if (arg.startsWith('-')) fail(`unknown option ${arg}`, 2)
|
|
26
|
+
else positional.push(arg)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const agent = positional[0]
|
|
30
|
+
if (positional.length !== 1 || (agent !== 'antigravity' && agent !== 'agy')) {
|
|
31
|
+
fail(agent ? `unknown agent ${agent}, expected antigravity` : 'missing agent, expected antigravity', 2)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const agyArgs = uninstall
|
|
35
|
+
? ['plugin', 'uninstall', 'irsim']
|
|
36
|
+
: (() => {
|
|
37
|
+
const pluginDir = join(PKG_ROOT, 'harnesses', 'antigravity')
|
|
38
|
+
if (!existsSync(pluginDir)) fail(`Antigravity plugin not found at ${pluginDir}`)
|
|
39
|
+
return ['plugin', 'install', pluginDir]
|
|
40
|
+
})()
|
|
41
|
+
|
|
42
|
+
const res = spawnSync('agy', agyArgs, { stdio: 'inherit' })
|
|
43
|
+
if (res.error?.code === 'ENOENT') fail('agy is not installed or not on PATH')
|
|
44
|
+
if (res.error) fail(res.error.message)
|
|
45
|
+
process.exit(res.status ?? 1)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><defs><linearGradient id="bg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#181b27"/><stop offset="1" stop-color="#07080c"/></linearGradient><linearGradient id="rim" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#fff" stop-opacity=".35"/><stop offset=".5" stop-color="#fff" stop-opacity=".04"/><stop offset="1" stop-color="#fff" stop-opacity=".2"/></linearGradient></defs><rect x="8" y="8" width="240" height="240" rx="56" fill="url(#bg)"/><rect x="9.5" y="9.5" width="237" height="237" rx="54.5" fill="none" stroke="url(#rim)" stroke-width="3"/><g><rect x="40" y="139" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="40" y="136" width="80" height="80" rx="13" fill="hsl(252 90% 58%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="42" y="138" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="56" y="123" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="56" y="120" width="80" height="80" rx="13" fill="hsl(234.5 90% 59%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="58" y="122" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="72" y="107" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="72" y="104" width="80" height="80" rx="13" fill="hsl(217 90% 60%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="74" y="106" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="88" y="91" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="88" y="88" width="80" height="80" rx="13" fill="hsl(199.5 90% 61%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="90" y="90" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="104" y="75" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="104" y="72" width="80" height="80" rx="13" fill="hsl(182 90% 62%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="106" y="74" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="120" y="59" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="120" y="56" width="80" height="80" rx="13" fill="hsl(164.5 90% 63%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="122" y="58" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g><g><rect x="136" y="43" width="80" height="80" rx="13" fill="#000" opacity=".35"/><rect x="136" y="40" width="80" height="80" rx="13" fill="hsl(147 90% 64%)" stroke="#0a0c12" stroke-width="3.5"/><rect x="138" y="42" width="76" height="22" rx="11" fill="#fff" opacity=".16"/></g></svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"irsim": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"type": "command",
|
|
6
|
+
"command": "irsim bridge hook antigravity SessionStart",
|
|
7
|
+
"timeout": 15
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"PreInvocation": [
|
|
11
|
+
{
|
|
12
|
+
"type": "command",
|
|
13
|
+
"command": "irsim bridge hook antigravity PreInvocation",
|
|
14
|
+
"timeout": 10
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"Stop": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "irsim bridge hook antigravity Stop",
|
|
21
|
+
"timeout": 15
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://antigravity.google/schemas/v1/plugin.json",
|
|
3
|
+
"name": "irsim",
|
|
4
|
+
"displayName": "irsim",
|
|
5
|
+
"version": "0.7.1",
|
|
6
|
+
"description": "Opens the irsim design canvas, adds design_canvas over MCP, and delivers canvas comments to your session.",
|
|
7
|
+
"logo": "assets/logo.svg",
|
|
8
|
+
"suggestedPrompts": [
|
|
9
|
+
"/irsim",
|
|
10
|
+
"/irsim-doctor",
|
|
11
|
+
"/irsim-comments"
|
|
12
|
+
],
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "Kafbit",
|
|
15
|
+
"url": "https://github.com/kafbit/irsim"
|
|
16
|
+
},
|
|
17
|
+
"homepage": "https://github.com/kafbit/irsim",
|
|
18
|
+
"repository": "https://github.com/kafbit/irsim",
|
|
19
|
+
"license": "AGPL-3.0-only",
|
|
20
|
+
"keywords": ["irsim", "design", "canvas", "boards", "hooks", "mcp"]
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim
|
|
3
|
+
description: Open irsim and listen for its comments. Use when the user runs /irsim or asks to open the irsim design canvas for the current project (optionally focusing a page or board).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /irsim
|
|
7
|
+
|
|
8
|
+
Open the irsim design canvas for this project and listen for comments.
|
|
9
|
+
|
|
10
|
+
1. Call the `design_canvas` MCP tool with `{"action": "open"}`. The tool is `design_canvas` on the irsim MCP server (named `irsim_irsim` in agy). Its arguments are given here, so call it at once: do not read its schema file, `instructions.md` or any other file first.
|
|
11
|
+
- If the user passed a page id or board name, pass it as `"target"` (or `"page"` / `"board"` if explicit).
|
|
12
|
+
2. Report the opened canvas URL briefly.
|
|
13
|
+
3. Follow the `irsim-workflow` and `irsim-design` skills for any change to what a screen shows: update the board first, check it with `design_canvas {"action": "check"}`, report its route, and wait for the user's confirmation before writing app code.
|
|
14
|
+
4. Comments sent from the canvas arrive automatically between turns; reply in at most three short sentences with `design_canvas {"action": "reply", "id": "…", "body": "…"}` and resolve with `{"action": "resolve", "id": "…"}`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim-comments
|
|
3
|
+
description: Count the open irsim comments per page. Use when the user runs /irsim-comments or asks to see open design canvas comments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /irsim-comments
|
|
7
|
+
|
|
8
|
+
List and count open comments in the irsim design canvas.
|
|
9
|
+
|
|
10
|
+
1. Call the `design_canvas` MCP tool with `{"action": "comments"}` (pass `"page"` if the user specified a page id). The tool is `design_canvas` on the irsim MCP server (named `irsim_irsim` in agy). Its arguments are given here, so call it at once: do not read its schema file, `instructions.md` or any other file first.
|
|
11
|
+
2. Summarize the open comment counts per page (or state that there are no open comments).
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim-design
|
|
3
|
+
description: The file formats of an irsim design folder: board files and design/canvas.json. Load it before you create or edit a board file or design/canvas.json, or when a project has a design folder of boards.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# irsim design files
|
|
7
|
+
|
|
8
|
+
Load this before you write a board file or `design/canvas.json`. For the order of work on a screen change (board first, user confirms, then code) follow the `irsim-workflow` skill.
|
|
9
|
+
|
|
10
|
+
## Where things live
|
|
11
|
+
|
|
12
|
+
- `.irsim.json` at the project root names the design folder: `{ "designDir": "design" }`. The default is `design`.
|
|
13
|
+
- `<designDir>/<Name>.html` is one board.
|
|
14
|
+
- `<designDir>/canvas.json` places boards on pages and in sections.
|
|
15
|
+
- `<designDir>/shared/` holds `*.css` (injected into every board), `*.js` and `*.mjs` (modules, reached as `shared.<name>`), and images and fonts (referenced as `./shared/<path>`). Names that start with `.` are ignored.
|
|
16
|
+
- `.irsim/` holds generated files (checks, screenshots, port). Never edit or commit it.
|
|
17
|
+
|
|
18
|
+
## A board file
|
|
19
|
+
|
|
20
|
+
- The file name is `<Name>.html`. `Name` matches `^[A-Za-z][A-Za-z0-9]*$`, for example `LeadsTable`.
|
|
21
|
+
- A legacy `<Name>.dc.html` is still read. Do not create new ones. When both exist, `<Name>.html` wins.
|
|
22
|
+
- A `.html` file is a board only when it contains `<x-dc>` or a `<script type="text/x-dc">`. Any other `.html` file in the folder is ignored.
|
|
23
|
+
- Parts of a board file:
|
|
24
|
+
- `<title>`: the board title shown on the canvas.
|
|
25
|
+
- `<script src="./support.js">` in the head. Leave it as written, the canvas serves the runtime under that name.
|
|
26
|
+
- `<x-dc>`: the template. Its children are rendered as written. `<helmet>` inside it holds the `<link>` and `<style>` elements that belong in the head.
|
|
27
|
+
- `<script type="text/x-dc" data-dc-script data-props='...'>`: the props as JSON in single quotes, then `class Component extends DCLogic` with `renderVals()` returning the values the template uses.
|
|
28
|
+
- `$preview` inside `data-props` is the board size `{ "width": n, "height": n }`. It is not a prop. Without it the size is 1440 by 900.
|
|
29
|
+
- A hole is `{{a.b.c}}`, a dotted lookup in what `renderVals()` returns. There are no operators or calls. `<sc-if value="{{x}}">` and `<sc-for list="{{xs}}" as="item">` are the only control tags.
|
|
30
|
+
- `<dc-import name="Other" prop="value" ...>` mounts the board `Other` of the same folder. Every other attribute is a prop of it. `hint-size` and `hint-placeholder-*` are dropped. Write it as a pair with no content.
|
|
31
|
+
- `data-props` entries are `{ "editor": "text", "enum" or "number", "default": ..., "options": [...] }`, or `{ "editor": null }` for a prop only a parent passes.
|
|
32
|
+
|
|
33
|
+
A complete minimal board:
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<!doctype html>
|
|
37
|
+
<html lang="en" dir="ltr">
|
|
38
|
+
<head>
|
|
39
|
+
<meta charset="utf-8">
|
|
40
|
+
<title>Greeting: dark</title>
|
|
41
|
+
<script src="./support.js"></script>
|
|
42
|
+
</head>
|
|
43
|
+
<body>
|
|
44
|
+
<x-dc>
|
|
45
|
+
<helmet>
|
|
46
|
+
<style>body{margin:0}</style>
|
|
47
|
+
</helmet>
|
|
48
|
+
<dc-import name="Greeting" theme="{{theme}}" hint-size="480px,240px"></dc-import>
|
|
49
|
+
</x-dc>
|
|
50
|
+
<script type="text/x-dc" data-dc-script data-props='{"theme":{"editor":"enum","default":"dark","options":["light","dark"]},"$preview":{"width":480,"height":240}}'>
|
|
51
|
+
class Component extends DCLogic {
|
|
52
|
+
renderVals() {
|
|
53
|
+
return { theme: this.props.theme }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
</body>
|
|
58
|
+
</html>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Props and state boards
|
|
62
|
+
|
|
63
|
+
- The canvas has no prop switcher. Draw each state as its own board: a wrapper of the base board with fixed props, named `<Board><State>` (`GreetingDark`), with its own title, placed on a page.
|
|
64
|
+
- A wrapper is the example above: one `<dc-import>` with the fixed props, the `theme` prop passed down as `theme="{{theme}}"`, and the same `$preview` size as the base.
|
|
65
|
+
- Do not copy the base markup into a state board.
|
|
66
|
+
- Every board has a `theme` prop, `light` or `dark`, when the project has both themes.
|
|
67
|
+
|
|
68
|
+
## Tokens
|
|
69
|
+
|
|
70
|
+
- Colors, radius and type come from the project's token files (this repo: `app/src/app/ui-tokens.css` and `globals.css`). Write `var(--token)` and never a close value. If a value is missing, ask.
|
|
71
|
+
- Put styles that many boards share in `<designDir>/shared/*.css`.
|
|
72
|
+
- English boards set `<html lang="en" dir="ltr">` and the same on the root element. A project in another language sets its own `lang` and `dir`.
|
|
73
|
+
|
|
74
|
+
## design/canvas.json
|
|
75
|
+
|
|
76
|
+
Top level: `{ "version": 1, "pages": [...], "overrides": {...}, "bindings": {...} }`. `overrides` and `bindings` are required. The canvas writes them, so leave their content as it is. A new file starts with `"overrides": {"colors": {}, "radius": {}, "type": {}}` and `"bindings": {}`. `irsim lint` reports an error when either is missing or malformed.
|
|
77
|
+
|
|
78
|
+
Page:
|
|
79
|
+
|
|
80
|
+
| Field | Type | Required | Notes |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| `id` | string | yes | Used in the route `/p/<id>`. Lowercase kebab-case. |
|
|
83
|
+
| `title` | string | yes | Shown in the sidebar. At most 120 characters. |
|
|
84
|
+
| `icon` | string | no | A Lucide icon name in kebab-case. Give every page one. |
|
|
85
|
+
| `sections` | array | no | Section entries, below. |
|
|
86
|
+
| `boards` | array | yes | Board entries, below. |
|
|
87
|
+
|
|
88
|
+
Board entry:
|
|
89
|
+
|
|
90
|
+
| Field | Type | Required | Notes |
|
|
91
|
+
|---|---|---|---|
|
|
92
|
+
| `name` | string | yes | The board file name without `.html`. A name with no file is dropped. |
|
|
93
|
+
| `title` | string | filled | Read from `<title>`. Never write it by hand. |
|
|
94
|
+
| `width`, `height` | number | filled | Read from `$preview`. Never write them by hand. A size under 240 x 160 gets a lint warning and is fine for a small part. |
|
|
95
|
+
| `x`, `y` | number | filled | Canvas position. Leave out for a new board, it is placed below the others. Do not place by hand. |
|
|
96
|
+
| `section` | string | no | The `id` of the innermost section of the same page. |
|
|
97
|
+
| `interactive` | boolean | no | Overrides the guess whether the board is a prototype. |
|
|
98
|
+
| `expand` | string | no | `"fill"` makes it a web page in full screen play. |
|
|
99
|
+
| `variantOf`, `variantLabel` | string | no | Written by the Variants feature. Do not write them. |
|
|
100
|
+
| `baseHash` | string | no | Written by the canvas. Do not write it. |
|
|
101
|
+
|
|
102
|
+
Section entry:
|
|
103
|
+
|
|
104
|
+
| Field | Type | Required | Notes |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `id` | string | yes | Unique on the page. |
|
|
107
|
+
| `title` | string | yes | Shown as the section label. |
|
|
108
|
+
| `parent` | string | no | The `id` of another section of the page. At most 3 levels, no cycle. |
|
|
109
|
+
| `color` | string | no | `gray` (default), `blue`, `green`, `amber`, `purple` or `red`. |
|
|
110
|
+
| `x`, `y`, `width`, `height` | number | no | A stored area. All four or none. Written by the canvas. |
|
|
111
|
+
| `layout` | object | no | `{ "mode": "wrap", "gap": 0 to 400 }`. Written by the canvas. |
|
|
112
|
+
| `variantOf`, `baseSection` | string | no | Written by the Variants feature. Do not write them. |
|
|
113
|
+
|
|
114
|
+
A complete 2-page example (the fields marked filled are left out on purpose):
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"version": 1,
|
|
119
|
+
"pages": [
|
|
120
|
+
{
|
|
121
|
+
"id": "onboarding",
|
|
122
|
+
"title": "Onboarding",
|
|
123
|
+
"icon": "hand",
|
|
124
|
+
"sections": [
|
|
125
|
+
{ "id": "greeting", "title": "Greeting" },
|
|
126
|
+
{ "id": "greeting-states", "title": "States", "parent": "greeting", "color": "red" }
|
|
127
|
+
],
|
|
128
|
+
"boards": [
|
|
129
|
+
{ "name": "Greeting", "section": "greeting" },
|
|
130
|
+
{ "name": "GreetingDark", "section": "greeting-states" }
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "settings",
|
|
135
|
+
"title": "Settings",
|
|
136
|
+
"icon": "settings",
|
|
137
|
+
"boards": [{ "name": "SettingsForm" }]
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"overrides": { "colors": {}, "radius": {}, "type": {} },
|
|
141
|
+
"bindings": {}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`irsim build` fills `title`, `width`, `height`, `x` and `y` from the board files, adds boards that no page lists to the `unsorted` page, and drops entries whose file is gone. A file that has no entry yet shows up on the `unsorted` page.
|
|
146
|
+
|
|
147
|
+
## Finish
|
|
148
|
+
|
|
149
|
+
1. Run `irsim lint`. Fix every error and read every warning. `design_canvas {action: "lint"}` returns the same list.
|
|
150
|
+
2. Run `irsim build` to fill `canvas.json`. Never hand-write `title`, `width` or `height`. `irsim lint --fix` runs the build too and also renames legacy `.dc.html` files to `.html`.
|
|
151
|
+
3. Run `design_canvas {action: "check", page: "<id>"}` and look at the screenshots. `check` also lists every lint error first, under `Format problems:`, and the warnings of the checked boards. It counts the other warnings, and `design_canvas {action: "lint"}` lists them.
|
|
152
|
+
4. Report the board routes `/p/<page>?board=<Board>`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim-doctor
|
|
3
|
+
description: Check the project rules, git setup and config. Use when the user runs /irsim-doctor or asks to diagnose the irsim project setup.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /irsim-doctor
|
|
7
|
+
|
|
8
|
+
Run the irsim doctor checks for the current project.
|
|
9
|
+
|
|
10
|
+
1. Call the `design_canvas` MCP tool with `{"action": "doctor"}`. The tool is `design_canvas` on the irsim MCP server (named `irsim_irsim` in agy). Its arguments are given here, so call it at once: do not read its schema file, `instructions.md` or any other file first.
|
|
11
|
+
2. Report the doctor output clearly, highlighting any warnings, failures, and their suggested fix commands.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim-stop
|
|
3
|
+
description: Stop listening for irsim comments. Use when the user runs /irsim-stop or asks to disconnect this session from the irsim design canvas.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /irsim-stop
|
|
7
|
+
|
|
8
|
+
Stop listening for irsim canvas comments in this session.
|
|
9
|
+
|
|
10
|
+
1. Call the `design_canvas` MCP tool with `{"action": "stop"}`. The tool is `design_canvas` on the irsim MCP server (named `irsim_irsim` in agy). Its arguments are given here, so call it at once: do not read its schema file, `instructions.md` or any other file first.
|
|
11
|
+
2. Confirm briefly to the user that the session stopped listening (and that running `/irsim` resumes it).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: irsim-workflow
|
|
3
|
+
description: The design-first process for any project that keeps its screens as boards in irsim. Use before planning or changing anything a person sees (a screen, popup, state, layout or shared component), when the user pastes a screenshot or asks to move, add, remove or restyle UI, and when implementing from a board. The board changes first, the user confirms it, then the code follows, and the board stays in step with the app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# irsim workflow
|
|
7
|
+
|
|
8
|
+
Load the `irsim-design` skill before you create or edit a board file or `design/canvas.json`.
|
|
9
|
+
|
|
10
|
+
The boards in the design folder are the design. The app must match them, and they must match the app.
|
|
11
|
+
|
|
12
|
+
## When this applies
|
|
13
|
+
|
|
14
|
+
Any change to what a screen shows or lets the user do: moving, adding, removing, resizing or restyling anything visible, including a one-control move or a layout that differs at one breakpoint.
|
|
15
|
+
|
|
16
|
+
It does not apply to a change that alters nothing a person sees (a refactor, a server-only fix with no visible effect).
|
|
17
|
+
|
|
18
|
+
## The order
|
|
19
|
+
|
|
20
|
+
1. Plan. Name the boards that change, what changes in each, and the app files that would follow. List open choices, do not decide them. Put the board change in the plan as its own step, before the implementation steps.
|
|
21
|
+
2. Change the board. Edit the board file, `<Name>.html` (`.dc.html` is a legacy form that is still read). Draw the new states: disabled and locked controls, confirmation dialogs, empty, loading and error states, and every language and width the screen has. The canvas has no prop switcher: the user sees only the boards placed on a page. Draw each state, and each option of a choice the user must make, as its own state board: a `dc-import` wrapper of the base board with fixed props, named `<Board><State>`, with a title, placed on the page. Group the states of one screen in a section (see Sections).
|
|
22
|
+
3. Check the board. Run `design_canvas {action: "check", board: "<Board>"}` (or `page` for every board of a page). Fix every error and warning it lists, then open the screenshot it returns and look at it. Check again until it reports `ok`.
|
|
23
|
+
4. Report and stop. Give the board name and its route (`/p/<page>?board=<Board>`), the plan and the open choices. Give the route of each state board. Never ask the user to set a prop value to see a state. Write no app code until the user confirms in a separate message. A request is not a confirmation: "implement", "make it", "move X" and a pasted screenshot all ask for the board change. The user can also confirm with the Approve button in irsim: a turn that starts with "Design canvas: the user approved board X" is the confirmation for that board. If that turn says the board changed after the approval, it is not a confirmation; ask again.
|
|
24
|
+
5. Implement. Read the board file again first, because the user may have edited it. A board the user edited is the source of truth over your last copy and over the plan.
|
|
25
|
+
6. Compare by looking. Screenshot the board in irsim and the running screen at the same width with Playwright, list every difference (layout, spacing, alignment, icons, cell content, header, footer), fix them, and screenshot again. Reading the markup or the component code is not a comparison.
|
|
26
|
+
7. Keep them in step. Any later change to a screen in the app updates its board in the same change. Add, rename or remove a board and update the project's board index.
|
|
27
|
+
|
|
28
|
+
## Sections
|
|
29
|
+
|
|
30
|
+
- `design/canvas.json` groups a page's boards in sections: `"sections": [{ "id": "leads", "title": "Leads" }, { "id": "leads-incoming", "title": "Incoming", "parent": "leads", "color": "red" }]`. A board joins one with `"section": "leads-incoming"`.
|
|
31
|
+
- Put one screen in one section, and each group of its states in a sub-section. Sections nest at most 3 levels.
|
|
32
|
+
- `color` is one of `gray` (the default), `blue`, `green`, `amber`, `purple` and `red`. Use it to tell groups apart, for example `red` for error states.
|
|
33
|
+
- A page in `design/canvas.json` has an optional `"icon"`, a Lucide icon name in kebab-case. Give every new page an icon that fits its subject, and change it when the user asks.
|
|
34
|
+
- Place boards 80 units apart so frame titles and section labels have room.
|
|
35
|
+
- A new board without x and y is placed under all existing boards of its page, and a move that overlaps another board pushes that board apart, so do not place boards by hand.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- A board that shrinks by more than 30% in `git diff --stat` needs the user's yes in chat before you keep it.
|
|
40
|
+
- Shared boards (table, sidebar, topbar, menu, nav) move many screens at once. Say which screens a change touches.
|
|
41
|
+
- Use only the project's design system values. Never pick a close enough color or radius. If a value is missing, ask.
|
|
42
|
+
- Read only the boards you change, with `rg` or `sed -n`, never a whole large board.
|
|
43
|
+
- A pull request that changes UI source without a board change is incomplete, unless the change alters nothing visible and says so.
|
|
44
|
+
- Replies to canvas comments: Reply in at most three short sentences. Put long detail in the board or a file and link to it, not in the reply.
|
|
45
|
+
- Styles that many boards share go in `design/shared/*.css`, helpers in `design/shared/*.js` (the exports reach a board script as `shared.<name>`, for example `design/shared/table-sort.js` as `shared.tableSort`), and images and fonts in `design/shared/`, referenced as `./shared/<path>`. Keep components as `dc-import` boards.
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kafbit/irsim-connectors",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "irsim connectors for Pi, OpenCode and Command Code: the design_canvas tool, canvas comments delivered to the session, and the irsim-workflow and irsim-design skills.",
|
|
3
|
+
"version": "0.7.1",
|
|
4
|
+
"description": "irsim connectors for Antigravity, Pi, OpenCode and Command Code: the design_canvas tool, canvas comments delivered to the session, and the irsim-workflow and irsim-design skills.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"homepage": "https://github.com/kafbit/irsim",
|
|
7
7
|
"repository": { "type": "git", "url": "git+https://github.com/kafbit/irsim.git", "directory": "plugin" },
|
|
8
8
|
"bugs": "https://github.com/kafbit/irsim/issues",
|
|
9
|
-
"keywords": ["pi-package", "opencode", "opencode-plugin", "command-code", "irsim", "design", "canvas"],
|
|
10
|
-
"
|
|
9
|
+
"keywords": ["antigravity", "agy", "pi-package", "opencode", "opencode-plugin", "command-code", "irsim", "design", "canvas"],
|
|
10
|
+
"bin": { "irsim-connectors": "./bin/irsim-connectors.mjs" },
|
|
11
|
+
"files": ["bin/irsim-connectors.mjs", "harnesses/antigravity", "harnesses/pi/irsim.ts", "harnesses/opencode/irsim.js", "harnesses/command-code/irsim.ts", "skills/irsim-workflow", "skills/irsim-design"],
|
|
11
12
|
"exports": { "./server": "./harnesses/opencode/irsim.js" },
|
|
12
13
|
"pi": { "extensions": ["./harnesses/pi/irsim.ts"], "skills": ["./skills/irsim-workflow", "./skills/irsim-design"] },
|
|
13
14
|
"commandcode": { "mods": ["./harnesses/command-code/irsim.ts"], "skills": ["./skills/irsim-workflow", "./skills/irsim-design"] },
|