RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Diff/ssdeanx-langgraph-dm-clinerules-agents ↔ ssdeanx-langgraph-dm-windsurf-rules-graphs

Comparison

A · Cline rules · ssdeanx/langgraph-dmB · Windsurf rules · ssdeanx/langgraph-dm
What each file covers, counted
DimensionSharedOnly in AOnly in BOverlap
Sections0560%
Commands000—
Section tags0210%

What each file covers

Sections

0 shared · 5 only in A · 6 only in B
  • − Agents Guidelines
  • − Agent Responsibilities
  • − Agent Development Principles
  • − Agent Architectures
  • − Agent Type Definitions (`src/agent/state.ts`)
  • + Graph Rules
  • + Rule 1: Mandatory Entry Node
  • + Rule 2: Conditional Routing Logic
  • + Rule 3: Node Error Handling
  • + Rule 4: Logging for Node Transitions
  • + Rule 5: Termination Conditions

Commands

neither file has any

Section tags

0 shared · 2 only in A · 1 only in B
  • − types
  • − agent-behaviour
  • + do-not

Line diff

+24 added−23 removed11 unchanged31.4% identical
ssdeanx/langgraph-dm · .clinerules/agents.md
@@ −1 @@
1---
2glob: "**/*.ts"
3description: "Langgraph Agents Guidelines"
4---
5# Agents Guidelines
6 
7## Agent Responsibilities
8 
9* **Supervisor:** Acts as the central orchestrator (`src/agent/supervisor.ts`), directing the flow between specialized agents based on the current state and user intent. It should be robust in decision-making and error recovery.
10* **Specialized Agents:** Each agent (e.g., `reactAgent`, `research_agent`, `documentation_agent`) should have a clearly defined purpose and set of tools. They should focus on their specific domain, update the `AgentState` with their results, and return control to the supervisor upon completion or if an unhandled error occurs.
11* **Chat Agent (`chatNode`):** Provides general conversational responses and acts as a fallback for queries not requiring specialized agent intervention.
12* **Tool-Calling Agent (ReAct):** Uses an LLM to decide the control flow, selecting and using various tools, retaining memory, and planning multi-step actions.
13 
14## Agent Development Principles
 
 
 
15 
16* **Modularity:** Each agent should be a self-contained unit, with its own logic and potentially its own set of tools. This facilitates reusability and easier debugging.
17* **State Management:** Agents must correctly interact with and update the `AgentState` to ensure continuity and accurate context passing throughout the graph. Use `Annotation` and reducers for precise state modifications.
18* **Tool Integration:** Agents should seamlessly integrate and utilize the available tools (`src/tools/*`) to perform their tasks. Ensure proper input validation and error handling when calling tools. Consider `ToolNode` for simplified tool execution.
19* **Error Handling:** Implement agent-specific error handling to gracefully manage failures and report back to the supervisor or user.
20* **Logging:** Use the `winston` logger (`src/config/logger.ts`) for tracing agent execution, decisions, and tool calls.
21* **Control Flow:** Agents can return `Command` objects to combine state updates and dynamic routing (e.g., handoffs between agents).
22* **Human-in-the-Loop:** Design agents to support human intervention for approvals, state editing, or input collection using LangGraph's `interrupt()` function.
23 
24## Agent Architectures
 
 
 
25 
26* **Router:** LLM selects a single path from options.
27* **Tool-Calling Agent (ReAct):** Combines tool usage, memory, and planning for multi-step decision-making.
28* **Multi-Agent Systems:** Break down complex problems into smaller, independent agents collaborating via networks, supervisors, or hierarchical structures. Handoffs are crucial for communication.
 
29 
30## Agent Type Definitions (`src/agent/state.ts`)
 
 
 
31 
32* The `AgentType` enum defines the various types of agents supported in the system, enabling clear categorization and routing within the `StateGraph`.
33* When adding new agent types, ensure they are properly defined in `AgentType` and integrated into the `StateGraph` in `src/agent/graph.ts`.
34 
ssdeanx/langgraph-dm · .windsurf/rules/graphs.md
@@ +1 @@
1---
2trigger: manual
 
