72 lines
3.7 KiB
Markdown
72 lines
3.7 KiB
Markdown
# Fission Python Skill Plan
|
|
|
|
## Context
|
|
The user wanted to create a new skill called `fission-python-skill` in the `@fission-plugin/skills` directory. This skill should provide three main capabilities:
|
|
1. Create a new fission python project with template (based on @data/py-eom-quota)
|
|
2. Analyze configuration in .fission of each fission-python project
|
|
3. Parse and update docstring of fission function method
|
|
|
|
## Approach
|
|
Based on my exploration of the codebase:
|
|
- The example project @data/py-eom-quota shows a standard fission python project structure
|
|
- Fission configuration is stored in .fission/deployment.json and similar files
|
|
- Python functions contain fission configuration in their docstrings using a specific format (between ```fission and ``` markers)
|
|
- The fission-plugin/skills directory currently contained empty SKILL.md and reference.md files
|
|
|
|
I implemented all three requested capabilities as shell scripts within the skill directory.
|
|
|
|
## Implementation Summary
|
|
|
|
### Phase 1: Skill Creation Completed
|
|
1. Created the skill directory: `/workspaces/claude-marketplace/fission-plugin/skills/fission-python-skill/`
|
|
2. Created SKILL.md following the skill format from the documentation
|
|
3. Created reference.md with detailed usage instructions
|
|
4. Implemented the three core tools as shell scripts:
|
|
- `create-project.sh`: Creates a new fission python project from template
|
|
- `analyze-config.sh`: Analyzes .fission configuration in a project
|
|
- `update-docstring.sh`: Parses and updates docstrings in fission function methods
|
|
|
|
### Phase 2: Tool Implementation Details (Completed)
|
|
|
|
#### create-project.sh
|
|
- Takes project name and optional destination directory
|
|
- Copies template from @data/py-eom-quota (excluding .git, etc.)
|
|
- Replaces placeholder values in configuration files
|
|
- Provides usage instructions for next steps
|
|
|
|
#### analyze-config.sh
|
|
- Takes path to a fission project
|
|
- Reads and parses .fission/deployment.json (and related files)
|
|
- Outputs structured summary of:
|
|
- Environments and their resource settings
|
|
- Packages and build commands
|
|
- Functions and their triggers
|
|
- Secrets and configmaps
|
|
- Archives and source configuration
|
|
|
|
#### update-docstring.sh
|
|
- Takes path to a python file and optionally function name
|
|
- Parses docstrings to extract embedded fission configuration (between ```fission markers)
|
|
- Allows updating the fission configuration within docstrings using --set flag
|
|
- Can retrieve current configuration using --get flag (default)
|
|
- Preserves existing function code and documentation outside fission blocks
|
|
- Uses Python script for robust JSON handling and string manipulation
|
|
|
|
### Phase 3: Testing (Completed)
|
|
- Tested create-project.sh by generating a new project and verifying structure
|
|
- Tested analyze-config.sh on the existing @data/py-eom-quota project
|
|
- Tested update-docstring.sh by retrieving and modifying fission configuration in function docstrings
|
|
- All tools have proper help text and error handling
|
|
|
|
## Files Created
|
|
- `/workspaces/claude-marketplace/fission-python-skill/SKILL.md`
|
|
- `/workspaces/claude-marketplace/fission-python-skill/reference.md`
|
|
- `/workspaces/claude-marketplace/fission-python-skill/create-project.sh`
|
|
- `/workspaces/claude-marketplace/fission-python-skill/analyze-config.sh`
|
|
- `/workspaces/claude-marketplace/fission-python-skill/update-docstring.sh`
|
|
|
|
## Verification Results
|
|
✓ create-project.sh: Successfully creates new fission python projects from template
|
|
✓ analyze-config.sh: Successfully analyzes .fission configuration showing environments, packages, functions, secrets, etc.
|
|
✓ update-docstring.sh: Successfully extracts and updates fission configuration in function docstrings
|
|
All tools are executable and include proper error handling and usage instructions. |