| title | Performance Optimization — Module User | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| type | documentation | ||||||||
| created | 2026-05-11 | ||||||||
| updated | 2026-05-11 | ||||||||
| tags |
|
||||||||
| related |
|
Prima: Bootstrap caricava tutte le rules (50K+ token) Dopo: Carico solo what's needed (~2K startup)
```diff
- 150+ rules embeddate in AGENTS.md
- 0 rules embeddate — tutte on-demand ```
```diff
- .cache/ (8KB nel repo)
- ~/.cache/qmd-cache/ (fuori da git) ```
Risultato:
- Clone più veloce (nessuna cache da scaricare)
- Git history pulito
- Nessun rischio di commit cache
```diff
- bashscripts/ai/.agents/node_modules/ (58MB)
- laravel/node_modules/ (singola installazione) ```
Ogni modulo ha i propri rules/skills/commands/memories/INDEX.md:
- Ricerca più rapida (scope limitato)
- Context rilevante per il modulo
- Non mischia contenuti eterogenei
| Metric | Before | After |
|---|---|---|
| Token startup | ~50,000 | ~2,000 |
| Context usage | 90% | 60-70% |
| Ricerca regole | 500ms (grep) | 30ms (qmd) |
| Repo size | +58MB | -58MB |
| Cache in git | 8KB tracked | 0KB |
```python
Read all_rules = Read docs/wiki/rules/*.md # TOO MANY TOKENS
trigger = detect_task_trigger() if trigger in trigger_map: Read specific_rule = Read docs/wiki/rules/$trigger.md ```
```bash
qmd search "form"
qmd search "filament form schema conventions" ```
```bash
qmd search "validation" -c user
qmd search "global validation rules" ```
- Auto-index rebuild — Dopo 500 file changes,
qmd index rebuild - Hooks pre-task — Auto-memory sync
- Context-mode batch — Convertire script in batch exec
- Permissions allowlist — .claude/settings.json
Controlla performance attuali:
```bash
du -sh ~/.cache/qmd-cache/
context-mode ctx-stats ```
Status: Ottimizzato | Token risparmiati: ~48K per session