kirti/reactforge-demo/react-node-automation

Claude Code and agent skill by kirti/reactforge-demo

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Comprehensive automation suite for React/Node projects including TypeScript validation, unused code detection, performance optimization, accessibility checks, and commit automation

Install

npx vskill@latest install kirti/reactforge-demo/react-node-automation

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as kirti/reactforge-demo/react-node-automation.

React + Node Comprehensive Automation

When to Use This Skill

  • Automating code quality checks
  • Ensuring TypeScript/PropTypes accuracy
  • Detecting and removing dead code
  • Optimizing component performance
  • Enforcing accessibility standards
  • Automating commit workflows
  • Comprehensive project maintenance

This skill combines multiple automation capabilities into a unified workflow.


1. Automatic PropType/TypeScript Validation

Auto-Generate PropTypes from Usage
javascript
// scripts/generate-proptypes.js
import fs from 'fs';
import { parse } from '@babel/parser';
import traverse from '@babel/traverse';
class PropTypeGenerator {
constructor() {
this.components = new Map();
}
async analyzeComponent(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const ast = parse(content, {
sourceType: 'module',
plugins: ['jsx', 'typescript']
});
const propUsages = new Set();
traverse(ast, {
// Find function components
FunctionDeclaration(path) {
const params = path.node.params;
if (params.length > 0 && params[0].type === 'ObjectPattern') {
// Extract destructured props
params[0].properties.forEach(prop => {
if (prop.key) {
propUsages.add(prop.key.name);
}
});
}
},
// Find props accessed as props.something
MemberExpression(path) {
if (path.node.object.name === 'props') {
propUsages.add(path.node.property.name);
}
}
});
return this.inferPropTypes(propUsages, ast);
}
inferPropTypes(propNames, ast) {
const propTypes = {};
propNames.forEach(propName => {
// Infer type from usage
const type = this.inferType(propName, ast);
propTypes[propName] = type;
});
return propTypes;
}
inferType(propName, ast) {
let inferredType = 'any';
traverse(ast, {
// Check how prop is used
MemberExpression(path) {
if (path.node.property.name === propName) {
const parent = path.parent;
// If used as function: propName()
if (parent.type === 'CallExpression') {
inferredType = 'func';
}
// If used with .map(): propName.map()
if (parent.type === 'MemberExpression' &&
parent.property.name === 'map') {
inferredType = 'arrayOf(any)';
}
// If used with .length
if (parent.type === 'MemberExpression' &&
parent.property.name === 'length') {
inferredType = 'string or array';
}
}
},
// Check default values
AssignmentPattern(path) {
if (path.node.left.name === propName) {
const defaultValue = path.node.right;
if (defaultValue.type === 'StringLiteral') {
inferredType = 'string';
} else if (defaultValue.type === 'NumericLiteral') {
inferredType = 'number';
} else if (defaultValue.type === 'BooleanLiteral') {
inferredType = 'bool';
} else if (defaultValue.type === 'ArrayExpression') {
inferredType = 'array';
} else if (defaultValue.type === 'ObjectExpression') {
inferredType = 'object';
}
}
}
});
return inferredType;
}
generatePropTypesCode(propTypes) {
const imports = `import PropTypes from 'prop-types';\n\n`;
const propTypesObj = Object.entries(propTypes)
.map(([name, type]) => ` ${name}: PropTypes.${type}`)
.join(',\n');
return `${imports}ComponentName.propTypes = {\n${propTypesObj}\n};\n`;
}
}
// Usage
const generator = new PropTypeGenerator();
const propTypes = await generator.analyzeComponent('./src/Button.jsx');
const code = generator.generatePropTypesCode(propTypes);
console.log('Generated PropTypes:\n');
console.log(code);
Auto-Generate TypeScript Interfaces
typescript
// scripts/generate-typescript-interfaces.ts
import fs from 'fs';
import * as ts from 'typescript';
class TypeScriptGenerator {
analyzeComponent(filePath: string): Record<string, string> {
const content = fs.readFileSync(filePath, 'utf8');
const sourceFile = ts.createSourceFile(
filePath,
content,
ts.ScriptTarget.Latest,
true
);
const propTypes: Record<string, string> = {};
const visit = (node: ts.Node) => {
// Find function components
if (ts.isFunctionDeclaration(node) ||
ts.isArrowFunction(node)) {
node.parameters.forEach(param => {
if (ts.isObjectBindingPattern(param.name)) {
param.name.elements.forEach(element => {
const name = element.name.getText();
const type = this.inferTypeFromUsage(name, sourceFile);
propTypes[name] = type;
});
}
});
}
ts.forEachChild(node, visit);
};
visit(sourceFile);
return propTypes;
}
inferTypeFromUsage(propName: string, sourceFile: ts.SourceFile): string {
// Simplified type inference
return 'string'; // Would be more sophisticated in production
}
generateInterface(componentName: string, props: Record<string, string>): string {
const propsString = Object.entries(props)
.map(([name, type]) => ` ${name}: ${type};`)
.join('\n');
return `
interface ${componentName}Props {
${propsString}
}
const ${componentName}: React.FC<${componentName}Props> = ({ ${Object.keys(props).join(', ')} }) => {
// Component implementation
};
`;
}
}

2. Unused Code Detection

