- Home
- Skills
- Frontend & Web Apps
- devflow clean js
Works with the AI Agents you already use
devflow clean js
Opinionated clean-code conventions for JavaScript and TypeScript (Node, React, Express, tests), applied whenever your agent writes or changes JS/TS. Your project's own config always wins.
Free
devflow clean js
Example session with this skill installed
Refactor the processData function in src/utils.ts to follow clean code standards. It currently has nested if-statements and uses several positional arguments.
- Read your context and instructions
- Compiled the devflow clean js
I have refactored src/utils.ts to improve readability and maintainability. I replaced the nested conditionals with guard clauses, consolidated positional parameters into a single options object, and ensured the function follows the 30-line limit. I also ran the project's Biome linter to ensure style consistency.
Refactored Utility
import { formatCurrency } from './formatters';
import type { DataOptions, ProcessingResult } from './types';
/**
* Processes raw input data into a validated result object.
* Uses guard clauses to keep nesting depth at 1.
*/
export const processData = ({
data,
retryCount = 0,
isPremium = false,
onComplete
}: DataOptions): ProcessingResult => {
if (!data) {
throw new Error('Processing failed', { cause: 'Data payload is null' });
}
if (retryCount > 3) {
return { status: 'failed', reason: 'MAX_RETRIES' };
}
const processedValue = data.items
.filter(item => item.isActive)
.map(item => item.value * (isPremium ? 1.2 : 1.0));
const total = processedValue.reduce((acc, val) => acc + val, 0);
if (onComplete) {
onComplete(total);
}
return {
status: 'success',
total,
formattedTotal: formatCurrency(total),
timestamp: Date.now(),
};
};
Next steps
- Review the new
DataOptionstype I added tosrc/types.tsto support the options object. - Run
npm testto verify that the logic remains unchanged by the structural refactor. - Check the
scripts/lint.shoutput log to see the minor whitespace fixes applied automatically.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop fighting against messy JavaScript and inconsistent TypeScript patterns. This skill enforces opinionated clean-code standards for Node, React, and Express environments, ensuring your agent writes maintainable, professional-grade code without manual supervision. It bridges the gap between raw code generation and production-ready quality by aligning with your existing project configurations while preventing common architectural smells.
What it does
- Enforces Clean Standards applies guard clauses, early returns, and a max nesting depth of two to ensure readability.
- Optimizes Test Suites prevents redundant setup in Vitest, Jest, and Playwright by analyzing global configurations first.
- Standardizes React & Node mandates named exports, options objects for complex parameters, and pure function patterns.
- Automates Linting executes project-specific linters via
scripts/lint.shwith safe auto-fixes enabled. - Manages Async Safely ensures all promises are handled and utilizes
Promise.allfor independent concurrent operations.
How it works
- The agent analyzes your local
biome.json,.eslintrc, andtsconfig.jsonto ensure project-specific styles take precedence. - Code is generated or refactored following strict rules like
constby default, no magic numbers, and 30-line function limits. - The agent runs
scripts/test-config.shbefore writing tests to identify what not to duplicate from global setups. - Final output is passed through the project's linter to resolve style violations automatically.
Frameworks & tools
Works with JavaScript (ESM/CJS) and TypeScript. Supported frameworks include React, Node.js, and Express. Compatible with Biome, ESLint, Prettier, Vitest, Jest, and Playwright.
Why this beats prompting it yourself
Generic prompts often produce deeply nested if-statements or messy test mocks that drift from your config. This skill uses a multi-step workflow that actually reads your configuration files and runs your local linting scripts to guarantee the code integrates perfectly with your specific environment.
Use cases
- Refactoring legacy React components into clean, functional patterns.
- Writing integration tests that strictly follow existing Vitest or Playwright setups.
- Converting complex nested logic into flat, readable guard-clause structures.
- Standardizing a new microfrontend or service with consistent named exports and types.
Known limitations
Requires a bash environment to execute linting and config check scripts. Does not support non-JS/TS languages.
Requires bash. Automated linting requires project-level Biome or ESLint configurations. Optimized for JS/TS environments only.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account
Requires