Agent skill

Code Quality

by doorkeeper-gem in doorkeeper-gem/doorkeeper

Maintain code health and architecture standards when implementing features or refactoring Doorkeeper.

MITAuto-check passedDevelopment

Install Code Quality

skills CLI
$ npx skills add doorkeeper-gem/doorkeeper --skill code-quality -a claude-code

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

GitHub CLI
$ gh skill install doorkeeper-gem/doorkeeper code-quality --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/doorkeeper-gem/doorkeeper.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/code-quality .claude/skills/code-quality && 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
code-quality
GitHub stars
5.5k
Token cost
~1.2k tokens
SKILL.md length
374 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Maintain code health and architecture standards when implementing features or refactoring Doorkeeper.

  • Works in 4 steps: Run full spec suite: bundle exec rake spec → Run RuboCop: bundle exec rubocop → If you changed public API: check that… → …
  • Adding new classes
  • SKILL.md covers Where New Code Belongs, Large Files to Watch, Configuration Option Pattern and Grant Flow Registration Pattern, plus 5 more sections
  • Calls bundle

What it does

Code Quality is an agent skill from doorkeeper-gem/doorkeeper. Maintain code health and architecture standards when implementing features or refactoring Doorkeeper. Use when adding new classes, modules, configuration options, or when a file is growing large or complex.

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 Development, covering Code quality, Refactoring and OAuth and OpenID Connect. It works with Ruby on Rails. The repository describes itself as: Doorkeeper is an OAuth 2 provider for Ruby on Rails / Grape. The licence is MIT.

When your agent uses it

  • Adding new classes
  • Configuration options
  • A file is growing large

Example prompts

  • “/code-quality”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Run full spec suite: bundle exec rake spec
  2. Run RuboCop: bundle exec rubocop
  3. If you changed public API: check that spec/dummy/config/initializers/doorkeeper.rb still works
  4. If you extracted code: ensure all original specs still pass without modification

What it can do on your machine

Read from SKILL.md and the folder at commit 80f4eba. 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

    Shell commands in SKILL.md call:

    • bundle

    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

Code Quality loads about 1.2k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 374 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
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 doorkeeper-gem/doorkeeper at commit 80f4eba, republished under its MIT licence (© doorkeeper-gem). 374 words, ~1,196 tokens.

