@pixel-point/toolcraft 0.0.2 → 0.0.4
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/README.md +15 -2
- package/package.json +6 -1
- package/src/cli.mjs +226 -17
- package/src/cli.test.mjs +127 -2
- package/templates/runtime/contracts/component-contracts.test.ts +28 -7
- package/templates/runtime/contracts/component-contracts.ts +14 -7
- package/templates/runtime/contracts/decision-contracts.ts +1 -1
- package/templates/runtime/export/export.test.ts +65 -0
- package/templates/runtime/export/export.ts +54 -1
- package/templates/runtime/react/controls-panel.test.tsx +54 -6
- package/templates/runtime/react/controls-panel.tsx +216 -0
- package/templates/runtime/react/settings-transfer.test.ts +6 -0
- package/templates/runtime/react/settings-transfer.ts +28 -2
- package/templates/runtime/schema/canvas-aspect-ratio-presets.ts +50 -0
- package/templates/runtime/schema/define-toolcraft.test.ts +45 -1
- package/templates/runtime/schema/define-toolcraft.ts +60 -2
- package/templates/runtime/schema/keyframe-capability.test.ts +7 -0
- package/templates/runtime/schema/keyframe-capability.ts +2 -2
- package/templates/runtime/schema/runtime-targets.ts +5 -0
- package/templates/runtime/state/create-template-state.test.ts +6 -0
- package/templates/runtime/state/reducer.test.ts +55 -0
- package/templates/runtime/state/reducer.ts +214 -9
- package/templates/starter/AGENTS.md +5 -3
- package/templates/starter/docs/toolcraft/acceptance-testing.md +3 -1
- package/templates/starter/docs/toolcraft/assembly-workflow.md +10 -3
- package/templates/starter/docs/toolcraft/component-rules.md +12 -5
- package/templates/starter/docs/toolcraft/schema-reference.md +45 -7
- package/templates/starter/scripts/check-ai-skills.mjs +39 -4
- package/templates/starter/src/app/starter-acceptance.test.ts +623 -21
- package/templates/starter/src/app/starter-acceptance.ts +290 -3
- package/templates/ui/components/control-layout/index.tsx +4 -4
- package/templates/ui/components/controls/font-picker/font-picker-control.tsx +1 -1
- package/toolcraft-skills/brainstorming/SKILL.md +28 -0
- package/toolcraft-skills/browser/SKILL.md +25 -0
- package/toolcraft-skills/figma/SKILL.md +24 -0
- package/toolcraft-skills/figma-implement-design/SKILL.md +24 -0
- package/toolcraft-skills/systematic-debugging/SKILL.md +24 -0
- package/toolcraft-skills/writing-plans/SKILL.md +26 -0
|
@@ -3,31 +3,66 @@
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import os from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
6
7
|
|
|
7
8
|
const codexHome = process.env.CODEX_HOME
|
|
8
9
|
? path.resolve(process.env.CODEX_HOME)
|
|
9
10
|
: path.join(os.homedir(), ".codex");
|
|
11
|
+
const claudeHome = process.env.CLAUDE_HOME
|
|
12
|
+
? path.resolve(process.env.CLAUDE_HOME)
|
|
13
|
+
: path.join(os.homedir(), ".claude");
|
|
14
|
+
const cursorHome = path.join(os.homedir(), ".cursor");
|
|
15
|
+
const configHome = process.env.XDG_CONFIG_HOME
|
|
16
|
+
? path.resolve(process.env.XDG_CONFIG_HOME)
|
|
17
|
+
: path.join(os.homedir(), ".config");
|
|
18
|
+
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
const projectRoot = path.resolve(scriptDir, "..");
|
|
20
|
+
|
|
21
|
+
const skillRoots = [
|
|
22
|
+
path.join(projectRoot, ".agents/skills"),
|
|
23
|
+
path.join(projectRoot, ".claude/skills"),
|
|
24
|
+
path.join(codexHome, "skills"),
|
|
25
|
+
path.join(claudeHome, "skills"),
|
|
26
|
+
path.join(cursorHome, "skills"),
|
|
27
|
+
path.join(configHome, "opencode/skills"),
|
|
28
|
+
path.join(configHome, "agents/skills"),
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
function skillPaths(name) {
|
|
32
|
+
return skillRoots.map((root) => path.join(root, name, "SKILL.md"));
|
|
33
|
+
}
|
|
10
34
|
|
|
11
35
|
const requiredSkills = [
|
|
12
36
|
{
|
|
13
37
|
name: "brainstorming",
|
|
14
38
|
purpose: "shape the app behavior, panels, controls, canvas, media, export, and ambiguity before code",
|
|
15
|
-
paths:
|
|
39
|
+
paths: skillPaths("brainstorming"),
|
|
16
40
|
},
|
|
17
41
|
{
|
|
18
42
|
name: "writing-plans",
|
|
19
43
|
purpose: "turn the approved app spec into a deterministic Toolcraft implementation plan",
|
|
20
|
-
paths:
|
|
44
|
+
paths: skillPaths("writing-plans"),
|
|
21
45
|
},
|
|
22
46
|
{
|
|
23
47
|
name: "systematic-debugging",
|
|
24
48
|
purpose: "investigate root cause before fixing broken controls, tests, builds, visual regressions, or runtime bugs",
|
|
25
|
-
paths:
|
|
49
|
+
paths: skillPaths("systematic-debugging"),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "figma",
|
|
53
|
+
purpose: "inspect actual Figma structure before implementing Figma-referenced Toolcraft apps",
|
|
54
|
+
paths: skillPaths("figma"),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "figma-implement-design",
|
|
58
|
+
purpose: "translate inspected Figma structure into Toolcraft schema, renderer, and verification coverage",
|
|
59
|
+
paths: skillPaths("figma-implement-design"),
|
|
26
60
|
},
|
|
27
61
|
{
|
|
28
62
|
name: "browser",
|
|
29
63
|
purpose: "verify the generated UI in a running local browser after implementation",
|
|
30
64
|
paths: [
|
|
65
|
+
...skillPaths("browser"),
|
|
31
66
|
path.join(codexHome, "skills/browser/SKILL.md"),
|
|
32
67
|
path.join(codexHome, "skills/browser/browser/SKILL.md"),
|
|
33
68
|
path.join(codexHome, "plugins/cache/openai-bundled/browser/0.1.0-alpha2/skills/browser/SKILL.md"),
|
|
@@ -90,6 +125,6 @@ for (const skill of missingSkills) {
|
|
|
90
125
|
console.error("");
|
|
91
126
|
console.error("If your AI environment supports Codex skills, install the missing skills before implementation.");
|
|
92
127
|
console.error("If installation is not available, stop and ask the user to install them.");
|
|
93
|
-
console.error(
|
|
128
|
+
console.error("Checked project and global skill locations for Codex, Claude Code, Cursor, and OpenCode-compatible agents.");
|
|
94
129
|
|
|
95
130
|
process.exit(1);
|