Reorganize skills: scope guards, archive deploy, restructure z-image
- Add SCOPE guards to major-domo, paper-dynasty, proxmox skills to prevent activation in unrelated projects - Archive deploy skill (replaced by Gitea workflows + per-project scripts) - Restructure z-image: remove embedded app code, add SKILL.md (app relocated to /mnt/NV2/Development/z-image/ as uv tool) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b7eb626785
commit
e76527a0a0
@ -176,6 +176,7 @@
|
||||
"frontend-design@claude-plugins-official": true,
|
||||
"rust-analyzer-lsp@claude-plugins-official": true
|
||||
},
|
||||
"autoUpdatesChannel": "latest",
|
||||
"skipDangerousModePermissionPrompt": true,
|
||||
"effortLevel": "medium"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: major-domo
|
||||
description: Comprehensive Major Domo (SBA fantasy baseball league) management - Discord bot operations, API operations, database management, league operations, analytics, and development workflows. USE WHEN user mentions Major Domo, SBA, league operations, player stats, team rosters, Discord bot management, database migrations, or needs to work with the Strat-o-Matic Baseball Association system. Supports both production and development environments.
|
||||
description: Comprehensive Major Domo (SBA fantasy baseball league) management - Discord bot operations, API operations, database management, league operations, analytics, and development workflows. USE WHEN user mentions Major Domo, SBA, league operations, player stats, team rosters, Discord bot management, database migrations, or needs to work with the Strat-o-Matic Baseball Association system. Supports both production and development environments. SCOPE: Only use in major-domo-v2, major-domo-bot, major-domo-database repos. Do not activate in unrelated projects.
|
||||
---
|
||||
|
||||
# Major Domo - SBA Fantasy Baseball League Management
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: paper-dynasty
|
||||
description: Complete Paper Dynasty baseball card game management - API operations, gauntlet cleanup, pack distribution, scouting updates, card generation, team/player queries. USE WHEN user mentions Paper Dynasty, gauntlet teams, player cards, scouting reports, game stats, pack distribution, rewards, or needs database operations. Supports both structured workflows and creative ad-hoc requests.
|
||||
description: Complete Paper Dynasty baseball card game management - API operations, gauntlet cleanup, pack distribution, scouting updates, card generation, team/player queries. USE WHEN user mentions Paper Dynasty, gauntlet teams, player cards, scouting reports, game stats, pack distribution, rewards, or needs database operations. Supports both structured workflows and creative ad-hoc requests. SCOPE: Only use in paper-dynasty, paper-dynasty-database repos. Do not activate in unrelated projects.
|
||||
---
|
||||
|
||||
# Paper Dynasty - Baseball Card Game Management
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
name: proxmox
|
||||
description: Comprehensive Proxmox VE management - VM lifecycle (start/stop/restart), VM creation/cloning, snapshot management, resource monitoring, LXC containers, storage operations, and backup management. USE WHEN user mentions "proxmox", "vm", "virtual machine", "qemu", "lxc", "container", "hypervisor", or needs VM infrastructure operations.
|
||||
description: Comprehensive Proxmox VE management - VM lifecycle (start/stop/restart), VM creation/cloning, snapshot management, resource monitoring, LXC containers, storage operations, and backup management. USE WHEN user mentions "proxmox", "vm", "virtual machine", "qemu", "lxc", "container", "hypervisor", or needs VM infrastructure operations. SCOPE: Only use in claude-home or vm-management contexts. Do not activate in unrelated projects.
|
||||
---
|
||||
|
||||
# Proxmox - Virtual Infrastructure Management
|
||||
|
||||
52
skills/z-image/SKILL.md
Normal file
52
skills/z-image/SKILL.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
name: z-image
|
||||
description: Generate images from text prompts using the Z-Image Turbo model (Tongyi-MAI) with local GPU inference. USE WHEN user says "generate an image", "create a picture", "make an image of", "z-image", or describes something they want visualized.
|
||||
allowed-tools: Bash(z-image:*)
|
||||
---
|
||||
|
||||
# Z-Image - Local AI Image Generation
|
||||
|
||||
## When to Activate This Skill
|
||||
- "Generate an image of..."
|
||||
- "Create a picture of..."
|
||||
- "Make me an image"
|
||||
- "z-image [prompt]"
|
||||
- User describes something visual they want generated
|
||||
|
||||
## Tool
|
||||
|
||||
**Binary:** `z-image` (in PATH via `~/bin/z-image`)
|
||||
**Script:** `~/.claude/skills/z-image/generate.py`
|
||||
**Model:** Tongyi-MAI/Z-Image-Turbo (diffusers, bfloat16, CUDA)
|
||||
**venv:** `~/.claude/skills/z-image/.venv/`
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Basic generation
|
||||
z-image "a cat sitting on a cloud"
|
||||
|
||||
# Custom output filename
|
||||
z-image "sunset over mountains" -o sunset.png
|
||||
|
||||
# Custom output directory
|
||||
z-image "forest path" -d ~/Pictures/ai-generated/
|
||||
|
||||
# More inference steps (higher quality, slower)
|
||||
z-image "detailed portrait" -s 20
|
||||
|
||||
# Disable CPU offloading (faster if VRAM allows)
|
||||
z-image "quick sketch" --no-offload
|
||||
```
|
||||
|
||||
## Defaults
|
||||
- **Steps:** 9 (fast turbo mode)
|
||||
- **Guidance scale:** 0.0 (turbo model doesn't need guidance)
|
||||
- **Output:** `zimage_TIMESTAMP_PROMPT.png` in current directory
|
||||
- **VRAM:** Uses CPU offloading by default to reduce VRAM usage
|
||||
|
||||
## Notes
|
||||
- First run downloads the model (~several GB)
|
||||
- Requires NVIDIA GPU with CUDA support
|
||||
- Output is always PNG format
|
||||
- After generating, use the Read tool to show the image to the user
|
||||
@ -1,61 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Z-Image CLI - Generate images from text prompts"""
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
|
||||
from diffusers import ZImagePipeline
|
||||
import torch
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Generate images with Z-Image")
|
||||
parser.add_argument("prompt", help="Text description of the image to generate")
|
||||
parser.add_argument("-o", "--output", help="Output filename (default: auto-generated)")
|
||||
parser.add_argument("-s", "--steps", type=int, default=9, help="Inference steps (default: 9)")
|
||||
parser.add_argument("--no-offload", action="store_true", help="Disable CPU offloading (requires more VRAM)")
|
||||
parser.add_argument("-d", "--output-dir", default=".", help="Output directory (default: current)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
print("Loading Z-Image model...")
|
||||
pipe = ZImagePipeline.from_pretrained(
|
||||
"Tongyi-MAI/Z-Image-Turbo",
|
||||
torch_dtype=torch.bfloat16
|
||||
)
|
||||
|
||||
if args.no_offload:
|
||||
pipe.to("cuda")
|
||||
else:
|
||||
pipe.enable_model_cpu_offload()
|
||||
|
||||
print(f"Generating image with {args.steps} steps...")
|
||||
print(f"Prompt: {args.prompt}")
|
||||
|
||||
image = pipe(
|
||||
prompt=args.prompt,
|
||||
num_inference_steps=args.steps,
|
||||
guidance_scale=0.0
|
||||
).images[0]
|
||||
|
||||
# Generate output filename if not provided
|
||||
if args.output:
|
||||
output_path = Path(args.output_dir) / args.output
|
||||
else:
|
||||
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
||||
# Create safe filename from prompt
|
||||
safe_prompt = "".join(c if c.isalnum() or c in " -_" else "" for c in args.prompt[:30])
|
||||
safe_prompt = safe_prompt.strip().replace(" ", "_")
|
||||
output_path = Path(args.output_dir) / f"zimage_{timestamp}_{safe_prompt}.png"
|
||||
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
image.save(output_path)
|
||||
print(f"Image saved to: {output_path}")
|
||||
|
||||
return str(output_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Reference in New Issue
Block a user