bad-example-skill
БесплатноБез исполняемых скриптовНе проверенANTI-PATTERN - Example showing violations of self-containment (DO NOT COPY)
от bobmatnyc★ 79 звёзд на GitHubОб этом скилле
⚠️ BAD EXAMPLE - Interdependent Skill (Anti-Pattern)
WARNING: This is an ANTI-PATTERN example showing what NOT to do.
DO NOT COPY THIS STRUCTURE. See good-self-contained-skill for correct approach.
❌ VIOLATION #1: Relative Path Dependencies
## Related Documentation
For setup instructions, see [../setup-skill/SKILL.md](../setup-skill/SKILL.md)
For testing patterns, see:
- [../../testing/pytest-patterns/](../../testing/pytest-patterns/)
- [../../testing/test-utils/](../../testing/test-utils/)
Database integration: [../../data/database-skill/](../../data/database-skill/)
Why This is Wrong:
- ❌ Uses relative paths (
../,../../) - ❌ Assumes hierarchical directory structure
- ❌ Breaks in flat deployment (
~/.claude/skills/) - ❌ Links break when skill deployed standalone
Correct Approach:
## Complementary Skills
Consider these related skills (if deployed):
- **setup-skill**: Installation and configuration patterns
- **pytest-patterns**: Testing framework and fixtures
- **database-skill**: Database integration patterns
*Note: All skills are independently deployable.*
❌ VIOLATION #2: Missing Essential Content
## Testing
This skill uses pytest for testing.
**See pytest-patterns skill for all testing code.**
To write tests for this framework, install pytest-patterns skill
and refer to its documentation.
Why This is Wrong:
- ❌ No actual testing patterns included
- ❌ Requires user to have another skill
- ❌ Skill is incomplete without other skills
- ❌ "See other skill" instead of inlining
Correct Approach:
## Testing (Self-Contained)
**Essential pytest pattern** (inlined):
```python
import pytest
from example_framework.testing import TestClient
@pytest.fixture
def client():
"""Test client fixture."""
return TestClient(app)
def test_home_route(client):
"""Test homepage."""
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"message": "Hello"}
Advanced fixtures (if pytest-patterns skill deployed):
- Parametrized fixtures
- Database session fixtures
- Mock fixtures
See pytest-patterns skill for comprehensive patterns.
---
## ❌ VIOLATION #3: Hard Skill Dependencies
```markdown
## Prerequisites
**Required Skills**:
1. **setup-skill** - Must be installed first
2. **database-skill** - Required for database operations
3. **pytest-patterns** - Required for testing
Install all required skills before using this skill:
```bash
claude-code skills add setup-skill database-skill pytest-patterns
This skill will not work without these dependencies.
**Why This is Wrong**:
- ❌ Lists other skills as "Required"
- ❌ Skill doesn't work standalone
- ❌ Creates deployment coupling
- ❌ Violates self-containment principle
**Correct Approach**:
```markdown
## Prerequisites
**External Dependencies**:
```bash
pip install example-framework pytest sqlalchemy
Complementary Skills
When using this skill, consider (if deployed):
- setup-skill: Advanced configuration patterns (optional)
- database-skill: ORM patterns and optimization (optional)
- pytest-patterns: Testing enhancements (optional)
This skill is fully functional independently.
---
## ❌ VIOLATION #4: Cross-Skill Imports
```python
"""
Bad example - importing from other skills.
"""
# ❌ DON'T DO THIS
from skills.database_skill import get_db_session
from skills.pytest_patterns import fixture_factory
from ..shared.utils import validate_input
# Using imported patterns
@app.route("/users")
def create_user(data):
# Requires database-skill to be installed
with get_db_session() as session:
user = User(**data)
session.add(user)
return user.to_dict()
Why This is Wrong:
- ❌ Imports from other skills
- ❌ Code won't run without other skills
- ❌ Creates runtime dependencies
- ❌ Violates Python module boundaries
Correct Approach:
"""
Good example - self-contained implementation.
"""
from contextlib import contextmanager
# ✅ Include pattern directly in this skill
@contextmanager
def get_db_session():
"""Database session context manager (self-contained)."""
db = SessionLocal()
try:
yield db
db.commit()
except Exception:
db.rollback()
raise
finally:
db.close()
@app.route("/users")
def create_user(data):
# Works independently
with get_db_session() as session:
user = User(**data)
session.add(user)
return user.to_dict()
❌ VIOLATION #5: Hierarchical Directory Assumptions
## Project Structure
This skill is located in:
toolchains/python/frameworks/bad-example-skill/
**Navigate to parent directories for related skills**:
- `../` - Other framework skills
- `../../testing/` - Testing skills
- `../../data/` - Database skills
**All skills in `toolchains/
Установить bad-example-skill в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bad-example-skill?
ANTI-PATTERN - Example showing violations of self-containment (DO NOT COPY)
Как установить скилл bad-example-skill?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bad-example-skill запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic