Agent skill

Validate Syntax

by peijun1700 in peijun1700/bluemouse

L1-L4 語法和結構驗證 - 檢查 Python 語法、AST 結構、縮進格式、命名規範. An agent skill from peijun1700/bluemouse.

AGPL-3.0Auto-check: notes

Install Validate Syntax

skills CLI
$ npx skills add peijun1700/bluemouse --skill validate-syntax -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install peijun1700/bluemouse validate-syntax --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/peijun1700/bluemouse.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/validate-syntax .claude/skills/validate-syntax && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
validate-syntax
GitHub stars
109
Token cost
~856 tokens
SKILL.md length
159 words
Files
2
Skills in repo
5
Repo updated
First seen
Licence
AGPL-3.0

At a glance

L1-L4 語法和結構驗證 - 檢查 Python 語法、AST 結構、縮進格式、命名規範. An agent skill from peijun1700/bluemouse.

  • Works in 2 steps: AI-Guided Validation → Script Execution
  • SKILL.md covers Two Ways to Use, L1: 基本語法檢查, L2: AST 結構檢查 and L3: 縮進和格式檢查, plus 3 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Validate Syntax is an agent skill from peijun1700/bluemouse. L1-L4 語法和結構驗證 - 檢查 Python 語法、AST 結構、縮進格式、命名規範。 BlueMouse 17-Layer Validation Group 1。 Triggers: "syntax", "格式檢查", "naming", "PEP8"

Its SKILL.md is about 860 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `validator.py`).

It works with Python. The licence is AGPL-3.0.

Example prompts

  • “syntax”
  • “naming”
  • “/validate-syntax”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Bash

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. AI-Guided Validation
  2. Script Execution

What it can do on your machine

Read from SKILL.md and the folder at commit 4f32ef0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Validate Syntax loads about 856 tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 159 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~856

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from peijun1700/bluemouse at commit 4f32ef0, republished under its AGPL-3.0 licence (© peijun1700). 159 words, ~856 tokens.

Download SKILL.mdSave it as .claude/skills/validate-syntax/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
validate-syntax
description
L1-L4 語法和結構驗證 - 檢查 Python 語法、AST 結構、縮進格式、命名規範。 BlueMouse 17-Layer Validation Group 1。 Triggers: "syntax", "格式檢查", "naming", "PEP8"
allowed-tools
Read, Bash
user-invocable
true
context
fork

Validate Syntax Skill (L1-L4)

BlueMouse 17-Layer Validation System - Group 1: 語法和結構驗證

Two Ways to Use

1. AI-Guided Validation

Follow the checklist below to analyze code.

2. Script Execution
bash
python3 .claude/skills/validate-syntax/validator.py myfile.py
python3 .claude/skills/validate-syntax/validator.py --json myfile.py

L1-L4 Validation Checklist

L1: 基本語法檢查

What: Code compiles without syntax errors

How:

python
compile(code, '<string>', 'exec')

Pass: No SyntaxError raised Fail: Report error: "語法錯誤: {error_message}"


L2: AST 結構檢查

What: Code contains at least one function or class definition

How:

python
tree = ast.parse(code)
has_definition = any(
    isinstance(node, (ast.FunctionDef, ast.ClassDef))
    for node in ast.walk(tree)
)

Pass: has_definition == True Fail: "缺少函數或類定義"


L3: 縮進和格式檢查

What: Proper indentation format

Rules:

  1. No tab characters (\t) anywhere
  2. Leading spaces must be multiples of 4

How:

python
for i, line in enumerate(lines, 1):
    if '\t' in line:
        issues.append(f"Line {i}: 使用 Tab 而非空格")
    leading_spaces = len(line) - len(line.lstrip())
    if leading_spaces % 4 != 0:
        issues.append(f"Line {i}: 縮進不是 4 的倍數")

Pass: No issues found Fail: "發現 N 個格式問題" + list first 3 issues

Examples:

python
# ✅ PASS: 4-space indentation
def foo():
    if True:
        return 1

# ❌ FAIL: Tab character
def foo():
	return 1  # Uses tab

# ❌ FAIL: 2-space indentation
def foo():
  return 1  # 2 spaces, not multiple of 4

L4: 命名規範檢查

What: PEP 8 naming conventions

Rules:

TypeConventionRegex
Functionssnake_case^[a-z_][a-z0-9_]*$
ClassesPascalCase^[A-Z][a-zA-Z0-9]*$

How:

python
for node in ast.walk(tree):
    if isinstance(node, ast.FunctionDef):
        if not re.match(r'^[a-z_][a-z0-9_]*$', node.name):
            issues.append(f"函數名 '{node.name}' 不符合 snake_case")
    if isinstance(node, ast.ClassDef):
        if not re.match(r'^[A-Z][a-zA-Z0-9]*$', node.name):
            issues.append(f"類名 '{node.name}' 不符合 PascalCase")

Pass: All names follow conventions → "命名符合 PEP 8" Fail: "發現 N 個命名問題" + list issues

Examples:

python
# ✅ PASS
def calculate_total():  # snake_case
    pass

class UserManager:  # PascalCase
    pass

# ❌ FAIL
def CalculateTotal():  # Should be snake_case
    pass

class user_manager:  # Should be PascalCase
    pass

Output Format

==================================================
L1-L4: 語法和結構驗證
==================================================

Status: ✅ PASSED / ❌ FAILED
Score: X/100 (N/4 layers)

