feat: add AutoClaw compatibility (#545)

* feat: add AutoClaw compatibility

- Add root SKILL.md following the open SKILL.md standard
- Add 'autoclaw' to skill.json#platforms
- Add AutoClaw install instructions to README
- Add docs/autoclaw-install.md with detailed install guide

AutoClaw is Z.ai's official general-purpose AI agent (https://autoclaw.z.ai),
part of the GLM Coding Plan family alongside ZCode and OpenClaw. This PR
adds first-class AutoClaw support without changing any existing platform
install paths.

Verified SKILL.md compliance with AutoClaw/ZCode spec:
- name and description in frontmatter (required)
- description < 1024 chars
- body < 100KB
- explicit trigger phrases in description

* text feat(cli): add AutoClaw platform support

- Register 'autoclaw' in AIType, AI_TYPES, and AI_FOLDERS configuration.
- Update SKILL.md to fix broken search script paths and incorrect folder layout documentation.
- Synchronize CLI assets to ensure platform configuration and script paths are correctly bundled.

* fix(cli): install AutoClaw skills where AutoClaw actually loads them

AutoClaw does not scan `.autoclaw`; it reads workspace `skills/` plus the
shared `~/.openclaw-autoclaw/skills` directory. Point the platform config at
those roots so `uipro init --ai autoclaw` produces a skill that AutoClaw
discovers without extra configuration.

- register `autoclaw` in AI_TO_PLATFORM and add templates/platforms/autoclaw.json
  with root `skills` and globalRoot `.openclaw-autoclaw/skills`
- detect AutoClaw from `.autoclaw` or an installed `skills/ui-ux-pro-max/SKILL.md`
  and add its CLI description
- sync cli/assets, including the packaged autoclaw.json
- restore the `## Using the Search Script (CLI)` section in the canonical skill
  template, keep the explanatory paragraph as body text, and remove the
  source-repo path from generated content
- make search.py add its own directory to sys.path so sibling imports work on
  embedded Python builds whose `._pth` omits the script directory (AutoClaw's
  bundled runtime)
- remove the hand-maintained root SKILL.md; templates/base/skill-content.md is
  the single source of truth
- rewrite docs/INSTALL.md around the verified local and global CLI workflows
- update e2e coverage for the new platform count, detection, and script paths

Validated with npm run check:assets, npm run typecheck, 49 Playwright tests,
164 Python tests, and local/global installs whose generated search script runs
successfully from the installed skill directory.

* Update search.py
This commit is contained in:
Walid Khalafi 2026-10-30 22:38:33 +03:30 committed by GitHub
parent 28b3b8dee8
commit 9a3f14f742
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 348 additions and 7 deletions

View File

@ -27,8 +27,15 @@ Persistence (Master + Overrides pattern):
import argparse
import json as json_module
import os
import sys
import io
# Embedded Python builds (for example AutoClaw's bundled runtime, which ships a
# ._pth file) do not add this script's directory to sys.path. Resolve sibling
# modules explicitly so `python <path>/search.py` works in those environments.
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, UNTRUNCATED_COLS, search, search_stack
from design_system import generate_design_system

View File

@ -293,6 +293,7 @@ uipro init --ai zcode # ZCode
uipro init --ai kimi # Kimi Code
uipro init --ai amazonq # Amazon Q Developer
uipro init --ai openclaw # OpenClaw (.agents/skills/)
uipro init --ai autoclaw # AutoClaw (skills/ or ~/.openclaw-autoclaw/skills)
uipro init --ai universal # Universal / Agent Standard (.agents/skills/)
uipro init --ai all # All assistants
```

View File

@ -26,6 +26,7 @@ uipro init --ai trae # Trae
uipro init --ai opencode # OpenCode
uipro init --ai amazonq # Amazon Q Developer
uipro init --ai openclaw # OpenClaw (.agents/skills/)
uipro init --ai autoclaw # AutoClaw (skills/ or ~/.openclaw-autoclaw/skills)
uipro init --ai universal # Universal / Agent Standard (.agents/skills/)
uipro init --ai all # All assistants

View File

@ -27,8 +27,15 @@ Persistence (Master + Overrides pattern):
import argparse
import json as json_module
import os
import sys
import io
# Embedded Python builds (for example AutoClaw's bundled runtime, which ships a
# ._pth file) do not add this script's directory to sys.path. Resolve sibling
# modules explicitly so `python <path>/search.py` works in those environments.
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, UNTRUNCATED_COLS, search, search_stack
from design_system import generate_design_system

View File

@ -18,6 +18,14 @@ If the user prefers not to install Python, skip the CLI searches and {{#QR}}rely
---
## Using the Search Script (CLI)
When invoked, this skill can run the bundled Python search script to query the catalogs. The script uses only the Python 3 standard library - no extra dependencies.
The script lives in this skill's own `scripts/search.py`. The commands below use the install-rooted path so they resolve when run from the project root.
---
## How to Use This Skill
Use this skill when the user requests any of the following:
@ -312,7 +320,7 @@ Scope notice: The rules below are for App UI (iOS/Android/React Native/Flutter),
### Icons & Visual Elements
- 默认图标库使用 **Phosphor (`@phosphor-icons/react`)**。`src/ui-ux-pro-max/data/icons.csv` 中列出的只是常用推荐图标,不是完整集合。
- 默认图标库使用 **Phosphor (`@phosphor-icons/react`)**。`data/icons.csv` 中列出的只是常用推荐图标,不是完整集合。
- 当推荐表中找不到合适的图标时:
- **优先继续从 Phosphor 的完整图标集中选择任何语义更贴切的图标**;
- 如果 Phosphor 也没有理想选项,可以使用 **Heroicons (`@heroicons/react`)** 作为备选,注意保持风格一致(线性/填充、笔画粗细、圆角风格)。

View File

@ -0,0 +1,22 @@
{
"platform": "autoclaw",
"displayName": "AutoClaw",
"installType": "full",
"folderStructure": {
"root": "skills",
"globalRoot": ".openclaw-autoclaw/skills",
"skillPath": "ui-ux-pro-max",
"filename": "SKILL.md"
},
"scriptPath": "ui-ux-pro-max/scripts/search.py",
"frontmatter": {
"name": "ui-ux-pro-max",
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks."
},
"sections": {
"quickReference": false
},
"title": "ui-ux-pro-max",
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.",
"skillOrWorkflow": "Skill"
}

View File

@ -1,4 +1,4 @@
export type AIType = 'claude' | 'cursor' | 'windsurf' | 'antigravity' | 'copilot' | 'kiro' | 'roocode' | 'codex' | 'qoder' | 'gemini' | 'trae' | 'opencode' | 'continue' | 'codebuddy' | 'droid' | 'kilocode' | 'warp' | 'augment' | 'codewhale' | 'zcode' | 'kimi' | 'amazonq' | 'openclaw' | 'universal' | 'all';
export type AIType = 'claude' | 'cursor' | 'windsurf' | 'antigravity' | 'copilot' | 'kiro' | 'roocode' | 'codex' | 'qoder' | 'gemini' | 'trae' | 'opencode' | 'continue' | 'codebuddy' | 'droid' | 'kilocode' | 'warp' | 'augment' | 'codewhale' | 'zcode' | 'kimi' | 'amazonq' | 'openclaw' | 'autoclaw' | 'universal' | 'all';
export type ConcreteAIType = Exclude<AIType, 'all'>;
export type InstallType = 'full' | 'reference';
@ -44,7 +44,7 @@ export interface PlatformConfig {
skillOrWorkflow: string;
}
export const AI_TYPES: AIType[] = ['claude', 'cursor', 'windsurf', 'antigravity', 'copilot', 'roocode', 'kiro', 'codex', 'qoder', 'gemini', 'trae', 'opencode', 'continue', 'codebuddy', 'droid', 'kilocode', 'warp', 'augment', 'codewhale', 'zcode', 'kimi', 'amazonq', 'openclaw', 'universal', 'all'];
export const AI_TYPES: AIType[] = ['claude', 'cursor', 'windsurf', 'antigravity', 'copilot', 'roocode', 'kiro', 'codex', 'qoder', 'gemini', 'trae', 'opencode', 'continue', 'codebuddy', 'droid', 'kilocode', 'warp', 'augment', 'codewhale', 'zcode', 'kimi', 'amazonq', 'openclaw', 'autoclaw', 'universal', 'all'];
// Legacy folder mapping for backward compatibility with ZIP-based installs.
// Note: .shared is included for platforms that used ZIP installs. Post-ZIP platforms
@ -73,5 +73,6 @@ export const AI_FOLDERS: Record<ConcreteAIType, string[]> = {
kimi: ['.kimi-code', '.shared'],
amazonq: ['.amazonq', '.shared'],
openclaw: ['.agents', '.shared'],
autoclaw: ['.autoclaw', '.shared'],
universal: ['.agents', '.shared'],
};

View File

@ -88,6 +88,9 @@ export function detectAIType(cwd: string = process.cwd()): DetectionResult {
if (existsSync(join(cwd, '.zcode'))) {
detected.push('zcode');
}
if (existsSync(join(cwd, '.autoclaw')) || existsSync(join(cwd, 'skills', 'ui-ux-pro-max', 'SKILL.md'))) {
detected.push('autoclaw');
}
if (existsSync(join(cwd, '.kimi-code'))) {
detected.push('kimi');
}
@ -161,6 +164,8 @@ export function getAITypeDescription(aiType: AIType): string {
return 'Amazon Q Developer (.amazonq/rules/)';
case 'openclaw':
return 'OpenClaw (.agents/skills/)';
case 'autoclaw':
return 'AutoClaw (skills/ locally, ~/.openclaw-autoclaw/skills/ globally)';
case 'universal':
return 'Universal (.agents/skills/)';
case 'all':

View File

@ -73,6 +73,7 @@ const AI_TO_PLATFORM: Record<string, string> = {
kimi: 'kimi',
amazonq: 'amazonq',
openclaw: 'openclaw',
autoclaw: 'autoclaw',
universal: 'universal',
};

View File

@ -6,7 +6,7 @@ const DESCRIPTION =
test('all platform metadata uses one accurate activation description', async () => {
const configs = await loadAllPlatformConfigs();
expect(configs.size).toBe(24);
expect(configs.size).toBe(25);
for (const [platform, config] of configs) {
expect(config.description, platform).toBe(DESCRIPTION);
if (config.frontmatter?.description) {

View File

@ -1,5 +1,5 @@
import { expect, test } from '@playwright/test';
import { mkdir, mkdtemp } from 'node:fs/promises';
import { mkdir, mkdtemp, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { detectAIType, getAITypeDescription } from '../../src/utils/detect.js';
@ -20,3 +20,30 @@ test('a sole .agents directory detects every consumer and still suggests codex',
test('openclaw has a platform description', async () => {
expect(getAITypeDescription('openclaw')).toBe('OpenClaw (.agents/skills/)');
});
test('a sole .autoclaw directory detects and suggests autoclaw', async () => {
const scratch = await mkdtemp(join(tmpdir(), 'uipro-detect-autoclaw-'));
await mkdir(join(scratch, '.autoclaw'));
const { detected, suggested } = detectAIType(scratch);
expect(detected).toEqual(['autoclaw']);
expect(suggested).toBe('autoclaw');
});
test('autoclaw has a platform description', async () => {
expect(getAITypeDescription('autoclaw')).toBe(
'AutoClaw (skills/ locally, ~/.openclaw-autoclaw/skills/ globally)'
);
});
test('an installed skills/ui-ux-pro-max directory detects autoclaw', async () => {
const scratch = await mkdtemp(join(tmpdir(), 'uipro-detect-autoclaw-skills-'));
await mkdir(join(scratch, 'skills', 'ui-ux-pro-max'), { recursive: true });
await writeFile(join(scratch, 'skills', 'ui-ux-pro-max', 'SKILL.md'), '---\nname: ui-ux-pro-max\n---\n');
const { detected, suggested } = detectAIType(scratch);
expect(detected).toEqual(['autoclaw']);
expect(suggested).toBe('autoclaw');
});

View File

@ -35,6 +35,22 @@ for (const [platform, localPath] of cases) {
});
}
test('autoclaw renders workspace skills locally and ~/.openclaw-autoclaw/skills globally', async () => {
const config = await loadPlatformConfig('autoclaw');
const localPaths = extractSearchScriptPaths(await renderSkillFile(config));
expect(localPaths).toHaveLength(SEARCH_COMMAND_COUNT);
expect(new Set(localPaths)).toEqual(new Set(['skills/ui-ux-pro-max/scripts/search.py']));
expect(await renderSkillFile(config)).not.toContain('{{SCRIPT_PATH}}');
const globalPaths = extractSearchScriptPaths(await renderSkillFile(config, true));
expect(globalPaths).toHaveLength(SEARCH_COMMAND_COUNT);
expect(new Set(globalPaths)).toEqual(
new Set(['~/.openclaw-autoclaw/skills/ui-ux-pro-max/scripts/search.py'])
);
expect(await renderSkillFile(config, true)).not.toContain('{{SCRIPT_PATH}}');
});
test('copilot renders .github/skills paths locally and ~/.copilot/skills globally', async () => {
const config = await loadPlatformConfig('copilot');

207
docs/INSTALL.md Normal file
View File

@ -0,0 +1,207 @@
# Installing UI/UX Pro Max in AutoClaw
UI/UX Pro Max installs into AutoClaw through the `ui-ux-pro-max-cli` package. The CLI generates the skill from the same canonical templates used for every other supported platform, so the installed copy always matches the current release.
AutoClaw loads skills from these locations (highest precedence first):
- `<workspace>/skills` - per-workspace skills (used by a local install)
- `~/.openclaw-autoclaw/skills` - shared skills for every agent on the machine (used by `--global`)
- `<workspace>/.agents/skills` and `~/.agents/skills`
The `autoclaw` platform config targets the first two paths, so an installed skill is discovered without any extra configuration.
## Prerequisites
- AutoClaw installed (download from <https://autoclaw.z.ai/?channel=zai>)
- Node.js 18+ and npm (for the CLI installer)
- Python 3.x on your system (the bundled search script uses only the standard library)
---
## Install the CLI
```bash
npm install -g ui-ux-pro-max-cli
```
This installs the `uipro` command.
---
## Method 1: Local Install (Per Workspace)
Run the installer from the AutoClaw workspace root (the project folder your agent uses):
```bash
uipro init --ai autoclaw
```
The CLI writes the skill to `skills/` inside that workspace:
```text
skills/
├── ui-ux-pro-max/ # orchestrator skill
│ ├── SKILL.md
│ ├── data/
│ └── scripts/
│ └── search.py
├── banner-design/
├── brand/
├── design/
├── design-system/
├── slides/
└── ui-styling/
```
The one `uipro init` call installs the orchestrator plus its six sibling sub-skills.
Useful flags:
```bash
uipro init --ai autoclaw --dry-run # Preview every path the install would write
uipro init --ai autoclaw --force # Overwrite an existing installation
```
You can also omit `--ai` and let the CLI detect the platform from an existing installation:
```bash
uipro init
```
---
## Method 2: Global Install (All Agents)
Run the installer with `--global`:
```bash
uipro init --ai autoclaw --global
```
The CLI writes the skill to `~/.openclaw-autoclaw/skills/` instead of the current workspace. In the generated `SKILL.md`, script commands are anchored at the home directory (`~/.openclaw-autoclaw/skills/ui-ux-pro-max/scripts/search.py`) so they resolve from any project.
---
## Activate the Skill in AutoClaw
1. Open AutoClaw
2. Go to **Settings → Skills**
3. Click **Refresh**
4. Confirm `ui-ux-pro-max` appears with the toggle enabled
5. Start a chat with a design prompt (e.g., "Build a dashboard for healthcare analytics") - the skill triggers automatically
---
## Verify the Installation
### Check the generated files
Local install (run from the workspace root):
```bash
ls skills/ui-ux-pro-max/SKILL.md
ls skills/ui-ux-pro-max/scripts/search.py
```
Global install:
```bash
ls ~/.openclaw-autoclaw/skills/ui-ux-pro-max/SKILL.md
ls ~/.openclaw-autoclaw/skills/ui-ux-pro-max/scripts/search.py
```
The generated `SKILL.md` should reference the installed location, not a source checkout. For a local install, its commands start with `skills/ui-ux-pro-max/scripts/search.py`; for a global install, with `~/.openclaw-autoclaw/skills/ui-ux-pro-max/scripts/search.py`.
### Run the search script
```bash
# Local install (from the workspace root)
python3 skills/ui-ux-pro-max/scripts/search.py "saas dashboard" --design-system
# Global install
python3 ~/.openclaw-autoclaw/skills/ui-ux-pro-max/scripts/search.py "saas dashboard" --design-system
```
On Windows, use `python` instead of `python3`.
If the script prints a design-system report, the skill and its data catalogs are installed correctly.
---
## Update
```bash
# Update a local installation
uipro update --ai autoclaw
# Update a global installation
uipro update --ai autoclaw --global
```
`uipro update` checks the latest CLI release. If the installed CLI is current, it regenerates the skill files with `--force`. If a newer CLI exists, it installs that version first and then asks you to rerun the command above.
---
## Uninstall
```bash
# Remove the workspace-local installation
uipro uninstall --ai autoclaw
# Remove the global installation
uipro uninstall --ai autoclaw --global
```
The CLI prompts for confirmation before removing the orchestrator and the six sibling sub-skills. Afterwards, click **Refresh** in AutoClaw's Skills page.
---
## Troubleshooting
### Skill doesn't appear in Settings → Skills
- Confirm the files are under a scanned root: `skills/ui-ux-pro-max/SKILL.md` (workspace) or `~/.openclaw-autoclaw/skills/ui-ux-pro-max/SKILL.md` (global).
- Make sure you ran the installer from the workspace root that AutoClaw uses, not from an unrelated folder.
- Confirm the directory name matches the `name` field in the frontmatter (both should be `ui-ux-pro-max`).
- Click **Refresh** in the Skills page.
- Check the diagnostics panel for any error messages.
### Skill appears but never triggers automatically
Common causes:
1. **Too many skills enabled** - AutoClaw injects metadata for every enabled skill into the model context. If you've blown past the budget, descriptions get dropped and the model can't decide when to trigger. Disable skills you don't actively use.
2. **Vague description** - The skill's `description` already spells out triggers, but if you've customized it, make sure your version includes concrete trigger phrases.
3. **Inside a subagent with a custom `tools` allowlist** - If you've defined a subagent that restricts tools, the skill tool may not be on the allowlist. Remove the `tools` field or add the skill tool explicitly.
### Search script fails to run
```bash
# Verify Python 3 is on PATH
python3 --version
# Run the script directly to see the error
python3 skills/ui-ux-pro-max/scripts/search.py "saas dashboard" --design-system
```
The script uses only the Python 3 standard library, so there should be no missing-module errors. If you see import errors, your Python install may be non-standard.
### Wrong paths in the generated SKILL.md
Reinstall with `--force` so the file is regenerated from the current templates:
```bash
uipro init --ai autoclaw --force
```
Or, for a global installation:
```bash
uipro init --ai autoclaw --global --force
```
---
## License
Same as upstream: MIT.

View File

@ -36,7 +36,8 @@
"warp",
"augment",
"antigravity",
"openclaw"
"openclaw",
"autoclaw"
],
"install": "npx ui-ux-pro-max-cli init --ai {{platform}}"
}

View File

@ -27,8 +27,15 @@ Persistence (Master + Overrides pattern):
import argparse
import json as json_module
import os
import sys
import io
# Embedded Python builds (for example AutoClaw's bundled runtime, which ships a
# ._pth file) do not add this script's directory to sys.path. Resolve sibling
# modules explicitly so `python <path>/search.py` works in those environments.
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, UNTRUNCATED_COLS, search, search_stack
from design_system import generate_design_system

View File

@ -18,6 +18,14 @@ If the user prefers not to install Python, skip the CLI searches and {{#QR}}rely
---
## Using the Search Script (CLI)
When invoked, this skill can run the bundled Python search script to query the catalogs. The script uses only the Python 3 standard library - no extra dependencies.
The script lives in this skill's own `scripts/search.py`. The commands below use the install-rooted path so they resolve when run from the project root.
---
## How to Use This Skill
Use this skill when the user requests any of the following:
@ -312,7 +320,7 @@ Scope notice: The rules below are for App UI (iOS/Android/React Native/Flutter),
### Icons & Visual Elements
- 默认图标库使用 **Phosphor (`@phosphor-icons/react`)**。`src/ui-ux-pro-max/data/icons.csv` 中列出的只是常用推荐图标,不是完整集合。
- 默认图标库使用 **Phosphor (`@phosphor-icons/react`)**。`data/icons.csv` 中列出的只是常用推荐图标,不是完整集合。
- 当推荐表中找不到合适的图标时:
- **优先继续从 Phosphor 的完整图标集中选择任何语义更贴切的图标**;
- 如果 Phosphor 也没有理想选项,可以使用 **Heroicons (`@heroicons/react`)** 作为备选,注意保持风格一致(线性/填充、笔画粗细、圆角风格)。

View File

@ -0,0 +1,22 @@
{
"platform": "autoclaw",
"displayName": "AutoClaw",
"installType": "full",
"folderStructure": {
"root": "skills",
"globalRoot": ".openclaw-autoclaw/skills",
"skillPath": "ui-ux-pro-max",
"filename": "SKILL.md"
},
"scriptPath": "ui-ux-pro-max/scripts/search.py",
"frontmatter": {
"name": "ui-ux-pro-max",
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks."
},
"sections": {
"quickReference": false
},
"title": "ui-ux-pro-max",
"description": "UI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation. Searchable local data: 79 searchable styles (50 active), 192 product palettes and reasoning profiles, 74 font pairings, 119 UX guidelines, 105 icons, 17 GSAP presets, 25 chart types, and 22 stacks.",
"skillOrWorkflow": "Skill"
}