| name | post-prompt-finetune |
| description | Run automatically after completing any code changes. Validates TypeScript build, auto-fixes prettier and linting, then manually fixes any remaining issues. |
Post-Prompt Fine-Tune
Runs automatically after editing code.
Purpose
This skill ensures code quality by automatically validating changes after every modification.
When to Use
AUTOMATICALLY after:
- Creating new TypeScript files
- Modifying existing TypeScript files
- Refactoring code
- Adding features
- Fixing bugs
Do NOT run for:
- Reading files only
- Answering questions
- Documentation changes (unless they affect code)
Steps
Workflow
Step 1: Build
npm run build
If build fails:
- Read the TypeScript error messages carefully
- Identify the file and line number
- Understand what the error means
- Fix the actual code issue (don't just add
// @ts-ignore) - Re-run build
- Repeat until build succeeds
Common TypeScript Errors:
- See
references/common-fixes.mdfor solutions
This auto-fixes formatting. No manual action needed.
Step 2: Lint Check
npm run lint
If linting fails:
- Read each ESLint error carefully
- Understand WHY the rule exists (see
references/eslint-rules.md) - Fix the code properly (don't disable rules)
- Run
npm run lint:fixto auto-fix what's possible - Re-run
npm run lint - Repeat until no errors remain
Never:
- Add
// eslint-disablewithout understanding why - Skip fixing errors
- Leave code in failing state
- Use
anytype
Step 3: Auto-Format
npm run prettier:fix
Step 4: Report
Report validation status clearly:
- ✅ What passed
- ❌ What failed and how you fixed it
- 📝 Summary of changes made
Examples
Example 1: Unused Variable
Error: 'user' is assigned a value but never used
Bad Fix:
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const user = getUser();
Good Fix:
// Remove if truly unused
// OR use it if it should be used
const user = getUser();
return user.name;
Example 2: Missing Return Type
Error: Missing return type on function
Fix:
// Before
function getUser() {
return { name: 'John' };
}
// After
function getUser(): { name: string } {
return { name: 'John' };
}
That's it.