Agent skill

Action Cable Patterns

by ThibautBaissac in ThibautBaissac/rails_ai_agents

Implements real-time features with Action Cable and WebSockets.

MITAuto-check passedBackend & APIs

Install Action Cable Patterns

skills CLI
$ npx skills add ThibautBaissac/rails_ai_agents --skill action-cable-patterns -a claude-code

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

GitHub CLI
$ gh skill install ThibautBaissac/rails_ai_agents action-cable-patterns --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/action-cable-patterns .claude/skills/action-cable-patterns && 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
action-cable-patterns
GitHub stars
665
Token cost
~1.2k tokens
SKILL.md length
281 words
Files
4 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

Implements real-time features with Action Cable and WebSockets.

  • Works in 3 steps: subscribed — find the resource, check… → Class-level broadcast_* methods — render… → A matching JavaScript subscription…
  • Adding live updates
  • SKILL.md covers Overview, Quick Start, Project Structure and Connection Authentication, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Action Cable Patterns is an agent skill from ThibautBaissac/rails_ai_agents. Implements real-time features with Action Cable and WebSockets. Use when adding live updates, chat features, notifications, real-time dashboards, or when user mentions Action Cable, WebSockets, channels, or real-time. WHEN NOT: Simple HTTP request/response flows, REST APIs, static content, or features that don't need real-time updates.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/broadcasting-and-stimulus.md`, `references/channel-patterns.md` and `references/testing.md`).

It sits in Backend & APIs, covering Realtime and WebSockets and REST APIs. 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

  • Adding live updates
  • Real-time dashboards
  • User mentions Action Cable

Example prompts

  • “Use the action-cable-patterns skill to implement real-time features with Action Cable and WebSockets”
  • “/action-cable-patterns”

Workflow steps

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

  1. subscribed — find the resource, check authorization, call stream_for
  2. Class-level broadcast_* methods — render partials via ApplicationController.renderer
  3. A matching JavaScript subscription handler with a received(data) switch

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 (its code samples are ruby).

    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

Action Cable Patterns loads about 1.2k tokens when it runs, and up to ~4.2k if it reads all its reference files. Until then it costs about 90 tokens; SKILL.md has 281 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~90
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.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). 281 words, ~1,249 tokens.

Download SKILL.mdSave it as .claude/skills/action-cable-patterns/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
action-cable-patterns
description
Implements real-time features with Action Cable and WebSockets. Use when adding live updates, chat features, notifications, real-time dashboards, or when user mentions Action Cable, WebSockets, channels, or real-time. WHEN NOT: Simple HTTP request/response flows, REST APIs, static content, or features that don't need real-time updates.
paths
app/channels/**/*.rb, app/javascript/channels/**/*.js, spec/channels/**/*.rb

Action Cable Patterns for Rails 8

Overview

Action Cable integrates WebSockets with Rails:

  • Real-time updates without polling
  • Server-to-client push notifications
  • Chat and messaging features
  • Live dashboards and feeds
  • Collaborative editing

Quick Start

Action Cable is included in Rails by default. Configure it:

ruby
# config/cable.yml
development:
  adapter: async

test:
  adapter: test

production:
  adapter: solid_cable  # Rails 8 default
  # OR
  adapter: redis
  url: <%= ENV.fetch("REDIS_URL") %>

Project Structure

app/
├── channels/
│   ├── application_cable/
│   │   ├── connection.rb      # Authentication
│   │   └── channel.rb         # Base channel
│   ├── notifications_channel.rb
│   ├── events_channel.rb
│   └── chat_channel.rb
├── javascript/
│   └── channels/
│       ├── consumer.js
│       ├── notifications_channel.js
│       └── events_channel.js
spec/channels/
├── notifications_channel_spec.rb
└── events_channel_spec.rb

Connection Authentication

ruby
# app/channels/application_cable/connection.rb
module ApplicationCable
  class Connection < ActionCable::Connection::Base
    identified_by :current_user

    def connect
      self.current_user = find_verified_user
    end

    private

    def find_verified_user
      # Using Rails 8 authentication
      if session_token = cookies.signed[:session_token]
        if session = Session.find_by(token: session_token)
          session.user
        else
          reject_unauthorized_connection
        end
      else
        reject_unauthorized_connection
      end
    end
  end
end

Channel Patterns

Four core patterns are available. See channel-patterns.md for full Ruby and JavaScript implementations:

  • Pattern 1: Notifications Channel — streams per-user notifications via stream_for current_user
  • Pattern 2: Resource Updates Channel — streams updates for a specific resource with authorization via reject
  • Pattern 3: Chat Channel — bidirectional messaging with speak and typing actions, presence tracking
  • Pattern 4: Dashboard Live Updates — broadcasts stats and activity feed to all account members

Each pattern follows the same structure:

  1. subscribed — find the resource, check authorization, call stream_for
  2. Class-level broadcast_* methods — render partials via ApplicationController.renderer
  3. A matching JavaScript subscription handler with a received(data) switch

Broadcasting

Broadcasting can be triggered from services, models, or callbacks. See broadcasting-and-stimulus.md for:

  • From a service object — call EventsChannel.broadcast_update(event) after persistence
  • From model callbacks — use after_create_commit to trigger channel broadcasts
  • Turbo Streams integration — use broadcast_append_to / broadcast_remove_to helpers directly on models
  • Stimulus controller — wrap the Action Cable subscription lifecycle inside a Stimulus controller for clean connect/disconnect management
  • Performance patterns — connection limits, selective broadcasting, debounced broadcasts

