Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 104 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,36 +169,123 @@ Skills can be used individually or as a workflow:
(developing-cast: implements sub-cast, manages dependencies per CLAUDE.md commands)
```

## Architecture

### Module Dependency

The diagram below shows how modules connect within a Cast.

```mermaid
graph TD
LG["graph.py"] -->|inherits| BG["base_graph.py"]
LG -->|imports| S["state.py"]
LG -->|imports| N["nodes.py"]
LG -->|imports| CD["conditions.py"]
N -->|inherits| BN["base_node.py"]
N -.->|optional| A["agents.py"]
N -.->|optional| U["utils.py"]
A -.->|uses| M["models.py"]
A -.->|uses| P["prompts.py"]
A -.->|uses| T["tools.py"]
A -.->|uses| MW["middlewares.py"]

classDef required fill:#4a9eff,stroke:#2d7cd6,color:#fff
classDef optional fill:#a0a0a0,stroke:#808080,color:#fff
classDef base fill:#34c759,stroke:#28a745,color:#fff
classDef entry fill:#ff9500,stroke:#e68a00,color:#fff

class LG entry
class G,S,N required
class BG,BN base
class CD,A,T,MW,M,P,U optional
```

> **Legend**: 🟠 Entry Point / πŸ”΅ Required / 🟒 Base Class / ⚫ Optional

### Execution Flow

```mermaid
sequenceDiagram
participant G as Graph
participant N as Node (BaseNode)
participant St as State

G->>St: Initialize State from InputState
loop For each node in graph
G->>N: node.__call__(state, config, runtime)
N->>N: execute(state, ...) β†’ dict
N->>St: Merge returned dict into State
end
G->>G: Extract OutputState β†’ Result
```

### Skill-Driven Development Flow

```mermaid
sequenceDiagram
participant U as Developer
box rgba(100, 149, 237, 0.15) Agent Skills
participant AA as architecting-act
participant DC as developing-cast
participant TC as testing-cast
end
participant P as Act Project

Note over U,P: Phase 1 β€” Architecture Design
U->>AA: Instruct the agent to design the Act/Cast architecture
AA->>U: AskUserQuestion (purpose, pattern, tech stack)
U->>AA: Answer selections
AA->>P: Generate CLAUDE.md (architecture spec)

Note over U,P: Phase 2 β€” Implementation
U->>DC: Instruct the agent to implement the Cast's Modules
DC->>P: Read CLAUDE.md (architecture spec)
DC->>P: state.py β†’ nodes.py β†’ conditions.py β†’ optional modules β†’ graph.py
DC->>P: Install dependencies (uv add)

Note over U,P: Phase 3 β€” Testing
U->>TC: Instruct the agent to test the Cast
TC->>P: Read implementation code
TC->>P: Node unit tests + Graph integration tests
TC->>P: uv run pytest --cov
```

## Project Structure

```
my_workflow/
β”œβ”€β”€ .claude/
β”‚ └── skills/ # AI collaboration guides
β”‚ β”œβ”€β”€ architecting-act/ # Architecture design & development commands
β”‚ β”‚ β”œβ”€β”€ resources/ # Design patterns, questions, decision matrices
β”‚ β”‚ β”œβ”€β”€ scripts/ # Architecture validation (validate_architecture.py)
β”‚ β”‚ └── templates/ # CLAUDE.md generation templates
β”‚ β”œβ”€β”€ developing-cast/ # Implementation patterns
β”‚ β”‚ └── resources/ # 50+ LangGraph patterns (core, agents, memory, middleware, ...)
β”‚ └── testing-cast/ # Testing strategies
β”‚ └── resources/ # Mocking, fixtures, coverage guides
β”œβ”€β”€ casts/
β”‚ β”œβ”€β”€ base_node.py # Base node class
β”‚ β”œβ”€β”€ base_graph.py # Base graph utilities
β”‚ β”œβ”€β”€ base_node.py # Base node class (sync/async, signature validation)
β”‚ β”œβ”€β”€ base_graph.py # Base graph class (abstract build method)
β”‚ └── chatbot/ # Your cast (graph package)
β”‚ β”œβ”€β”€ modules/
β”‚ β”‚ β”œβ”€β”€ state.py # Graph state definition
β”‚ β”‚ β”œβ”€β”€ nodes.py # Node implementations
β”‚ β”‚ β”œβ”€β”€ agents.py # Agent configurations
β”‚ β”‚ β”œβ”€β”€ tools.py # Tool definitions
β”‚ β”‚ β”œβ”€β”€ models.py # LLM model configs
β”‚ β”‚ β”œβ”€β”€ conditions.py # Routing conditions
β”‚ β”‚ β”œβ”€β”€ middlewares.py # Custom middleware
β”‚ β”‚ └── prompts.py # Prompt templates
β”‚ β”œβ”€β”€ graph.py # Graph assembly
β”‚ └── pyproject.toml # Cast dependencies
β”‚ β”‚ β”œβ”€β”€ state.py # [Required] InputState, OutputState, State
β”‚ β”‚ β”œβ”€β”€ nodes.py # [Required] Node implementations (BaseNode subclass)
β”‚ β”‚ β”œβ”€β”€ agents.py # [Optional] Agent configurations
β”‚ β”‚ β”œβ”€β”€ tools.py # [Optional] Tool definitions / MCP adapters
β”‚ β”‚ β”œβ”€β”€ models.py # [Optional] LLM model configs
β”‚ β”‚ β”œβ”€β”€ conditions.py # [Optional] Routing conditions
β”‚ β”‚ β”œβ”€β”€ middlewares.py # [Optional] Lifecycle hooks (before/after agent/model)
β”‚ β”‚ β”œβ”€β”€ prompts.py # [Optional] Prompt templates
β”‚ β”‚ └── utils.py # [Optional] Helper functions
β”‚ β”œβ”€β”€ graph.py # Graph assembly (BaseGraph subclass β†’ entry point)
β”‚ └── pyproject.toml # Cast-specific dependencies
β”œβ”€β”€ tests/
β”‚ β”œβ”€β”€ cast_tests/ # Graph-level tests
β”‚ └── node_tests/ # Unit tests
β”œβ”€β”€ langgraph.json # LangGraph configuration
β”œβ”€β”€ pyproject.toml # Monorepo dependencies
β”œβ”€β”€ TEMPLATE_README.md # Template Using Guideline
β”‚ β”œβ”€β”€ cast_tests/ # Graph integration tests
β”‚ └── node_tests/ # Node unit tests
β”œβ”€β”€ langgraph.json # LangGraph entry points (graph registration)
β”œβ”€β”€ pyproject.toml # Monorepo workspace (uv workspace, shared deps)
β”œβ”€β”€ TEMPLATE_README.md # Template usage guideline
└── README.md
```

Expand Down
121 changes: 104 additions & 17 deletions README_KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,35 +169,122 @@ claude
(developing-cast: μ„œλΈŒ 캐슀트 κ΅¬ν˜„, CLAUDE.md λͺ…λ Ήμ–΄λ‘œ μ˜μ‘΄μ„± 관리)
```

## μ•„ν‚€ν…μ²˜

### λͺ¨λ“ˆ μ˜μ‘΄μ„±

μ•„λž˜ λ‹€μ΄μ–΄κ·Έλž¨μ€ Cast λ‚΄λΆ€ λͺ¨λ“ˆ κ°„μ˜ μ—°κ²° ꡬ쑰λ₯Ό λ³΄μ—¬μ€λ‹ˆλ‹€.

```mermaid
graph TD
LG["graph.py"] -->|상속| BG["base_graph.py"]
LG -->|κ°€μ Έμ˜€κΈ°| S["state.py"]
LG -->|κ°€μ Έμ˜€κΈ°| N["nodes.py"]
LG -->|κ°€μ Έμ˜€κΈ°| CD["conditions.py"]
N -->|상속| BN["base_node.py"]
N -.->|선택| A["agents.py"]
N -.->|선택| U["utils.py"]
A -.->|μ‚¬μš©| M["models.py"]
A -.->|μ‚¬μš©| P["prompts.py"]
A -.->|μ‚¬μš©| T["tools.py"]
A -.->|μ‚¬μš©| MW["middlewares.py"]

classDef required fill:#4a9eff,stroke:#2d7cd6,color:#fff
classDef optional fill:#a0a0a0,stroke:#808080,color:#fff
classDef base fill:#34c759,stroke:#28a745,color:#fff
classDef entry fill:#ff9500,stroke:#e68a00,color:#fff

class LG entry
class G,S,N required
class BG,BN base
class CD,A,T,MW,M,P,U optional
```

> **λ²”λ‘€**: 🟠 μ§„μž…μ  / πŸ”΅ ν•„μˆ˜ / 🟒 베이슀 클래슀 / ⚫ 선택적

### μ‹€ν–‰ 흐름

