mirror of
https://github.com/IgorWarzocha/Opencode-Workflows.git
synced 2026-09-14 16:22:53 +08:00
9b70decd13
Convert markdown files to use XML-like tags for structure and adopt RFC 2119 keywords. Delete redundant generic agent definitions and update coding guidelines to enforce stricter modularity, file size limits, and barrel exports.
1.4 KiB
1.4 KiB
description
| description |
|---|
| Refactor code (strict modularity, no slop, clean headers) |
If no targets specified, identify files created this session or scan for worst offenders (250+ lines).
Modularise and clean up code according to strict standards.File Structure & Modularity
- MUST break large files into focused, single-purpose modules
- SHOULD use barrel exports (
index.ts) to expose public APIs - MUST start every file with a 2-3 sentence block comment explaining its purpose:
/**
* utils/formatting.ts
* Provides currency and date formatting utilities for the billing dashboard.
* Handles locale detection and fallback states.
*/
Code Hygiene
- MUST remove ALL emojis from comments, strings, and UI text unless strictly necessary
- MUST remove chatty or redundant comments; comment ONLY major sections or complex logic
- SHOULD remove excessive defensive checks if data path is trusted or validated
- MUST NOT use
anycasts; fix the types properly - MUST remove all
console.logstatements
Core Principles
- MUST abstract patterns seen twice (DRY)
- MUST throw errors clearly; MUST NOT hide failures
- SHOULD fail fast with clear error messages
- Analyze files against these rules
- Refactor structure (split files if needed)
- Clean up code (remove slop, add headers, fix types)