diff --git a/.claude/agents/frontend.md b/.claude/agents/frontend.md index 3817964..6bcc1aa 100644 --- a/.claude/agents/frontend.md +++ b/.claude/agents/frontend.md @@ -3,6 +3,8 @@ ## Role You are the frontend specialist for the CVE Dashboard project. You build and maintain the React UI, handle client-side state, manage API communication, and implement user-facing features. +**IMPORTANT:** When creating new UI components or implementing frontend features, you should use the `frontend-design` skill to ensure production-grade, distinctive design quality. Invoke this skill using the Skill tool with `skill: "frontend-design"`. + ## Project Context ### Tech Stack diff --git a/.claude/instructions.md b/.claude/instructions.md new file mode 100644 index 0000000..0124a89 --- /dev/null +++ b/.claude/instructions.md @@ -0,0 +1,25 @@ +# Project Instructions + +## Token Usage & Efficiency +Follow the guidelines in `.claude/optimization.md` for: +- When to use subagents vs main conversation +- Model selection (Haiku vs Sonnet) +- Token preservation strategies +- Rate limiting rules + +## Project Context +This is a CVE (Common Vulnerabilities and Exposures) dashboard application for tracking security vulnerabilities, vendors, and JIRA tickets. + +## Security Focus +All code changes should consider: +- Input validation +- SQL injection prevention +- XSS protection +- Authentication/authorization + +## Frontend Development +When working on frontend features or UI components: +- Use the `frontend-design` skill for new component creation and UI implementation +- This skill provides production-grade design quality and avoids generic AI aesthetics +- Invoke it using: `Skill` tool with `skill: "frontend-design"` +- The skill will guide implementation with distinctive, polished code patterns diff --git a/.claude/optimization.md b/.claude/optimization.md new file mode 100644 index 0000000..f0f5273 --- /dev/null +++ b/.claude/optimization.md @@ -0,0 +1,143 @@ +OPTIMIZATION.md - Token Usage & Subagent Strategy + +## SUBAGENT USAGE STRATEGY + +Subagents run in separate contexts and preserve main conversation tokens. + +### When to Use Subagents + +**Use Subagents for:** +- Large-scale codebase exploration and analysis +- Complex multi-step investigations across many files +- Detailed code pattern searches and refactoring analysis +- Gathering comprehensive information before main conversation work +- When total tokens would exceed 30,000 in main conversation + +**Keep in Main Conversation:** +- Direct file edits (1-3 files) +- Simple code changes and debugging +- Architecture decisions +- Security reviews and approvals +- User-facing responses and recommendations +- Questions requiring reasoning about codebase +- Frontend UI work (use `frontend-design` skill for new components) + +### Subagent Types & When to Use + +**Explore Agent** (Haiku 3.5) +- Codebase exploration and file discovery +- Pattern searching across large codebases +- Gathering information about file structure +- Finding references and relationships + +**General-Purpose Agent** (Haiku 3.5) +- Multi-step code analysis tasks +- Summarizing findings from exploration +- Complex searches requiring multiple strategies +- Collecting data for main conversation decisions + +--- + +## MODEL SELECTION STRATEGY + +### Main Conversation (Sonnet 4.5) +- **Always use Sonnet 4.5 in main conversation** +- Direct file edits and modifications +- Architecture and design decisions +- Security analysis and approvals +- Complex reasoning and recommendations +- Final user responses + +### Subagent Models + +**Haiku 4.5** (Default for subagents) +- Code exploration and pattern searching +- File discovery and structure analysis +- Simple codebase investigations +- Gathering information and summarizing +- Task: Use Haiku first for subagent work + +**Sonnet 4.5** (For subagents - when needed) +- Security-critical analysis within subagents +- Complex architectural decisions needed in exploration +- High-risk code analysis +- When exploration requires advanced reasoning + +--- + +## RATE LIMITING GUIDANCE + +### API Call Throttling +- 5 seconds minimum between API calls +- 10 seconds minimum between web searches +- Batch similar work whenever possible +- If you hit 429 error: STOP and wait 5 minutes + +### Budget Management +- Track tokens used across all agents +- Main conversation should stay under 100,000 tokens +- Subagent work can extend to 50,000 tokens per agent +- Batch multiple subagent tasks together when possible + +--- + +## TOKEN PRESERVATION RULES + +### Best Practices for Long-Running Conversations + +**In Main Conversation:** +1. Start with subagent for exploration (saves ~20,000 tokens) +2. Request subagent summarize findings +3. Use summary to inform main conversation edits/decisions +4. Keep main conversation focused on decisions and actions + +**Information Gathering:** +- Use subagents to explore before asking for analysis in main conversation +- Have subagent provide condensed summaries (250-500 words max) +- Main conversation uses summary + provides feedback/decisions + +**File Editing:** +- For <3 files: Keep in main conversation +- For 3+ files: Split between subagent (finding/analysis) and main (approval/execution) +- Simple edits (1-5 lines per file): Main conversation +- Complex refactoring (10+ lines per file): Subagent analysis + main approval + +**Code Review Workflow:** +1. Subagent explores and analyzes code patterns +2. Subagent flags issues and suggests improvements +3. Main conversation reviews suggestions +4. Main conversation executes approved changes + +### Token Budget Allocation Example +- Main conversation: 0-100,000 tokens (soft limit) +- Per subagent task: 0-50,000 tokens +- Critical work (security): Use Sonnet in main conversation +- Exploratory work: Use Explore agent (Haiku) in subagent + +--- + +## DECISION TREE + +``` +Is this a direct file edit request? +├─ YES (1-3 files, <10 lines each) → Main conversation +├─ NO +└─ Is this exploratory analysis? + ├─ YES (finding files, patterns) → Use Explore agent (Haiku) + ├─ NO + └─ Is this complex multi-step work? + ├─ YES (3+ steps, many files) → Use General agent (Haiku) + ├─ NO + └─ Is this security-critical? + ├─ YES → Main conversation (Sonnet) + └─ NO → Subagent (Haiku) or Main conversation +``` + +--- + +## SUMMARY + +**Main Conversation (You):** Architecture, decisions, edits, reviews +**Subagents:** Exploration, analysis, information gathering +**Sonnet 4.5:** Security, complexity, final decisions +**Haiku 4.5:** Exploration, gathering, analysis support \ No newline at end of file diff --git a/frontend/public/index.html b/frontend/public/index.html index 0640fca..7141c16 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -25,9 +25,67 @@ Learn how to configure a non-root public URL by running `npm run build`. -->