用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/carrot-foundation/methodology-rules --skill rule-code-style命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | rule-code-style |
| description | Rule mapping for code-style |
Apply this rule whenever work touches:
*.ts*.tsxCode in this repository should be immediately readable by any team member without requiring extra context or tribal knowledge.
Choose names that convey meaning at the point of use:
// Clear
const documentExpirationDate = computeExpirationDate(document);
// Unclear
const d = calc(doc);
Functions should read as actions: validateVehiclePlate, fetchCreditOrder, buildRuleOutput. Variables should read as things: ruleResult, parsedDocument, vehicleWeight.
Flatten control flow by returning early for edge cases:
function evaluateResult(subject: RuleSubject): RuleOutput {
if (!subject.document) {
return { status: 'REJECTED', reason: 'Missing document' };
}
if (!subject.document.isValid) {
return { status: 'REJECTED', reason: 'Invalid document' };
}
// Main logic at top indentation level
return computeApproval(subject.document);
}
Each file and function should do one thing well. If a function needs a comment to separate "sections," it is likely doing too much. Extract helper functions with descriptive names.
The project uses ESLint and Prettier via Nx. After changing code, verify it passes:
pnpm nx lint <project-name>
Every file must end with a single trailing newline (no trailing blank lines, no missing final newline).
Use path aliases for anything outside the current library:
import { BoldHelpers } from '@carrot-fndn/shared/methodologies/bold/helpers';
Within the same library, use relative paths. Avoid deep relative paths that cross Nx project boundaries.