3---
 
4 
5# Graph Rules
6 
7These rules govern the construction and management of graph workflows within the LangGraph project. The purpose is to ensure that graphs are structured correctly, maintain logical flow, and adhere to best practices for conversational agent interactions.
 
 
 
8 
9## Rule 1: Mandatory Entry Node
10- **Description**: All graph workflows must include an entry node to process initial user input. This node is responsible for initializing the conversation state and ensuring that user input is captured correctly.
11- **Rationale**: The entry node sets the foundation for the conversation flow, as seen in 'src/agent/graph.ts' where the 'entryNode' function processes the initial user input into the state.
12- **Enforcement**: During graph design or updates, verify that an 'entry' node is defined and connected to the START point.
13 
14## Rule 2: Conditional Routing Logic
15- **Description**: Graphs must implement conditional routing logic to determine the next node based on the state or supervisor decisions. This ensures dynamic conversation flow.
16- **Rationale**: In 'src/agent/graph.ts', the 'routeMessages' function uses state.next to decide whether to proceed to a chat node or end the conversation, demonstrating the importance of conditional edges.
17- **Enforcement**: Ensure that conditional edges are defined for supervisor nodes to route to appropriate nodes or END.
 
 
 
18 
19## Rule 3: Node Error Handling
20- **Description**: Each node in the graph must include error handling to manage model invocation failures or unexpected issues during processing.
21- **Rationale**: Error handling is critical for robustness, as shown in 'src/agent/graph.ts' where 'safeModelInvoke' and 'handleGlobalError' are used to catch and manage errors during model calls.
22- **Enforcement**: Include try-catch blocks or error handling mechanisms in node implementations.
23 
24## Rule 4: Logging for Node Transitions
25- **Description**: Log transitions between nodes to track the flow of conversation and aid in debugging graph execution.
26- **Rationale**: Logging is implemented in 'src/agent/graph.ts' for chat and entry nodes to monitor processing, which is essential for understanding graph behavior.
27- **Enforcement**: Add logging statements at the start and end of each node's processing logic.
28 
29## Rule 5: Termination Conditions
30- **Description**: Define clear termination conditions within the graph to prevent infinite loops and ensure conversations can conclude appropriately.
31- **Rationale**: The 'routeMessages' function in 'src/agent/graph.ts' checks for 'FINISH' or 'END' to route to END, providing a clear exit path.
32- **Enforcement**: Verify that routing logic includes checks for termination signals or states.
33 
34These rules are designed to maintain the integrity and efficiency of graph-based workflows in LangGraph, ensuring that conversational agents operate smoothly and reliably. Review these during graph design and updates to ensure compliance.
 
