agentleFS
xp13910818313xp13910818313/pencil-skills/skills/pencil-mcp-snapshot-layout/SKILL.md

pencil-mcp-snapshot-layout

Skill0 starsChanged 10 months agoApache-2.0View on GitHub

Get page layout structure snapshot. Use when you need to understand the current page's DOM-like tree structure to prepare for layout adjustments.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 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.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If your client namespaces MCP tools, it may appear as mcp__pencil__snapshot_layout.

    line 14
  2. Distinctive:

    Recommendation: Always specify a reasonable limit (e.g., 2 or 3) to avoid context overflow.

    line 45
  3. Very specific:

    Determine Scope: Do you need the whole page (maxDepth=1) or a specific section (parentId=...)?

    line 54
  4. Very specific:

    Check for layout issues (like clipped content) deep within a specific section.

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
SKILL.md

Tools

This skill is designed to call the Pencil MCP tool:

  • snapshot_layout

If your client namespaces MCP tools, it may appear as mcp__pencil__snapshot_layout.

When to use this skill

Intent Recognition (CRITICAL)

Even if a trigger phrase matches, you must verify the user's intent:

  1. Is the user explicitly asking to use "Pencil"?
  2. Is the current conversation context clearly about "Pencil" design tasks?

If the answer is NO, do NOT use this skill. (e.g., "Analyze layout" might refer to HTML/CSS layout analysis).

CRITICAL PREREQUISITE: You must ONLY use this skill when the user EXPLICITLY mentions "Pencil".

ALWAYS use this skill when:

  • You need to understand the hierarchy and layout relationship of nodes in Pencil.
  • You are planning to move or align elements and need their current bounds.
  • You need to check for "problems" like clipped content or overlapping elements.
  • The user asks to "Analyze layout" or "Check structure" of a Pencil design.

Trigger phrases include:

  • "Pencil snapshot layout" (Pencil 布局快照)
  • "Analyze Pencil page structure" (分析 Pencil 页面结构)
  • "Check Pencil layout problems" (检查 Pencil 布局问题)
  • "Get Pencil node hierarchy" (获取 Pencil 节点层级)

Input Parameters

  • filePath (string, optional): Path to access a specific .pen file. Default is active document.
  • maxDepth (integer, optional):
    • Limit how deep to descend in the node tree.
    • Recommendation: Always specify a reasonable limit (e.g., 2 or 3) to avoid context overflow.
    • 0 means only top-level nodes.
  • parentId (string, optional): Only return layout for this node's subtree.
  • problemsOnly (boolean, optional):
    • Set to true to only return nodes with layout issues (e.g., clipped by parent).
    • Default: false.

How to use this skill

  1. Determine Scope: Do you need the whole page (maxDepth=1) or a specific section (parentId=...)?
  2. Call Tool: snapshot_layout(...).
  3. Analyze Output: The result is a tree structure with layout information (bounds, constraints).

Examples

1. Simple: Top Level Snapshot

Get the layout of the top-level frames to see where empty space might be. See 1-top-level.json.

2. Medium: Specific Frame Layout

Get the layout structure of a specific frame to understand its children's positioning. See 2-specific-frame.json.

3. Complex: Layout Problems

Check for layout issues (like clipped content) deep within a specific section. See 3-layout-problems.json.

Keywords

English keywords: snapshot layout, layout analysis, node hierarchy, structure check, bounds check, layout problems

Chinese keywords (中文关键词): 布局快照, 布局分析, 节点层级, 结构检查, 边界检查, 布局问题

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.