skills/general/SKILL.md
Universal coding principles and best practices
npx skillsauth add jcsaaddupuy/badrobots generalInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
User Request
↓
Is it a specific technology? → Use specialized skill
├─ Python → python skill
├─ Docker → docker skill
├─ GitLab CI → gitlab-ci or pipeline-fix skill
├─ Git operations → commit skill
└─ GitLab queries → glab skill
↓
General task → Follow General Workflow below
1. Understand the Request
├─ What is the user asking for?
├─ What technology/language is involved?
└─ Is there an existing codebase to respect?
↓
2. Gather Context
├─ Check for existing project structure
├─ Identify coding style in use
├─ Look for configuration files (.gitignore, pyproject.toml, etc.)
└─ Check for documentation or README
↓
3. Choose Appropriate Skill(s)
├─ Read relevant skill file(s)
├─ Follow skill-specific workflows
└─ Combine multiple skills if needed
↓
4. Plan Implementation
├─ Keep it simple
├─ Follow existing patterns
└─ Don't over-engineer
↓
5. Execute
├─ Write code/config
├─ Add tests if applicable
└─ Validate/lint/format
↓
6. Verify
├─ Test the solution
├─ Check for errors
└─ Ensure requirements met
↓
7. Communicate Results
├─ Be concise
├─ Show what was done
└─ Report any issues
# ❌ BAD - States the obvious
# Increment counter by 1
counter += 1
# ✅ GOOD - Explains why
# Skip first item as it's always the header row
counter += 1
# ❌ BAD - Too verbose
"""
This function takes a list of numbers and returns the sum.
It iterates through each number in the list and adds it to
a running total, which is then returned at the end.
"""
def sum_numbers(numbers: list[int]) -> int:
return sum(numbers)
# ✅ GOOD - Concise and informative
def sum_numbers(numbers: list[int]) -> int:
"""Return the sum of numbers."""
return sum(numbers)
project/
├── src/ # Source code
├── tests/ # Test files (same level as src/)
├── scripts/ # Helper/utility scripts
├── examples/ # Example code and usage
├── reports/ # Generated reports/summaries
├── troubleshoot/ # Troubleshooting resources
│ └── scripts/ # Diagnostic scripts
├── docs/ # Documentation (if extensive)
├── .gitignore # Git ignore rules
├── README.md # Project overview
└── pyproject.toml # Project config (Python projects)
Helper Scripts → scripts/
# Example: scripts/setup.sh
#!/bin/bash
# Setup development environment
Reports & Summaries → reports/
# Example: reports/analysis-2024-02-16.md
Example Code → examples/
# Example: examples/basic_usage.py
Troubleshooting → troubleshoot/scripts/
# Example: troubleshoot/scripts/check_environment.sh
Verify before modifying
git log to understand project historyRespect existing style
Respect existing architecture
# Standard format
copilot-feature/<feature-name>
# Examples
copilot-feature/add-authentication
copilot-feature/fix-memory-leak
copilot-feature/refactor-database-layer
# Create and switch to feature branch
git checkout -b copilot-feature/my-feature
# Start new work
git checkout main
git pull
git checkout -b copilot-feature/new-feature
# Make changes, test, commit
# ... do work ...
git add <files>
git commit -m "feat(scope): description"
# Push when ready (see commit skill for guidance)
git push -u origin copilot-feature/new-feature
When implementing a new feature:
Unit Tests:
tests/ folder at same level as src/test_<module>.py for src/<module>.pyIntegration Tests:
tests/integration/ or separate from unit testsExample Test Structure:
project/
├── src/
│ ├── auth.py
│ └── database.py
└── tests/
├── test_auth.py # Unit tests for auth
├── test_database.py # Unit tests for database
└── integration/
└── test_auth_flow.py # Integration tests
1. Read the Error Message
├─ What is the actual error?
├─ What file/line is mentioned?
└─ Is it a syntax, type, runtime, or logic error?
↓
2. Check Recent Changes
├─ What was modified last?
├─ git diff to see changes
└─ Can you revert to working state?
↓
3. Isolate the Problem
├─ Can you reproduce it?
├─ Is it consistent or intermittent?
└─ What's the minimal code to trigger it?
↓
4. Gather Information
├─ Check logs
├─ Add debug statements
├─ Run with verbose flags
└─ Check environment (versions, config)
↓
5. Generate Diagnostic Script (if complex)
└─ Save to troubleshoot/scripts/
↓
6. Apply Fix
├─ Make minimal change to fix
├─ Test the fix
└─ Add test to prevent regression
↓
7. Document (if non-obvious)
└─ Add comment explaining the fix
# troubleshoot/scripts/check_environment.sh
#!/bin/bash
# Check if environment is properly configured
echo "=== Environment Check ==="
# Check Python version
python --version
# Check installed packages
pip list | grep -E "requests|pydantic"
# Check environment variables
echo "API_KEY set: $([ -n "$API_KEY" ] && echo "yes" || echo "no")"
# Check Docker
docker --version
docker compose version
# Check GitLab connectivity
glab auth status
echo "=== Check Complete ==="
Example 1: Python + Docker + GitLab CI
Task: Deploy Python app
1. Use python skill → Structure code, write tests
2. Use docker skill → Create Dockerfile
3. Use gitlab-ci skill → Setup CI/CD pipeline
4. Use commit skill → Commit all changes
Example 2: Fix Failing Pipeline
Task: Pipeline failed in MR
1. Use glab skill → Get pipeline info
2. Use pipeline-fix skill → Diagnose and fix
3. Use commit skill → Commit the fix
4. Verify with glab skill → Check new pipeline
Example 3: New Python Project Setup
Task: Create new Python project
1. Use python skill → Create project structure
2. Use gitignore skill → Generate .gitignore
3. Use gitlab-ci skill → Add CI/CD config
4. Use commit skill → Initial commit
| Task | Primary Skill | Supporting Skills | |------|---------------|-------------------| | Write Python code | python | general, python-uv | | Create Dockerfile | docker | general | | Setup CI/CD | gitlab-ci | docker, python, pipeline-fix | | Fix failed pipeline | pipeline-fix | glab, gitlab-ci | | Query GitLab | glab | - | | Make git commit | commit | general | | Generate .gitignore | gitignore | - | | Work with LangGraph | langgraph | python, openai | | Create diagrams | mermaid | - | | Use OpenAI API | openai | python | | Control tmux | tmux | - | | Spawn sub-agents | pi-spawn | tmux, general |
# ❌ BAD - Over-complicated
class SingletonMetaclass(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super().__call__(*args, **kwargs)
return cls._instances[cls]
class Config(metaclass=SingletonMetaclass):
pass
# ✅ GOOD - Simple module-level instance
# config.py
class Config:
def __init__(self):
self.value = "default"
config = Config() # Single instance
# ❌ BAD - Optimizing before knowing it's slow
from functools import lru_cache
@lru_cache(maxsize=1000)
def simple_addition(a: int, b: int) -> int:
return a + b
# ✅ GOOD - Write simple code first
def simple_addition(a: int, b: int) -> int:
return a + b
# Optimize later if profiling shows it's a bottleneck
# Existing code uses:
def get_user(id: int) -> User:
...
def get_post(id: int) -> Post:
...
# ❌ BAD - Different pattern
def fetch_comment(comment_id: int) -> Comment:
...
# ✅ GOOD - Follow existing pattern
def get_comment(id: int) -> Comment:
...
# Existing structure:
src/
services/
models/
utils/
# ❌ BAD - New pattern
src/
helpers/ # Don't introduce new top-level folders
# ✅ GOOD - Use existing structure
src/
utils/ # Add to existing folder
| Situation | Action | |-----------|--------| | New Python project | Read python skill | | Docker container needed | Read docker skill | | CI/CD pipeline failing | Read pipeline-fix skill | | Need GitLab info | Read glab skill | | Ready to commit | Read commit skill | | Need .gitignore | Read gitignore skill | | Complex system | Combine multiple skills | | Unsure what to do | Follow General Workflow above |
Read specific skill files for detailed guidance:
development
DuckDB patterns for JSON/JSONL analysis, array unnesting, and common gotchas. Use when querying JSON files, nested data, or encountering "UNNEST not supported here" errors.
development
Mealie recipe manager API: recipes, shopping lists, meal plans. Requires MEALIE_BASE_URL and MEALIE_API_KEY.
business
TimeWarrior time tracking: start/stop intervals, query durations by tag or issue, compute totals for issue tracker time reporting
development
Bookmark manager for saving, searching, and annotating web content. Use when: (1) saving a webpage for later reference, (2) searching previously saved bookmarks, (3) adding highlights/annotations to saved content, (4) user asks to 'bookmark this' or 'save this article'. Requires READECK_BASE_URL and READECK_API_KEY environment variables.