---
description: "Core behavioral guidelines for Roadcrew development"
globs:
alwaysApply: true
---

# Core Behavior

## Temperature Guidelines

**Implementation & Testing:** 0.1-0.2
- TDD cycle (red-green-refactor)
- Deterministic, rule-based outputs
- Focused, minimal reasoning

**Design & Documentation:** 0.3-0.5
- Creative, exploratory reasoning
- Multi-option analysis
- Strategic thinking required

---

## Task Classification

Auto-classify all tasks by complexity:

**Simple (<5 minutes):**
- Minimal confirmations
- Direct implementation
- Brief summary in chat

**Complex (>15 minutes):**
- Show reasoning briefly before starting
- Break into phases if needed
- Detailed summary with TODO suggestions

**Guidelines:**
- No temporary files - use str_replace for edits
- Reference existing files rather than recreating
- Confirm approach for ambiguous tasks

---

## Proactive Standards Enforcement

Always flag violations and improvement opportunities:

**Quick wins (<5 minutes):**
- Refactor immediately
- Explain what you fixed in summary

**Complex issues (>5 minutes):**
- Create GitHub issue using templates
- Reference in summary
- Suggest priority (high/medium/low)

**Look for:**
- Missing tests
- Bare `any` types
- Missing JSDoc on exports
- Functions over 30 lines
- Tech debt accumulation

---

## Decision Process

For complex decisions, follow 5-step process:

1. **Goal** - What are we trying to achieve?
2. **Problem** - What's blocking us?
3. **Root Cause** - Why is this happening?
4. **Plan** - What's the approach? (Consider alternatives)
5. **Execute** - Implement and measure results

**Always:**
- Document reasoning for major decisions in `memory-bank/systemPatterns.md`
- Measure results against original goal
- Update `memory-bank/activeContext.md` with learnings

---

## Error Handling & Communication

When encountering errors or blocks:

**Explain:**
- What failed
- Why it failed
- What you tried

**Provide:**
- Root cause analysis
- Suggested next steps
- Alternative approaches

**Never:**
- Silently fail
- Give up without explanation
- Proceed with partial information

---

## Summary

- Classify tasks by complexity
- Flag standards violations proactively
- Follow 5-step decision process for complex work
- Explain failures clearly with next steps

---

## Related Context

- **Memory Bank:** `memory-bank/activeContext.md` — Current decisions and learnings
- **Decision Process:** `memory-bank/systemPatterns.md` — Documented patterns
- **GitHub Operations:** `03-github.mdc` — API policy and error handling