agentleFS
Md-NisarMd-Nisar/neuron/.claude/skills/add-graph-node/SKILL.md

add-graph-node

Skill1 starsChanged 8 days agoApache-2.0View on GitHub

Use when adding or changing a node, edge, or routing logic in the LangGraph StateGraph under src/neuron_agent/graphs/, or extending MainGraphState.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check for architectural creep: if this change introduces retrieval, a queue, custom persistence, or a subgraph, stop — AGENTS.md requires a …

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Graph Node

The graph in src/neuron_agent/graphs/ is intentionally simple (ARCHITECTURE.md: START -> agent -> END). Any change here should stay deliberate — this skill sequences the requirements from DEVELOPMENT.md and AGENTS.md so state scope and docs don't drift.

Steps

  1. Extend MainGraphState only with fields the graph actually owns. Don't add fields for data that belongs in services/ or a tool's own return value — state fields are for what the graph itself routes or persists on (DEVELOPMENT.md).
  2. Keep business logic out of the graph where practical — put it in services/ or a domain module, and have the node call into that (DEVELOPMENT.md, ARCHITECTURE.md component responsibilities table).
  3. Add explicit edges or conditional routing — no implicit fallthrough. If routing depends on state, make the condition function testable in isolation.
  4. Add graph tests in tests/graph/ covering:
    • Happy path
    • Failure path (the node's error handling / AppError classification)
    • State transitions (fields set/cleared as expected across the edge)
  5. Update ARCHITECTURE.md: the graph flow diagram (the flowchart LR under "Graph Flow") and, if state fields changed, the "State Model" section.
  6. Check for architectural creep: if this change introduces retrieval, a queue, custom persistence, or a subgraph, stop — AGENTS.md requires a concrete requirement and an ADR update under docs/decisions/ before adding any of those, not just a graph change.
  7. Run the quality gates: make format lint typecheck test security.

Common mistakes

  • Adding a state field "just in case" it's useful later — state is typed and shared across the graph; scope creep here is expensive to unwind.
  • Routing logic embedded directly in a node function instead of an isolated, testable condition.
  • Forgetting to update ARCHITECTURE.md's Mermaid diagram, so the doc silently drifts from the actual graph shape.

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.