agentleFS
nodealchemynodealchemy/powernode-platform/server/CLAUDE.md

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
  1. Very specific:

    Always use render_success(), render_error()

    line 9
  2. Very specific:

    Use current_user.has_permission?('name') - NEVER permissions.include?()

    line 10
  3. Distinctive:

    Before writing code for a non-trivial change:

    line 20
  4. Very specific:

    NEVER: create job classes in server/app/jobs/

    line 94
  5. Very specific:

    Use platform.discover_skills with your task description first.

    line 100

≈ “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.

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

Server CLAUDE.md

Rails 8 API backend for Powernode.

Critical Rules

  • # frozen_string_literal: true pragma in every .rb file
  • Rails.logger only - no puts/print
  • Always use render_success(), render_error()
  • Use current_user.has_permission?('name') - NEVER permissions.include?()
  • Controllers: Api::V1 namespace, inherit ApplicationController
  • Migrations: Index in t.references declaration - 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:

  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

Before Creating/Modifying

TaskMCP Query
Models or migrationsplatform.search_knowledge_graph — entity relationships, column conventions, FK patterns
Servicesplatform.discover_skills + platform.code_semantic_search — find existing services by meaning before creating new ones
Controllers or API endpointsplatform.query_learnings — API anti-patterns, response format gotchas
Refactoring shared codeplatform.code_blast_radius — trace all files affected before renaming/moving symbols
Understanding unfamiliar codeplatform.code_file_skeleton + platform.code_context_tree — structure without reading every line
MCP tools or actionsplatform.search_knowledge query: "MCP tool schema"
Permission logicplatform.search_knowledge query: "permission system"
AI agent featuresplatform.search_knowledge_graph query: "AI orchestration"
Billing/paymentsplatform.search_knowledge query: "billing" or "payment integration"
Agent/team resourcesplatform.list_agents / platform.list_teams — inspect existing resources
Memory tier operationsplatform.search_memory + platform.memory_stats — understand current memory state
RAG / knowledge basesplatform.list_knowledge_bases + platform.query_knowledge_base — check existing document stores
Pipeline / CI/CDplatform.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/servicesplatform.search_knowledge query: "agent autonomy"
Kill switch / escalationplatform.search_knowledge query: "kill switch"

During Work

  • Before new associations: platform.search_knowledge_graph for existing entity relationships to avoid duplication
  • Before new service patterns: platform.query_learnings category: pattern + platform.code_semantic_search — check if the pattern exists or has known issues
  • Before adding gems: platform.query_learnings query: "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 typeContribution
New model/migration patternplatform.extract_to_knowledge_graph — entities, relationships, FK conventions
Service bug fixplatform.create_learning category: discovery — root cause + fix
New API patternplatform.create_learning category: best_practice
Reusable serviceplatform.create_skill — codify the approach

Context-Aware Documentation (file fallback)

Query MCP first. Use these files when MCP returns no relevant results:

When working onMCP QueryFile 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/servicesplatform.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 DatabaseCleaner with :deletion strategy (avoids TRUNCATE deadlocks)
  • 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

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.