code-standards
Review code against CONVENTIONS -- type safety (`any` detection), naming, imports, Next.js patterns, 12-factor. NOT for complexity metrics (use code-quality) or API field alignment (use api-contract).
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 8
- Forks
- 5
01 前言 Front Matter
- docs
- { "status": "reviewed", "updated": 1785974400000, "source_sha": "07f13623e2e2" }
- name
- code-standards
- owner
- swarmery-core
- version
- 1.0.0
- description
- Review code against CONVENTIONS -- type safety (`any` detection), naming, imports, Next.js patterns, 12-factor. NOT for complexity metrics (use code-quality) or API field alignment (use api-contract).
- allowed-tools
- Read, Grep, Glob, Bash
02 资源文件 3
- 参考文档resources/checklists.md4.1 KB
- 参考文档resources/review-procedure.md6.3 KB
- 参考文档resources/sandbox-preflight.md2.4 KB
03 SKILL.md 正文
Purpose
Review code against the project's per-repository conventions and return a
violation report with file:line citations, severities, and before/after fixes.
Covers type safety (any detection, annotations), naming, Next.js 15 patterns,
Python typing and async style, service-config hygiene, and 12-factor
build-once/deploy-anywhere rules.
"Is this function too long or too complex?" → code-quality. "Does this use
any, follow naming, or comply with framework patterns?" → here.
Rules (never violate)
- Review only — never fix in place; fixes go to
@implementation-agent. - Every violation cites
file:lineand carries a severity; Critical and High findings include before/after code. NEXT_PUBLIC_*is allowed in source, prohibited as a Docker--build-arg.- Module-scope
process.env.Xis a violation; lazy access inside a function is not. - Never emit length, nesting, or complexity findings —
code-qualityowns those. - Close the report with the
STANDARDS-VIOLATIONS:trailer; cap it at 300 lines.
Resources
- Read
resources/review-procedure.mdbefore reviewing: the 8-step procedure, severity criteria, output template, self-check, escalation triggers, failure modes, and a worked example. - Read
resources/checklists.mdfor the rule set matchingrepo_type— web app, device/edge, service config, and the 12-factor build rules. - Read
resources/sandbox-preflight.mdwhen the run edits files from a git worktree isolate: one operation per Bash call, and the checks to make before the first read or write.
How to use
What it does
Checks code against your conventions and hands back an actionable report: type
safety including any types, naming, framework patterns, Python type hints and
async style, service-config hygiene, and 12-factor build rules — each finding
with a citation, a severity, and corrected code for the serious ones.
When to use it
- TypeScript/Next.js code changed and wants a standards pass before merge.
- Python device or edge code needs type hints and async patterns verified.
- A service config changed and needs lint, version bump, and template guards checked.
- A Dockerfile or CI pipeline changed and needs 12-factor compliance verified.
Not for: length, nesting, or complexity (code-quality); schema ↔ handler field
alignment (api-contract); locating files (code-search); or applying fixes —
this skill reviews and refuses in-place edits.
How to invoke
Skill(skill: "core:code-standards")
scope: apps/<mainApp>/src/app/api/orders/route.ts
repo_type: web-app
scope and repo_type (web-app | device | service-config |
infrastructure) are both required; the matching checklist is selected for you.
Worked example
The route above calls auth() without export const dynamic = 'force-dynamic'
and annotates a query result : any. You get two rows — one Critical, one High —
each with the line, the offending snippet, the corrected snippet, and:
STANDARDS-VIOLATIONS: 2 | CRITICAL: 1 | HIGH: 1 | MEDIUM: 0 | LOW: 0
Both fixes are single-line edits you apply yourself. A file with more than 20 Critical findings stops the review and asks instead.
Related
code-quality— length and complexity; composes with this skill as a depth-1 fan-out under@code-reviewerover the same scope.api-contract— field-level alignment across the data layer.code-search— run first when the files to review are still unknown.
04 同仓库更多 Skills
short-desc
Too short.
no-frontmatter
暂无简介
global-skill
Fixture global skill (minimal user-scope shape, format doc §2.3).
documented-skill
Fixture skill whose usage guide deliberately omits the Worked example subsection.
z
NOT auto-discovered — only skills/ is scanned for plugins (§2.2).
y
Plugin skill y from toolpack — stored as "toolpack:y".