Token导航 LogoToken导航

Agent Skill · 前端设计

excess-property-checking(超额财产检查)

excess-property-checking 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

excess-property-checking 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,432。

总安装 216周安装 9GitHub Stars 2下载 72核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:excess-property-checking(超额财产检查)
来源仓库:https://github.com/marius-townhouse/effective-typescript-skills
仓库路径:skills/excess-property-checking
安装命令:
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill excess-property-checking
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill excess-property-checking

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

excess-property-checking 帮助理解 TypeScript 中对象字面量的超额属性检查机制。适用于避免因拼写错误导致的类型错误和运行时异常。区分结构类型与字面量类型的行为差异,提升类型安全性。通过 GitHub 安装,需确认项目启用严格类型检查模式。

建议在接口定义中合理使用 never 类型约束可选字段。

来源仓库内路径:skills/excess-property-checking

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/marius-townhouse/effective-typescript-skills -…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

excess-property-checking 怎么安装?

在终端执行 npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill exc…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

excess-property-checking 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

excess-property-checking 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

excess-property-checking 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

excess-property-checking 用的人多吗?

公开数据是累计安装 216 次,近一周安装 9 次,下载 72 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

excess-property-checking 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
excess-property-checking

超额财产检查 · 本页

2162需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Distinguish Excess Property Checking from Type Checking

Overview

Object literals get special treatment: TypeScript flags unknown properties.

This catches typos and mistakes that structural typing would miss. But it only applies to object literals - understanding this distinction prevents confusion.

When to Use This Skill

  • Assigning object literals to typed variables
  • Confused why extra properties cause errors sometimes
  • Error disappears when using intermediate variable
  • Working with optional properties where typos are likely
  • Designing interfaces with many optional fields

The Iron Rule

ALWAYS remember: Excess property checking only applies to OBJECT LITERALS.

Remember:

  • Object literal → extra properties flagged
  • Variable assignment → structural typing applies
  • Type assertions → bypass excess property checking

Detection: The "Extra Property" Error

When you see "Object literal may only specify known properties", you've triggered excess property checking.

interface Room {
  numDoors: number;
  ceilingHeightFt: number;
}

// Excess property checking: Error!
const r: Room = {
  numDoors: 1,
  ceilingHeightFt: 10,
  elephant: 'present',
  // ~~~~~~~ Object literal may only specify known properties,
  //         and 'elephant' does not exist in type 'Room'
};

// Same value via intermediate variable: No error!
const obj = {
  numDoors: 1,
  ceilingHeightFt: 10,
  elephant: 'present',
};
const r2: Room = obj;  // OK - structural typing allows this

Why Excess Property Checking Exists

Structural typing is powerful but permissive. It allows extra properties, which can hide bugs:

interface Options {
  title: string;
  darkMode?: boolean;
}

function createWindow(options: Options) {
  if (options.darkMode) {
    setDarkMode();
  }
}

// Without excess property checking, this typo would be silent:
createWindow({
  title: 'Spider Solitaire',
  darkmode: true  // lowercase 'm' - TYPO!
  // ~~~~~~~ Object literal may only specify known properties,
  //         but 'darkmode' does not exist in type 'Options'.
  //         Did you mean to write 'darkMode'?
});

When Excess Property Checking Applies

ContextExcess Property Checking?
Object literal assigned to typed variableYes
Object literal as function argumentYes
Object literal as return valueYes
Variable assigned to typed variableNo
Type assertionNo
interface Point { x: number; y: number; }

// Object literal - checking applies
const p1: Point = { x: 1, y: 2, z: 3 };  // Error: 'z' not in Point

// Variable - checking does NOT apply
const temp = { x: 1, y: 2, z: 3 };
const p2: Point = temp;  // OK

// Type assertion - checking does NOT apply
const p3 = { x: 1, y: 2, z: 3 } as Point;  // OK (but bad practice)

When Excess Property Checking Helps

Catching Typos in Optional Properties

interface Config {
  logLevel?: 'debug' | 'info' | 'warn' | 'error';
  timeout?: number;
  retries?: number;
}

