@clawhub-harrylabsj-35a31b2850
Designs personalized resilience-building practices for adversity navigation and psychological recovery.
---
name: Resilience Building Architect
slug: resilience-building-architect
description: Designs personalized resilience-building practices for adversity navigation and psychological recovery.
tags: [resilience, mental-health, adversity, growth]
---
# Resilience Building Architect
## Overview
Resilience is the capacity to absorb disruption, adapt to change, and recover with strength from adversity. It is not an innate trait — it is a set of practices, perspectives, and supports that can be deliberately built.
The Resilience Building Architect helps users move beyond generic "stay positive" advice to create a concrete, personalized resilience system. It acknowledges that different people face different kinds of adversity — sudden loss, chronic stress, identity challenges, or cumulative burnout — and that each requires a tailored approach.
This skill draws on established frameworks from cognitive behavioral psychology, somatic experiencing, and post-traumatic growth research. Rather than offering one-size-fits-all exercises, it helps users diagnose their current resilience baseline, identify specific vulnerability patterns, and design a practice architecture that fits their life circumstances.
## How It Works
**1. Adversity Pattern Recognition**
The tool analyzes what type of adversity the user is navigating — acute shock, prolonged stress, identity disruption, or relational rupture — and tailors its response accordingly.
**2. The Resilience Inventory**
Users receive a structured self-assessment of their current resilience resources across four domains: Internal (beliefs, values, coping skills), Social (support network quality), Practical (material resources and practical skills), and Existential (sense of meaning and purpose).
**3. Practice Architecture Design**
Based on the inventory, the tool generates a Resilience Practice Plan — a set of daily and weekly micro-practices targeting the lowest-scoring domains. For someone low on Social resilience, this might include designing a "support map" and scheduling one meaningful check-in per week. For someone low on Existential resilience, it might include a values-clarity exercise.
**4. Recovery Protocol**
For acute adversity, the tool provides a 3-phase recovery protocol: Stabilize (immediate grounding and safety), Process (making sense of what happened), and Integrate (extracting growth and planning forward).
## Example Prompts
1. *"I just received a cancer diagnosis and I don't know how to tell my family or where to start"*
2. *"After 15 years with the same company, I was laid off and I feel completely unmoored"*
3. *"My parent's dementia has progressed and I'm becoming their full-time caregiver while working full-time"*
4. *"I went through a divorce last year and I thought I'd be "over it" by now but I'm not"*
5. *"I've been promoted to manager but I feel like an imposter and it's affecting my performance"*
## Safety & Boundaries
This skill is for self-reflection and personal development only. It does not provide medical, psychological, legal, or professional advice. Always consult qualified professionals for health, mental health, or legal concerns. Information provided is for educational purposes and should not replace professional guidance. This tool does not store personal data between sessions.
## Tips for Deepening Practice
- Resilience is not about bouncing back — it is about bouncing forward with new understanding
- Start with physical resilience (sleep, movement, breath) before tackling cognitive or emotional work
- A written "resilience map" identifying your warning signs and recovery supports is worth its weight in gold
- Small consistent practices beat dramatic interventions — 5 minutes daily is better than an hour once a month
- Isolation is the enemy of resilience — one genuine connection per day is a powerful antidote
## Related Skills
This skill pairs well with: **intuition-development-guide, curiosity-cultivator, sensory-awareness-enhancer**.
## About This Skill
This skill was developed as part of the Personal Growth Skills collection, designed to support continuous self-development across emotional, cognitive, and relational domains. It is a descriptive, non-prescriptive tool intended for reflective use by motivated individuals.
## When to Use This Skill
Use the Resilience Building Architect when facing significant adversity — a loss, a setback, a major transition, chronic stress that feels unmanageable, or simply when you sense your resilience reserves are running low. It is also valuable as a preventive practice: building resilience before you need it, like strengthening an immune system before flu season.
This skill is not a replacement for therapy or medical care. It is a structured self-development tool for people who want to build their capacity to navigate life's inevitable adversities with strength and grace.
## The Four Resilience Domains
Resilience is not a single trait — it is a composite of four distinct domains:
**Internal Resilience** encompasses your psychological resources: your core beliefs, the mental models you use to interpret events, your emotional regulation capacity, and your coping skills. People with strong internal resilience can experience the same difficult event as someone with weak internal resilience and emerge with very different outcomes.
**Social Resilience** is the quality and depth of your relationships. Human beings are fundamentally social creatures, and the single most reliable predictor of resilience outcomes is the presence of at least one genuine, trusting relationship. Social resilience means having people you can call, lean on, and be genuinely known by.
**Practical Resilience** is the concrete, material dimension: Do you have financial reserves? Do you have practical problem-solving skills? Do you have access to healthcare, legal support, or other institutional resources when needed?
**Existential Resilience** is the sense that life has meaning and that your experience of adversity is part of a larger story you can make sense of. People with strong existential resilience can ask "Why is this happening?" and actually engage meaningfully with the question, rather than either avoiding it or being destroyed by it.
## The Post-Traumatic Growth Paradox
Research on post-traumatic growth consistently shows that a significant proportion of people who navigate major adversity report not just returning to baseline but actually growing — developing new strengths, deeper relationships, a clearer sense of purpose, and a richer appreciation for life. This does not minimize the reality of suffering; it suggests that adversity, when navigated with support and reflection, can be a catalyst for development that would not have occurred otherwise.
## Frequently Asked Questions
**"Is resilience about toughing it out?"**
No. Resilience is not about suppressing emotion, denying difficulty, or pretending everything is fine. It is about facing reality clearly, accessing appropriate support, and finding a path through that maintains your integrity and values. The healthiest resilient response often involves vulnerability — admitting difficulty, asking for help, and allowing others to support you.
**"I've been through something awful and I can't seem to bounce back — am I less resilient than others?"**
Resilience is not a competition and there is no "normal" timeline for recovery. Major adversity — especially prolonged or relational trauma — takes time. Some adversities fundamentally change you and the goal is not to return to who you were before but to build a new integration that includes what you've been through.
**"Can resilience be developed at any age?"**
Yes. While early formative experiences shape baseline resilience, research shows that resilience capacities can be developed at any age through deliberate practice, new relationship experiences, and reframing work.
---
*Part of the Personal Growth Skills collection. For self-reflection only. Not therapy or professional advice. Seek professional support for serious mental health concerns.*
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No professional advice
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Resilience Building Architect - Descriptive skill
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:60],
"word_count": len(user_input.split()),
"has_goals": "goal" in input_lower,
"has_challenges": "challenge" in input_lower or "problem" in input_lower,
}
# Skill-specific detection
if "resilience-building-architect" == "curiosity-cultivator":
parsed["curiosity_focus"] = "curiosity" in input_lower or "wonder" in input_lower
elif "resilience-building-architect" == "resilience-building-architect":
parsed["resilience_focus"] = "resilience" in input_lower or "stress" in input_lower
elif "resilience-building-architect" == "intuition-development-guide":
parsed["intuition_focus"] = "intuition" in input_lower or "gut" in input_lower
elif "resilience-building-architect" == "personal-ritual-designer":
parsed["ritual_focus"] = "ritual" in input_lower or "meaning" in input_lower
elif "resilience-building-architect" == "digital-presence-curator":
parsed["digital_focus"] = "digital" in input_lower or "online" in input_lower
elif "resilience-building-architect" == "legacy-thinking-facilitator":
parsed["legacy_focus"] = "legacy" in input_lower or "impact" in input_lower
elif "resilience-building-architect" == "sensory-awareness-enhancer":
parsed["sensory_focus"] = "sensory" in input_lower or "awareness" in input_lower
elif "resilience-building-architect" == "play-rediscovery-guide":
parsed["play_focus"] = "play" in input_lower or "fun" in input_lower
elif "resilience-building-architect" == "cultural-intelligence-builder":
parsed["cultural_focus"] = "cultural" in input_lower or "diversity" in input_lower
elif "resilience-building-architect" == "generosity-practice-designer":
parsed["generosity_focus"] = "generosity" in input_lower or "giving" in input_lower
# Urgency detection
if "urgent" in input_lower:
parsed["urgency"] = "high"
elif "important" in input_lower:
parsed["urgency"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
response = {
"skill": "resilience-building-architect",
"name": "Resilience Building Architect",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
frameworks = []
# Differentiate based on urgency
urgency = parsed.get("urgency")
if urgency == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 24-48 hours.")
elif urgency == "medium":
recs.append("Important items require structured planning.")
steps.append("Create timeline with milestones.")
# Differentiate based on word count
if parsed.get("word_count", 0) > 30:
recs.append("Detailed input allows for tailored guidance.")
else:
recs.append("Consider providing more details for specific advice.")
# Skill-specific recommendations
if "resilience-building-architect" == "curiosity-cultivator":
recs.append("Cultivate curiosity through questioning and exploration.")
frameworks.append("Curiosity assessment framework")
elif "resilience-building-architect" == "resilience-building-architect":
recs.append("Build resilience through stress management and recovery practices.")
frameworks.append("Resilience building framework")
elif "resilience-building-architect" == "intuition-development-guide":
recs.append("Develop intuition through awareness and validation practices.")
frameworks.append("Intuition development framework")
elif "resilience-building-architect" == "personal-ritual-designer":
recs.append("Design meaningful rituals for transitions and daily life.")
frameworks.append("Ritual design framework")
elif "resilience-building-architect" == "digital-presence-curator":
recs.append("Curate digital presence with intention and authenticity.")
frameworks.append("Digital presence framework")
elif "resilience-building-architect" == "legacy-thinking-facilitator":
recs.append("Reflect on legacy and align actions with values.")
frameworks.append("Legacy thinking framework")
elif "resilience-building-architect" == "sensory-awareness-enhancer":
recs.append("Enhance sensory awareness for presence and creativity.")
frameworks.append("Sensory awareness framework")
elif "resilience-building-architect" == "play-rediscovery-guide":
recs.append("Rediscover play for joy, creativity, and stress relief.")
frameworks.append("Play rediscovery framework")
elif "resilience-building-architect" == "cultural-intelligence-builder":
recs.append("Build cultural intelligence for diverse environments.")
frameworks.append("Cultural intelligence framework")
elif "resilience-building-architect" == "generosity-practice-designer":
recs.append("Design sustainable generosity practices.")
frameworks.append("Generosity practice framework")
# Ensure we have content
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals if needed."]
if not steps:
steps = ["Customize with your context.", "Schedule regular reviews."]
if not frameworks:
frameworks = ["Personal growth framework", "Implementation checklist"]
response["recommendations"] = recs
response["next_steps"] = steps
response["frameworks"] = frameworks
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals for serious matters."
return response
def handle(user_input: str) -> str:
"""Main handler."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Resilience Building Architect",
"slug": "resilience-building-architect",
"version": "1.0.0",
"description": "Designs personalized resilience-building practices for adversity navigation and psychological recovery.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"resilience",
"mental-health",
"adversity",
"growth"
],
"trigger_keywords": [
"build resilience",
"bounce back from setback",
"resilience practice",
"stress recovery",
"adversity navigation"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "development"
}
FILE:tests/test_handler.py
"""
Tests for Resilience Building Architect
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "resilience-building-architect"
print("✓ JSON test passed for resilience-building-architect")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for resilience-building-architect")
def test_input_differentiation():
input1 = "simple request"
input2 = "urgent request with specific goals"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
assert parsed1["input_analysis"] != parsed2["input_analysis"]
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for resilience-building-architect")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for resilience-building-architect")
Develops and sustains curiosity as a skill through structured questioning frameworks and exploratory habits.
---
name: Curiosity Cultivator
slug: curiosity-cultivator
description: Develops and sustains curiosity as a skill through structured questioning frameworks and exploratory habits.
tags: [curiosity, learning, self-development, growth]
---
# Curiosity Cultivator
## Overview
Curiosity is not a fixed trait — it is a practice that can be cultivated, structured, and deepened over time. The Curiosity Cultivator provides a systematic yet warm framework for people who want to move from passive wondering to active inquiry.
Many adults feel stuck in fixed patterns of thinking, relying on familiar answers rather than asking generative questions. This skill helps users identify where curiosity has narrowed in their lives, what topics or domains feel genuinely alive, and how to build daily habits that sustain an inquistive mindset.
Rather than offering generic "be more curious" advice, this skill delivers structured tools: the 5-Question Depth Protocol for exploring any topic, the Curiosity Expansion Grid for mapping domains of interest, and the Wonder Journal system for tracking evolving questions over time.
The skill works by first analyzing the user's stated interests and the language they use to describe their current situation. It then offers a tailored curiosity practice — specific questions to ask, patterns to notice, and small experiments to run within a 7-day cycle.
## How It Works
The Curiosity Cultivator operates through three core mechanisms:
**1. Input Analysis & Interest Mapping**
The handler first parses the user's input to identify stated interests, frustrations with stagnation, and domains where curiosity feels blocked. It maps these against a taxonomy of curiosity types: factual (wanting to know), practical (wanting to do), relational (wanting to understand others), and philosophical (wanting to ponder meaning).
**2. Structured Question Frameworks**
Based on the mapped interests, the tool generates a personalized 5-Question Depth Protocol — five progressively deeper questions designed to move the user from surface-level information toward genuine insight. Each question is chosen to counteract specific curiosity blockers (certainty, assumptions, fear of not knowing).
**3. 7-Day Curiosity Practice**
The tool generates a micro-habit plan: one curiosity practice per day for seven days. Practices include "Question of the Day" prompts, "Assumption Audits" (choosing one thing you "know" and genuinely questioning it), and "Blind Spot Walks" (observing something familiar in a new context).
## Example Prompts
1. *"I feel stuck in my career but don't know what I actually want"*
2. *"My teenager has become distant and I want to understand what's happening without pushing them away"*
3. *"I've been hearing about AI everywhere but I don't understand what it really means for my work"*
4. *"I want to reconnect with my spouse but life keeps getting in the way — where do I even start?"*
5. *"I've always wanted to learn to cook but I'm intimidated by where to begin"*
## Safety & Boundaries
This skill is for self-reflection and personal development only. It does not provide medical, psychological, legal, or professional advice. Always consult qualified professionals for health, mental health, or legal concerns. Information provided is for educational purposes and should not replace professional guidance. This tool does not store personal data between sessions.
## Tips for Deepening Practice
- Start with "What don't I know about this?" rather than "What do I know?" — the shift matters
- Keep a dedicated "wonder list" — a running document of questions that arise in daily life
- Schedule "curiosity time" twice a week, even 15 minutes, without agenda or goal
- Practice "assumption inversion": take one belief you hold strongly and genuinely argue against it
- Share genuine questions with someone you trust — curiosity deepens through dialogue, not just solo reflection
## Related Skills
This skill pairs well with: **intuition-development-guide, learning-style-synthesizer, play-rediscovery-guide**.
## About This Skill
This skill was developed as part of the Personal Growth Skills collection, designed to support continuous self-development across emotional, cognitive, and relational domains. It is a descriptive, non-prescriptive tool intended for reflective use by motivated individuals.
## When to Use This Skill
Use the Curiosity Cultivator when you feel stuck in habitual thinking patterns, when facing an important decision and wanting to explore it from multiple angles, when you notice a domain of life that has become stagnant or routine, or when you want to reconnect with a sense of wonder and discovery in your daily life. It is also valuable before creative work, difficult conversations, or any situation where fresh thinking is needed.
This skill is particularly helpful during life transitions — changing jobs, relationships, locations, or life phases — when inherited assumptions about yourself and the world may no longer serve.
## Common Curiosity Blocks
Most adults experience predictable curiosity blocks. The most common include: the certainty trap (you feel you already know the answer), the judgment trap (you evaluate questions before you fully formulate them), the productivity trap (you only ask "useful" questions, dismissing "foolish" ones), and the fear trap (you avoid questions whose answers might be uncomfortable or require change).
Recognizing which block is active is itself a curiosity practice. Once identified, the 5-Question Depth Protocol can be specifically aimed at the identified block.
## The Science of Curiosity
Research in neuroscience and psychology consistently demonstrates that curiosity activates the brain's reward circuitry in similar ways to material reward — the dopaminergic anticipation of a novel answer is itself intrinsically pleasurable. Studies show that curious people demonstrate better memory consolidation, more creative problem-solving, and higher resilience in the face of uncertainty.
Curiosity is also trainable. Studies of curiosity training programs show measurable increases in wellbeing and reductions in anxiety after just 4 weeks of consistent curiosity practice.
## Frequently Asked Questions
**"I'm not naturally curious — is this skill still useful?"**
Curiosity is not a fixed trait. It is more like a muscle that atrophies without use. Most adults who believe they are "not curious" are actually experiencing learned caution, not genuine low curiosity. This skill provides structured ways to rebuild that muscle.
**"Does curiosity lead to anxiety? Sometimes wondering about things feels unsettling."**
Genuine curiosity should feel expansive and energizing. If wondering feels anxiety-inducing, it may be that you are asking "What if things go wrong?" instead of "What is actually happening here?" The protocol is designed to keep curiosity grounded in observation rather than catastrophic imagination.
**"I don't have time for extra practices."**
The Curiosity Cultivator is designed around micro-practices — questions you can ask in ordinary moments (while driving, waiting, showering) without adding anything to your schedule. The practice is more about shifting how you use existing time than adding new obligations.
---
*Part of the Personal Growth Skills collection. For self-reflection only. Not therapy or professional advice.*
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No professional advice
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Curiosity Cultivator - Descriptive skill
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:60],
"word_count": len(user_input.split()),
"has_goals": "goal" in input_lower,
"has_challenges": "challenge" in input_lower or "problem" in input_lower,
}
# Skill-specific detection
if "curiosity-cultivator" == "curiosity-cultivator":
parsed["curiosity_focus"] = "curiosity" in input_lower or "wonder" in input_lower
elif "curiosity-cultivator" == "resilience-building-architect":
parsed["resilience_focus"] = "resilience" in input_lower or "stress" in input_lower
elif "curiosity-cultivator" == "intuition-development-guide":
parsed["intuition_focus"] = "intuition" in input_lower or "gut" in input_lower
elif "curiosity-cultivator" == "personal-ritual-designer":
parsed["ritual_focus"] = "ritual" in input_lower or "meaning" in input_lower
elif "curiosity-cultivator" == "digital-presence-curator":
parsed["digital_focus"] = "digital" in input_lower or "online" in input_lower
elif "curiosity-cultivator" == "legacy-thinking-facilitator":
parsed["legacy_focus"] = "legacy" in input_lower or "impact" in input_lower
elif "curiosity-cultivator" == "sensory-awareness-enhancer":
parsed["sensory_focus"] = "sensory" in input_lower or "awareness" in input_lower
elif "curiosity-cultivator" == "play-rediscovery-guide":
parsed["play_focus"] = "play" in input_lower or "fun" in input_lower
elif "curiosity-cultivator" == "cultural-intelligence-builder":
parsed["cultural_focus"] = "cultural" in input_lower or "diversity" in input_lower
elif "curiosity-cultivator" == "generosity-practice-designer":
parsed["generosity_focus"] = "generosity" in input_lower or "giving" in input_lower
# Urgency detection
if "urgent" in input_lower:
parsed["urgency"] = "high"
elif "important" in input_lower:
parsed["urgency"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
response = {
"skill": "curiosity-cultivator",
"name": "Curiosity Cultivator",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
frameworks = []
# Differentiate based on urgency
urgency = parsed.get("urgency")
if urgency == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 24-48 hours.")
elif urgency == "medium":
recs.append("Important items require structured planning.")
steps.append("Create timeline with milestones.")
# Differentiate based on word count
if parsed.get("word_count", 0) > 30:
recs.append("Detailed input allows for tailored guidance.")
else:
recs.append("Consider providing more details for specific advice.")
# Skill-specific recommendations
if "curiosity-cultivator" == "curiosity-cultivator":
recs.append("Cultivate curiosity through questioning and exploration.")
frameworks.append("Curiosity assessment framework")
elif "curiosity-cultivator" == "resilience-building-architect":
recs.append("Build resilience through stress management and recovery practices.")
frameworks.append("Resilience building framework")
elif "curiosity-cultivator" == "intuition-development-guide":
recs.append("Develop intuition through awareness and validation practices.")
frameworks.append("Intuition development framework")
elif "curiosity-cultivator" == "personal-ritual-designer":
recs.append("Design meaningful rituals for transitions and daily life.")
frameworks.append("Ritual design framework")
elif "curiosity-cultivator" == "digital-presence-curator":
recs.append("Curate digital presence with intention and authenticity.")
frameworks.append("Digital presence framework")
elif "curiosity-cultivator" == "legacy-thinking-facilitator":
recs.append("Reflect on legacy and align actions with values.")
frameworks.append("Legacy thinking framework")
elif "curiosity-cultivator" == "sensory-awareness-enhancer":
recs.append("Enhance sensory awareness for presence and creativity.")
frameworks.append("Sensory awareness framework")
elif "curiosity-cultivator" == "play-rediscovery-guide":
recs.append("Rediscover play for joy, creativity, and stress relief.")
frameworks.append("Play rediscovery framework")
elif "curiosity-cultivator" == "cultural-intelligence-builder":
recs.append("Build cultural intelligence for diverse environments.")
frameworks.append("Cultural intelligence framework")
elif "curiosity-cultivator" == "generosity-practice-designer":
recs.append("Design sustainable generosity practices.")
frameworks.append("Generosity practice framework")
# Ensure we have content
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals if needed."]
if not steps:
steps = ["Customize with your context.", "Schedule regular reviews."]
if not frameworks:
frameworks = ["Personal growth framework", "Implementation checklist"]
response["recommendations"] = recs
response["next_steps"] = steps
response["frameworks"] = frameworks
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals for serious matters."
return response
def handle(user_input: str) -> str:
"""Main handler."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Curiosity Cultivator",
"slug": "curiosity-cultivator",
"version": "1.0.0",
"description": "Develops and sustains curiosity as a skill through structured questioning frameworks and exploratory habits.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"curiosity",
"learning",
"self-development",
"growth"
],
"trigger_keywords": [
"how to stay curious",
"curiosity practice",
"cultivate curiosity daily",
"curious mindset",
"curiosity exercises"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "development"
}
FILE:tests/test_handler.py
"""
Tests for Curiosity Cultivator
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "curiosity-cultivator"
print("✓ JSON test passed for curiosity-cultivator")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for curiosity-cultivator")
def test_input_differentiation():
input1 = "simple request"
input2 = "urgent request with specific goals"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
assert parsed1["input_analysis"] != parsed2["input_analysis"]
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for curiosity-cultivator")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for curiosity-cultivator")
Interprets income statements, balance sheets, and cash flows into plain-language insights, ratio analysis, and management questions for financial review.
# Financial Report Interpreter
## Overview
Turns income statement, balance sheet, and cash flow inputs into plain-language signals, ratio commentary, and management follow-up questions. It is a descriptive interpretation aid and does not connect to external accounting systems.
## Trigger
Use this skill when the user wants to:
- get structured guidance on financial report interpreter
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Explain what this balance sheet says about liquidity."
- "What should I worry about in this cash flow statement?"
- "Interpret these gross margin and operating margin changes."
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "financial-report-interpreter",
"name": "Financial Report Interpreter",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Financial Report Interpreter specific logic
if "income" in input_lower:
recommendations.append("Focus on revenue trends.")
next_steps.append("Analyze changes over time.")
if "balance" in input_lower:
recommendations.append("Evaluate financial structure.")
next_steps.append("Calculate key ratios.")
if "cash" in input_lower:
recommendations.append("Analyze cash flow.")
next_steps.append("Assess sustainability.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Financial Report Interpreter",
"slug": "financial-report-interpreter",
"version": "1.0.0",
"description": "Turns income statement, balance sheet, and cash flow inputs into plain-language signals, ratio commentary, and management follow-up questions.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"financial-statements",
"analysis",
"cash-flow",
"ratios"
],
"trigger_keywords": [
"interpret financial statements",
"income statement analysis",
"balance sheet review",
"cash flow explanation",
"ratio commentary"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Financial Report Interpreter handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "financial-report-interpreter"
print(f"✓ test_handle_returns_json passed for financial-report-interpreter")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for financial-report-interpreter")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for financial-report-interpreter")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for financial-report-interpreter")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for financial-report-interpreter")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for financial-report-interpreter")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for financial-report-interpreter")
Creates structured financial education frameworks with actionable recommendations and clear next-step checklists for learning paths.
# Financial Education Path Designer
## Overview
Designs financial education paths. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Financial Education Path Designer - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "financial-education-path-designer",
"name": "Financial Education Path Designer",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "financial-education-path-designer" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "financial-education-path-designer" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "financial-education-path-designer" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Financial Education Path Designer",
"slug": "financial-education-path-designer",
"version": "1.0.0",
"description": "Creates role-based finance learning paths for founders, operators, and early-career analysts.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"learning-path",
"curriculum",
"upskilling",
"education"
],
"trigger_keywords": [
"finance learning path",
"accounting study roadmap",
"founder finance curriculum",
"analyst upskilling plan",
"financial literacy plan"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Financial Education Path Designer
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "financial-education-path-designer"
print("✓ JSON test passed for financial-education-path-designer")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for financial-education-path-designer")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for financial-education-path-designer")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for financial-education-path-designer")
Provides frameworks and templates to analyze and optimize working capital management with actionable recommendations and next steps.
# Working Capital Optimizer
## Overview
Helps optimize working capital management. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Working Capital Optimizer - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "working-capital-optimizer",
"name": "Working Capital Optimizer",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "working-capital-optimizer" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "working-capital-optimizer" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "working-capital-optimizer" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Working Capital Optimizer",
"slug": "working-capital-optimizer",
"version": "1.0.0",
"description": "Analyzes receivables, payables, inventory, and cash-cycle friction to suggest working-capital improvement moves.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"working-capital",
"cash-cycle",
"receivables",
"inventory"
],
"trigger_keywords": [
"working capital improvement",
"cash conversion cycle",
"reduce receivable days",
"payables strategy",
"inventory cash tie-up"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Working Capital Optimizer
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "working-capital-optimizer"
print("✓ JSON test passed for working-capital-optimizer")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for working-capital-optimizer")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for working-capital-optimizer")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for working-capital-optimizer")
Provides structured guidance and templates to optimize tax deductions and improve record-keeping for freelancers, small businesses, and salaried taxpayers.
# Tax Deduction Optimizer
## Overview
Maps deduction opportunities, record-keeping gaps, and deduction-versus-risk tradeoffs for freelancers, small businesses, and salaried taxpayers. It is a descriptive planning skill, not tax filing software or legal advice.
## Trigger
Use this skill when the user wants to:
- get structured guidance on tax deduction optimizer
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "What deductions can a freelance designer usually claim?"
- "Should I take the standard deduction or itemize?"
- "How should I organize travel and meal receipts for audit readiness?"
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "tax-deduction-optimizer",
"name": "Tax Deduction Optimizer",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Tax Deduction Optimizer specific logic
if "home" in input_lower and "office" in input_lower:
recommendations.append("Calculate home office deductions.")
next_steps.append("Measure office space.")
if "vehicle" in input_lower:
recommendations.append("Maintain mileage logs.")
next_steps.append("Choose expense method.")
if "education" in input_lower:
recommendations.append("Document development expenses.")
next_steps.append("Keep course records.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Tax Deduction Optimizer",
"slug": "tax-deduction-optimizer",
"version": "1.0.0",
"description": "Maps deduction scenarios, record-keeping gaps, and deduction-vs-risk tradeoffs for freelancers, small businesses, and salaried taxpayers.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"tax-planning",
"deductions",
"compliance",
"record-keeping"
],
"trigger_keywords": [
"tax deduction strategy",
"standard vs itemized",
"business expense deductions",
"receipt organization",
"tax write-offs"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Tax Deduction Optimizer handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "tax-deduction-optimizer"
print(f"✓ test_handle_returns_json passed for tax-deduction-optimizer")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for tax-deduction-optimizer")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for tax-deduction-optimizer")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for tax-deduction-optimizer")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for tax-deduction-optimizer")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for tax-deduction-optimizer")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for tax-deduction-optimizer")
Provides frameworks and templates to plan capital expenditures with structured analysis, recommendations, and next steps, for informational use only.
# Capital Expenditure Planner
## Overview
Plans capital expenditures. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Capital Expenditure Planner - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "capital-expenditure-planner",
"name": "Capital Expenditure Planner",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "capital-expenditure-planner" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "capital-expenditure-planner" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "capital-expenditure-planner" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Capital Expenditure Planner",
"slug": "capital-expenditure-planner",
"version": "1.0.0",
"description": "Prioritizes capex options using business impact, payback, timing, and risk tradeoffs.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"capex",
"investment-planning",
"payback",
"prioritization"
],
"trigger_keywords": [
"capex planning",
"equipment investment decision",
"payback analysis",
"capital budget prioritization",
"capex roadmap"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Capital Expenditure Planner
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "capital-expenditure-planner"
print("✓ JSON test passed for capital-expenditure-planner")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for capital-expenditure-planner")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for capital-expenditure-planner")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for capital-expenditure-planner")
Provides structured analysis, actionable recommendations, and next-step checklists to help track and manage progress toward financial goals.
# Financial Goal Progress Tracker
## Overview
Tracks financial goal progress. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Financial Goal Progress Tracker - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "financial-goal-progress-tracker",
"name": "Financial Goal Progress Tracker",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "financial-goal-progress-tracker" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "financial-goal-progress-tracker" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "financial-goal-progress-tracker" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Financial Goal Progress Tracker",
"slug": "financial-goal-progress-tracker",
"version": "1.0.0",
"description": "Structures savings milestones, goal pacing, and review cadences for debt payoff, emergency funds, and investment targets.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"goal-tracking",
"savings-plan",
"milestones",
"personal-finance"
],
"trigger_keywords": [
"financial goal tracking",
"savings milestone plan",
"debt payoff tracking",
"emergency fund progress",
"investment target pacing"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Financial Goal Progress Tracker
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "financial-goal-progress-tracker"
print("✓ JSON test passed for financial-goal-progress-tracker")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for financial-goal-progress-tracker")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for financial-goal-progress-tracker")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for financial-goal-progress-tracker")
Creates structured expense approval workflow frameworks with actionable recommendations and next-step checklists for process design.
# Expense Approval Workflow Designer
## Overview
Designs expense approval workflows. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Expense Approval Workflow Designer - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "expense-approval-workflow-designer",
"name": "Expense Approval Workflow Designer",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "expense-approval-workflow-designer" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "expense-approval-workflow-designer" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "expense-approval-workflow-designer" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Expense Approval Workflow Designer",
"slug": "expense-approval-workflow-designer",
"version": "1.0.0",
"description": "Designs approval thresholds, routing rules, escalation paths, and audit controls for expense governance.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"expense-management",
"workflow",
"approvals",
"controls"
],
"trigger_keywords": [
"expense approval matrix",
"approval workflow design",
"expense routing rules",
"spend controls",
"expense escalation"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Expense Approval Workflow Designer
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "expense-approval-workflow-designer"
print("✓ JSON test passed for expense-approval-workflow-designer")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for expense-approval-workflow-designer")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for expense-approval-workflow-designer")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for expense-approval-workflow-designer")
Provides frameworks and templates for negotiating payment terms with structured analysis, actionable recommendations, and next steps guidance.
# Payment Term Negotiator
## Overview
Provides payment term negotiation frameworks. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Payment Term Negotiator - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "payment-term-negotiator",
"name": "Payment Term Negotiator",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "payment-term-negotiator" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "payment-term-negotiator" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "payment-term-negotiator" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Payment Term Negotiator",
"slug": "payment-term-negotiator",
"version": "1.0.0",
"description": "Provides payment term negotiation frameworks",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"payment"
],
"trigger_keywords": [
"payment term negotiator",
"payment term negotiator"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Payment Term Negotiator
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "payment-term-negotiator"
print("✓ JSON test passed for payment-term-negotiator")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for payment-term-negotiator")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for payment-term-negotiator")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for payment-term-negotiator")
Provides financial ratio benchmarks with structured analysis, actionable recommendations, and next steps without executing code or external calls.
# Financial Ratio Benchmarker
## Overview
Provides financial ratio benchmarks. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Financial Ratio Benchmarker - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "financial-ratio-benchmarker",
"name": "Financial Ratio Benchmarker",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "financial-ratio-benchmarker" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "financial-ratio-benchmarker" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "financial-ratio-benchmarker" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Financial Ratio Benchmarker",
"slug": "financial-ratio-benchmarker",
"version": "1.0.0",
"description": "Provides financial ratio benchmarks",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"financial"
],
"trigger_keywords": [
"financial ratio benchmarker",
"financial ratio benchmarker"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Financial Ratio Benchmarker
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "financial-ratio-benchmarker"
print("✓ JSON test passed for financial-ratio-benchmarker")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for financial-ratio-benchmarker")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for financial-ratio-benchmarker")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for financial-ratio-benchmarker")
Provides break-even analysis frameworks, structured insights, actionable recommendations, and next-step checklists without executing code or financial transa...
# Break-Even Analysis Calculator
## Overview
Provides break-even analysis frameworks. This is a descriptive skill that provides frameworks and templates without executing real code.
## Safety
- No real code execution
- No external API calls
- No financial transactions
- Informational only
## Outputs
- Structured analysis
- Actionable recommendations
- Next steps checklist
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional
1. Returns structured JSON output
2. Includes actionable recommendations
3. Provides relevant frameworks
4. Shows input-based differentiation
## Non-Functional
1. No code execution
2. No external APIs
3. No financial transactions
4. File count ≤ 10
## Quality
1. Clear documentation
2. Testable code
3. Descriptive outputs only
4. Safety disclaimers present
FILE:handler.py
#!/usr/bin/env python3
"""
Break-Even Analysis Calculator - handler.py
Descriptive skill providing frameworks.
No real code execution or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input."""
input_lower = user_input.lower()
parsed = {
"input_preview": user_input[:80],
"word_count": len(user_input.split()),
"has_amounts": bool(re.search(r'\$?\d+', user_input)),
"has_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}', user_input)),
}
# Check for amounts
amounts = re.findall(r'\$?(\d+)', user_input)
if amounts:
try:
nums = [int(a) for a in amounts]
parsed["amounts"] = nums
parsed["max_amount"] = max(nums)
except:
pass
# Check timeframe
if "month" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower:
parsed["timeframe"] = "annual"
# Check urgency
if "urgent" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower:
parsed["priority"] = "medium"
return parsed
def generate_response(parsed: dict, user_input: str) -> dict:
"""Generate response."""
input_lower = user_input.lower()
response = {
"skill": "break-even-analysis-calculator",
"name": "Break-Even Analysis Calculator",
"input_analysis": parsed,
"analysis": "Analysis based on your input.",
}
recs = []
steps = []
# Differentiate based on amounts
if parsed.get("has_amounts"):
max_amt = parsed.get("max_amount", 0)
if max_amt > 100000:
recs.append("For large amounts, consider professional advice.")
steps.append("Consult financial professionals.")
elif max_amt > 10000:
recs.append("For significant amounts, implement detailed tracking.")
steps.append("Set up tracking systems.")
else:
recs.append("For smaller amounts, focus on efficiency.")
steps.append("Use standard templates.")
# Differentiate based on timeframe
timeframe = parsed.get("timeframe")
if timeframe == "monthly":
recs.append("Monthly planning enables regular adjustments.")
steps.append("Establish monthly reviews.")
elif timeframe == "quarterly":
recs.append("Quarterly review supports strategic planning.")
steps.append("Align with business quarters.")
elif timeframe == "annual":
recs.append("Annual planning drives long-term strategy.")
steps.append("Set annual goals.")
# Differentiate based on priority
priority = parsed.get("priority")
if priority == "high":
recs.append("Urgent matters need immediate attention.")
steps.append("Address within 48 hours.")
elif priority == "medium":
recs.append("Important items require clear planning.")
steps.append("Create timeline with milestones.")
# Skill-specific logic
if "break-even-analysis-calculator" == "break-even-analysis-calculator":
if "fixed" in input_lower:
recs.append("Identify all fixed costs accurately.")
if "variable" in input_lower:
recs.append("Calculate variable costs per unit.")
elif "break-even-analysis-calculator" == "working-capital-optimizer":
if "inventory" in input_lower:
recs.append("Optimize inventory levels.")
if "receivables" in input_lower:
recs.append("Improve collections process.")
elif "break-even-analysis-calculator" == "financial-ratio-benchmarker":
if "ratio" in input_lower:
recs.append("Compare ratios to industry benchmarks.")
# ... 其他skill类似
# Ensure we have recommendations
if not recs:
recs = ["Review relevant frameworks.", "Consult professionals."]
if not steps:
steps = ["Customize with your data.", "Schedule regular reviews."]
response["recommendations"] = recs
response["next_steps"] = steps
response["templates"] = ["Framework template", "Checklist", "Best practices"]
response["disclaimer"] = "Descriptive analysis only. No code execution. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler - MUST use user_input."""
parsed = parse_input(user_input)
response = generate_response(parsed, user_input)
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Break-Even Analysis Calculator",
"slug": "break-even-analysis-calculator",
"version": "1.0.0",
"description": "Provides break-even analysis frameworks",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"break"
],
"trigger_keywords": [
"break even analysis calculator",
"break-even analysis calculator"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Break-Even Analysis Calculator
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_returns_json():
result = handle("test")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "break-even-analysis-calculator"
print("✓ JSON test passed for break-even-analysis-calculator")
def test_has_disclaimer():
result = handle("test")
assert "disclaimer" in result.lower()
print("✓ Disclaimer test passed for break-even-analysis-calculator")
def test_input_differentiation():
# Test different inputs produce different outputs
input1 = "simple request"
input2 = "urgent request with $50000 amount"
result1 = handle(input1)
result2 = handle(input2)
parsed1 = json.loads(result1)
parsed2 = json.loads(result2)
# Check input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"]
# Check at least one difference
diff_found = False
if parsed1.get("recommendations") != parsed2.get("recommendations"):
diff_found = True
if parsed1.get("next_steps") != parsed2.get("next_steps"):
diff_found = True
assert diff_found, "Different inputs should produce different outputs"
print("✓ Differentiation test passed for break-even-analysis-calculator")
if __name__ == "__main__":
test_returns_json()
test_has_disclaimer()
test_input_differentiation()
print("All tests passed for break-even-analysis-calculator")
Provides structured analysis, templates, and actionable recommendations to identify cost reduction opportunities using best-practice financial frameworks.
# Cost Reduction Opportunity Finder
## Overview
Identifies potential cost reduction opportunities across operational categories. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on cost reduction opportunity finder
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "cost-reduction-opportunity-finder",
"name": "Cost Reduction Opportunity Finder",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Cost Reduction Opportunity Finder specific logic
if "operations" in input_lower:
recommendations.append("Look for inefficiencies.")
next_steps.append("Map processes.")
if "supplier" in input_lower:
recommendations.append("Review supplier contracts.")
next_steps.append("Consolidate purchases.")
if "technology" in input_lower:
recommendations.append("Evaluate subscriptions.")
next_steps.append("Audit software.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Cost Reduction Opportunity Finder",
"slug": "cost-reduction-opportunity-finder",
"version": "1.0.0",
"description": "Identifies potential cost reduction opportunities across operational categories.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"cost"
],
"trigger_keywords": [
"cost reduction opportunity finder",
"cost reduction opportunity finder",
"cost",
"reduction",
"opportunity",
"finder"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Cost Reduction Opportunity Finder handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "cost-reduction-opportunity-finder"
print(f"✓ test_handle_returns_json passed for cost-reduction-opportunity-finder")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for cost-reduction-opportunity-finder")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for cost-reduction-opportunity-finder")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for cost-reduction-opportunity-finder")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for cost-reduction-opportunity-finder")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for cost-reduction-opportunity-finder")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for cost-reduction-opportunity-finder")
Provides structured pricing strategy frameworks, templates, and actionable recommendations based on cost, value, and competitive analysis for informed financ...
# Pricing Strategy Framework
## Overview
Provides structured frameworks for pricing decisions based on cost, value, and competitive analysis. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on pricing strategy framework
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "pricing-strategy-framework",
"name": "Pricing Strategy Framework",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Pricing Strategy Framework specific logic
if "cost" in input_lower:
recommendations.append("Track costs accurately.")
next_steps.append("Calculate full costs.")
if "competition" in input_lower:
recommendations.append("Analyze competitor pricing.")
next_steps.append("Monitor market positioning.")
if "value" in input_lower:
recommendations.append("Focus on value-based pricing.")
next_steps.append("Research customer value.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Pricing Strategy Framework",
"slug": "pricing-strategy-framework",
"version": "1.0.0",
"description": "Provides structured frameworks for pricing decisions based on cost, value, and competitive analysis.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"pricing"
],
"trigger_keywords": [
"pricing strategy framework",
"pricing strategy framework",
"pricing",
"strategy",
"framework"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Pricing Strategy Framework handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "pricing-strategy-framework"
print(f"✓ test_handle_returns_json passed for pricing-strategy-framework")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for pricing-strategy-framework")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for pricing-strategy-framework")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for pricing-strategy-framework")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for pricing-strategy-framework")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for pricing-strategy-framework")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for pricing-strategy-framework")
Provides structured analysis, templates, and recommendations to assess invoice compliance with regulations and internal policies without executing transactions.
# Invoice Compliance Checker
## Overview
Checks invoices for compliance with regulatory requirements and internal policies. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on invoice compliance checker
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "invoice-compliance-checker",
"name": "Invoice Compliance Checker",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Invoice Compliance Checker specific logic
if "tax" in input_lower:
recommendations.append("Ensure tax compliance.")
next_steps.append("Verify tax calculations.")
if "legal" in input_lower:
recommendations.append("Review against contracts.")
next_steps.append("Maintain approval records.")
if "international" in input_lower:
recommendations.append("Check international requirements.")
next_steps.append("Verify exchange rates.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Invoice Compliance Checker",
"slug": "invoice-compliance-checker",
"version": "1.0.0",
"description": "Checks invoices for compliance with regulatory requirements and internal policies.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"invoice"
],
"trigger_keywords": [
"invoice compliance checker",
"invoice compliance checker",
"invoice",
"compliance",
"checker"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Invoice Compliance Checker handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "invoice-compliance-checker"
print(f"✓ test_handle_returns_json passed for invoice-compliance-checker")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for invoice-compliance-checker")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for invoice-compliance-checker")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for invoice-compliance-checker")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for invoice-compliance-checker")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for invoice-compliance-checker")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for invoice-compliance-checker")
Provides structured receivable aging analysis, best-practice frameworks, and actionable recommendations for prioritizing collections without executing transa...
# Receivable Aging Analyzer
## Overview
Analyzes accounts receivable aging and suggests prioritization strategies for collections. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on receivable aging analyzer
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "receivable-aging-analyzer",
"name": "Receivable Aging Analyzer",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Receivable Aging Analyzer specific logic
if "overdue" in input_lower:
recommendations.append("Implement proactive collection.")
next_steps.append("Segment overdue accounts.")
if "customer" in input_lower:
recommendations.append("Develop customer strategies.")
next_steps.append("Review payment history.")
if "terms" in input_lower:
recommendations.append("Optimize credit terms.")
next_steps.append("Consider payment discounts.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Receivable Aging Analyzer",
"slug": "receivable-aging-analyzer",
"version": "1.0.0",
"description": "Analyzes accounts receivable aging and suggests prioritization strategies for collections.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"receivable"
],
"trigger_keywords": [
"receivable aging analyzer",
"receivable aging analyzer",
"receivable",
"aging",
"analyzer"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Receivable Aging Analyzer handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "receivable-aging-analyzer"
print(f"✓ test_handle_returns_json passed for receivable-aging-analyzer")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for receivable-aging-analyzer")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for receivable-aging-analyzer")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for receivable-aging-analyzer")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for receivable-aging-analyzer")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for receivable-aging-analyzer")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for receivable-aging-analyzer")
Provides structured financial health assessments with templates and actionable recommendations based on user-provided context and goals.
# Financial Health Check Analyzer
## Overview
Provides a multi-dimensional assessment of financial health with actionable improvement recommendations. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on financial health check analyzer
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "financial-health-check-analyzer",
"name": "Financial Health Check Analyzer",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Financial Health Check Analyzer specific logic
if "liquidity" in input_lower:
recommendations.append("Focus on liquidity ratios.")
next_steps.append("Monitor current ratio monthly.")
if "profit" in input_lower:
recommendations.append("Analyze profit margins.")
next_steps.append("Break down costs.")
if "debt" in input_lower:
recommendations.append("Evaluate debt levels.")
next_steps.append("Develop debt reduction plan.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Financial Health Check Analyzer",
"slug": "financial-health-check-analyzer",
"version": "1.0.0",
"description": "Provides a multi-dimensional assessment of financial health with actionable improvement recommendations.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"financial"
],
"trigger_keywords": [
"financial health check analyzer",
"financial health check analyzer",
"financial",
"health",
"check",
"analyzer"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Financial Health Check Analyzer handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "financial-health-check-analyzer"
print(f"✓ test_handle_returns_json passed for financial-health-check-analyzer")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for financial-health-check-analyzer")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for financial-health-check-analyzer")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for financial-health-check-analyzer")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for financial-health-check-analyzer")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for financial-health-check-analyzer")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for financial-health-check-analyzer")
Provides structured guidance, templates, and recommendations to optimize expense categorization for improved financial tracking and planning.
# Expense Categorization Optimizer
## Overview
Optimizes expense categorization rules and suggests improvements for better financial tracking. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on expense categorization optimizer
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "expense-categorization-optimizer",
"name": "Expense Categorization Optimizer",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Expense Categorization Optimizer specific logic
if "tax" in input_lower:
recommendations.append("Optimize for tax deductions.")
next_steps.append("Review deductible expense guidelines.")
if "business" in input_lower:
recommendations.append("Separate business and personal expenses.")
next_steps.append("Use separate accounts.")
if "project" in input_lower:
recommendations.append("Implement project-based tracking.")
next_steps.append("Set up project cost centers.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Expense Categorization Optimizer",
"slug": "expense-categorization-optimizer",
"version": "1.0.0",
"description": "Optimizes expense categorization rules and suggests improvements for better financial tracking.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"expense"
],
"trigger_keywords": [
"expense categorization optimizer",
"expense categorization optimizer",
"expense",
"categorization",
"optimizer"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Expense Categorization Optimizer handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "expense-categorization-optimizer"
print(f"✓ test_handle_returns_json passed for expense-categorization-optimizer")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for expense-categorization-optimizer")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for expense-categorization-optimizer")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for expense-categorization-optimizer")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for expense-categorization-optimizer")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for expense-categorization-optimizer")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for expense-categorization-optimizer")
Provides structured guidance, templates, and recommendations for cash flow forecasting and financial planning without executing transactions or accessing ext...
# Cash Flow Forecast Assistant
## Overview
Generates cash flow projections and scenario analysis for small businesses and freelancers. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on cash flow forecast assistant
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "cash-flow-forecast-assistant",
"name": "Cash Flow Forecast Assistant",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Cash Flow Forecast Assistant specific logic
if "seasonal" in input_lower:
recommendations.append("Account for seasonal variations.")
next_steps.append("Create separate forecasts for different seasons.")
if "growth" in input_lower:
recommendations.append("Plan for working capital during growth.")
next_steps.append("Model growth scenarios.")
if "volatile" in input_lower:
recommendations.append("Build larger cash reserves.")
next_steps.append("Create multiple scenarios.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Cash Flow Forecast Assistant",
"slug": "cash-flow-forecast-assistant",
"version": "1.0.0",
"description": "Generates cash flow projections and scenario analysis for small businesses and freelancers.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"cash"
],
"trigger_keywords": [
"cash flow forecast assistant",
"cash flow forecast assistant",
"cash",
"flow",
"forecast",
"assistant"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/__init__.py
FILE:tests/test_handler.py
"""
Tests for Cash Flow Forecast Assistant handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "cash-flow-forecast-assistant"
print(f"✓ test_handle_returns_json passed for cash-flow-forecast-assistant")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for cash-flow-forecast-assistant")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for cash-flow-forecast-assistant")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for cash-flow-forecast-assistant")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for cash-flow-forecast-assistant")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for cash-flow-forecast-assistant")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for cash-flow-forecast-assistant")
Provides personalized budgeting frameworks, templates, and analysis based on income, expenses, goals, and priorities without executing transactions.
# Personal Budget Planner
## Overview
Helps individuals create personalized budget frameworks based on income, expenses, savings goals, and debt priorities. This is a descriptive skill that provides templates, frameworks, and heuristic analysis without executing real code, accessing external APIs, or performing actual financial transactions.
## Trigger
Use this skill when the user wants to:
- get structured guidance on personal budget planner
- apply best-practice frameworks to their financial situation
- generate templates and checklists for financial planning
### Example prompts
- "Help me create a personal budget"
- "Analyze my cash flow forecast"
- "Check my expense categorization"
- "Assess my financial health"
- "Review my receivables aging"
- "Check invoice compliance"
- "Develop a pricing strategy"
- "Find cost reduction opportunities"
- "Optimize my tax deductions"
- "Interpret my financial reports"
## Workflow
1. User provides context and goals.
2. Skill applies built-in templates and frameworks.
3. Skill generates structured output with recommendations.
4. User receives actionable insights and next steps.
## Inputs
- User context (financial situation, goals, constraints)
- Optional data inputs (amounts, categories, timeframes)
- Analysis preferences
## Outputs
- Structured analysis report
- Templates and frameworks
- Actionable recommendations
- Next steps checklist
## Safety
- No real financial transactions or API calls
- No access to real bank accounts or financial systems
- Recommendations are informational only
- Users should consult financial professionals for actual decisions
## Acceptance Criteria
- Must return structured markdown/JSON output
- Must include actionable recommendations
- Must clearly state the descriptive/non-executable nature
- Must provide templates or frameworks for user adaptation
FILE:ACCEPTANCE.md
# Acceptance Criteria
## Functional Requirements
1. Must return structured JSON output
2. Must include actionable recommendations
3. Must provide templates or frameworks
4. Must include next steps checklist
5. Must clearly state descriptive/non-executable nature
## Non-Functional Requirements
1. No real code execution
2. No external API calls
3. No network requests
4. No financial transactions
5. File count ≤ 10 per skill
## Quality Requirements
1. Clear documentation in English
2. Testable skeleton code
3. Descriptive outputs only
4. Proper error handling for invalid inputs
## Success Criteria
- All tests pass
- File count within limits (current: 5 files)
- Output meets descriptive requirements
- Documentation complete and clear
FILE:handler.py
#!/usr/bin/env python3
"""
{skill_name} - handler.py
Descriptive skill providing templates and frameworks.
No real code execution, external APIs, or financial transactions.
"""
import json
import sys
import re
def parse_input(user_input: str) -> dict:
"""Parse user input to extract key information."""
input_lower = user_input.lower()
parsed = {
"original_input_preview": user_input[:100] + ("..." if len(user_input) > 100 else ""),
"word_count": len(user_input.split()),
"contains_amounts": bool(re.search(r'\$?\d+[,\.]?\d*', user_input)),
"contains_dates": bool(re.search(r'\d{1,2}[/-]\d{1,2}[/-]\d{2,4}', user_input)),
}
# Detect key terms
key_terms = ["income", "expenses", "savings", "debt", "monthly", "tax", "business",
"personal", "profit", "cash", "customer", "supplier", "growth", "risk"]
for term in key_terms:
if term in input_lower:
parsed[f"contains_{term}"] = True
# Detect amounts
amounts = re.findall(r'\$?(\d+[,\.]?\d*)', user_input)
if amounts:
try:
nums = [float(a.replace(',', '')) for a in amounts]
parsed["amounts_found"] = nums
parsed["max_amount"] = max(nums)
parsed["min_amount"] = min(nums)
parsed["amount_count"] = len(nums)
parsed["total_amount"] = sum(nums)
except:
pass
# Detect timeframe
if "month" in input_lower or "monthly" in input_lower:
parsed["timeframe"] = "monthly"
elif "quarter" in input_lower or "quarterly" in input_lower:
parsed["timeframe"] = "quarterly"
elif "year" in input_lower or "annual" in input_lower or "yearly" in input_lower:
parsed["timeframe"] = "annual"
# Detect priority
if "urgent" in input_lower or "immediate" in input_lower or "asap" in input_lower:
parsed["priority"] = "high"
elif "important" in input_lower or "critical" in input_lower:
parsed["priority"] = "medium"
else:
parsed["priority"] = "normal"
return parsed
def generate_response(parsed_input: dict, user_input: str) -> dict:
"""Generate response based on parsed input."""
input_lower = user_input.lower()
# Base response
response = {
"skill": "personal-budget-planner",
"name": "Personal Budget Planner",
"input_analysis": parsed_input,
"analysis": "Analysis generated based on your specific input characteristics.",
}
# Generate differentiated recommendations
recommendations = []
next_steps = []
# Amount-based differentiation
if parsed_input.get("contains_amounts"):
max_amount = parsed_input.get("max_amount", 0)
if max_amount > 100000:
recommendations.append("For large amounts (over $100,000), consider professional advice.")
next_steps.append("Engage financial advisor for amounts of this scale.")
elif max_amount > 10000:
recommendations.append("For significant amounts ($10,000-$100,000), implement robust tracking.")
next_steps.append("Set up dedicated tracking for these transactions.")
else:
recommendations.append("For smaller amounts, focus on aggregation and pattern analysis.")
next_steps.append("Track consistently to identify spending patterns.")
# Timeframe differentiation
timeframe = parsed_input.get("timeframe")
if timeframe == "monthly":
recommendations.append("Monthly analysis enables regular adjustments.")
next_steps.append("Establish monthly review cadence.")
elif timeframe == "quarterly":
recommendations.append("Quarterly review balances responsiveness with strategy.")
next_steps.append("Align with business quarters.")
elif timeframe == "annual":
recommendations.append("Annual planning supports long-term strategy.")
next_steps.append("Use for strategic planning.")
# Priority differentiation
priority = parsed_input.get("priority")
if priority == "high":
recommendations.append("Urgent matters require immediate attention.")
next_steps.append("Address within 48 hours.")
elif priority == "medium":
recommendations.append("Important items need clear deadlines.")
next_steps.append("Create timeline with weekly checks.")
else:
recommendations.append("Normal priority allows systematic approach.")
next_steps.append("Develop plan with monthly reviews.")
# Skill-specific logic will be inserted here
# Personal Budget Planner specific logic
if "debt" in input_lower:
recommendations.append("Prioritize high-interest debt repayment in budget.")
next_steps.append("Calculate minimum payments and allocate extra to highest interest.")
if "savings" in input_lower or "emergency" in input_lower:
recommendations.append("Build emergency fund before discretionary spending.")
next_steps.append("Set up automatic transfers to savings.")
if "retirement" in input_lower:
recommendations.append("Treat retirement savings as essential budget item.")
next_steps.append("Explore tax-advantaged retirement accounts.")
# Ensure basic recommendations
if not recommendations:
recommendations = [
"Review relevant financial frameworks.",
"Consult with professionals.",
"Use insights as starting point."
]
if not next_steps:
next_steps = [
"Customize with your data.",
"Establish tracking system.",
"Schedule regular reviews."
]
response["recommendations"] = recommendations
response["next_steps"] = next_steps
response["templates_available"] = [
"Framework template",
"Implementation checklist",
"Scenario guidance",
"Best practices"
]
response["disclaimer"] = "Descriptive analysis only. No code execution or financial transactions. Consult professionals."
return response
def handle(user_input: str) -> str:
"""Main handler function."""
# Actually parse user input
parsed = parse_input(user_input)
# Generate response based on parsed input
response = generate_response(parsed, user_input)
# Return JSON
return json.dumps(response, indent=2)
if __name__ == "__main__":
input_text = sys.argv[1] if len(sys.argv) > 1 else sys.stdin.read()
print(handle(input_text))
FILE:skill.json
{
"name": "Personal Budget Planner",
"slug": "personal-budget-planner",
"version": "1.0.0",
"description": "Helps individuals create personalized budget frameworks based on income, expenses, savings goals, and debt priorities.",
"author": "Golden Bean (OpenClaw)",
"tags": [
"finance",
"descriptive",
"template",
"framework",
"personal"
],
"trigger_keywords": [
"personal budget planner",
"personal budget planner",
"personal",
"budget",
"planner"
],
"language": "en",
"outputs": "json",
"requires_api": false,
"readiness": "stable"
}
FILE:tests/test_handler.py
"""
Tests for Personal Budget Planner handler.py
"""
import os
import sys
import json
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from handler import handle
def test_handle_returns_json():
"""Test that handle() returns valid JSON."""
result = handle("test input")
parsed = json.loads(result)
assert isinstance(parsed, dict)
assert parsed["skill"] == "personal-budget-planner"
print(f"✓ test_handle_returns_json passed for personal-budget-planner")
def test_handle_contains_disclaimer():
"""Test that output contains the descriptive disclaimer."""
result = handle("test")
assert "descriptive" in result.lower() or "informational" in result.lower()
print(f"✓ test_handle_contains_disclaimer passed for personal-budget-planner")
def test_handle_has_recommendations():
"""Test that output contains recommendations."""
result = handle("test")
parsed = json.loads(result)
assert "recommendations" in parsed
assert len(parsed["recommendations"]) > 0
print(f"✓ test_handle_has_recommendations passed for personal-budget-planner")
def test_handle_has_next_steps():
"""Test that output contains next steps."""
result = handle("test")
parsed = json.loads(result)
assert "next_steps" in parsed
assert len(parsed["next_steps"]) > 0
print(f"✓ test_handle_has_next_steps passed for personal-budget-planner")
def test_input_differentiation():
"""Test that different inputs produce different outputs (DEF-FIN-001 fix)."""
# Test case 1: Simple input
input1 = "Help me with this"
result1 = handle(input1)
parsed1 = json.loads(result1)
# Test case 2: Detailed input with amounts
input2 = "I need help with budget. Monthly income $5000, expenses $3000, debt $10000, urgent situation"
result2 = handle(input2)
parsed2 = json.loads(result2)
# Verify input analysis differs
assert parsed1["input_analysis"] != parsed2["input_analysis"], "Input analysis should differ"
# Verify at least one recommendation differs (not guaranteed but likely)
recs1 = parsed1.get("recommendations", [])
recs2 = parsed2.get("recommendations", [])
# Check if recommendations differ or if input analysis shows difference
diff_found = False
if recs1 != recs2:
diff_found = True
# Also check input analysis fields
if parsed1["input_analysis"].get("contains_amounts") != parsed2["input_analysis"].get("contains_amounts"):
diff_found = True
if parsed1["input_analysis"].get("priority") != parsed2["input_analysis"].get("priority"):
diff_found = True
assert diff_found, "Different inputs should produce differentiable outputs"
print(f"✓ test_input_differentiation passed for personal-budget-planner")
def test_amount_parsing():
"""Test that amounts in input are properly parsed."""
input_text = "I have $5000 income and $3000 expenses"
result = handle(input_text)
parsed = json.loads(result)
assert parsed["input_analysis"].get("contains_amounts") == True
assert "amounts_found" in parsed["input_analysis"]
print(f"✓ test_amount_parsing passed for personal-budget-planner")
if __name__ == "__main__":
test_handle_returns_json()
test_handle_contains_disclaimer()
test_handle_has_recommendations()
test_handle_has_next_steps()
test_input_differentiation()
test_amount_parsing()
print(f"All tests passed for personal-budget-planner")
A rule-drafting skill that helps users define exit conditions in advance for their crypto positions. Use when the user wants to set pre-defined exit rules. P...
---
name: crypto-exit-rule-drafter
description: A rule-drafting skill that helps users define exit conditions in advance for their crypto positions. Use when the user wants to set pre-defined exit rules. Prompt-only.
---
# crypto-exit-rule-drafter
A rule-drafting skill that helps users define exit conditions in advance for their crypto positions.
## Workflow
1. Ask about the current or planned position: asset, size, entry price, and thesis.
2. Ask what would make this investment wrong: price drop, fundamental change, or time horizon.
3. Draft two exit rules: a stop-loss level (downside exit) and a thesis-review level (fundamental exit).
4. Make the rules concrete and written, not vague intentions.
5. Set a review trigger and a consequence for when the rule is hit.
## Output Format
- Position summary
- Downside exit rule (price or percentage level)
- Fundamental exit rule (what must change)
- Review trigger and date
- Written commitment statement
## Quality Bar
- Rules are specific enough to actually trigger, not vague aspirational targets.
- Separates emotional stopping from rule-based stopping.
- Does not set stop-losses so tight that normal volatility triggers them.
## Edge Cases
- If the user has no clear thesis for the position, help them articulate one before drafting rules.
- If the position is long-term and the user has high conviction, focus more on fundamental exit than price stops.
## Compatibility
- Prompt-only, no exchange or portfolio integration.
- Works from user-provided position details.
FILE:handler.py
import json
import re
def _load_skill_meta(skill_name):
skill_dir = f"/Users/jianghaidong/.openclaw/skills/{skill_name}"
with open(f"{skill_dir}/SKILL.md", "r") as f:
content = f.read()
return {"name": skill_name, "description": "loaded"}
def _load_prompt_template(skill_name):
return "placeholder template"
def handle(args):
skill_name = args.get("skill_name", "")
user_input = args.get("input", "")
mode = args.get("mode", "guide")
meta = _load_skill_meta(skill_name)
template = _load_prompt_template(skill_name)
return {"result": "done"}
FILE:tests/test_handler.py
import sys
sys.path.insert(0, '..')
from handler import handle
result = handle({})
assert result["result"] == "done"
print("passed")
A plain-language explanation helper for talking to family members about crypto involvement. Use when discussing crypto with non-crypto people. Prompt-only.
---
name: family-crypto-explainer
description: A plain-language explanation helper for talking to family members about crypto involvement. Use when discussing crypto with non-crypto people. Prompt-only.
---
# family-crypto-explainer
A plain-language explanation helper for talking to family members about crypto involvement.
## Workflow
1. Ask who the family member is, their age, financial background, and what prompted the conversation.
2. Identify the core concern: safety, legitimacy, environmental impact, financial risk, or something else.
3. Translate the crypto concept into a frame the family member already understands.
4. Address the specific concern directly, honestly, and without hype.
5. Give a recommendation on how to continue the conversation.
## Output Format
- Key concern identified
- Translation in their language
- Honest assessment of the concern
- What you would tell them about your own position
- Suggested closing line for the conversation
## Quality Bar
- Respects the family member's skepticism as valid.
- Does not oversell or defend crypto aggressively.
- Honest about risks and uncertainties.
## Edge Cases
- If the family member is elderly or has no financial buffer, lean toward conservative framing.
- If the family member has been scammed before, take extra care with any language that sounds like a pitch.
## Compatibility
- Prompt-only, works from brief descriptions of the situation.
- Good companion to scam red flags and wallet safety skills.
FILE:handler.py
import json
import re
def _load_skill_meta(skill_name):
skill_dir = f"/Users/jianghaidong/.openclaw/skills/{skill_name}"
with open(f"{skill_dir}/SKILL.md", "r") as f:
content = f.read()
return {"name": skill_name, "description": "loaded"}
def _load_prompt_template(skill_name):
return "placeholder template"
def handle(args):
skill_name = args.get("skill_name", "")
user_input = args.get("input", "")
mode = args.get("mode", "guide")
meta = _load_skill_meta(skill_name)
template = _load_prompt_template(skill_name)
return {"result": "done"}
FILE:tests/test_handler.py
import sys
sys.path.insert(0, '..')
from handler import handle
result = handle({})
assert result["result"] == "done"
print("passed")
A reflection skill that helps users process a win without overconfidence or lifestyle inflation. Use after a successful trade or investment gain. Prompt-only.
---
name: crypto-win-humility-check
description: A reflection skill that helps users process a win without overconfidence or lifestyle inflation. Use after a successful trade or investment gain. Prompt-only.
---
# crypto-win-humility-check
A reflection skill that helps users process a win without overconfidence or lifestyle inflation.
## Workflow
1. Ask what happened: position, timing, what the gain means in real life.
2. Separate the outcome from the decision process: skill, luck, or both?
3. Identify what would have to be true for this to repeat consistently.
4. Surface any urge to increase position size, trade more, or change lifestyle based on the win.
5. Generate a humility anchor: a written rule or check that keeps perspective.
## Output Format
- What happened (facts)
- Skill vs. luck breakdown
- Conditions for repetition
- Warning signs of overconfidence
- Humility anchor rule
## Quality Bar
- Celebrates the win without dismissing it.
- Prevents the common pattern of one win leading to over-leveraging or over-trading.
- Grounds the gain in real life context, not percentage terms alone.
## Edge Cases
- If the gain was large enough to materially change the user's life, suggest they take time before making any financial decisions.
- If the user wants to immediately increase their crypto allocation, strongly flag this impulse.
## Compatibility
- Prompt-only, works best immediately after a realized gain.
- Strong complement to the review ritual and portfolio risk sensemaker.
FILE:handler.py
import json
import re
def _load_skill_meta(skill_name):
skill_dir = f"/Users/jianghaidong/.openclaw/skills/{skill_name}"
with open(f"{skill_dir}/SKILL.md", "r") as f:
content = f.read()
return {"name": skill_name, "description": "loaded"}
def _load_prompt_template(skill_name):
return "placeholder template"
def handle(args):
skill_name = args.get("skill_name", "")
user_input = args.get("input", "")
mode = args.get("mode", "guide")
meta = _load_skill_meta(skill_name)
template = _load_prompt_template(skill_name)
return {"result": "done"}
FILE:tests/test_handler.py
import sys
sys.path.insert(0, '..')
from handler import handle
result = handle({})
assert result["result"] == "done"
print("passed")
A guided journal for processing a crypto loss or drawdown in a healthy, non-shaming way. Use when the user has experienced a loss and wants to reflect. Promp...
---
name: crypto-drawdown-journal
description: A guided journal for processing a crypto loss or drawdown in a healthy, non-shaming way. Use when the user has experienced a loss and wants to reflect. Prompt-only.
---
# crypto-drawdown-journal
A guided journal for processing a crypto loss or drawdown in a healthy, non-shaming way.
## Workflow
1. Ask what happened: position, size, time horizon, and what the loss means in real life terms.
2. Separate the outcome from the decision process: was the decision reasonable given what was known?
3. Identify what was in the user's control versus what was not.
4. Surface emotional reactions and name them without judgment.
5. Extract 1-2 practical lessons without spiraling into self-punishment.
## Output Format
- What happened (facts)
- What was the decision at the time
- What went well and what went off-plan
- Emotional check-in
- One practical lesson to carry forward
- One self-care note
## Quality Bar
- Non-judgmental and compassionate.
- Converts emotional pain into useful information.
- Does not allow the spiral of "I should have known" when the information was genuinely unavailable.
## Edge Cases
- If the loss is severe enough to affect daily life, recommend professional support, not just journaling.
- If the user shows signs of compulsive trading patterns, flag this gently and recommend stepping back.
## Compatibility
- Prompt-only, works from memory and rough notes.
- Best used alone or with a trusted person, not as a trading journal.
FILE:handler.py
import json
import re
def _load_skill_meta(skill_name):
skill_dir = f"/Users/jianghaidong/.openclaw/skills/{skill_name}"
with open(f"{skill_dir}/SKILL.md", "r") as f:
content = f.read()
return {"name": skill_name, "description": "loaded"}
def _load_prompt_template(skill_name):
return "placeholder template"
def handle(args):
skill_name = args.get("skill_name", "")
user_input = args.get("input", "")
mode = args.get("mode", "guide")
meta = _load_skill_meta(skill_name)
template = _load_prompt_template(skill_name)
return {"result": "done"}
FILE:tests/test_handler.py
import sys
sys.path.insert(0, '..')
from handler import handle
result = handle({})
assert result["result"] == "done"
print("passed")