35 
@@ −1 +1 @@
11 ---
2−glob: "**/*.ts"
3−description: "Langgraph Agents Guidelines"
2+trigger: manual
43 ---
5−# Agents Guidelines
64  
7−## Agent Responsibilities
5+# Graph Rules
86  
9−* **Supervisor:** Acts as the central orchestrator (`src/agent/supervisor.ts`), directing the flow between specialized agents based on the current state and user intent. It should be robust in decision-making and error recovery.
10−* **Specialized Agents:** Each agent (e.g., `reactAgent`, `research_agent`, `documentation_agent`) should have a clearly defined purpose and set of tools. They should focus on their specific domain, update the `AgentState` with their results, and return control to the supervisor upon completion or if an unhandled error occurs.
11−* **Chat Agent (`chatNode`):** Provides general conversational responses and acts as a fallback for queries not requiring specialized agent intervention.
12−* **Tool-Calling Agent (ReAct):** Uses an LLM to decide the control flow, selecting and using various tools, retaining memory, and planning multi-step actions.
7+These rules govern the construction and management of graph workflows within the LangGraph project. The purpose is to ensure that graphs are structured correctly, maintain logical flow, and adhere to best practices for conversational agent interactions.
138  
14−## Agent Development Principles
9+## Rule 1: Mandatory Entry Node
10+- **Description**: All graph workflows must include an entry node to process initial user input. This node is responsible for initializing the conversation state and ensuring that user input is captured correctly.
11+- **Rationale**: The entry node sets the foundation for the conversation flow, as seen in 'src/agent/graph.ts' where the 'entryNode' function processes the initial user input into the state.
12+- **Enforcement**: During graph design or updates, verify that an 'entry' node is defined and connected to the START point.
1513  
16−* **Modularity:** Each agent should be a self-contained unit, with its own logic and potentially its own set of tools. This facilitates reusability and easier debugging.
17−* **State Management:** Agents must correctly interact with and update the `AgentState` to ensure continuity and accurate context passing throughout the graph. Use `Annotation` and reducers for precise state modifications.
18−* **Tool Integration:** Agents should seamlessly integrate and utilize the available tools (`src/tools/*`) to perform their tasks. Ensure proper input validation and error handling when calling tools. Consider `ToolNode` for simplified tool execution.
19−* **Error Handling:** Implement agent-specific error handling to gracefully manage failures and report back to the supervisor or user.
20−* **Logging:** Use the `winston` logger (`src/config/logger.ts`) for tracing agent execution, decisions, and tool calls.
21−* **Control Flow:** Agents can return `Command` objects to combine state updates and dynamic routing (e.g., handoffs between agents).
22−* **Human-in-the-Loop:** Design agents to support human intervention for approvals, state editing, or input collection using LangGraph's `interrupt()` function.
14+## Rule 2: Conditional Routing Logic
15+- **Description**: Graphs must implement conditional routing logic to determine the next node based on the state or supervisor decisions. This ensures dynamic conversation flow.
16+- **Rationale**: In 'src/agent/graph.ts', the 'routeMessages' function uses state.next to decide whether to proceed to a chat node or end the conversation, demonstrating the importance of conditional edges.
17+- **Enforcement**: Ensure that conditional edges are defined for supervisor nodes to route to appropriate nodes or END.
2318  
24−## Agent Architectures
19+## Rule 3: Node Error Handling
20+- **Description**: Each node in the graph must include error handling to manage model invocation failures or unexpected issues during processing.
21+- **Rationale**: Error handling is critical for robustness, as shown in 'src/agent/graph.ts' where 'safeModelInvoke' and 'handleGlobalError' are used to catch and manage errors during model calls.
22+- **Enforcement**: Include try-catch blocks or error handling mechanisms in node implementations.
2523  
26−* **Router:** LLM selects a single path from options.
27−* **Tool-Calling Agent (ReAct):** Combines tool usage, memory, and planning for multi-step decision-making.
28−* **Multi-Agent Systems:** Break down complex problems into smaller, independent agents collaborating via networks, supervisors, or hierarchical structures. Handoffs are crucial for communication.
24+## Rule 4: Logging for Node Transitions
25+- **Description**: Log transitions between nodes to track the flow of conversation and aid in debugging graph execution.
26+- **Rationale**: Logging is implemented in 'src/agent/graph.ts' for chat and entry nodes to monitor processing, which is essential for understanding graph behavior.
27+- **Enforcement**: Add logging statements at the start and end of each node's processing logic.
2928  
30−## Agent Type Definitions (`src/agent/state.ts`)
29+## Rule 5: Termination Conditions
30+- **Description**: Define clear termination conditions within the graph to prevent infinite loops and ensure conversations can conclude appropriately.
31+- **Rationale**: The 'routeMessages' function in 'src/agent/graph.ts' checks for 'FINISH' or 'END' to route to END, providing a clear exit path.
32+- **Enforcement**: Verify that routing logic includes checks for termination signals or states.
3133  
32−* The `AgentType` enum defines the various types of agents supported in the system, enabling clear categorization and routing within the `StateGraph`.
33−* When adding new agent types, ensure they are properly defined in `AgentType` and integrated into the `StateGraph` in `src/agent/graph.ts`.
34+These rules are designed to maintain the integrity and efficiency of graph-based workflows in LangGraph, ensuring that conversational agents operate smoothly and reliably. Review these during graph design and updates to ensure compliance.
3435  
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack