powernode-platform / server
CLAUDE.md4 starsChanged 18 days agoMITView on GitHub
Rails 8 API backend for Powernode. Query MCP before non-trivial backend changes (full protocol: conventions/mcp-first-workflow.md). Before writing code for a non-trivial change: 1. platform.query_learnings — check for existing patterns/gotchas in the area being modified 2. platform.search_knowledge — find relevant procedures/references for the subsystem 3. platform.search_knowledge_graph — understand entity relationships that may be affected Query MCP first. Use these files when MCP returns no relevant results:
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Always use render_success(), render_error()
- Very specific: line 10
Use current_user.has_permission?('name') - NEVER permissions.include?()
- Distinctive: line 20
Before writing code for a non-trivial change:
- Very specific: line 94
NEVER: create job classes in server/app/jobs/
- Very specific: line 100
Use platform.discover_skills with your task description first.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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.
Files
Server CLAUDE.md
Rails 8 API backend for Powernode.
Critical Rules
# frozen_string_literal: truepragma in every .rb fileRails.loggeronly - no puts/print- Always use
render_success(),render_error() - Use
current_user.has_permission?('name')- NEVERpermissions.include?() - Controllers:
Api::V1namespace, inherit ApplicationController - Migrations: Index in
t.referencesdeclaration - never separate
MCP-First Backend Workflow
Query MCP before non-trivial backend changes (full protocol: conventions/mcp-first-workflow.md).
Starting a change
Before writing code for a non-trivial change:
platform.query_learnings— check for existing patterns/gotchas in the area being modifiedplatform.search_knowledge— find relevant procedures/references for the subsystemplatform.search_knowledge_graph— understand entity relationships that may be affected
Before Creating/Modifying
| Task | MCP Query |
| Models or migrations | platform.search_knowledge_graph — entity relationships, column conventions, FK patterns |
| Services | platform.discover_skills + platform.code_semantic_search — find existing services by meaning before creating new ones |
| Controllers or API endpoints | platform.query_learnings — API anti-patterns, response format gotchas |
| Refactoring shared code | platform.code_blast_radius — trace all files affected before renaming/moving symbols |
| Understanding unfamiliar code | platform.code_file_skeleton + platform.code_context_tree — structure without reading every line |
| MCP tools or actions | platform.search_knowledge query: "MCP tool schema" |
| Permission logic | platform.search_knowledge query: "permission system" |
| AI agent features | platform.search_knowledge_graph query: "AI orchestration" |
| Billing/payments | platform.search_knowledge query: "billing" or "payment integration" |
| Agent/team resources | platform.list_agents / platform.list_teams — inspect existing resources |
| Memory tier operations | platform.search_memory + platform.memory_stats — understand current memory state |
| RAG / knowledge bases | platform.list_knowledge_bases + platform.query_knowledge_base — check existing document stores |
| Pipeline / CI/CD | platform.list_pipelines + platform.get_pipeline_status — verify pipeline state |
| Content (KB articles / pages) | platform.list_kb_articles / platform.list_pages — check existing content |
| Autonomy models/services | platform.search_knowledge query: "agent autonomy" |
| Kill switch / escalation | platform.search_knowledge query: "kill switch" |
During Work
- Before new associations:
platform.search_knowledge_graphfor existing entity relationships to avoid duplication - Before new service patterns:
platform.query_learningscategory:pattern+platform.code_semantic_search— check if the pattern exists or has known issues - Before adding gems:
platform.query_learningsquery: "gem name" — check for known integration gotchas - Before refactoring:
platform.code_blast_radius— understand full impact before changing shared symbols - Before adding files:
platform.code_context_tree— understand directory structure and naming conventions
After Work (MANDATORY for non-trivial changes)
| Change type | Contribution |
| New model/migration pattern | platform.extract_to_knowledge_graph — entities, relationships, FK conventions |
| Service bug fix | platform.create_learning category: discovery — root cause + fix |
| New API pattern | platform.create_learning category: best_practice |
| Reusable service | platform.create_skill — codify the approach |
Context-Aware Documentation (file fallback)
Query MCP first. Use these files when MCP returns no relevant results:
| When working on | MCP Query | File Fallback |
app/services/mcp/* | platform.search_knowledge query: "MCP tool" | concepts/mcp-and-tools.md |
app/models/ai/* | platform.search_knowledge_graph query: "AI model" | concepts/agents-and-autonomy.md |
app/controllers/api/v1/* | platform.search_knowledge query: "API standards" | reference/api/overview.md |
db/migrate/* | platform.search_knowledge query: "UUID migration" | concepts/data-model.md |
| Permission models/services | platform.search_knowledge query: "permission system" | concepts/permissions.md |
Backend MCP Tool Reference
Full tool catalog with parameters: reference/auto/mcp-tools.md (regenerable via rails mcp:generate_tool_catalog). To load a tool's schema in a session, use ToolSearch (e.g. select:mcp__powernode__platform_search_knowledge).
Test Execution
bundle exec rspec spec/ # Run full suite
bundle exec rspec spec/path_spec.rb # Run single file
bundle exec rspec spec/path_spec.rb:42 # Run single example- Uses
DatabaseCleanerwith:deletionstrategy (avoidsTRUNCATEdeadlocks) - Transactional fixtures enabled — each test rolls back automatically
- Frontend tests and TypeScript checks are always safe to run concurrently
Worker Architecture
- This server does NOT run Sidekiq — the worker is a separate service (
worker/) - NEVER create job classes in
server/app/jobs/ - The worker communicates with this server via HTTP API only
- Background work is dispatched to the worker, not run in-process
Key Specialists
Use platform.discover_skills with your task description first. File fallback:
- Backend guide — Rails architecture, API patterns, data modeling, background jobs
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
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.

