一键导入
code-pattern-fmt-check
Validate pattern doc format against the specification. Use when reviewing PRs, after editing pattern docs, or before commits
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate pattern doc format against the specification. Use when reviewing PRs, after editing pattern docs, or before commits
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Validate and lint code after changes. Use after editing Rust/shell script files, when user mentions compilation errors, linting, clippy warnings, shellcheck issues, or before commits/PRs. Ensures all code passes checks and has zero warnings.
Format Rust and shell script code automatically. Use immediately after editing .rs/.sh files or the install script, when user mentions formatting, code style, or before commits/PRs. Ensures consistent code style following project conventions.
Load relevant coding patterns based on user query or work context. Use when asking about coding patterns, standards, or before implementing code.
Review code changes for bugs, pattern violations, security, and quality. Use when reviewing PRs, code changes, or before commits.
Run targeted tests to validate changes. Use filters to target specific tests when needed.
Generate and validate conventional commit messages with Rust workspace scope rules. Use when user says "commit", "git commit", "/commit", asks for help with commit messages, or requests to amend a commit. Enforces crate-based scoping and validates message accuracy against changesets.
| name | code-pattern-fmt-check |
| description | Validate pattern doc format against the specification. Use when reviewing PRs, after editing pattern docs, or before commits |
This skill validates that code pattern documentation format follows the established patterns in docs/__meta__/code-pattern-docs.md.
Use this skill when:
docs/code/For recent commits:
git diff --name-only HEAD~1 | grep 'docs/code/.*\.md$'
For staged changes:
git diff --cached --name-only | grep 'docs/code/.*\.md$'
For unstaged changes:
git diff --name-only | grep 'docs/code/.*\.md$'
For each changed pattern doc, verify:
All format requirements are defined in docs/meta/code-pattern-docs.md. Read that file for:
name, description, type, scope)core, arch, crate, meta)global, crate:<name>)docs/code/ root)Use the Checklist section in docs/__meta__/code-pattern-docs.md to validate pattern docs.
Verify frontmatter is extractable:
Primary Method: Use the Grep tool with multiline mode:
^---\n[\s\S]*?\n---docs/code/<pattern-name>.mdtruecontentFallback: Bash command:
grep -Pzo '(?s)^---\n.*?\n---' docs/code/<pattern-name>.md
Cross-platform alternative (macOS compatible):
awk '/^---$/{p=!p; print; next} p' docs/code/<pattern-name>.md
git diff --name-only HEAD~1 | grep 'docs/code/.*\.md$'After validation, provide a structured report listing issues found. Use the checklist from docs/meta/code-pattern-docs.md as the validation criteria.
## Pattern Doc Format Review: <filename>
### Issues Found
1. <issue description with line number>
2. <issue description with line number>
### Verdict: PASS/FAIL
<If FAIL, provide specific fixes needed referencing docs/__meta__/code-pattern-docs.md>
When validation fails, refer to docs/meta/code-pattern-docs.md for detailed requirements. Common issues include:
name not in kebab-case or doesn't match filename (minus .md)description missing "Load when" trigger clausetype not one of: core, arch, crate, metascope invalid format (not global or crate:<name>)<crate>-<type>.md namingdocs/code/ root)name field present and matches filename (minus .md)description field present with "Load when" triggertype field present and valid (core, arch, crate, meta)scope field present and valid (global or crate:<name>).md extension<crate>-<type> formatcore, arch, crate, or metaglobal or crate:<name>core, arch, meta patterns use globalcrate:<name> formatdocs/code/ root (no subdirectories)<crate>-<type>.mdThese tools/commands can run without user permission:
docs/code/git diff and git status read-only commandsAfter format review: