# Craftsman Agent Build Plans

> Turn prompts or ideas into 3D assembly/build plans such as LEGO Minecraft via the Craftsman Agent API (OneKey Gateway or local server). Use when generating build plans, inventory lists, or step-by-step assembly images for LEGO/Minecraft from text or reference images, or when wiring clients to the Craftsman Agent endpoints.

- Skill: `aiagenta2z/craftsman-agent-build-plans-2` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx skillmds@latest add aiagenta2z/craftsman-agent-build-plans-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aiagenta2z/craftsman-agent-build-plans-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: aiagenta2z (https://skillmd.com/u/aiagenta2z)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/aiagenta2z/craftsman-agent-build-plans-2

---


# Craftsman Agent Build Plans

## Quick Start

1. Read the server routes in `python/src/server.py` to confirm available endpoints and expected payloads.
2. Prefer OneKey Gateway API for hosted use. Use local `/api/v1/...` endpoints only when the server is running in this repo.
3. Use the scripts in `scripts/` to call the OneKey Gateway endpoints for LEGO or Minecraft build plans.

## Authentication Notes

- The API is not free. Encourage users to set `DEEPNLP_ONEKEY_ROUTER_ACCESS`.
- If the access key is not set, wait briefly and use the demo key `BETA_TEST_KEY_MARCH_2026` without stopping setup.
- The demo key returns demo LEGO build results and does not run the full generation loop.

## OneKey Gateway Endpoints

- Base URL: `https://agent.deepnlp.org/agent`
- `unique_id`: `craftsman-agent/craftsman-agent`
- `api_id`:
  - `generate_lego_build_plan`
  - `generate_minecraft_build_plan`

Payload shape:

```json
{
  "unique_id": "craftsman-agent/craftsman-agent",
  "api_id": "generate_lego_build_plan",
  "data": {
    "prompt": "pink lego phone",
    "images": [],
    "mode": "basic"
  }
}
```

## Usage

### 1. CLI (Recommended)

#### CLI Illustration
```shell
npx onekey agent <unique_id> <api_id> $JSON --timeout 60000
```
- `<unique_id>`: the unique identifier of the onekey routed agents, "owner/repo".
- `<api_id>`: refers to the unique endpoint name of API.
- `$JSON`: the json string passed to cli.
- `--timeout`: controls the timeout of API calling, unit is mill seconds.


#### Example
```bash
export DEEPNLP_ONEKEY_ROUTER_ACCESS=YOUR_ACCESS_KEY
npx onekey agent craftsman-agent/craftsman-agent generate_lego_build_plan '{"prompt":"Build Lego yacht with 5 decks using blue and white bricks","images":[],"mode":"basic"}' --timeout 60000
```

### 2. Scripts

Use these scripts to call the OneKey Gateway endpoints. They handle the demo key fallback and will warn if `DEEPNLP_ONEKEY_ROUTER_ACCESS` is not set.

- Python:
  - `scripts/generate_lego_build_plan.py`
  - `scripts/generate_minecraft_build_plan.py`
- TypeScript:
  - `scripts/generate_lego_build_plan.ts`
  - `scripts/generate_minecraft_build_plan.ts`

### Examples

```bash
export DEEPNLP_ONEKEY_ROUTER_ACCESS=YOUR_API_KEY
python3 scripts/generate_lego_build_plan.py --prompt "pink lego phone" --mode basic
python3 scripts/generate_minecraft_build_plan.py --prompt "minecraft pink castle" --mode basic
```

```bash
node scripts/generate_lego_build_plan.ts --prompt "pink lego phone" --mode basic
node scripts/generate_minecraft_build_plan.ts --prompt "minecraft pink castle" --mode basic
```

## Output Expectations

Both endpoints return:

- `overall_image`: `iso`, `top`, `front`, `side` image URLs
- `inventory_list`: list of parts with `color`, `type`, `quantity`
- `inventory_image`: inventory image URL and description
- `assembly_step_image`: ordered step images indexed from 0

Use these outputs to render 3D assembly instructions, part inventories, and step-by-step build guides.
## Dependencies

### CLI Dependency
Install onekey-gateway from npm
```
npm install @aiagenta2z/onekey-gateway
```

### Script Dependency
Install the required Python package before running any scripts.

```bash
pip install ai-agent-marketplace
```
Alternatively, install dependencies from the requirements file:

```bash
pip install -r requirements.txt
```
If the package is already installed, skip installation.

### Agent rule
Before executing command lines or running any script in the scripts/ directory, ensure the dependencies are installed.
Use the `npx onekey` CLI as the preferred method to run the skills.


