home / skills / joncrangle / .dotfiles / code-style
This skill enforces code style and discovery practices in TypeScript projects, guiding pattern search, type discipline, and test-driven verification.
npx playbooks add skill joncrangle/.dotfiles --skill code-styleReview the files below or copy the command above to add this skill to your agents.
---
name: code-style
description: Discovery, typing, and execution standards.
---
<skill_doc>
# Code Style & Discovery
## 🔍 Discovery Phase (Mandatory)
Before writing any code:
1. **Search**: Search for existing patterns using the `search_files` tool.
2. **Read**: Read similar files to match style.
3. **Types**: Find the TypeScript interfaces/types defined in the project.
## 🛡️ Coding Standards
- **Strict TypeScript**: No `any`. Define interfaces.
- **Error Handling**: Use `try/catch` with specific error logging. No silent failures.
- **Comments**: Comment *why*, not *what*.
- **Imports**: Use absolute imports if project configured (check `tsconfig`).
## đź§Ş Verification
- **Test-Driven**: Create/Update tests for every logic change.
- **Lint**: Run linting before reporting success.
## 🛠️ Tooling
- Use `bun tools/hotspots.ts` to find frequently changed files.
- Use `list_files` to explore the directory structure.
</skill_doc>
This skill defines discovery, typing, and execution standards for TypeScript-based dotfiles and install scripts. It enforces strict typing, explicit error handling, and a mandatory discovery phase to match existing project patterns. The goal is predictable, well-typed code that integrates with the repository's tooling and tests.
Before any change, the skill requires searching and reading existing files to discover established patterns and types. It enforces strict TypeScript without any usage of 'any', requires interface definitions, and mandates explicit try/catch error handling with targeted logging. Developers run project-specific tools to find hotspots, lint, and add or update tests for every logic change.
What tools should I run to find frequently changed files?
Run the provided hotspot script (bun tools/hotspots.ts) to list files with high churn, and use list_files to inspect the tree.
Is using 'any' ever acceptable?
No. The standard disallows 'any'. Use concrete interfaces, union types, or type guards to model unknown shapes.