fractal

GitHub

Fractal无头模式技能,用于通过CLI代理处理大型代码库的分析、审计及复杂推理任务。利用递归语言模型在Docker沙箱中程序化处理上下文,避免上下文溢出,适用于跨文件溯源、日志分析等重负载场景。

.agents/skills/fractal/SKILL.md jasonkneen/tiny-world-builder

触发场景

需要分析大型或深层代码库结构 执行跨多个文件的审计或根因调查 对超出上下文限制的文档或日志进行综合问答 在非交互式环境中调用AI代理进行自动化代码分析

安装

npx skills add jasonkneen/tiny-world-builder --skill fractal -g -y
更多选项

非标准路径

npx skills add https://github.com/jasonkneen/tiny-world-builder/tree/main/.agents/skills/fractal -g -y

不安装直接使用

npx skills use jasonkneen/tiny-world-builder@fractal

指定 Agent (Claude Code)

npx skills add jasonkneen/tiny-world-builder --skill fractal -a claude-code -g -y

安装 repo 全部 skill

npx skills add jasonkneen/tiny-world-builder --all -g -y

预览 repo 内 skill

npx skills add jasonkneen/tiny-world-builder --list

SKILL.md

Frontmatter
{
    "name": "fractal",
    "description": "Delegate analysis- and context-heavy work to Fractal, an agentic CLI powered by a self-harnessed Recursive Language Model (predict-rlm), by running it non-interactively (fractal -p). Reach for it when a task needs reasoning over a large or deep codebase, synthesizing an answer across many files, auditing, or open-ended investigation — work that would otherwise flood your own context. The RLM reasons over context programmatically (no context rot) and returns a distilled answer. Use when asked to run Fractal headless, script it, call it from CI or another agent, or offload a heavy analysis\/large-context task. Less suited to trivial single-file edits you can do directly."
}

Fractal headless mode

Fractal is an agentic CLI powered by predict-rlm, a self-harnessed Recursive Language Model runtime. Each invocation runs one RLM turn: it mounts the workspace into a Docker sandbox, lets the model write and run its own code to read/edit files and run commands, then prints a final answer. Headless mode is fractal -p "<task>".

Install Fractal (if needed)

Before anything else, check that the fractal command exists, and install it if it doesn't:

command -v fractal >/dev/null 2>&1 \
  && fractal --version \
  || curl -LsSf https://fractal.trampoline.ai/install.sh | sh

The installer bootstraps uv if needed, installs Fractal as an isolated tool, and puts fractal on the PATH. If it was just installed in this shell, fractal may not be on the PATH until you start a new shell or re-source your profile.

Fractal also needs, at runtime:

  • Docker, running — every turn executes in a Docker sandbox.
  • The sbx CLI, logged inbrew install docker/tap/sbx && sbx login.
  • A configured model provider — verify with the Preflight checks below.

When to reach for it

An RLM reasons over context programmatically — it greps, reads, and slices files in code instead of loading everything into one prompt — so it handles large or deep inputs without context rot. Defer to Fractal when a task is analysis- or context-heavy and would otherwise flood your own context:

  • "Trace how a request flows through this 200-file service, end to end."
  • "Audit this repo for X across every file and summarize the findings."
  • "Read these logs / this diff / these docs and tell me the root cause."
  • Synthesis or Q&A over a directory too big to pull into your own window.

It also works as a general coding agent (fix a bug, make tests pass) — use that when convenient. But skip it for trivial, local edits you can do yourself in a file read or two: each turn is slow (minutes) and separately billed, so the payoff is in the heavy jobs.

Quick start

fractal -p "Trace how a request flows through this service, end to end" --workspace /path/to/project
  • stdout = the agent's final response text, nothing else.
  • stderr = banner, progress, changed files, usage/cost, completion status.
  • Capture the two streams separately so you can use the response while still reading diagnostics: out=$(fractal -p "..." 2>err.log).

Preflight (do once per machine/session)

docker info >/dev/null || echo "start Docker first"   # sandbox needs the daemon
fractal config status                                  # provider/model/auth ok?

If config is missing, fractal config setup is interactive — in automation use fractal config set ... or the FRACTAL_PROVIDER / FRACTAL_MODEL env vars.

Output contract

