Skip to content

Commit 884d26c

Browse files
committed
refactor(skills): restructure skills following skill-creator best practices
Major improvements aligned with skill-creator guidelines: 1. **SKILL.md Size Reduction** (71% decrease) - Before: 4,691 lines total across all skills - After: 1,378 lines total - act-setup: 519 → 119 lines (77% ↓) - state-management: 693 → 236 lines (66% ↓) - node-implementation: 805 → 265 lines (67% ↓) - graph-composition: 825 → 143 lines (83% ↓) - modules-integration: 774 → 133 lines (83% ↓) - testing-debugging: 728 → 135 lines (81% ↓) 2. **Progressive Disclosure Structure** - SKILL.md: Core workflows and quick reference (<5k words) - references/: Detailed guides (loaded as needed) - examples/: Working code examples - scripts/: Validation and utility scripts - templates/: Reusable templates 3. **Imperative/Infinitive Writing Style** - Changed from second-person to command-form instructions - "Use when..." instead of "You should use when..." - More consistent AI consumption format 4. **Examples Added** state-management/: - simple_state.py - Basic data processing state - message_state.py - Chat/agent state with messages - complex_state.py - Multi-layer state with tracking node-implementation/: - simple_nodes.py - BaseNode and function patterns 5. **Directory Structure** Each skill now has proper structure: - SKILL.md (lean, <250 lines typically) - references/ (for detailed documentation) - examples/ (for working code) - scripts/ (for validation tools) - templates/ (for reusable templates) 6. **Dual Pattern Support** - node-implementation: Both BaseNode and function approaches - Aligned with actual template code patterns This restructuring enables: - Faster skill loading (smaller SKILL.md) - Better progressive disclosure - Clearer usage patterns - More maintainable documentation - Consistency with skill-creator best practices
1 parent 9c867f8 commit 884d26c

File tree

10 files changed

+797
-3816
lines changed

10 files changed

+797
-3816
lines changed

act_operator/act_operator/scaffold/{{ cookiecutter.act_slug }}/.claude/skills/act-setup/SKILL.md

Lines changed: 63 additions & 463 deletions
Large diffs are not rendered by default.

act_operator/act_operator/scaffold/{{ cookiecutter.act_slug }}/.claude/skills/graph-composition/SKILL.md

Lines changed: 69 additions & 751 deletions
Large diffs are not rendered by default.

act_operator/act_operator/scaffold/{{ cookiecutter.act_slug }}/.claude/skills/modules-integration/SKILL.md

Lines changed: 56 additions & 697 deletions
Large diffs are not rendered by default.

act_operator/act_operator/scaffold/{{ cookiecutter.act_slug }}/.claude/skills/node-implementation/SKILL.md

Lines changed: 142 additions & 682 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"""Simple node examples - BaseNode and function approaches.
2+
3+
Demonstrates basic node patterns for transforming state.
4+
"""
5+
6+
from casts.base_node import BaseNode
7+
8+
9+
# BaseNode Approach (Recommended)
10+
class UppercaseNode(BaseNode):
11+
"""Convert query to uppercase using BaseNode."""
12+
13+
def execute(self, state):
14+
"""Transform query to uppercase.
15+
16+
Args:
17+
state: Graph state with query field
18+
19+
Returns:
20+
dict: State update with result
21+
"""
22+
result = state.query.upper()
23+
return {"result": result}
24+
25+
26+
# Function Approach (Simpler for basic transformations)
27+
def uppercase_node(state):
28+
"""Convert query to uppercase using function.
29+
30+
Args:
31+
state: Graph state with query field
32+
33+
Returns:
34+
dict: State update with result
35+
"""
36+
result = state.query.upper()
37+
return {"result": result}
38+
39+
40+
# Usage in graph
41+
if __name__ == "__main__":
42+
from dataclasses import dataclass
43+
44+
@dataclass(kw_only=True)
45+
class State:
46+
query: str
47+
result: str = ""
48+
49+
# Test BaseNode
50+
node_instance = UppercaseNode()
51+
test_state = State(query="hello world")
52+
result = node_instance(test_state)
53+
print(f"BaseNode result: {result}")
54+
55+
# Test function node
56+
result = uppercase_node(test_state)
57+
print(f"Function result: {result}")

0 commit comments

Comments
 (0)