Skip to content

neko314/factone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

factone

A Claude Code plugin that analyzes FactoryBot usage in Rails test suites and recommends optimal build strategies.

What it does

Every unnecessary FactoryBot.create call writes to the database. Switching to build_stubbed or build where safe can cut test suite runtime significantly.

This plugin adds a /factone skill that:

  1. Reads your factory definitions and model callbacks
  2. Analyzes each create / build / build_stubbed call in your test files
  3. Presents a list of recommended changes with explanations
  4. Applies the changes after your confirmation

Usage

/factone                        # scan whole project
/factone spec/models/           # scan a directory
/factone spec/models/user_spec.rb  # scan a single file
/factone --fix                  # scan and apply all safe changes immediately
/factone spec/models/ --fix     # directory + auto-apply

Strategy guide

Strategy DB write Has ID Best for
create yes yes DB state assertions, after_create callbacks, integration tests
build no no Validation tests, attribute logic
build_stubbed no yes (stubbed) Unit tests, service objects, presenters

Installation

First, clone this repository:

git clone https://github.com/neko314/factone.git

Then install it either project-locally or globally.

Local (project-level)

cp -r factone /path/to/your/project/.claude/plugins/

Global

cp -r factone ~/.claude/plugins/

Requirements

License

MIT © Keiko Kaneko

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages