Generates an experiment-overview snapshot of all research questions under research/reports/. Invoke when a new point-in-time report across all RQs should be produced.
日本語の概要は準備中です。原文の説明を表示しています。
TDD Refactor Phase - Improve code while keeping tests green using Simple Design Rules and APP mass
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
You are now in the Refactor Phase of TDD. Follow these instructions to improve the code while keeping tests green.
Guide developers through the Refactor phase of TDD by helping them:
Total Mass = (constants x 1) + (bindings x 1) + (invocations x 2) +
(conditionals x 4) + (loops x 5) + (assignments x 6)
5, "hello", true)amount, result)calculate(), Math.max())if, switch, ?:)for, forEach, map)x = 5, count++)Before anything else, evaluate the naming:
**Naming Evaluation**:
- Current name: `calculate`
- Function purpose: "adds numbers from an array"
- Question: Does "calculate" clearly reveal this intent?
- Assessment: Too generic - "calculate" could mean anything
- Recommendation: Rename to `sumNumbers` or keep if name fits
Decision: [Rename to X] or [Keep current name because Y]
Before making changes, calculate current code mass:
**Current Code Mass**:
function calculate(numbers: number[]): number {
return numbers.reduce((sum, num) => sum + num, 0);
}
Component Count:
- Constants: 1 (literal 0) = 1
- Bindings: 3 (numbers, sum, num) = 3
- Invocations: 2 (reduce, +) = 4
- Conditionals: 0 = 0
- Loops: 1 (reduce is iteration) = 5
- Assignments: 0 = 0
Total Mass: 13
Systematically evaluate each rule:
Potential improvements:
Potential improvements:
Potential improvements:
After refactoring, recalculate mass:
**Refactored Code Mass**:
[refactored code]
Component Count:
[detailed breakdown]
Total Mass: [new total]
Mass Change: [old mass] -> [new mass] (delta [difference])
Explain the refactoring outcome:
If Improvements Made:
**Refactoring Applied**:
- Naming: Renamed `calculate` to `sumNumbers` (better reveals intent)
- Mass: Reduced from 13 to 11 (removed conditional)
- Rule 2: Improved clarity with explaining variable
Benefits:
- Code now clearly states it sums numbers
- Reduced complexity (lower mass)
- More maintainable
If No Improvements Possible:
**Refactoring Evaluation**:
- Naming: `calculate` already clearly describes purpose
- Duplication: No duplicated code found
- Mass: Current implementation already minimal (mass: 13)
- Simplification: No unnecessary complexity
Reasoning:
Current implementation is already optimal because:
1. Name clearly reveals intent
2. No duplication exists
3. Mass is minimal for this functionality
4. No unnecessary abstractions
No refactoring performed - code is already clean.
Refactor Phase Complete:
**Refactoring**: [improvements made or "none possible"]
**Mass Change**: [before -> after] (if calculated)
**Tests**: All passing
Proceeding to the next test.
// Before (mass: 13)
function calc(nums: number[]): number {
return nums.reduce((s, n) => s + n, 0);
}
// After (mass: 13, clarity improved)
function sumNumbers(numbers: number[]): number {
return numbers.reduce((sum, num) => sum + num, 0);
}
Refactoring:
- Naming: Renamed for clarity (Rule 2)
- Mass unchanged: 13 -> 13
- Benefit: Better reveals intent
// Before (mass: 22, duplication)
function differsByOneLetter(a: string, b: string): boolean {
if (a.length !== b.length) return false;
let diffs = 0;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) diffs++;
}
return diffs === 1;
}
function isAdjacent(a: string, b: string): boolean {
if (a.length !== b.length) return false;
let count = 0;
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) count++;
}
return count === 1;
}
// After (mass: reduced, no duplication)
const countDifferences = (a: string, b: string): number => {
if (a.length !== b.length) return Infinity;
return a.split('').reduce((count, char, i) =>
char !== b[i] ? count + 1 : count, 0
);
};
const differsByOneLetter = (a: string, b: string): boolean =>
countDifferences(a, b) === 1;
Refactoring:
- Removed duplication (Rule 3)
- Reduced mass
- Improved maintainability
// Current code (mass: 8)
function isEmpty(str: string): boolean {
return str.length === 0;
}
Evaluation:
- Naming: "isEmpty" clearly reveals intent
- Duplication: No duplication
- Mass: Already minimal (8)
- Simplification: No unnecessary complexity
No refactoring performed - code is already optimal.
Watch for these violations:
Your goal is to systematically improve code quality using established principles, measure improvements objectively with APP, and maintain transparency through comprehensive documentation.
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Generates an experiment-overview snapshot of all research questions under research/reports/. Invoke when a new point-in-time report across all RQs should be produced.
日本語の概要は準備中です。原文の説明を表示しています。
Mint a new YYYY-MM-DD-exact-coding-baseline snapshot under research/workflow-dev/export/. Detects the current best correctness- oriented workflow from research/workflow-dev/workflow-construction.md (or takes an explicit source-workflow argument) and transforms it from a lab workflow into a consumer-ready one on three axes: strips lab-only measurement content, re-enables human-in-the-loop checkpoints, and converts auto-loading config into an explicitly-invoked skill. Supports both promoted EXACT Coding lines: Opus/Hybrid and SOL/Predictive TDD. Exports Claude Code, pi, OpenCode, cursor-agent and, for SOL, Copilot. Trigger when the user says "exact-coding baseline export", "neue exact-coding baseline", "exact-coding-baseline-export", or asks to refresh the baseline snapshot.
日本語の概要は準備中です。原文の説明を表示しています。
TDD Green Phase - Implement minimal code to make the failing test pass
日本語の概要は準備中です。原文の説明を表示しています。
Re-run the analysis pipeline on all runs matching an RQ, reaggregate metrics, and propose findings updates against the fresh data. Trigger when the user says "reanalyze RQ-N", "reanalyse RQ-N", "Runs neu analysieren", or wants to refresh metrics/findings after a pipeline change (analyze-run.sh fix, adapter added, ESLint config).
日本語の概要は準備中です。原文の説明を表示しています。
TDD Red Phase - Activate ONE test from the test list and make it fail with explicit predictions
日本語の概要は準備中です。原文の説明を表示しています。
Use this skill to drive a research question (RQ) end-to-end: validate the RQ README, generate a fill batch-plan, start the Docker batch in the background, monitor progress, run aggregation, and propose findings updates. Trigger when the user says "RQ-N voranbringen", "run-rq", "fill RQ-N", "run RQ-N", "Forschungsfrage N starten", or names a specific RQ-N directory in research/.
日本語の概要は準備中です。原文の説明を表示しています。