@unifocl/claude-plugin 0.0.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.
@@ -0,0 +1,29 @@
1
+ Hydrate full scene context from the active unifocl project for agent reasoning.
2
+
3
+ Arguments (optional — pass any combination): $ARGUMENTS
4
+ --project <path> explicit project path
5
+ --depth <n> hierarchy/asset traversal depth (default: 6 for hierarchy, 4 for project)
6
+ --limit <n> max objects to return
7
+ --compact omit null/default fields to reduce token usage
8
+
9
+ Steps:
10
+
11
+ 1. Dump the scene hierarchy (GameObject tree):
12
+ `unifocl exec "/dump hierarchy --format json --depth 6 --limit 2000 $ARGUMENTS" --agentic --format json`
13
+
14
+ 2. Dump the project asset structure:
15
+ `unifocl exec "/dump project --format json --depth 4 --limit 1000 $ARGUMENTS" --agentic --format json`
16
+
17
+ 3. For inspector detail on a specific object — identify its path from the hierarchy dump, then:
18
+ `unifocl exec "/inspect <path>" --agentic --format json $ARGUMENTS`
19
+ followed by:
20
+ `unifocl exec "/dump inspector --format json $ARGUMENTS" --agentic --format json`
21
+
22
+ 4. Summarize findings:
23
+ - Active scene name (from hierarchy root metadata)
24
+ - Total GameObjects, root-level objects, any disabled objects
25
+ - Scripts and components attached to key objects
26
+ - Any missing script references (null component entries)
27
+
28
+ Use this context before planning any `/mutate` operation so mutation paths target correct objects.
29
+ If no project is open, run `/init` first.
@@ -0,0 +1,24 @@
1
+ Initialize the unifocl bridge in a Unity project.
2
+
3
+ Project path (optional — defaults to current working directory if omitted): $ARGUMENTS
4
+
5
+ Steps:
6
+
7
+ 1. Run the init command to install the editor-side bridge package:
8
+ `unifocl exec "/init $ARGUMENTS" --agentic --format json`
9
+
10
+ 2. If `ok` is false, inspect the `message` field and surface the error. Common causes:
11
+ - Path does not contain `ProjectSettings/ProjectVersion.txt` (not a Unity project root)
12
+ - Unity Editor is not installed or not detected
13
+ - Write permission denied on `Packages/` directory
14
+
15
+ 3. After a successful `/init`, confirm the bridge is ready:
16
+ `unifocl exec "/status" --agentic --format json --project "$ARGUMENTS"`
17
+ Check that `data.mode` is `bridge` (Unity Editor connected) or `host` (headless/batch).
18
+
19
+ 4. If `protocolMismatch` appears in the response, the editor package is outdated — re-run step 1 to redeploy the updated version.
20
+
21
+ Next steps after a successful init:
22
+ - Use `/context` to hydrate scene state before any mutations.
23
+ - Use `/mutate` for guided scene mutations with dry-run validation.
24
+ - For concurrent multi-agent workflows, use `src/unifocl/scripts/agent-worktree.sh setup` instead of this command.
@@ -0,0 +1,40 @@
1
+ Guided scene mutation with mandatory dry-run validation first.
2
+
3
+ Describe what to mutate: $ARGUMENTS
4
+
5
+ Follow this order exactly — never skip the dry-run step.
6
+
7
+ Step 1 — Plan
8
+ Based on "$ARGUMENTS", determine the /mutate op array.
9
+ Call `GetMutateSchema` via the unifocl MCP server to review all supported ops and required fields.
10
+ Supported ops: create, rename, remove, move, toggle_active, add_component, remove_component,
11
+ set_field, toggle_field, toggle_component.
12
+
13
+ Step 2 — Validate (static schema check, no Unity needed)
14
+ Call `ValidateMutateBatch` via MCP with your planned JSON array.
15
+ Fix any validation errors before proceeding.
16
+
17
+ Step 3 — Dry-run (preview without applying)
18
+ `unifocl exec "/mutate --dry-run <json-array>" --agentic --format json`
19
+ Inspect the `diff` in the response. Verify object paths match the scene hierarchy from `/context`.
20
+ Do NOT proceed if `data.allOk` is false — fix ops first.
21
+
22
+ Step 4 — Execute (apply for real)
23
+ `unifocl exec "/mutate <json-array>" --agentic --format json`
24
+ Confirm `data.allOk: true` and `data.succeeded == data.total`.
25
+ If `--continue-on-error` was used, check `data.errors` for partial failures.
26
+
27
+ Step 5 — Verify
28
+ Re-run `/context` (or a targeted dump) to confirm the scene reflects the expected changes.
29
+
30
+ Path format rules:
31
+ - Scene root: `/`
32
+ - Top-level object: `/ObjectName`
33
+ - Nested: `/Parent/Child/Grandchild`
34
+ - Names are case-sensitive and must match exactly as shown in `/dump hierarchy`
35
+
36
+ Mode availability:
37
+ - Host mode (no Unity Editor open): create, rename, remove, move, toggle_active
38
+ - Bridge mode (Unity Editor open with com.unifocl.cli): all ops including add_component, remove_component, set_field, toggle_field, toggle_component
39
+
40
+ For multi-step workflows, pass `--session-seed <id>` across exec calls to share project context without re-specifying --project every time.
@@ -0,0 +1,33 @@
1
+ Check unifocl daemon and project status.
2
+
3
+ Optional project path or flags: $ARGUMENTS
4
+
5
+ Steps:
6
+
7
+ 1. Get current status:
8
+ `unifocl exec "/status" --agentic --format json $ARGUMENTS`
9
+
10
+ 2. Report from the response:
11
+ - `data.daemon` — running port and uptime
12
+ - `data.mode` — `bridge` (Unity Editor connected) or `host` (headless/batch)
13
+ - `data.project` — loaded project path and name
14
+ - `data.editor` — Unity Editor version in use
15
+ - `data.session` — active session seed if set
16
+
17
+ 3. If daemon is not running:
18
+ `unifocl exec "/daemon ps" --agentic --format json`
19
+ Lists all running daemon instances with ports, uptime, and associated projects.
20
+
21
+ 4. If no project is open, use `/init` to initialize the bridge, then `/context` to load scene state.
22
+
23
+ 5. If environment issues are suspected (missing Unity Editor path, incompatible protocol version, etc.):
24
+ `unifocl exec "/doctor" --agentic --format json`
25
+
26
+ MCP server tools available when daemon is up:
27
+ - `ListCommands(scope, query, limit)` — discover all unifocl commands by scope (root/project/inspector/all)
28
+ - `LookupCommand(command, scope)` — exact or fuzzy command lookup with signature and description
29
+ - `GetMutateSchema()` — full /mutate op schema with all supported fields and types
30
+ - `ValidateMutateBatch(opsJson)` — pre-validate a mutation batch without executing
31
+ - `GetAgentWorkflowGuide()` — complete agentic workflow reference, version-matched to this binary
32
+ - `GetCategories()` — list custom tool categories from the project manifest
33
+ - `LoadCategory(name)` — register a category's [UnifoclCommand] tools as live MCP tools
@@ -0,0 +1,44 @@
1
+ Full agentic workflow guide for unifocl Unity operations.
2
+
3
+ Task or workflow to plan: $ARGUMENTS
4
+
5
+ Start by calling `GetAgentWorkflowGuide` via the unifocl MCP server. It returns the authoritative,
6
+ version-matched workflow reference — always prefer it over static docs for exact flags and field names.
7
+
8
+ Standard session pattern:
9
+
10
+ 1. Setup
11
+ Install: `brew install unifocl` (macOS) or run `scripts/install.ps1` (Windows).
12
+ Initialize bridge: `/init <project-path>` (see `/init` slash command).
13
+ The MCP server starts automatically when Claude Code loads this plugin.
14
+
15
+ 2. Open project
16
+ `unifocl exec "/open <project-path>" --agentic --format json`
17
+ Wait for `data.ok: true` before proceeding.
18
+
19
+ 3. Hydrate context
20
+ Use `/context` to dump hierarchy + project structure before any mutations.
21
+ Always read context before planning mutations — paths are case-sensitive.
22
+
23
+ 4. Discover commands
24
+ `ListCommands(scope="all")` via MCP for full catalog.
25
+ `LookupCommand(command="...")` for a specific command's signature.
26
+ Prefer MCP lookups over reading README — lower token cost.
27
+
28
+ 5. Mutate scenes
29
+ Always follow dry-run-first. Use `/mutate` for guided mutation.
30
+ For [UnifoclCommand] custom tools:
31
+ a. `GetCategories()` — list available tool categories from project manifest
32
+ b. `LoadCategory(name)` — register category tools as live MCP tools
33
+ c. Call the custom tool via MCP
34
+ d. `ReloadManifest()` after Unity recompiles new [UnifoclCommand] methods
35
+
36
+ 6. Multi-agent / worktrees
37
+ Provision isolated worktrees: `src/unifocl/scripts/agent-worktree.sh setup --worktree-path <path> --branch <name>/<task>`
38
+ Never share mutable worktrees across concurrent agents.
39
+
40
+ 7. Session efficiency
41
+ Pass `--session-seed <id>` to reuse project context across multiple exec calls.
42
+ Eliminates repeated /open overhead in multi-step workflows.
43
+
44
+ Apply the above principles to accomplish: $ARGUMENTS
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@unifocl/claude-plugin",
3
+ "version": "0.0.0",
4
+ "description": "Claude Code plugin for unifocl — auto-configures MCP server and slash commands for Unity project workflows.",
5
+ "keywords": ["unity", "unifocl", "claude", "mcp", "claude-code-plugin"],
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Kiankinakomochi/unifocl.git",
10
+ "directory": "src/unifocl.claude-plugin"
11
+ },
12
+ "files": [
13
+ "commands/",
14
+ "package.json"
15
+ ],
16
+ "claude": {
17
+ "mcpServers": {
18
+ "unifocl": {
19
+ "command": "unifocl",
20
+ "args": ["--mcp-server"]
21
+ }
22
+ },
23
+ "commands": "./commands"
24
+ }
25
+ }