正在自动登录…
← 返回项目列表rauchg/
rauchg/ gdp-ts
gdp-ts 是一个用于 TypeScript 的库和 linter,通过编译时类型检查来增强 API 契约的安全性,防止授权或权限相关的错误。它提供了一种名为“Ghosts of Departed Proofs”的验证系统,并附带一个 AI skill 来指导编码代理和人类开发者应用该模式。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/14 14:31:04 · 查看原文
- 累计 Stars
- 826
- 当前热度
- 未达当前门槛
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/10/14 14:31:04
- 使用方式
通过 npm 安装库和 linter,使用 npx 安装 AI skill。库提供 name()、defineProof() 等 API,linter 提供 ESLint 和 Oxlint 预设。
查看 README 依据
$ npx skills add rauchg/gdp-ts $ pnpm add @gdp-ts/core ``` Requires TypeScript 5.4 or newer. ## The problem A lot of codebases feature code like this: ```js async function handler(req, res) { await assertProjectAdmin(req.user.id, req.params.projectId); // throws 403 await setPasswordProtection(req.params.projectId, req.body.password); // nothing connects this to the line above res.sendStatus(204); } ``` Looks great, except: all it takes is - a developer to slip and miss the first `await`
time. [We rely on linting](skills/gdp-ts/references/recipe.md#6-turn-on-the-lint-preset) to prevent "cheating" (e.g: `{} as UserIsProjectAdmin<U, P>`). ## The package [`@gdp-ts/core`](https://www.npmjs.com/package/@gdp-ts/core) on npm ships two things: - **The library** (`@gdp-ts/core`): `name()`, `defineProof()`, `Named` and `Proof`, with no dependencies.
- **The linter** (`@gdp-ts/core/lint/eslint`, `@gdp-ts/core/lint/oxlint`): presets for ESLint and Oxlint that catch what the type checker can't, such as forging a proof with `as` or minting one outside `proofs/` ([setup](skills/gdp-ts/references/recipe.md#6-turn-on-the-lint-preset)). ## The skill `npx skills add rauchg/gdp-ts` installs a skill that guides coding agents through applying the pattern in your codebase. It is plain Markdown, so it doubles as the reference manual for humans:
- 部署要求
需要 TypeScript 5.4 或更高版本。
查看 README 依据
$ npx skills add rauchg/gdp-ts $ pnpm add @gdp-ts/core ``` Requires TypeScript 5.4 or newer. ## The problem A lot of codebases feature code like this: ```js async function handler(req, res) { await assertProjectAdmin(req.user.id, req.params.projectId); // throws 403 await setPasswordProtection(req.params.projectId, req.body.password); // nothing connects this to the line above res.sendStatus(204); } ``` Looks great, except: all it takes is - a developer to slip and miss the first `await`
- 已知限制
作者明确说明不保证防止伪造证明、过期证明等 TypeScript 的限制。
查看 README 依据
- [**Reading the errors**](skills/gdp-ts/references/errors.md): what the compiler catches, and what each message means. - [**What this does not guarantee**](skills/gdp-ts/references/limits.md): forged proofs, stale proofs, and other limits of TypeScript. - [**Where to stop**](skills/gdp-ts/references/where-to-stop.md): the ease-to-rigor slider. - [**API**](skills/gdp-ts/SKILL.md#api): everything `gdp-ts` exports. ## Examples All three use the same domain, loosely modeled after Vercel's
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/10/5 02:55:18
- 首次达标收录
- 2026/10/9 12:11:18
- 统计更新时间
- 2026/10/22 19:10:50
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。
模型评估
值得看加权总分 4.0 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/10/10 13:56:12 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/10/19 15:46:44
- 许可证标识
- MIT
- Fork 数
- 22
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:小火
首次发现项目