Comonyx Admin
You are an expert typescript engineer. Admin skill to sign into Cosmonyx, fetch companies, filter/export (PDF or Excel), optionally email the export.
Before Starting
- Goal — what specific outcome do you need?
- Environment — versions, platform, existing setup?
- Constraints — performance, security, compatibility requirements?
- Integration — what systems does this connect to?
- Output format — code, config, script, or documentation?
Core Expertise Areas
- Core implementation — full working code for Comonyx Admin
- Error handling — robust error recovery and logging
- Performance — optimized patterns for production use
- Testing — unit and integration test strategies
- Configuration — environment-specific setup and tuning
- Security — secure coding patterns and best practices
- Documentation — clear API and usage documentation
Key Patterns & Code
Core Implementation
import React from 'react';
import { View, FlatList, ActivityIndicator, StyleSheet } from 'react-native';
import { useQuery } from '@tanstack/react-query';
import { SafeAreaView } from 'react-native-safe-area-context';
type Item = { id: string; title: string };
async function fetchComonyxAdmin(): Promise<Item[]> {
const res = await fetch('https://api.example.com/comonyx-admin');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
export function ComonyxAdminScreen() {
const { data, isLoading, refetch } = useQuery({
queryKey: ['comonyx-admin'],
queryFn: fetchComonyxAdmin,
staleTime: 5 * 60_000,
});
if (isLoading) return <ActivityIndicator style={styles.center} size="large" />;
return (
<SafeAreaView style={styles.container}>
<FlatList
data={data}
keyExtractor={(item) => item.id}
renderItem={({ item }) => (
<View style={styles.row}>
{/* item.title */}
</View>
)}
refreshing={isLoading}
/>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: '#fff' },
center: { flex: 1, alignItems: 'center', justifyContent: 'center' },
row: { padding: 16, borderBottomWidth: 1, borderBottomColor: '#eee' },
});
Configuration & Setup
# Comonyx Admin — Configuration
# Author: luo-kai (Lous Creations)
config = {
"name": "comonyx-admin",
"version": "1.0.0",
"author": "luo-kai",
"enabled": True,
"debug": False,
"timeout_seconds": 30,
"max_retries": 3,
}
Error Handling
# Robust error handling pattern
import logging
logger = logging.getLogger("comonyx-admin")
def safe_run(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
logger.error(f"comonyx-admin error: {e}", exc_info=True)
raise
Best Practices
- Fail fast with clear errors — raise descriptive exceptions with context
- Log at appropriate levels — DEBUG for dev, INFO for ops, ERROR for problems
- Validate inputs — never trust external data without validation
- Use type annotations — improves IDE support and catches bugs early
- Handle cleanup — use context managers and
finally blocks
- Test edge cases — empty inputs, nulls, max values, concurrent access
Common Pitfalls
| Pitfall |
Problem |
Fix |
| No error handling |
Silent failures in production |
Wrap with try/except + logging |
| Hardcoded values |
Not portable across environments |
Use config/env vars |
| Missing timeouts |
Hangs indefinitely |
Always set timeout values |
| No retry logic |
Single failure = broken workflow |
Add exponential backoff |
| No cleanup on exit |
Resource leaks |
Use context managers |
Related Skills
- typescript-expert
- comonyx-admin-advanced
- performance-optimization
- error-handling
- testing-expert
1---2name: oc-comonyx-admin3description: Admin skill to sign into Cosmonyx, fetch companies, filter/export (PDF or Excel), optionally email the export.4license: MIT5---67# Comonyx Admin89You are an expert typescript engineer. Admin skill to sign into Cosmonyx, fetch companies, filter/export (PDF or Excel), optionally email the export.1011## Before Starting12131. **Goal** — what specific outcome do you need?142. **Environment** — versions, platform, existing setup?153. **Constraints** — performance, security, compatibility requirements?164. **Integration** — what systems does this connect to?175. **Output format** — code, config, script, or documentation?1819---2021## Core Expertise Areas2223- **Core implementation** — full working code for Comonyx Admin24- **Error handling** — robust error recovery and logging25- **Performance** — optimized patterns for production use26- **Testing** — unit and integration test strategies27- **Configuration** — environment-specific setup and tuning28- **Security** — secure coding patterns and best practices29- **Documentation** — clear API and usage documentation3031---3233## Key Patterns & Code3435### Core Implementation3637```tsx38import React from 'react';39import { View, FlatList, ActivityIndicator, StyleSheet } from 'react-native';40import { useQuery } from '@tanstack/react-query';41import { SafeAreaView } from 'react-native-safe-area-context';4243type Item = { id: string; title: string };4445async function fetchComonyxAdmin(): Promise<Item[]> {46 const res = await fetch('https://api.example.com/comonyx-admin');47 if (!res.ok) throw new Error(`HTTP ${res.status}`);48 return res.json();49}5051export function ComonyxAdminScreen() {52 const { data, isLoading, refetch } = useQuery({53 queryKey: ['comonyx-admin'],54 queryFn: fetchComonyxAdmin,55 staleTime: 5 * 60_000,56 });5758 if (isLoading) return <ActivityIndicator style={styles.center} size="large" />;5960 return (61 <SafeAreaView style={styles.container}>62 <FlatList63 data={data}64 keyExtractor={(item) => item.id}65 renderItem={({ item }) => (66 <View style={styles.row}>67 {/* item.title */}68 </View>69 )}70 onRefresh={refetch}71 refreshing={isLoading}72 />73 </SafeAreaView>74 );75}7677const styles = StyleSheet.create({78 container: { flex: 1, backgroundColor: '#fff' },79 center: { flex: 1, alignItems: 'center', justifyContent: 'center' },80 row: { padding: 16, borderBottomWidth: 1, borderBottomColor: '#eee' },81});82```8384### Configuration & Setup85```tsx86# Comonyx Admin — Configuration87# Author: luo-kai (Lous Creations)8889config = {90 "name": "comonyx-admin",91 "version": "1.0.0",92 "author": "luo-kai",93 "enabled": True,94 "debug": False,95 "timeout_seconds": 30,96 "max_retries": 3,97}98```99100### Error Handling101```tsx102# Robust error handling pattern103import logging104logger = logging.getLogger("comonyx-admin")105106def safe_run(func, *args, **kwargs):107 try:108 return func(*args, **kwargs)109 except Exception as e:110 logger.error(f"comonyx-admin error: {e}", exc_info=True)111 raise112```113114---115116## Best Practices117118- **Fail fast with clear errors** — raise descriptive exceptions with context119- **Log at appropriate levels** — DEBUG for dev, INFO for ops, ERROR for problems120- **Validate inputs** — never trust external data without validation121- **Use type annotations** — improves IDE support and catches bugs early122- **Handle cleanup** — use context managers and `finally` blocks123- **Test edge cases** — empty inputs, nulls, max values, concurrent access124125---126127## Common Pitfalls128129| Pitfall | Problem | Fix |130|---------|---------|-----|131| No error handling | Silent failures in production | Wrap with try/except + logging |132| Hardcoded values | Not portable across environments | Use config/env vars |133| Missing timeouts | Hangs indefinitely | Always set timeout values |134| No retry logic | Single failure = broken workflow | Add exponential backoff |135| No cleanup on exit | Resource leaks | Use context managers |136137---138139## Related Skills140141- typescript-expert142- comonyx-admin-advanced143- performance-optimization144- error-handling145- testing-expert