add-cog

Solid

Step-by-step guide to add a new discord.py Cog to the framework

AI & Automation 55 stars 28 forks Updated today MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
58
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Add Cog — Scaffold a New Discord.py Cog ## When to Activate - Adding new Discord bot functionality - Creating a new slash command or event handler - When asked to "add a cog", "create a command", or "add a feature" ## Steps ### 1. Create the Cog File Create `claude_discord/cogs/your_cog.py`: ```python """Short description of what this Cog does.""" from __future__ import annotations import logging import discord from discord import app_commands from discord.ext import commands logger = logging.getLogger(__name__) class YourCog(commands.Cog): """Docstring explaining the Cog's purpose.""" def __init__( self, bot: commands.Bot, # Add dependencies as constructor params (dependency injection) ) -> None: self.bot = bot # Add commands and listeners here ``` ### 2. If It Runs Claude CLI Use the shared helper — **never duplicate the streaming logic**: ```python from ._run_helper import run_claude_in_thread # In your command handler: runner = self.runner.clone() # Always clone for concurrent safety await run_claude_in_thread( thread=thread, runner=runner, repo=self.repo, prompt=user_input, session_id=existing_session_id, ) ``` ### 3. Export from Package Add to `claude_discord/cogs/__init__.py`: ```python from .your_cog import YourCog ``` Add to `claude_discord/__init__.py`: ```python from .cogs.your_cog import YourCog # And add "YourCog" to __all__ ``` ### 4. Write Tests Create `tests/test_yo...

Details

Author
ebibibi
Repository
ebibibi/ebi-agent-chat-relay
Created
6 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

build-models

Package and build custom AI models with Cog for deployment on Replicate. Use when creating a cog.yaml or predict.py, defining model inputs and outputs, loading model weights at setup time, building Docker images for ML models, serving locally with cog serve or cog predict, or porting a HuggingFace, GitHub, or ComfyUI model to run on Replicate. Trigger on phrases like "build a model", "package a model", "create a Cog model", "wrap a model", "containerize an AI model", "predict.py", "cog.yaml", "BasePredictor", or "Cog container", and when referencing cog.run, github.com/replicate/cog, or github.com/replicate/cog-examples. Covers GPU and CUDA setup, pget for fast weight downloads, async predictors with continuous batching, streaming outputs, and cold-boot optimization for image, video, audio, and LLM models. For pushing built models to Replicate, see publish-models. For running existing models, see run-models.

0 Updated 4 days ago
bertbertov
AI & Automation Solid

add

ADD (AI-Driven Development) — a lean, state-tracked workflow where the AI writes the code and the human owns direction and verification. Drives every change through one atomic task node: Direction (specify · plan · red tests) → Build → Verify, red/green TDD built in, trusted on a recorded receipt not a plausible diff. Research rides the same rails: "investigate this bug", "evaluate this library", "research X" route to the Explore lane. Use whenever a repo has a `.add/` bundle, or the user says "add", "/add", "start a task", "next phase", "specify this", "ADD method", "AI-driven development", or wants spec/tests-first discipline over vague-prompt coding. Resumes across sessions from the bundle alone — run `add status`, never re-read the repo.

18 Updated 1 weeks ago
pilotspace
AI & Automation Featured

add-command

Scaffold a new command definition inside an existing addon or framework

201 Updated today
jmagly