Channel Content
stdout Final response text only (trailing newline guaranteed)
stderr fractal: session <id>, progress events, fractal: changed files a.py, b.py, fractal: usage N in / M out tokens, $X, fractal: complete
exit 0 Turn completed
exit 1 Setup/runtime error (fractal: failed: ... on stderr)
exit 2 Hit --max-iterations; best-effort response still on stdout
exit 130 Interrupted (Ctrl-C / SIGINT)

For scripting, capture streams separately: out=$(fractal -p "..." 2>err.log).

Key flags

  • --workspace DIR — directory the agent edits. Always pass it explicitly; default is the cwd.
  • --json — print one machine-readable result object to stdout instead of plain text (session_id, status, response, changed_files, usage, error). Pair with --quiet for stdout-only JSON. See RECIPES.md.
  • --quiet — suppress all stderr. Stdout-only, but you lose progress, the session id, changed-files, and cost. Prefer capturing stderr to a file over --quiet when you need to resume or audit.
  • --verbose — full per-iteration trace (reasoning, code, output) on stderr. Use when debugging why a turn did something.
  • -p - — read the whole prompt from stdin (fails fast if stdin is empty). Piping stdin alongside a normal -p "..." instead appends it as context: git diff | fractal -p "review this diff".
  • --resume SESSION_ID — continue a prior session (multi-turn memory works headless). Get the id from the stderr line fractal: session <id>, or the newest file in <workspace>/.fractal/sessions/.
  • --include DIR — mount extra read/write dirs into the sandbox (repeatable).
  • --lm / --sub-lm / --max-iterations — per-run overrides; env equivalents FRACTAL_MODEL, FRACTAL_SUB_MODEL, FRACTAL_MAX_ITERATIONS.

Tips for reliable runs

  • fractal: command failed: ... lines on stderr are the agent probing (e.g. trying pytest variants), not failures — trust the exit code and any fractal: failed: line.
  • Validate model ids with fractal config status before a run, so a typo is caught up front rather than mid-turn.
  • For structured output, ask for it in the prompt (e.g. "respond with only a JSON array of …"), or run in a clean git tree and diff it afterwards to see exactly what changed.

See RECIPES.md for copy-paste patterns: CI gate, multi-turn driver, diff review, structured output.

版本历史

  • 2ffaf91 当前 2026-07-06 00:19

同 Skill 集合

.agents/skills/lightweight-3d-effects/SKILL.md
.agents/skills/threejs-primitive-reconstructor/SKILL.md
.agents/skills/tinyworld-i18n/SKILL.md
.claude/skills/tinyworld-i18n/SKILL.md
.codex/skills/threejs-primitive-reconstructor/SKILL.md
.codex/skills/tinyworld-25d-template-sprites/SKILL.md
.codex/skills/tinyworld-asset-editing/SKILL.md
.codex/skills/tinyworld-auto-batching/SKILL.md
.codex/skills/tinyworld-block-button-style/SKILL.md
.codex/skills/tinyworld-cctv-truman/SKILL.md
.codex/skills/tinyworld-ghost-world-gen/SKILL.md
.codex/skills/tinyworld-integrations/SKILL.md
.codex/skills/tinyworld-island-and-planes/SKILL.md
.codex/skills/tinyworld-island-viewer/SKILL.md
.codex/skills/tinyworld-lowpoly-stylized-3d/SKILL.md
.codex/skills/tinyworld-lowpoly-world-prompt/SKILL.md
.codex/skills/tinyworld-mesh-terrain/SKILL.md
.codex/skills/tinyworld-opacity-torch/SKILL.md
.codex/skills/tinyworld-render-performance/SKILL.md
.codex/skills/tinyworld-runtime-state/SKILL.md
.codex/skills/tinyworld-settings/SKILL.md
.codex/skills/tinyworld-shader-fx/SKILL.md
.codex/skills/tinyworld-single-file/SKILL.md
.codex/skills/tinyworld-tile-variation/SKILL.md
.codex/skills/tinyworld-tinyverse-collectibles/SKILL.md
.codex/skills/tinyworld-tinyverse-race-track/SKILL.md
.codex/skills/tinyworld-tool-icons-and-modes/SKILL.md
.codex/skills/tinyworld-visual-qa/SKILL.md
.codex/skills/tinyworld-webxr/SKILL.md
.agents/skills/3d-modeling/SKILL.md
.agents/skills/poly-pizza-api/SKILL.md

元信息

文件数
0
版本
8afdf00
Hash
d64b2913
收录时间
2026-07-06 00:19

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-04 20:31
浙ICP备14020137号-1 $访客地图$