编程 Standards
- 作者仓库星标 0
- 作者仓库 skills-registry
name: coding-standards description: Use when writing or reviewing code in any language. Covers typed-language rules (TypeScript, Python, Go), naming conventions, file organisation, error handling, import ordering, and universal quality rules. Read project conventions first to identify the stack, then apply only the relevant language sections.
Coding Standards
Before reviewing, read
copilot-instructions.md/AGENTS.md/CLAUDE.mdto identify the project's language, framework, and version. Adapt stack-specific rules accordingly.
Typed Language Rules (apply only when project uses the language)
TypeScript
- Strict mode required — never disable
strict: true - No
anywithout comment explaining why unavoidable - No
@ts-ignorewithout comment - Use
unknown+ narrowing instead ofanywhen type genuinely unknown interfacefor object shapes;typefor unions, intersections, utilities- All exported functions: explicit return type annotations
Python
- Type hints required on all function signatures (
def fn(x: int) -> str:) - No
# type: ignorewithout explanatory comment - Use
T | None(Python 3.10+) orOptional[T]— no implicitNonereturns - Use
dataclassesorpydanticfor structured data shapes
Go
- All errors must be checked — never discard with
_unless intentional + commented - Exported identifiers must have doc comments
- No
interface{}/anywithout justification - Prefer table-driven tests; use
errors.Is/errors.Asfor error checking
Naming Conventions
| Thing | Convention | Example |
|---|---|---|
| UI components / classes | PascalCase | UserCard, NoteEditor |
| Utility / helper files | kebab-case | sync-messages.ts, format-date.py |
| Variables and functions | camelCase | activeUser, loadData() |
| Module-level constants | UPPER_SNAKE_CASE | MAX_RETRIES |
| Type / interface names | PascalCase | UserSchema, ApiResponse |
| Route / endpoint files | Follow framework convention | +page.server.ts, router.py |
File Organisation
- Group by feature/domain, not by type
- One exported component per file
- Target under 400 lines per file; split larger files by concern
- Before creating a new file, check if logic fits in an existing module
Error Handling
- Never empty
catchblocks — re-throw, log, or return structured error - Server errors: log with context server-side; return safe message to client (no stack traces, no internal paths)
- API routes: return appropriate HTTP status codes with structured error body
- Validate all user input at system boundaries before use
Security (non-negotiable)
- No hardcoded secrets, credentials, or API keys — use environment variables
- Parameterized queries only — never interpolate user input into SQL/queries
- Sanitize user-controlled HTML before rendering (DOMPurify or equivalent)
- Never return stack traces or internal paths to the client
Import Ordering
Groups separated by a blank line:
- External packages / standard library
- Framework internals
- Internal path aliases
- Relative imports
Code Quality
- Functions under 50 lines, single responsibility
- No dead code, unused imports, or commented-out blocks in commits
- No logic repeated at 3+ call sites without extraction into a named helper
- Comment the why, not the what
What Never to Do
- No syntax from the wrong framework version — check project conventions
- No untyped code where the language supports type annotations
- No hardcoded environment-specific values
- No deprecated APIs without a migration comment
<!-- tomevault:4.0:skill_md:2026-05-22 -->Source: AshenDulsanka/agent-arche — distributed by TomeVault.
- 流狐分类
- AI 智能
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- Python >=3.10
- 检测到的文件与系统行为
-
- 只读
- 读取环境变量
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 TypeScript Strict mode required — never disable strict: true No any without comment explaining why unavoidable
Thing · Convention · Example UI components / classes · PascalCase · UserCard, NoteEditor Utility / helper files · kebab-case · sync-messages.ts, format-date.py
Group by feature/domain, not by type One exported component per file Target under 400 lines per file; split larger files by concern
Never empty catch blocks — re-throw, log, or return structured error Server errors: log with context server-side; return safe message to client (no stack traces, no internal paths) API routes: return appropriate HTTP status codes with structured error body
No hardcoded secrets, credentials, or API keys — use environment variables Parameterized queries only — never interpolate user input into SQL/queries Sanitize user-controlled HTML before rendering (DOMPurify or equivalent)
Groups separated by a blank line: External packages / standard library Framework internals
---
name: coding-standards
description: Use when writing or reviewing code in any language. Covers typed-language rules (TypeScript, Python, Go), naming conventions, file organisation, error handling, import ordering, and universal quality rules. Read project conventions first to identify the stack, then apply only the relevant language sections.
---
# Coding Standards
> Before reviewing, read `copilot-instructions.md` / `AGENTS.md` / `CLAUDE.md` to identify the project's language, framework, and version. Adapt stack-specific rules accordingly.
## Typed Language Rules (apply only when project uses the language)
**TypeScript**
- Strict mode required — never disable `strict: true`
- No `any` without comment explaining why unavoidable
- No `@ts-ignore` without comment
- Use `unknown` + narrowing instead of `any` when type genuinely unknown
- `interface` for object shapes; `type` for unions, intersections, utilities
- All exported functions: explicit return type annotations
**Python**
- Type hints required on all function signatures (`def fn(x: int) -> str:`)
- No `# type: ignore` without explanatory comment
- Use `T | None` (Python 3.10+) or `Optional[T]` — no implicit `None` returns
- Use `dataclasses` or `pydantic` for structured data shapes
**Go**
- All errors must be checked — never discard with `_` unless intentional + commented
- Exported identifiers must have doc comments
- No `interface{}` / `any` without justification
- Prefer table-driven tests; use `errors.Is`/`errors.As` for error checking
## Naming Conventions
| Thing | Convention | Example |
|-------|-----------|---------|
| UI components / classes | PascalCase | `UserCard`, `NoteEditor` |
| Utility / helper files | kebab-case | `sync-messages.ts`, `format-date.py` |
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Typed Language Rules (apply only when project uses the language) → Naming Conventions → File Organisation → Error Handling → Security (non-negotiable) → Import Ordering
要点 -> TypeScript · Python · Go · --- name: coding-standards description: Use when writing or reviewing code in any language. · > Before reviewing, read copilot-instructions.md / AGENTS.md / CLAUDE.md to identify the project's language, framework, and version. · Groups separated by a blank line: 1. · --- > Source: [AshenDulsanka/agent-arche](https://github.com/AshenDulsanka/agent-arche) — distributed by [TomeVault](https://tomevault.io).
文件/命令 -> copilot-instructions.md · AGENTS.md · CLAUDE.md · strict: true · any · @ts-ignore · unknown · interface
内容 SHA-256 -> 56b188a90b31
原文结构
适用与边界
原文中的明确线索
copilot-instructions.md、AGENTS.md、CLAUDE.md、strict: true、any、@ts-ignore、unknown、interface