✅/❌ L1: 基本語法檢查 - [message]
✅/❌ L2: AST 結構檢查 - [message]
✅/❌ L3: 縮進和格式檢查 - [message]
✅/❌ L4: 命名規範檢查 - [message]

SkillLayers
/validate-17-layersL1-L17 (完整)
/validate-syntaxL1-L4
/validate-signatureL5-L8
/validate-dependenciesL9-L12
/validate-logicL13-L17

Part of BlueMouse 17-Layer Validation System

© peijun1700, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/validate-syntax of peijun1700/bluemouse.

  • SKILL.md
  • validator.py

Open the folder on GitHubat commit 4f32ef0

Compare with similar skills

Validate Syntax next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Validate Syntax compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Validate Syntax this skillpeijun1700/bluemouse109—~856Automated safety check: NotesAGPL-3.0
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
PDF Processinganthropics/skills180k48 repos~2kAutomated safety check: PassProprietary
NotebookLM Research AssistantPleasePrompto/notebooklm-skill7.8k14 repos~2.4kAutomated safety check: NotesMIT
Manim Video Productionbrowser-use/video-use28k6 repos~3kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • PDF Processing

    anthropics/skills

    Official

    Handles everyday PDF jobs in Python and on the command line: extract text and tables, merge, split, rotate, watermark, fill forms, encrypt and OCR.

    180k GitHub starsUsed in 48 repos~2k tokens
    Documents & OfficeAuto-check passed
  • NotebookLM Research Assistant

    PleasePrompto/notebooklm-skill

    Lets Claude Code ask questions of your Google NotebookLM notebooks through browser automation and return answers grounded in your uploaded sources.

    7.8k GitHub starsUsed in 14 repos~2.4k tokens
    Knowledge ManagementAuto-check: notes
  • Manim Video Production

    browser-use/video-use

    Produces math and technical explainer videos with Manim Community Edition: concept animations, equation derivations, algorithm walkthroughs and data stories.

    28k GitHub starsUsed in 6 repos~3k tokens
    Media & CreativeAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • PPT Master

    hugohe3/ppt-master

    Generates editable PowerPoint decks, rebuilds slides from images, fills .pptx templates and polishes existing presentations through routed workflows.

    58k GitHub starsUsed in 1 repo~2.5k tokens
    Documents & OfficeAuto-check passed

More from peijun1700/bluemouse

  • Validate Dependencies

    peijun1700/bluemouse

    L9-L12 依賴關係驗證 - 檢查導入語句、標準庫、第三方庫、循環依賴. An agent skill from peijun1700/bluemouse.

    109 GitHub stars~1k tokensUpdated 8 mo ago
    Auto-check: notes
  • Validate Logic

    peijun1700/bluemouse

    L13-L17 類型和邏輯驗證 - 檢查類型一致性、邏輯完整性、錯誤處理、安全性、性能. An agent skill from peijun1700/bluemouse.

    109 GitHub stars~1.5k tokensUpdated 8 mo ago
    Auto-check: notes
  • Validate Signature

    peijun1700/bluemouse

    L5-L8 函數簽名驗證 - 檢查參數、返回值、類型提示、文檔字符串. An agent skill from peijun1700/bluemouse.

    109 GitHub stars~923 tokensUpdated 8 mo ago
    Auto-check: notes
  • Validate 17 Layers

    peijun1700/bluemouse

    The BlueMouse 17-Layer Alpha Scale (Static Standard). An agent skill from peijun1700/bluemouse.

    109 GitHub stars~546 tokensUpdated 8 mo ago
    Auto-check: notes

Works with

Questions about Validate Syntax

What does Validate Syntax do?

L1-L4 語法和結構驗證 - 檢查 Python 語法、AST 結構、縮進格式、命名規範. An agent skill from peijun1700/bluemouse. Validate Syntax is an agent skill from peijun1700/bluemouse.

How do I install Validate Syntax in Claude Code?

Run `npx skills add peijun1700/bluemouse --skill validate-syntax -a claude-code`. Or copy the skill folder (.claude/skills/validate-syntax in peijun1700/bluemouse) into .claude/skills/validate-syntax in your project. Claude Code loads it when a task matches its description.

How do I install Validate Syntax in Codex?

Run `npx skills add peijun1700/bluemouse --skill validate-syntax -a codex`. Or copy the skill folder (.claude/skills/validate-syntax in peijun1700/bluemouse) into .agents/skills/validate-syntax in your project. Codex loads it when a task matches its description.

Can I use Validate Syntax in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add peijun1700/bluemouse --skill validate-syntax -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/validate-syntax, .gemini/skills/validate-syntax, .github/skills/validate-syntax and .opencode/skills/validate-syntax in your project.

What does Validate Syntax need to run?

Going by SKILL.md and its folder, Validate Syntax needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Bash.

Does Validate Syntax access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Validate Syntax safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Validate Syntax use?

Validate Syntax is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Validate Syntax use?

About 856 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Validate Syntax?

Skills that share tags, products or a category with Validate Syntax: MCP Server Builder (anthropics/skills, 180k stars), PDF Processing (anthropics/skills, 180k stars), NotebookLM Research Assistant (PleasePrompto/notebooklm-skill, 7.8k stars) and Manim Video Production (browser-use/video-use, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Validate Syntax?

peijun1700 (a GitHub user) maintains it in peijun1700/bluemouse, which has 109 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on January 29, 2026.

Source: peijun1700/bluemouse on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.