Agent skill

Extraction Timing

by ThibautBaissac in ThibautBaissac/rails_ai_agents

Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns.

MITAuto-check passedGame Development

Install Extraction Timing

skills CLI
$ npx skills add ThibautBaissac/rails_ai_agents --skill extraction-timing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ThibautBaissac/rails_ai_agents extraction-timing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ThibautBaissac/rails_ai_agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/extraction-timing .claude/skills/extraction-timing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extraction-timing
GitHub stars
665
Token cost
~1.2k tokens
SKILL.md length
402 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns.

  • Deciding whether to extract code
  • SKILL.md covers Core Philosophy: Skinny…, Extraction Thresholds, Decision Tree: "Where Should… and Settled Debates, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Choosing between patterns (service vs concern vs query)

What it does

Extraction Timing is an agent skill from ThibautBaissac/rails_ai_agents. Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns. Use when deciding whether to extract code, choosing between patterns (service vs concern vs query), evaluating if a base class or abstraction is needed, or when user mentions refactoring, extraction, code organization, or "where should this go." WHEN NOT: Implementing a specific pattern already decided on (use specialist agents like service-agent, query-agent, or model-agent), writing tests (use…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Backend development, Game design and Refactoring. The repository describes itself as: Specialized AI skills, agents, rules and hooks for modern Rails AI driven-development + Spec-Driven-Development kit + MCP. The licence is MIT.

When your agent uses it

  • Deciding whether to extract code
  • Choosing between patterns (service vs concern vs query)
  • Evaluating if a base class
  • Abstraction is needed

Example prompts

  • “where should this go.”
  • “Use the extraction-timing skill to guide decisions about when and how to extract code into services, queries, concerns, form objects, or other…”
  • “/extraction-timing”

What it can do on your machine

Read from SKILL.md and the folder at commit 03622f2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extraction Timing loads about 1.2k tokens when it runs. Until then it costs about 151 tokens; SKILL.md has 402 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~151
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ThibautBaissac/rails_ai_agents at commit 03622f2, republished under its MIT licence (© ThibautBaissac). 402 words, ~1,247 tokens.

Download SKILL.mdSave it as .claude/skills/extraction-timing/SKILL.md (or your agent's skills folder).
name
extraction-timing
description
Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns. Use when deciding whether to extract code, choosing between patterns (service vs concern vs query), evaluating if a base class or abstraction is needed, or when user mentions refactoring, extraction, code organization, or "where should this go." WHEN NOT: Implementing a specific pattern already decided on (use specialist agents like service-agent, query-agent, or model-agent), writing tests (use rspec-agent), or architecture-level design (use rails-architecture).
user-invocable
false

You are an expert in Rails code organization and extraction decisions. Help decide when to extract, what pattern to use, and when to keep it simple.

Core Philosophy: Skinny Everything

The 2025 Rails consensus has evolved beyond "Fat Models" to Skinny Everything:

  • Controllers: orchestrate (delegate to services, render responses) -- max ~10 lines per action
  • Models: persist (validations, associations, scopes, simple predicates) -- max ~100 lines
  • Services: contain business logic (multi-step operations, external calls, orchestration)
  • Views: display markup with zero logic

Extraction Thresholds

SignalAction
Controller action exceeds ~10 lines of business logicExtract to service object
Model exceeds ~100 linesExtract business logic to services, complex queries to query objects
Query joins multiple tables or has conditional clausesExtract to query object
Form touches multiple models or has custom validationExtract to form object
Display formatting logic in modelExtract to presenter
UI element reused across 2+ viewsExtract to ViewComponent
Shared behavior across 2+ models (narrow, simple)Extract to concern
5+ concrete implementations with identical structureExtract base class
One-off operationDon't extract. Inline is fine.

Decision Tree: "Where Should This Code Go?"

Is it a database query?
  ├── Simple (one table, one condition) → Model scope
  └── Complex (joins, conditionals, reused) → Query object

Is it business logic?
  ├── Simple CRUD on one model → Controller inline (or model method)
  ├── Multi-step operation → Service object
  ├── Involves external API → Service object
  └── Spans multiple models → Service object with transaction

Is it shared behavior?
  ├── Property of the model (soft-delete, slugs, search) → Concern
  └── Operation on the model (checkout, import, sync) → Service object

Is it display logic?
  ├── Formatting one model's data → Presenter (SimpleDelegator)
  ├── Reusable UI element → ViewComponent
  └── Simple helper method → Keep in helper (use sparingly)

Is it validation?
  ├── Single model, standard rules → Model validation
  ├── Multi-model form → Form object
  └── Business rule (not data integrity) → Service validation

Settled Debates

Concerns vs Service Objects
ConcernsService Objects
Use forSimple shared model propertiesMulti-step business operations
ExamplesSoftDeletable, Searchable, SluggableCreateOrder, ProcessRefund, ImportCsv
Max size~30 linesNo hard limit (but SRP applies)
Test viaIncluding model's specsIsolated unit specs

Rule: If the behavior is a property of the model, use a concern. If it's an operation on the model, use a service.

Show full SKILL.md (153 more words)Show less
STI vs Polymorphic Associations
STIPolymorphic
Use whenSubclasses share >80% of columnsTypes have unique attributes
TableOne shared table with type columnSeparate tables per type
Avoid when>20% columns are NULL for some subtypesTypes are fundamentally similar
Callbacks vs Explicit Calls

Rule: Callbacks for data normalization only. Everything else is explicit.

Acceptable CallbacksMust Be Explicit (in services)
before_validation :strip_whitespaceSending emails
before_save :downcase_emailEnqueuing background jobs
before_destroy :check_dependenciesCalling external APIs
after_initialize :set_defaultsCreating related records with business logic

Anti-Pattern Checklist

Before extracting, verify you're not creating:

  • A service that wraps a single model.update! call (Service Graveyard)
  • A base class for only 2 services (Premature Abstraction)
  • A concern with multiple responsibilities (Kitchen Sink Concern)
  • A helper that should be a presenter or component
  • An abstraction for a hypothetical future need (YAGNI violation)

Reference

See @docs/rails-development-principles.md for the complete development principles guide including SOLID, testing strategy, security, and performance.

© ThibautBaissac, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/extraction-timing of ThibautBaissac/rails_ai_agents.

Open the folder on GitHubat commit 03622f2

Compare with similar skills

Extraction Timing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extraction Timing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extraction Timing this skillThibautBaissac/rails_ai_agents665—~1.2kAutomated safety check: PassMIT
Antipattern Preventiondoorkeeper-gem/doorkeeper5.5k—~1.1kAutomated safety check: PassMIT
Layered Railsevilmartians/redprints-cfp1081 repos~4.1kAutomated safety check: PassNone
Bootui Java Developmentjdubois/boot-ui307—~1.3kAutomated safety check: PassApache-2.0
Engineering PrinciplesAzure/agent-app-orchestrator103—~282Automated safety check: PassMIT
Spring Data Jparrezartprebreza/spring-boot-skills298—~3kAutomated safety check: PassMIT

Similar skills

  • Antipattern Prevention

    doorkeeper-gem/doorkeeper

    Avoid common Ruby and Rails antipatterns that degrade maintainability and performance.

    5.5k GitHub stars~1.1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Layered Rails

    evilmartians/redprints-cfp

    Write, refactor, and review Rails code using layered architecture principles from "Layered Design for Ruby on Rails Applications".

    108 GitHub starsUsed in 1 repo~4.1k tokens
    Backend & APIsAuto-check passed
  • A skill your agent uses when implementing, debugging, refactoring, or testing existing BootUI Java code, including framework-neutral engine logic, Spring MVC and WebFlux adapters, Quarkus runtime…

    307 GitHub stars~1.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Engineering Principles

    Azure/agent-app-orchestrator

    Official

    Agent Landing Zone Orchestrator architecture and implementation principles.

    103 GitHub stars~282 tokensUpdated today
    Backend & APIsAuto-check passed
  • Spring Data Jpa

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when generating or refactoring Spring Boot 4 JPA entities, repositories, queries, projections, persistence tests, entity relationships, embeddables, IDs, or Hibernate mappings.

    298 GitHub stars~3k tokensUpdated 17 days ago
    Backend & APIsAuto-check passed
  • Java

    ericrisco/rsc-harness

    A skill your agent uses when writing, reviewing or refactoring modern Java (21+, 25 LTS) — records and sealed interfaces as algebraic data types, exhaustive pattern-matching switch over instanceof…

    167 GitHub stars~4.6k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from ThibautBaissac/rails_ai_agents

All 19 skills in this repo
  • Accessibility Review

    ThibautBaissac/rails_ai_agents

    Audits Rails application accessibility against WCAG 2.2 Level AA, detects violations with axe-core / Lighthouse / Pa11y, and reports remediation guidance for ERB views, ViewComponents, Stimulus…

    665 GitHub stars~2.9k tokensUpdated 4 mo ago
    Auto-check: notes
  • Action Cable Patterns

    ThibautBaissac/rails_ai_agents

    Implements real-time features with Action Cable and WebSockets.

    665 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Active Storage Setup

    ThibautBaissac/rails_ai_agents

    Configures Active Storage for file uploads with variants and direct uploads.

    665 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Authentication Flow

    ThibautBaissac/rails_ai_agents

    Implements authentication using Rails 8 built-in generator. An agent skill from ThibautBaissac/rails_ai_agents.

    665 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Caching Strategies

    ThibautBaissac/rails_ai_agents

    Implements Rails caching patterns for performance optimization.

    665 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • I18n Patterns

    ThibautBaissac/rails_ai_agents

    Implements internationalization with Rails I18n for multi-language support.

    665 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed

Questions about Extraction Timing

What does Extraction Timing do?

Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns. Extraction Timing is an agent skill from ThibautBaissac/rails_ai_agents. Guides decisions about when and how to extract code into services, queries, concerns, form objects, or other patterns.

When should I use Extraction Timing?

Extraction Timing fits situations like: deciding whether to extract code; choosing between patterns (service vs concern vs query); evaluating if a base class; abstraction is needed.

How do I install Extraction Timing in Claude Code?

Run `npx skills add ThibautBaissac/rails_ai_agents --skill extraction-timing -a claude-code`. Or copy the skill folder (.agents/skills/extraction-timing in ThibautBaissac/rails_ai_agents) into .claude/skills/extraction-timing in your project. Claude Code loads it when a task matches its description.

How do I install Extraction Timing in Codex?

Run `npx skills add ThibautBaissac/rails_ai_agents --skill extraction-timing -a codex`. Or copy the skill folder (.agents/skills/extraction-timing in ThibautBaissac/rails_ai_agents) into .agents/skills/extraction-timing in your project. Codex loads it when a task matches its description.

Can I use Extraction Timing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ThibautBaissac/rails_ai_agents --skill extraction-timing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extraction-timing, .gemini/skills/extraction-timing, .github/skills/extraction-timing and .opencode/skills/extraction-timing in your project.

What does Extraction Timing need to run?

SKILL.md names no scripts, command-line tools or credentials: Extraction Timing is instructions for the agent only.

Does Extraction Timing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Extraction Timing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Extraction Timing use?

Extraction Timing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extraction Timing use?

About 1.2k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Extraction Timing?

Skills that share tags, products or a category with Extraction Timing: Antipattern Prevention (doorkeeper-gem/doorkeeper, 5.5k stars), Layered Rails (evilmartians/redprints-cfp, 108 stars), Bootui Java Development (jdubois/boot-ui, 307 stars) and Engineering Principles (Azure/agent-app-orchestrator, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extraction Timing?

ThibautBaissac (a GitHub user) maintains it in ThibautBaissac/rails_ai_agents, which has 665 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on June 1, 2026.

Source: ThibautBaissac/rails_ai_agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.