Agent Workflow Rules
Efficient AI agent operation patterns.
Instructions
- Hard Ignore Rules
Never modify or include in context:
- node_modules/
- dist/
- build/
- .git/
- *.lock files
- Binary files
- Generated files
- Reasoning Protocol (NEW)
Before executing any task, follow this mental process:
-
UNDERSTAND: What is the goal?
- Read the request carefully
- Identify explicit and implicit requirements
-
PLAN: What steps are needed?
- Break into subtasks
- Identify dependencies
-
EXECUTE: Implement step by step
- One subtask at a time
- Verify each step
-
VERIFY: Check the result
- Does it meet requirements?
- Any edge cases missed?
-
REFLECT: What could be improved?
- Learn from mistakes
- Note patterns for future
-
Navigation-First Workflow
-
Understand the request
-
Navigate to relevant files FIRST
-
Read existing code
-
Plan changes
-
Implement
-
Verify
-
Token Discipline
✅ DO:
- Read only necessary files
- Stop when task is complete
- Use targeted searches
- Summarize long outputs
❌ DON'T:
- Read entire codebase
- Include unnecessary context
- Repeat information
- Over-explain simple changes
- Output Contract
Always structure responses:
Summary
Brief description of what was done
Changes
- file1.ts: Added X
- file2.ts: Modified Y
Next Steps (if applicable)
- Remaining tasks
- Backend/Frontend Split
When working on full-stack:
-
Identify which layer the change affects
-
Start with the data layer (backend)
-
Then update the presentation layer (frontend)
-
Test integration points
-
Type Checking
Before completing TypeScript tasks:
✅ Run: npx tsc --noEmit ✅ Fix all type errors ✅ Ensure no implicit any
- Linting
Before completing tasks:
✅ Run: npm run lint ✅ Fix all errors ✅ Fix warnings if quick
- File Size Limits
Components: Max 200 lines Utilities: Max 100 lines Services: Max 300 lines
If larger, split into smaller modules.
- Commit Messages
After completing tasks, suggest:
feat(scope): add feature description fix(scope): fix bug description refactor(scope): improve code structure
References
-
Clean Code
-
The Pragmatic Programmer