diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8601c28..ca707ef 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -7,10 +7,8 @@ "name" : "Fission-Python-Skill", "description": "Skill for creating, analyzing, and managing Fission Python projects.", "source" : "./", - "type" : "skill", "path" : "fission-python", - "tools" : ["create-project", "analyze-config", "update-docstring"], - "version" : "1.0.2" + "version" : "1.0.3" } ] } diff --git a/fission-python/.claude-plugin/plugin.json b/fission-python/.claude-plugin/plugin.json index 85839c0..18c95a2 100644 --- a/fission-python/.claude-plugin/plugin.json +++ b/fission-python/.claude-plugin/plugin.json @@ -2,7 +2,5 @@ "id" : "fission-python-skill", "name" : "Fission-Python-Skill", "description": "Skill for creating, analyzing, and managing Fission Python projects.", - "type" : "skill", - "tools" : ["create-project", "analyze-config", "update-docstring"], - "version" : "1.0.2" + "version" : "1.0.3" } diff --git a/fission-python/skills/analyze-config/SKILL.md b/fission-python/skills/analyze-config/SKILL.md new file mode 100644 index 0000000..0c6be9f --- /dev/null +++ b/fission-python/skills/analyze-config/SKILL.md @@ -0,0 +1,34 @@ +--- +name: analyze-config +description: Analyze the .fission configuration of an existing Fission Python project +--- + +Analyze the Fission configuration of a project by running the analyze-config script. + +## Usage + +```bash +./fission-python/analyze-config.sh +``` + +- `project-path`: Path to the Fission Python project directory + +Requires `jq` to be installed for JSON parsing. + +## What it does + +Reads `.fission/deployment.json` (and override files) and outputs: +- Environments defined +- Packages and their build commands +- Functions and their configurations +- HTTP triggers and URLs +- Cron triggers +- Secrets and configmaps + +## Example + +User asks: "Analyze the Fission config of ./my-api" + +```bash +./fission-python/analyze-config.sh ./my-api +``` diff --git a/fission-python/skills/create-project/SKILL.md b/fission-python/skills/create-project/SKILL.md new file mode 100644 index 0000000..de06de1 --- /dev/null +++ b/fission-python/skills/create-project/SKILL.md @@ -0,0 +1,32 @@ +--- +name: create-project +description: Create a new Fission Python project from the standard template +--- + +Create a new Fission Python project by running the create-project script. + +## Usage + +Run the following command from the repository root: + +```bash +./fission-python/create-project.sh [destination-directory] +``` + +- `project-name`: Name for the new project (letters, numbers, hyphens, underscores only) +- `destination-directory`: Where to create the project (default: current directory) + +## What it does + +1. Copies the template from `fission-python/template/` +2. Substitutes project name in `.fission/deployment.json`, override files, `src/helpers.py`, and `README.md` +3. Validates the created project structure (build.sh, requirements.txt, workflows, docstrings) +4. Creates a `.env` file with default environment variables + +## Example + +User asks: "Create a new Fission project called my-api in ./projects/" + +```bash +./fission-python/create-project.sh my-api ./projects/ +``` diff --git a/fission-python/skills/update-docstring/SKILL.md b/fission-python/skills/update-docstring/SKILL.md new file mode 100644 index 0000000..e319852 --- /dev/null +++ b/fission-python/skills/update-docstring/SKILL.md @@ -0,0 +1,48 @@ +--- +name: update-docstring +description: View or update the Fission configuration embedded in a Python function's docstring +--- + +View or update Fission configuration in a Python function docstring using the update-docstring script. + +## Usage + +```bash +# View current config +./fission-python/update-docstring.sh --get + +# Update config +./fission-python/update-docstring.sh --set '' +``` + +## Docstring format + +The script reads/writes Fission config between ` ```fission ` and ` ``` ` markers: + +```python +def main(): + """ + ```fission + { + "name": "function-name", + "http_triggers": { + "trigger-name": {"url": "/endpoint", "methods": ["GET"]} + } + } + ``` + """ +``` + +## Examples + +User asks: "Show the Fission config of function `main` in `./my-api/src/func.py`" + +```bash +./fission-python/update-docstring.sh ./my-api/src/func.py main --get +``` + +User asks: "Update the HTTP trigger URL to `/v2/items`" + +```bash +./fission-python/update-docstring.sh ./my-api/src/func.py main --set '{"http_triggers": {"api": {"url": "/v2/items", "methods": ["GET"]}}}' +```