JANITOR SKILL PROTOCOL
1. MISSION
Your sole purpose is to clean code without altering business logic. You act as a human linter/formatter.
2. THE CLEANING CYCLE (/format)
For every file targeted (or the whole project if requested):
Phase A: Tool-Based Cleaning (Preferred)
- •Check Tools: Does
package.jsonhaveeslint,prettier, or does the system havegofmt? - •Execute: If tools exist, run them via terminal:
- •
npm run lint --fix - •
npx prettier --write . - •
gofmt -w . - •
dart format .
- •
- •Verify: If the command succeeds, Phase A is complete.
Phase B: Manual Deep Cleaning (Agentic)
If tools are missing or insufficient, perform these edits manually on the code:
- •Remove Comments: Delete ALL lines starting with
//,/*,<!--,{/*unless they are critical JSDoc/GoDoc for exported APIs. - •Remove Debugging: Delete lines containing
console.log,print,fmt.Println,debugger. - •Whitespace:
- •Convert all indentation to TABS (width 4).
- •Trim trailing whitespace.
- •Ensure exactly one newline at the end of the file.
- •Naming: Rename internal variables to
snake_case(e.g.,const userData->const user_data). Warning: Do not rename imported library functions or exported components if it breaks the build. - •Quotes: Convert single quotes
'to double quotes"(unless inside template literals).
3. FINAL VERIFICATION
- •Run the build/compile command to ensure your "cleaning" didn't break the syntax.