human2ai 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/LICENSE +21 -0
- package/README.md +120 -0
- package/assets/quaternius/License_Standard.txt +22 -0
- package/assets/quaternius/README.md +31 -0
- package/assets/quaternius/Superhero_Female_FullBody.bin +0 -0
- package/assets/quaternius/Superhero_Female_FullBody.gltf +2056 -0
- package/assets/quaternius/Superhero_Male_FullBody.bin +0 -0
- package/assets/quaternius/Superhero_Male_FullBody.gltf +2018 -0
- package/dist/cli/integration.d.ts +39 -0
- package/dist/cli/integration.js +466 -0
- package/dist/cli/integration.js.map +1 -0
- package/dist/cli/main.d.ts +17 -0
- package/dist/cli/main.js +1455 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/database/composition-session-repository.d.ts +37 -0
- package/dist/database/composition-session-repository.js +147 -0
- package/dist/database/composition-session-repository.js.map +1 -0
- package/dist/database/draft-version-errors.d.ts +29 -0
- package/dist/database/draft-version-errors.js +47 -0
- package/dist/database/draft-version-errors.js.map +1 -0
- package/dist/database/draft-version-store.d.ts +30 -0
- package/dist/database/draft-version-store.js +168 -0
- package/dist/database/draft-version-store.js.map +1 -0
- package/dist/database/image-asset-repository.d.ts +37 -0
- package/dist/database/image-asset-repository.js +101 -0
- package/dist/database/image-asset-repository.js.map +1 -0
- package/dist/database/image-input.d.ts +15 -0
- package/dist/database/image-input.js +28 -0
- package/dist/database/image-input.js.map +1 -0
- package/dist/database/migrate.d.ts +4 -0
- package/dist/database/migrate.js +45 -0
- package/dist/database/migrate.js.map +1 -0
- package/dist/database/project-session-repository.d.ts +72 -0
- package/dist/database/project-session-repository.js +291 -0
- package/dist/database/project-session-repository.js.map +1 -0
- package/dist/database/spatial-session-repository.d.ts +26 -0
- package/dist/database/spatial-session-repository.js +44 -0
- package/dist/database/spatial-session-repository.js.map +1 -0
- package/dist/database/style-library-repository.d.ts +70 -0
- package/dist/database/style-library-repository.js +290 -0
- package/dist/database/style-library-repository.js.map +1 -0
- package/dist/database/svg-input.d.ts +1 -0
- package/dist/database/svg-input.js +77 -0
- package/dist/database/svg-input.js.map +1 -0
- package/dist/database/ui-sketch-session-repository.d.ts +19 -0
- package/dist/database/ui-sketch-session-repository.js +35 -0
- package/dist/database/ui-sketch-session-repository.js.map +1 -0
- package/dist/domain/canvas-layer-order.d.ts +6 -0
- package/dist/domain/canvas-layer-order.js +40 -0
- package/dist/domain/canvas-layer-order.js.map +1 -0
- package/dist/domain/canvas-node-metadata.d.ts +20 -0
- package/dist/domain/canvas-node-metadata.js +17 -0
- package/dist/domain/canvas-node-metadata.js.map +1 -0
- package/dist/domain/canvas-states.d.ts +8 -0
- package/dist/domain/canvas-states.js +23 -0
- package/dist/domain/canvas-states.js.map +1 -0
- package/dist/domain/composition/analysis.d.ts +104 -0
- package/dist/domain/composition/analysis.js +337 -0
- package/dist/domain/composition/analysis.js.map +1 -0
- package/dist/domain/composition/camera-reference.d.ts +24 -0
- package/dist/domain/composition/camera-reference.js +34 -0
- package/dist/domain/composition/camera-reference.js.map +1 -0
- package/dist/domain/composition/draft.d.ts +50 -0
- package/dist/domain/composition/draft.js +609 -0
- package/dist/domain/composition/draft.js.map +1 -0
- package/dist/domain/composition/frame.d.ts +23 -0
- package/dist/domain/composition/frame.js +154 -0
- package/dist/domain/composition/frame.js.map +1 -0
- package/dist/domain/composition/geometry.d.ts +15 -0
- package/dist/domain/composition/geometry.js +262 -0
- package/dist/domain/composition/geometry.js.map +1 -0
- package/dist/domain/composition/index.d.ts +13 -0
- package/dist/domain/composition/index.js +10 -0
- package/dist/domain/composition/index.js.map +1 -0
- package/dist/domain/composition/layers.d.ts +4 -0
- package/dist/domain/composition/layers.js +12 -0
- package/dist/domain/composition/layers.js.map +1 -0
- package/dist/domain/composition/records.d.ts +14 -0
- package/dist/domain/composition/records.js +2 -0
- package/dist/domain/composition/records.js.map +1 -0
- package/dist/domain/composition/refinement/engine.d.ts +12 -0
- package/dist/domain/composition/refinement/engine.js +521 -0
- package/dist/domain/composition/refinement/engine.js.map +1 -0
- package/dist/domain/composition/refinement/relations.d.ts +16 -0
- package/dist/domain/composition/refinement/relations.js +293 -0
- package/dist/domain/composition/refinement/relations.js.map +1 -0
- package/dist/domain/composition/refinement/types.d.ts +181 -0
- package/dist/domain/composition/refinement/types.js +2 -0
- package/dist/domain/composition/refinement/types.js.map +1 -0
- package/dist/domain/composition/render.d.ts +5 -0
- package/dist/domain/composition/render.js +169 -0
- package/dist/domain/composition/render.js.map +1 -0
- package/dist/domain/composition/states.d.ts +9 -0
- package/dist/domain/composition/states.js +104 -0
- package/dist/domain/composition/states.js.map +1 -0
- package/dist/domain/composition/types.d.ts +149 -0
- package/dist/domain/composition/types.js +2 -0
- package/dist/domain/composition/types.js.map +1 -0
- package/dist/domain/composition/workflow.d.ts +15 -0
- package/dist/domain/composition/workflow.js +77 -0
- package/dist/domain/composition/workflow.js.map +1 -0
- package/dist/domain/fingerprint.d.ts +2 -0
- package/dist/domain/fingerprint.js +25 -0
- package/dist/domain/fingerprint.js.map +1 -0
- package/dist/domain/session/canvas-edit-history.d.ts +17 -0
- package/dist/domain/session/canvas-edit-history.js +53 -0
- package/dist/domain/session/canvas-edit-history.js.map +1 -0
- package/dist/domain/session/capabilities.d.ts +16 -0
- package/dist/domain/session/capabilities.js +84 -0
- package/dist/domain/session/capabilities.js.map +1 -0
- package/dist/domain/session/draft-version.d.ts +41 -0
- package/dist/domain/session/draft-version.js +2 -0
- package/dist/domain/session/draft-version.js.map +1 -0
- package/dist/domain/session/index.d.ts +5 -0
- package/dist/domain/session/index.js +3 -0
- package/dist/domain/session/index.js.map +1 -0
- package/dist/domain/session/types.d.ts +23 -0
- package/dist/domain/session/types.js +2 -0
- package/dist/domain/session/types.js.map +1 -0
- package/dist/domain/spatial/assets/quaternius-female-rig.json +799 -0
- package/dist/domain/spatial/assets/quaternius-rig.json +799 -0
- package/dist/domain/spatial/assets/quaternius-superhero-female.json +1 -0
- package/dist/domain/spatial/assets/quaternius-superhero.json +1 -0
- package/dist/domain/spatial/camera-box.d.ts +13 -0
- package/dist/domain/spatial/camera-box.js +52 -0
- package/dist/domain/spatial/camera-box.js.map +1 -0
- package/dist/domain/spatial/geometric-model.d.ts +4 -0
- package/dist/domain/spatial/geometric-model.js +101 -0
- package/dist/domain/spatial/geometric-model.js.map +1 -0
- package/dist/domain/spatial/hands.d.ts +36 -0
- package/dist/domain/spatial/hands.js +128 -0
- package/dist/domain/spatial/hands.js.map +1 -0
- package/dist/domain/spatial/index.d.ts +30 -0
- package/dist/domain/spatial/index.js +381 -0
- package/dist/domain/spatial/index.js.map +1 -0
- package/dist/domain/spatial/kinematics.d.ts +27 -0
- package/dist/domain/spatial/kinematics.js +285 -0
- package/dist/domain/spatial/kinematics.js.map +1 -0
- package/dist/domain/spatial/lighting.d.ts +35 -0
- package/dist/domain/spatial/lighting.js +173 -0
- package/dist/domain/spatial/lighting.js.map +1 -0
- package/dist/domain/spatial/model.d.ts +5 -0
- package/dist/domain/spatial/model.js +193 -0
- package/dist/domain/spatial/model.js.map +1 -0
- package/dist/domain/spatial/morph.d.ts +3 -0
- package/dist/domain/spatial/morph.js +187 -0
- package/dist/domain/spatial/morph.js.map +1 -0
- package/dist/domain/spatial/proportions.d.ts +46 -0
- package/dist/domain/spatial/proportions.js +59 -0
- package/dist/domain/spatial/proportions.js.map +1 -0
- package/dist/domain/spatial/reference-lines.d.ts +6 -0
- package/dist/domain/spatial/reference-lines.js +58 -0
- package/dist/domain/spatial/reference-lines.js.map +1 -0
- package/dist/domain/spatial/scene-cache.d.ts +15 -0
- package/dist/domain/spatial/scene-cache.js +69 -0
- package/dist/domain/spatial/scene-cache.js.map +1 -0
- package/dist/domain/spatial/scene.d.ts +8 -0
- package/dist/domain/spatial/scene.js +69 -0
- package/dist/domain/spatial/scene.js.map +1 -0
- package/dist/domain/spatial/types.d.ts +187 -0
- package/dist/domain/spatial/types.js +5 -0
- package/dist/domain/spatial/types.js.map +1 -0
- package/dist/domain/style/index.d.ts +1 -0
- package/dist/domain/style/index.js +2 -0
- package/dist/domain/style/index.js.map +1 -0
- package/dist/domain/style/prompt-summary.d.ts +2 -0
- package/dist/domain/style/prompt-summary.js +11 -0
- package/dist/domain/style/prompt-summary.js.map +1 -0
- package/dist/domain/style/types.d.ts +32 -0
- package/dist/domain/style/types.js +3 -0
- package/dist/domain/style/types.js.map +1 -0
- package/dist/domain/ui-sketch/draft.d.ts +12 -0
- package/dist/domain/ui-sketch/draft.js +424 -0
- package/dist/domain/ui-sketch/draft.js.map +1 -0
- package/dist/domain/ui-sketch/geometry.d.ts +7 -0
- package/dist/domain/ui-sketch/geometry.js +11 -0
- package/dist/domain/ui-sketch/geometry.js.map +1 -0
- package/dist/domain/ui-sketch/groups.d.ts +5 -0
- package/dist/domain/ui-sketch/groups.js +40 -0
- package/dist/domain/ui-sketch/groups.js.map +1 -0
- package/dist/domain/ui-sketch/index.d.ts +8 -0
- package/dist/domain/ui-sketch/index.js +8 -0
- package/dist/domain/ui-sketch/index.js.map +1 -0
- package/dist/domain/ui-sketch/layers.d.ts +4 -0
- package/dist/domain/ui-sketch/layers.js +11 -0
- package/dist/domain/ui-sketch/layers.js.map +1 -0
- package/dist/domain/ui-sketch/render.d.ts +2 -0
- package/dist/domain/ui-sketch/render.js +58 -0
- package/dist/domain/ui-sketch/render.js.map +1 -0
- package/dist/domain/ui-sketch/standardize.d.ts +17 -0
- package/dist/domain/ui-sketch/standardize.js +139 -0
- package/dist/domain/ui-sketch/standardize.js.map +1 -0
- package/dist/domain/ui-sketch/states.d.ts +5 -0
- package/dist/domain/ui-sketch/states.js +21 -0
- package/dist/domain/ui-sketch/states.js.map +1 -0
- package/dist/domain/ui-sketch/types.d.ts +73 -0
- package/dist/domain/ui-sketch/types.js +2 -0
- package/dist/domain/ui-sketch/types.js.map +1 -0
- package/dist/server/app.d.ts +18 -0
- package/dist/server/app.js +108 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/image-content-type-parser.d.ts +2 -0
- package/dist/server/image-content-type-parser.js +5 -0
- package/dist/server/image-content-type-parser.js.map +1 -0
- package/dist/server/routes/composition-sessions.d.ts +3 -0
- package/dist/server/routes/composition-sessions.js +190 -0
- package/dist/server/routes/composition-sessions.js.map +1 -0
- package/dist/server/routes/draft-version-routes.d.ts +10 -0
- package/dist/server/routes/draft-version-routes.js +201 -0
- package/dist/server/routes/draft-version-routes.js.map +1 -0
- package/dist/server/routes/image-assets.d.ts +3 -0
- package/dist/server/routes/image-assets.js +114 -0
- package/dist/server/routes/image-assets.js.map +1 -0
- package/dist/server/routes/project-sessions.d.ts +48 -0
- package/dist/server/routes/project-sessions.js +305 -0
- package/dist/server/routes/project-sessions.js.map +1 -0
- package/dist/server/routes/spatial-sessions.d.ts +3 -0
- package/dist/server/routes/spatial-sessions.js +80 -0
- package/dist/server/routes/spatial-sessions.js.map +1 -0
- package/dist/server/routes/style-library.d.ts +3 -0
- package/dist/server/routes/style-library.js +308 -0
- package/dist/server/routes/style-library.js.map +1 -0
- package/dist/server/routes/ui-sketch-sessions.d.ts +3 -0
- package/dist/server/routes/ui-sketch-sessions.js +14 -0
- package/dist/server/routes/ui-sketch-sessions.js.map +1 -0
- package/dist/server/runtime.d.ts +30 -0
- package/dist/server/runtime.js +123 -0
- package/dist/server/runtime.js.map +1 -0
- package/dist/server/spatial-render.d.ts +5 -0
- package/dist/server/spatial-render.js +360 -0
- package/dist/server/spatial-render.js.map +1 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +3 -0
- package/dist/server/start.js.map +1 -0
- package/licenses/THIRD-PARTY-NOTICES.txt +16664 -0
- package/licenses/YisiUI-LICENSE +21 -0
- package/locales/en/common.json +671 -0
- package/migrations/0001_projects_and_sessions.sql +45 -0
- package/migrations/0002_composition_versions_and_refinements.sql +26 -0
- package/migrations/0003_ui_sketch_draft_versions.sql +12 -0
- package/migrations/0004_image_assets.sql +16 -0
- package/migrations/0005_style_library.sql +31 -0
- package/migrations/0006_session_styles.sql +6 -0
- package/migrations/0007_svg_image_assets.sql +19 -0
- package/migrations/0008_spatial_spaces.sql +20 -0
- package/package.json +82 -0
- package/schemas/composition-draft.schema.json +234 -0
- package/schemas/composition-refinement-plan.schema.json +758 -0
- package/schemas/spatial-draft.schema.json +517 -0
- package/schemas/spatial-operations.schema.json +1082 -0
- package/schemas/ui-layout-standardization-plan.schema.json +29 -0
- package/schemas/ui-sketch-draft.schema.json +197 -0
- package/skills/human2ai/SKILL.md +149 -0
- package/skills/human2ai/agents/openai.yaml +3 -0
- package/skills/human2ai/references/composition-projection.md +170 -0
- package/skills/human2ai/references/composition.md +79 -0
- package/skills/human2ai/references/spatial.md +188 -0
- package/skills/human2ai/references/svg-images.md +27 -0
- package/skills/human2ai/references/ui-layout.md +100 -0
- package/web/out/404/index.html +1 -0
- package/web/out/404.html +1 -0
- package/web/out/__next.__PAGE__.txt +26 -0
- package/web/out/__next._full.txt +21 -0
- package/web/out/__next._tree.txt +4 -0
- package/web/out/_next/static/TV-jgcACg6HANZAMZTE2S/_buildManifest.js +1 -0
- package/web/out/_next/static/TV-jgcACg6HANZAMZTE2S/_ssgManifest.js +1 -0
- package/web/out/_next/static/chunks/130-9fadd0432daff55d.js +1 -0
- package/web/out/_next/static/chunks/158-eb00456e1bab68b3.js +52 -0
- package/web/out/_next/static/chunks/20-0801fc297cda2a7a.js +1 -0
- package/web/out/_next/static/chunks/248-d4a79649dae2a3f8.js +259 -0
- package/web/out/_next/static/chunks/678-1305cadf8254d814.js +1 -0
- package/web/out/_next/static/chunks/728-eb8b667f79229443.js +1 -0
- package/web/out/_next/static/chunks/83607670-bc1279370476e59f.js +1 -0
- package/web/out/_next/static/chunks/app/_global-error/page-5eece43b8152c414.js +1 -0
- package/web/out/_next/static/chunks/app/_not-found/page-c0cd75ac39fbf9cf.js +1 -0
- package/web/out/_next/static/chunks/app/composition/page-051ee2fabb12110a.js +1 -0
- package/web/out/_next/static/chunks/app/layout-745ca27ef8830f4f.js +1 -0
- package/web/out/_next/static/chunks/app/page-0027378a269a6168.js +1 -0
- package/web/out/_next/static/chunks/app/spatial/page-266dedc81784d4f6.js +1 -0
- package/web/out/_next/static/chunks/app/styles/page-d5cb83af828ea9ed.js +1 -0
- package/web/out/_next/static/chunks/app/ui-sketch/page-2a8436e05a05c618.js +1 -0
- package/web/out/_next/static/chunks/c3f2cda1-9e279dab137b7272.js +342 -0
- package/web/out/_next/static/chunks/c7879cf7-7873c8afd9c9c666.js +1 -0
- package/web/out/_next/static/chunks/framework-6eacf80ec1e4c887.js +1 -0
- package/web/out/_next/static/chunks/main-5ee8fd93319f955c.js +5 -0
- package/web/out/_next/static/chunks/main-app-0cf10803ab17c700.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/app-error-5eece43b8152c414.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/forbidden-5eece43b8152c414.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/global-error-728204b7cccc4ed2.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/not-found-5eece43b8152c414.js +1 -0
- package/web/out/_next/static/chunks/next/dist/client/components/builtin/unauthorized-5eece43b8152c414.js +1 -0
- package/web/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/web/out/_next/static/chunks/webpack-97ae63c0e0b2a512.js +1 -0
- package/web/out/_next/static/css/3b7982b41ed8eccd.css +4 -0
- package/web/out/_next/static/css/81ae71f1d3e9a866.css +1 -0
- package/web/out/_next/static/css/8c3843f4951fa9f6.css +5 -0
- package/web/out/_next/static/css/c739d0131cdcc891.css +1 -0
- package/web/out/_next/static/css/ce1b4bb3ad3c6073.css +1 -0
- package/web/out/_next/static/css/db96ae2e88545d96.css +1 -0
- package/web/out/_not-found/__next._full.txt +18 -0
- package/web/out/_not-found/__next._not-found.__PAGE__.txt +24 -0
- package/web/out/_not-found/__next._tree.txt +3 -0
- package/web/out/_not-found/index.html +1 -0
- package/web/out/_not-found/index.txt +18 -0
- package/web/out/composition/__next._full.txt +25 -0
- package/web/out/composition/__next._tree.txt +6 -0
- package/web/out/composition/__next.composition.__PAGE__.txt +31 -0
- package/web/out/composition/index.html +1 -0
- package/web/out/composition/index.txt +25 -0
- package/web/out/index.html +1 -0
- package/web/out/index.txt +21 -0
- package/web/out/spatial/__next._full.txt +23 -0
- package/web/out/spatial/__next._tree.txt +4 -0
- package/web/out/spatial/__next.spatial.__PAGE__.txt +29 -0
- package/web/out/spatial/index.html +1 -0
- package/web/out/spatial/index.txt +23 -0
- package/web/out/styles/__next._full.txt +23 -0
- package/web/out/styles/__next._tree.txt +4 -0
- package/web/out/styles/__next.styles.__PAGE__.txt +29 -0
- package/web/out/styles/index.html +1 -0
- package/web/out/styles/index.txt +23 -0
- package/web/out/ui-sketch/__next._full.txt +25 -0
- package/web/out/ui-sketch/__next._tree.txt +6 -0
- package/web/out/ui-sketch/__next.ui-sketch.__PAGE__.txt +31 -0
- package/web/out/ui-sketch/index.html +1 -0
- package/web/out/ui-sketch/index.txt +25 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"additionalProperties": false,
|
|
5
|
+
"required": ["sourceFingerprint", "alignments"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"sourceFingerprint": { "type": "string", "minLength": 1 },
|
|
8
|
+
"alignments": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["stageId", "axis", "edge", "anchorId", "itemIds"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"stageId": { "type": "string", "minLength": 1 },
|
|
16
|
+
"axis": { "enum": ["x", "y"] },
|
|
17
|
+
"edge": { "enum": ["start", "center", "end"] },
|
|
18
|
+
"anchorId": { "type": "string", "minLength": 1 },
|
|
19
|
+
"itemIds": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"minItems": 1,
|
|
22
|
+
"uniqueItems": true,
|
|
23
|
+
"items": { "type": "string", "minLength": 1 }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://yisi.local/schemas/ui-sketch-draft.schema.json",
|
|
4
|
+
"title": "UI Sketch Draft",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["version", "kind", "frame", "overallNote", "rectangles", "texts", "images", "groups", "stages"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"layerOrder": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
|
|
10
|
+
"version": { "const": 1 },
|
|
11
|
+
"kind": { "const": "ui-layout-draft" },
|
|
12
|
+
"frame": { "$ref": "#/$defs/bounds" },
|
|
13
|
+
"overallNote": { "type": "string" },
|
|
14
|
+
"stateTabs": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"minItems": 1,
|
|
17
|
+
"items": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"required": ["id", "number"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": { "type": "string", "minLength": 1 },
|
|
23
|
+
"number": { "type": "integer", "minimum": 1 },
|
|
24
|
+
"name": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "\\S" }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"groups": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["id", "itemIds"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"id": { "type": "string", "minLength": 1 },
|
|
36
|
+
"itemIds": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"minItems": 2,
|
|
39
|
+
"uniqueItems": true,
|
|
40
|
+
"items": { "type": "string", "minLength": 1 }
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"rectangles": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"required": ["id", "x", "y", "width", "height", "note", "annotation", "semanticType", "origin", "visible", "weight"],
|
|
51
|
+
"properties": {
|
|
52
|
+
"id": { "type": "string", "minLength": 1 },
|
|
53
|
+
"x": { "type": "number" },
|
|
54
|
+
"y": { "type": "number" },
|
|
55
|
+
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
56
|
+
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
57
|
+
"note": { "type": "string" },
|
|
58
|
+
"annotation": { "type": "string" },
|
|
59
|
+
"semanticType": { "type": "string" },
|
|
60
|
+
"origin": { "enum": ["user", "agent", "import"] },
|
|
61
|
+
"visible": { "type": "boolean" },
|
|
62
|
+
"weight": {
|
|
63
|
+
"enum": ["auto", "high", "medium", "low", "decorative"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"texts": {
|
|
69
|
+
"type": "array",
|
|
70
|
+
"items": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"required": ["id", "x", "y", "text", "fontSize", "note", "annotation", "semanticType", "origin", "visible", "weight"],
|
|
74
|
+
"properties": {
|
|
75
|
+
"id": { "type": "string", "minLength": 1 },
|
|
76
|
+
"x": { "type": "number" },
|
|
77
|
+
"y": { "type": "number" },
|
|
78
|
+
"text": { "type": "string" },
|
|
79
|
+
"fontSize": { "type": "number", "exclusiveMinimum": 0 },
|
|
80
|
+
"note": { "type": "string" },
|
|
81
|
+
"annotation": { "type": "string" },
|
|
82
|
+
"semanticType": { "type": "string" },
|
|
83
|
+
"origin": { "enum": ["user", "agent", "import"] },
|
|
84
|
+
"visible": { "type": "boolean" },
|
|
85
|
+
"weight": {
|
|
86
|
+
"enum": ["auto", "high", "medium", "low", "decorative"]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"images": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "object",
|
|
95
|
+
"additionalProperties": false,
|
|
96
|
+
"required": ["id", "x", "y", "width", "height", "assetId", "crop", "note", "annotation", "semanticType", "origin", "visible", "weight"],
|
|
97
|
+
"properties": {
|
|
98
|
+
"id": { "type": "string", "minLength": 1 },
|
|
99
|
+
"x": { "type": "number" },
|
|
100
|
+
"y": { "type": "number" },
|
|
101
|
+
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
102
|
+
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
103
|
+
"assetId": {
|
|
104
|
+
"type": ["string", "null"],
|
|
105
|
+
"minLength": 1
|
|
106
|
+
},
|
|
107
|
+
"crop": {
|
|
108
|
+
"oneOf": [
|
|
109
|
+
{ "type": "null" },
|
|
110
|
+
{ "$ref": "#/$defs/imageCrop" }
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"note": { "type": "string" },
|
|
114
|
+
"annotation": { "type": "string" },
|
|
115
|
+
"semanticType": { "type": "string" },
|
|
116
|
+
"origin": { "enum": ["user", "agent", "import"] },
|
|
117
|
+
"visible": { "type": "boolean" },
|
|
118
|
+
"weight": {
|
|
119
|
+
"enum": ["auto", "high", "medium", "low", "decorative"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"stages": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"required": ["id", "rectangles", "texts", "images"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"id": { "type": "string", "minLength": 1, "not": { "const": "start" } },
|
|
132
|
+
"rectangles": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": { "$ref": "#/$defs/stageRectangle" }
|
|
135
|
+
},
|
|
136
|
+
"texts": {
|
|
137
|
+
"type": "array",
|
|
138
|
+
"items": { "$ref": "#/$defs/stageText" }
|
|
139
|
+
},
|
|
140
|
+
"images": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": { "$ref": "#/$defs/stageRectangle" }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"$defs": {
|
|
149
|
+
"imageCrop": {
|
|
150
|
+
"type": "object",
|
|
151
|
+
"additionalProperties": false,
|
|
152
|
+
"required": ["x", "y", "width", "height"],
|
|
153
|
+
"properties": {
|
|
154
|
+
"x": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
155
|
+
"y": { "type": "number", "minimum": 0, "maximum": 1 },
|
|
156
|
+
"width": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 },
|
|
157
|
+
"height": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 }
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"bounds": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"additionalProperties": false,
|
|
163
|
+
"required": ["x", "y", "width", "height"],
|
|
164
|
+
"properties": {
|
|
165
|
+
"x": { "type": "number" },
|
|
166
|
+
"y": { "type": "number" },
|
|
167
|
+
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
168
|
+
"height": { "type": "number", "exclusiveMinimum": 0 }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"stageRectangle": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"required": ["id", "x", "y", "width", "height", "visible"],
|
|
175
|
+
"properties": {
|
|
176
|
+
"id": { "type": "string", "minLength": 1 },
|
|
177
|
+
"x": { "type": "number" },
|
|
178
|
+
"y": { "type": "number" },
|
|
179
|
+
"width": { "type": "number", "exclusiveMinimum": 0 },
|
|
180
|
+
"height": { "type": "number", "exclusiveMinimum": 0 },
|
|
181
|
+
"visible": { "type": "boolean" }
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"stageText": {
|
|
185
|
+
"type": "object",
|
|
186
|
+
"additionalProperties": false,
|
|
187
|
+
"required": ["id", "x", "y", "fontSize", "visible"],
|
|
188
|
+
"properties": {
|
|
189
|
+
"id": { "type": "string", "minLength": 1 },
|
|
190
|
+
"x": { "type": "number" },
|
|
191
|
+
"y": { "type": "number" },
|
|
192
|
+
"fontSize": { "type": "number", "exclusiveMinimum": 0 },
|
|
193
|
+
"visible": { "type": "boolean" }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: human2ai
|
|
3
|
+
description: Collaborate through local Human2AI design sessions, its style library, and its CLI. Use in a consumer project containing .human2ai/integration.json to inspect, edit, refine, review, or undo design work; to draw a reference picture as editable scene or editorial composition (“把这张图的构图画到画布上”); to project existing UI into a layout canvas (“把 UI 放到画布上让我修改”); or to reuse a visual style. The consumer project's Agent owns downstream implementation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Human2AI
|
|
7
|
+
|
|
8
|
+
Use Human2AI as the shared design-intent workspace. The user primarily edits and reviews in the browser. Use the CLI against the same typed session, then perform any downstream implementation in the consumer project yourself.
|
|
9
|
+
|
|
10
|
+
## Choose the operation channel
|
|
11
|
+
|
|
12
|
+
Default to the CLI for service checks, session discovery, capture reads and edits, state changes, refinement, asset access, and preview export. An open Human2AI page is not a prerequisite. Read structured captures to inspect document contents; do not scrape the page or simulate clicks and drags for operations the CLI supports.
|
|
13
|
+
|
|
14
|
+
Use Chrome MCP only when the task actually requires browser interaction, such as reproducing an interaction bug or exercising a consumer interface state that CLI data and exported artifacts cannot verify. Explain the interaction being checked before invoking it. Connecting to Human2AI, saving a canvas, or visually inspecting a static result alone does not require Chrome MCP. Export previews with the session's CLI operations and view the local image; rasterize SVG locally when the image viewer needs a bitmap. If that visual inspection is unavailable, report the limitation instead of automatically switching to Chrome MCP.
|
|
15
|
+
|
|
16
|
+
## Resolve the local integration
|
|
17
|
+
|
|
18
|
+
Read `.human2ai/integration.json` from the consumer repository before invoking the CLI. Execute its `runner` as an argument array and append the Human2AI arguments shown below. Do not assume that `human2ai` is globally installed, install a registry package, or access the Human2AI SQLite database directly.
|
|
19
|
+
|
|
20
|
+
Run the integration checks from the consumer repository root:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
<runner> integration doctor --root <consumer-root>
|
|
24
|
+
<runner> service status
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
When `integration doctor` returns `update-available`, run `<runner> integration sync --root <consumer-root>` immediately and continue. A copied Skill is replaced only when its installed digest still matches the managed version. If synchronization reports `INTEGRATION_CONFLICT`, do not overwrite the consumer copy; report the changed path. A linked Skill already reflects source edits, while `sync` only refreshes its recorded digest.
|
|
28
|
+
|
|
29
|
+
If the integration config is missing, stop and tell the user that this repository has not been connected to its local Human2AI source. Do not guess the source path.
|
|
30
|
+
|
|
31
|
+
## Use the shared style library
|
|
32
|
+
|
|
33
|
+
The style library is global to the local Human2AI service. Each composition or UI session can bind one of its styles; the browser and Agent share that binding. Search it when the user asks to reuse a style or when you need to select a style for canvas processing:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
<runner> style list [--category <visual|ui>] [--creator <user|agent>]
|
|
37
|
+
<runner> style get --style <style-id>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`style get` returns reference image URLs and the full description. Treat that description as an actionable design specification: layout, proportions, hierarchy, spacing, typography, palette, materials, and decorative treatment as applicable. Inspect available reference images to resolve the visual characteristics. The user's explicit content, functions, and placement requirements take precedence over the style specification.
|
|
41
|
+
|
|
42
|
+
When a style encountered during Agent work is worth keeping, save it directly as an Agent-created entry; there is no proposal or pending-review state:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
<runner> style create --name <name> --category <visual|ui> --description <specification> --summary <sentence>
|
|
46
|
+
<runner> style add-reference --style <style-id> --input <image> --expected-revision <n>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A style may have no reference image, but its design specification must be non-empty. Supply a separate concise sentence capturing its distinctive visual traits (typically 30–60 Chinese characters, maximum 240 characters). Browser prompt copying adds only this sentence, without a model call or the full specification. Keep the sentence consistent when editing the specification. Older entries without a sentence fall back to their first description sentence until edited. The creation entrypoint permanently marks these entries as `agent`; entries created in the browser remain `user` even after Agent edits. Update or permanently delete only when the user requests it or it is otherwise clearly part of the current task:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
<runner> style update --style <style-id> --expected-revision <n> [--name <name>] [--category <visual|ui>] [--description <specification>] [--summary <sentence>]
|
|
53
|
+
<runner> style remove-reference --style <style-id> --reference <reference-id> --expected-revision <n>
|
|
54
|
+
<runner> style delete --style <style-id> --expected-revision <n>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
On a revision conflict, read the current entry again and reconcile before retrying. Never attempt to change `creatorType`.
|
|
58
|
+
|
|
59
|
+
## Create or connect to the shared session
|
|
60
|
+
|
|
61
|
+
Check the service before starting work. If `service status` returns `SERVICE_UNAVAILABLE`, execute the config's `service.start` as an argument array in a persistent terminal, wait for it to become ready, and retry the status command. Do not append `web` to the CLI runner when `service.start` provides a different local development command.
|
|
62
|
+
|
|
63
|
+
Use the session identifier supplied by the user or browser when one exists. When the requested work needs a new Human2AI workspace, inspect current projects and sessions before creating only the needed session:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
<runner> project list
|
|
67
|
+
<runner> session list [--project <project-id>]
|
|
68
|
+
<runner> session create --type <image-composition|ui-layout|spatial> --title <title> [--project <project-id>]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Reuse a clearly matching project when available. Otherwise create an unassigned session instead of inventing project organization. After creation, use the returned session identifier for both the Agent CLI and browser page.
|
|
72
|
+
|
|
73
|
+
Connect using the resolved session identifier:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
<runner> session connect --session <session-id>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Treat the returned `session-connection` JSON as the discovery contract. Read `session.sessionType`, `ui.editUrl`, `capture.kind`, `capture.latest`, `capture.commands`, `images.commands`, `style.current`, `style.commands`, and `operations`. The command fields are argument arrays to append to the configured `runner`; do not hardcode API paths or operations that the connection does not expose.
|
|
80
|
+
|
|
81
|
+
Use `<runner> session open --session <session-id>` when the user wants the review page opened. If the environment cannot open a browser, provide `ui.editUrl` instead.
|
|
82
|
+
|
|
83
|
+
## Modify captures immediately
|
|
84
|
+
|
|
85
|
+
Read the latest saved capture, preserve its schema, apply the requested change, and save it immediately with optimistic concurrency:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
<runner> capture list --session <session-id>
|
|
89
|
+
<runner> capture get --session <session-id> --kind <capture-kind> --revision <n>
|
|
90
|
+
<runner> capture save --session <session-id> --kind <capture-kind> --input <document.json> --expected-revision <n>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Do not create proposal, approval, or staging states. A successful save appends an immutable revision and an open clean browser page displays it. If the service reports `DRAFT_REVISION_CONFLICT`, reconnect, read the new latest capture, reconcile the user's request with it, and save against that revision rather than overwriting it.
|
|
94
|
+
|
|
95
|
+
Undo the latest Agent change when requested:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
<runner> capture undo --session <session-id> --kind <capture-kind> --change-revision <n> --expected-revision <n>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Undo appends the previous document as a new revision; it never deletes history.
|
|
102
|
+
|
|
103
|
+
## Author a 3D space
|
|
104
|
+
|
|
105
|
+
For spatial sessions, read [references/spatial.md](references/spatial.md). Create and pose articulated characters, extend custom morphologies, place simple geometry, and edit named output cameras through `spatial apply`. World position and world rotation locks are independent hard constraints. Render and inspect the requested camera after every completed Agent task. Composition nodes can reference those cameras and follow saved scene changes, or keep the current PNG as an independent image node.
|
|
106
|
+
|
|
107
|
+
When generating an image from a spatial camera, follow that reference's **Camera references for image generation** guidance for interpreting pose intent, correcting anatomical inaccuracies, and excluding guide markings from the generated image.
|
|
108
|
+
|
|
109
|
+
## Choose refinement or style processing
|
|
110
|
+
|
|
111
|
+
A request for 精修, mathematical proportion, symmetry, focal guidance, or rule-based composition calls for the independent refinement workflow in [references/composition.md](references/composition.md). Do not infer a style request from these terms or bind a library style. Refinement may preserve the source without changes when the Agent finds no justified improvement. Use style processing below only when style application is part of the user’s intent.
|
|
112
|
+
|
|
113
|
+
## Process a canvas with its style
|
|
114
|
+
|
|
115
|
+
For a request to recover the composition of a reference picture, first follow the reference-projection workflow in [references/composition.md](references/composition.md). Abstract the structure that organizes attention, weight, rhythm and space; judge the resulting experience rather than resemblance to object outlines. Choose each shape for its contribution to the whole and explain that contribution in its description. New reference nodes have empty notes, and a new reference draft has an empty overall note. The supplied picture is the visual evidence for that task. Apply a different style only when requested; an existing binding must not silently redesign the recovered composition.
|
|
116
|
+
|
|
117
|
+
When modifying a styled session, use `style.current.description` and its reference images as design constraints. A request to apply or improve the style calls for actual canvas edits, not just adding a style name or rewriting notes.
|
|
118
|
+
|
|
119
|
+
If the user names a style, bind it. Otherwise retain an existing binding; when processing calls for a style and none is bound, choose a suitable library entry yourself based on the canvas and the user's goal. `visual` and `ui` are useful search filters, not restrictions on binding. Read candidate specifications before selecting and briefly explain the choice. Use the returned binding commands:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
<runner> session style --session <session-id>
|
|
123
|
+
<runner> session bind-style --session <session-id> --style <style-id> --expected-revision <session-revision>
|
|
124
|
+
<runner> session unbind-style --session <session-id> --expected-revision <session-revision>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Reconnect after binding to obtain the current specification and save command. Binding alone does not alter the canvas. Deleting a library style clears its bindings while retaining canvas history.
|
|
128
|
+
|
|
129
|
+
1. Read the latest capture and the full current specification. If `capture.latest.styleProcessing` exists, read its `resultRevision` as the prior processing baseline and compare it with the latest capture. Preserve subsequent user changes; in particular, do not recreate accents the user removed without a new request.
|
|
130
|
+
2. Preserve existing ids, origins, user notes, visible text, content/function and approximate spatial arrangement. Adjust proportions, size, whitespace, alignment, hierarchy and moderate placement/rotation where the specification supports it. Add purposeful decorative elements when helpful. Existing explicit placement requirements win over stylistic preferences.
|
|
131
|
+
3. Set new nodes to `origin: "agent"`. Use `annotation` for a short design-role description; for a newly added decoration, its initial `note` should describe the intended visible content so it survives prompt export. Existing notes remain user instructions. Use the session-specific reference below for its coordinate system, allowed geometry and stages.
|
|
132
|
+
4. Save the full editable draft using `style.commands.save`, which includes the canvas, style and session revisions:
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
<runner> capture save --session <session-id> --kind <capture-kind> --input <document.json> --expected-revision <canvas-revision> --style <style-id> --style-revision <style-revision> --session-revision <session-revision>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`STYLE_PROCESSING_STALE` or `DRAFT_REVISION_CONFLICT` means the source changed. Reconnect, read the latest canvas and style, and reconcile before retrying. Never remove the style flags to bypass a conflict. Ordinary user edits inherit processing metadata; undo restores the previous document and its processing metadata.
|
|
139
|
+
5. Export and inspect the saved revision through the session-specific CLI preview command, then summarize the concrete changes. The draft communicates editable structure and visual intent; carry the full specification into authorized downstream implementation or image generation for details the canvas does not render, such as materials and typography. The browser's copied prompt remains a compact handoff using the single style sentence.
|
|
140
|
+
|
|
141
|
+
## Route by session type
|
|
142
|
+
|
|
143
|
+
For SVG icons, decorations, or outlines requested as image-node content, read [references/svg-images.md](references/svg-images.md). Both session types use their existing image nodes for SVG; the user describes the result in language and the Agent authors the source.
|
|
144
|
+
|
|
145
|
+
- For `image-composition`, read [references/composition.md](references/composition.md) before drawing a reference picture, canvas processing, refinement or generation-reference work. Interpret light markers as approximately as ordinary shape regions: retain their broad lighting contribution while freely adapting width, length, continuity, edges and strength. User instructions and node notes take precedence. Approximate overall correspondence is sufficient; do not infer fixed-width stripes, strong contrast or exact coverage from the canvas.
|
|
146
|
+
- For `ui-layout`, read [references/ui-layout.md](references/ui-layout.md) before modifying the layout document or implementing UI from a capture. Group multi-node controls during projection, and execute its standardization workflow before changing consumer components from canvas geometry.
|
|
147
|
+
- For a future session type, use only the capture kind and operations returned by `session connect`. If no reference or operation supports the requested action, report that boundary instead of inventing a command.
|
|
148
|
+
|
|
149
|
+
Human2AI captures design structure and intent, including SVG image content when requested. After the user's review, decide and complete the appropriate code, asset, article, music, build, or test work in the consumer project under that project's instructions.
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Reference picture to editable composition
|
|
2
|
+
|
|
3
|
+
## Read the picture and session
|
|
4
|
+
|
|
5
|
+
Use the image attached by the user or the local image they identify. Actually inspect it with the environment's image-viewing capability; a filename or verbal description alone does not establish its contents. If it is unavailable, request the missing image before drawing from it.
|
|
6
|
+
|
|
7
|
+
Follow `SKILL.md` to resolve the integration and connect to a matching `image-composition` session. Read its latest capture when one exists. Use its selected `processingSemantic` unless the user explicitly requests a different mode. An explicit choice in the conversation counts as the user's selection and may be saved in the draft. If neither the session nor the user selects Scene (`scene-composition`) or Editorial (`editorial-layout`), ask once before drawing; do not infer the mode from the picture.
|
|
8
|
+
|
|
9
|
+
For a new composition, match the picture's aspect ratio within the supported frame range below. For an existing session, preserve its frame and unrelated nodes unless the request calls for replacing them. If the destination or replacement scope is materially ambiguous, resolve that before overwriting existing intent. A bound style remains bound, but recovering a reference picture does not itself request restyling; use the ordinary Capture save command. When the user also requests a style adaptation, use the style-processing workflow and its save command.
|
|
10
|
+
|
|
11
|
+
## Recover the structure that shapes the viewing experience
|
|
12
|
+
|
|
13
|
+
Draw an abstraction of how the picture organizes attention, weight, movement and space. Success is retaining the structure and its perceptual effect when the pictured objects and surface treatment change. Recognizable silhouettes, matching bounding boxes and accurate pixel gaps are not the default acceptance criteria. The reference supplies evidence for the composition; it is not a contour template. Honor an explicit request for precise reproduction separately, without making it the default for composition work.
|
|
14
|
+
|
|
15
|
+
### Understand the whole before selecting shapes
|
|
16
|
+
|
|
17
|
+
Inspect the picture at thumbnail scale, then full size only to resolve uncertain relationships. Form a concise working reading of what makes it feel organized: where attention concentrates, what balances that concentration, how the eye can move, and where density gives way to breathing room. Ground terms such as calm, tension, weight or spaciousness in visible relationships. Do not attribute feelings produced mainly by subject matter, materials or lighting to geometry alone, or claim to know the designer's intent or every viewer's reading order.
|
|
18
|
+
|
|
19
|
+
For example, a dense lower-left text mass opposed by a broad lower-right image mass can give a banner an asymmetric balance; a more compact mass higher up can lift attention away from the bottom edge, while a quieter center gives the active regions room. This reading determines the drawing. Starting with “glass here, record player there” and later adding the word “balance” does not.
|
|
20
|
+
|
|
21
|
+
Keep this whole-picture reading in the Agent's reasoning or concise handoff, not in `overallNote`. It is a hypothesis to verify against the drawn result, not an invented theme to impose on every reference.
|
|
22
|
+
|
|
23
|
+
### Choose geometry by contribution, not resemblance
|
|
24
|
+
|
|
25
|
+
Use areas to express concentrations of visual weight, supporting fields and coherent reading units. Their size, elongation, direction, spacing and overlap should make the identified effects legible. A region can stand for several objects, part of a larger image, or a broad tonal mass. Choose a primitive for that role; it need not follow the object's outline. Preserve relative hierarchy, approximate placement and the reference's essential relationships. Positions and envelopes may be simplified or moderately adjusted to express them in the selected frame, subject to explicit user constraints and subsequent user edits.
|
|
26
|
+
|
|
27
|
+
Use two contribution checks:
|
|
28
|
+
|
|
29
|
+
- **Too coarse:** merging masses or leaving a subject free to drift inside a large image box would erase a counterweight, collapse a reading step, crowd a text area, or change a meaningful sense of depth, openness or movement. Give that role enough actual geometry to remain effective; naming it in a description is insufficient.
|
|
30
|
+
- **Too detailed:** removing a shape changes only object recognition, local contour accuracy, texture or a minor typographic distinction. Absorb or omit it. Separate a small accent only when it makes a distinct contribution at the scale of the whole, or the user explicitly needs it editable.
|
|
31
|
+
|
|
32
|
+
There is no node quota and no rule that every object, image or group needs one node. Similar elements can share a mass when they act together; retain their separation when it creates rhythm, openness or depth. Do not collect distant objects merely because they share an identity. A visual unit may use a few shapes, but every extra span must preserve a perceptual effect beyond making the object look more recognizable. An identifiable horn, curved edge or opening does not automatically deserve reconstruction. If a simpler mass or directional cue conveys the same effect, use it. Do not build a duplicate enclosing shape over those spans.
|
|
33
|
+
|
|
34
|
+
A background area earns its place by an effect such as unifying dispersed accents or establishing figure-ground contrast, not simply because the source is a photograph. A photograph's outer footprint cannot replace internal masses that balance text or organize attention. Conversely, do not automatically draw the photo rectangle when the frame and main masses already carry its role. A fixed image used only as a layout slot may remain one footprint when its interior is outside the requested composition work.
|
|
35
|
+
|
|
36
|
+
A focus point locates concentrated attention; an area expresses its spread and weight. A direction line can express a dominant flow, but it spans the canvas and cannot act as a short connector, curve or divider. Use none of these marks automatically. Negative space is expressed through neighboring masses and gaps, not through invented exclusion boxes. The draft has no group container, exclusion enforcement or mandatory layers.
|
|
37
|
+
|
|
38
|
+
Use `shotScale` and `visualWeight` to support the reading, while making the geometry carry what it can. Metadata alone does not render tonal contrast or make a large rectangle visually quiet. Array order controls painting. Keep `images: []` for an abstract projection; placing the reference screenshot on the canvas does not perform this abstraction.
|
|
39
|
+
|
|
40
|
+
### Apply the reading to the selected mode
|
|
41
|
+
|
|
42
|
+
| Mode | Organize | Judge the effect through |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| Scene | Main and supporting masses, depth, scale contrasts, framing and motion | Dominance versus counterbalance, near/far separation, enclosure versus openness, stability versus directional tension |
|
|
45
|
+
| Editorial | Information hierarchy, text/image weight, grouping, density and gaps | Likely attention priorities and reading transitions, asymmetric or symmetric balance, breathing room and pace |
|
|
46
|
+
|
|
47
|
+
For a scene with a giant subject and nearby people, size contrast and foreground overlap may create monumentality and depth. Retain those relationships without reconstructing the subject's anatomy. Keep a silhouette opening only when it contributes to that spatial reading or tension, not merely to identifying the animal. An isolated foreground accent may need its own mass to give the scene a counterweight or nearer scale reference.
|
|
48
|
+
|
|
49
|
+
For a layout with a glass and a record player, represent their compact upper mass and broad lower mass when those weights organize the surrounding typography. The cup rim and disc outline need not be recognizable. A brand lockup, issue badge or compact call to action normally remains one reading unit with its immediate backing; differences in internal font size alone do not create separate compositional roles. Split text only to retain a distinct reading step, meaningful offset or directional effect. Preserve readable source wording in `displayText`, even when its spatial representation is abstracted.
|
|
50
|
+
|
|
51
|
+
Retain a curved arrangement's lightness, turning movement or enclosing effect with the simplest useful gesture; do not trace its bends as a sequence of construction pieces. Use a few spans only if the effect otherwise disappears. Do not impose a ban on image/text overlap: deliberate overlap can bind them into one visual field. Preserve legibility and breathing room where they matter, rather than reproducing every measured gap. A round badge can use one text-region envelope when its compact counterweight matters more than its exact circular edge.
|
|
52
|
+
|
|
53
|
+
### Keep descriptions, user notes, and lettering separate
|
|
54
|
+
|
|
55
|
+
Preserve readable source lettering in text-region `displayText`, including punctuation and line breaks that matter. Never invent a transcription for unreadable text: leave it unspecified and explain the uncertainty in the node description. An empty `displayText` remains a text region and means the wording is unspecified for later generation. The browser canvas displays abstract typography marks, not the exact font or lettering; the CLI `inspect --preview` SVG shows plain region shapes. The CLI preview currently leaves ellipses axis-aligned even when they have rotation; read the saved rotation and report this preview limitation when it affects visual verification. Read `displayText` from the saved draft to check its wording. Colors, materials, depth and weight metadata are not a complete rendered theme.
|
|
56
|
+
|
|
57
|
+
Assign stable ids and `origin: "import"` to every node recovered from the reference, including focus and direction marks. Reserve `origin: "agent"` for new design additions the user requests and `user` for browser-created nodes. Editing a node preserves its origin.
|
|
58
|
+
|
|
59
|
+
Write `annotation` in the user's language to explain **what this element's presence contributes to the composition**. Connect a visible characteristic to its relationship with another mass or space and the resulting perceptual effect. Usually one sentence is enough. A short source-object reference can help identification, but the subject of the explanation is its compositional role. These are explanations of the current structure, not instructions to change it.
|
|
60
|
+
|
|
61
|
+
| Merely describing the picture | Explaining the contribution |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| “手与酒杯在标题上方,杯底保留间隙” | “上方紧凑的重块将注意力从底边抬起,与右下横向大形形成斜向呼应,让下方密集文字有呼吸空间。” |
|
|
64
|
+
| “右下是低而宽的唱片机,与标题错开” | “右下宽而平缓的体量承接上方的动势,与左下高对比文字形成不对称的平衡,使画面重心稳定。” |
|
|
65
|
+
| “分类文字分成三段,沿弧线排列” | “中间轻而疏的转向节奏连接两侧重块,给视线留出经过的空隙,减轻大面积图文的拥挤感。” |
|
|
66
|
+
| “大主体前方是一排人群” | “低矮、重复的前景节奏提供尺度参照并遮住主形底部,使后方大形显得更高、更远。” |
|
|
67
|
+
|
|
68
|
+
Avoid interchangeable praise such as “丰富层次”“提升美感”“增强平衡” without saying what changes and through which relationship. Do not claim an effect just because a node needs a description: if it has no distinct contribution, revisit its geometry, grouping or necessity. Hiding the descriptions should leave a legible composition; reading them should explain why it feels that way. Source-dependent contrast or other qualities the canvas cannot show should be identified as such, not claimed as visibly rendered.
|
|
69
|
+
|
|
70
|
+
Every newly imported node must have `note: ""`, including focus and direction nodes. For a new reference composition, set `overallNote: ""` too. Do not put the image analysis, generation instructions, a copy of the description, or a composition summary into notes. These fields remain available for the user's instructions. Preserve existing user notes when continuing a draft. Node descriptions remain in the draft for subsequent Agent work; the browser's compact prompt does not export them, which is not a reason to copy them into notes.
|
|
71
|
+
|
|
72
|
+
## Author a complete draft
|
|
73
|
+
|
|
74
|
+
Use this format directly; no project-source import, extra API, or new capture kind is needed. Coordinates are signed world units referenced to **1200 × 800**, not output pixels. `frame.width` and `frame.height` are integer output dimensions from 256 to 4096, with width/height from 0.5 to 2. `frame.bounds` locates the crop in world units. Always include it to avoid legacy-coordinate migration. For an unsupported picture ratio, resolve the desired crop or framing with the user rather than distorting it.
|
|
75
|
+
|
|
76
|
+
Choose the abstract masses in the selected frame first. The following converts their chosen positions to canvas coordinates; it does not require tracing source pixels. For a visual point `(u, v)` expressed as fractions of the output frame and frame bounds `b`:
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
x = b.x + u * b.width
|
|
80
|
+
y = b.y + v * b.height
|
|
81
|
+
width = regionWidthShareOfOutputFrame * b.width
|
|
82
|
+
height = regionHeightShareOfOutputFrame * b.height
|
|
83
|
+
area = width * height * shapeFactor
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
When the user explicitly requests a particular crop, padding or precise registration to the source, incorporate that framing before conversion and keep the source scale consistent on both axes. Preserve the chosen output ratio in either case.
|
|
87
|
+
|
|
88
|
+
`shapeFactor` is 1 for a quadrilateral, π/4 for a free ellipse (`primitive: "circle"`), and 1/2 for a triangle. `x/y` locate the center of a rectangle or ellipse; triangles use their centroid, two-thirds of the height below their apex. Positive rotation turns clockwise in the screen's downward y-axis. Keep `area` consistent with the unrotated dimensions. `frame.bounds.width * 1200 / (frame.bounds.height * 800)` must equal the output aspect ratio.
|
|
89
|
+
|
|
90
|
+
Required top-level fields are `version: 1`, `kind: "composition-draft"`, `processingSemantic`, `frame`, `overallNote`, `focusPoints`, `directionLine`, `areas`, and `images`. Use empty arrays, `null` for an absent direction line, and an empty overall note for a new reference composition.
|
|
91
|
+
|
|
92
|
+
All nodes carry `origin`, `note`, `annotation`, `semanticType` and `shotScale` (`auto`, `foreground`, `midground`, `background`). Use a concise descriptive semantic type; only `text-region` has special text behavior.
|
|
93
|
+
|
|
94
|
+
- Areas: ids `area-<integer>`, `primitive` (`circle`, `triangle`, `quadrilateral`), `x`, `y`, `area`, `aspect`, `visualWeight`, and optional `rotation`. Prefer `aspect: "free"` with explicit positive `width` and `height` for picture footprints. Weights are `auto`, `high`, `medium`, `low`, or `decorative`. A `text-region` uses a free quadrilateral and must include `displayText`; other areas must omit `displayText`. Array order determines area painting order; `shotScale` does not reorder nodes automatically.
|
|
95
|
+
- Focus points: ids `focus-<integer>` and `x/y`; at most three, added only where useful.
|
|
96
|
+
- Direction line: id `direction-1`, `x/y`, and `rotation`; at most one.
|
|
97
|
+
- Keep `images: []` for an abstract projection. Represent source imagery as areas. Existing image nodes in a reused draft must retain their asset references and crop unless changing them is requested.
|
|
98
|
+
|
|
99
|
+
These small examples demonstrate the payload and role explanations, not templates to impose on other pictures. Their object names identify the source content; the geometry carries transferable relationships.
|
|
100
|
+
|
|
101
|
+
### Scene example: background mass and foreground subject
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"version": 1,
|
|
106
|
+
"kind": "composition-draft",
|
|
107
|
+
"processingSemantic": "scene-composition",
|
|
108
|
+
"frame": { "width": 1200, "height": 800, "bounds": { "x": 0, "y": 0, "width": 1, "height": 1 } },
|
|
109
|
+
"overallNote": "",
|
|
110
|
+
"focusPoints": [
|
|
111
|
+
{ "id": "focus-1", "x": 0.72, "y": 0.48, "origin": "import", "note": "", "annotation": "Concentrated attention in the upper part of the foreground mass interrupts the broad horizontal sweep", "semanticType": "subject-focus", "shotScale": "foreground" }
|
|
112
|
+
],
|
|
113
|
+
"directionLine": null,
|
|
114
|
+
"areas": [
|
|
115
|
+
{ "id": "area-1", "primitive": "quadrilateral", "x": 0.32, "y": 0.55, "area": 0.21, "aspect": "free", "width": 0.6, "height": 0.35, "rotation": 0, "visualWeight": "low", "origin": "import", "note": "", "annotation": "The broad, quiet horizontal field counterbalances the narrow upright mass and gives the scene lateral breathing room", "semanticType": "landscape", "shotScale": "background" },
|
|
116
|
+
{ "id": "area-2", "primitive": "quadrilateral", "x": 0.72, "y": 0.65, "area": 0.081, "aspect": "free", "width": 0.18, "height": 0.45, "rotation": 0, "visualWeight": "high", "origin": "import", "note": "", "annotation": "The compact upright mass concentrates weight on the right, creating an asymmetric balance with the wide quiet field", "semanticType": "figure", "shotScale": "foreground" }
|
|
117
|
+
],
|
|
118
|
+
"images": []
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Editorial example: type over photography with two subject masses
|
|
123
|
+
|
|
124
|
+
The photograph fills the background. Its key subjects need geometry because they organize the space around the type; another full-frame image rectangle would add no necessary boundary here.
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"version": 1,
|
|
129
|
+
"kind": "composition-draft",
|
|
130
|
+
"processingSemantic": "editorial-layout",
|
|
131
|
+
"frame": { "width": 1200, "height": 600, "bounds": { "x": 0, "y": 0, "width": 1, "height": 0.75 } },
|
|
132
|
+
"overallNote": "",
|
|
133
|
+
"focusPoints": [],
|
|
134
|
+
"directionLine": null,
|
|
135
|
+
"areas": [
|
|
136
|
+
{ "id": "area-1", "primitive": "circle", "x": 0.36, "y": 0.27, "area": 0.07225663103256524, "aspect": "free", "width": 0.23, "height": 0.4, "rotation": 0, "visualWeight": "high", "origin": "import", "note": "", "annotation": "The upright upper mass lifts attention above the lower pair, keeping the composition from settling into a single bottom-heavy band", "semanticType": "vase-group", "shotScale": "auto" },
|
|
137
|
+
{ "id": "area-2", "primitive": "circle", "x": 0.73, "y": 0.57, "area": 0.060475658581603514, "aspect": "free", "width": 0.35, "height": 0.22, "rotation": 0, "visualWeight": "medium", "origin": "import", "note": "", "annotation": "The low, broad mass opposes the dense heading across a gap, providing a stable counterweight without joining it into a solid strip", "semanticType": "bowl-group", "shotScale": "auto" },
|
|
138
|
+
{ "id": "area-3", "primitive": "quadrilateral", "x": 0.23, "y": 0.585, "area": 0.054, "aspect": "free", "width": 0.36, "height": 0.15, "rotation": 0, "visualWeight": "high", "displayText": "ROOM TO\nBREATHE", "origin": "import", "note": "", "annotation": "Dense horizontal type establishes the primary reading anchor, held in balance by the broader image mass to its right", "semanticType": "text-region", "shotScale": "auto" },
|
|
139
|
+
{ "id": "area-4", "primitive": "quadrilateral", "x": 0.86, "y": 0.1, "area": 0.0128, "aspect": "free", "width": 0.16, "height": 0.08, "rotation": 0, "visualWeight": "low", "displayText": "VOL. 04", "origin": "import", "note": "", "annotation": "The isolated small label punctuates the open upper-right field while remaining subordinate to the main reading anchor", "semanticType": "text-region", "shotScale": "auto" }
|
|
140
|
+
],
|
|
141
|
+
"images": []
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Save, inspect, and continue editing
|
|
146
|
+
|
|
147
|
+
Before saving, check every region against the whole-picture reading: what effect does it contribute, through which relationship, and is that contribution expressed in the drawing? Remove geometry justified only by resemblance. Restore a missing weight, gap or direction when its absence changes the intended experience. Descriptions must explain the contribution rather than supply one after the fact. Verify that all new notes and the new overall note are empty.
|
|
148
|
+
|
|
149
|
+
Save the complete JSON with `capture.commands.save` from the connection, using its latest revision (0 before the first save). Keep the returned revision as the projection baseline. Use `composition inspect --session <session-id> --revision <saved-revision> --preview <preview.svg>` and actually view the local result, rasterizing it locally when the image viewer needs a bitmap. Follow the parent Skill's operation-channel rule; static preview inspection does not require Chrome MCP. Compare it with the reference at a size where both whole frames are visible, without relying on node descriptions:
|
|
150
|
+
|
|
151
|
+
- Is attention concentrated in comparable places, with the same dominant and subordinate roles?
|
|
152
|
+
- Does the balance of mass and open space preserve the identified stability, tension, depth or breathing room? Does the rhythm remain dense, loose, steady or turning where it matters?
|
|
153
|
+
- If the objects were replaced by different content with these same visual roles, would the structural effect still work? If only object recognition survives, reconsider the abstraction. This is a thought experiment, not a request to generate another image.
|
|
154
|
+
- Has an incidental contour or extra colored region become falsely prominent? Would merging it change the experience or only make the object less recognizable?
|
|
155
|
+
- Do the descriptions explain the observed relationships and effects? If an effect depends on contrast the canvas does not render, is that dependency clear instead of being mistaken for a successful visual check?
|
|
156
|
+
|
|
157
|
+
If it reads as a parts diagram, regroup around compositional contributions; better wording alone does not repair the drawing. If simplification lost a necessary effect, restore only the geometry needed to convey it. Correct those discrepancies and save against the latest revision. Do not add pieces merely to improve silhouette likeness. Schema validation and a low node count alone do not verify visual quality. Report limitations that affect the retained structure or experience, and unavailable visual inspection; ordinary omission of photographic detail is expected. These authoring checks guide subsequent work, not runtime guarantees of a generated picture's layout.
|
|
158
|
+
|
|
159
|
+
Open or provide the session's `ui.editUrl`; an already open clean page receives the saved draft. If the request ends at an editable canvas, hand it off there. The first saved revision has no predecessor and cannot be undone; later latest revisions can be undone through the normal Capture command.
|
|
160
|
+
|
|
161
|
+
When the user asks to continue after editing, read the latest capture and, when needed, the retained projection baseline. Preserve stable ids, origins, notes, required text, and user-added nodes; do not regenerate the original picture's layout over their changes or restore nodes they removed without a request. Treat edits as revised composition intent. They do not modify the reference image itself. Carry node descriptions as context into any separately authorized downstream image work.
|
|
162
|
+
|
|
163
|
+
## Basis for these drawing rules
|
|
164
|
+
|
|
165
|
+
These are Human2AI authoring decisions adapted from the following principles, not a universal formula or a requirement to research every new picture:
|
|
166
|
+
|
|
167
|
+
- [Getty: Principles of Design](https://www.getty.edu/education/teachers/building_lessons/principles_design.pdf) explains visual weight, emphasis, movement, rhythm and unity. Here, those relationships determine whether a region deserves to exist.
|
|
168
|
+
- [James Gurney: First Impressions](https://gurneyjourney.blogspot.com/2011/04/first-impressions.html) discusses deliberately seeing broad masses through defocusing or squinting. Here, the thumbnail pass precedes choosing nodes.
|
|
169
|
+
- [NN/g: Proximity](https://www.nngroup.com/articles/gestalt-proximity/) and [Similarity](https://www.nngroup.com/articles/gestalt-similarity/) describe perceptual grouping. Here, shared appearance and proximity support aggregation while major spatial separations remain visible.
|
|
170
|
+
- [Art Prof: Great 2D Compositions](https://artprof.org/learn/fundamentals/composition/great-2d-compositions/) emphasizes varying shape sizes, attention, and balancing visually active and quiet areas. Here, simplification retains meaningful small accents and negative space.
|