agentleFS
AnjanJAnjanJ/rails_error_dashboard/.claude/skills/add-breadcrumb-page/SKILL.md

add-breadcrumb-page

Skill93 starsChanged 8 days agoMITView on GitHub

Scaffold a full breadcrumb aggregate page — query, view, route, controller action, and specs

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create a complete breadcrumb aggregate page following the pattern established by deprecations, N+1 queries, and cache health pages.

    line 9
  2. Distinctive:

    Before creating anything, read the existing breadcrumb page implementations as reference:

    line 26
  3. Very specific:

    Read lib/rails_error_dashboard/queries/deprecation_warnings.rb or n_plus_one_summary.rb:

    line 29
  4. Very specific:

    Read the deprecations or n_plus_one_summary action in errors_controller.rb:

    line 55
  5. Distinctive:

    Run the new specs:

    line 74
  6. Distinctive:

    Run RuboCop on new files

    line 78
  7. Distinctive:

    Verify the page loads in the dummy app or a test app

    line 79
  8. Distinctive:

    Check the sidebar link works

    line 80

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/add-breadcrumb-page — Scaffold Breadcrumb Aggregate Page

Create a complete breadcrumb aggregate page following the pattern established by deprecations, N+1 queries, and cache health pages.

Usage

/add-breadcrumb-page <name> — e.g., /add-breadcrumb-page slow_queries

What Gets Created

  1. Query: lib/rails_error_dashboard/queries/<name>.rb
  2. View: app/views/rails_error_dashboard/errors/<name>.html.erb
  3. Route: Added to config/routes.rb (collection GET)
  4. Controller action: Added to app/controllers/rails_error_dashboard/errors_controller.rb
  5. Query spec: spec/queries/rails_error_dashboard/<name>_spec.rb
  6. Controller spec: Added to existing controller spec or integration test

Reference Files (Read These First)

Before creating anything, read the existing breadcrumb page implementations as reference:

Query Pattern

Read lib/rails_error_dashboard/queries/deprecation_warnings.rb or n_plus_one_summary.rb:

  • self.call(params = {}) factory method
  • days parameter (default 30, options: 7/30/90)
  • page and per_page for pagination via Pagy
  • Aggregation by breadcrumb category/message
  • Returns { items:, pagy:, stats: { unique_count:, total_occurrences:, affected_errors: } }

View Pattern

Read app/views/rails_error_dashboard/errors/deprecations.html.erb or n_plus_one_summary.html.erb:

  • Time-range filter buttons (7/30/90 days) with active state
  • Three metric cards (unique count, total occurrences, affected errors)
  • Pagination via @pagy
  • Empty state with descriptive guide
  • Data table with breadcrumb details and links to affected errors
  • Guide links section at the bottom

Route Pattern

In config/routes.rb, breadcrumb pages are collection GET routes:

collection do
  get :deprecations, :n_plus_one_summary, :cache_health_summary
  get :<new_name>  # Add here
end

Controller Action Pattern

Read the deprecations or n_plus_one_summary action in errors_controller.rb:

def <name>
  result = RailsErrorDashboard::Queries::<ClassName>.call(
    days: params[:days],
    page: params[:page],
    per_page: 25
  )
  @items = result[:items]
  @pagy = result[:pagy]
  @stats = result[:stats]
end

Sidebar Navigation

The sidebar in the layout (app/views/layouts/rails_error_dashboard.html.erb) has a "Breadcrumb Aggregates" section. Add a link for the new page.

After Creating

  1. Run the new specs:
    bundle exec rspec spec/queries/rails_error_dashboard/<name>_spec.rb
  2. Run RuboCop on new files
  3. Verify the page loads in the dummy app or a test app
  4. Check the sidebar link works

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.