@namewta/speculo 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +3 -2
  2. package/package.json +1 -1
  3. package/template/skills/typescript-engineering-standards/README.md +36 -0
  4. package/template/skills/typescript-engineering-standards/SKILL.md +158 -0
  5. package/template/skills/typescript-engineering-standards/examples/comment-patterns.md +47 -0
  6. package/template/skills/typescript-engineering-standards/examples/naming-patterns.md +42 -0
  7. package/template/skills/typescript-engineering-standards/examples/project-layouts.md +75 -0
  8. package/template/skills/typescript-engineering-standards/examples/review-output-example.md +25 -0
  9. package/template/skills/typescript-engineering-standards/examples/type-modeling-patterns.md +66 -0
  10. package/template/skills/typescript-engineering-standards/manifest.txt +33 -0
  11. package/template/skills/typescript-engineering-standards/references/00-standard-levels-and-precedence.md +51 -0
  12. package/template/skills/typescript-engineering-standards/references/01-project-architecture-and-directory-layout.md +105 -0
  13. package/template/skills/typescript-engineering-standards/references/02-file-directory-and-symbol-naming.md +117 -0
  14. package/template/skills/typescript-engineering-standards/references/03-modules-imports-exports-and-dependencies.md +111 -0
  15. package/template/skills/typescript-engineering-standards/references/04-typescript-type-system.md +150 -0
  16. package/template/skills/typescript-engineering-standards/references/05-functions-async-errors-and-resources.md +142 -0
  17. package/template/skills/typescript-engineering-standards/references/06-comments-jsdoc-and-documentation.md +104 -0
  18. package/template/skills/typescript-engineering-standards/references/07-testing-strategy.md +84 -0
  19. package/template/skills/typescript-engineering-standards/references/08-react-and-frontend.md +91 -0
  20. package/template/skills/typescript-engineering-standards/references/09-node-cli-and-cross-platform.md +92 -0
  21. package/template/skills/typescript-engineering-standards/references/10-formatting-lint-and-complexity.md +107 -0
  22. package/template/skills/typescript-engineering-standards/references/11-configuration-dependencies-and-ci.md +86 -0
  23. package/template/skills/typescript-engineering-standards/references/12-security-performance-and-i18n.md +65 -0
  24. package/template/skills/typescript-engineering-standards/references/13-git-review-and-delivery.md +79 -0
  25. package/template/skills/typescript-engineering-standards/references/14-adoption-exceptions-and-migration.md +84 -0
  26. package/template/skills/typescript-engineering-standards/references/15-orca-derived-observations.md +54 -0
  27. package/template/skills/typescript-engineering-standards/references/README.md +45 -0
  28. package/template/skills/typescript-engineering-standards/templates/.editorconfig +12 -0
  29. package/template/skills/typescript-engineering-standards/templates/AGENTS.typescript.md +21 -0
  30. package/template/skills/typescript-engineering-standards/templates/code-review-checklist.md +37 -0
  31. package/template/skills/typescript-engineering-standards/templates/package-scripts.json +11 -0
  32. package/template/skills/typescript-engineering-standards/templates/prettier.json +6 -0
  33. package/template/skills/typescript-engineering-standards/templates/pull-request-template.md +37 -0
  34. package/template/skills/typescript-engineering-standards/templates/tsconfig.base.json +17 -0
  35. package/template/skills/typescript-engineering-standards/templates/tsconfig.project-references.json +8 -0
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ indent_style = space
8
+ indent_size = 2
9
+ trim_trailing_whitespace = true
10
+
11
+ [*.md]
12
+ trim_trailing_whitespace = false
@@ -0,0 +1,21 @@
1
+ # TypeScript Project Rules
2
+
3
+ - 先按运行环境和业务领域组织代码,领域内部优先局部平铺。
4
+ - 目录与普通 TypeScript 文件使用 `kebab-case`;组件文件沿用项目统一规则。
5
+ - 文件名必须表达具体领域和职责,避免 `utils`、`helpers`、`common`、`misc`。
6
+ - 一个文件只有一个主要职责;不要为单个普通文件创建目录。
7
+ - 默认使用命名导出;仅在框架约定入口使用默认导出。
8
+ - 禁止无意义全局 Barrel 和循环依赖。
9
+ - TypeScript 必须开启严格模式;禁止无说明的 `any`、双重断言和 `@ts-ignore`。
10
+ - 外部输入先作为 `unknown`,在系统边界运行时验证。
11
+ - 优先使用可辨识联合表达互斥状态,并进行穷尽检查。
12
+ - 导出函数和公共 API 写明确返回类型。
13
+ - 所有 Promise 必须 `await`、`return` 或显式处理。
14
+ - 监听器、Timer、连接、Worker 和进程必须有清理路径。
15
+ - 注释解释 WHY、约束和权衡,不逐行翻译代码。
16
+ - 单元测试与源码共置;集成和 E2E 测试放在根级 `tests/`。
17
+ - 修复缺陷时添加回归测试。
18
+ - 不引入未经要求的新框架或依赖。
19
+ - 不通过关闭核心规则、删除测试或扩大 `any` 来绕过检查。
20
+ - 合并前运行格式检查、Lint、类型检查、测试和构建。
21
+ - 修改现有项目时优先遵守仓库已生效配置,避免无关重命名和格式噪声。
@@ -0,0 +1,37 @@
1
+ # TypeScript Code Review Checklist
2
+
3
+ ## 正确性与安全
4
+
5
+ - [ ] 外部输入已验证。
6
+ - [ ] 权限、安全和敏感信息处理正确。
7
+ - [ ] 错误路径不会造成数据损坏或状态不一致。
8
+
9
+ ## 类型与 API
10
+
11
+ - [ ] 没有无说明的 `any`、双重断言或 `@ts-ignore`。
12
+ - [ ] 公共 API 输入、输出和错误契约明确。
13
+ - [ ] 互斥状态使用可靠模型,分支穷尽。
14
+ - [ ] 空值和可选语义清晰。
15
+
16
+ ## 异步与资源
17
+
18
+ - [ ] Promise 已等待、返回或显式处理。
19
+ - [ ] 超时、取消和重试策略合理。
20
+ - [ ] 监听器、Timer、连接和进程已清理。
21
+ - [ ] 无明显竞态或过期响应覆盖问题。
22
+
23
+ ## 架构与维护
24
+
25
+ - [ ] 文件位于正确领域和运行环境。
26
+ - [ ] 文件名具体,职责单一。
27
+ - [ ] 依赖方向正确,无循环依赖。
28
+ - [ ] 没有无意义共享抽象和 Barrel。
29
+ - [ ] 文件、函数和状态复杂度合理。
30
+
31
+ ## 测试与交付
32
+
33
+ - [ ] 新行为有适当测试。
34
+ - [ ] 缺陷修复有回归测试。
35
+ - [ ] 测试确定、可诊断且不过度 Mock。
36
+ - [ ] 格式、Lint、类型检查、测试和构建通过。
37
+ - [ ] 无无关格式化、重命名或生成文件变化。
@@ -0,0 +1,11 @@
1
+ {
2
+ "scripts": {
3
+ "format": "prettier --write .",
4
+ "format:check": "prettier --check .",
5
+ "lint": "eslint .",
6
+ "typecheck": "tsc --noEmit",
7
+ "test": "vitest run",
8
+ "build": "tsc -b",
9
+ "check": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test && pnpm build"
10
+ }
11
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": true,
3
+ "semi": false,
4
+ "printWidth": 100,
5
+ "trailingComma": "none"
6
+ }
@@ -0,0 +1,37 @@
1
+ ## 背景
2
+
3
+ <!-- 这个变更解决什么问题? -->
4
+
5
+ ## 方案
6
+
7
+ <!-- 核心实现、边界和主要取舍。 -->
8
+
9
+ ## 影响范围
10
+
11
+ - [ ] 公共 API
12
+ - [ ] 数据或配置迁移
13
+ - [ ] 跨平台行为
14
+ - [ ] 安全或权限
15
+ - [ ] 性能
16
+ - [ ] UI / 可访问性
17
+
18
+ ## 验证
19
+
20
+ - [ ] 格式检查
21
+ - [ ] Lint
22
+ - [ ] TypeScript 类型检查
23
+ - [ ] 单元测试
24
+ - [ ] 集成 / E2E 测试
25
+ - [ ] 构建
26
+
27
+ ## 证据
28
+
29
+ <!-- 截图、录屏、日志、基准或测试结果。 -->
30
+
31
+ ## 风险与回滚
32
+
33
+ <!-- 已知风险、兼容性和回滚方式。 -->
34
+
35
+ ## 后续工作
36
+
37
+ <!-- 不属于本 PR 的工作,附任务编号。 -->
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2022",
5
+ "strict": true,
6
+ "noUncheckedIndexedAccess": true,
7
+ "exactOptionalPropertyTypes": true,
8
+ "noImplicitOverride": true,
9
+ "noImplicitReturns": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "useUnknownInCatchVariables": true,
12
+ "verbatimModuleSyntax": true,
13
+ "isolatedModules": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "skipLibCheck": true
16
+ }
17
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.node.json" },
5
+ { "path": "./tsconfig.web.json" },
6
+ { "path": "./tsconfig.test.json" }
7
+ ]
8
+ }