From reactlynx
Provides ReactLynx best practices for dual-thread architecture and React patterns, with rules reference for writing, static analysis for reviewing, and auto-fix for refactoring.
npx claudepluginhub lynx-community/skills --plugin reactlynxThis skill uses the workspace's default tool permissions.
ReactLynx best practices covering dual-thread architecture and React patterns. Provides rules reference for writing, static analysis for reviewing, and auto-fix for refactoring.
Reviews React components for architecture, hooks usage, React 19 patterns, state management, performance optimization, accessibility, and TypeScript. Use before merging PRs, after new features, or for validation.
Enforces React 18/19 patterns and anti-patterns for hooks discipline, component architecture, and state management. Corrects stale training data mistakes. Activates on react/react-dom detection.
Guides architectural refactoring for React apps covering component/state architecture, hook patterns, decomposition, coupling/cohesion, data flow, safety. For refactoring codebases, PR reviews, oversized components, module boundaries.
Share bugs, ideas, or general feedback.
ReactLynx best practices covering dual-thread architecture and React patterns. Provides rules reference for writing, static analysis for reviewing, and auto-fix for refactoring.
This skill should be used when:
This skill accepts the following inputs:
| Input | Required | Description |
|---|---|---|
sourceCode | No | The ReactLynx source code to analyze (string or file path) |
mode | No | Workflow mode: writing, review, or refactor. Auto-detected if not specified |
When mode is not explicitly provided, the skill will determine the appropriate mode based on context:
| Context | Auto-Selected Mode |
|---|---|
| User is asking for best practices or guidelines | writing |
| User wants to check/analyze existing code for issues | review |
| User wants to fix/refactor code with auto-fixes | refactor |
When writing new ReactLynx code, reference the rules in rules/*.md as best practice guidelines. See also the Rules section below for a summary of all available rules.
Use this mode when:
When reviewing code, do both:
scripts/index.mjs) to analyze source code for issuesrules/*.md explanations to generate a rule-aware reportUse this mode when:
Report requirements (must include):
workflow.reviewCode(sourceCode)ruleId from rules/<ruleId>.mdimpact, impactDescription)node -e "
import fs from 'fs';
import { ReactLynxWorkflow, formatScanReport } from '<path_to_skill>/scripts/index.mjs';
// <sourceCode>: string (source code) or file path
const input = '<sourceCode>';
const sourceCode = fs.existsSync(input) ? fs.readFileSync(input, 'utf-8') : input;
const workflow = new ReactLynxWorkflow('review');
const summary = workflow.reviewCode(sourceCode);
console.log(formatScanReport(summary));
"
When refactoring, generate a fix plan and ask the user before applying.
In this mode, output must include both script results and a rules-aware report.
Use this mode when:
Report requirements (must include):
fixableIssues, manualIssues, per-file changes)appliedFixes) and remaining manual issuesTOOL CALL: AskUserQuestion(
question: "🔧 Found {fixableIssues} auto-fixable issues. Would you like me to apply these fixes?",
options: ["Yes, apply fixes", "No, show me the issues first", "Skip auto-fix"]
)
node -e "
import fs from 'fs';
import { ReactLynxWorkflow, formatFixPlan } from '<path_to_skill>/scripts/index.mjs';
// <sourceCode>: string (source code) or file path
const input = '<sourceCode>';
const sourceCode = fs.existsSync(input) ? fs.readFileSync(input, 'utf-8') : input;
const workflow = new ReactLynxWorkflow('refactor');
workflow.reviewCode(sourceCode);
const plan = workflow.generateFixPlan();
if (plan && plan.fixableIssues > 0) {
console.log(formatFixPlan(plan));
// ASK USER: 'Would you like me to apply these auto-fixes?'
// If yes:
const { fixed, appliedFixes } = workflow.applyAutoFixes(sourceCode);
console.log('Fixed code:', fixed);
}
"
All rules are documented in the rules/ directory as Markdown files:
| Rule | Impact | Description |
|---|---|---|
| detect-background-only | CRITICAL | Native APIs in background contexts, use 'background only' directive |
| proper-event-handlers | MEDIUM | Correct event handler usage |
| main-thread-scripts-guide | MEDIUM | Main thread scripts guide |
| hoist-static-jsx | LOW | Performance optimization |
For complete type definitions:
TOOL CALL: Read(<path_to_skill>/scripts/index.d.ts)
function runSkill(source: string): Diagnostic[];
function runSkillWithFixes(source: string): DiagnosticWithFix[];
function analyzeBackgroundOnlyUsage(source: string): Diagnostic[];
function generateFixes(source: string, diagnostic: Diagnostic): Fix[];
function applyFix(source: string, fix: Fix): string;
function applyFixes(source: string, fixes: Fix[]): string;
function formatScanReport(summary: ScanSummary): string;
function formatFixPlan(plan: FixPlan): string;
class ReactLynxWorkflow {
constructor(mode: WorkflowMode);
reviewCode(source: string): ScanSummary;
generateFixPlan(): FixPlan | null;
applyAutoFixes(source: string): { fixed: string; appliedFixes: Fix[] };
}
type WorkflowMode = 'writing' | 'review' | 'refactor';
interface Diagnostic {
ruleId: string;
message: string;
severity: 'error' | 'warning' | 'info';
location: { start: { line: number; column: number }; end: { line: number; column: number } };
}
interface DiagnosticWithFix extends Diagnostic {
fixes?: Fix[];
}
interface Fix {
type: 'wrap-in-useEffect' | 'add-directive' | 'add-import' | 'move-to-event-handler';
description: string;
oldCode: string;
newCode: string;
location: { start: { line: number; column: number }; end: { line: number; column: number } };
}
interface ScanSummary {
totalFiles: number;
filesWithIssues: number;
totalIssues: number;
errorCount: number;
warningCount: number;
infoCount: number;
results: ScanResult[];
}
interface FixPlan {
totalIssues: number;
fixableIssues: number;
manualIssues: number;
files: FilePlan[];
}