code-rules
OfficialEnforce safe, consistent code generation.
Software Engineering#javascript#safety#error-handling#coding-standards#code-generation#return-values
Authorclaude-office-skills
Version1.0.0
Installs0
System Documentation
What problem does it solve?
代码生成规范与安全约束通过强制执行一组明确的规则来避免不一致的代码输出、降低错误风险,并确保在自动化场景中生成的代码可维护和可预测。
Core Features & Use Cases
- 仅使用 var 声明变量,避免引入隐性块级作用域的复杂性。
- 禁止箭头函数、let、const、class、模板字符串等现代特性,确保兼容性与可预测性。
- 代码总长度不超过 3000 字符,避免生成过长的片段影响可读性。
- 返回值必须在最后一行返回字符串,确保调用方可直接获取结果。
- 安全规范:所有文档操作使用 try/catch,操作前检查对象存在性,避免对空对象或未初始化对象进行修改。
- 错误处理:提供清晰的错误信息,确保在异常时返回可观测的字符串结果。
- 返回值规范:提供具体、描述性的返回文本,而非简单的 'done'。
Quick Start
用 Claude 产出符合本规范的代码片段。
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: code-rules Download link: https://github.com/claude-office-skills/claude-wps-word-plugin/archive/main.zip#code-rules Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.