Detect Unused Imports
javascript
// scripts/detect-unused-imports.js
import fs from 'fs';
import { parse } from '@babel/parser';
import traverse from '@babel/traverse';
class UnusedImportDetector {
detectUnused(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const ast = parse(content, {
sourceType: 'module',
plugins: ['jsx', 'typescript']
});
const imports = new Set();
const used = new Set();
// Collect all imports
traverse(ast, {
ImportDeclaration(path) {
path.node.specifiers.forEach(spec => {
if (spec.local) {
imports.add(spec.local.name);
}
});
}
});
// Collect all usages
traverse(ast, {
Identifier(path) {
// Skip import declarations themselves
if (path.parent.type !== 'ImportSpecifier' &&
path.parent.type !== 'ImportDefaultSpecifier') {
used.add(path.node.name);
}
}
});
// Find unused
const unused = Array.from(imports).filter(name => !used.has(name));
return {
file: filePath,
totalImports: imports.size,
unusedImports: unused
};
}
async scanProject(dir) {
const files = this.getAllJSFiles(dir);
const results = [];
files.forEach(file => {
const result = this.detectUnused(file);
if (result.unusedImports.length > 0) {
results.push(result);
}
});
return results;
}
getAllJSFiles(dir) {
// Implementation similar to previous examples
return [];
}
async removeUnusedImports(filePath, unused) {
const content = fs.readFileSync(filePath, 'utf8');
let updated = content;
unused.forEach(name => {
// Remove import statement
const importRegex = new RegExp(
`import\\s+{[^}]*\\b${name}\\b[^}]*}\\s+from\\s+['"]['"];?\\s*`,
'g'
);
updated = updated.replace(importRegex, '');
});
fs.writeFileSync(filePath, updated);
}
}
// Usage
const detector = new UnusedImportDetector();
const results = await detector.scanProject('./src');
console.log('📊 Unused Imports Report\n');
results.forEach(result => {
console.log(`📄 ${result.file}`);
console.log(` Unused: ${result.unusedImports.join(', ')}\n`);
});
Detect Unused CSS
javascript
// scripts/detect-unused-css.js
import fs from 'fs';
import postcss from 'postcss';
class UnusedCSSDetector {
async detect(cssPath, srcDir) {
const cssContent = fs.readFileSync(cssPath, 'utf8');
const ast = postcss.parse(cssContent);
const definedClasses = new Set();
const usedClasses = new Set();
// Extract all class definitions
ast.walkRules(rule => {
const classes = rule.selector.match(/\.[a-zA-Z_-][a-zA-Z0-9_-]*/g);
if (classes) {
classes.forEach(cls => definedClasses.add(cls.slice(1)));
}
});
// Find usage in JS/JSX files
const jsFiles = this.getAllJSFiles(srcDir);
jsFiles.forEach(file => {
const content = fs.readFileSync(file, 'utf8');
definedClasses.forEach(cls => {
if (content.includes(cls)) {
usedClasses.add(cls);
}
});
});
const unused = Array.from(definedClasses).filter(
cls => !usedClasses.has(cls)
);
return {
totalClasses: definedClasses.size,
usedClasses: usedClasses.size,
unusedClasses: unused
};
}
getAllJSFiles(dir) {
// Implementation
return [];
}
}

3. Performance Optimization

Detect Slow Components
javascript
// scripts/detect-slow-components.js
class PerformanceAnalyzer {
detectSlowPatterns(filePath) {
const content = fs.readFileSync(filePath, 'utf8');
const issues = [];
// Pattern 1: Missing React.memo
if (this.isFunctionalComponent(content) &&
!content.includes('React.memo') &&
!content.includes('memo(')) {
issues.push({
type: 'missing-memo',
severity: 'medium',
suggestion: 'Consider wrapping with React.memo to prevent unnecessary re-renders'
});
}
// Pattern 2: Inline function definitions
const inlineFunctions = content.match(/onClick={\(\) =>/g);
if (inlineFunctions && inlineFunctions.length > 2) {
issues.push({
type: 'inline-functions',
count: inlineFunctions.length,
severity: 'high',
suggestion: 'Use useCallback to memoize event handlers'
});
}
// Pattern 3: Missing key prop in lists
if (content.includes('.map(') && !content.includes('key=')) {
issues.push({
type: 'missing-keys',
severity: 'critical',
suggestion: 'Add unique key prop to list items'
});
}
// Pattern 4: Large inline objects/arrays
const inlineObjects = content.match(/=\s*{[^}]{50,}}/g);
if (inlineObjects && inlineObjects.length > 0) {
issues.push({
type: 'inline-objects',
count: inlineObjects.length,
severity: 'medium',
suggestion: 'Move objects outside component or use useMemo'
});
}
return issues;
}
isFunctionalComponent(content) {
return /function\s+\w+\s*\([^)]*\)\s*{[\s\S]*return\s+</m.test(content) ||
/const\s+\w+\s*=\s*\([^)]*\)\s*=>\s*{[\s\S]*return\s+</m.test(content);
}
generateOptimizations(issues) {
const optimizations = [];
issues.forEach(issue => {
switch (issue.type) {
case 'missing-memo':
optimizations.push({
code: `export default React.memo(ComponentName);`,
explanation: 'Prevents re-renders when props haven\'t changed'
});
break;
case 'inline-functions':
optimizations.push({
code: `const handleClick = useCallback(() => {
// handler logic
}, [dependencies]);`,
explanation: 'Memoizes function to prevent recreation on each render'
});
break;
case 'missing-keys':
optimizations.push({
code: `items.map(item => <div key={item.id}>...</div>)`,
explanation: 'Helps React identify which items changed'
});
break;

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/kirti/reactforge-demo/react-node-automation/badge)](https://verified-skill.com/skills/kirti/reactforge-demo/react-node-automation)

Something wrong with this skill or its page? Tell us.