From 92817adb4357ff90a4d8e179b01a2c55e3933295 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sun, 30 Nov 2025 08:57:10 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 12 +++++++++ README.md | 3 +++ plugin.lock.json | 49 +++++++++++++++++++++++++++++++++++ skills/test-coverage/SKILL.md | 27 +++++++++++++++++++ skills/ts-style/SKILL.md | 36 +++++++++++++++++++++++++ 5 files changed, 127 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 plugin.lock.json create mode 100644 skills/test-coverage/SKILL.md create mode 100644 skills/ts-style/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..2461ae7 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "airbot-typescript", + "description": "TypeScript style and testing rubrics for AIRBot reviews.", + "version": "0.1.0", + "author": { + "name": "AIRBot Team", + "email": "zhongweili@tubi.tv" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..9e90537 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# airbot-typescript + +TypeScript style and testing rubrics for AIRBot reviews. diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..1aac33f --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,49 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:sids/airbot:plugins/airbot-typescript", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "c133338b9f3ee9c1ac177204936313a41f8d7373", + "treeHash": "7909c65580e84585fd559a0b84e84ed421bed6f9783ccd98328ccb8df8a692bc", + "generatedAt": "2025-11-28T10:28:20.541209Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "airbot-typescript", + "description": "TypeScript style and testing rubrics for AIRBot reviews.", + "version": "0.1.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "9ac0a3a7249bbb5badbf1b5a92177ebfe6ef09696d68e22591eceeb92c88575d" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "49279c79212e9a49799e3218124506e274e6e8d7040f2b410076ddd8ddb35d0a" + }, + { + "path": "skills/ts-style/SKILL.md", + "sha256": "b55203ce7d199a816ec61f3db8307d5dbe7f56eb80446441c28c53286d8ad681" + }, + { + "path": "skills/test-coverage/SKILL.md", + "sha256": "e0ce2189c40411d3faba8623d2838542ea2a344a29553631380e2052cceb3ef9" + } + ], + "dirSha256": "7909c65580e84585fd559a0b84e84ed421bed6f9783ccd98328ccb8df8a692bc" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/test-coverage/SKILL.md b/skills/test-coverage/SKILL.md new file mode 100644 index 0000000..f8eb2f7 --- /dev/null +++ b/skills/test-coverage/SKILL.md @@ -0,0 +1,27 @@ +--- +name: test-coverage +description: Testing expectations for AIRBot reviewers +license: MIT +--- + +## Mission +- Ensure pull requests maintain or improve automated test coverage and reliability. +- Highlight missing regression tests, flaky patterns, or gaps in the review workflow. + +## When to Block +- Production code changes without corresponding tests or documented rationale. +- Failing or removed tests without replacement coverage. +- Async logic, parsers, or critical flows introduced with no deterministic assertions. + +## Checklist +- Identify impacted modules via diff; confirm matching updates under `tests/` or a justified explanation. +- Require Bun test fixtures close to their source modules; suggest new files under `tests/`. +- Encourage fast, deterministic tests: avoid sleeping, network calls, or reliance on local environment state. +- Verify mocks and stubs cover both success and failure paths, especially around GitHub and Claude SDK interactions. +- Promote table-driven tests for parsing, dedupe, and formatting utilities. +- Ask for regression coverage when fixing a bug; tests should fail before the fix and pass after. + +## Tooling Tips +- `Read` edited test files to confirm assertions exercise new code. +- `Glob` for `*.test.ts` near touched modules to gauge existing coverage. +- `Grep` for TODOs or `skip` calls that might hide missing coverage. diff --git a/skills/ts-style/SKILL.md b/skills/ts-style/SKILL.md new file mode 100644 index 0000000..adc8278 --- /dev/null +++ b/skills/ts-style/SKILL.md @@ -0,0 +1,36 @@ +--- +name: ts-style +description: TypeScript style standards for AIRBot reviewers +license: MIT +--- + +## Mission +- Enforce readable, maintainable TypeScript that matches AIRBot conventions. +- Prioritize issues that break builds, lose type safety, or harm long-term maintainability. + +## Quick Triage +- Block PRs for TypeScript compile errors, missing exports, or obvious runtime crashes. +- Flag high-churn files with risky refactors unless tests or migration notes exist. +- Praise meaningful improvements to typing, structure, or docs. + +## Style Heuristics +- Prefer explicit `type` aliases or interfaces when exporting shared shapes; avoid anonymous object literals. +- Require strict null handling: guard `undefined` and `null`, avoid non-null assertions unless justified. +- Ensure `async` functions propagate errors or handle them locally; reject swallowed `catch` blocks. +- Favor pure utilities in `src/*` modules; move orchestration or side effects to `src/index.ts`. +- Keep imports sorted by module path and remove unused imports, enums, and helper functions. +- Encourage `const` over `let` unless mutation is necessary; avoid `var`. +- Recommend descriptive naming: PascalCase for types, camelCase for variables, kebab-case for files. + +## Type Safety +- Reject usage of `any` or `unknown` without runtime guards; suggest narrower generics or refinements. +- Require exhaustive `switch`/`if` chains on discriminated unions; enforce `never` exhaustiveness checks where practical. +- Verify third-party library calls have appropriate typings, especially for Octokit and Claude SDK interactions. +- Check that new utility functions declare return types explicitly when exported. + +## Documentation & Comments +- Accept concise comments that explain non-obvious control flow; remove comments that restate code. +- Encourage README/CLAUDE rubric updates alongside behavior changes. + +## Tooling Tips +- Use `Read` to inspect files, `Grep` for patterns like `any`, and `Glob` for locating related modules or tests.