Creator · mkosir
Last updated · Sep 2, 2026
Apply, review, and explain TypeScript type conventions. Use automatically for tasks involving inference, readonly data, type-safe constants, template literal types, any and unknown, assertions, type errors, type definitions, arrays, type imports, or generated service types.
Sandbox only
Install targets
Codex install prompt
Install the "typescript-types" agent skill from https://github.com/mkosir/typescript-style-guide/tree/main/skills/typescript-types. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Apply, review, and explain TypeScript type conventions. Use automatically for tasks involving inference, readonly data, type-safe constants, template literal types, any and unknown, assertions, type errors, type definitions, arrays, type imports, or generated service types. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"mkosir-typescript-types","task":"Install typescript-types","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add mkosir/typescript-style-guide --skill typescript-types
Maintenance
fresh
11d since push
Risk
Needs review
Permission surface may require sandboxing
GitHub quality
784
76/100 Quality · 79/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Quality score needs review
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
StrongSolid option that is likely worth shortlisting for production workflows.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
784 GitHub stars
Repo activity
784 stars, 37 forks
Maintenance
11d since push
License
MIT
Install
npx skills add mkosir/typescript-style-guide --skill typescript-types
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add mkosir/typescript-style-guide --skill typescript-typesDo not use when
Agent safety v2
Usable candidate, but the agent should surface permission and audit notes before installation.
Require human approval before installing into a real workspace.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
medium
Skill may read or write project files, documents, generated artifacts, or local workspace state.
medium
Skill may inspect schemas, query databases, or work with persistent stores.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20typescript-types%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20typescript-types%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/mkosir-typescript-types/install
Agent should check
Copy prompt
Task: Use typescript-types in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20typescript-types%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/mkosir-typescript-types/install
Install command: npx skills add mkosir/typescript-style-guide --skill typescript-types
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/mkosir-typescript-types/install
LLM text format
/api/skills/mkosir-typescript-types/install?format=text
Find alternatives
/api/skills/search?q=typescript-types&limit=3
Agent prompt
Use typescript-types for this task. Review https://www.openagentskill.com/api/skills/mkosir-typescript-types/install, then install with: npx skills add mkosir/typescript-style-guide --skill typescript-typesRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/mkosir-typescript-types
LLM text
/api/registry/manifest/mkosir-typescript-types?format=text
Install alias
/api/registry/install/mkosir-typescript-types
Recommend
/api/registry/recommend?task=Use%20typescript-types%20in%20an%20agent%20workflow&limit=3
Agent fit
Coding agents
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Role in stack
Primary pick
Primary fit
Coding agents
Trust label
Production-ready
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO784 GitHub stars
Stars/forks activity
INFO784 stars, 37 forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Solid option that is likely worth shortlisting for production workflows.
Workflow fit
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Manage repositories
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Operate local tools
I need my agent to operate local files and desktop apps in a repeatable workflow.
Workflow fit
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Turn skills into distribution
A workflow for turning newly indexed skills into SEO briefs, social drafts, comparison pages, and reusable publishing workflows.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Apache ECharts is a powerful, interactive charting and data visualization library for browser
Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 160,000+ scientists worldwide. 140 ready-to-use skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
Apache Superset is a Data Visualization and Data Exploration Platform
--- name: typescript-types description: Apply, review, and explain TypeScript type conventions. Use automatically for tasks involving inference, readonly data, type-safe constants, template literal types, any and unknown, assertions, type errors, type definitions, arrays, type imports, or generated service types. ---
# Types
Apply the TypeScript Style Guide's type conventions in the context of the current task.
## Workflow
1. Inspect the consuming repository's conventions and configuration. 2. Let explicit repository conventions take precedence over this opinionated guidance. 3. Apply, review, or explain only the guidance relevant to the task. 4. State important tradeoffs when the appropriate model depends on context or judgment.
## Boundaries
- Keep TypeScript and ESLint responsible for checks they can enforce automatically. - Do not introduce unrelated TypeScript Style Guide conventions merely because this skill is active.
<!-- BEGIN CANONICAL GUIDE CONTENT -->
## Types
When creating types, consider how they would best **describe our code**. Being expressive and keeping types as **narrow as possible** offers several benefits to the codebase:
- Increased Type Safety - Catch errors at compile time, as narrowed types provide more specific information about the shape and behavior of your data. - Improved Code Clarity - Reduces cognitive load by providing clearer boundaries and constraints on your data, making your code easier for other developers to understand. - Easier Refactoring - With narrower types, making changes to your code becomes less risky, allowing you to refactor with confidence.
### Type Inference
As a rule of thumb, explicitly declare types only when it helps to narrow them.
<Note> Just because you don't need to add types doesn't mean you shouldn't. In some cases, explicitly declaring types can improve code readability and clarify intent. </Note>
Explicitly declare types when doing so helps to narrow them:
```ts // ❌ Avoid const employees = new Map(); // Inferred as wide type 'Map<any, any>' employees.set('Lea', 17); type UserRole = 'admin' | 'guest'; const [userRole, setUserRole] = useState('admin'); // Inferred as 'string', not the desired narrowed literal type
// ✅ Use explicit type declarations to narrow the types. const employees = new Map<string, number>(); // Narrowed to 'Map<string, number>' employees.set('Gabriel', 32); type UserRole = 'admin' | 'guest'; const [userRole, setUserRole] = useState<UserRole>('admin'); // Explicit type 'UserRole' ```
Avoid explicitly declaring types when they can be inferred:
```ts // ❌ Avoid const userRole: string = 'admin'; // Inferred as wide type 'string' const employees = new Map<string, number>([['Gabriel', 32]]); // Redundant type declaration const [isActive, setIsActive] = useState<boolean>(false); // Redundant, inferred as 'boolean'
// ✅ Use type inference. const USER_ROLE = 'admin'; // Inferred as narrowed string literal type 'admin' const employees = new Map([['Gabriel', 32]]); // Inferred as 'Map<string, number>' const [isActive, setIsActive] = useState(false); // Inferred as 'boolean' ```
### Data Immutability
Immutability should be a key principle. Wherever possible, prevent unintended mutations with types like `Readonly` and `ReadonlyArray`.
- Readonly types help prevent accidental mutations and bugs caused by unintended side effects. This protection exists during type checking and does not freeze values at runtime. - When performing data processing, always return new arrays, objects, or other reference-based data structures. To minimize cognitive load for future developers, strive to keep data objects flat and concise. - Use mutations sparingly, only in cases where they are truly necessary, such as when dealing with complex objects or optimizing for performance.
```ts // ❌ Avoid data mutations const removeFirstUser = (users: Array<User>) => { if (users.length === 0) { return users; } return users.splice(1); };
// ✅ Use readonly type to prevent accidental mutations const removeFirstUser = (users: ReadonlyArray<User>) => { if (users.length === 0) { return users; } return users.slice(1); // Using arr.splice(1) errors - Function 'splice' does not exist on 'users' }; ```
### Type-Safe Constants With Satisfies
The `as const satisfies` syntax combines narrow, readonly inference with type validation. It is useful when a constant should retain its exact values while conforming to a broader type.
Key benefits:
- Readonly values with `as const` - Ensures the constant is treated as readonly. - Narrows the types of values to their literals, preventing accidental modifications. - Validation with `satisfies` - Ensures the object conforms to a broader type without widening its inferred type. - Helps catch type mismatches at compile time while preserving narrowed inferred types.
Array constants:
```ts type UserRole = 'admin' | 'editor' | 'moderator' | 'viewer' | 'guest';
// ❌ Avoid constant of wide type const DASHBOARD_ACCESS_ROLES: ReadonlyArray<UserRole> = ['admin', 'editor', 'moderator'];
// ❌ Avoid constant with incorrect values const DASHBOARD_ACCESS_ROLES = ['admin', 'contributor', 'analyst'] as const;
// ✅ Use readonly constant of narrowed type const DASHBOARD_ACCESS_ROLES = ['admin', 'editor', 'moderator'] as const satisfies ReadonlyArray<UserRole>; ```
Object constants:
```ts type OrderStatus = { pending: 'pending' | 'idle'; fulfilled: boolean; error: string; };
// ❌ Avoid mutable constant of wide type const IDLE_ORDER: OrderStatus = { pending: 'idle', fulfilled: true, error: 'Shipping Error', };
// ❌ Avoid constant with incorrect values const IDLE_ORDER = { pending: 'done', fulfilled: 'partially', error: 116, } as const;
// ✅ Use readonly constant of narrowed type const IDLE_ORDER = { pending: 'idle', fulfilled: true, error: 'Shipping Error', } as const satisfies OrderStatus; ```
### Template Literal Types
Embrace template literal types as they allow you to create precise and type-safe string constructs by interpolating values. They are a powerful alternative to using the wide string type, providing better type safety.
Template literal types constrain values known to TypeScript at compile time. They do not validate strings received at runtime.
Adopting template literal types brings several advantages:
- Prevent errors caused by typos or invalid strings. - Provide better type safety and autocompletion support. - Improve code maintainability and readability.
Template literal types are useful in various practical scenarios, such as:
- String Patterns - Use template literal types to enforce specific string patterns during type checking.
```ts // ❌ Avoid const appVersion = '2.6'; // ✅ Use type Version = `v${number}.${number}.${number}`; const appVersion: Version = 'v2.6.1'; ```
- API Endpoints - Use template literal types to restrict values to valid API routes.
```ts // ❌ Avoid const userEndpoint = '/api/usersss'; // Type 'string' - Typo 'usersss': the route doesn't exist, leading to a runtime error. // ✅ Use type ApiRoute = 'users' | 'posts' | 'comments'; type ApiEndpoint = `/api/${ApiRoute}`; // Type ApiEndpoint = "/api/users" | "/api/posts" | "/api/comments" const userEndpoint: ApiEndpoint = '/api/users'; ```
- Internationalization Keys - Avoid relying on raw strings for translation keys, which can lead to typos and missing translations. Use template literal types to constrain their structure.
```ts // ❌ Avoid const homeTitle = 'translation.homesss.title'; // Type 'string' - Typo 'homesss': the translation doesn't exist, leading to a runtime error. // ✅ Use type LocaleKeyPages = 'home' | 'about' | 'contact'; type TranslationKey = `translation.${LocaleKeyPages}.${string}`; // Type TranslationKey = `translation.home.${string}` | `translation.about.${string}` | `translation.contact.${string}` const homeTitle: TranslationKey = 'translation.home.title'; ```
- CSS Utilities - Avoid raw strings for color values, which can lead to invalid or non-existent colors. Use template literal types to enforce known color names and require custom values to start with `#`.
```ts // ❌ Avoid const color = 'blue-450'; // Type 'string' - Color 'blue-450' doesn't exist, leading to a runtime error. // ✅ Use type BaseColor = 'blue' | 'red' | 'yellow' | 'gray'; type Variant = 50 | 100 | 200 | 300 | 400; type Color = `${BaseColor}-${Variant}` | `#${string}`; // Type Color = "blue-50" | "blue-100" | "blue-200" ... | "red-50" | "red-100" ... | #${string} const iconColor: Color = 'blue-400'; const customColor: Color = '#AD3128'; ```
- Database queries - Avoid using raw strings for table or column names, which can lead to typos. Use template literal types to define valid table and column combinations.
<!-- prettier-ignore-start --> ```ts // ❌ Avoid const query = 'SELECT name FROM usersss WHERE age > 30'; // Type 'string' - Typo 'usersss': table doesn't exist, leading to a runtime error. // ✅ Use type Table = 'users' | 'posts' | 'comments'; type Column<TTableName extends Table> = TTableName extends 'users' ? 'id' | 'name' | 'age' : TTableName extends 'posts' ? 'id' | 'title' | 'content' : TTableName extends 'comments' ? 'id' | 'postId' | 'text' : never;
type Query<TTableName extends Table> = `SELECT ${Column<TTableName>} FROM ${TTableName} WHERE ${string}`; const userQuery: Query<'users'> = 'SELECT name FROM users WHERE age > 30'; // Accepted by Query<'users'> const invalidQuery: Query<'users'> = 'SELECT title FROM users WHERE age > 30'; // Error: 'title' is not a column in 'users' table. ``` <!-- prettier-ignore-end -->
### Type any & unknown
The `any` type must not be used because it bypasses type checking and allows unsafe operations and assignments. This can mask serious programming errors.
When dealing with ambiguous data, use `unknown`, which is the type-safe counterpart of `any`. Anything can be assigned to `unknown`, but it must be narrowed before accessing its properties or assigning it to a more specific type.
```ts // ❌ Avoid any const foo: any = 'five'; const bar: number = foo; // no type error
// ✅ Use unknown const foo: unknown = 5; const bar: number = foo; // type error - Type 'unknown' is not assignable to type 'number'
// Narrow the type before dereferencing it using: // Type guard const isNumber = (num: unknown): num is number => { return typeof num === 'number'; }; if (!isNumber(foo)) { throw Error(`API provided a fault value for field 'foo':${foo}. Should be a number!`); } const bar: number = foo; ```
### Type & Non-nullability Assertions
Type assertions `user as User` and non-nullability assertions `user!.name` are unsafe. Both only silence the TypeScript compiler and increase the risk of crashing the application at runtime. They can only be used as an exception, such as a third-party library type mismatch, with a strong rationale for why they are introduced into the codebase.
```ts type User = { id: string; username: string; avatar: string | null }; // ❌ Avoid type assertions const user = { name: 'Nika' } as User;
// ❌ Avoid non-nullability assertions const getUsername = (user: User | null) => user!.username; // Runtime error when user is null ```
### Type Errors
When a TypeScript error cannot be mitigated, use `@ts-expect-error` as a last resort to suppress it.
This directive notifies the compiler when the suppressed error no longer exists, ensuring errors are revisited once they’re obsolete, unlike `@ts-ignore`, which can silently linger even after the error is resolved.
- Always use `@ts-expect-error` with a clear description explaining why it is necessary. - Avoid `@ts-ignore`, as it does not track suppressed errors.
<Rule href="https://typescript-eslint.io/rules/ban-ts-comment/#allow-with-description">{`'@typescript-eslint/ban-ts-comment': [ 'error', { 'ts-expect-error': 'allow-with-description' }, ]`}
Source provenance
Decision snapshot
784 GitHub stars
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for typescript-types, ready for a manual X post.
typescript-types: Apply, review, and explain TypeScript type conventions. Use automatically for tasks involving... 784 stars https://www.openagentskill.com/skills/mkosir-typescript-types?ref=x
Listing + install path for typescript-types: https://www.openagentskill.com/skills/mkosir-typescript-types?ref=x Install: npx skills add mkosir/typescript-style-guide --skill typescript-types
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to mkosir but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/mkosir-typescript-types?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/mkosir-typescript-types?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/mkosir-typescript-types/audit)
[](https://www.openagentskill.com/skills/mkosir-typescript-types?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)mkosir
@mkosir
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Echarts
Apache ECharts is a powerful, interactive charting and data visualization library for browser
67.2K StarsD3
Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:
113.1K StarsScientific Agent Skills
Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 160,000+ scientists worldwide. 140 ready-to-use skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.
33.5K StarsSuperset
Apache Superset is a Data Visualization and Data Exploration Platform
74.7K StarsPermission surface
filesystem or document access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness