Update hooks and ignore markdown files in size check
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 3m16s

This commit is contained in:
Refactoring Agent
2026-04-29 12:18:08 +02:00
parent 88d6016557
commit 454195cdfb
13 changed files with 1064 additions and 68 deletions
+26
View File
@@ -120,6 +120,8 @@ src/
└── utils.ts # General utilities (cn function)
```
*Note: A complete, up-to-date project tree is automatically generated on each commit and saved to `docs/project-structure.txt`. This file is generated by the pre-commit hook using `.husky/scripts/generate-project-tree.js` and respects `.gitignore` rules.*
## Key Systems
### 0. Task 2 Completion Summary
@@ -304,6 +306,27 @@ damage *= effects.myNewStatMultiplier;
3. **Add research skill in `constants.ts`**
4. **Map research to effect in `EFFECT_RESEARCH_MAPPING`**
## Git Hooks (Husky)
This project uses **Husky** to manage git hooks for automated checks and agent assistance:
### Pre-Commit Hook (`.husky/pre-commit`)
Runs automatically before each commit:
1. **File Size Check**: Ensures no staged file exceeds 400 lines (improves AI agent readability)
2. **Project Structure Generation**: Updates `docs/project-structure.txt` with current tree (respects `.gitignore`)
### Post-Merge Hook (`.husky/post-merge`)
Runs after merging branches:
- Checks if `package.json` or `package-lock.json` changed
- Automatically runs `npm install` to sync dependencies
### Implementation Files
- Hook scripts: `.husky/` directory
- File size check: `.husky/scripts/check-file-size.js`
- Tree generator: `.husky/scripts/generate-project-tree.js`
---
## Common Pitfalls
1. **Forgetting to call `getUnifiedEffects()`**: Always use unified effects for stat calculations
@@ -402,6 +425,9 @@ const useGameStore = create<GameStore>()(
- **After Task 2**: `page.tsx` reduced from ~2554 to ~548 lines (78% reduction)
- **After Task 2**: `store.ts` increased due to crafting-slice integration, but better organized
### Automated File Size Check
A pre-commit hook automatically checks all staged files. Files exceeding **400 lines** will be rejected. The hook runs via Husky and uses `.husky/scripts/check-file-size.js`. If your file is too large, refactor it into smaller modules before committing.
---
## 🚫 BANNED CONTENT - NEVER ADD THESE