← 返回 Skills 市场
n2tr0n

ANSIClaw

作者 n2tr0n · GitHub ↗ · v0.0.4
cross-platform ✓ 安全检测通过
396
总下载
1
收藏
1
当前安装
4
版本数
在 OpenClaw 中安装
/install ansiclaw
功能描述
Draws BBS compatible ANSI art via the Clawbius API
使用说明 (SKILL.md)

\r \r

ANSIClaw 🦞🎨\r

\r Draw ANSI art via the local Clawbius REST API. Use anytime the user asks for ANSI art, or when you want to create it on your own initiative.\r \r Project home: \r \r

⛔ HARD RULES — BEFORE ANYTHING ELSE\r

\r

  1. NEVER modify reference files. Files in resources/ are your source material. Do not open them via /api/file/open without immediately calling /api/file/new afterward to switch to a fresh canvas. Opening a file in Clawbius makes it the active canvas — any draw calls will corrupt it. Analyze reference files by reading canvas data ONLY, then immediately create a new canvas before drawing.\r \r
  2. NEVER save or export over an existing ANS file without operators explicit instruction. Always use a new versioned filename (e.g. flower_v2.ans).\r \r
  3. NEVER use /api/file/export-png — the correct endpoint is /api/file/export/png (with a slash before png).\r \r ---\r \r

1. Session Start Checklist\r

\r Every new ANSIClaw session, in order:\r \r

  1. GET http://127.0.0.1:7777/api/canvas/info — confirm Clawbius is running\r
    • If not running it can be started from the clawbius folder with: launch_clawbius.sh\r
  2. GET http://127.0.0.1:7777/api/openapi.json — check for API changes\r
  3. Study reference files (see Section 4 below) — mandatory before drawing\r
  4. Read references/api.md for full endpoint details\r
  5. Check that ice colors are set to OFF unless Operator says otherwise (see Section 2 below)\r
  6. Only draw ONE iteration of the image, but analyze your result and ask the operator if you can improve it and tell them how you will improve it before drawing again. ANSI art is an iterative process — you should be learning and improving with each iteration.\r
  7. Only draw iterations when authorized, a maximum of 5 at a time. Ensure you keep copies of each iteration .PNG and .ANS named apprproately; _v1, _v2 etc using a strategy like _v1a to resolve conflicts\r \r Output dir: the 'outputs' folder in your skill folder — save ANS + PNG here - create the folder if it is not there\r \r ---\r \r

2. Color Rules\r

\r

⚠️ ICE COLORS — DEFAULT IS OFF. \r

\r Ice colors are OFF by default. Do not use colors 8–15 as background colors.\r \r If operator specifics that this is an 'ice colors ansi' you may turn ice colors control ON and use 8-15 as background colors.\r \r

  • Colors 0–7 are always safe as background\r
  • Colors 0–15 are always safe as foreground\r \r Turning ice colors ON:\r
  • Call POST /api/ui/ice-colors {"value": true}\r
  • Also pass "ice_colors": true in your POST /api/file/new call\r
  • Now bg colors 8–15 are available for BACKGROUND use and open up new color mixing possibilities.\r \r

16-Color Palette\r

\r

DARK (safe as foreground and background):\r
  0=black       1=dark blue   2=dark green  3=dark cyan\r
  4=dark red    5=magenta     6=brown       7=light gray\r
\r
BRIGHT (foreground ONLY unless ice colors ON):\r
  8=dark gray   9=blue        10=green      11=cyan\r
  12=red        13=light mag  14=yellow     15=white\r
```\r
\r
## 3. Block types\r
\r
### Shade Blocks (F1–F4)\r
\r
```\r
F1=176 ░  light shade    F2=177 ▒  medium shade\r
F3=178 ▓  dark shade     F4=219 █  full block\r
```\r
\r
Dithering is achieved by varying the shade block (F1–F4) with different foreground/background color pairs. This is the primary tool for gradients, texture, and depth in ANSI art. Avoid large areas of solid color blocks without shade variation, unless a 'toon' style is called for in which case favor a bright/dark cell shaded approach with minimal dithering.\r
\r
### Half-Blocks useful for edges and, smoother curves and anti-aliasing techniques\r
\r
```\r
220=▄ lower half   223=▀ upper half\r
221=▌ left half    222=▐ right half\r
```\r
\r
---\r
\r
## 4. Studying Reference Files (MANDATORY)\r
\r
Before drawing anything, study the reference files in `resources/`. Inspect the whole folder, not just the readme. Do these things: \r
\r
- Load the file if it is .ANS or .ASC and analyze it in clawbius - determine form and structure using your API and file analysis skills. focus on how blocks are used to generate aesthetic effects, how colors are combined, and how transitions are handled.\r
- analyze any PNG or image file for the same qualities - these are also ANSI art but rendered as images, so you can see the intended final output without the limitations of the ANSI format. Look for how colors are distributed, where half-blocks are used, and how shading is achieved.\r
\r
Study the reference files with the mindset of a detective — look for patterns, techniques, and stylistic choices that you can learn from and apply in your own work. This is a critical step that should not be skipped.\r
\r
### Step 1 — Read the README\r
```\r
resources/README.md\r
```\r
Get the description of each file and what it demonstrates. Also check the folder for any files not described in the readme.\r
\r
### Step 2 — Open and analyze canvas data via API\r
```python\r
import requests, json\r
# Open the reference file\r
requests.post("http://127.0.0.1:7777/api/file/open",\r
    json={"path": "/absolute/path/to/resources/file.ans"})\r