Testing Channels

See testing.md for full specs. Key conventions:

ruby
# Stub connection identity
stub_connection(current_user: user)

# Assert subscription confirmed and streaming
subscribe(event_id: event.id)
expect(subscription).to be_confirmed
expect(subscription).to have_stream_for(event)

# Assert rejection for unauthorized access
expect(subscription).to be_rejected

# Assert broadcast payload
expect {
  described_class.notify(user, notification)
}.to have_broadcasted_to(user).with(hash_including(type: "notification"))

Checklist

  • Connection authentication configured
  • Channel authorization implemented
  • Client-side subscription set up
  • Broadcasting from services/models
  • Channel specs written
  • Error handling in place
  • Reconnection logic on client
  • Performance limits configured

References

  • channel-patterns.md — Full implementations of Notifications, Resource Updates, Chat, and Dashboard channels (Ruby + JavaScript)
  • broadcasting-and-stimulus.md — Broadcasting from services/models, Turbo Streams integration, Stimulus controller, performance tips
  • testing.md — RSpec channel specs, authorization specs, and system tests

© 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

SKILL.md and 3 other files (references) in .agents/skills/action-cable-patterns of ThibautBaissac/rails_ai_agents.

  • SKILL.md
  • references/broadcasting-and-stimulus.md
  • references/channel-patterns.md
  • references/testing.md

Open the folder on GitHubat commit 03622f2

Compare with similar skills

Action Cable Patterns 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.

Action Cable Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Action Cable Patterns this skillThibautBaissac/rails_ai_agents665—~1.2kAutomated safety check: PassMIT
Use Yaakmountain-loop/yaak19k—~1.9kAutomated safety check: PassMIT
Binance Datatoollostleaf/binance-datatool148—~2.5kAutomated safety check: NotesBSD-3-Clause
Cb Realtime APIBlkLeg/CircuitBreaker201—~1.7kAutomated safety check: PassMIT
Domain Webfjrevoredo/mini-diarium3081 repos~1kAutomated safety check: PassMIT
FastAPI ExpertJeffallan/claude-skills12k—~1.8kAutomated safety check: PassMIT

Similar skills

  • Use Yaak

    mountain-loop/yaak

    A skill your agent uses when the user mentions Yaak, a Yaak workspace, or the yaak command, or asks to call, hit, or smoke test HTTP/REST endpoints, save or organize API requests for reuse or manual…

    19k GitHub stars~1.9k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Binance Datatool

    lostleaf/binance-datatool

    Manage Binance historical market data from data.binance.vision using the binance-datatool CLI.

    148 GitHub stars~2.5k tokensUpdated 5 mo ago
    Backend & APIsAuto-check: notes
  • Cb Realtime API

    BlkLeg/CircuitBreaker

    How Circuit Breaker moves data between backend and frontend — the NATS internal bus, Redis pub/sub, the WebSocket stream endpoints and their first-message JWT handshake, SSE log/event streams, and…

    201 GitHub stars~1.7k tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Domain Web

    fjrevoredo/mini-diarium

    A skill your agent uses when building web services. An agent skill from fjrevoredo/mini-diarium.

    308 GitHub starsUsed in 1 repo~1k tokens
    Backend & APIsAuto-check passed
  • FastAPI Expert

    Jeffallan/claude-skills

    Builds async Python APIs with FastAPI and Pydantic V2, covering endpoints, JWT authentication, async SQLAlchemy, WebSockets and pytest checks against the OpenAPI docs.

    12k GitHub stars~1.8k tokensUpdated 5 days ago
    Backend & APIsAuto-check passed
  • Ros2 Web Integration

    arpitg1304/robotics-agent-skills

    Patterns and best practices for integrating ROS2 systems with web technologies including REST APIs, WebSocket bridges, and browser-based robot interfaces.

    368 GitHub stars~13k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes

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
  • 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
  • Performance Optimization

    ThibautBaissac/rails_ai_agents

    Identifies and fixes Rails performance issues including N+1 queries, slow queries, and memory problems.

    665 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check: notes

Categories

Questions about Action Cable Patterns

What does Action Cable Patterns do?

Implements real-time features with Action Cable and WebSockets. Action Cable Patterns is an agent skill from ThibautBaissac/rails_ai_agents. Implements real-time features with Action Cable and WebSockets.

When should I use Action Cable Patterns?

Action Cable Patterns fits situations like: adding live updates; real-time dashboards; user mentions Action Cable.

How do I install Action Cable Patterns in Claude Code?

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

How do I install Action Cable Patterns in Codex?

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

Can I use Action Cable Patterns 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 action-cable-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/action-cable-patterns, .gemini/skills/action-cable-patterns, .github/skills/action-cable-patterns and .opencode/skills/action-cable-patterns in your project.

What does Action Cable Patterns need to run?

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

Does Action Cable Patterns 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 Action Cable Patterns 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 Action Cable Patterns use?

Action Cable Patterns 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 Action Cable Patterns 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. Its references folder adds about 3k tokens, read only when the agent opens those files.

What are the alternatives to Action Cable Patterns?

Skills that share tags, products or a category with Action Cable Patterns: Use Yaak (mountain-loop/yaak, 19k stars), Binance Datatool (lostleaf/binance-datatool, 148 stars), Cb Realtime API (BlkLeg/CircuitBreaker, 201 stars) and Domain Web (fjrevoredo/mini-diarium, 308 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Action Cable Patterns?

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.