1k-cross-platform
CommunityCross-platform patterns for platform code
Authorwanghaisheng
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Build and maintain a single codebase that targets Web, Mobile, Desktop, and Browser Extensions by organizing platform-specific code alongside shared logic, using a centralized platformEnv for deterministic behavior.
Core Features & Use Cases
- Platform-specific extensions: .native.ts for React Native, .web.ts for Web, .desktop.ts for Desktop, and .ext.ts for browser extensions.
- Platform detection with platformEnv to avoid direct runtime checks and to clearly separate platform branches.
- Unified file structure that promotes reusability and predictable builds across all target platforms.
- Use Case: Create a cross-platform UI component that renders platform-appropriate behavior with a single source of truth.
Quick Start
Create a cross-platform component by adding shared logic and platform-specific files (e.g., MyComponent.native.ts, MyComponent.web.ts) and use platformEnv to branch behavior.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: 1k-cross-platform Download link: https://github.com/wanghaisheng/web3-scaffold-app-monorepo/archive/main.zip#1k-cross-platform Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.