\r
# Get canvas info\r
info = requests.get("http://127.0.0.1:7777/api/canvas/info").json()\r
\r
# Get full canvas data and analyze color/code usage\r
data = requests.get("http://127.0.0.1:7777/api/canvas/data").json()\r
blocks = data["result"]\r
cols = info["result"]["columns"]\r
\r
# Study a region (e.g. rows 10-20):\r
for y in range(10, 20):\r
    unique = {}\r
    for x in range(0, cols):\r
        b = blocks[y * cols + x]\r
        key = (b["code"], b["fg"], b["bg"])\r
        unique[key] = unique.get(key, 0) + 1\r
    top = sorted(unique.items(), key=lambda x: -x[1])[:6]\r
    print(f"row {y}: {top}")\r
```\r
\r
Look for:\r
- What foreground/background color pairs dominate each region?\r
- Which shade blocks (F1–F4), and half-blocks are used and where?\r
- How are transitions handled between regions?\r
- What background colors are used — are they all 0–7?\r
\r
### Step 3 — Analyze the reference PNG\r
Each reference file in `resources/` should have a matching `.png` alongside the `.ans` file. Use the `image` tool to analyze the PNG directly:\r
```\r
image(image="\x3Cabsolute_path_to_resources/file.png>", prompt="...")\r
```\r
Study:\r
- Color regions and how they transition\r
- Where black separators appear between colored areas\r
- Half-block usage on edges and curves\r
- Overall composition and density\r
\r
---\r
\r
## 4. Core Style Rules\r
\r
### No-Tocar (Colored Areas Must Not Touch)\r
\r
**This is an important stylistic rule of some ANSI art.**\r
\r
Different objects can look more appealing when not touching each other directly. They can be separated by black (fg or bg=0) half-blocks or full blocks. This gives the art a clean, distinct look.\r
\r
**Wrong:** Red block directly adjacent to yellow block\r
**Right:** Red block → black half-block separator → yellow block\r
\r
Use `▌(221)`, `▐(222)`, `▀(223)`, `▄(220)` with `fg=color, bg=BLACK` to create clean color boundaries.\r
\r
Example — transitioning from red to yellow area:\r
```\r
[RED F4][▐ fg=RED bg=BLACK][▌ fg=YELLOW bg=BLACK][YELLOW F4]\r
```\r
\r
### Shading & Depth\r
\r
- Use F1–F4 shade blocks to build gradients — never just solid color fills for large areas\r
- Light source: decide where the light is coming from and be consistent\r
- Lit faces: use lighter shade blocks (F1/F2) or higher-contrast fg color\r
- Shadow faces: use F3/F4 or black fg\r
- Edges catch light: use `UH(223)` or `LH(220)` with bright fg on dark bg for edge highlights\r
\r
### Typical Shading Patterns\r
\r
```\r
Sky gradient (top to bottom, dark to light):\r
  F4 fg=DBLUE bg=BLACK → F3 fg=BLUE bg=BLACK → F2 fg=BLUE bg=BLACK → F1 fg=CYAN bg=BLACK\r
\r
Ground (dark):\r
  F4 fg=BLACK bg=BLACK → F3 fg=BROWN bg=BLACK → F2 fg=BROWN bg=BLACK\r
\r
Metal object (gray, lit from top-left):\r
  top edge:  UH fg=LGRAY bg=DGRAY  ← highlight\r
  upper:     F2 fg=LGRAY bg=DGRAY\r
  mid:       F3 fg=DGRAY bg=BLACK\r
  lower:     F4 fg=BLACK bg=BLACK  ← deep shadow\r
\r
Fire/explosion background:\r
  F3 fg=RED bg=BLACK → F2 fg=BROWN bg=BLACK → F1 fg=YELLOW bg=BLACK\r
  Vary randomly across rows/columns — avoid horizontal banding\r
