关于 isentinel
isentinel 为 roblox-ts 项目提供一套工具选择和开发规范,面向 TypeScript 开发者,涵盖包管理、严格类型检查、Lint 和 Jest-roblox 测试。
主要功能
- 01使用 pnpm 管理包
- 02严格的 roblox TypeScript 配置
- 03基于 ESLint 的检查与格式化
- 04Jest-roblox 测试驱动开发
- 05Conventional Commits 与 Git 钩子
适用场景
- 01统一 roblox-ts 项目配置
- 02启用更严格的 TypeScript 检查
- 03规范 Lint 和格式化流程
- 04组织 Jest-roblox 测试
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ christopher-buss/ skills --skill isentinel安装后在 Claude Code 中输入/isentinel确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/error-handling.mdlinting.mdtesting.mdtooling.mdtypescript.md详细介绍
isentinel 偏好设置
面向 roblox-ts 开发的约定式工具与模式。
快速概览
| 类别 | 偏好 |
|---|---|
| 包管理器 | pnpm(bun 可作为可选运行时) |
| 语言 | TypeScript(严格模式 + 额外检查) |
| TypeScript 配置 | @isentinel/tsconfig |
| 代码检查 | @isentinel/eslint-config(不使用 Prettier) |
| 测试 | Jest-roblox,采用 TDD 方法 |
| Git 钩子 | husky + lint-staged |
| 提交 | Conventional Commits |
包管理器(pnpm)
使用 pnpm 作为包管理器。可使用 bun 作为脚本运行时。
@antfu/ni
使用 @antfu/ni 统一包管理器命令(它会根据锁文件自动检测包管理器(pnpm/npm/yarn/bun)):
| 命令 | 描述 |
|---|---|
ni | 安装依赖 |
ni <pkg> | 添加依赖 |
ni -D <pkg> | 添加开发依赖 |
nr <script> | 运行脚本 |
nu | 升级依赖 |
nun <pkg> | 卸载依赖 |
nci | 全新安装 |
nlx <pkg> | 执行包 |
TypeScript
使用带有 roblox 预设的 @isentinel/tsconfig。启用严格模式和额外检查:
exactOptionalPropertyTypesnoUncheckedIndexedAccessnoPropertyAccessFromIndexSignaturenoImplicitOverridenoImplicitReturnsnoFallthroughCasesInSwitch
{
"extends": "@isentinel/tsconfig/roblox"
}
代码检查
使用 @isentinel/eslint-config。不使用 Prettier——由 ESLint 负责格式化。
// eslint.config.ts
import { isentinel } from "@isentinel/eslint-config";
export default isentinel();
使用 nr lint --fix 修复错误。
错误处理
优先使用断言,而不是静默失败。尽早失败,并明确报错。
模式请参阅 error-handling.md。
测试驱动开发
红 → 绿 → 重构:
- 编写一个失败的测试
- 编写通过测试所需的最少代码
- 在测试保护下进行重构
简洁规则(按优先级排列)
- 通过所有测试
- 清晰表达意图
- 不包含重复内容
- 元素尽可能少
三行相似的代码胜过过早抽象。
Jest-roblox 的设置请参阅 testing.md。
参考
| 主题 | 参考 |
|---|---|
| 工具详情 | tooling.md |
| TypeScript 配置 | typescript.md |
| 代码检查规则 | linting.md |
| 测试(TDD) | testing.md |
| 错误处理 | error-handling.md |
评论
支持 Markdown