feat(opencode): add language-specific coding skills

- add conventions for Bash, C#, Go, Python, and TypeScript
- add frontend guidance for HTMX, PrimeVue, and Vue
- document formatting, typing, testing, async, and framework-specific practices
- reference official documentation for framework API details
This commit is contained in:
colem
2026-08-11 15:28:09 -05:00
parent 71f73fccbc
commit a4fc747df2
8 changed files with 192 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
---
name: python
description: Python conventions (PEP 8, ruff, type hints). Use when editing .py files.
---
# Python Conventions
## Style
- Follow PEP 8; run `ruff check` and `ruff format` for linting and formatting.
- Let ruff manage line length and import ordering; do not hand-format against it.
## Typing
- Add type hints on all function signatures; prefer modern syntax (`list[int]`, `X | None`) on supported Python versions.
- Use `dataclasses` (or Pydantic where validation is required) for structured data.
- Prefer an explicit exception hierarchy over bare `except:`.
## Idioms
- Prefer `pathlib.Path` over `os.path`.
- Use f-strings for interpolation; use the `logging` module with structured handlers instead of `print` in libraries.
- Prefer comprehensions and generator expressions over manual loops where readability is preserved.
## Testing
- Use `unittest` (or `pytest` if the project adopts it); mirror the source layout under a `tests/` directory.