mcpField
M
mastergo

mastergo

github.com/jeasonstudioDesign & UI14226 installsUpdated 38w ago
Repository

About mastergo

A skill for retrieving and analyzing design data from MasterGo files through Python scripts. It is intended for workflows that need page structure, DSL details, component documentation, and design metadata.

Key features

  1. 01Analyze page node trees
  2. 02Retrieve full DSL as JSON
  3. 03Fetch linked component docs
  4. 04Inspect tokens and interactions
  5. 05Use scripts with stdout output

Use cases

  1. 01Reviewing MasterGo page structure
  2. 02Extracting design data for code generation
  3. 03Checking component documentation links
  4. 04Inspecting navigation and interaction details

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jeasonstudio/mastergo-skills --skill mastergo

After installing, type/mastergoin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

LICENSE
.gitignore
README.md
README.zh-CN.md
.cursor/skills/skill-creator/
LICENSE.txt
.cursor/skills/skill-creator/references/
output-patterns.md
workflows.md
.cursor/skills/skill-creator/scripts/
package_skill.py
quick_validate.py
init_skill.py
references/
multi-page-workflow.md
dsl-types.md
dsl-structure.md
scripts/
mastergo_analyze.py
mastergo_get_dsl.py
mastergo_utils.py
mastergo_fetch_docs.py

Details

From the project README

MasterGo Skill

Retrieve and analyze design data from MasterGo files using self-contained Python scripts.

Prerequisites

Environment variable required:

export MASTERGO_TOKEN="mg_your_token_here"

Get token: MasterGo Settings > Security > Personal Access Token

Requirements: Team Edition account, files in Team Projects (not Drafts).

CRITICAL: Secure Token Handling

NEVER do this:

  • echo $MASTERGO_TOKEN - exposes secret in output
  • echo "Token: $MASTERGO_TOKEN" - exposes secret
  • printenv MASTERGO_TOKEN - exposes secret
  • Any command that prints the token value

Secure verification method:

test -n "$MASTERGO_TOKEN" && echo "Token is set" || echo "Token is NOT set"

This only prints whether the token exists, never its value.

Script Location

Scripts are in scripts/ relative to this SKILL.md file. Use absolute path when executing:

{this_skill_directory}/scripts/mastergo_*.py

Workflow

Step 1: Analyze DSL Structure

Always analyze first to understand the page structure:

python scripts/mastergo_analyze.py "https://mastergo.com/goto/xxx"

Output shows:

  • Node tree (type, name, size)
  • Text contents
  • Component doc links
  • Navigation targets
Step 2: Get Full DSL (if needed)

For detailed DSL data:

python scripts/mastergo_get_dsl.py "https://mastergo.com/goto/xxx"

Output: JSON with { dsl, componentDocumentLinks, rules }

Step 3: Fetch Component Docs

If componentDocumentLinks is non-empty, fetch relevant docs:

python scripts/mastergo_get_dsl.py URL | python scripts/mastergo_fetch_docs.py --from-dsl

Or fetch individually:

python scripts/mastergo_fetch_docs.py "https://example.com/button.mdx"

Scripts Reference

ScriptPurposeOutput
mastergo_analyze.pyStructure summaryHuman-readable tree to stdout
mastergo_get_dsl.pyFull DSL dataJSON to stdout
mastergo_fetch_docs.pyComponent docsDoc content to stdout
mastergo_utils.pyUtility functionsImport as module

DSL Key Concepts

  • token fields: Design tokens for colors, shadows, fonts (convert to CSS variables when generating code)
  • componentInfo: Component metadata including documentation links
  • interactive fields: User interactions including page navigation targets
  • rules array: Guidelines returned with DSL response

CRITICAL: Do NOT Pollute User Projects

FORBIDDEN actions:

  • Creating .temp_dsl.json or any DSL cache file in user project
  • Creating analyze_dsl.py or any analysis script in user project
  • Creating any temporary files in user project directory
  • Writing any skill-related files outside of skill directory

ALLOWED:

  • Running scripts and capturing stdout output
  • Using output directly in memory
  • Reading user's existing project files for context

All script output goes to stdout only. Use the output directly; do not save intermediate files to user's project.

References

Comments

Markdown supported