pencil-mcp-snapshot-layout

$npx mdskill add partme-ai/full-stack-skills/pencil-mcp-snapshot-layout

Captures a structural snapshot of node trees in Pencil .pen files to analyze layout and detect problems.

  • Helps analyze page hierarchy, check for clipped or overlapping elements, and prepare for layout adjustments in Pencil designs.
  • Integrates with the Pencil MCP tool snapshot_layout, which may be namespaced as mcp__pencil__snapshot_layout.
  • Decides to execute only when the user explicitly mentions Pencil in the conversation context.
  • Presents results as a structural snapshot of the node tree, optionally filtered to show layout issues.

SKILL.md

.github/skills/pencil-mcp-snapshot-layoutView on GitHub ↗
---
name: pencil-mcp-snapshot-layout
description: "Capture a structural snapshot of the node tree in a Pencil .pen file via the snapshot_layout MCP tool, optionally filtering to only show layout problems. Use when the user explicitly mentions Pencil and needs to analyze page hierarchy, check for clipped or overlapping elements, or prepare for layout adjustments."
license: Complete terms in LICENSE.txt
---


## 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](examples/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](examples/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](examples/3-layout-problems.json).

## Keywords

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

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

More from partme-ai/full-stack-skills

SkillDescription
adobe-xd"Guides creation of UI/UX designs, interactive prototypes, reusable components, and design specs in Adobe XD. Use when the user asks about Adobe XD artboards, prototype links, repeat grids, component states, design tokens export, or developer handoff."
angular"Provides comprehensive guidance for Angular framework including components, modules, services, dependency injection, routing, forms, and TypeScript integration. Use when the user asks about Angular, needs to create Angular applications, implement Angular components, or work with Angular features."
ansible"Provides comprehensive guidance for Ansible automation including playbooks, roles, inventory, and module usage. Use when the user asks about Ansible, needs to automate IT tasks, create Ansible playbooks, or manage infrastructure with Ansible."
ant-design-mini"Builds mini-program UIs with Ant Design Mini components for Alipay and WeChat mini-programs. Covers Button, Form, List, Modal, Tabs, NavBar, and 60+ components with theme customization and CSS variable theming. Use when the user needs to create mini-program interfaces with Ant Design Mini, configure themes, or implement mini-program-specific UI patterns."
ant-design-mobile"Builds React mobile UIs with Ant Design Mobile (antd-mobile) components including Button, Form, List, Modal, Picker, Tabs, PullToRefresh, InfiniteScroll, and 50+ mobile-optimized components. Use when the user needs to create mobile-first React interfaces, implement mobile navigation, forms, or data display with Ant Design Mobile."
ant-design-react"Builds enterprise React UIs with Ant Design (antd) including 60+ components (Button, Form, Table, Select, Modal, Message), design tokens, TypeScript support, and ConfigProvider theming. Use when the user needs to create React applications with Ant Design, build forms with validation, display data tables, or customize the Ant Design theme."
ant-design-vueProvides comprehensive guidance for Ant Design Vue (AntDV) component library for Vue 3. Covers installation, usage, API reference, templates, and all component categories. Use when building enterprise-class UI with Vue 3 and Ant Design.
api-doc-generator"Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention."
appium"Provides comprehensive guidance for Appium mobile testing including mobile app automation, element location, gestures, and cross-platform testing. Use when the user asks about Appium, needs to test mobile applications, automate mobile apps, or write Appium test scripts."
ascii-ansi-colorizer"Add an ANSI color layer to existing ASCII/plain-text output (gradient/rainbow/highlights) with alignment-safe rules and a required no-color fallback. Use when the user wants to colorize terminal output, add rainbow effects to CLI text, or style ASCII art with ANSI colors."