const config: Config = {
  loglevel: 'debug',  // Error: Did you mean 'logLevel'?
  timeout: 5000,
};

Preventing Wrong Property Names

interface User {
  firstName: string;
  lastName: string;
}

const user: User = {
  first_name: 'John',  // Error: Did you mean 'firstName'?
  last_name: 'Doe',    // Error: Did you mean 'lastName'?
};

Bypassing Excess Property Checking (When Intentional)

Use Index Signature for Known Extra Properties

interface Options {
  darkMode?: boolean;
  [otherOptions: string]: unknown;
}

const o: Options = { darkmode: true };  // OK now

Use Intermediate Variable

const options = { title: 'Game', extraProp: true };
createWindow(options);  // OK - excess checking skipped

Weak Types: A Related Check

"Weak" types have only optional properties. TypeScript adds a special check:

interface LineChartOptions {
  logscale?: boolean;
  invertedYAxis?: boolean;
  areaChart?: boolean;
}

const opts = { logScale: true };  // Note: capital 'S'
setOptions(opts);
// ~~~~ Type '{ logScale: boolean; }' has no properties in common
//      with type 'LineChartOptions'

This check applies even through intermediate variables (unlike regular excess property checking).

Common Mistakes

Mistake 1: Expecting Structural Typing to Catch Typos

// ❌ Typo passes silently because no excess property checking
const options = { darkmode: true };  // lowercase 'm'
const config: Options = options;     // No error!

// ✅ Use object literal for catching typos
const config: Options = { darkmode: true };  // Error caught!

Mistake 2: Using Type Assertion to Silence Errors

// ❌ Assertion bypasses the check
const config = { darkmode: true } as Options;

// ✅ Fix the typo instead
const config: Options = { darkMode: true };

Mistake 3: Confusion About Why Error Disappears

// This has an error
const p: Point = { x: 1, y: 2, z: 3 };

// Why doesn't this?
const temp = { x: 1, y: 2, z: 3 };
const p: Point = temp;

// Answer: Excess property checking only applies to object literals!

Pressure Resistance Protocol

1. "Just Add as Type"

Pressure: "The type assertion makes the error go away"

Response: Assertions bypass safety checks. Fix the actual issue.

Action: Correct the property name or update the type definition.

2. "TypeScript Is Being Too Strict"

Pressure: "Extra properties shouldn't matter"

Response: This catches real bugs like typos in optional fields.

Action: If you truly need extra properties, use an index signature.

3. "It Works With a Variable"

Pressure: "Just use an intermediate variable to avoid the error"

Response: That hides bugs. The error exists for a reason.

Action: Investigate why the extra property exists.

Red Flags - STOP and Reconsider

  • Using type assertion to silence excess property errors
  • Creating intermediate variables just to avoid checks
  • Confused why some assignments error and others don't
  • Thinking TypeScript is inconsistent about extra properties

Common Rationalizations (All Invalid)

ExcuseReality
"It's just an extra property"Extra properties often indicate typos
"Structural typing allows this"Object literals have stricter rules for good reason
"The assertion fixes it"Assertions hide bugs, they don't fix them

Quick Reference

ScenarioExcess Property Check?Example
Object literal to typed varYesconst x: T = {...}
Object literal as argumentYesfn({...})
Variable to typed varNoconst temp = {...}; const x: T = temp;
Type assertionNo{...} as T
Weak type (via variable)Checks for common propsSpecial case

The Bottom Line

Excess property checking catches bugs that structural typing would miss.

It only applies to object literals, not variables. This is intentional - it catches typos in property names, especially for optional properties. Don't bypass it with assertions or intermediate variables; instead, fix the underlying issue.

Reference

Based on "Effective TypeScript" by Dan Vanderkam, Item 11: Distinguish Excess Property Checking from Type Checking.

平台分布

Codex

36.85%
按下载量换算27

Claude

28.96%
按下载量换算21

Cursor

20.71%
按下载量换算15

Gemini CLI

10.47%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills