type-expand
Skill1 starsChanged 56 days agoMITView on GitHub
Expand TS aliases to shapes
In this repository33 other files it gives its agents.
- apollousaSkill
- chrome-clean-installSkill
- ci-hardeningSkill
- codebase-litter-auditSkill
- coderabbit-resolverSkill
- code-step-tourSkill
- code-traceSkill
- colorful-typeSkill
- component-hierarchySkill
- cookieSkill
- deep-traceSkill
- disk-mapSkill
- dndSkill
- electron-releaseSkill
- explain-diff-htmlSkill
- explainSkill
- generating-codebase-wikiSkill
- github-actions-pnpm-ciSkill
- laststance-publish-skillSkill
- learn-htmlSkill
- loadSkill
- locate-ui-from-codeSkill
- mac-security-sweepSkill
- oss-repo-setupSkill
- product-inspirationSkill
- prop-drillSkill
- pr-tourSkill
- saveSkill
- searchSkill
- source-grounded-researchSkill
- ts-pattern-refactorSkill
- ux-gap-detectorSkill
- visual-lintSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
When running this skill in Codex, translate Claude Code-only primitives before acting: AskUserQuestion -> chat/request_user_input, …
- Distinctive: line 18
Use this skill to inspect the real shape of complex TypeScript types when IDE hover is not enough.
- Distinctive: line 22
Use one of these:
- Distinctive: line 30
Run the expander script:
- Distinctive: line 38
If project root cannot be inferred, pass tsconfig path:
- Distinctive: line 52
If part of the type cannot be fully resolved, keep best-effort expansion and annotate unresolved fragments inline.
- Distinctive: line 56
Prefer concrete object property expansion over alias names.
- Distinctive: line 65
Keep property names stable and readable.
- Very specific: line 67
Use unknown for recursion/depth guard fallbacks.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Type Expand
Codex Compatibility
When running this skill in Codex, translate Claude Code-only primitives before acting: AskUserQuestion -> chat/request_user_input, TodoWrite -> update_plan, Task/TaskCreate/TeamCreate/SendMessage -> spawn_agent/send_input/wait_agent when available and allowed, and EnterPlanMode/ExitPlanMode -> a concise chat plan plus explicit approval.
Resolve Read/Write/Edit/Bash/WebSearch/WebFetch to Codex file/shell/web tools, and map ~/.claude/... paths to ~/.agents/... or ~/.codex/... unless the task explicitly targets Claude Code.
Cursor Compatibility
When running this skill in Cursor Agent, translate Claude Code-only primitives before acting: AskUserQuestion -> AskQuestion; TodoWrite -> Cursor TodoWrite or an equivalent checklist; Task/TaskCreate/TeamCreate/SendMessage/multi-agent flows -> Cursor Task (subagents), parallel Tasks, or run_in_background when allowed (TeamCreate/SendMessage may have no exact match); EnterPlanMode/ExitPlanMode -> Plan mode (SwitchMode / CreatePlan) plus explicit user approval.
Resolve Read/Write/Edit/StrReplace/Bash/web/search/MCP via Cursor Composer or Agent equivalents. MCP names written as mcp__server__tool typically map to call_mcp_tool with configured server identifiers. Map ~/.claude/... to ~/.cursor/skills/, .cursor/skills/, and .cursor/rules/ unless the task explicitly targets Claude Code.
Purpose
Use this skill to inspect the real shape of complex TypeScript types when IDE hover is not enough.
Inputs
Use one of these:
- Selected code that includes a target type alias.
filePath+typeName.- A direct alias snippet (
export type X = ...).
Workflow
- Identify target alias name and source file.
- Run the expander script:
pnpm exec tsx ~/.agents/skills/type-expand/scripts/expand-type.ts --file <filePath> --type <typeName>(Claude Code: ~/.claude/skills/...、Cursor: ~/.cursor/skills/... または .cursor/skills/... に symlink される)
- If project root cannot be inferred, pass tsconfig path:
pnpm exec tsx ~/.agents/skills/type-expand/scripts/expand-type.ts --file <filePath> --type <typeName> --project <tsconfigPath>- Return output in this format:
export type <TypeName> =
| <expanded object type>
| <expanded object type>- If part of the type cannot be fully resolved, keep best-effort expansion and annotate unresolved fragments inline.
Expansion Policy
- Prefer concrete object property expansion over alias names.
- Recursively expand unions/intersections.
- Expand instantiated generics where type arguments are known.
- Resolve conditional types (
extends) and infer-derived parts when checker provides concrete results. - Flatten common utility-type transformations when symbol/property info is available (
Pick,Omit,Partial,Required,Readonly,Record,Exclude,Extract,NonNullable). - Enforce depth and cycle guards to prevent runaway expansion.
Output Style
- Keep property names stable and readable.
- Preserve optional (
?) and readonly modifiers when detectable. - Use
unknownfor recursion/depth guard fallbacks.
Additional Resource
- See reference.md for command examples and troubleshooting.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