\r
General style tip: Once the gradient is established, add complexity - patterns can be mixed, stair stepped to create visual complexity\r
```\r
\r
### Half-Block Edge Technique\r
\r
At the boundary between a filled area and black space, use half-blocks to smooth the edge and add depth:\r
- `UH(223) fg=color bg=BLACK` — object color on top, black below (bottom edge of object)\r
- `LH(220) fg=color bg=BLACK` — black on top, object color below (top edge of object)\r
- These also double as separators (no-tocar) between two color regions\r
- Also use half blocks for round, circular edges and diagonal lines and organic shapes like hair or the curvature of an object\r
\r
---\r
\r
## 5. Drawing Approach\r
\r
Write Python scripts using `requests`. Never curl individual cells — always batch with scripts.\r
\r
**Script template:**\r
```python\r
import requests, os\r
BASE = "http://127.0.0.1:7777"\r
\r
def post(path, data):\r
    r = requests.post(f"{BASE}{path}", json=data)\r
    resp = r.json()\r
    if not resp.get("ok"): print(f"WARN {path}: {resp}")\r
    return resp\r
\r
def rect(x, y, w, h, code=219, fg=7, bg=0):\r
    if w > 0 and h > 0:\r
        post("/api/draw/rect/filled", {"x":x,"y":y,"width":w,"height":h,"code":code,"fg":fg,"bg":bg})\r
\r
def at(x, y, code=219, fg=7, bg=0):\r
    post("/api/draw/at", {"x":x,"y":y,"code":code,"fg":fg,"bg":bg})\r
\r
def line(x1, y1, x2, y2, code=219, fg=7, bg=0):\r
    post("/api/draw/line", {"x1":x1,"y1":y1,"x2":x2,"y2":y2,"code":code,"fg":fg,"bg":bg})\r
