agentleFS
doublejdoublej/consult-user-mcp/sketch-cli/CLAUDE.md

consult-user-mcp / sketch-cli

CLAUDE.md39 starsChanged 4 months agoMITView on GitHub

The grid layout editor behind the propose_layout MCP tool. A separate Swift CLI from the [[Dialog CLI]] — different binary, different command set, different problem. macOS only. Not a dialog. It is an editor: the agent proposes a layout, the user rearranges blocks on a grid, and the result comes back as structured layout data. Five commands (Main.swift): Three renderers, one layout model. Rendering/ holds AsciiRenderer, SvgRenderer, and DescriptionRenderer. A change to Models/LayoutModels.swift or SemanticLayout.swift ripples into all three, and…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not a dialog. It is an editor: the agent proposes a layout, the user rearranges blocks on a grid, and the result comes back as structured …

    line 9

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Sketch CLI

What this is

The grid layout editor behind the propose_layout MCP tool. A separate Swift CLI from the [[Dialog CLI]] — different binary, different command set, different problem. macOS only.

Mental model

Not a dialog. It is an editor: the agent proposes a layout, the user rearranges blocks on a grid, and the result comes back as structured layout data.

Five commands (Main.swift):

CommandDoes
templatesReturns the built-in density templates
describeTurns a layout into prose
renderRenders a layout without opening a window
proposeOpens the interactive editor — the one the MCP tool calls
testScreenshot harness (Testing/)

Three renderers, one layout model. Rendering/ holds AsciiRenderer, SvgRenderer, and DescriptionRenderer. A change to Models/LayoutModels.swift or SemanticLayout.swift ripples into all three, and each one fails differently — ASCII misaligns, SVG produces valid-but-wrong output, description silently omits.

Services/LayoutCompiler.swift turns the editor state into the output model; Services/ContentInference.swift guesses block content from context.

Important invariants

  • propose_layout is single-flight. mcp-server guards against a second concurrent call, and the tool is removed entirely on Windows. Do not add a Windows path here.
  • This CLI ships in the app bundle too. mcp-server/src/providers/swift.ts looks for it in the bundle first, then .build/release/. A debug-only build will not be found by the installed app.
  • Theme and window code are forked from the Dialog CLI, not shared. Theme/Theme.swift, Window/BorderlessWindow.swift, and Components/FocusableButton.swift exist in both trees. A fix in one does not reach the other — port it deliberately or leave it.

Common change patterns

Changing the layout model → update all three renderers and re-run the test harness. The ASCII output is the fastest way to see a model change go wrong.

Adding a block type → Models/BlockStyles.swift, Views/BlockView.swift, all three renderers, AddBlockSheet.swift.

Verification

swift build                                  # from sketch-cli/
.build/debug/SketchCLI templates
.build/debug/SketchCLI test                  # screenshot harness → test-report/

Testing/HtmlReportGenerator.swift produces a browsable report — the practical way to review a rendering change.

Related context

  • ../mcp-server/CLAUDE.md — how propose_layout reaches this binary
  • ../test-cases/cases/sketch/ — fixtures
  • ../dialog-cli/CLAUDE.md — the sibling CLI these components were forked from

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.