This skill defines shared library configuration for React Web and React Native projects.
/plugin marketplace add Syntek-Studio/syntek-dev-suite/plugin install syntek-studio-syntek-dev-suite@Syntek-Studio/syntek-dev-suiteThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill defines shared library configuration for React Web and React Native projects.
| Layer | Technology |
|---|---|
| Context | Shared Logic/UI for React (Web) and React Native (Mobile) |
| Environment | Node.js (Host machine or Docker) |
| Build Tool | tsup / Rollup (ESM & CJS output) |
| Language | TypeScript (Strict mode) |
| Testing | Vitest or Jest |
| Task | Command |
|---|---|
| Build package | npm run build |
| Watch mode | npm run watch |
| Run tests | npm test |
| Link locally | npm link or yalc push |
| Lint | npm run lint |
| Publish | npm publish |
CRITICAL: Shared code must work on BOTH web and mobile.
| Avoid | Alternative |
|---|---|
window, document | Platform detection or conditional imports |
fs, path (Node APIs) | Only in build tools, not runtime code |
localStorage | Abstract to platform-specific adapters |
fetch (browser-specific) | Use cross-platform HTTP client |
// BAD - Will crash on React Native
const width = window.innerWidth;
// GOOD - Platform-safe
import { Platform, Dimensions } from 'react-native';
const width = Platform.OS === 'web'
? window.innerWidth
: Dimensions.get('window').width;
// Option 1: Primitive props
interface ButtonProps {
variant: 'primary' | 'secondary';
size: 'sm' | 'md' | 'lg';
}
// Option 2: Style prop
interface CardProps {
style?: ViewStyle | CSSProperties;
}
CRITICAL: Ensure correct exports configuration.
{
"name": "@company/shared",
"version": "1.0.0",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}
},
"files": ["dist"],
"sideEffects": false
}
| Version Bump | When to Use |
|---|---|
| Major (X.0.0) | Breaking changes |
| Minor (0.X.0) | New features (backwards compatible) |
| Patch (0.0.X) | Bug fixes (backwards compatible) |
1. Make changes to shared lib
↓
2. Run `npm run build`
↓
3. Link to consuming app:
- `npm link` (in shared lib)
- `npm link @company/shared` (in consuming app)
OR
- `yalc push` (in shared lib)
- `yalc add @company/shared` (in consuming app)
↓
4. Test in consuming app
↓
5. Bump version in package.json
↓
6. Commit and publish
packages/shared/
├── src/
│ ├── index.ts # Main exports
│ ├── components/
│ │ ├── Button.tsx
│ │ └── Card.tsx
│ ├── hooks/
│ │ ├── useAuth.ts
│ │ └── useFetch.ts
│ ├── utils/
│ │ ├── formatters.ts
│ │ └── validators.ts
│ └── types/
│ └── index.ts
├── dist/ # Built output (gitignored)
├── package.json
├── tsconfig.json
└── tsup.config.ts # Or rollup.config.js
docs/
└── METRICS/ # Self-learning system (see global-workflow skill)
├── README.md
├── config.json
├── runs/
├── feedback/
└── optimisations/
import { describe, it, expect } from 'vitest';
import { formatCurrency } from './formatters';
describe('formatCurrency', () => {
it('formats GBP correctly', () => {
expect(formatCurrency(1234.56, 'GBP')).toBe('£1,234.56');
});
it('handles zero', () => {
expect(formatCurrency(0, 'GBP')).toBe('£0.00');
});
});
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.