Index of every page on this site: llms.txt
All skills
penpot avatar

/penpot-router

@fe4f99e
by penpotpenpot/penpot-ai-kit126 stars
17
Run it yourself

Thin dispatcher / entry point for any Penpot request. Use FIRST on any Penpot task to ensure high_level_overview ran, read the user's intent, and route to exactly one target skill or workflow (build a screen, build a slide deck, build a design system, audit accessibility, audit tokens, migrate from Figma, rename layers, code review, extract DESIGN.md, etc.). Never mutates the canvas. Triggers: 'work on this Penpot file', 'help me with Penpot', 'I want to design/build/audit/migrate in Penpot', 'where do I start', 'which skill should I use', 'route this request', ambiguous Penpot asks.

Use this Skill: https://skilld.dev/gh/penpot/penpot-ai-kit/penpot-router

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

references02-preflight-overview.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

02 — Preflight & Overview (router Phase 0)

Loaded during Phase 0 (Discovery) of penpot-router. Phase 0 is read-only. Its job is to (a) guarantee the MCP's own guidance is loaded and (b) sense the current state of the file so the routing decision in Phase 1 is grounded in reality — not the user's words alone. The router never mutates here, so there is nothing to validate with export_shape.

Step 1 — Always call high_level_overview first

Per AGENTS.md §2 and shared/penpot-mcp-tool-reference.md, high_level_overview (no arguments) must be called once per session before any other Penpot action. It returns the MCP's own usage guidance plus a Plugin API overview.

  • If you cannot confirm it ran in this session, call it now.
  • Record storage.router.overviewCalled = true so a resumed session can tell.
  • No routing decision is executed in a session where the overview was skipped (Critical Rule 1).

Step 2 — Sense file + selection state (one read-only execute_code call)

This single read tells you the page layout, what's selected, and where work would land. Paste into one execute_code call:

// READ-ONLY. Verify any unfamiliar helper with penpot_api_info before relying on it,
// e.g. penpot_api_info("PenpotUtils", "shapeStructure").
return {
  pages: penpotUtils.getPages().map(p => p.name),
  currentPage: penpot.currentPage && penpot.currentPage.name,
  selectionCount: penpot.selection.length,
  selection: penpot.selection.map(s => ({ id: s.id, name: s.name, type: s.type })),
  // depth 1 keeps the return small; the router only needs the top-level shape of the page
  topLevel: penpotUtils.shapeStructure(penpot.currentPage.root, 1)
};

What to read from the result:

  • selectionCount / selection — a non-empty selection usually means the user wants to act on those shapes (rename them, componentize them, audit them). Route accordingly.
  • topLevel — is the page empty (bias toward foundations/bootstrap) or full of boards (bias toward build/audit/review)? Are layer names auto-generated (Rectangle 12, Board) → naming is a likely intent or prerequisite?
  • pages — multiple pages named like screens implies an existing product; a lone default page implies a fresh start.

Step 3 — Sense token / design-system state (one read-only call)

Whether a design system already exists is the single biggest tie-breaker (see 01-intent-taxonomy.md):

// READ-ONLY. tokenOverview returns the active token sets/themes and counts.
const ov = penpotUtils.tokenOverview();
return {
  hasTokens: !!(ov && ov.totalTokens),
  overview: ov   // sets, themes, counts — enough to know if a system exists
};

Decision impact:

  • hasTokens === false → "set up our design system" / "build a screen" should bias toward penpot-foundations or the design-system-bootstrap workflow first — you cannot bind shapes to tokens that do not exist.
  • hasTokens === true → build/audit/review skills are viable directly; "set up tokens" likely means extend an existing set, not bootstrap.

Step 4 — Record the breadcrumb (optional, still effectively read-only intent)

So a resumed session can see how the route was reached, drop a tiny breadcrumb. This is metadata, not a canvas change. Verify the signature first.

// Verify: penpot_api_info("PenpotFile", "setSharedPluginData")
penpot.currentFile.setSharedPluginData(
  "penpot-ai",
  "router.lastRoute",
  JSON.stringify({ at: new Date().toISOString(), chosenTarget: "REPLACE-ME" })
);
return { recorded: true };

(If the host client is sandboxed or the call is unavailable, skip it — correctness must not depend on the breadcrumb; storage.router is enough for the session.)

Output discipline

  • Keep every return small and structured (names, counts, ids). These are read back by the agent.
  • Do not console.log a value you also return.
  • One logical read per execute_code call — Steps 2, 3, and 4 are separate calls.

Exit criterion for Phase 0

You can now answer three questions, which Phase 1 needs to classify intent:

  1. Does a token/design system already exist? (hasTokens)
  2. Is the user pointing at specific shapes? (selection)
  3. Is the file empty, fresh, or a mature product? (pages + topLevel)

Proceed to Phase 1 (intent classification, 01-intent-taxonomy.md). No user checkpoint is required to leave Phase 0 — it changed nothing.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill acts as a router for Penpot design tasks. It is generally safe but possesses a standard attack surface for indirect prompt injection by processing external design data (layer names and tokens) from the workspace without explicit sanitization.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at fe4f99e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 2 months ago
disable-model-invocation
false
version
0.3.1
audiences
[
  "design-system",
  "product-designer",
  "design-engineer",
  "migration"
]
Other metadata
mode-default
suggest
requires
[
  "shared/penpot-mcp-tool-reference.md",
  "shared/plugin-api-gotchas.md",
  "shared/tokens-schema.json",
  "shared/naming-conventions.md",
  "shared/state-management.md",
  "shared/modes-and-policies.md"
]

README badge

README badge for penpot/penpot-ai-kit/penpot-router