skills/dev-workflow/tdd-red-green-refactor/SKILL.md
Enforces a disciplined Red-Green-Refactor (TDD) workflow in TypeScript/Node.js. Use this whenever creating new features, fixing bugs, or migrating logic to ensure high-quality, verifiable implementations.
npx skillsauth add The-Utopia-Studio/skills tdd-red-green-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill implements a structural framework for AI-assisted programming to ensure every line of code is verifiable, typed, and purposeful.
You must prove the feature does not exist and that your test is valid.
ReferenceError: add is not defined) and not a configuration error.Make the test pass as quickly and simply as possible.
Improve the code structure while maintaining the "Green" state.
You are strictly forbidden from writing a large "splurge" of multiple tests at once. You must follow a strictly incremental loop:
Use automated assertions and strong typing (TypeScript) as backpressure to prevent the AI from "guessing" the solution or "playing in the mud" with low-quality code.
Never modify an existing test to make a failing implementation pass. If a test must change, it must be because the requirement changed, not because the code is difficult to write.
Step 1: Red
// math.test.ts
import { describe, it, expect } from 'vitest';
import { add } from './math';
describe('add', () => {
it('should sum two numbers', () => {
expect(add(2, 2)).toBe(4); // Fails: ReferenceError: add is not defined
});
});
Step 2: Green
// math.ts
export const add = (a: any, b: any) => {
return 4; // Passes: Minimal code to satisfy the test
};
Step 3: Refactor
// math.ts
/**
* Sums two numbers with explicit type safety.
*/
export const add = (a: number, b: number): number => {
return a + b; // Passes: Proper implementation with safety net
};
development
Create professional equity research earnings update reports (8-12 pages, 3,000-5,000 words) analyzing quarterly results for companies already under coverage. Fast-turnaround format focusing on beat/miss analysis, key metrics, updated estimates, and revised thesis. Includes 1-3 summary tables and 8-12 charts. Use when user requests "earnings update", "quarterly update", "earnings analysis", "Q1/Q2/Q3/Q4 results", or post-earnings report.
development
Updates a presentation with new numbers — quarterly refreshes, earnings updates, comp rolls, rebased market data. Use whenever the user asks to "update the deck with Q4 numbers", "refresh the comps", "roll this forward", "swap in the new earnings", "change all the $485M to $512M", or any request to swap figures across an existing deck without rebuilding it.
development
Real DCF (Discounted Cash Flow) model creation for equity valuation. Retrieves financial data from SEC filings and analyst reports, builds comprehensive cash flow projections with proper WACC calculations, performs sensitivity analysis, and outputs professional Excel models with executive summaries. Use when users need to value a company using DCF methodology, request intrinsic value analysis, or ask for detailed financial modeling with growth projections and terminal value calculations.
tools
Build professional financial services data packs from various sources including CIMs, offering memorandums, SEC filings, web search, or MCP servers. Extract, normalize, and standardize financial data into investment committee-ready Excel workbooks with consistent structure, proper formatting, and documented assumptions. Use for M&A due diligence, private equity analysis, investment committee materials, and standardizing financial reporting across portfolio companies. Do not use for simple financial calculations or working with already-completed data packs.