\r
# Canvas setup — ice_colors=False unless Operator says otherwise\r
post("/api/file/new", {\r
    "columns": 80, "rows": 25,\r
    "title": "Title", "author": "Clawd", "group": "ANSIClaw",\r
    "ice_colors": False\r
})\r
```\r
\r
Save scripts to skill folder `scripts/`\r
Save output to skill folder `output/` — always export both ANS and PNG.\r
\r
---\r
\r
## 6. Input Files (Image-to-ANSI Renditions)\r
\r
Operator may drop a source image into `inputs/` and ask for an ANSI rendition of it. **Do not check this folder unless explicitly asked.**\r
\r
When asked to render an input file:\r
\r
1. Read the image with the `image` tool — study shapes, dominant colors, light source, and composition\r
2. Map the image's colors to the 16-color ANSI palette (find the closest match for each major region)\r
3. Plan the canvas layout — decide which regions become which shade/color blocks\r
4. Simplify aggressively — ANSI art is abstraction, not photorealism. Pick 3-5 dominant colors max\r
5. Sketch the composition in comments before coding: major regions, where half-blocks go, light direction\r
6. Draw it — apply all the usual style rules (no-tocars, shade gradients, half-block edges)\r
7. Save output to the usual place\r
\r
---\r
\r
## 7. Full API Reference\r
\r
See `references/api.md` — full endpoint details, parameter lists, CP437 extended codes.\r
\r
---\r
\r
## 8. Lessons Learned (from real sessions)\r
\r
### Sky / Background Gradients\r
- **Don't use random noise for texture** — even at 15-18% density it creates "rain" or "static" artifacts that look terrible.\r
- **Don't use per-column checkerboard dithering on every row** — ANSI cells are tall and narrow, so alternating x%2 columns creates visible vertical stripes, not smooth blending.\r
- **Do use clean solid bands** — banding is natural and expected in ANSI art sky gradients. 4-5 rows per band (F4→F3→F2→F1, DBLUE on BLACK) reads cleanly.\r
- If you want a subtle transition between bands, a single dither row between solid blocks is the maximum — and even that can stripe visually, so test it.\r
\r
### Petals / Organic Shapes\r
- Start wider than you think you need. Horizontal spread reads better at ANSI cell aspect ratio than height.\r
- Use the full shade gradient within each petal (F1 at tip → F4 at base where it meets the center) to imply curvature.\r
- Each petal's outermost edge should be `RFH`/`LFH` (half-block) with bg=BLACK to keep the no-tocars boundary clean.\r
- Diagonal petals need extra width (4+ cols) to be visible — don't short-change them.\r
\r
### Centers / Small Color Areas\r
- A 2x2 center block can convey light/shadow convincingly:\r
  - top-left: F1 bright-color on dark-bg (lit)\r
  - top-right: F2\r
  - bottom-left: F3\r
  - bottom-right: F4 (deepest shadow)\r
- bg=BROWN (6) is always safe (it's \x3C8), good for warm center tones.\r
\r
### API Gotchas\r
- Export PNG endpoint is `/api/file/export/png` (not `/api/file/export-png`).\r
- Always check `openapi.json` at session start — endpoints may have changed.\r
- `post()` should print warnings but not crash on bad responses — wrap defensively.\r
安全使用建议
This skill is coherent: it draws ANSI art by talking to a Clawbius service on localhost and saves output files in your home folders. Before installing/running: (1) confirm you have a trusted Clawbius binary (node.js) running on tcp/7777 — the skill will POST to that local endpoint; (2) review the included Python scripts if you care where files get written (they save to ~/Desktop and ~/Documents/ANSIClaw Output); (3) be cautious about using the API file-open capability to open arbitrary absolute paths—only open files in the skill's resources/ or other trusted locations to avoid exposing unrelated local files to the drawing process; (4) ensure Python 'requests' is installed. If you plan to run unmodified, these behaviors are expected and proportional to the skill's purpose.
功能分析
Type: OpenClaw Skill Name: ansiclaw Version: 0.0.4 The ANSIClaw skill bundle is a legitimate toolset designed to allow an AI agent to create ANSI art using the Clawbius REST API. The bundle contains well-structured Python scripts (e.g., draw_butterfly.py, draw_field.py) that interact with a local endpoint (127.0.0.1:7777) to perform drawing operations. The SKILL.md file provides detailed artistic guidelines and safety constraints, such as preventing the overwriting of reference files and ensuring iterative user feedback. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found; the file access is limited to saving output art to standard user directories like ~/Desktop.
能力评估
Purpose & Capability
Name/description claim (draw ANSI art via Clawbius) matches the included files and SKILL.md. The scripts only call a local API (127.0.0.1:7777) and perform drawing/export operations; required runtime pieces (node.js to run Clawbius, Python requests) are reasonable and explicitly documented.
Instruction Scope
SKILL.md and scripts instruct the agent to read reference files in the skill's resources/ folder, create new canvases, draw, and save/export PNG/ANS files to ~/Desktop or ~/Documents. That scope is appropriate for an art tool, but note the agent will issue POST /api/file/open with absolute paths and will save files into the user's home directory—so file-open/save operations are real filesystem actions and should be allowed only if you trust local Clawbius and the skill's scripts.
Install Mechanism
No install spec; this is instruction/code-only. No external downloads or package installs performed by the skill itself. It relies on system-provided node.js and Python 'requests', which is proportional and documented.
Credentials
The skill requests no environment variables, no credentials, and no config paths beyond local resource files. That matches the stated purpose.
Persistence & Privilege
The skill is not marked always:true and does not attempt to modify other skills or system-wide settings. It writes output files into the user's home directories (Desktop/Documents), which is expected for an art-exporting tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ansiclaw
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ansiclaw 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.0.4
- Adds strict session guidelines: only one ANSI art iteration per session, with mandatory operator approval for further iterations (max 5 at a time). - Clarifies process for studying reference files and stresses detective-like analysis of all resources before drawing. - Expands and organizes color and dithering rules, with emphasis on correct use of ice colors and block types. - Refines "no-tocar" (no-touch) style rule details and when to apply it. - Aligns documentation for output file naming and version management for each iteration. - General documentation cleanup and updated links for project and dependencies.
v0.0.3
- Added a .gitignore file to the project. - Updated the SKILL.md documentation: - Removed dependency on the 'peekaboo' package; screenshot analysis now relies on the PNG files provided alongside .ans reference files. - Adjusted the workflow for studying references: use the `image` tool to analyze reference PNGs directly instead of taking new screenshots. - Minor instructions streamlined to match the new reference analysis workflow.
v0.0.2
ansiclaw 0.0.2 - Major SKILL.md rewrite for clarity and brevity; removed redundant and overly technical explanations. - Output directory changed to the 'outputs' folder inside the skill folder. - Updated compatibility note: optimized for Mac OS Sequoia. - Updated style guidance to clarify "no-tocar" technique as optional for some ANSI scenes. - Improved instructions for session startup, ice color handling, and reference file analysis. - General documentation cleanup; now more concise and focused for end-user clarity.
v0.0.1
initial commit
元数据
Slug ansiclaw
版本 0.0.4
许可证
累计安装 1
当前安装数 1
历史版本数 4
常见问题

ANSIClaw 是什么?

Draws BBS compatible ANSI art via the Clawbius API. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 396 次。

如何安装 ANSIClaw?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ansiclaw」即可一键安装,无需额外配置。

ANSIClaw 是免费的吗?

是的,ANSIClaw 完全免费(开源免费),可自由下载、安装和使用。

ANSIClaw 支持哪些平台?

ANSIClaw 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 ANSIClaw?

由 n2tr0n(@n2tr0n)开发并维护,当前版本 v0.0.4。

💬 留言讨论