From geas
Memory lifecycle management — candidate extraction, promotion pipeline, review, application logging, index maintenance, decay and harmful reuse detection.
npx claudepluginhub choam2426/geasThis skill uses the workspace's default tool permissions.
Manages the full memory lifecycle. Orchestrator invokes this skill after retrospective (per-task extraction) and during Evolving (batch promotion).
Audits, classifies, and selectively prunes Claude Code agent memories by type, age, access frequency, staleness, and fidelity using decision trees and audit trails. Use when memory grows large, project state shifts, or retrieval degrades.
Persists learnings into a 5-layer memory hierarchy (CLAUDE.md files, memory/MEMORY.md) and consolidates by pruning outdated entries and promoting recurring patterns. Triggers on 'extract learnings', 'remember', 'dream'.
Manages project memories—constraints, decisions, conventions—in SQLite DB with conflict detection, resolution, full-text search, and usage tracking for task relevance.
Share bugs, ideas, or general feedback.
Manages the full memory lifecycle. Orchestrator invokes this skill after retrospective (per-task extraction) and during Evolving (batch promotion).
memory_candidates[].geas/memory/
├── candidates/ # memory-candidate.json files (state = candidate)
│ └── {memory-id}.json
├── entries/ # promoted memory-entry.json files (provisional/stable/canonical)
│ └── {memory-id}.json
└── logs/ # memory-application-log.json files
└── {task-id}-{memory-id}.json
Central index: .geas/state/memory-index.json
Input: .geas/missions/{mission_id}/tasks/{task-id}/retrospective.json → memory_candidates[]
For each candidate string in memory_candidates[]:
memory_id: mem-{task-id}-{N} (N = sequential within task)memory_type based on content:
failure_lessonarchitecture_precedent or decision_precedentsecurity_patternperformance_tiptest_strategyintegration_patternux_patternprocess_improvementrisk_patternproject_ruleagent_rulescope:
taskmissionprojectagentglobal.geas/memory/candidates/{memory-id}.json conforming to schemas/memory-candidate.schema.json:
{
"meta": {
"version": "1.0",
"artifact_type": "memory_candidate",
"artifact_id": "{memory-id}",
"producer_type": "orchestration_authority",
"created_at": "<ISO 8601>"
},
"memory_id": "{memory-id}",
"memory_type": "<determined type>",
"state": "candidate",
"title": "<short title from candidate string>",
"summary": "<the candidate string from retrospective>",
"scope": "<determined scope>",
"evidence_refs": ["retro-{task-id}"],
"signals": {
"evidence_count": 1,
"reuse_count": 0,
"successful_reuses": 0,
"failed_reuses": 0,
"contradiction_count": 0,
"confidence": 0.4
},
"candidate_reason": "Extracted from task {task-id} retrospective",
"source_artifacts": [".geas/missions/{mission_id}/tasks/{task-id}/retrospective.json"]
}
.geas/state/memory-index.jsonAutomatic extraction triggers (check during retrospective review, per protocol/08):
failure_class in failure-record.json repeats 2+ times → auto-extract failure_lesson, confidence 0.6category in specialist-review.json across 2+ tasks → auto-extract, confidence 0.6recovery_class recovery incident repeats 2+ times → auto-extract risk_pattern, confidence 0.4confidence <= 2 in worker-self-check.json repeats 2+ times for the same task_kind → auto-extract risk_pattern, confidence 0.4Before creating a new candidate:
.geas/state/memory-index.jsonevidence_refsevidence_count in signalsSimilarity check: entries with the same memory_type and overlapping keywords in title/summary are considered similar.
For each new candidate, determine the domain authority reviewer:
| memory_type | reviewer_type |
|---|---|
| security_pattern | risk_specialist |
| architecture_precedent | design_authority |
| test_strategy | quality_specialist |
| performance_tip | design_authority |
| integration_pattern | design_authority |
| ux_pattern | communication_specialist |
| process_improvement | orchestration_authority |
| failure_lesson | orchestration_authority |
| decision_precedent | product_authority |
| risk_pattern | orchestration_authority |
| project_rule | orchestration_authority |
| agent_rule | orchestration_authority |
Mission (batch): Domain authority reviews during Evolving phase. Spawn the reviewer agent:
Agent(agent: "{reviewer}", prompt: "Review memory candidate at .geas/memory/candidates/{memory-id}.json. Decide: promote_provisional (ready to try applying), keep (needs more evidence), or reject (not useful). Write review to .geas/memory/candidates/{memory-id}-review.json with fields: version, artifact_type (memory_review), artifact_id, producer_type, memory_id, decision (promote_provisional/keep/reject), rationale, created_at.")
Lightweight (inline): If candidate has evidence_refs >= 2 or comes from a repeated pattern, auto-promote to provisional. Otherwise keep as candidate for future review.
| From | To | Conditions |
|---|---|---|
| candidate | provisional | 2+ evidence_refs OR 2+ similar incidents OR domain authority approval |
| provisional | stable | 3+ successful_reuses + 0 contradictions + domain authority review |
| stable | canonical | 5+ successful_reuses (3+ different tasks) + joint approval (orchestration_authority + domain authority) |
| any active | under_review | failed_reuses >= 2 OR confidence < 0.3 OR manual request |
| under_review | reinstated/superseded/archived/rejected | Review decision |
| any | decayed | review_after passed + 0 reuses in period, OR contradiction_count >= 3, OR confidence < 0.3 |
candidates/ to entries/, update statereview_after to 30 days from now (provisional), 90 days (stable), 180 days (canonical).geas/state/memory-index.json{"event": "memory_promoted", "memory_id": "...", "from_state": "...", "to_state": "...", "timestamp": "<actual>"}Collected by orchestrator after task completion (at retrospective time):
applicable_memory_id in the packet:
a. Read the task outcome (passed/failed/iterate) and gate result
b. Determine effect:
positivenegativeneutralnegative + set followup_action to weaken
c. Determine usage_surface from context: task_packet, review_context, gate_context, etc.
d. Write .geas/memory/logs/{task-id}-{memory-id}.json conforming to schemas/memory-application-log.schema.json:{
"meta": {
"version": "1.0",
"artifact_type": "memory_application_log",
"artifact_id": "mal-{task-id}-{memory-id}",
"producer_type": "orchestration_authority",
"created_at": "<ISO 8601>"
},
"memory_id": "{memory-id}",
"task_id": "{task-id}",
"applied_by_type": "<agent type that received the packet>",
"usage_surface": "task_packet",
"effect": "positive | negative | neutral",
"notes": "<brief explanation>",
"followup_action": "none | strengthen | weaken | supersede | review_required"
}
positive → successful_reuses += 1, reuse_count += 1, confidence += 0.1 (cap at 1.0)negative → failed_reuses += 1, reuse_count += 1, confidence -= 0.1 (floor at 0.0)neutral → reuse_count += 1 (no confidence change)contradiction_count += 1, confidence -= 0.2Run during Evolving phase or at session start:
.geas/state/memory-index.jsonprovisional, stable, or canonical:
review_after has passed AND no application logs exist since review_after → transition to decayedcontradiction_count >= 3 → transition to decayedconfidence < 0.3 → transition to decayed{"event": "memory_decayed", "memory_id": "...", "reason": "...", "timestamp": "<actual>"}When failed_reuses >= 2 for any memory entry:
under_reviewsuperseded_by on old entrymemory-review.json with the decision| Evidence refs | Initial confidence |
|---|---|
| 1 | 0.4 |
| 2 | 0.6 |
| 3+ | 0.8 |
Adjustments per application: positive +0.1, negative -0.1, contradiction -0.2. Clamped to [0.0, 1.0].
Valid types (from _defs.schema.json): project_rule, agent_rule, decision_precedent, failure_lesson, security_pattern, performance_tip, test_strategy, integration_pattern, ux_pattern, architecture_precedent, process_improvement, risk_pattern
Valid states (from _defs.schema.json): candidate, provisional, stable, canonical, under_review, decayed, superseded, archived, rejected
When multiple memories conflict (from doc 07): rules.md > project_memory > agent_memory > risk_memory