tsx
tsx Style Guide
Install / Use
npx skills add zenbase-ai/context42Installs into whichever agent you are using.
Cursor Rules
Cursor IDE rules (v2)
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of tsx
tsx scores 57/100 on our quality scale, 4174th of 4,617 Development & Engineering skills we index.
Its Cursor Rules is 28 KB long, well organised into 25 sections and no code examples: a thorough specification that gives an agent plenty to work with.
It has no GitHub stars yet, so there is no community track record; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
- Our last check on 2026-10-19 found the source still online.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 69/100, with 4 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-25. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
tsx compared with similar skills
All 4 of these similar skills score higher than tsx; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| tsx (this skill)by zenbase-ai | 57 | 0 | 9mo ago | Cursor Rules |
| taste-skillby Leonxlnx | 100 | 110.6k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 69.8k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 46.6k | 2d ago | CLAUDE.md |
Frequently asked questions
- How do I install tsx?
- Run
npx skills add zenbase-ai/context42. The install tabs above show the steps for each supported agent. - Which AI agents does tsx work with?
- It is written for Cursor, as a Cursor Rules file. Other agents that read the same format can often use it too.
- Is tsx safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It declares no license and scores 69/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is tsx still maintained?
- The repository was last updated about 9 months ago. That is recent enough to be usable, but agent tooling moves fast, so check the instructions against your agent's current version.
Skill content
View source on GitHubdescription: tsx Style Guide globs: "**/*.tsx" alwaysApply: false
Developer Style Guide: TypeScript React Components (.tsx)
This guide decodes the unique coding DNA of the developer, providing insights into their patterns, preferences, and the subtle decisions that make their code distinctively theirs. The goal is to enable an AI agent to seamlessly mimic this style, making contributions indistinguishable from the original author.
1. CORE PHILOSOPHY
The developer prioritizes readability, maintainability, and functional purity in UI components, with a keen eye on performance optimization for complex rendering scenarios. They believe in explicit data flow and clear separation of concerns, favoring composition over deep inheritance. The code "feels" clean, predictable, and robust, designed for long-term evolution.
Rationale: This approach minimizes cognitive load for future developers, reduces the likelihood of subtle bugs, and ensures a responsive user interface, especially in data-intensive components.
2. NAMING PATTERNS
2.1. Component Naming
- Convention:
PascalCasefor component files and component exports. - Rationale: Standard React convention, clearly distinguishes components from other modules.
- Examples:
// File: ExplorerStatus.tsx export const ExplorerStatus: React.FC<ExplorerStatusProps> = ({ ... }) => { ... }// File: ProgressBar.tsx export const ProgressBar: React.FC<ProgressBarProps> = ({ ... }) => { ... }// File: Index.tsx export const Index: React.FC<IndexProps> = ({ ... }) => { ... } - Anti-Example (Avoid):
explorerStatus.tsx(camelCase file name),export const explorerStatus = ...(camelCase component name).
2.2. Prop Type Naming
- Convention:
PascalCasefollowed byPropssuffix. - Rationale: Clearly identifies the interface as defining component properties.
- Examples:
export type ExplorerStatusProps = { readonly fileGroups: Map<Language, FileGroup[]> readonly isLoading: boolean }export type ProgressBarProps = { readonly value: number readonly max: number readonly label?: string readonly terminalWidth?: number }export type IndexProps = { fileGroups: Map<Language, FileGroup[]> inputDir: string outputDir: string model: string concurrency: number total: number database: DB debug?: boolean } - Anti-Example (Avoid):
ExplorerStatusP,IExplorerStatusProps.
2.3. Variable and Function Naming
- Convention:
camelCasefor local variables, function names, and object keys. Descriptive and avoids excessive abbreviations unless contextually clear (e.g.,colIfor column index in a loop). - Rationale: Standard JavaScript/TypeScript convention, promotes readability.
- Examples:
const foundLanguages = Array.from(fileGroups.keys()) let fileCount = 0 const languageCounts: Record<string, number> = {}const truncateText = (text: string, maxWidth: number, padding: number): string => { ... } const intersperse = <T, I>(intersperser: (index: number) => I, elements: T[]): (T | I)[] => { ... }const outputPath = (inputDir: string, outputDir: string, lang: Language) => path.relative(inputDir, path.join(outputDir, `${lang}.md`)) - Anti-Example (Avoid):
fL,fCnt,langCnts(over-abbreviation).
2.4. Readonly Modifier
- Convention: Use
readonlyfor props and type properties that are not intended to be modified after creation. - Rationale: Enforces immutability, improves predictability, and leverages TypeScript's type safety.
- Examples:
export type ExplorerStatusProps = { readonly fileGroups: Map<Language, FileGroup[]> readonly isLoading: boolean }export type ProgressBarProps = { readonly value: number readonly max: number readonly label?: string readonly terminalWidth?: number }export type WorkersStatusProps = { inputDir: string readonly workers: readonly Worker[] readonly queuedTasks?: readonly QueuedTask[] } - Anti-Example (Avoid): Omitting
readonlywhen the property is not meant to be mutated.
3. CODE ORGANIZATION
3.1. File Structure and Component Cohesion
- Convention: Each major UI component resides in its own
.tsxfile. Related helper components or utility functions that are highly specific to a single component are co-located within that component's file. Generic utilities are moved to alibdirectory. Top-level application components (likeIndex) reside directly insrc/. - Rationale: Promotes high cohesion and low coupling. Components are self-contained units. Clear separation between application entry points, core UI components, and reusable utilities.
- Examples:
Table.tsxcontainsTablecomponent,Header,Cell,Skeleton(helper components specific toTable), androw,truncateText,intersperse(utility functions specific toTable'srendering logic).ExplorerStatus.tsx,ProgressBar.tsx,WorkerStatus.tsxare single-component files insrc/components/.index.tsx(the main application component) andmain.tsx(the CLI entry point) are insrc/.
- Anti-Example (Avoid): Placing
HeaderorCellin a separatecomponents/table/subdirectory if they are not reusable outsideTable. Mixing CLI setup logic directly within a React component.
3.2. Import Statement Organization
- Convention: Imports are grouped and ordered:
- Node.js built-in modules (e.g.,
node:path). - External libraries (e.g.,
ink,react). - Local relative imports (e.g.,
../lib/types.js,./Table.js). Type-only imports (import type ...) are often grouped separately or at the top of their respective sections.
- Node.js built-in modules (e.g.,
- Rationale: Consistency, readability, and easy identification of dependencies.
- Examples:
// WorkerStatus.tsx import path from "node:path" // Node.js built-in import { Box, Text } from "ink" // External import type React from "react" // External type import { useMemo } from "react" // External import type { QueuedTask, Worker } from "../lib/types.js" // Local type import Table from "./Table.js" // Local component// Index.tsx import path from "node:path" // Node.js built-in import { Box, Text, useApp } from "ink" // External import BigText from "ink-big-text" // External import Gradient from "ink-gradient" // External import { useEffect, useMemo } from "react" // External import { ExplorerStatus } from "./components/ExplorerStatus.js" // Local component import { ProgressBar } from "./components/ProgressBar.js" // Local component import Table from "./components/Table.js" // Local component import { WorkersStatus } from "./components/WorkerStatus.js" // Local component import { useProcessor } from "./hooks/use-processor.js" // Local hook import type { DB } from "./lib/database.js" // Local type import type { FileGroup, Language } from "./lib/types.js" // Local type - Anti-Example (Avoid): Mixed import order, e.g.,
import Table from "./Table.js"followed byimport { Box } from "ink".
3.3. Functional Component Structure
- Convention: Functional components are defined as
React.FC<PropsType>and use destructuring for props.useMemoanduseCallbackare used extensively for memoization of derived values and functions, respectively.useEffectis used for side effects, including component lifecycle management (e.g., running a process on mount, exiting on completion/error). - Rationale: Standard React functional component pattern, leverages memoization for performance, especially in components that re-render frequently or perform complex calculations.
useEffectensures proper handling of side effects and integration with the Ink application lifecycle. - Examples:
export const ExplorerStatus: React.FC<ExplorerStatusProps> = ({ fileGroups, isLoading }) => { // ... logic ... return ( <Box>...</Box> ) }export const WorkersStatus: React.FC<WorkersStatusProps> = ({ workers, inputDir, queuedTasks = [] }) => { const workersViewModel = useMemo( () => workers .map(agent => ({ ... })), [workers, inputDir], ) // ... }// Index.tsx export const Index: React.FC<IndexProps> = ({ ... }) => { const { exit } = useApp() const { run, workers, queuedTasks, progress, results, error, reset } = useProcessor({ ... }) useEffect(() => { run() }, [run]) useEffect(() => { if (results != null || error != null) { database.close() reset() exit() } }, [results, error, exit, reset, database]) // ... } - Anti-Example (Avoid): Defining components as
function MyComponent(props: MyProps) { ... }withoutReact.FCor not usinguseMemo/useCallbackfor potentially expensive computations or stable function references. Performing side effects directly in the render function.
4. ERROR HANDLING
- Convention: Error handling in UI components is primarily focused on displaying errors passed down via props rather than internal
try/catchblocks for rendering logic. Data validation and error generation are assumed to happen upstream (e.g., in data fetching layers or business logic, or custom hooks likeuseProcessor). Components react to anerrorprop to display appropriate messages. - Rationale: UI components are responsible for presentation. Separating error generation from error presentation simplifies component logic and allows for centralized error management and consistent UI feedback.
- Examples:
// WorkerStatus.tsx // The 'error' property is part of the Worker type, passed down. status: agent.status === "idle" ? "Waiting..." : agent.status === "working" ? agent.progress || "Working..." : agent.status === "success" ? "Success" : agent.error, // Displaying the error if agent.status is an error state// Index.tsx ) : error != null ? ( <> <ExplorerStatus fileGroups={fileGroups} isLoading={false} /> <Box marginTop={1}> <Text color="red">✗ Error: {error}</Text> {debug && <Text dimColor>Run ID: {database.runId}</Text>} </Box> </> ) : ( - Anti-Example (Avoid):
try/catchblocks directly withinrendermethods oruseMemohooks for data that is expected to be valid. UI components performing complex error validation that should be handled by business logic.
5. STATE MANAGEMENT
- Convention: Local component state is managed using React's built-in hooks (
useState,useMemo,useCallback,useEffect). There is no evidence of a global state management library (e.g., Redux, Zustand). Derived state is heavily memoized usinguseMemo. Complex, shared logic and state are encapsulated within custom hooks (e.g.,useProcessor), which then expose their state and methods via a structured return object. - Rationale: For the current scope of UI components, local state and prop drilling are sufficient.
useMemoensures performance by preventing unnecessary re-calculations of derive
Truncated for display — read the full file on GitHub.
Related Skills
taste-skill
110.6kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
69.8kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
46.6kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