```mermaid
sequenceDiagram
participant G as κ·Έλž˜ν”„
participant N as λ…Έλ“œ (BaseNode)
participant St as μƒνƒœ(State)

G->>St: InputState둜 State μ΄ˆκΈ°ν™”
loop κ·Έλž˜ν”„ λ‚΄ 각 λ…Έλ“œμ— λŒ€ν•΄
G->>N: node.__call__(state, config, runtime)
N->>N: execute(state, ...) β†’ dict
N->>St: λ°˜ν™˜λœ dictλ₯Ό State에 병합
end
G->>G: OutputState μΆ”μΆœ β†’ κ²°κ³Ό
```

### μŠ€ν‚¬ 기반 개발 흐름

```mermaid
sequenceDiagram
participant U as Developer
box rgba(100, 149, 237, 0.15) Agent Skills
participant AA as @architecting-act
participant DC as @developing-cast
participant TC as @testing-cast
end
participant P as Act Project

Note over U,P: 1단계 β€” μ•„ν‚€ν…μ²˜ 섀계
U->>AA: Act/Cast μ•„ν‚€ν…μ²˜ 섀계 μ§€μ‹œ
AA->>U: AskUserQuestion (λͺ©μ , νŒ¨ν„΄, 기술 μŠ€νƒ)
U->>AA: 선택지 응닡
AA->>P: CLAUDE.md 생성 (μ•„ν‚€ν…μ²˜ λͺ…μ„Έ)

Note over U,P: 2단계 β€” κ΅¬ν˜„
U->>DC: Cast λͺ¨λ“ˆ κ΅¬ν˜„ μ§€μ‹œ
DC->>P: CLAUDE.md 읽기 (μ•„ν‚€ν…μ²˜ λͺ…μ„Έ)
DC->>P: state.py β†’ nodes.py β†’ conditions.py β†’ graph.py
DC->>P: μ˜μ‘΄μ„± μ„€μΉ˜ (uv add)

Note over U,P: 3단계 β€” ν…ŒμŠ€νŒ…
U->>TC: Cast ν…ŒμŠ€νŠΈ μ§€μ‹œ
TC->>P: κ΅¬ν˜„ μ½”λ“œ 읽기
TC->>P: λ…Έλ“œ λ‹¨μœ„ ν…ŒμŠ€νŠΈ + κ·Έλž˜ν”„ 톡합 ν…ŒμŠ€νŠΈ
TC->>P: uv run pytest --cov
```

## ν”„λ‘œμ νŠΈ ꡬ쑰

