108 lines
2.7 KiB
Python
Executable File
108 lines
2.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
test.example - A simple test skill for validating the meta.create orchestrator workflow
|
|
|
|
Generated by meta.skill with Betty Framework certification
|
|
"""
|
|
|
|
import os
|
|
import sys
|
|
import json
|
|
import yaml
|
|
from pathlib import Path
|
|
from typing import Dict, List, Any, Optional
|
|
|
|
|
|
from betty.config import BASE_DIR
|
|
from betty.logging_utils import setup_logger
|
|
from betty.certification import certified_skill
|
|
|
|
logger = setup_logger(__name__)
|
|
|
|
|
|
class TestExample:
|
|
"""
|
|
A simple test skill for validating the meta.create orchestrator workflow
|
|
"""
|
|
|
|
def __init__(self, base_dir: str = BASE_DIR):
|
|
"""Initialize skill"""
|
|
self.base_dir = Path(base_dir)
|
|
|
|
@certified_skill("test.example")
|
|
def execute(self, input_data_string___test_input_data: Optional[str] = None) -> Dict[str, Any]:
|
|
"""
|
|
Execute the skill
|
|
|
|
Returns:
|
|
Dict with execution results
|
|
"""
|
|
try:
|
|
logger.info("Executing test.example...")
|
|
|
|
# TODO: Implement skill logic here
|
|
|
|
# Implementation notes:
|
|
# This is a minimal test skill to verify that meta.create can properly orchestrate the creation of skills, check for duplicates, and validate compatibility.
|
|
|
|
# Placeholder implementation
|
|
result = {
|
|
"ok": True,
|
|
"status": "success",
|
|
"message": "Skill executed successfully"
|
|
}
|
|
|
|
logger.info("Skill completed successfully")
|
|
return result
|
|
|
|
except Exception as e:
|
|
logger.error(f"Error executing skill: {e}")
|
|
return {
|
|
"ok": False,
|
|
"status": "failed",
|
|
"error": str(e)
|
|
}
|
|
|
|
|
|
def main():
|
|
"""CLI entry point"""
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser(
|
|
description="A simple test skill for validating the meta.create orchestrator workflow"
|
|
)
|
|
|
|
parser.add_argument(
|
|
"--input-data-string---test-input-data",
|
|
help="input_data (string) - Test input data"
|
|
)
|
|
parser.add_argument(
|
|
"--output-format",
|
|
choices=["json", "yaml"],
|
|
default="json",
|
|
help="Output format"
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
|
|
# Create skill instance
|
|
skill = TestExample()
|
|
|
|
# Execute skill
|
|
result = skill.execute(
|
|
input_data_string___test_input_data=args.input_data_string___test_input_data,
|
|
)
|
|
|
|
# Output result
|
|
if args.output_format == "json":
|
|
print(json.dumps(result, indent=2))
|
|
else:
|
|
print(yaml.dump(result, default_flow_style=False))
|
|
|
|
# Exit with appropriate code
|
|
sys.exit(0 if result.get("ok") else 1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|