📝 docs: enhance context-manager with persistent memory and task management

- Add autonomous knowledge storage with MCP memory tools
- Implement task capture system for user-assigned TODOs
- Enable cross-session persistence of architectural decisions
- Add task status tracking (pending, in-progress, blocked, completed)
- Update CLAUDE.md with context-manager capabilities
- Configure memory MCP server in .mcp.json
- Document seven entity types for knowledge graph
- Add proactive task reminders at session start
This commit is contained in:
Lorenz Hilpert
2025-10-29 10:58:45 +01:00
parent c2c40a44e8
commit 6db5f2afda
3 changed files with 233 additions and 34 deletions

View File

@@ -1,6 +1,6 @@
# CLAUDE.md
> **Last Updated:** 2025-10-22
> **Last Updated:** 2025-10-29
> **Angular Version:** 20.1.2
> **Nx Version:** 21.3.2
> **Node.js:** ≥22.0.0
@@ -8,14 +8,26 @@
## 🔴 CRITICAL: Mandatory Agent Usage
**You MUST use these subagents for ALL research tasks:**
**You MUST use these subagents for ALL research and knowledge management tasks:**
- **`docs-researcher`**: For ALL documentation (packages, libraries, READMEs)
- **`docs-researcher-advanced`**: Auto-escalate when docs-researcher fails
- **`Explore`**: For ALL code pattern searches and multi-file analysis
- **`context-manager`**: For complex projects and knowledge preservation with **persistent memory** (NEW)
- **Direct tools (Read/Bash)**: ONLY for single specific files or commands
**NEW**: The `context-manager` now autonomously stores project knowledge (decisions, patterns, solutions) in persistent memory for cross-session learning.
**Violations of this rule degrade performance and context quality. NO EXCEPTIONS.**
## Communication Guidelines
**Keep answers concise and focused:**
- Provide direct, actionable responses without unnecessary elaboration
- Skip verbose explanations unless specifically requested
- Focus on what the user needs to know, not everything you know
- Use bullet points and structured formatting for clarity
- Only provide detailed explanations when complexity requires it
## Project Overview
This is a sophisticated Angular 20.1.2 monorepo managed by Nx 21.3.2. The main application is `isa-app`, a comprehensive inventory and returns management system for retail/e-commerce operations. The system handles complex workflows including order management (OMS), returns processing (remission), customer relationship management (CRM), product cataloging, and checkout/reward systems.
@@ -320,6 +332,73 @@ isDesktop = breakpoint([Breakpoint.Desktop, Breakpoint.DekstopL, Breakpoint.Deks
- **Module resolution**: Check `tsconfig.base.json` path aliases
- **State issues**: Use Angular DevTools browser extension
### Project Knowledge Management with Context-Manager
**NEW CAPABILITY**: The `context-manager` subagent now has **persistent memory** that autonomously stores and retrieves project knowledge across sessions.
#### Autonomous Knowledge Storage
The context-manager **automatically stores** the following without being explicitly asked:
| Information Type | What Gets Stored |
|------------------|-----------------|
| **Assigned Tasks** (NEW) | User-assigned tasks with context ("Remember to look up X because of Y"), TODO items, investigation requests, status tracking |
| **Architectural Decisions** | State management patterns, API integration approaches, component architecture choices |
| **Reusable Patterns** | Code conventions, testing patterns, error handling approaches |
| **Integration Points** | API contracts, data flows, module boundaries, third-party integrations |
| **Domain Knowledge** | Business workflows (returns, checkout), business rules, user roles/permissions |
| **Technical Solutions** | Bug fixes with root causes, performance optimizations, configuration solutions |
**Task Assignment Examples:**
- "Remember to look up the pricing calculation function because pricing seems off"
- "TODO: investigate why the checkout flow breaks on mobile"
- "Don't forget to check the API response format for the new endpoint"
These get stored with full context, related code locations, and status tracking.
#### How It Works
1. **Task Capture**: Listens for phrases like "Remember to...", "TODO:", "Don't forget...", "Investigate..." and immediately stores them with full context
2. **Automatic Storage**: As the context-manager works, it proactively stores important discoveries in persistent memory using MCP tools
3. **Knowledge Retrieval**: Before starting new work, it queries stored knowledge to provide informed recommendations
4. **Task Reminders**: At session start, proactively reminds you of pending/incomplete tasks from previous sessions
5. **Knowledge Graph**: Entities are linked together (e.g., task → relates_to → decision), building a comprehensive understanding
6. **Status Tracking**: Updates task status automatically (pending → in-progress → completed)
7. **Cross-Session Persistence**: Information persists across Claude Code sessions for true institutional knowledge
#### When to Use Context-Manager
Use the `context-manager` subagent PROACTIVELY for:
- **Task Management**: Assigning tasks for later ("Remember to investigate X because of Y")
- **Session Continuity**: Starting a new session (it will remind you of pending tasks)
- Complex, multi-step projects requiring coordination
- Long-running tasks that span multiple sessions
- When you need to preserve architectural context
- Learning about resolved issues and their solutions
- Understanding domain-specific business logic
- **Task Status Queries**: "What was I working on?" or "What tasks are pending?"
#### Memory Entity Types
The system stores seven entity types:
- `task`: User-assigned tasks, reminders, TODOs with context and status (NEW)
- `decision`: Architectural and design decisions with rationale
- `pattern`: Reusable code patterns and conventions
- `integration`: API contracts and integration points
- `solution`: Resolved issues with root cause and fix
- `convention`: Coding standards and project conventions
- `domain-knowledge`: Business logic and workflow explanations
**Task Status Values**: `pending`, `in-progress`, `blocked`, `completed`, `cancelled`
**Benefits**:
- Eliminates context loss between sessions
- Never forget assigned tasks or TODOs
- Maintains project knowledge
- Accelerates onboarding
- Ensures consistency
- Provides task continuity across sessions
### Library Development Patterns
- **Library Documentation**: Use `docs-researcher` for ALL library READMEs (mandatory for context management)
- **New Library Creation**: Use Nx generators with domain-specific naming (`[domain]-[layer]-[feature]`)