```
my_workflow/
β”œβ”€β”€ .claude/
β”‚ └── skills/ # AI ν˜‘μ—… κ°€μ΄λ“œ
β”‚ β”œβ”€β”€ architecting-act/ # μ•„ν‚€ν…μ²˜ 섀계 및 개발 λͺ…λ Ήμ–΄
β”‚ β”‚ β”œβ”€β”€ resources/ # λ””μžμΈ νŒ¨ν„΄, 질문, κ²°μ • 맀트릭슀
β”‚ β”‚ β”œβ”€β”€ scripts/ # μ•„ν‚€ν…μ²˜ 검증 (validate_architecture.py)
β”‚ β”‚ └── templates/ # CLAUDE.md 생성 ν…œν”Œλ¦Ώ
β”‚ β”œβ”€β”€ developing-cast/ # κ΅¬ν˜„ νŒ¨ν„΄
β”‚ β”‚ └── resources/ # 50개 μ΄μƒμ˜ LangGraph νŒ¨ν„΄ (core, agents, memory, middleware, ...)
β”‚ └── testing-cast/ # ν…ŒμŠ€νŒ… μ „λž΅
β”‚ └── resources/ # λͺ¨ν‚Ή, ν”½μŠ€μ²˜, 컀버리지 κ°€μ΄λ“œ
β”œβ”€β”€ casts/
β”‚ β”œβ”€β”€ base_node.py # 베이슀 λ…Έλ“œ 클래슀
β”‚ β”œβ”€β”€ base_graph.py # 베이슀 κ·Έλž˜ν”„ μœ ν‹Έλ¦¬ν‹°
β”‚ └── chatbot/ # 캐슀트(κ·Έλž˜ν”„ νŒ¨ν‚€μ§€)
β”‚ β”œβ”€β”€ base_node.py # 베이슀 λ…Έλ“œ 클래슀 (동기/비동기, μ‹œκ·Έλ‹ˆμ²˜ 검증)
β”‚ β”œβ”€β”€ base_graph.py # 베이슀 κ·Έλž˜ν”„ 클래슀 (좔상 build λ©”μ„œλ“œ)
β”‚ └── chatbot/ # 캐슀트 (κ·Έλž˜ν”„ νŒ¨ν‚€μ§€)
β”‚ β”œβ”€β”€ modules/
β”‚ β”‚ β”œβ”€β”€ state.py # κ·Έλž˜ν”„ μƒνƒœ μ •μ˜
β”‚ β”‚ β”œβ”€β”€ nodes.py # λ…Έλ“œ κ΅¬ν˜„
β”‚ β”‚ β”œβ”€β”€ agents.py # μ—μ΄μ „νŠΈ μ„€μ •
β”‚ β”‚ β”œβ”€β”€ tools.py # 도ꡬ μ •μ˜
β”‚ β”‚ β”œβ”€β”€ models.py # LLM λͺ¨λΈ μ„€μ •
β”‚ β”‚ β”œβ”€β”€ conditions.py # λΌμš°νŒ… 쑰건
β”‚ β”‚ β”œβ”€β”€ middlewares.py # μ»€μŠ€ν…€ 미듀웨어
β”‚ β”‚ └── prompts.py # ν”„λ‘¬ν”„νŠΈ ν…œν”Œλ¦Ώ
β”‚ β”œβ”€β”€ graph.py # κ·Έλž˜ν”„ 쑰립
β”‚ └── pyproject.toml # 캐슀트 μ˜μ‘΄μ„±
β”‚ β”‚ β”œβ”€β”€ state.py # [ν•„μˆ˜] InputState, OutputState, State
β”‚ β”‚ β”œβ”€β”€ nodes.py # [ν•„μˆ˜] λ…Έλ“œ κ΅¬ν˜„ (BaseNode μ„œλΈŒν΄λž˜μŠ€)
β”‚ β”‚ β”œβ”€β”€ agents.py # [선택] μ—μ΄μ „νŠΈ μ„€μ •
β”‚ β”‚ β”œβ”€β”€ tools.py # [선택] 도ꡬ μ •μ˜ / MCP μ–΄λŒ‘ν„°
β”‚ β”‚ β”œβ”€β”€ models.py # [선택] LLM λͺ¨λΈ μ„€μ •
β”‚ β”‚ β”œβ”€β”€ conditions.py # [선택] λΌμš°νŒ… 쑰건
β”‚ β”‚ β”œβ”€β”€ middlewares.py # [선택] 라이프사이클 ν›… (before/after agent/model)
β”‚ β”‚ β”œβ”€β”€ prompts.py # [선택] ν”„λ‘¬ν”„νŠΈ ν…œν”Œλ¦Ώ
β”‚ β”‚ └── utils.py # [선택] 헬퍼 ν•¨μˆ˜
β”‚ β”œβ”€β”€ graph.py # κ·Έλž˜ν”„ 쑰립 (BaseGraph μ„œλΈŒν΄λž˜μŠ€ β†’ μ§„μž…μ )
β”‚ └── pyproject.toml # μΊμŠ€νŠΈλ³„ μ˜μ‘΄μ„±
β”œβ”€β”€ tests/
β”‚ β”œβ”€β”€ cast_tests/ # κ·Έλž˜ν”„ 레벨 ν…ŒμŠ€νŠΈ
β”‚ └── node_tests/ # λ‹¨μœ„ ν…ŒμŠ€νŠΈ
β”œβ”€β”€ langgraph.json # LangGraph μ„€μ •
β”œβ”€β”€ pyproject.toml # λͺ¨λ…Έλ ˆν¬ μ˜μ‘΄μ„±
β”‚ β”œβ”€β”€ cast_tests/ # κ·Έλž˜ν”„ 톡합 ν…ŒμŠ€νŠΈ
β”‚ └── node_tests/ # λ…Έλ“œ λ‹¨μœ„ ν…ŒμŠ€νŠΈ
β”œβ”€β”€ langgraph.json # LangGraph μ§„μž…μ  (κ·Έλž˜ν”„ 등둝)
β”œβ”€β”€ pyproject.toml # λͺ¨λ…Έλ ˆν¬ μ›Œν¬μŠ€νŽ˜μ΄μŠ€ (uv workspace, 곡유 μ˜μ‘΄μ„±)
β”œβ”€β”€ TEMPLATE_README.md # ν…œν”Œλ¦Ώ μ‚¬μš© κ°€μ΄λ“œλΌμΈ
└── README.md
```
Expand Down