AutoSnippet Guard — Code Compliance Checking
Use this skill when: The user wants to check whether code meets project standards (规范 / Audit / Guard / Lint).
MCP Tool: autosnippet_guard
Single code check (code param):
{ "code": "URLSession.shared.dataTask(with: url) { ... }", "language": "objc", "filePath": "Sources/Network/OldAPI.m" }
Multi-file audit (files[] param):
{ "files": [{ "path": "Sources/Network/APIClient.m" }, { "path": "Sources/Network/RequestManager.m" }], "scope": "project" }
Returns violations with { ruleId, severity, message, line, pattern }. Batch results auto-recorded to ViolationsStore.
Guard Knowledge Source
Guard uses Recipe content as the standard — no separate config:
- kind=rule → enforced as Guard rules (severity: error/warning/info)
- kind=pattern → best-practice references
constraints.guards[].pattern→ regex patterns for automated detection
Agent Workflow
Quick Check ("检查这段代码")
autosnippet_guardwith code → present violations + fix suggestions
Module Audit ("审查网络模块")
autosnippet_structure(operation=files)→ get file listautosnippet_guardwith file paths → summarize by severity
Project-wide
autosnippet_bootstrap→ full project scan including Guard audit
Related Skills
- autosnippet-recipes: Recipe content IS the Guard standard
Converted and distributed by TomeVault — claim your Tome and manage your conversions.