flpbalada/my-opencode-config
Overview
This skill guides TypeScript best practices to improve type safety, code organization, and long-term maintainability. It gives actionable recommendations for project configuration, typing strategies, async patterns, testing, and performance. Use it to make concrete decisions when starting projects, reviewing code, or fixing runtime type issues.
How this skill works
The skill inspects typical TypeScript decisions and suggests concrete patterns: enabling strict compiler options, preferring inference for locals and explicit types for public APIs, choosing between interface and type aliases, and replacing any with unknown and generics. It also recommends file organization, async/await patterns, testing-friendly dependency injection, and performance-minded type usage. Outputs are practical, ready-to-apply rules and examples.
When to use it
- Initializing or configuring a new TypeScript project
- Choosing interface vs type alias for public APIs
- Writing or reviewing async/await code and concurrency
- Improving testability and dependency injection in code
- Optimizing type usage for compile-time performance
Best practices
- Enable compiler strict mode (noImplicitAny, strictNullChecks, etc.) for maximum safety
- Trust type inference for local values; annotate public APIs and class members explicitly
- Prefer interface for extendable object shapes and public contracts; use type for unions, tuples, mapped types
- Avoid any; use unknown with type guards or generics to preserve type-safety
- Use guard clauses, single-responsibility functions, and small focused helpers
- Use type-only imports/exports and const assertions to aid tree-shaking and literal typing
Example use cases
- Set up tsconfig.json with strict flags before adding third-party libraries
- Refactor a large function into validation, transformation, persistence, and side-effect steps
- Replace any-typed API responses with unknown and add runtime type guards
- Parallelize independent async calls with Promise.all instead of sequential awaits
- Create barrel files for module groups to simplify imports and surface public types
FAQ
Yes. strict mode catches many errors early and enforces explicit handling of null/undefined and implicit any. It’s the single best compiler configuration for safety.
When should I use interface vs type?
Use interface for extendable object shapes and public contracts; use type for unions, tuples, mapped types, and advanced type compositions.
28 skills
This skill helps you configure TypeScript projects and enforce best practices for type safety, maintainability, and code quality.
This skill helps design internal triggers for sustained engagement by shifting users from external prompts to self-motivated habits.
This skill helps you design landing pages and CTAs using gaze cues and visual hierarchy to boost conversions and user engagement.
This skill helps you review React code and avoid useEffect misuse by suggesting better patterns for derived state, event handling, and performance.
This skill helps you optimize decision speed by reducing choices in navigation, onboarding, and forms, applying Hick's Law to improve user flow.
This skill captures user-centered requirements as structured user stories to guide backlog items, acceptance criteria, and cross-functional collaboration.
This skill guides a PEST analysis to identify political, economic, social, and technological factors and translate them into actionable strategies.
This skill guides you through root cause analysis using the Five Whys technique to uncover underlying issues and drive effective fixes.
This skill helps you design product migrations and feature launches that respect status quo bias, easing adoption and maximizing completion.
This skill helps you correctly manage React Server Components boundaries by guiding when to use the use client directive for optimal client/server separation.
This skill helps you visualize complex dependencies and architectures using graph-thinking to map relationships and non-linear problem solving for clearer
This skill enforces consistent naming using the A/HC/LC pattern to improve readability and maintainability across variables and functions.
This skill helps you optimize interfaces by applying Cognitive Load Theory to reduce extraneous load and enhance germane learning.
This skill helps you implement and troubleshoot React useState usage, guiding when to use state, avoid pitfalls, and optimize local component state.
This skill helps you design landing pages and checkout flows that reduce perceived risk by applying proven trust signals.
This skill helps you structure complex questions into testable hypotheses for MECE coverage, enabling faster validation of ideas and experiments.
This skill helps you design headlines, notifications, and onboarding flows that spark curiosity and boost engagement by revealing just enough.
This skill helps you structure and document product decisions using a framework that improves alignment, traceability, and learning across teams.
This skill guides you to apply Tit for Tat in repeated interactions to maximize cooperative outcomes and manage conflicts.
This skill helps implement art direction for Next.js images using getImageProps to serve viewport-specific compositions and assets.
This skill helps you apply the Fogg Behavior Model to diagnose why users fail to act and design targeted prompts.
This skill visualizes workflow with Kanban boards, limits WIP, and optimizes flow to improve delivery and continuous improvement.
This skill helps you decide when to use interface versus type in TypeScript to improve type safety and maintainability.
This skill helps you implement responsive components using CSS container queries and Tailwind, enabling components to adapt to their container size.
This skill helps you design landing pages and conversions by applying social proof tactics to build trust and boost actions.
This skill helps you apply loss aversion principles to retention, pricing, and onboarding to nudge users toward desired actions.
This skill helps you apply Jobs-to-be-Done insights to shape product strategy, conduct research interviews, write user stories, and identify true competition.
This skill helps you leverage the halo effect to optimize first impressions, brand perception, and feature presentation across onboarding and marketing.