Download SKILL.mdSave it as .claude/skills/code-quality/SKILL.md (or your agent's skills folder).
name
code-quality
description
Maintain code health and architecture standards when implementing features or refactoring Doorkeeper. Use when adding new classes, modules, configuration options, or when a file is growing large or complex.

Code Quality & Refactoring

When implementing features or refactoring code in Doorkeeper, use this skill to maintain code health and avoid architectural drift.

Where New Code Belongs

Type of codeLocation
Protocol logic (grant processing, token issuance)lib/doorkeeper/oauth/
Request strategy (parsing grant_type → request class)lib/doorkeeper/request/
Model behavior (token/grant/application mixins)lib/doorkeeper/models/
Model concerns (reusable cross-model behavior)lib/doorkeeper/models/concerns/
ORM-specific code (ActiveRecord queries, validations)lib/doorkeeper/orm/active_record/
Client authentication methodslib/doorkeeper/client_authentication/
Configuration options and validationlib/doorkeeper/config.rb, lib/doorkeeper/config/
Rails integration (routes, helpers, engine)lib/doorkeeper/rails/, lib/doorkeeper/engine.rb
Grape integrationlib/doorkeeper/grape/
Controllers exposed to host appsapp/controllers/doorkeeper/
Views exposed to host appsapp/views/doorkeeper/
Generatorslib/generators/doorkeeper/

Large Files to Watch

Known large files that warrant care when modifying:

  • lib/doorkeeper/config.rb (~873 lines) — the configuration DSL, complex by necessity
  • lib/doorkeeper/models/access_token_mixin.rb (~607 lines) — consider if new methods belong in a concern
  • lib/doorkeeper/oauth/pre_authorization.rb (~264 lines) — validation-heavy, watch for growth
  • lib/doorkeeper/oauth/authorization_code_request.rb (~249 lines) — dense protocol logic

When adding to these files: Consider extracting to a new concern or helper module rather than growing them further. The codebase already uses lib/doorkeeper/models/concerns/ for model decomposition.

Configuration Option Pattern

Use the established option DSL:

ruby
# In lib/doorkeeper/config.rb, inside the Builder class:
option :my_new_setting, default: :some_default

# Accessed via:
Doorkeeper.config.my_new_setting

Add validation in lib/doorkeeper/config/validations.rb if the value has constraints.

Grant Flow Registration Pattern

ruby
# In lib/doorkeeper/grant_flow.rb:
Doorkeeper::GrantFlow.register(
  :my_flow,
  grant_type_matches: "my_grant_type",
  grant_type_strategy: Doorkeeper::Request::MyFlow,
)

Client Authentication Method Pattern

ruby
module Doorkeeper
  module ClientAuthentication
    class MyMethod < Method
      def self.matches_request?(request)
        # return true if this method's credentials are present
      end

      def self.authenticate(request)
        Credentials.new(uid, secret)
      end
    end
  end
end

# Registration:
Doorkeeper::ClientAuthentication.register(:my_method, MyMethod)

Validation DSL

The validate DSL in lib/doorkeeper/validations.rb is the standard pattern for request validation:

ruby
class MyRequest < Doorkeeper::OAuth::BaseRequest
  validate :client,   error: Doorkeeper::Errors::InvalidClient
  validate :scopes,   error: Doorkeeper::Errors::InvalidScope

  private

  def validate_client
    client.present?
  end

  def validate_scopes
    # return true/false
  end
end

Don't duplicate validation logic in controllers — keep it in request/pre_authorization objects.

Show full SKILL.md (157 more words)Show less

Complexity Guidelines

  • Methods: Keep under 10 lines. Extract private helpers for clarity.
  • Classes: Keep under 200 lines. Use concerns for model mixins.
  • Nesting: Max 2 levels of conditionals. Use guard clauses or early returns.
  • Parameters: Max 3 positional parameters. Use keyword arguments beyond that.

Backward Compatibility

Doorkeeper is used by many host applications. Changes must be backward-compatible unless explicitly breaking:

  • New config options: Always provide a sensible default that preserves existing behavior
  • New database columns: Always make them optional (nullable) with a migration generator
  • Changed behavior: Gate behind a config flag when possible
  • Deprecated methods: Use ActiveSupport::Deprecation.warn with a removal version
  • View changes: Note in UPGRADE.md that hosts with overridden views may need to update

Verification

After refactoring:

  1. Run full spec suite: bundle exec rake spec
  2. Run RuboCop: bundle exec rubocop
  3. If you changed public API: check that spec/dummy/config/initializers/doorkeeper.rb still works
  4. If you extracted code: ensure all original specs still pass without modification

© doorkeeper-gem, 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/code-quality of doorkeeper-gem/doorkeeper.

Open the folder on GitHubat commit 80f4eba

Compare with similar skills

Code Quality 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.

Code Quality compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Quality this skilldoorkeeper-gem/doorkeeper5.5k—~1.2kAutomated safety check: PassMIT
Systematic Code Refactoringluongnv89/claude-howto42k—~3kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling68k—~1.5kAutomated safety check: PassApache-2.0
Clean Code GuardamElnagdy/guard-skills1.3k2 repos~4.3kAutomated safety check: PassMIT
Code Refactoring Workflowluongnv89/claude-howto42k—~3.1kAutomated safety check: PassMIT
Maintainable Code for iPolloWorkDevin-AXIS/iPolloWork6.7k—~2.7kAutomated safety check: PassCustom licence

Similar skills

  • Systematic Code Refactoring

    luongnv89/claude-howto

    Guides refactoring in phases based on Martin Fowler's method: research, test coverage check, planning and small tested steps, with your approval at each phase.

    42k GitHub stars~3k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    68k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • Code Refactoring Workflow

    luongnv89/claude-howto

    Guides systematic, test-backed refactoring in the style of Martin Fowler, moving through research, planning and small incremental changes with your approval at each phase.

    42k GitHub stars~3.1k tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • A code-change gate for the iPolloWork repository: search and reuse first, keep one source of truth, justify every new file or dependency, and audit the change.

    6.7k GitHub stars~2.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Tech Debt Analyzer

    ailabs-393/ai-labs-claude-skills

    This skill should be used when analyzing technical debt in a codebase, documenting code quality issues, creating technical debt registers, or assessing code maintainability.

    454 GitHub starsUsed in 2 repos~3.9k tokens
    DevelopmentAuto-check passed

More from doorkeeper-gem/doorkeeper

  • Antipattern Prevention

    doorkeeper-gem/doorkeeper

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

    5.5k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Dependency Safety

    doorkeeper-gem/doorkeeper

    Ensure gems are safe, necessary, and properly constrained when adding, updating, or reviewing dependencies in Doorkeeper.

    5.5k GitHub stars~931 tokensUpdated yesterday
    Auto-check passed
  • Security Review

    doorkeeper-gem/doorkeeper

    Verify that code changes do not introduce OAuth security vulnerabilities.

    5.5k GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Testing

    doorkeeper-gem/doorkeeper

    Write correct and complete RSpec tests for Doorkeeper. An agent skill from doorkeeper-gem/doorkeeper.

    5.5k GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Rfc Compliance

    doorkeeper-gem/doorkeeper

    Verify OAuth protocol implementations stay aligned with relevant RFCs.

    5.5k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Code Quality

What does Code Quality do?

Maintain code health and architecture standards when implementing features or refactoring Doorkeeper. Code Quality is an agent skill from doorkeeper-gem/doorkeeper. Maintain code health and architecture standards when implementing features or refactoring Doorkeeper.

When should I use Code Quality?

Code Quality fits situations like: adding new classes; configuration options; A file is growing large.

How do I install Code Quality in Claude Code?

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

How do I install Code Quality in Codex?

Run `npx skills add doorkeeper-gem/doorkeeper --skill code-quality -a codex`. Or copy the skill folder (.agents/skills/code-quality in doorkeeper-gem/doorkeeper) into .agents/skills/code-quality in your project. Codex loads it when a task matches its description.

Can I use Code Quality 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 doorkeeper-gem/doorkeeper --skill code-quality -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-quality, .gemini/skills/code-quality, .github/skills/code-quality and .opencode/skills/code-quality in your project.

What does Code Quality need to run?

Going by SKILL.md and its folder, Code Quality needs the command-line tools its instructions call (bundle).

Does Code Quality 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 Code Quality 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 Code Quality use?

Code Quality 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 Code Quality use?

About 1.2k tokens (SKILL.md is roughly 4.8k 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 Code Quality?

Skills that share tags, products or a category with Code Quality: Systematic Code Refactoring (luongnv89/claude-howto, 42k stars), Dignified Python Standards (docling-project/docling, 68k stars), Clean Code Guard (amElnagdy/guard-skills, 1.3k stars) and Code Refactoring Workflow (luongnv89/claude-howto, 42k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Quality?

doorkeeper-gem (a GitHub organization) maintains it in doorkeeper-gem/doorkeeper, which has 5,522 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 6, 2026.

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