@fenixforce/edition-pro 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/approval-routes.d.ts +15 -0
- package/dist/api/fleet-routes.d.ts +23 -0
- package/dist/api/integration-routes.d.ts +17 -0
- package/dist/api/middleware.d.ts +37 -0
- package/dist/boot.d.ts +37 -0
- package/dist/business/approval-queue.d.ts +94 -0
- package/dist/business/arena.d.ts +71 -0
- package/dist/business/best-of-n.d.ts +68 -0
- package/dist/business/brainstorm.d.ts +42 -0
- package/dist/business/compile-checker.d.ts +50 -0
- package/dist/business/debate.d.ts +38 -0
- package/dist/business/fleet-budget.d.ts +69 -0
- package/dist/business/fleet-config.d.ts +125 -0
- package/dist/business/fleet.d.ts +85 -0
- package/dist/business/handoff.d.ts +56 -0
- package/dist/business/hat-system.d.ts +57 -0
- package/dist/business/index.d.ts +44 -0
- package/dist/business/integration-registry.d.ts +66 -0
- package/dist/business/node-pipeline.d.ts +62 -0
- package/dist/business/oracle.d.ts +64 -0
- package/dist/business/roles/index.d.ts +7 -0
- package/dist/business/roles/judge.d.ts +24 -0
- package/dist/business/roles/planner.d.ts +30 -0
- package/dist/business/roles/types.d.ts +37 -0
- package/dist/business/roles/worker.d.ts +25 -0
- package/dist/business/router.d.ts +75 -0
- package/dist/business/shared-memory.d.ts +85 -0
- package/dist/business/status-detector.d.ts +52 -0
- package/dist/business/swarm-registry.d.ts +63 -0
- package/dist/business/templates.d.ts +55 -0
- package/dist/business/workspace-manager.d.ts +105 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +638 -0
- package/dist/infrastructure/pty-agent.d.ts +74 -0
- package/dist/migrations/migrate.d.ts +7 -0
- package/dist/migrations/runner.d.ts +49 -0
- package/dist/workspace/worktree.d.ts +69 -0
- package/package.json +37 -0
- package/skills/builtin/academic-researcher/SKILL.md +51 -0
- package/skills/builtin/advanced-recon/SKILL.md +75 -0
- package/skills/builtin/agent-governance/SKILL.md +122 -0
- package/skills/builtin/algorithmic-art/SKILL.md +55 -0
- package/skills/builtin/api-attack-surface-mapper/SKILL.md +88 -0
- package/skills/builtin/api-development/SKILL.md +147 -0
- package/skills/builtin/api-exploit-prover/SKILL.md +74 -0
- package/skills/builtin/api-integration/SKILL.md +73 -0
- package/skills/builtin/api-security-tester/SKILL.md +82 -0
- package/skills/builtin/api-test-executor/SKILL.md +62 -0
- package/skills/builtin/app-store-optimization/SKILL.md +46 -0
- package/skills/builtin/audio-tour-guide/SKILL.md +18 -0
- package/skills/builtin/auth-flow-operator/SKILL.md +70 -0
- package/skills/builtin/autonomous-rag/SKILL.md +21 -0
- package/skills/builtin/backend-development/SKILL.md +265 -0
- package/skills/builtin/binary-analysis-analyst/SKILL.md +61 -0
- package/skills/builtin/binary-analysis-core/SKILL.md +65 -0
- package/skills/builtin/binary-recon/SKILL.md +64 -0
- package/skills/builtin/blackboard-coordination/SKILL.md +56 -0
- package/skills/builtin/blog-to-podcast/SKILL.md +18 -0
- package/skills/builtin/blog-writing/SKILL.md +36 -0
- package/skills/builtin/brainstorming/SKILL.md +69 -0
- package/skills/builtin/brand-design/SKILL.md +42 -0
- package/skills/builtin/ci-cd-pipelines/SKILL.md +210 -0
- package/skills/builtin/cloud-infrastructure/SKILL.md +140 -0
- package/skills/builtin/code-review/SKILL.md +88 -0
- package/skills/builtin/code-review-analyst/SKILL.md +96 -0
- package/skills/builtin/code-review-recon/SKILL.md +64 -0
- package/skills/builtin/code-review-verifier/SKILL.md +55 -0
- package/skills/builtin/coding-agent-team/SKILL.md +13 -0
- package/skills/builtin/competitor-intelligence/SKILL.md +39 -0
- package/skills/builtin/content-engine/SKILL.md +82 -0
- package/skills/builtin/context7-docs/SKILL.md +145 -0
- package/skills/builtin/copywriting/SKILL.md +38 -0
- package/skills/builtin/corrective-rag/SKILL.md +19 -0
- package/skills/builtin/cost-optimization/SKILL.md +131 -0
- package/skills/builtin/crypto-vulnerability-analyst/SKILL.md +64 -0
- package/skills/builtin/customer-support/SKILL.md +48 -0
- package/skills/builtin/customer-voice-support/SKILL.md +43 -0
- package/skills/builtin/data-analysis/SKILL.md +57 -0
- package/skills/builtin/data-visualization/SKILL.md +33 -0
- package/skills/builtin/database-design/SKILL.md +119 -0
- package/skills/builtin/decision-helper/SKILL.md +84 -0
- package/skills/builtin/deep-research/SKILL.md +68 -0
- package/skills/builtin/deepwiki-research/SKILL.md +115 -0
- package/skills/builtin/dependency-audit/SKILL.md +46 -0
- package/skills/builtin/doc-coauthoring/SKILL.md +48 -0
- package/skills/builtin/docker-deployment/SKILL.md +243 -0
- package/skills/builtin/docx-generation/SKILL.md +135 -0
- package/skills/builtin/dry-run-harness/SKILL.md +61 -0
- package/skills/builtin/editor/SKILL.md +44 -0
- package/skills/builtin/email-drafter/SKILL.md +42 -0
- package/skills/builtin/error-handling/SKILL.md +82 -0
- package/skills/builtin/eval-harness/SKILL.md +197 -0
- package/skills/builtin/evaluation-framework/SKILL.md +51 -0
- package/skills/builtin/exploit-writer/SKILL.md +63 -0
- package/skills/builtin/fact-checker/SKILL.md +51 -0
- package/skills/builtin/filesystem-context/SKILL.md +47 -0
- package/skills/builtin/financial-coach/SKILL.md +18 -0
- package/skills/builtin/finding-chain-correlator/SKILL.md +70 -0
- package/skills/builtin/finding-verifier/SKILL.md +65 -0
- package/skills/builtin/frontend-design/SKILL.md +104 -0
- package/skills/builtin/frontend-development/SKILL.md +227 -0
- package/skills/builtin/frontend-slides/SKILL.md +155 -0
- package/skills/builtin/fullstack-project/SKILL.md +286 -0
- package/skills/builtin/game-development/SKILL.md +60 -0
- package/skills/builtin/git-workflow/SKILL.md +44 -0
- package/skills/builtin/i18n-localization/SKILL.md +38 -0
- package/skills/builtin/image-prompt-engineering/SKILL.md +37 -0
- package/skills/builtin/investment-research/SKILL.md +33 -0
- package/skills/builtin/investor-materials/SKILL.md +90 -0
- package/skills/builtin/javascript-surface-analyzer/SKILL.md +66 -0
- package/skills/builtin/markdown-reports/SKILL.md +68 -0
- package/skills/builtin/market-research/SKILL.md +69 -0
- package/skills/builtin/mcp-builder/SKILL.md +86 -0
- package/skills/builtin/meeting-notes/SKILL.md +47 -0
- package/skills/builtin/memory-safety-analyst/SKILL.md +61 -0
- package/skills/builtin/meta-controller/SKILL.md +44 -0
- package/skills/builtin/mixture-of-agents/SKILL.md +53 -0
- package/skills/builtin/monitoring-observability/SKILL.md +169 -0
- package/skills/builtin/negotiation-simulator/SKILL.md +24 -0
- package/skills/builtin/nestjs-development/SKILL.md +56 -0
- package/skills/builtin/nextjs-development/SKILL.md +55 -0
- package/skills/builtin/parallel-dispatch/SKILL.md +83 -0
- package/skills/builtin/pdf-generation/SKILL.md +169 -0
- package/skills/builtin/personal-finance/SKILL.md +17 -0
- package/skills/builtin/pev-workflow/SKILL.md +62 -0
- package/skills/builtin/planning-with-files/SKILL.md +59 -0
- package/skills/builtin/pptx-generation/SKILL.md +117 -0
- package/skills/builtin/prisma-orm/SKILL.md +48 -0
- package/skills/builtin/rag-database-routing/SKILL.md +38 -0
- package/skills/builtin/rapid-prototyping/SKILL.md +152 -0
- package/skills/builtin/react-development/SKILL.md +244 -0
- package/skills/builtin/react-native-mobile/SKILL.md +113 -0
- package/skills/builtin/refactoring/SKILL.md +39 -0
- package/skills/builtin/reflexive-metacognition/SKILL.md +29 -0
- package/skills/builtin/riper-workflow/SKILL.md +214 -0
- package/skills/builtin/security-audit/SKILL.md +113 -0
- package/skills/builtin/security-self-audit/SKILL.md +311 -0
- package/skills/builtin/self-evolving-agent/SKILL.md +28 -0
- package/skills/builtin/self-improvement-loop/SKILL.md +58 -0
- package/skills/builtin/semantic-search/SKILL.md +93 -0
- package/skills/builtin/seo-audit-team/SKILL.md +27 -0
- package/skills/builtin/seo-optimization/SKILL.md +49 -0
- package/skills/builtin/server-management/SKILL.md +190 -0
- package/skills/builtin/social-media-content/SKILL.md +50 -0
- package/skills/builtin/sprint-planner/SKILL.md +49 -0
- package/skills/builtin/strategic-compact/SKILL.md +61 -0
- package/skills/builtin/strategy-advisor/SKILL.md +51 -0
- package/skills/builtin/structured-thinking/SKILL.md +70 -0
- package/skills/builtin/subagent-development/SKILL.md +105 -0
- package/skills/builtin/system-design/SKILL.md +66 -0
- package/skills/builtin/systematic-debugging/SKILL.md +87 -0
- package/skills/builtin/tailwind-css/SKILL.md +55 -0
- package/skills/builtin/taint-flow-tracer/SKILL.md +89 -0
- package/skills/builtin/teaching-agent-team/SKILL.md +32 -0
- package/skills/builtin/tech-debt-manager/SKILL.md +67 -0
- package/skills/builtin/technical-documentation/SKILL.md +47 -0
- package/skills/builtin/test-driven-development/SKILL.md +70 -0
- package/skills/builtin/theme-factory/SKILL.md +244 -0
- package/skills/builtin/threat-model-generator/SKILL.md +105 -0
- package/skills/builtin/trust-layer/SKILL.md +43 -0
- package/skills/builtin/typescript-patterns/SKILL.md +61 -0
- package/skills/builtin/ui-ux-design/SKILL.md +75 -0
- package/skills/builtin/verification-before-completion/SKILL.md +41 -0
- package/skills/builtin/verification-loop/SKILL.md +120 -0
- package/skills/builtin/waf-bypass-agent/SKILL.md +97 -0
- package/skills/builtin/web-artifacts-builder/SKILL.md +117 -0
- package/skills/builtin/web-assessment-executor/SKILL.md +66 -0
- package/skills/builtin/web-exploit-prover/SKILL.md +58 -0
- package/skills/builtin/web-scraping/SKILL.md +63 -0
- package/skills/builtin/webapp-testing/SKILL.md +86 -0
- package/skills/builtin/webhook-development/SKILL.md +62 -0
- package/skills/builtin/writing-skills/SKILL.md +67 -0
- package/skills/builtin/xlsx-generation/SKILL.md +116 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-development
|
|
3
|
+
description: "Use this skill when the user asks to build React components, React applications, or anything using the React library. Triggers: 'React component', 'React app', 'useState', 'useEffect', 'hooks', 'JSX', 'TSX', 'React Router', 'state management', 'Redux', 'Zustand', or any request specifically mentioning React. Covers components, hooks, state management, performance, testing, and React ecosystem patterns."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# React Development
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Build production React components and applications. Functional components, hooks, state management, performance optimization, testing patterns. Based on 57 composition rules from Vercel's best practices plus React 19 patterns.
|
|
12
|
+
|
|
13
|
+
## Before You Start
|
|
14
|
+
|
|
15
|
+
1. **Context7:** ALWAYS fetch React docs before writing components. React's API changes between versions. Never guess at hook signatures or component APIs.
|
|
16
|
+
2. **Ask the user** about React version, state management preference, and styling approach if not specified
|
|
17
|
+
|
|
18
|
+
## Component Patterns
|
|
19
|
+
|
|
20
|
+
### Functional Components Only
|
|
21
|
+
```tsx
|
|
22
|
+
// Named export for components
|
|
23
|
+
export function UserCard({ name, email, avatar }: UserCardProps) {
|
|
24
|
+
return (
|
|
25
|
+
<article className="user-card">
|
|
26
|
+
<img src={avatar} alt={`${name}'s avatar`} />
|
|
27
|
+
<h3>{name}</h3>
|
|
28
|
+
<p>{email}</p>
|
|
29
|
+
</article>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Default export for page components
|
|
34
|
+
export default function UsersPage() {
|
|
35
|
+
return <main>...</main>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Props Interface
|
|
40
|
+
```tsx
|
|
41
|
+
interface UserCardProps {
|
|
42
|
+
name: string;
|
|
43
|
+
email: string;
|
|
44
|
+
avatar: string;
|
|
45
|
+
role?: "admin" | "user"; // Optional with union type
|
|
46
|
+
onEdit?: (id: string) => void; // Optional callback
|
|
47
|
+
children?: React.ReactNode; // Composable children
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Composition Over Configuration
|
|
52
|
+
```tsx
|
|
53
|
+
// Good: composable
|
|
54
|
+
<Card>
|
|
55
|
+
<Card.Header>Title</Card.Header>
|
|
56
|
+
<Card.Body>Content</Card.Body>
|
|
57
|
+
<Card.Footer>Actions</Card.Footer>
|
|
58
|
+
</Card>
|
|
59
|
+
|
|
60
|
+
// Avoid: prop-heavy monolith
|
|
61
|
+
<Card title="Title" body="Content" footer="Actions" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Hooks
|
|
65
|
+
|
|
66
|
+
### State
|
|
67
|
+
```tsx
|
|
68
|
+
const [items, setItems] = useState<Item[]>([]);
|
|
69
|
+
const [status, setStatus] = useState<"idle" | "loading" | "error">("idle");
|
|
70
|
+
|
|
71
|
+
// Functional updates for state that depends on previous value
|
|
72
|
+
setItems(prev => [...prev, newItem]);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Effects
|
|
76
|
+
```tsx
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const controller = new AbortController();
|
|
79
|
+
|
|
80
|
+
async function fetchData() {
|
|
81
|
+
setStatus("loading");
|
|
82
|
+
try {
|
|
83
|
+
const res = await fetch(`/api/items`, { signal: controller.signal });
|
|
84
|
+
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
85
|
+
const data = await res.json();
|
|
86
|
+
setItems(data);
|
|
87
|
+
setStatus("idle");
|
|
88
|
+
} catch (err) {
|
|
89
|
+
if (err instanceof Error && err.name !== "AbortError") {
|
|
90
|
+
setStatus("error");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
fetchData();
|
|
96
|
+
return () => controller.abort();
|
|
97
|
+
}, []); // Dependencies array: list every external value used inside
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Custom Hooks
|
|
101
|
+
```tsx
|
|
102
|
+
function useAsync<T>(asyncFn: () => Promise<T>, deps: unknown[] = []) {
|
|
103
|
+
const [data, setData] = useState<T | null>(null);
|
|
104
|
+
const [error, setError] = useState<Error | null>(null);
|
|
105
|
+
const [loading, setLoading] = useState(true);
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
setLoading(true);
|
|
109
|
+
asyncFn()
|
|
110
|
+
.then(setData)
|
|
111
|
+
.catch(setError)
|
|
112
|
+
.finally(() => setLoading(false));
|
|
113
|
+
}, deps);
|
|
114
|
+
|
|
115
|
+
return { data, error, loading };
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## State Management
|
|
120
|
+
|
|
121
|
+
### Local State (useState)
|
|
122
|
+
Use for: component-specific UI state, form inputs, toggles, modals
|
|
123
|
+
|
|
124
|
+
### Lifted State
|
|
125
|
+
Use for: state shared between 2-3 sibling components. Lift to nearest common parent.
|
|
126
|
+
|
|
127
|
+
### Context
|
|
128
|
+
Use for: theme, auth, locale. Rarely for frequently-changing data (causes re-renders).
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
const AuthContext = createContext<AuthState | null>(null);
|
|
132
|
+
|
|
133
|
+
export function useAuth() {
|
|
134
|
+
const ctx = useContext(AuthContext);
|
|
135
|
+
if (!ctx) throw new Error("useAuth must be used within AuthProvider");
|
|
136
|
+
return ctx;
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### External Store (Zustand, Jotai)
|
|
141
|
+
Use for: complex global state, cross-component data sharing, state that changes often.
|
|
142
|
+
Fetch Context7 docs for the chosen library before implementing.
|
|
143
|
+
|
|
144
|
+
## Performance
|
|
145
|
+
|
|
146
|
+
### Memoization (use sparingly)
|
|
147
|
+
```tsx
|
|
148
|
+
// Only memoize expensive computations
|
|
149
|
+
const sortedItems = useMemo(
|
|
150
|
+
() => items.sort((a, b) => a.name.localeCompare(b.name)),
|
|
151
|
+
[items]
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
// Only memoize callbacks passed to memoized children
|
|
155
|
+
const handleClick = useCallback((id: string) => {
|
|
156
|
+
setSelected(id);
|
|
157
|
+
}, []);
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Code Splitting
|
|
161
|
+
```tsx
|
|
162
|
+
const AdminPanel = lazy(() => import("./AdminPanel"));
|
|
163
|
+
|
|
164
|
+
function App() {
|
|
165
|
+
return (
|
|
166
|
+
<Suspense fallback={<Spinner />}>
|
|
167
|
+
<AdminPanel />
|
|
168
|
+
</Suspense>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### List Rendering
|
|
174
|
+
```tsx
|
|
175
|
+
// Always use stable, unique keys (never array index for dynamic lists)
|
|
176
|
+
{items.map(item => (
|
|
177
|
+
<ListItem key={item.id} item={item} />
|
|
178
|
+
))}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Error Boundaries
|
|
182
|
+
```tsx
|
|
183
|
+
class ErrorBoundary extends React.Component<
|
|
184
|
+
{ children: React.ReactNode; fallback: React.ReactNode },
|
|
185
|
+
{ hasError: boolean }
|
|
186
|
+
> {
|
|
187
|
+
state = { hasError: false };
|
|
188
|
+
|
|
189
|
+
static getDerivedStateFromError() {
|
|
190
|
+
return { hasError: true };
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
componentDidCatch(error: Error, info: React.ErrorInfo) {
|
|
194
|
+
console.error("Caught by boundary:", error, info);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
render() {
|
|
198
|
+
if (this.state.hasError) return this.props.fallback;
|
|
199
|
+
return this.props.children;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## Rules
|
|
205
|
+
|
|
206
|
+
- Functional components only. No class components except ErrorBoundary.
|
|
207
|
+
- TypeScript interfaces for all props. No `any` types.
|
|
208
|
+
- Every effect must have a cleanup function if it creates subscriptions, timers, or fetch requests
|
|
209
|
+
- Dependencies arrays must be complete and accurate. Never suppress the linter.
|
|
210
|
+
- Keys must be stable and unique. Never use array index for dynamic lists.
|
|
211
|
+
- Avoid premature memoization. Measure before optimizing.
|
|
212
|
+
- Forms: use controlled components with validation on submit
|
|
213
|
+
- Never mutate state directly. Always create new references.
|
|
214
|
+
- Collocate state as close to where it's used as possible
|
|
215
|
+
|
|
216
|
+
## Verification
|
|
217
|
+
|
|
218
|
+
Before marking complete:
|
|
219
|
+
1. Components render without console errors or warnings
|
|
220
|
+
2. No missing key warnings in lists
|
|
221
|
+
3. No "missing dependency" warnings in effects
|
|
222
|
+
4. Loading, error, and empty states all handled
|
|
223
|
+
5. TypeScript compiles with no errors in strict mode
|
|
224
|
+
6. Keyboard navigation works for interactive elements
|
|
225
|
+
|
|
226
|
+
## Integration with Other Skills
|
|
227
|
+
|
|
228
|
+
- **context7-docs:** MANDATORY. Always fetch React docs before writing components
|
|
229
|
+
- **frontend-development:** For non-React web projects
|
|
230
|
+
- **frontend-design:** For visual design direction
|
|
231
|
+
- **fullstack-project:** When building a complete React application
|
|
232
|
+
|
|
233
|
+
## Semantic Search Before Editing (Cursor 2.0 pattern)
|
|
234
|
+
|
|
235
|
+
Before creating any new component, hook, or utility:
|
|
236
|
+
1. Search existing codebase for similar patterns
|
|
237
|
+
2. If something similar exists, extend or compose with it
|
|
238
|
+
3. Never duplicate code that exists elsewhere
|
|
239
|
+
|
|
240
|
+
Read multiple files simultaneously for context gathering. Serialize only when one file determines which others to read.
|
|
241
|
+
|
|
242
|
+
## Minimal Edits
|
|
243
|
+
|
|
244
|
+
Touch only files that need to change. Within those files, change only lines that need to change. Never rewrite surrounding working code. Never change formatting of untouched code.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-native-mobile
|
|
3
|
+
description: "Use this skill when the user asks to build a mobile app, iOS app, Android app, or cross-platform mobile application using React Native or Expo. Triggers: 'mobile app', 'iOS app', 'Android app', 'React Native', 'Expo', 'cross-platform', 'phone app', or any request for a native mobile experience."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# React Native Mobile Development
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Build cross-platform mobile applications with React Native and Expo. iOS and Android from a single TypeScript codebase. Navigation, platform APIs, offline support, app store deployment.
|
|
12
|
+
|
|
13
|
+
## Before You Start
|
|
14
|
+
|
|
15
|
+
1. **Context7:** ALWAYS fetch React Native and Expo docs. The API surface changes frequently.
|
|
16
|
+
2. **DeepWiki:** Research any native module libraries before installing
|
|
17
|
+
3. Default to **Expo** (managed workflow) unless the user needs custom native modules
|
|
18
|
+
|
|
19
|
+
## Project Setup
|
|
20
|
+
|
|
21
|
+
### Expo (Recommended)
|
|
22
|
+
```bash
|
|
23
|
+
npx create-expo-app@latest my-app --template blank-typescript
|
|
24
|
+
cd my-app
|
|
25
|
+
npx expo start
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Project Structure (Expo)
|
|
29
|
+
```
|
|
30
|
+
my-app/
|
|
31
|
+
├── app/ # Expo Router file-based routing
|
|
32
|
+
│ ├── (tabs)/
|
|
33
|
+
│ │ ├── index.tsx
|
|
34
|
+
│ │ ├── explore.tsx
|
|
35
|
+
│ │ └── _layout.tsx
|
|
36
|
+
│ ├── _layout.tsx
|
|
37
|
+
│ └── +not-found.tsx
|
|
38
|
+
├── components/
|
|
39
|
+
├── hooks/
|
|
40
|
+
├── lib/
|
|
41
|
+
├── assets/
|
|
42
|
+
├── constants/
|
|
43
|
+
└── app.json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Core Patterns
|
|
47
|
+
|
|
48
|
+
### Components
|
|
49
|
+
```tsx
|
|
50
|
+
import { View, Text, Pressable, StyleSheet } from "react-native";
|
|
51
|
+
|
|
52
|
+
export function Card({ title, onPress }: CardProps) {
|
|
53
|
+
return (
|
|
54
|
+
<Pressable onPress={onPress} style={styles.card}>
|
|
55
|
+
<Text style={styles.title}>{title}</Text>
|
|
56
|
+
</Pressable>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const styles = StyleSheet.create({
|
|
61
|
+
card: {
|
|
62
|
+
backgroundColor: "#fff",
|
|
63
|
+
borderRadius: 12,
|
|
64
|
+
padding: 16,
|
|
65
|
+
shadowColor: "#000",
|
|
66
|
+
shadowOffset: { width: 0, height: 2 },
|
|
67
|
+
shadowOpacity: 0.1,
|
|
68
|
+
shadowRadius: 4,
|
|
69
|
+
elevation: 3,
|
|
70
|
+
},
|
|
71
|
+
title: { fontSize: 18, fontWeight: "600" },
|
|
72
|
+
});
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Platform-Specific Code
|
|
76
|
+
```tsx
|
|
77
|
+
import { Platform } from "react-native";
|
|
78
|
+
const padding = Platform.OS === "ios" ? 44 : 24;
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Safe Areas
|
|
82
|
+
```tsx
|
|
83
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
84
|
+
export default function Screen() {
|
|
85
|
+
return (
|
|
86
|
+
<SafeAreaView style={{ flex: 1 }}>
|
|
87
|
+
{/* Content respects notch, status bar, home indicator */}
|
|
88
|
+
</SafeAreaView>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Async Storage (offline data)
|
|
94
|
+
```tsx
|
|
95
|
+
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
96
|
+
await AsyncStorage.setItem("user", JSON.stringify(userData));
|
|
97
|
+
const stored = await AsyncStorage.getItem("user");
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Rules
|
|
101
|
+
|
|
102
|
+
- Use `StyleSheet.create()` over inline styles (performance)
|
|
103
|
+
- Always wrap screens in `SafeAreaView`
|
|
104
|
+
- Handle both iOS and Android in every component
|
|
105
|
+
- Test on both platforms before marking complete
|
|
106
|
+
- Use `FlatList` for long lists, never `ScrollView` with `.map()`
|
|
107
|
+
- Fetch Context7 docs for EVERY third-party library before using it
|
|
108
|
+
|
|
109
|
+
## Integration with Other Skills
|
|
110
|
+
|
|
111
|
+
- **context7-docs:** MANDATORY for React Native and Expo APIs
|
|
112
|
+
- **react-development:** Shares React patterns but mobile has different primitives
|
|
113
|
+
- **backend-development:** For the API the mobile app consumes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactoring
|
|
3
|
+
description: "Use this skill when the user asks to refactor code, clean up code, reduce duplication, improve types, or restructure existing code without changing behavior. Triggers: 'refactor', 'clean up', 'restructure', 'simplify', 'reduce duplication', 'improve readability', 'extract function', or requests to make code better without adding features."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Refactoring
|
|
8
|
+
|
|
9
|
+
## What This Skill Does
|
|
10
|
+
|
|
11
|
+
Improve code structure without changing behavior. Extract functions, rename, remove duplication, improve types, simplify logic.
|
|
12
|
+
|
|
13
|
+
## Common Refactorings
|
|
14
|
+
|
|
15
|
+
### Extract Function
|
|
16
|
+
When a block of code has a clear purpose, extract it into a named function.
|
|
17
|
+
|
|
18
|
+
### Rename
|
|
19
|
+
When a name doesn't describe what the thing does. Variables, functions, types, files.
|
|
20
|
+
|
|
21
|
+
### Remove Duplication
|
|
22
|
+
When the same logic appears in 2+ places. Extract into a shared function, utility, or module.
|
|
23
|
+
|
|
24
|
+
### Simplify Conditionals
|
|
25
|
+
Replace nested if/else with early returns, guard clauses, or lookup tables.
|
|
26
|
+
|
|
27
|
+
### Improve Types
|
|
28
|
+
Replace `any` with specific types. Add discriminated unions for state. Use branded types for IDs.
|
|
29
|
+
|
|
30
|
+
### Extract Constant
|
|
31
|
+
When magic numbers or strings appear in code. Name them.
|
|
32
|
+
|
|
33
|
+
## Rules
|
|
34
|
+
|
|
35
|
+
- Refactoring changes structure, never behavior
|
|
36
|
+
- Run tests before AND after refactoring. Both must pass.
|
|
37
|
+
- One refactoring per commit for easy review and rollback
|
|
38
|
+
- If there are no tests, write tests first BEFORE refactoring
|
|
39
|
+
- Small, incremental changes. Never rewrite entire files in one step.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Reflexive Metacognition
|
|
2
|
+
## Self-Assessment Before Action
|
|
3
|
+
Before choosing a strategy for any non-trivial task:
|
|
4
|
+
|
|
5
|
+
### 1. Confidence Assessment
|
|
6
|
+
Rate confidence 1-10 on the specific topic:
|
|
7
|
+
- **1-3 (Low)**: research first. Use DeepWiki, Context7, web search before responding.
|
|
8
|
+
- **4-6 (Medium)**: proceed but flag uncertainties explicitly. "I believe X, but I'm not certain about Y."
|
|
9
|
+
- **7-9 (High)**: proceed with full recommendation.
|
|
10
|
+
- **10**: be suspicious. Overconfidence is the most dangerous bias.
|
|
11
|
+
|
|
12
|
+
### 2. Capability Boundary Check
|
|
13
|
+
Can this task be completed with available tools and knowledge?
|
|
14
|
+
- If YES: proceed
|
|
15
|
+
- If PARTIALLY: complete what's possible, clearly state what's beyond capability
|
|
16
|
+
- If NO: say so immediately rather than producing low-quality output
|
|
17
|
+
|
|
18
|
+
### 3. Strategy Selection
|
|
19
|
+
Based on assessment:
|
|
20
|
+
- Low confidence + high stakes → research extensively before responding
|
|
21
|
+
- Low confidence + low stakes → best-effort with clear caveats
|
|
22
|
+
- High confidence + high stakes → proceed carefully with verification
|
|
23
|
+
- High confidence + low stakes → proceed directly
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
- State confidence level explicitly when it's below 7
|
|
27
|
+
- Never fake confidence to appear helpful
|
|
28
|
+
- "I don't know" with a research plan beats a hallucinated answer
|
|
29
|
+
- Re-assess confidence when new information arrives mid-task
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# RIPER Workflow — Structured Development Phases
|
|
2
|
+
|
|
3
|
+
## Trigger
|
|
4
|
+
Activate when: user mentions "RIPER", "research-innovate-plan-execute-review", "structured workflow", "phased development", or begins a complex multi-step implementation task.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
RIPER enforces five sequential phases with strict tool access boundaries and an approval gate between planning and execution. Each phase produces artifacts in the memory bank at `{workspace}/.riper/{branch}/`.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Phase 1: RESEARCH (read-only)
|
|
12
|
+
|
|
13
|
+
**Goal:** Investigate the codebase, problem domain, and constraints.
|
|
14
|
+
|
|
15
|
+
**Tool Access:** Read-only. File reads, grep, glob, web search. NO file writes, NO bash mutations.
|
|
16
|
+
|
|
17
|
+
**Instructions:**
|
|
18
|
+
- Read all relevant source files, documentation, and dependencies
|
|
19
|
+
- Identify existing patterns, conventions, and constraints
|
|
20
|
+
- Document findings in structured format
|
|
21
|
+
- Do NOT propose solutions yet — pure investigation
|
|
22
|
+
|
|
23
|
+
**Output:** Write findings to `{workspace}/.riper/research.md`:
|
|
24
|
+
```
|
|
25
|
+
## Research Findings
|
|
26
|
+
### Codebase Analysis
|
|
27
|
+
[files examined, patterns identified, dependencies mapped]
|
|
28
|
+
### Constraints
|
|
29
|
+
[technical constraints, compatibility requirements, performance bounds]
|
|
30
|
+
### Open Questions
|
|
31
|
+
[anything unclear that needs resolution]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Transition:** Announce "RESEARCH COMPLETE" and summarize key findings before moving to INNOVATE.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Phase 2: INNOVATE (read-only)
|
|
39
|
+
|
|
40
|
+
**Goal:** Brainstorm approaches and explore design options. Build on research findings.
|
|
41
|
+
|
|
42
|
+
**Tool Access:** Read-only. Same as RESEARCH. NO implementation, NO file writes to source code.
|
|
43
|
+
|
|
44
|
+
**Instructions:**
|
|
45
|
+
- Reference research findings explicitly
|
|
46
|
+
- Generate 2-4 distinct approaches with trade-off analysis
|
|
47
|
+
- Consider edge cases, failure modes, and maintenance burden
|
|
48
|
+
- Score each approach on: complexity, risk, maintainability, performance
|
|
49
|
+
- Do NOT pick a winner yet — present options neutrally
|
|
50
|
+
|
|
51
|
+
**Output:** Write options to `{workspace}/.riper/options.md`:
|
|
52
|
+
```
|
|
53
|
+
## Design Options
|
|
54
|
+
|
|
55
|
+
### Option A: [Name]
|
|
56
|
+
**Approach:** [description]
|
|
57
|
+
**Pros:** [benefits]
|
|
58
|
+
**Cons:** [drawbacks]
|
|
59
|
+
**Risk:** low/medium/high
|
|
60
|
+
**Effort:** [estimate]
|
|
61
|
+
|
|
62
|
+
### Option B: [Name]
|
|
63
|
+
...
|
|
64
|
+
|
|
65
|
+
### Recommendation
|
|
66
|
+
[brief recommendation with reasoning]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Transition:** Announce "INNOVATION COMPLETE" and present the recommendation.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Phase 3: PLAN (limited write)
|
|
74
|
+
|
|
75
|
+
**Goal:** Create a detailed technical specification and numbered implementation steps.
|
|
76
|
+
|
|
77
|
+
**Tool Access:** LIMITED WRITE. Can ONLY write to `{workspace}/.riper/plan.md`. Source code is completely off-limits.
|
|
78
|
+
|
|
79
|
+
**Instructions:**
|
|
80
|
+
- Select the approved approach from INNOVATE phase
|
|
81
|
+
- Break implementation into numbered, atomic steps
|
|
82
|
+
- Each step must have acceptance criteria
|
|
83
|
+
- Include rollback strategy for each step
|
|
84
|
+
- Identify which files will be modified/created
|
|
85
|
+
- Estimate scope (lines changed, files touched)
|
|
86
|
+
|
|
87
|
+
**Output:** Write plan to `{workspace}/.riper/plan.md`:
|
|
88
|
+
```
|
|
89
|
+
## Implementation Plan
|
|
90
|
+
|
|
91
|
+
**Selected Approach:** [Option name from INNOVATE]
|
|
92
|
+
**Estimated Scope:** [N files, ~M lines]
|
|
93
|
+
|
|
94
|
+
### Step 1: [Title]
|
|
95
|
+
**Files:** [file paths]
|
|
96
|
+
**Changes:** [what will be modified]
|
|
97
|
+
**Acceptance:** [how to verify this step is correct]
|
|
98
|
+
**Rollback:** [how to undo if needed]
|
|
99
|
+
|
|
100
|
+
### Step 2: [Title]
|
|
101
|
+
...
|
|
102
|
+
|
|
103
|
+
### Verification Plan
|
|
104
|
+
[how to verify the complete implementation]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Transition:** Announce "PLAN COMPLETE" and present full plan for approval.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Phase 4: APPROVAL GATE
|
|
112
|
+
|
|
113
|
+
**HARD STOP.** Do NOT proceed without explicit human approval.
|
|
114
|
+
|
|
115
|
+
**Actions:**
|
|
116
|
+
1. Present the complete plan from `{workspace}/.riper/plan.md`
|
|
117
|
+
2. Highlight any risks or assumptions
|
|
118
|
+
3. Ask: "Approve this plan to proceed to EXECUTE? (yes/no/revise)"
|
|
119
|
+
4. Emit `approval:requested` event with plan contents
|
|
120
|
+
|
|
121
|
+
**If "revise":** Return to PLAN phase with feedback.
|
|
122
|
+
**If "no":** Return to INNOVATE phase to explore alternatives.
|
|
123
|
+
**If "yes":** Proceed to EXECUTE.
|
|
124
|
+
|
|
125
|
+
**CRITICAL:** The loop does NOT auto-advance past this gate. Autonomous mode pauses here.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Phase 5: EXECUTE (full write)
|
|
130
|
+
|
|
131
|
+
**Goal:** Implement exactly what was approved in the plan. No improvisation.
|
|
132
|
+
|
|
133
|
+
**Tool Access:** FULL. All tools available — file writes, bash, git, etc.
|
|
134
|
+
|
|
135
|
+
**Instructions:**
|
|
136
|
+
- Execute plan steps sequentially (Step 1, then Step 2, etc.)
|
|
137
|
+
- Reference the plan step number before each change: "Executing Step N: [title]"
|
|
138
|
+
- If a step reveals the plan is insufficient, STOP and return to PLAN phase
|
|
139
|
+
- Do NOT add features not in the plan
|
|
140
|
+
- Do NOT refactor code not specified in the plan
|
|
141
|
+
- Commit after each logical unit of work
|
|
142
|
+
- Deviation from plan = re-enter PLAN phase (not improvise mid-Execute)
|
|
143
|
+
|
|
144
|
+
**Output:** Implementation in source code + commit history.
|
|
145
|
+
|
|
146
|
+
**Transition:** Announce "EXECUTION COMPLETE" and list all changes made.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Phase 6: REVIEW (read + test)
|
|
151
|
+
|
|
152
|
+
**Goal:** Validate implementation against the plan acceptance criteria.
|
|
153
|
+
|
|
154
|
+
**Tool Access:** Read + bash (for running tests). NO source code writes.
|
|
155
|
+
|
|
156
|
+
**Instructions:**
|
|
157
|
+
- Walk through each plan step's acceptance criteria
|
|
158
|
+
- Run all relevant tests and quality checks
|
|
159
|
+
- Compare actual vs. expected for each criterion
|
|
160
|
+
- Note any deviations, even minor ones
|
|
161
|
+
- Run backpressure checks (tests, lint, type check) if configured
|
|
162
|
+
|
|
163
|
+
**Output:** Write review to `{workspace}/.riper/review.md`:
|
|
164
|
+
```
|
|
165
|
+
## Implementation Review
|
|
166
|
+
|
|
167
|
+
### Step 1: [Title]
|
|
168
|
+
**Status:** PASS / FAIL / PARTIAL
|
|
169
|
+
**Expected:** [acceptance criteria from plan]
|
|
170
|
+
**Actual:** [what was observed]
|
|
171
|
+
**Notes:** [any deviations]
|
|
172
|
+
|
|
173
|
+
### Step 2: [Title]
|
|
174
|
+
...
|
|
175
|
+
|
|
176
|
+
### Overall Assessment
|
|
177
|
+
**Tests:** [pass/fail count]
|
|
178
|
+
**Type Check:** PASS/FAIL
|
|
179
|
+
**Lint:** PASS/FAIL
|
|
180
|
+
**Plan Adherence:** [percentage of steps fully matching plan]
|
|
181
|
+
|
|
182
|
+
### Issues Found
|
|
183
|
+
[list any problems discovered]
|
|
184
|
+
|
|
185
|
+
### Recommendation
|
|
186
|
+
[APPROVE / NEEDS REWORK with specific items]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**If NEEDS REWORK:** Return to EXECUTE with specific fix list.
|
|
190
|
+
**If APPROVE:** Workflow complete.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Memory Bank
|
|
195
|
+
|
|
196
|
+
All artifacts are stored at `{workspace}/.riper/{branch}/`:
|
|
197
|
+
- `research.md` — Phase 1 findings
|
|
198
|
+
- `options.md` — Phase 2 design options
|
|
199
|
+
- `plan.md` — Phase 3 implementation plan
|
|
200
|
+
- `review.md` — Phase 6 review report
|
|
201
|
+
|
|
202
|
+
**Branch awareness:** Each git branch gets its own memory bank directory. Switching branches switches the active memory bank.
|
|
203
|
+
|
|
204
|
+
**Backup:** Before overwriting any memory bank file, copy the previous version to `{filename}.backup.md`.
|
|
205
|
+
|
|
206
|
+
## Tool Restrictions Summary
|
|
207
|
+
|
|
208
|
+
| Phase | Read Files | Write Source | Write .riper/ | Bash (tests) | Git |
|
|
209
|
+
|-----------|-----------|-------------|---------------|-------------|-----|
|
|
210
|
+
| RESEARCH | YES | NO | YES | NO | NO |
|
|
211
|
+
| INNOVATE | YES | NO | YES | NO | NO |
|
|
212
|
+
| PLAN | YES | NO | YES | NO | NO |
|
|
213
|
+
| EXECUTE | YES | YES | YES | YES | YES |
|
|
214
|
+
| REVIEW | YES | NO | YES | YES | NO |
|