Files
EB_Dashboard/DOCUMENTATION/CLAUDE_CODE_SESSION_INIT.md

236 lines
6.9 KiB
Markdown

# 🤖 Claude Code - Session Initialization Template
**For: Endobest Dashboard Project**
**Purpose: Rapid context restoration for optimal task completion**
**Setup Time: 15 minutes**
---
## 📋 Quick Copy-Paste Instructions
Use this template at the beginning of each Claude Code session. Simply copy the instruction below into your first message to Claude Code:
---
## 🎯 Recommended Session Initialization (Copy-Paste Below)
```
=== CLAUDE CODE CONTEXT RESTORATION ===
Project: Endobest Dashboard (Clinical Research Data Collection System)
Documentation Location: /RC/Dashboard/
Session Date: [TODAY'S DATE]
STEP 1: LOAD ARCHITECTURE CONTEXT (MANDATORY)
Read: DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md
Purpose: Establish complete system understanding in 30 minutes
Covers: System design, 5 execution phases, 9 code blocks, APIs, multithreading
STEP 2: LOAD VISUAL CONTEXT (RECOMMENDED)
Read: DOCUMENTATION_31_FLOWCHART_DIAGRAMS.md
Purpose: Clarify workflow with 10 ASCII diagrams
Time: 15 minutes
Benefit: Quick visual reference for data flows
STEP 3: LOAD TASK-SPECIFIC DOCUMENTATION
Based on your task, read ONE:
- Modifying field extraction? → Read: DOCUMENTATION_11_FIELD_MAPPING.md
- Modifying quality checks? → Read: DOCUMENTATION_12_QUALITY_CHECKS.md
- Modifying Excel export? → Read: DOCUMENTATION_13_EXCEL_EXPORT.md
- General configuration? → Read: DOCUMENTATION_99_CONFIG_GUIDE.md
- Understanding architecture? → Read: DOCUMENTATION_10_ARCHITECTURE.md
STEP 4: LOAD SOURCE CODE (IF NEEDED)
- Primary: eb_dashboard.py (1,021 lines, 9 blocks)
- Secondary: Module based on task (utils, quality_checks, excel_export)
AFTER READING:
✅ I understand the 5 execution phases
✅ I can identify which block/module needs modification
✅ I know the API endpoints and data flows
✅ I'm ready to start the task
THEN: Describe your task and I'll provide specific implementation guidance
```
---
## 📝 Alternative: Short Session Init (5 minutes)
For quick follow-up tasks in same context:
```
=== QUICK CLAUDE CODE CONTEXT REFRESH ===
Project: Endobest Dashboard
Context: Already loaded from previous session
Task: [DESCRIBE YOUR TASK IN 1-2 SENTENCES]
Documentation quick reference:
- Architecture overview: DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md
- Code blocks: DOCUMENTATION_10_ARCHITECTURE.md
- Field extraction: DOCUMENTATION_11_FIELD_MAPPING.md
- Quality validation: DOCUMENTATION_12_QUALITY_CHECKS.md
- Excel export: DOCUMENTATION_13_EXCEL_EXPORT.md
- Configuration: DOCUMENTATION_99_CONFIG_GUIDE.md
Ready for task guidance.
```
---
## 🔄 How to Persist Context in Claude Code
### Option 1: Manual Context in Each Message
Copy the initialization above at the start of each session. Takes 30 seconds.
### Option 2: Create a `.claude/context` File (If Supported)
Some Claude Code environments support context files:
**File location:** `.claude/context.md` (in project root)
**File contents:**
```markdown
# Endobest Dashboard Project Context
## Quick Facts
- **Project:** Clinical research data collection system
- **Language:** Python 3.x
- **Type:** Automated data processing pipeline
- **Main Files:** eb_dashboard.py (1,021 lines)
## Always Load These Files
1. DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md (system overview)
2. DOCUMENTATION_31_FLOWCHART_DIAGRAMS.md (visual clarity)
3. Task-specific DOCUMENTATION_NN per request
## 9 Main Code Blocks
1. Config & Infrastructure loading
2. Decorators & error handling
3. Authentication (IAM APIs)
4. Extended field configuration
5. Data search & extraction
6. Custom functions library
7. Business API calls (RC, GDD)
8. Processing orchestration
9. Main execution loop
## Key Paths
- Config: `config/Endobest_Dashboard_Config.xlsx`
- Output: `endobest_inclusions.json`
- Quality: `eb_dashboard_quality_checks.py`
- Export: `eb_dashboard_excel_export.py`
## Documentation Entry Points by Role
- **Developers**: Start with DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md
- **Admins**: Start with DOCUMENTATION_99_CONFIG_GUIDE.md
- **Users**: Start with DOCUMENTATION_32_QUICK_START.md
```
Save this file and reference it with: `Load context from .claude/context.md`
### Option 3: Instructions in README.md
Add to project README:
```markdown
## Claude Code Integration
For Claude Code sessions, load context with:
1. Read: `DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md` (architecture overview)
2. Read: `DOCUMENTATION_31_FLOWCHART_DIAGRAMS.md` (visual flows)
3. Specify task and read task-specific documentation
See: `CLAUDE_CODE_SESSION_INIT.md` for complete initialization template
```
---
## ⚡ Quick Reference: Documentation Map
| Need | File | Time |
|------|------|------|
| System overview | DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md | 30 min |
| Visual workflows | DOCUMENTATION_31_FLOWCHART_DIAGRAMS.md | 15 min |
| Architecture details | DOCUMENTATION_10_ARCHITECTURE.md | 45 min |
| Field extraction | DOCUMENTATION_11_FIELD_MAPPING.md | 20 min |
| Quality checks | DOCUMENTATION_12_QUALITY_CHECKS.md | 20 min |
| Excel export | DOCUMENTATION_13_EXCEL_EXPORT.md | 25 min |
| Configuration | DOCUMENTATION_99_CONFIG_GUIDE.md | 20 min |
| User guide | DOCUMENTATION_98_USER_GUIDE.md | 10 min |
| Quick start | DOCUMENTATION_32_QUICK_START.md | 5 min |
| Navigation | DOCUMENTATION_35_NAVIGATION_INDEX.md | 5 min |
---
## 🎯 Template for Claude Code Task Requests
When starting a task, structure your request like:
```
CONTEXT: [Describe your understanding of the system]
TASK: [What you want to accomplish]
- Modify field extraction
- Add quality check rule
- Export to new template
- Fix bug in module X
- Understand module Y
CONSTRAINTS:
- No external dependencies
- Config-driven (no hardcoded values)
- Maintain error handling
- Update logs
DOCUMENTATION LOADED:
- ✅ DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md
- ✅ DOCUMENTATION_31_FLOWCHART_DIAGRAMS.md
- ✅ [Task-specific doc]
READY: Provide implementation guidance
```
---
## 📊 Benefits of This Approach
| Benefit | Impact |
|---------|--------|
| **Structured context** | Reduces token usage, faster responses |
| **Persistent reference** | Don't repeat context in every message |
| **Task-focused** | Load only what's needed |
| **Time-efficient** | 15 min setup = 50% faster task completion |
| **Consistency** | Same understanding across sessions |
---
## 🚀 Implementation Checklist
- [ ] Save this file: `CLAUDE_CODE_SESSION_INIT.md`
- [ ] Copy the "Recommended Session Initialization" text
- [ ] Paste at start of next Claude Code session
- [ ] Verify: "I understand the 5 execution phases"
- [ ] Describe task and receive implementation guidance
- [ ] Success! ✅
---
## 📞 Support
- **Questions about architecture?** → Read DOCUMENTATION_30_ARCHITECTURE_SUMMARY.md
- **Lost in code?** → Check DOCUMENTATION_35_NAVIGATION_INDEX.md
- **Need overview?** → See DOCUMENTATION_01_START_HERE.md
---
**Status:** ✅ Ready to use
**Created:** 2025-11-08
**Version:** 1.0
*Customize this template as needed for your workflow!*