plugins/python3-development/skills/snakepolish/SKILL.md
Implementation phase for stinkysnake workflow. Use when tests are written and plan is ready. Implements functions following the modernization plan, runs tests until passing.
npx skillsauth add jamie-bitflight/claude_skills snakepolishInstall 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.
<file_paths>$ARGUMENTS</file_paths>
Execute the implementation plan from /python3-development:stinkysnake Phase 9. Implement functions following the modernization plan, run tests iteratively until all pass.
<file_paths/>
Before invoking this skill, ensure:
/python3-development:stinkysnake phases 1-8 completedpython3-development:python-pytest-architectRead the stinkysnake plan artifacts:
ARTIFACTS TO LOAD:
- [ ] Modernization plan (Phase 3 output)
- [ ] Plan review feedback (Phase 4-5 output)
- [ ] Interface definitions (Phase 7 output)
- [ ] Failing test files (Phase 8 output)
Run tests to confirm failing state:
uv run pytest <file_paths/> -v --tb=short 2>&1 | head -100
Expected: Tests fail because implementations don't exist yet.
If tests pass: Stop. Implementation already complete or tests are not testing the right things.
Follow this implementation sequence:
IMPLEMENTATION ORDER:
1. Type definitions (TypeAlias, TypedDict, Protocol)
2. Data structures (dataclass, Pydantic models)
3. Utility functions (pure functions, no side effects)
4. Core business logic
5. Integration points (API clients, file I/O)
6. Entry points (CLI commands, handlers)
For each planned change:
FOR EACH IMPLEMENTATION ITEM:
1. Read the interface/protocol definition
2. Read the failing test(s) for this component
3. Implement the function/class
4. Run targeted tests: uv run pytest -k "test_name" -v
5. If fails: debug and fix
6. If passes: move to next item
Apply these patterns during implementation:
# Use modern union syntax
def process(data: str | None) -> dict[str, Any]:
...
# Use TypeGuard for narrowing
def is_valid_user(obj: object) -> TypeGuard[User]:
return isinstance(obj, dict) and "id" in obj
from typing import Protocol
class Serializable(Protocol):
def to_dict(self) -> dict[str, Any]: ...
def save(item: Serializable) -> None:
data = item.to_dict()
...
from dataclasses import dataclass, field
@dataclass(slots=True, frozen=True)
class Config:
name: str
options: list[str] = field(default_factory=list)
from pydantic import BaseModel, Field
class APIResponse(BaseModel):
status: int = Field(ge=100, le=599)
data: dict[str, Any]
model_config = {"strict": True}
# httpx for async HTTP
async with httpx.AsyncClient() as client:
response = await client.get(url)
# orjson for fast JSON
data = orjson.loads(response.content)
output = orjson.dumps(result, option=orjson.OPT_INDENT_2)
# tomlkit for TOML with comments preserved
doc = tomlkit.parse(content)
doc["section"]["key"] = value
After each implementation batch:
# Run full test suite
uv run pytest <file_paths/> -v --tb=short
# If failures remain, focus on failing tests
uv run pytest <file_paths/> -v --tb=long -x # Stop on first failure
Before completion, verify code quality:
# Format check
uv run ruff format --check <file_paths/>
# Lint check
uv run ruff check <file_paths/>
# Type check — match hooks/CI; ty when repo runs ty (do not infer mypy from [tool.mypy] alone)
uv run ty check <file_paths/>
# uv run mypy <file_paths/> --strict
Fix any issues that arise.
Confirm all tests pass:
uv run pytest <file_paths/> -v --cov --cov-report=term-missing
Success Criteria:
When all tests pass and static analysis is clean:
If a test failure appears to be a test bug rather than implementation bug:
If an implementation is blocked:
../stinkysnake/SKILL.md - Parent workflow../../agents/python-cli-architect.md - Implementation agent../python3-development/SKILL.md - Modern Python patternsdevelopment
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
tools
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.