rails-agent-gateway
Configure and operate a Ruby On Rails Agent Gateway integration from the OpenClaw side for briefing pull workflows. Use when setting up OpenClaw to read app data through a Rails `/agent-gateway/:secret/briefing` endpoint, validating tokens/URL env vars, testing connectivity, and generating summary pulls for reports or automations.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- rails-agent-gateway
- description
- Configure and operate a Ruby On Rails Agent Gateway integration from the OpenClaw side for briefing pull workflows. Use when setting up OpenClaw to read app data through a Rails `/agent-gateway/:secret/briefing` endpoint, validating tokens/URL env vars, testing connectivity, and generating summary pulls for reports or automations.
03 SKILL.md 正文
Rails Agent Gateway
This skill works in tandem with the
agent_gateway Ruby gem,
a mountable Rails engine that must be installed and configured on the
Rails side (gem "agent_gateway" + initializer). This skill handles
the OpenClaw-side setup and usage for pulling data from that endpoint.
Quick Workflow
- Confirm required env vars are available.
- Validate endpoint connectivity with a non-destructive briefing fetch.
- Pull briefing data for a selected period/resources.
- Summarize result counts, aggregations, and latest records.
- If requested, prepare commands suitable for cron/automation.
Required Environment
Require these variables before any live fetch:
AGENT_GATEWAY_TOKEN(bearer token — set in the Rails app initializer asc.auth_token)AGENT_GATEWAY_SECRET(path secret — set asc.path_secret)
The OpenClaw helper script may also read:
RAILS_GATEWAY_URL(full/briefingURL, e.g.https://myapp.com/agent-gateway/<secret>/briefing)RAILS_GATEWAY_TOKEN(maps to bearer token)
If env vars are missing, stop and show the exact export commands needed.
Authentication
The gem uses two-layer auth:
- Path secret — embedded in the URL (
/agent-gateway/<secret>/briefing). Wrong value returns 404 (endpoint appears nonexistent). - Bearer token — sent via
Authorizationheader. Wrong/missing value returns 401.
Both are compared using timing-safe secure_compare.
Command Patterns
Direct curl
curl -H "Authorization: Bearer $AGENT_GATEWAY_TOKEN" \
"https://myapp.com/agent-gateway/$AGENT_GATEWAY_SECRET/briefing?period=7d&resources=users,orders"
Helper script
Prefer the local helper script when present:
/home/node/.openclaw/workspace/scripts/rails-gateway-briefing --period 7d
With explicit env vars:
RAILS_GATEWAY_URL='https://myapp.com/agent-gateway/<secret>/briefing' \
RAILS_GATEWAY_TOKEN='***' \
/home/node/.openclaw/workspace/scripts/rails-gateway-briefing --period 7d --resources users,orders
Query Parameters
| Param | Description | Example |
|---|---|---|
period |
Time window: 1d, 7d, 30d, 90d, 1y, all |
?period=30d |
resources |
Comma-separated resource keys | ?resources=users,orders |
latest |
Override latest count for all resources | ?latest=10 |
Resource-Scoped Pulls
Resources are configured per-app via the gem's DSL. Common examples:
--resources users--resources orders
Use --latest N to cap detailed rows while keeping counts.
The gem DSL also supports aggregations (count, sum, avg) on numeric
columns — these appear in the response alongside count and latest.
Safety Rules
- Never print or echo live tokens in user-visible output.
- Redact secrets in pasted commands.
- Do not perform external write actions unless explicitly asked.
- Keep pulls read-only (
briefingendpoint usage only).
Troubleshooting
If calls fail:
- Confirm helper script exists and is executable.
- Confirm endpoint URL includes
/agent-gateway/<secret>/briefing. - Confirm bearer token is current (
AGENT_GATEWAY_TOKEN). - Check two-layer auth: 404 = bad path secret, 401 = bad bearer token.
- Retry with minimal scope (
--resources users --period 7d --latest 1). - Report exact error class (auth/network/format), then propose a fix.
For reusable command snippets and output interpretation, read
references/usage.md.
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.