From 0317ffe0f204b8a889a82b0a7fb6506e8d9fa6ab Mon Sep 17 00:00:00 2001 From: "Mikhail [azalio] Petrov" Date: Sun, 8 Feb 2026 22:35:05 +0300 Subject: [PATCH] Remove all Cipher MCP integration from codebase Cipher was deprecated in v4.0 in favor of mem0 MCP. This commit completes the removal by eliminating all remaining references. Changes: - Remove cipher from MCP server configs, mappings, and selections - Remove cipher from all 7 agent templates (replaced with mem0 where needed) - Remove cipher from command templates (map-debug, map-fast, map-release) - Remove cipher from source code (__init__.py MCP server logic) - Delete docs/cipher-setup-guide/ directory and QUICKSTART-CIPHER.md - Delete cipher-integration.md from skills resources - Remove cipher from presentations (EN + RU) - Remove cipher from plugin configs and marketplace - Clean cipher from CHANGELOG, tests, lint scripts, .gitignore - Sync all templates to src/mapify_cli/templates/ - Update test assertions for cipher-free fallback generators All 697 tests pass. --- .claude-plugin/PLUGIN.md | 5 +- .claude-plugin/marketplace.json | 1 - .claude-plugin/plugin.json | 1 - .claude/agents/actor.md | 2 +- .claude/agents/curator.md | 2 +- .claude/agents/documentation-reviewer.md | 4 +- .claude/agents/monitor.md | 6 +- .claude/agents/predictor.md | 28 +- .claude/agents/reflector.md | 4 +- .claude/agents/task-decomposer.md | 3 - .claude/commands/map-debug.md | 18 +- .claude/commands/map-fast.md | 2 +- .claude/commands/map-release.md | 10 - .claude/playbook_delta_operations.json | 50 +-- .claude/skills/README.md | 2 - .claude/skills/map-workflows-guide/SKILL.md | 3 - .../resources/agent-architecture.md | 1 - .../resources/cipher-integration.md | 291 ------------- .../resources/map-efficient-deep-dive.md | 2 +- .../resources/map-fast-deep-dive.md | 4 +- .../resources/map-feature-deep-dive.md | 3 +- .../resources/playbook-system.md | 7 +- .gitignore | 8 - .mcp.json.example | 17 - CHANGELOG.md | 25 +- docs/ARCHITECTURE.md | 6 +- docs/CLI_COMMAND_REFERENCE.md | 2 +- docs/CLI_REFERENCE.json | 26 +- docs/INSTALL.md | 8 +- docs/QUICKSTART-CIPHER.md | 319 -------------- docs/USAGE.md | 6 +- .../01-infrastructure-setup.md | 129 ------ .../02-cipher-installation.md | 22 - .../03-cipher-configuration.md | 101 ----- .../04-claude-code-setup.md | 56 --- docs/cipher-setup-guide/05-verification.md | 75 ---- docs/cipher-setup-guide/06-troubleshooting.md | 389 ------------------ docs/cipher-setup-guide/README.md | 51 --- presentation/en/01-introduction.md | 3 +- presentation/en/02-architecture.md | 22 +- presentation/en/03-workflow.md | 40 +- presentation/en/04-getting-started.md | 4 +- ...20\264\320\265\320\275\320\270\320\265.md" | 3 +- ...20\272\321\202\321\203\321\200\320\260.md" | 18 +- presentation/ru/03-workflow.md | 43 +- ...20\260\320\261\320\276\321\202\321\213.md" | 4 +- scripts/lint-agent-templates.py | 1 - src/mapify_cli/__init__.py | 93 +---- src/mapify_cli/templates/agents/actor.md | 2 +- src/mapify_cli/templates/agents/curator.md | 2 +- .../agents/documentation-reviewer.md | 4 +- src/mapify_cli/templates/agents/monitor.md | 6 +- src/mapify_cli/templates/agents/predictor.md | 28 +- src/mapify_cli/templates/agents/reflector.md | 4 +- .../templates/agents/task-decomposer.md | 3 - .../templates/commands/map-debug.md | 18 +- src/mapify_cli/templates/commands/map-fast.md | 2 +- .../templates/commands/map-release.md | 10 - src/mapify_cli/templates/skills/README.md | 2 - .../skills/map-workflows-guide/SKILL.md | 3 - .../resources/agent-architecture.md | 1 - .../resources/cipher-integration.md | 291 ------------- .../resources/map-efficient-deep-dive.md | 2 +- .../resources/map-fast-deep-dive.md | 4 +- .../resources/map-feature-deep-dive.md | 3 +- .../resources/playbook-system.md | 7 +- tests/test_mapify_cli.py | 36 +- 67 files changed, 187 insertions(+), 2161 deletions(-) delete mode 100644 .claude/skills/map-workflows-guide/resources/cipher-integration.md delete mode 100644 docs/QUICKSTART-CIPHER.md delete mode 100644 docs/cipher-setup-guide/01-infrastructure-setup.md delete mode 100644 docs/cipher-setup-guide/02-cipher-installation.md delete mode 100644 docs/cipher-setup-guide/03-cipher-configuration.md delete mode 100644 docs/cipher-setup-guide/04-claude-code-setup.md delete mode 100644 docs/cipher-setup-guide/05-verification.md delete mode 100644 docs/cipher-setup-guide/06-troubleshooting.md delete mode 100644 docs/cipher-setup-guide/README.md delete mode 100644 src/mapify_cli/templates/skills/map-workflows-guide/resources/cipher-integration.md diff --git a/.claude-plugin/PLUGIN.md b/.claude-plugin/PLUGIN.md index dcda279..90e3a51 100644 --- a/.claude-plugin/PLUGIN.md +++ b/.claude-plugin/PLUGIN.md @@ -28,7 +28,7 @@ MAP (Modular Agentic Planner) is a cognitive architecture that orchestrates 9 sp **5 Automated Hooks:** - `validate-agent-templates` — prevents accidental removal of template variables -- `auto-store-knowledge` — automatically saves successful patterns to cipher +- `auto-store-knowledge` — automatically saves successful patterns - `enrich-context` — enriches prompts with relevant knowledge - `session-init` — loads ACE playbook at session start - `track-metrics` — tracks agent performance @@ -41,7 +41,7 @@ MAP (Modular Agentic Planner) is a cognitive architecture that orchestrates 9 sp ### ACE Learning System -- **Persistent Knowledge** — solutions saved and reused via cipher MCP +- **Persistent Knowledge** — solutions saved and reused via mem0 MCP - **Semantic Search** — find patterns by meaning (optional) - **Quality Tracking** — monitor pattern effectiveness - **Continuous Learning** — each workflow improves future ones @@ -87,7 +87,6 @@ cp map-framework/.claude/settings.hooks.json your-project/.claude/ - **Claude Code CLI** — installed and configured - **MCP Servers** (essential): - - `cipher` — knowledge management - `claude-reviewer` — professional code review - `sequential-thinking` — chain-of-thought reasoning diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 7f33c78..fb557f0 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -42,7 +42,6 @@ "requirements": { "claude_code": ">=1.0.0", "mcp_servers": [ - "cipher", "claude-reviewer", "sequential-thinking" ] diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index e06204c..f0863de 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -25,7 +25,6 @@ "requirements": { "claude_code_version": ">=1.0.0", "mcp_servers": [ - "cipher", "claude-reviewer", "sequential-thinking" ], diff --git a/.claude/agents/actor.md b/.claude/agents/actor.md index 98b955d..01cfaf1 100644 --- a/.claude/agents/actor.md +++ b/.claude/agents/actor.md @@ -1055,7 +1055,7 @@ export class ReconnectingWebSocket { 3. test_reconnect_max_attempts_triggers_callback 4. test_reconnect_handles_immediate_disconnect -**Used Bullets**: `[]` (No similar patterns in cipher. Novel implementation.) +**Used Bullets**: `[]` (No similar patterns in mem0. Novel implementation.) diff --git a/.claude/agents/curator.md b/.claude/agents/curator.md index da95f68..5fd4e57 100644 --- a/.claude/agents/curator.md +++ b/.claude/agents/curator.md @@ -125,7 +125,7 @@ run_id: "org:shared" - **Counter**: Increment helpful_count once (not per insight) ### Contradictory Insights (Opposite Recommendations) -- **Action**: Check cipher for existing consensus (helpful_count scores) +- **Action**: Check mem0 for existing consensus (helpful_count scores) - **Validate**: Use deepwiki to verify production patterns - **Output**: Create bullet with BOTH approaches + tradeoffs - **Flag**: Mark `metadata.manual_review_required = true` diff --git a/.claude/agents/documentation-reviewer.md b/.claude/agents/documentation-reviewer.md index 6dea019..ea32d0f 100644 --- a/.claude/agents/documentation-reviewer.md +++ b/.claude/agents/documentation-reviewer.md @@ -123,7 +123,7 @@ IF mcp__mem0__* available: → Use for historical pattern matching ELSE: → Skip pattern matching, rely on explicit checks only - → Log: "cipher unavailable, no historical context" + → Log: "mem0 unavailable, no historical context" ``` ## Fallback Protocol @@ -441,7 +441,7 @@ mcp__deepwiki__ask_question( question="How does Gatekeeper handle CRD installation?" ) -# 4. Check historical patterns (if cipher available) +# 4. Check historical patterns (if mem0 available) mcp__mem0__map_tiered_search( query="CRD installation documentation patterns", top_k=5, diff --git a/.claude/agents/monitor.md b/.claude/agents/monitor.md index 6082665..7bb6cbd 100644 --- a/.claude/agents/monitor.md +++ b/.claude/agents/monitor.md @@ -935,7 +935,7 @@ def divide(a, b): 2. Verify parameterized queries (no string interpolation) 3. Check command execution (no shell=True with user input) 4. Validate file paths (no path traversal) -5. Search cipher for known vulnerabilities: `"security vulnerability [language]"` +5. Search mem0 for known vulnerabilities: `"security vulnerability [language]"` 6. Use deepwiki to check production security patterns #### Pass Criteria @@ -2236,7 +2236,7 @@ IF false positive rate >15%: IF bug catch rate <70%: → Expand dimension checklists → Add more MCP tool triggers - → Review missed patterns, add to cipher + → Review missed patterns, add to mem0 IF review time consistently >target: → Optimize tool selection @@ -2470,7 +2470,7 @@ def check_rate_limit(user_id, action, limit=100, window=3600): **Before returning your review JSON:** 1. ✅ Did I use request_review for code implementations? -2. ✅ Did I search cipher for known issue patterns? +2. ✅ Did I search mem0 for known issue patterns? 3. ✅ Did I check all 10 validation dimensions systematically? 4. ✅ Did I verify documentation against source of truth (if applicable)? 5. ✅ Are all issues specific with location and actionable suggestions? diff --git a/.claude/agents/predictor.md b/.claude/agents/predictor.md index c0f6f0c..076c078 100644 --- a/.claude/agents/predictor.md +++ b/.claude/agents/predictor.md @@ -1710,8 +1710,8 @@ Return **ONLY** valid JSON in this exact structure: "score": 0.85, "tier_base": 0.50, "adjustments": [ - {"category": "A", "factor": "Cipher comprehensive data", "adjustment": 0.20}, - {"category": "B", "factor": "Codex+grep match", "adjustment": 0.15} + {"category": "A", "factor": "mem0 comprehensive data", "adjustment": 0.20}, + {"category": "B", "factor": "mem0+grep match", "adjustment": 0.15} ], "flags": ["MANUAL REVIEW REQUIRED"] }, @@ -1811,17 +1811,17 @@ Confidence is NOT a guess—calculate it using this formula with **tier-specific **Category A: Historical Data** (pick highest applicable) ``` -+0.20: Cipher returned comprehensive patterns for this change type -+0.10: Cipher returned partial/similar patterns ++0.20: mem0 returned comprehensive patterns for this change type ++0.10: mem0 returned partial/similar patterns +0.00: No query made (default for Tier 1) --0.15: Cipher queried but no relevant data found +-0.15: mem0 queried but no relevant data found ``` **Category B: Tool Agreement** (pick one) ``` -+0.15: Codex + grep results match (same usages found) ++0.15: mem0 + grep results match (same usages found) +0.05: Only one tool used, results clear --0.10: Codex and grep conflict (investigate before proceeding) +-0.10: mem0 and grep conflict (investigate before proceeding) ``` **Category C: Code Analyzability** (pick lowest applicable) @@ -1879,7 +1879,7 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) | Factor | Category | Adjustment | Running Total | |--------|----------|------------|---------------| | Tier 2 base score | — | 0.50 | 0.50 | -| Cipher has similar patterns | A | +0.20 | 0.70 | +| mem0 has similar patterns | A | +0.20 | 0.70 | | Codex + grep match | B | +0.15 | 0.85 | | Static code (no flags) | C | +0.00 | 0.85 | | High test coverage | D | +0.10 | 0.95 | @@ -1890,7 +1890,7 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) | Factor | Category | Adjustment | Running Total | |--------|----------|------------|---------------| | Tier 3 base score | — | 0.50 | 0.50 | -| Cipher queried, no data | A | -0.15 | 0.35 | +| mem0 queried, no data | A | -0.15 | 0.35 | | Only grep used | B | +0.05 | 0.40 | | Reflection detected | C | -0.20 | 0.20 | | External API undocumented | D | -0.10 | 0.10 | @@ -1921,9 +1921,9 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) 4. Be MORE conservative with risk assessment (err on higher risk) ``` -### If cipher and grep results conflict: +### If mem0 and grep results conflict: ``` -Example: cipher graph finds 10 usages, grep finds 15 +Example: mem0 finds 10 usages, grep finds 15 1. Trust manual verification (grep) over semantic tools 2. Investigate discrepancy: @@ -1931,7 +1931,7 @@ Example: cipher graph finds 10 usages, grep finds 15 - Check for generated code - Check for string-based references 3. Report BOTH numbers in output: - "affected_components": ["15 files (cipher: 10, grep: 15 - discrepancy noted)"] + "affected_components": ["15 files (mem0: 10, grep: 15 - discrepancy noted)"] 4. Set confidence to max 0.60 (moderate uncertainty) ``` @@ -1976,7 +1976,7 @@ IF confidence < 0.30 after all adjustments: ### Catastrophic Tool Failure Protocol (All Tools Fail) -**CRITICAL**: If ALL tools fail (cipher AND grep all error/timeout): +**CRITICAL**: If ALL tools fail (mem0 AND grep all error/timeout): ``` 1. DO NOT hallucinate results @@ -1988,7 +1988,7 @@ IF confidence < 0.30 after all adjustments: "tier_rationale": "All analysis tools failed - minimal analysis only", "tools_used": [], "tool_failures": { - "cipher": "timeout/error/unavailable", + "mem0": "timeout/error/unavailable", "grep": "timeout/error/unavailable" }, "catastrophic_failure": true diff --git a/.claude/agents/reflector.md b/.claude/agents/reflector.md index 5124215..db93dc6 100644 --- a/.claude/agents/reflector.md +++ b/.claude/agents/reflector.md @@ -537,7 +537,7 @@ Skip if: trivial fix, no technical knowledge, no clear entities. - **correct_approach** (REQUIRED, ≥150 chars, 5+ lines): Incorrect + correct code, why works, principle, {{language}} syntax - **key_insight** (REQUIRED, ≥50 chars): "When X, always Y because Z", actionable, memorable - **bullet_updates** (OPTIONAL): Only if Actor used bullets, tag helpful/harmful with reason -- **suggested_new_bullets** (OPTIONAL): Only if new (check cipher), meet quality framework, code_example for SECURITY/IMPL/PERF +- **suggested_new_bullets** (OPTIONAL): Only if new (check mem0), meet quality framework, code_example for SECURITY/IMPL/PERF ## JSON Schema (For Validation) @@ -608,7 +608,7 @@ Skip if: trivial fix, no technical knowledge, no clear entities. }, "unverified_novelty": { "type": "boolean", - "description": "Set to true if cipher was unavailable during analysis" + "description": "Set to true if mem0 was unavailable during analysis" }, "error": { "type": "boolean", diff --git a/.claude/agents/task-decomposer.md b/.claude/agents/task-decomposer.md index bd75b98..8f79219 100644 --- a/.claude/agents/task-decomposer.md +++ b/.claude/agents/task-decomposer.md @@ -34,7 +34,6 @@ machine-readable blueprint for the Actor/Monitor pipeline. │ │ │ 3. GATHER CONTEXT (if complexity ≥ 3) │ │ └─ ALWAYS: mcp__mem0__map_tiered_search (historical decompositions) │ -│ └─ IF similar found: cipher_search_reasoning_patterns │ │ └─ IF ambiguous: sequentialthinking │ │ └─ IF external lib: get-library-docs │ │ └─ Handle fallbacks if tools fail/return empty │ @@ -83,7 +82,6 @@ machine-readable blueprint for the Actor/Monitor pipeline. | Condition | Tool | Query Pattern | |-----------|------|---------------| | **ALWAYS** (complexity ≥ 3) | mcp__mem0__map_tiered_search | `"feature implementation [type]"`, `"task decomposition [domain]"` | -| Similar features found | cipher_search_reasoning_patterns | `"successful task decomposition [type]"`, `"dependency reasoning [domain]"` | | Ambiguous/complex goal | sequentialthinking | Iterative refinement of scope and dependencies | | External library | get-library-docs | Setup/quickstart guides for initialization order | | Unfamiliar domain | deepwiki | `"How does [repo] structure [feature]?"` | @@ -473,7 +471,6 @@ When invoked with `mode: "re_decomposition"` from the orchestrator, you receive **Analysis Completeness**: - [ ] Ran mcp__mem0__map_tiered_search for similar features -- [ ] Ran cipher_search_reasoning_patterns to understand decomposition thinking - [ ] Used sequential-thinking for complex/ambiguous goals - [ ] Checked library docs for initialization requirements - [ ] Identified all risks (not empty for medium/high complexity) diff --git a/.claude/commands/map-debug.md b/.claude/commands/map-debug.md index 95b1475..19bbfd3 100644 --- a/.claude/commands/map-debug.md +++ b/.claude/commands/map-debug.md @@ -48,9 +48,8 @@ PATTERN_CONTEXT=$(mcp__mem0__map_tiered_search(query="debug [issue type]", secti ``` 1. **Read error logs/stack traces** (if provided in $ARGUMENTS) -2. **Search cipher for similar issues**: `mcp__mem0__map_tiered_search("debug pattern [error_type]")` -3. **Identify affected files**: Use Grep/Glob to find relevant code -4. **Reproduce the issue** (if possible): Read test files or run commands +2. **Identify affected files**: Use Grep/Glob to find relevant code +3. **Reproduce the issue** (if possible): Read test files or run commands ## Step 2: Decompose Debugging Process @@ -65,7 +64,7 @@ Task( **Context:** - Error logs: [if available] - Affected files: [from analysis] -- Similar past issues: [from cipher search] +- Similar past issues: [from playbook search] Output JSON with: - subtasks: array of {id, description, debug_type: 'investigation'|'fix'|'verification', acceptance_criteria} @@ -259,11 +258,10 @@ User says: `/map-debug TypeError in authentication middleware` You should: 1. Gather context (read error logs, find middleware file) -2. Search cipher for similar authentication errors -3. Task(subagent_type="task-decomposer") → get investigation + fix steps -4. For investigation steps: Task(subagent_type="actor") to analyze -5. For fix steps: actor → monitor → predictor → evaluator → apply -6. Run tests, verify fix -7. Done! Optionally run `/map-learn` to preserve debugging patterns +2. Task(subagent_type="task-decomposer") → get investigation + fix steps +3. For investigation steps: Task(subagent_type="actor") to analyze +4. For fix steps: actor → monitor → predictor → evaluator → apply +5. Run tests, verify fix +6. Done! Optionally run `/map-learn` to preserve debugging patterns Begin debugging now. diff --git a/.claude/commands/map-fast.md b/.claude/commands/map-fast.md index f8f48d8..7560034 100644 --- a/.claude/commands/map-fast.md +++ b/.claude/commands/map-fast.md @@ -123,7 +123,7 @@ After all subtasks completed: 2. Create commit with message 3. Summarize what was implemented -**Note:** No playbook updates, no cipher patterns stored (learning disabled). +**Note:** No playbook updates (learning disabled). ## Critical Constraints diff --git a/.claude/commands/map-release.md b/.claude/commands/map-release.md index 8da07e2..3e6a35f 100644 --- a/.claude/commands/map-release.md +++ b/.claude/commands/map-release.md @@ -74,16 +74,6 @@ Query playbook for release-related patterns and past release issues: RELEASE_PATTERNS=$(mcp__mem0__map_tiered_search(query="release validation PyPI CI/CD", limit=10)) ``` -**Also search Cipher** for cross-project release patterns: - -``` -mcp__mem0__map_tiered_search( - query="package release validation PyPI deployment best practices", - top_k=5, - similarity_threshold=0.3 -) -``` - ### 1.2 Validation Gates (12 Required) Execute all validation gates in parallel where possible: diff --git a/.claude/playbook_delta_operations.json b/.claude/playbook_delta_operations.json index 686045f..3810bf7 100644 --- a/.claude/playbook_delta_operations.json +++ b/.claude/playbook_delta_operations.json @@ -1,5 +1,5 @@ { - "reasoning": "Curator integrated 11 high-value patterns from Reflector's Reddit post implementation insights. Cipher search revealed existing related patterns (3-layer CLI testing, SQLite migration, quality gates) which were merged or linked via related_to. Novel patterns were created with high specificity and code examples: Bash/Python hook architecture (impl-0050), stderr/stdout stream discipline (cli-0010), event-driven documentation (arch-0021), cipher search pre-design pattern (tool-0008), Monitor integration validation value (err-0002), incremental reflection for multi-subtask (arch-0022), manual testing checklist (test-0017). All patterns grounded in specific technologies (Python, Bash, SQLite, Click/Typer), include code examples showing both incorrect and correct approaches, and reference existing playbook bullets via related_to for cross-linking. Deduplication strategy: 85%+ similarity with cipher patterns triggered UPDATE with helpful_count increment rather than ADD, preserving context budget.", + "reasoning": "Curator integrated 10 high-value patterns from Reflector's Reddit post implementation insights. Search revealed existing related patterns (3-layer CLI testing, SQLite migration, quality gates) which were merged or linked via related_to. Novel patterns were created with high specificity and code examples: Bash/Python hook architecture (impl-0050), stderr/stdout stream discipline (cli-0010), event-driven documentation (arch-0021), Monitor integration validation value (err-0002), incremental reflection for multi-subtask (arch-0022), manual testing checklist (test-0017). All patterns grounded in specific technologies (Python, Bash, SQLite, Click/Typer), include code examples showing both incorrect and correct approaches, and reference existing playbook bullets via related_to for cross-linking. Deduplication strategy: 85%+ similarity with existing patterns triggered UPDATE with helpful_count increment rather than ADD, preserving context budget.", "operations": [ { @@ -57,17 +57,6 @@ "helpful_count": 0, "harmful_count": 0 }, - { - "type": "ADD", - "section": "TOOL_USAGE", - "id": "tool-0008", - "content": "Cipher Search Before Design: When implementing new features, search cipher memory FIRST (before writing specifications) to discover existing patterns and proven solutions across projects. Prevents: reimplementing solved problems, introducing duplicate knowledge, building on flawed approaches already tried. Query cipher with feature keywords and pain points (e.g., 'SQLite schema migration', 'authentication pattern', 'error handling'). If existing pattern found with high quality (helpful_count >= 5), adopt it with local customization rather than designing new approach. If pattern not found or existing solution incomplete, use that gap as specification requirement. Pattern reduces design time by 30-50% and prevents solution thrashing.", - "code_example": "```python\n# ✅ CIPHER-FIRST DESIGN\nfrom mapify.cipher import CipherMemory\n\ndef design_feature(feature_name: str):\n \"\"\"Search cipher before designing\"\"\"\n cipher = CipherMemory()\n \n # Step 1: Search cipher for existing patterns\n results = cipher.search(\n f'{feature_name} pattern',\n top_k=10,\n quality_threshold=0.7\n )\n \n if results:\n best = results[0]\n print(f'Found existing pattern: {best.id}')\n print(f'Quality score: {best.helpful_count}')\n print(f'Content: {best.text[:200]}...')\n \n # Use existing pattern as foundation\n return {\n 'base_pattern': best.id,\n 'customization_needed': [\n 'Adapt to local error handling',\n 'Integrate with existing CLI',\n ]\n }\n else:\n # Gap in knowledge - this becomes design requirement\n print(f'No existing pattern for {feature_name}')\n return {\n 'new_pattern': True,\n 'gap_analysis': 'Document this pattern for cross-project reuse'\n }\n\n# ❌ DESIGN-FIRST (no cipher check)\ndef design_without_cipher(feature_name: str):\n # Immediately write spec without checking existing solutions\n spec = write_specification()\n implement(spec)\n # Later discover: cipher had better solution, now have duplicate\n # Or: approach in cipher proved problematic, we hit same issue\n```", - "related_to": ["tool-0001", "arch-0001"], - "tags": ["cipher", "knowledge-reuse", "design", "deduplication"], - "helpful_count": 0, - "harmful_count": 0 - }, { "type": "ADD", "section": "ERROR_PATTERNS", @@ -107,10 +96,10 @@ ], "deduplication_check": { - "checked_sections": ["ARCHITECTURE_PATTERNS", "CLI_TOOL_PATTERNS", "TESTING_STRATEGIES", "TOOL_USAGE", "ERROR_PATTERNS", "IMPLEMENTATION_PATTERNS"], + "checked_sections": ["ARCHITECTURE_PATTERNS", "CLI_TOOL_PATTERNS", "TESTING_STRATEGIES", "ERROR_PATTERNS", "IMPLEMENTATION_PATTERNS"], "similar_bullets_found": [ - "test-0016 (3-layer CLI testing - exists in cipher)", - "arch-0020 (SQLite migration - exists in cipher)", + "test-0016 (3-layer CLI testing - exists in knowledge base)", + "arch-0020 (SQLite migration - exists in knowledge base)", "arch-0001 (workflow context - already in playbook)" ], "similarity_scores": { @@ -123,40 +112,18 @@ "created_impl-0050_bash_python_hook_architecture_novel_pattern", "created_cli-0010_stderr_stdout_stream_discipline_novel_pattern", "created_arch-0021_event_driven_documentation_novel_pattern", - "created_tool-0008_cipher_search_before_design_novel_pattern", "created_err-0002_monitor_integration_validation_value_novel_pattern", "created_arch-0022_incremental_reflection_multi_subtask_novel_pattern", "created_test-0017_manual_testing_checklist_novel_pattern", "created_test-0018_batch_test_development_novel_pattern", "incremented_helpful_count_test-0016_and_arch-0001_due_to_validation_in_workflow" ], - "reasoning": "Cipher search found 3 related patterns (3-layer testing similarity 0.65, SQLite migration 0.71, workflow context 0.58). All scores below merge threshold (0.85), so created new bullets instead. New bullets are high-specificity (name functions, parameters, consequences), include 5+ line code examples showing incorrect + correct, and grounded in Python/Bash. Related_to links enable cross-referencing between new and existing bullets. Two existing bullets (test-0016, arch-0001) incremented for helpful_count based on validation in Reddit implementation." + "reasoning": "Search found 3 related patterns (3-layer testing similarity 0.65, SQLite migration 0.71, workflow context 0.58). All scores below merge threshold (0.85), so created new bullets instead. New bullets are high-specificity (name functions, parameters, consequences), include 5+ line code examples showing incorrect + correct, and grounded in Python/Bash. Related_to links enable cross-referencing between new and existing bullets. Two existing bullets (test-0016, arch-0001) incremented for helpful_count based on validation in Reddit implementation." }, - "sync_to_cipher": [ - { - "bullet_id": "impl-0050", - "current_helpful_count": 1, - "reason": "High-value reusable pattern for decoupling shell and Python in CLI tools. Generalizable across projects using git hooks, pre-commit handlers, CI integration points. Will reach threshold after 4 more uses.", - "sync_priority": "medium" - }, - { - "bullet_id": "test-0016", - "current_helpful_count": 1, - "reason": "Already synced to cipher previously (confidence 0.85). Helpful_count incremented to 1. Re-verified quality via Reddit post implementation - 3-layer testing caught integration gaps. Monitor as pattern learner.", - "sync_priority": "high" - }, - { - "bullet_id": "arch-0001", - "current_helpful_count": 1, - "reason": "Workflow-scoped learning context pattern validated by incremental reflection (arch-0022) in multi-subtask workflow. Demonstrated value: later subtasks benefit from earlier reflections.", - "sync_priority": "medium" - } - ], - "quality_report": { - "operations_proposed": 11, - "operations_approved": 11, + "operations_proposed": 10, + "operations_approved": 10, "operations_rejected": 0, "rejection_reasons": [], "average_content_length": 248, @@ -171,11 +138,10 @@ "CLI_TOOL_PATTERNS (cli-0010)", "TESTING_STRATEGIES (test-0017, test-0018)", "ARCHITECTURE_PATTERNS (arch-0021, arch-0022)", - "TOOL_USAGE (tool-0008)", "ERROR_PATTERNS (err-0002)", "UPDATE: test-0016, arch-0001" ], "deduplication_effectiveness": "100% (0 duplicates created, 3 related bullets linked)", - "cipher_integration": "Identified 3 existing cipher patterns, chose CREATE_NEW over MERGE due to specificity differences. Planned 3 bullets for sync (test-0016, impl-0050, arch-0001) at next helpful_count threshold." + "knowledge_integration": "Identified 3 existing related patterns, chose CREATE_NEW over MERGE due to specificity differences." } } diff --git a/.claude/skills/README.md b/.claude/skills/README.md index db39e0f..1e2854c 100644 --- a/.claude/skills/README.md +++ b/.claude/skills/README.md @@ -55,7 +55,6 @@ MAP: [Shows decision tree and comparison matrix] - `map-refactor-deep-dive.md` - Dependency analysis - `agent-architecture.md` - How 8 agents orchestrate - `playbook-system.md` - Knowledge storage and search -- `cipher-integration.md` - Cross-project learning --- @@ -126,7 +125,6 @@ Skills work seamlessly with the prompt improvement system: ├── map-refactor-deep-dive.md ├── agent-architecture.md ├── playbook-system.md - └── cipher-integration.md ``` --- diff --git a/.claude/skills/map-workflows-guide/SKILL.md b/.claude/skills/map-workflows-guide/SKILL.md index 2d51ac8..dc12a41 100644 --- a/.claude/skills/map-workflows-guide/SKILL.md +++ b/.claude/skills/map-workflows-guide/SKILL.md @@ -485,7 +485,6 @@ Agent & system details: - **[Agent Architecture](resources/agent-architecture.md)** — How agents orchestrate and coordinate - **[Playbook System (LEGACY)](resources/playbook-system.md)** — Historical pattern storage -- **[mem0 Integration](resources/cipher-integration.md)** — Tiered pattern storage (v4.0+) --- @@ -570,8 +569,6 @@ MAP: 📚 Loads this skill for context 2. **Have a critical feature?** See [map-feature-deep-dive.md](resources/map-feature-deep-dive.md) 3. **Debugging an issue?** See [map-debug-deep-dive.md](resources/map-debug-deep-dive.md) 4. **Understanding agents?** See [Agent Architecture](resources/agent-architecture.md) -5. **Learning about mem0?** See [mem0 Integration](resources/cipher-integration.md) - --- **Skill Version:** 1.0 diff --git a/.claude/skills/map-workflows-guide/resources/agent-architecture.md b/.claude/skills/map-workflows-guide/resources/agent-architecture.md index 73a1d03..96173ed 100644 --- a/.claude/skills/map-workflows-guide/resources/agent-architecture.md +++ b/.claude/skills/map-workflows-guide/resources/agent-architecture.md @@ -243,5 +243,4 @@ Create `.claude/commands/map-custom.md`: **See also:** - [Playbook System](playbook-system.md) - How knowledge is structured -- [Cipher Integration](cipher-integration.md) - Cross-project learning - [map-efficient Deep Dive](map-efficient-deep-dive.md) - Conditional execution example diff --git a/.claude/skills/map-workflows-guide/resources/cipher-integration.md b/.claude/skills/map-workflows-guide/resources/cipher-integration.md deleted file mode 100644 index 93c34fb..0000000 --- a/.claude/skills/map-workflows-guide/resources/cipher-integration.md +++ /dev/null @@ -1,291 +0,0 @@ -# mem0 Integration - -> **MIGRATION NOTE:** As of v4.0, pattern storage has migrated from cipher to mem0 MCP. This document describes the new mem0-based system. - -mem0 is MAP's tiered knowledge system. It stores patterns across namespaces (branch → project → org) for both project-specific and cross-project knowledge sharing. - -## What is mem0? - -**mem0** = MCP (Model Context Protocol) server for tiered pattern storage - -**Key Features:** -- **Tiered namespaces** - L1 (branch), L2 (project), L3 (org) -- **Semantic search** - Find patterns by meaning via tiered search -- **Fingerprint deduplication** - Prevents storing exact duplicates -- **Persistent storage** - Knowledge survives across sessions - ---- - -## Tiered Memory System - -### Tier Overview - -| Tier | Namespace | Scope | Use Case | -|------|-----------|-------|----------| -| **L1 (Recent)** | Branch-scoped | Current work session | Patterns specific to current feature | -| **L2 (Frequent)** | Project-scoped | All project patterns | Shared project knowledge | -| **L3 (Semantic)** | Org-scoped | Cross-project patterns | Organizational best practices | - -### Search Flow - -Tiered search queries tiers in order: L1 → L2 → L3 - -``` -mcp__mem0__map_tiered_search("async implementation") - ↓ -L1 (branch): Check recent patterns from current feature branch - ↓ -L2 (project): Check project-level patterns - ↓ -L3 (org): Check organizational patterns - ↓ -Return merged results (most specific first) -``` - -### Example Pattern Distribution - -**L1 (Branch-specific):** -- "Using new auth middleware pattern for this feature" -- "This branch uses beta API version 2.1" - -**L2 (Project-specific):** -- "Use FastAPI with uvicorn for this API service" -- "JWT secret stored in .env file (JWT_SECRET)" -- "Database migrations via Alembic in migrations/ folder" - -**L3 (Org-wide):** -- "Use async/await for I/O operations to avoid blocking" -- "Validate JWT tokens before processing requests" -- "Database schema changes require migration scripts" - ---- - -## MCP Tools - -### 1. mcp__mem0__map_tiered_search - -**Purpose:** Find existing patterns before implementing - -**Used by:** -- Actor (before implementing) -- Reflector (before suggesting new patterns) -- Curator (before creating ADD operations) - -**Example call:** -```python -mcp__mem0__map_tiered_search( - query="JWT token validation best practices", - category="security" # optional filter -) -``` - -**Returns:** -```json -{ - "patterns": [ - { - "id": "impl-0042", - "content": "Always verify JWT signature before trusting claims", - "tier": "project", - "relevance": 0.89 - } - ], - "tiers_searched": ["branch", "project", "org"] -} -``` - -### 2. mcp__mem0__map_add_pattern - -**Purpose:** Store new patterns - -**Used by:** -- Curator (after validating patterns) - -**Example call:** -```python -mcp__mem0__map_add_pattern( - content="Use async/await for I/O operations", - category="implementation", - tier="project" # default: project -) -``` - -**Returns:** -```json -{ - "created": true, - "pattern_id": "impl-0043", - "fingerprint": "abc123..." -} -``` - -**If duplicate exists:** -```json -{ - "created": false, - "existing_id": "impl-0012", - "reason": "Duplicate fingerprint" -} -``` - -### 3. mcp__mem0__map_archive_pattern - -**Purpose:** Deprecate outdated patterns - -**Used by:** -- Curator (when patterns become obsolete) - -**Example call:** -```python -mcp__mem0__map_archive_pattern( - pattern_id="impl-0042", - reason="Superseded by new auth approach" -) -``` - ---- - -## Deduplication Strategy - -### Fingerprint-Based Deduplication - -Each pattern has a fingerprint (content hash). When adding: - -``` -Curator tries to add pattern - ↓ -map_add_pattern computes fingerprint - ↓ -Check if fingerprint exists in target tier - ↓ -If exists: Return created=false with existing_id -If not: Create new pattern, return created=true -``` - -### Why Fingerprint vs Similarity - -| Approach | Pros | Cons | -|----------|------|------| -| Fingerprint (exact) | Fast, deterministic | Only catches exact duplicates | -| Similarity (semantic) | Catches near-duplicates | Slower, requires embeddings | - -**MAP choice:** Fingerprint for deduplication (fast), semantic for search (smart) - ---- - -## Knowledge Flow - -### Adding New Patterns - -``` -1. Subtask completed successfully -2. Run /map-learn to trigger learning -3. Reflector extracts patterns -4. Reflector searches mem0 (check if similar exists) -5. Curator validates patterns -6. Curator calls map_add_pattern for each new pattern -7. Pattern stored in appropriate tier -``` - -### Searching Patterns - -``` -1. New subtask starts -2. Actor calls map_tiered_search(subtask_description) -3. Results from L1 → L2 → L3 merged -4. Actor applies most relevant patterns -5. Implementation benefits from accumulated knowledge -``` - ---- - -## Tier Promotion - -Patterns can be promoted from project to org tier when: - -1. Pattern used successfully across multiple projects -2. Manual review confirms universal applicability -3. Admin uses `mcp__mem0__map_promote_pattern` - -```python -mcp__mem0__map_promote_pattern( - pattern_id="impl-0042", - from_tier="project", - to_tier="org" -) -``` - ---- - -## Benefits - -### 1. Scoped Knowledge - -- Branch patterns don't pollute project scope -- Project patterns don't pollute org scope -- Clear boundaries for different concerns - -### 2. Fast Local Access - -- L1 (branch) = fastest access -- Most relevant patterns found first -- Cross-project patterns available when needed - -### 3. Quality Through Tiers - -- Experimental patterns stay in branch tier -- Validated patterns promote to project tier -- Universal patterns reach org tier - ---- - -## Troubleshooting - -### Patterns not found in search - -**Check:** -1. Pattern exists in correct tier: Use `mcp__mem0__get_memories` to list -2. Query matches pattern content: Try more specific query -3. Category filter isn't too restrictive - -### Duplicate patterns appearing - -**Check:** -1. Content differs slightly (different fingerprints) -2. Patterns in different tiers (L1 vs L2) - -**Solution:** -- Archive older duplicate -- Standardize pattern wording - -### Pattern not saving - -**Check:** -1. `created: false` in response = duplicate -2. Check `existing_id` to find the duplicate -3. Decide whether to update existing or archive it - ---- - -## Best Practices - -### For Workflows - -1. **Always search before implementing** - Actor should search mem0 first -2. **Use appropriate tier** - Branch for unvalidated, project for validated -3. **Archive instead of delete** - Preserve history for auditing -4. **Include category** - Helps filtering and organization - -### For Users - -1. **Run /map-learn after workflows** - Extracts and stores patterns -2. **Review archived patterns periodically** - May have valuable history -3. **Promote good patterns** - Move validated patterns to higher tiers -4. **Query across tiers** - Don't limit to single tier - ---- - -**See also:** -- [Playbook System (Legacy)](playbook-system.md) - Historical reference -- [Agent Architecture](agent-architecture.md) - Reflector/Curator roles -- [map-efficient Deep Dive](map-efficient-deep-dive.md) - Batched learning workflow diff --git a/.claude/skills/map-workflows-guide/resources/map-efficient-deep-dive.md b/.claude/skills/map-workflows-guide/resources/map-efficient-deep-dive.md index 9976ab2..5797b92 100644 --- a/.claude/skills/map-workflows-guide/resources/map-efficient-deep-dive.md +++ b/.claude/skills/map-workflows-guide/resources/map-efficient-deep-dive.md @@ -133,7 +133,7 @@ ST-3: Integration tests Reflector (batched): ├─ Analyzed: 3 subtasks -├─ Searched cipher: Found similar pagination patterns +├─ Searched mem0: Found similar pagination patterns └─ Extracted: - Pagination parameter pattern (offset/limit) - API versioning consideration diff --git a/.claude/skills/map-workflows-guide/resources/map-fast-deep-dive.md b/.claude/skills/map-workflows-guide/resources/map-fast-deep-dive.md index b4dd1c4..5061426 100644 --- a/.claude/skills/map-workflows-guide/resources/map-fast-deep-dive.md +++ b/.claude/skills/map-workflows-guide/resources/map-fast-deep-dive.md @@ -21,7 +21,7 @@ **Why?** No learning means: - Patterns not captured → team doesn't learn - Playbook not updated → knowledge lost -- Cipher not synced → other projects don't benefit +- Patterns not synced → other projects don't benefit - Technical debt accumulates --- @@ -42,7 +42,7 @@ **Curator (Playbook Updates)** - No playbook bullets created -- No cipher synchronization +- No pattern synchronization - No cross-project learning ### What Remains diff --git a/.claude/skills/map-workflows-guide/resources/map-feature-deep-dive.md b/.claude/skills/map-workflows-guide/resources/map-feature-deep-dive.md index 0f860ea..1e0c9e4 100644 --- a/.claude/skills/map-workflows-guide/resources/map-feature-deep-dive.md +++ b/.claude/skills/map-workflows-guide/resources/map-feature-deep-dive.md @@ -206,7 +206,6 @@ ST-2: Authorization code flow **Knowledge captured:** - ✅ Playbook bullets created (N subtasks → N+ bullets) -- ✅ High-quality bullets synced to cipher - ✅ Team can apply patterns immediately **Impact understood:** @@ -224,7 +223,7 @@ ST-2: Authorization code flow **Issue:** Too many playbook bullets created **Cause:** Reflector suggesting redundant patterns -**Solution:** Curator should check cipher more aggressively +**Solution:** Curator should check for duplicates more aggressively **Issue:** Predictor always says "high risk" **Cause:** Overly conservative risk assessment diff --git a/.claude/skills/map-workflows-guide/resources/playbook-system.md b/.claude/skills/map-workflows-guide/resources/playbook-system.md index f3f8e27..47c5579 100644 --- a/.claude/skills/map-workflows-guide/resources/playbook-system.md +++ b/.claude/skills/map-workflows-guide/resources/playbook-system.md @@ -68,7 +68,7 @@ High-level design decisions ### 6. PERFORMANCE_OPTIMIZATIONS Performance improvements and profiling -- Example: "Batch cipher search queries to avoid N+1 problem" +- Example: "Batch search queries to avoid N+1 problem" - Example: "FTS5 search 10x faster than grep for large playbooks" --- @@ -87,7 +87,7 @@ quality_score = helpful_count - harmful_count ``` **Usage:** -- Bullets with `quality_score >= 5` are high-quality → synced to cipher +- Bullets with `quality_score >= 5` are high-quality - Bullets with `quality_score < 0` are deprecated → soft-deleted --- @@ -240,7 +240,7 @@ Actor marks bullets as helpful ↓ Curator increments helpful_count ↓ -If helpful_count reaches 5 → sync to cipher +If helpful_count reaches 5 → promote to higher tier ↓ Pattern becomes cross-project knowledge ``` @@ -298,5 +298,4 @@ Pattern becomes cross-project knowledge **See also:** - [Agent Architecture](agent-architecture.md) - How Reflector/Curator work -- [Cipher Integration](cipher-integration.md) - Cross-project knowledge sync - [map-efficient Deep Dive](map-efficient-deep-dive.md) - Batched Curator updates diff --git a/.gitignore b/.gitignore index 3525f08..00ff8e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,4 @@ -.clinerules/cipher-rules.md -.kilocode/rules/cipher-rules.md -.roo/rules/cipher-rules.md -.windsurf/rules/cipher-rules.md -.cursor/rules/cipher-rules.mdc -.kiro/steering/cipher-rules.md -.qoder/rules/cipher-rules.md -.augment/rules/cipher-rules.md .reviews .coverage diff --git a/.mcp.json.example b/.mcp.json.example index 05d3ed7..87ec006 100644 --- a/.mcp.json.example +++ b/.mcp.json.example @@ -5,21 +5,6 @@ "_warning": "Project-specific .mcp.json overrides global ~/.claude.json settings. Only use if you need project-specific MCP configuration.", "mcpServers": { - "cipher": { - "_comment": "Byterover Cipher - Memory-powered AI agent framework with dual memory layer", - "_install": "npm install -g @byterover/cipher", - "_required_for": "ACE learning system, knowledge management, reasoning memory", - "_docs": "https://docs.byterover.dev/cipher/overview", - "type": "stdio", - "command": "cipher", - "args": ["--mode", "mcp"], - "env": { - "MCP_SERVER_MODE": "aggregator", - "OPENAI_API_KEY": "${OPENAI_API_KEY}", - "ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}" - } - }, - "claude-reviewer": { "_comment": "Code review MCP server - provides professional code review with security analysis", "_note": "This example uses a community server. You may need to adjust the command for your setup.", @@ -72,7 +57,6 @@ "global_vs_local": "Most users should configure MCP servers in ~/.claude.json globally. Only use project-specific .mcp.json if you need different configurations per project.", "environment_variables": "Environment variables like ${OPENAI_API_KEY} are expanded from your shell environment or .env file.", "required_servers": [ - "cipher - Essential for MAP ACE learning system", "claude-reviewer - Essential for code review features", "sequential-thinking - Essential for complex reasoning" ], @@ -81,7 +65,6 @@ "deepwiki - Recommended for GitHub repository analysis" ], "alternative_installations": { - "cipher": "Can also use Docker or build from source - see https://github.com/campfirein/cipher", "deepwiki": "Alternative transport: https://mcp.deepwiki.com/mcp (Streamable HTTP)" } } diff --git a/CHANGELOG.md b/CHANGELOG.md index 796b984..062fb54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [3.0.0] - 2026-01-16 ### Changed (BREAKING) -- **Memory layer migration**: Migrate from `playbook.db`/cipher to mem0 MCP for all pattern storage. This is a breaking change that requires mem0 MCP server configuration. +- **Memory layer migration**: Migrate from `playbook.db` to mem0 MCP for all pattern storage. This is a breaking change that requires mem0 MCP server configuration. ### Added - P0 foundation implementation: security hooks, permissions system, workflow recovery @@ -69,7 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Code quality: Black formatting, ruff linting, mypy type errors ### Documentation -- Complete migration of playbook.db/cipher references to mem0 MCP across all docs and templates +- Complete migration of playbook.db references to mem0 MCP across all docs and templates - Comprehensive documentation update to v2.3.0 standards - README optimization (418→93 lines) for improved conversion @@ -166,7 +166,7 @@ For existing projects with hooks installed: - ✅ All MAP workflows (`/map-efficient`, `/map-debug`, `/map-fast`, `/map-learn`, `/map-release`, `/map-review`) - ✅ Agent orchestration via Task tool - ✅ Pattern management via mem0 MCP tools (`mcp__mem0__map_tiered_search`, `mcp__mem0__map_add_pattern`, etc.) -- ✅ MCP server integration (cipher, context7, deepwiki, etc.) +- ✅ MCP server integration (context7, deepwiki, etc.) **What no longer works:** - ❌ `mapify init --with-hooks` / `--no-hooks` options (removed from CLI) @@ -187,7 +187,7 @@ rm -rf .claude/hooks/ ### Added - **Optional Learning Command**: Added `/map-learn` command for optional post-workflow learning. Reflector and Curator agents are now invoked on-demand rather than automatically in workflows (cdc7e4e) -- **Auto-Approval Permissions**: `mapify init` now configures auto-approval rules for common readonly operations (cipher memory search, tracker queries, sequential-thinking) to reduce permission prompts (18f9532) +- **Auto-Approval Permissions**: `mapify init` now configures auto-approval rules for common readonly operations (tracker queries, sequential-thinking) to reduce permission prompts (18f9532) ### Changed - **Workflow Simplification**: Removed unused workflow commands (`/map-feature`, `/map-refactor`) to reduce maintenance burden. Use `/map-efficient` for feature work (cdc7e4e) @@ -255,7 +255,7 @@ rm -rf .claude/hooks/ ### Added - **Non-Interactive Init**: `mapify init` now defaults to non-interactive mode, installing all MCP servers without prompts for better CI/CD compatibility (1ad6dd6) -- **Agent MCP Integration**: Integrated 18 Cipher MCP tools across all 8 MAP agents (task-decomposer, actor, monitor, predictor, evaluator, reflector, curator, documentation-reviewer) for enhanced knowledge management and reasoning capabilities (aaded8a) +- **Agent MCP Integration**: Integrated MCP tools across all 8 MAP agents (task-decomposer, actor, monitor, predictor, evaluator, reflector, curator, documentation-reviewer) for enhanced knowledge management and reasoning capabilities (aaded8a) - **Release Validation**: Added CHANGELOG completeness validation to Gate 12 in release workflow, preventing releases with incomplete documentation (6541511) ### Changed @@ -305,13 +305,6 @@ rm -rf .claude/hooks/ - Added E2E tests for CLI command correctness validation - Updated documentation with CLI best practices -- **Cipher Infrastructure Enhancements** (fd505ce, 30b0947, c7a3fa4, 59cbe7f) - - Added Neo4j to Cipher Docker Compose infrastructure for Knowledge Graph support - - Comprehensive Cipher + Qdrant + PostgreSQL setup documentation - - Knowledge Graph configuration documentation - - Refactored Cipher setup docs into modular quick-start guides (condensed from 76KB to ~15KB) - - Added infrastructure examples with docker-compose.yml and .env.example - - **Claude Code Hooks Integration** (1ffedbc, d27bfb9, ba43d1b) - Integrated claude-code-prompt-improver with sequential hooks - Use CLAUDE_PROJECT_DIR for absolute hook paths @@ -338,7 +331,7 @@ rm -rf .claude/hooks/ - Restored SessionStart hook functionality - **Documentation Corrections** (d998100, cc572b0, 62f4626, 3b8b492, b62bea7, 5e5ee62) - - Fixed Claude Desktop → Claude Code references in Cipher setup + - Fixed Claude Desktop → Claude Code references in documentation - Addressed Copilot review comments across multiple PRs - Aligned with official Claude Code hooks documentation @@ -351,7 +344,7 @@ rm -rf .claude/hooks/ ### Removed - **Cleanup** (cd93cfe, 4c0602b, cf0573c) - - Removed obsolete Cipher example files and curator outputs + - Removed obsolete example files and curator outputs - Removed generated curator_output.json file ## [1.2.3] - 2025-11-05 @@ -368,7 +361,7 @@ rm -rf .claude/hooks/ 2. Explicit error handling (no silent failures) 3. Security review (SQL injection, XSS, sensitive data logging) 4. Test case identification (happy path + edge cases) - 5. MCP tools usage (cipher_memory_search, context7) + 5. MCP tools usage (mem0, context7) 6. Template variable preservation (orchestration compatibility) 7. Trade-offs documentation 8. Playbook bullet tracking (ACE feedback loop) @@ -573,7 +566,7 @@ rm -rf .claude/hooks/ - Batched Reflector/Curator execution (once at end vs per-subtask) - Conditional Predictor (only for high-risk subtasks) - Skips Evaluator (Monitor provides sufficient validation) - - Maintains playbook updates and cipher integration + - Maintains playbook updates and knowledge integration - `/map-fast` (⚠️ low-risk only): 40-50% token savings, no learning - Minimal agent sequence: TaskDecomposer → Actor → Monitor - Skips: Predictor, Evaluator, Reflector, Curator diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index fe42aa3..7feca96 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -413,7 +413,7 @@ print("Consider running /map-learn to save patterns") **Architectural Consequences:** - Playbook remains static (no continuous improvement) -- Cipher knowledge base never grows +- Knowledge base never grows - Breaking changes undetected (no Predictor) - Security/performance issues may slip through (no Evaluator) - Same mistakes repeated (no Reflector) @@ -1506,7 +1506,7 @@ The Knowledge Graph (KG) layer transforms implicit knowledge into an explicit, q ### Memory System (v4.0) -> **Note:** As of v4.0, the dual memory system (playbook.db + cipher) has been replaced with mem0 MCP. This section describes the legacy architecture for reference. +> **Note:** As of v4.0, the legacy memory system (playbook.db) has been replaced with mem0 MCP. This section describes the legacy architecture for reference. MAP Framework now operates with **mem0 MCP tiered storage**: @@ -2060,7 +2060,7 @@ Agent template changes are tracked in the project's main CHANGELOG.md. ### Breaking Changes - Actor: Changed output format to include `used_patterns` array -- All agents: Migrated from cipher to mem0 MCP tools +- All agents: Migrated to mem0 MCP tools ### Added - Actor: MCP integration section with mem0 tool usage patterns diff --git a/docs/CLI_COMMAND_REFERENCE.md b/docs/CLI_COMMAND_REFERENCE.md index b7fc2b6..32d88e9 100644 --- a/docs/CLI_COMMAND_REFERENCE.md +++ b/docs/CLI_COMMAND_REFERENCE.md @@ -154,7 +154,7 @@ mapify init . --force mapify init my-project --no-git # Enable specific MCP servers -mapify init . --mcp cipher,context7 +mapify init . --mcp context7,deepwiki ``` --- diff --git a/docs/CLI_REFERENCE.json b/docs/CLI_REFERENCE.json index d0755dc..b0e9d0f 100644 --- a/docs/CLI_REFERENCE.json +++ b/docs/CLI_REFERENCE.json @@ -8,7 +8,7 @@ "description": "Manage and search playbook patterns", "subcommands": { "query": { - "description": "Query playbook using FTS5 full-text search with optional cipher integration", + "description": "Query playbook using FTS5 full-text search", "usage": "mapify playbook query [QUERY_TEXT] [OPTIONS]", "parameters": { "query_text": { @@ -36,8 +36,8 @@ "required": false, "flag": "--mode", "default": "local", - "enum": ["local", "cipher", "hybrid"], - "description": "Search mode: local (playbook only), cipher (cross-project), or hybrid (both)" + "enum": ["local"], + "description": "Search mode: local (playbook only)" }, "format": { "type": "string", @@ -60,10 +60,6 @@ "command": "mapify playbook query \"JWT authentication\" --limit 5", "description": "Basic query for JWT patterns" }, - { - "command": "mapify playbook query \"error handling\" --mode hybrid --limit 10", - "description": "Hybrid search (playbook + cipher)" - }, { "command": "mapify playbook query \"API design\" --section ARCHITECTURE_PATTERNS", "description": "Query specific section" @@ -453,9 +449,7 @@ "recommendation": "Use 'query' for most cases, 'search' for semantic similarity" }, "playbook_modes": { - "local": "Search only project playbook (fast)", - "cipher": "Search only cross-project cipher memory (requires MCP)", - "hybrid": "Search both playbook and cipher (comprehensive)" + "local": "Search only project playbook (fast)" }, "stdin_support": { "description": "Commands that accept stdin input", @@ -589,22 +583,14 @@ "reflector_agent": { "role": "Searches for existing patterns before extracting new ones", "workflow": [ - "1. Search cipher for similar patterns", + "1. Search mem0 for similar patterns", "2. Search local playbook", "3. Extract only novel patterns" ], "uses_commands": [ - "mapify playbook query \"...\" --mode hybrid" + "mapify playbook query \"...\"" ] } - }, - "cipher_mcp": { - "description": "Integration with cipher MCP server for cross-project memory", - "commands_using_cipher": [ - "mapify playbook query --mode cipher", - "mapify playbook query --mode hybrid" - ], - "requirement": "Cipher MCP server must be configured in Claude Desktop config" } }, "metadata": { diff --git a/docs/INSTALL.md b/docs/INSTALL.md index 7234053..8003fa7 100644 --- a/docs/INSTALL.md +++ b/docs/INSTALL.md @@ -163,14 +163,14 @@ Choose which MCP servers to enable: # All available MCP servers mapify init my-project --mcp all -# Essential servers only (cipher, claude-reviewer, sequential-thinking) +# Essential servers only (claude-reviewer, sequential-thinking) mapify init my-project --mcp essential # Documentation servers (context7, deepwiki) mapify init my-project --mcp docs # Specific servers -mapify init my-project --mcp "cipher,context7,deepwiki" +mapify init my-project --mcp "context7,deepwiki" # No MCP servers mapify init my-project --mcp none @@ -332,10 +332,6 @@ If you selected MCP servers during installation, ensure they're configured: See mem0 MCP server documentation for installation instructions. -### Cipher (LEGACY) - -> **DEPRECATED (v4.0+):** Cipher has been replaced by mem0 MCP. See [QUICKSTART-CIPHER.md](QUICKSTART-CIPHER.md) for legacy documentation. - ### Claude-Reviewer (Professional Review) - Automated security and quality analysis diff --git a/docs/QUICKSTART-CIPHER.md b/docs/QUICKSTART-CIPHER.md deleted file mode 100644 index ca6c8e3..0000000 --- a/docs/QUICKSTART-CIPHER.md +++ /dev/null @@ -1,319 +0,0 @@ -# Cipher MCP Quick Start (DEPRECATED) - -> **⚠️ DEPRECATED:** As of v4.0, pattern storage has migrated from Cipher to mem0 MCP. This guide is retained for historical reference only. For current implementation, mem0 MCP is used directly via the mem0 MCP server. - -Краткая инструкция для запуска Cipher MCP с Qdrant + PostgreSQL + Neo4j на основе работающей установки. - -> **Для пошаговой документации:** См. [cipher-setup-guide/](cipher-setup-guide/) с отдельными руководствами для каждого шага. - -## Prerequisites - -```bash -# Docker/Podman -docker --version # или podman --version - -# Ollama с моделями -ollama list # должны быть qwen2.5-coder:7b и mxbai-embed-large - -# Node.js и npm -node --version # v16+ -npm --version -``` - -## 1. Infrastructure Setup - -### Create directory - -```bash -mkdir -p ~/cipher-infra -cd ~/cipher-infra -``` - -### Create .env file - -```bash -cat > .env <<'EOF' -POSTGRES_USER=cipher -POSTGRES_PASSWORD=R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG -POSTGRES_DB=cipher - -NEO4J_USER=neo4j -NEO4J_PASSWORD=kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+ -EOF -``` - -### Create docker-compose.yml - -```bash -cat > docker-compose.yml <<'EOF' -services: - qdrant: - image: qdrant/qdrant:latest - container_name: cipher-qdrant - ports: - - "127.0.0.1:6333:6333" - - "127.0.0.1:6334:6334" - volumes: - - qdrant_storage:/qdrant/storage - environment: - - QDRANT__SERVICE__GRPC_PORT=6334 - restart: unless-stopped - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"] - interval: 30s - timeout: 10s - retries: 3 - - postgres: - image: pgvector/pgvector:pg16 - container_name: cipher-postgres - ports: - - "127.0.0.1:5432:5432" - volumes: - - postgres_data:/var/lib/postgresql/data - environment: - POSTGRES_USER: ${POSTGRES_USER:-cipher} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB:-cipher} - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "pg_isready -U cipher"] - interval: 10s - timeout: 5s - retries: 5 - - neo4j: - image: neo4j:latest - container_name: cipher-neo4j - ports: - - "127.0.0.1:7687:7687" - - "127.0.0.1:7474:7474" - volumes: - - neo4j_data:/data - - neo4j_logs:/logs - environment: - NEO4J_AUTH: ${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD} - NEO4J_PLUGINS: '["apoc"]' - NEO4J_dbms_security_procedures_unrestricted: apoc.* - NEO4J_dbms_memory_heap_initial__size: 512m - NEO4J_dbms_memory_heap_max__size: 2g - NEO4J_server_jvm_additional: "-Xint" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1"] - interval: 30s - timeout: 10s - retries: 5 - start_period: 40s - -volumes: - qdrant_storage: - driver: local - postgres_data: - driver: local - neo4j_data: - driver: local - neo4j_logs: - driver: local - -networks: - default: - name: cipher-network -EOF -``` - -### Start infrastructure - -```bash -docker compose up -d -# или для podman: -# podman compose up -d -``` - -## 2. Cipher Configuration - -### Install Cipher globally - -```bash -npm install -g @byterover/cipher -``` - -### Create Cipher config - -```bash -mkdir -p ~/.cipher - -cat > ~/.cipher/cipher.yml <<'EOF' -mcpServers: {} - -llm: - provider: ollama - model: qwen2.5-coder:7b - maxIterations: 50 - baseURL: $OLLAMA_BASE_URL - -embedding: - type: ollama - model: mxbai-embed-large - baseUrl: $OLLAMA_BASE_URL - dimensions: 1024 - -systemPrompt: - enabled: true - content: | - You are Cipher, a knowledge management and reasoning system integrated with MAP Framework. - - Your core capabilities: - - Knowledge Management: Extract, store, and retrieve semantic knowledge across sessions - - Reasoning Analysis: Capture and evaluate multi-step thought processes - - Pattern Recognition: Identify recurring patterns in problem-solving approaches - - Context Integration: Connect related knowledge from different domains - - MAP Framework Integration: - - Support ACE (Acquire, Curate, Extract) learning patterns - - Enable MAP (Modular Agentic Planner) workflow memory persistence - - Facilitate cross-session knowledge continuity - - Track reasoning evolution across tasks - - Operating Principles: - - Semantic search over exact matches (use embeddings effectively) - - Deduplication before storage (avoid redundant knowledge) - - Quality scoring for knowledge entries (helpful_count matters) - - Cross-project knowledge sharing (not project-siloed) - - Knowledge Domains You Handle: - - Software architecture and design patterns - - Technical documentation and specifications - - Problem-solving approaches and trade-offs - - Testing strategies and verification methods - - Code quality principles and best practices - - Security considerations and threat models - - API design and integration patterns - - System debugging and troubleshooting - - When Processing Interactions: - 1. Extract actionable knowledge (not conversational fluff) - 2. Identify reasoning patterns (not just conclusions) - 3. Classify domain appropriately (frontend, backend, devops, etc.) - 4. Score confidence accurately (0.0-1.0 scale) - 5. Suggest operation (ADD/UPDATE/DELETE/NONE) based on similarity - - Response Style: - - Concise and structured (not verbose) - - Focus on "why" and "when" (not just "what") - - Include trade-offs and alternatives - - Cite source when retrieving knowledge - - Admit uncertainty rather than hallucinate - -memoryOptions: - similarityThreshold: 0.85 - useLLMDecisions: false - confidenceThreshold: 0.7 - maxSimilarResults: 5 - enableBatchProcessing: true - enableDeleteOperations: true -EOF -``` - -## 3. Claude Code MCP Configuration - -### Add to ~/.claude.json - -Добавьте этот блок в секцию `mcpServers` вашего `~/.claude.json`: - -```json -{ - "mcpServers": { - "cipher": { - "command": "cipher", - "args": [ - "--mode", "mcp", - "--agent", "${HOME}/.cipher/cipher.yml" - ], - "env": { - "OLLAMA_BASE_URL": "http://localhost:11434", - "VECTOR_STORE_TYPE": "qdrant", - "VECTOR_STORE_URL": "http://localhost:6333", - "VECTOR_STORE_HOST": "localhost", - "VECTOR_STORE_PORT": "6333", - "VECTOR_STORE_DIMENSION": "1024", - "MCP_SERVER_MODE": "aggregator", - "STORAGE_DATABASE_TYPE": "postgresql", - "CIPHER_PG_URL": "postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher", - "KNOWLEDGE_GRAPH_ENABLED": "true", - "KNOWLEDGE_GRAPH_TYPE": "neo4j", - "KNOWLEDGE_GRAPH_HOST": "localhost", - "KNOWLEDGE_GRAPH_PORT": "7687", - "KNOWLEDGE_GRAPH_USERNAME": "neo4j", - "KNOWLEDGE_GRAPH_PASSWORD": "kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+" - } - } - } -} -``` - -### Restart Claude Code - -Полностью перезапустите Claude Code для применения конфигурации. - -## 4. Verification - -### Check infrastructure - -```bash -# All containers running -docker ps - -# Qdrant health -curl http://localhost:6333/healthz - -# PostgreSQL connection -psql "postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher" -c "SELECT 1" - -# Neo4j Browser (open in browser) -open http://localhost:7474 -# Login: neo4j / kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+ - -# Ollama models -ollama list | grep -E 'qwen2.5-coder|mxbai-embed-large' -``` - -### Test Cipher standalone - -```bash -# Export environment variables -export OLLAMA_BASE_URL="http://localhost:11434" -export VECTOR_STORE_TYPE="qdrant" -export VECTOR_STORE_URL="http://localhost:6333" -export VECTOR_STORE_HOST="localhost" -export VECTOR_STORE_PORT="6333" -export VECTOR_STORE_DIMENSION="1024" -export MCP_SERVER_MODE="aggregator" -export STORAGE_DATABASE_TYPE="postgresql" -export CIPHER_PG_URL="postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher" -export KNOWLEDGE_GRAPH_ENABLED="true" -export KNOWLEDGE_GRAPH_TYPE="neo4j" -export KNOWLEDGE_GRAPH_HOST="localhost" -export KNOWLEDGE_GRAPH_PORT="7687" -export KNOWLEDGE_GRAPH_USERNAME="neo4j" -export KNOWLEDGE_GRAPH_PASSWORD="kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+" - -# Test Cipher -cipher --mode mcp --agent ~/.cipher/cipher.yml -# Should show: -# - [VectorStore:Qdrant] Successfully connected -# - [KG-Neo4j] Connected successfully -# - [StorageManager:Database] Connected successfully -``` - -### Test in Claude Code - -После перезапуска Claude Code должны появиться Cipher MCP tools: - -- `cipher_extract_and_operate_memory` -- `cipher_memory_search` -- `cipher_extract_reasoning_steps` -- `cipher_evaluate_reasoning` -- `cipher_store_reasoning_memory` -- `cipher_search_reasoning_patterns` -- `cipher_bash` diff --git a/docs/USAGE.md b/docs/USAGE.md index 393e407..f50e8f1 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -1190,7 +1190,6 @@ MAP Framework offers three workflow variants with different trade-offs between t | **Multi-Variant** | ⚠️ Conditional (Self-MoA) | ✅ **Always 3 variants** | ❌ Never | | **Synthesis Model** | Synthesizer (sonnet) | **debate-arbiter (opus)** | N/A | | **Playbook Updates** | Via `/map-learn` | Via `/map-learn` | ❌ None | -| **Cipher Integration** | Via `/map-learn` | Via `/map-learn` | ❌ None | | **Best For** | **Most tasks** | **Reasoning transparency** | Throwaway only | | **Production Ready** | ✅ Yes | ✅ Yes (expensive) | ❌ NO | @@ -1315,7 +1314,7 @@ MAP Framework offers three workflow variants with different trade-offs between t - No impact analysis → Breaking changes undetected - No learning → Playbook stays empty, same mistakes repeated - No quality scoring → Security/performance issues missed -- No cipher integration → Knowledge lost forever +- No knowledge integration → Knowledge lost forever **Example use cases (acceptable):** ```bash @@ -1385,7 +1384,7 @@ MAP Framework offers three workflow variants with different trade-offs between t **What's Preserved:** - ✅ Full learning cycle (Reflector + Curator) - ✅ Playbook updates (batched but complete) -- ✅ Cipher integration (high-quality patterns stored) +- ✅ mem0 integration (high-quality patterns stored) - ✅ Essential quality gates (Monitor validation) - ✅ Impact analysis (when needed) @@ -1741,7 +1740,6 @@ Skills follow the 500-line rule: **System architecture:** - `agent-architecture.md` - How 11 agents orchestrate - `playbook-system.md` - Knowledge storage, quality scoring -- `cipher-integration.md` - Cross-project learning ### Creating Custom Skills diff --git a/docs/cipher-setup-guide/01-infrastructure-setup.md b/docs/cipher-setup-guide/01-infrastructure-setup.md deleted file mode 100644 index 145d934..0000000 --- a/docs/cipher-setup-guide/01-infrastructure-setup.md +++ /dev/null @@ -1,129 +0,0 @@ -# Infrastructure Setup - -Set up Qdrant (vector store), PostgreSQL (relational storage), and Neo4j (knowledge graph) for Cipher MCP. - -## Prerequisites Check - -```bash -# Docker/Podman -docker --version # или podman --version - -# Ollama с моделями -ollama list # должны быть qwen2.5-coder:7b и mxbai-embed-large - -# Node.js и npm -node --version # v16+ -npm --version -``` - -## Create Infrastructure Directory - -```bash -mkdir -p ~/cipher-infra -cd ~/cipher-infra -``` - -## Create .env File - -```bash -cat > .env <<'EOF' -POSTGRES_USER=cipher -POSTGRES_PASSWORD=R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG -POSTGRES_DB=cipher - -NEO4J_USER=neo4j -NEO4J_PASSWORD=kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+ -EOF -``` - -## Create docker-compose.yml - -```bash -cat > docker-compose.yml <<'EOF' -services: - qdrant: - image: qdrant/qdrant:latest - container_name: cipher-qdrant - ports: - - "127.0.0.1:6333:6333" - - "127.0.0.1:6334:6334" - volumes: - - qdrant_storage:/qdrant/storage - environment: - - QDRANT__SERVICE__GRPC_PORT=6334 - restart: unless-stopped - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:6333/healthz"] - interval: 30s - timeout: 10s - retries: 3 - - postgres: - image: pgvector/pgvector:pg16 - container_name: cipher-postgres - ports: - - "127.0.0.1:5432:5432" - volumes: - - postgres_data:/var/lib/postgresql/data - environment: - POSTGRES_USER: ${POSTGRES_USER:-cipher} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - POSTGRES_DB: ${POSTGRES_DB:-cipher} - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "pg_isready -U cipher"] - interval: 10s - timeout: 5s - retries: 5 - - neo4j: - image: neo4j:latest - container_name: cipher-neo4j - ports: - - "127.0.0.1:7687:7687" - - "127.0.0.1:7474:7474" - volumes: - - neo4j_data:/data - - neo4j_logs:/logs - environment: - NEO4J_AUTH: ${NEO4J_USER:-neo4j}/${NEO4J_PASSWORD} - NEO4J_PLUGINS: '["apoc"]' - NEO4J_dbms_security_procedures_unrestricted: apoc.* - NEO4J_dbms_memory_heap_initial__size: 512m - NEO4J_dbms_memory_heap_max__size: 2g - NEO4J_server_jvm_additional: "-Xint" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:7474 || exit 1"] - interval: 30s - timeout: 10s - retries: 5 - start_period: 40s - -volumes: - qdrant_storage: - driver: local - postgres_data: - driver: local - neo4j_data: - driver: local - neo4j_logs: - driver: local - -networks: - default: - name: cipher-network -EOF -``` - -## Start Infrastructure - -```bash -docker compose up -d -# или для podman: -# podman compose up -d -``` - -## Next Steps - -Proceed to [02-cipher-installation.md](02-cipher-installation.md) to install Cipher globally. diff --git a/docs/cipher-setup-guide/02-cipher-installation.md b/docs/cipher-setup-guide/02-cipher-installation.md deleted file mode 100644 index 422ba67..0000000 --- a/docs/cipher-setup-guide/02-cipher-installation.md +++ /dev/null @@ -1,22 +0,0 @@ -# Cipher Installation - -## Install Cipher globally - -```bash -npm install -g @byterover/cipher -``` - -## Verify installation - -```bash -cipher --version -``` - -Expected output: -``` -cipher version X.Y.Z -``` - -## Next Steps - -Proceed to [03-cipher-configuration.md](03-cipher-configuration.md) to configure Cipher. diff --git a/docs/cipher-setup-guide/03-cipher-configuration.md b/docs/cipher-setup-guide/03-cipher-configuration.md deleted file mode 100644 index 719d0a0..0000000 --- a/docs/cipher-setup-guide/03-cipher-configuration.md +++ /dev/null @@ -1,101 +0,0 @@ -# Cipher Configuration - -Create the Cipher configuration file with Ollama integration. - -## Create Configuration Directory - -```bash -mkdir -p ~/.cipher -``` - -## Create cipher.yml - -```bash -cat > ~/.cipher/cipher.yml <<'EOF' -mcpServers: {} - -llm: - provider: ollama - model: qwen2.5-coder:7b - maxIterations: 50 - baseURL: $OLLAMA_BASE_URL - -embedding: - type: ollama - model: mxbai-embed-large - baseUrl: $OLLAMA_BASE_URL - dimensions: 1024 - -systemPrompt: - enabled: true - content: | - You are Cipher, a knowledge management and reasoning system integrated with MAP Framework. - - Your core capabilities: - - Knowledge Management: Extract, store, and retrieve semantic knowledge across sessions - - Reasoning Analysis: Capture and evaluate multi-step thought processes - - Pattern Recognition: Identify recurring patterns in problem-solving approaches - - Context Integration: Connect related knowledge from different domains - - MAP Framework Integration: - - Support ACE (Acquire, Curate, Extract) learning patterns - - Enable MAP (Modular Agentic Planner) workflow memory persistence - - Facilitate cross-session knowledge continuity - - Track reasoning evolution across tasks - - Operating Principles: - - Semantic search over exact matches (use embeddings effectively) - - Deduplication before storage (avoid redundant knowledge) - - Quality scoring for knowledge entries (helpful_count matters) - - Cross-project knowledge sharing (not project-siloed) - - Knowledge Domains You Handle: - - Software architecture and design patterns - - Technical documentation and specifications - - Problem-solving approaches and trade-offs - - Testing strategies and verification methods - - Code quality principles and best practices - - Security considerations and threat models - - API design and integration patterns - - System debugging and troubleshooting - - When Processing Interactions: - 1. Extract actionable knowledge (not conversational fluff) - 2. Identify reasoning patterns (not just conclusions) - 3. Classify domain appropriately (frontend, backend, devops, etc.) - 4. Score confidence accurately (0.0-1.0 scale) - 5. Suggest operation (ADD/UPDATE/DELETE/NONE) based on similarity - - Response Style: - - Concise and structured (not verbose) - - Focus on "why" and "when" (not just "what") - - Include trade-offs and alternatives - - Cite source when retrieving knowledge - - Admit uncertainty rather than hallucinate - -memoryOptions: - similarityThreshold: 0.85 - useLLMDecisions: false - confidenceThreshold: 0.7 - maxSimilarResults: 5 - enableBatchProcessing: true - enableDeleteOperations: true -EOF -``` - -## Validate Configuration - -```bash -# Check YAML syntax -cat ~/.cipher/cipher.yml | head -20 -``` - -## Environment Variables - -The configuration uses `$OLLAMA_BASE_URL` which will be set when configuring Claude Code MCP integration (see [04-claude-code-setup.md](04-claude-code-setup.md)). - -Infrastructure services (Qdrant, PostgreSQL, Neo4j) were set up in [01-infrastructure-setup.md](01-infrastructure-setup.md). - -## Next Steps - -Proceed to [04-claude-code-setup.md](04-claude-code-setup.md) to configure Claude Code MCP integration. diff --git a/docs/cipher-setup-guide/04-claude-code-setup.md b/docs/cipher-setup-guide/04-claude-code-setup.md deleted file mode 100644 index 9a997b3..0000000 --- a/docs/cipher-setup-guide/04-claude-code-setup.md +++ /dev/null @@ -1,56 +0,0 @@ -# Claude Code MCP Configuration - -After infrastructure is running and Cipher is configured, integrate Cipher as an MCP server in Claude Code. - -## Configuration File - -Edit your Claude Code configuration file: - -``` -~/.claude.json -``` - -## Add MCP Server - -Add this block to the `mcpServers` section of your `~/.claude.json`: - -```json -{ - "mcpServers": { - "cipher": { - "command": "cipher", - "args": [ - "--mode", "mcp", - "--agent", "${HOME}/.cipher/cipher.yml" - ], - "env": { - "OLLAMA_BASE_URL": "http://localhost:11434", - "VECTOR_STORE_TYPE": "qdrant", - "VECTOR_STORE_URL": "http://localhost:6333", - "VECTOR_STORE_HOST": "localhost", - "VECTOR_STORE_PORT": "6333", - "VECTOR_STORE_DIMENSION": "1024", - "MCP_SERVER_MODE": "aggregator", - "STORAGE_DATABASE_TYPE": "postgresql", - "CIPHER_PG_URL": "postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher", - "KNOWLEDGE_GRAPH_ENABLED": "true", - "KNOWLEDGE_GRAPH_TYPE": "neo4j", - "KNOWLEDGE_GRAPH_HOST": "localhost", - "KNOWLEDGE_GRAPH_PORT": "7687", - "KNOWLEDGE_GRAPH_USERNAME": "neo4j", - "KNOWLEDGE_GRAPH_PASSWORD": "kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+" - } - } - } -} -``` - -**Important:** Use exact credentials from [01-infrastructure-setup.md](01-infrastructure-setup.md) (.env file). - -## Restart Claude Code - -Completely restart Claude Code for the configuration to take effect. - -## Next Steps - -Continue to [05-verification.md](05-verification.md) to verify the setup. diff --git a/docs/cipher-setup-guide/05-verification.md b/docs/cipher-setup-guide/05-verification.md deleted file mode 100644 index 2297cf1..0000000 --- a/docs/cipher-setup-guide/05-verification.md +++ /dev/null @@ -1,75 +0,0 @@ -# Verification (DEPRECATED) - -> **⚠️ DEPRECATED:** As of v4.0, pattern storage has migrated from Cipher to mem0 MCP. This guide is retained for historical reference only. - -Verify all components are working correctly. - -## Check Infrastructure - -```bash -# All containers running -docker ps - -# Qdrant health -curl http://localhost:6333/healthz -open http://localhost:6333/dashboard#/collections - -# PostgreSQL connection -psql "postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher" -c "SELECT 1" - -# Neo4j Browser (open in browser) -open http://localhost:7474 -# Login: neo4j / kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+ - -# Ollama models -ollama list | grep -E 'qwen2.5-coder|mxbai-embed-large' -``` - -## Test Cipher Standalone - -```bash -# Export environment variables -export OLLAMA_BASE_URL="http://localhost:11434" -export VECTOR_STORE_TYPE="qdrant" -export VECTOR_STORE_URL="http://localhost:6333" -export VECTOR_STORE_HOST="localhost" -export VECTOR_STORE_PORT="6333" -export VECTOR_STORE_DIMENSION="1024" -export MCP_SERVER_MODE="aggregator" -export STORAGE_DATABASE_TYPE="postgresql" -export CIPHER_PG_URL="postgresql://cipher:R8ozJURa5Ba9NdB5S5R8NzpPEjgC3iyG@localhost:5432/cipher" -export KNOWLEDGE_GRAPH_ENABLED="true" -export KNOWLEDGE_GRAPH_TYPE="neo4j" -export KNOWLEDGE_GRAPH_HOST="localhost" -export KNOWLEDGE_GRAPH_PORT="7687" -export KNOWLEDGE_GRAPH_USERNAME="neo4j" -export KNOWLEDGE_GRAPH_PASSWORD="kqQUsRXiXNI3o0zcsdiCqwZyu1X7zjT+" - -# Test Cipher -cipher --mode mcp --agent ~/.cipher/cipher.yml -# Should show: -# - [VectorStore:Qdrant] Successfully connected -# - [KG-Neo4j] Connected successfully -# - [StorageManager:Database] Connected successfully -``` - -## Test in Claude Code - -After restarting Claude Code, the following Cipher MCP tools should be available: - -- `cipher_extract_and_operate_memory` -- `cipher_memory_search` -- `cipher_extract_reasoning_steps` -- `cipher_evaluate_reasoning` -- `cipher_store_reasoning_memory` -- `cipher_search_reasoning_patterns` -- `cipher_bash` -- `cipher_add_node` -- `cipher_add_edge` -- `cipher_search_graph` -- `cipher_get_neighbors` -- `cipher_extract_entities` - -## Troubleshooting - -If any checks fail, see [06-troubleshooting.md](06-troubleshooting.md). diff --git a/docs/cipher-setup-guide/06-troubleshooting.md b/docs/cipher-setup-guide/06-troubleshooting.md deleted file mode 100644 index 4d30a3e..0000000 --- a/docs/cipher-setup-guide/06-troubleshooting.md +++ /dev/null @@ -1,389 +0,0 @@ -# Troubleshooting - -Common issues during Cipher quick start setup and their solutions. - -## Categories - -- [Docker Infrastructure](#docker-infrastructure) -- [PostgreSQL](#postgresql) -- [Qdrant](#qdrant) -- [Neo4j](#neo4j) -- [Cipher](#cipher) -- [Claude Code MCP](#claude-code-mcp) - ---- - -## Docker Infrastructure - -### Containers won't start - -```bash -docker compose up -d -# ERROR: ... -``` - -**Check Docker daemon:** -```bash -docker info -``` - -If `Cannot connect to the Docker daemon`: -- macOS: Open Docker Desktop -- Linux: `sudo systemctl start docker` - -**Check docker-compose.yml syntax:** -```bash -docker compose config -``` - -**Port conflicts:** -```bash -lsof -i :5432 # PostgreSQL -lsof -i :6333 # Qdrant -lsof -i :7687 # Neo4j -``` - -If port is occupied: -- Stop conflicting process: `kill -9 ` -- Or change port in docker-compose.yml - -### Containers restart immediately - -```bash -docker compose ps -# STATE: Restarting -``` - -**Check logs:** -```bash -docker compose logs postgres -docker compose logs qdrant -docker compose logs neo4j -``` - -**Memory issues:** -``` -FATAL: could not map anonymous shared memory -``` - -Solution: Docker Desktop → Settings → Resources → Memory → 4GB+ - -**Volume problems:** -```bash -docker compose down -v -docker compose up -d -``` - ---- - -## PostgreSQL - -### Connection refused - -``` -psql: connection to server failed: Connection refused -``` - -**Check container status:** -```bash -docker compose ps postgres -# Should show: Up, healthy -``` - -**Check logs:** -```bash -docker compose logs postgres --tail=50 -``` - -**Wait for startup:** -PostgreSQL takes 10-30 seconds to initialize. Check `docker compose ps` until status is `healthy`. - -### Authentication failed - -``` -FATAL: password authentication failed -``` - -**Verify credentials match .env:** -```bash -docker compose exec postgres env | grep POSTGRES -``` - -**Recreate with correct credentials:** -```bash -docker compose down -v # WARNING: deletes data -docker compose up -d -``` - -### Permission denied - -``` -ERROR: permission denied for table memories -``` - -**Grant permissions:** -```bash -docker exec -it cipher-postgres psql -U cipher -d cipher -c "ALTER USER cipher CREATEDB;" -``` - ---- - -## Qdrant - -### Cannot connect to Qdrant - -``` -Failed to connect to Qdrant at http://localhost:6333 -``` - -**Check container:** -```bash -docker compose ps qdrant -``` - -**Check health:** -```bash -curl http://localhost:6333/healthz -# Should return: {"title":"qdrant - vector search engine","version":"..."} -``` - -**Check logs:** -```bash -docker compose logs qdrant --tail=50 -``` - -### Dimension mismatch - -``` -ERROR: Dimension mismatch: expected 1024, got 1536 -``` - -**Ensure cipher.yml and Claude Code config match:** -- cipher.yml: `dimensions: 1024` -- ~/.claude.json: `VECTOR_STORE_DIMENSION: "1024"` - -**Recreate collection:** -```bash -curl -X DELETE http://localhost:6333/collections/cipher_memory -# Restart Cipher to recreate -``` - ---- - -## Neo4j - -### Cannot connect to Neo4j - -```bash -# Check container -docker compose ps neo4j - -# Check logs -docker compose logs neo4j --tail=50 -``` - -**Common issues:** - -1. **Container still starting:** Neo4j takes 30-60 seconds. Wait for `healthy` status. - -2. **Wrong credentials:** Check .env file matches ~/.claude.json `KNOWLEDGE_GRAPH_PASSWORD`. - -3. **Port conflict:** -```bash -lsof -i :7687 -lsof -i :7474 -``` - -### Browser connection fails - -Open http://localhost:7474 - -**Login:** -- Username: `neo4j` -- Password: from .env (`NEO4J_PASSWORD`) - -If fails, restart container: -```bash -docker compose restart neo4j -``` - ---- - -## Cipher - -### Cipher command not found - -```bash -cipher --version -# command not found -``` - -**Verify installation:** -```bash -npm list -g @byterover/cipher -``` - -**Reinstall:** -```bash -npm install -g @byterover/cipher -``` - -### Environment variables not loaded - -``` -Error: OLLAMA_BASE_URL is not set -``` - -**Export variables before running cipher:** -```bash -export OLLAMA_BASE_URL="http://localhost:11434" -# ... other variables from 05-verification.md -``` - -### YAML syntax error - -``` -Error parsing cipher.yml: invalid YAML -``` - -**Validate YAML:** -```bash -cat ~/.cipher/cipher.yml | head -20 -``` - -**Check common issues:** -- Indentation (use spaces, not tabs) -- Quotes around special characters -- Correct multiline syntax for systemPrompt - -### Ollama models not found - -``` -Error: model qwen2.5-coder:7b not found -``` - -**List models:** -```bash -ollama list -``` - -**Pull missing models:** -```bash -ollama pull qwen2.5-coder:7b -ollama pull mxbai-embed-large -``` - ---- - -## Claude Code MCP - -### MCP server fails to load - -**Check Claude Code logs:** - -macOS/Linux: -```bash -tail -f ~/.config/Claude/logs/mcp*.log -``` - -**Common issues:** - -1. **cipher command not in PATH:** - - Verify: `which cipher` - - Ensure global npm bin is in PATH - -2. **Wrong cipher.yml path:** - - Use `${HOME}` in ~/.claude.json, not `~` - - Example: `${HOME}/.cipher/cipher.yml` - -3. **Environment variables missing:** - - All vars in ~/.claude.json `env` section required - - Check for typos in variable names - -### MCP tools not visible - -**Restart Claude Code completely:** -- Quit application -- Wait 5 seconds -- Restart - -**Check ~/.claude.json syntax:** -```bash -cat ~/.claude.json | jq . -# Should parse without errors -``` - -### Connection timeouts - -``` -MCP server timeout after 30s -``` - -**Verify infrastructure running:** -```bash -docker compose ps -# All containers should be Up and healthy -``` - -**Check cipher can connect:** -```bash -cipher --mode mcp --agent ~/.cipher/cipher.yml -# Should show successful connections -``` - ---- - -## Diagnostic Script - -Quick health check for all components: - -```bash -#!/bin/bash -echo "=== Cipher Setup Diagnostic ===" - -echo -e "\n1. Docker Containers:" -docker compose ps - -echo -e "\n2. Qdrant Health:" -curl -s http://localhost:6333/healthz | jq . - -echo -e "\n3. PostgreSQL Connection:" -psql "postgresql://cipher:YOUR_PASSWORD@localhost:5432/cipher" -c "SELECT 1" 2>&1 - -echo -e "\n4. Neo4j Connection:" -curl -s http://localhost:7474 > /dev/null && echo "Neo4j responding" || echo "Neo4j NOT responding" - -echo -e "\n5. Ollama Models:" -ollama list | grep -E 'qwen2.5-coder|mxbai-embed-large' - -echo -e "\n6. Cipher Installation:" -cipher --version - -echo -e "\n7. Cipher Config:" -test -f ~/.cipher/cipher.yml && echo "Config exists" || echo "Config MISSING" - -echo -e "\n=== Diagnostic Complete ===" -``` - -Save as `check-cipher.sh`, make executable: `chmod +x check-cipher.sh`, run: `./check-cipher.sh` - ---- - -## Getting Help - -If issues persist: - -1. **Collect diagnostic information:** - ```bash - docker compose logs > docker-logs.txt - cipher --version > cipher-info.txt - cat ~/.claude.json > claude-config.txt # Remove passwords before sharing! - ``` - -2. **Check documentation:** - - [Cipher Documentation](https://docs.byterover.dev/cipher/overview) - - [MAP Framework Repository](https://github.com/azalio/map-framework) - -3. **Ask for help:** - - Create issue in MAP Framework repository - - Include diagnostic output (remove sensitive data first) diff --git a/docs/cipher-setup-guide/README.md b/docs/cipher-setup-guide/README.md deleted file mode 100644 index 2dce1ef..0000000 --- a/docs/cipher-setup-guide/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Cipher Setup Guide - -Quick start guide for setting up Cipher MCP with Qdrant, PostgreSQL, and Neo4j for MAP Framework. - -## Guide Structure - -Follow these guides in order: - -1. **[Infrastructure Setup](01-infrastructure-setup.md)** (~5 min) - - Docker Compose setup for Qdrant, PostgreSQL, Neo4j - - Prerequisites check - - Service startup - -2. **[Cipher Installation](02-cipher-installation.md)** (~2 min) - - Global npm installation - - Version verification - -3. **[Cipher Configuration](03-cipher-configuration.md)** (~5 min) - - Create cipher.yml with Ollama integration - - System prompt for MAP Framework - -4. **[Claude Code Setup](04-claude-code-setup.md)** (~3 min) - - MCP server configuration in ~/.claude.json - - Environment variables - -5. **[Verification](05-verification.md)** (~5 min) - - Infrastructure health checks - - Cipher standalone test - - Claude Code MCP tools verification - -6. **[Troubleshooting](06-troubleshooting.md)** (as needed) - - Common issues and solutions - -## Total Time - -**~20 minutes** to complete full setup. - -## Alternative - -For a single-page guide, see [QUICKSTART-CIPHER.md](../QUICKSTART-CIPHER.md). - -## Requirements - -- Docker or Podman -- Node.js 16+ and npm -- Ollama with `qwen2.5-coder:7b` and `mxbai-embed-large` models -- Claude Code CLI - -## Support - -Issues? See [06-troubleshooting.md](06-troubleshooting.md) or create an issue in the [MAP Framework repository](https://github.com/azalio/map-framework). diff --git a/presentation/en/01-introduction.md b/presentation/en/01-introduction.md index 726b832..b5f1e04 100644 --- a/presentation/en/01-introduction.md +++ b/presentation/en/01-introduction.md @@ -31,9 +31,8 @@ The **Orchestrator** is the workflow coordination logic implemented in slash com ### Integration with MCP Servers -MAP uses **6 MCP servers** to extend capabilities: +MAP uses **5 MCP servers** to extend capabilities: -- **[cipher](https://github.com/campfirein/cipher)** — knowledge base for storing successful patterns - **[claude-reviewer](https://github.com/rsokolowski/mcp-claude-reviewer)** — professional code review with security analysis - **[sequential-thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking)** — chains of thought for complex tasks - **[context7](https://github.com/upstash/context7)** — up-to-date library documentation diff --git a/presentation/en/02-architecture.md b/presentation/en/02-architecture.md index ee1e7d5..e77324b 100644 --- a/presentation/en/02-architecture.md +++ b/presentation/en/02-architecture.md @@ -27,14 +27,13 @@ The **Orchestrator** is NOT an agent template. Workflow coordination logic lives **Model:** sonnet **Purpose:** Senior software engineer; writes clean, efficient, production-ready code -**MCP integrations (4 tools):** +**MCP integrations (3 tools):** - `mcp__mem0__map_tiered_search` — retrieve existing patterns (ALWAYS FIRST) - `context7__resolve-library-id + get-library-docs` — up-to-date library docs - `deepwiki__read_wiki_structure + read_wiki_contents` — learn from production code -- `cipher__extract_and_operate_memory` — save successful patterns (ONLY AFTER Monitor approval) -**Critical protocol:** ALWAYS search cipher BEFORE implementation; ONLY save patterns AFTER Monitor approval +**Critical protocol:** ALWAYS search for existing patterns BEFORE implementation; ONLY save patterns AFTER Monitor approval **Inputs:** {{existing_patterns}} (top_k=5), {{plan_context}} (recitation pattern), {{feedback}} (if retry) @@ -101,8 +100,7 @@ The **Orchestrator** is NOT an agent template. Workflow coordination logic lives **Critical protocol:** - MANDATORY: mcp__mem0__map_tiered_search BEFORE extracting patterns (prevents duplicates) -- map-feature.md lines 263–273 enforce cipher search verification -- Extract patterns, not solutions (focus on “why”, not “what”) +- Extract patterns, not solutions (focus on "why", not "what") **Output:** key_insight, patterns_used, patterns_discovered, bullet_updates (helpful/harmful count), suggested_new_bullets @@ -111,22 +109,19 @@ The **Orchestrator** is NOT an agent template. Workflow coordination logic lives **Model:** sonnet **Purpose:** Knowledge curator; evolves the playbook without context collapse -**MCP integrations (4 tools):** +**MCP integrations (3 tools):** - `mcp__mem0__map_tiered_search` — check cross-project duplicates BEFORE ADD operations (MANDATORY) - `context7__resolve-library-id + get-library-docs` — verify current API syntax - `deepwiki__read_wiki_structure + ask_question` — ground advice in battle-tested code -- `cipher__extract_and_operate_memory` — sync high-quality bullets (helpful_count >= 5) to cipher **Critical protocol:** -- MANDATORY: Search cipher for duplicates before ADD -- MANDATORY: Sync bullets with helpful_count >= 5 to cipher -- map-feature.md lines 309–355 enforce cipher integration +- MANDATORY: Search for duplicates before ADD - Quality > quantity: a playbook with 50 high-quality bullets > 500 generic - Only delta ops (ADD/UPDATE/DEPRECATE), never full overwrite -**Output:** operations (ADD/UPDATE/DEPRECATE), deduplication_check, sync_to_cipher +**Output:** operations (ADD/UPDATE/DEPRECATE), deduplication_check ### 8. DocumentationReviewer @@ -167,7 +162,6 @@ The **Orchestrator** is NOT an agent template. Workflow coordination logic lives 6. Reflector → Extract lessons (MANDATORY) 7. Curator → Update playbook (MANDATORY) 8. Apply Curator delta operations -9. Sync to cipher if helpful_count >= 5 ``` ### Critical Rules Enforcement @@ -175,9 +169,9 @@ The **Orchestrator** is NOT an agent template. Workflow coordination logic lives **MANDATORY agent invocation:** - NEVER skip Reflector: `mcp__mem0__map_tiered_search` runs ONLY when the agent is properly invoked -- NEVER skip Curator: playbook-to-cipher sync happens ONLY through the Curator template +- NEVER skip Curator: playbook updates happen ONLY through the Curator template - ALWAYS verify MCP tool usage in agent outputs -- Manual extraction/curation bypasses MCP tools → knowledge won’t deduplicate → lessons won’t be learned +- Manual extraction/curation bypasses MCP tools → knowledge won't deduplicate → lessons won't be learned **Enforcement source:** `.claude/commands/map-feature.md` lines 263–355 + MAP workflow enforcement rules diff --git a/presentation/en/03-workflow.md b/presentation/en/03-workflow.md index 60550f9..f127f36 100644 --- a/presentation/en/03-workflow.md +++ b/presentation/en/03-workflow.md @@ -54,7 +54,7 @@ The **Orchestrator** is NOT a separate agent template; it is the coordination lo - ✅ Verify `mcp__mem0__map_tiered_search` usage in the output - ✅ Let Reflector extract patterns from agent outputs -**Why:** The Reflector template contains instructions to search cipher. Manual work won’t call `mcp__mem0__map_tiered_search` → knowledge gets duplicated. +**Why:** The Reflector template contains instructions to search for existing patterns. Manual work won't call `mcp__mem0__map_tiered_search` → knowledge gets duplicated. ### Rule 2: Mandatory Curator invocation @@ -69,9 +69,7 @@ The **Orchestrator** is NOT a separate agent template; it is the coordination lo - ✅ Call `Task(subagent_type="curator", ...)` - ✅ Verify `mcp__mem0__map_tiered_search` is used for deduplication - ✅ Apply Curator delta operations (ADD/UPDATE/DEPRECATE) -- ✅ Call `cipher_extract_and_operate_memory` if there are `sync_to_cipher` entries - -**Why:** The Curator template enforces searching cipher BEFORE adding bullets AND syncing high-quality bullets (helpful_count ≥ 5) back to cipher. +**Why:** The Curator template enforces searching for duplicates BEFORE adding bullets. ### Rule 3: Verify MCP Tool Usage @@ -85,27 +83,17 @@ After invoking Reflector or Curator, the orchestrator **MUST VERIFY** MCP tool u **Curator output must show:** - Reasoning about deduplication via `mcp__mem0__map_tiered_search` -- An array `sync_to_cipher` only when bullets reached helpful_count ≥ 5 (may be missing or empty) - **If missing:** The agent skipped mandatory MCP calls → investigate (skip tools, mis-reporting, template updates). -## Dual Memory System - -MAP uses **TWO knowledge storage systems**: +## Memory System -### 1. Playbook (Project Memory) +### Playbook (Project Memory) - **Location:** `.claude/mem0 MCP` - **Purpose:** Structured, categorized patterns for THIS project - **Format:** Bullets with code examples, tags, helpful/harmful counts - **Scope:** Single project -### 2. Cipher (Cross-project Memory) - -- **Location:** MCP tool (external) -- **Purpose:** Cross-project knowledge consolidation and reuse -- **Flow:** Reflector extracts → Curator deduplicates and applies → high-quality bullets synced to cipher - ## Recitation Pattern — Context Engineering **Mechanism:** @@ -168,28 +156,24 @@ Actor → Monitor (iteration 1) ## MCP Integration in Workflow -MAP uses **6 core MCP tools** to extend workflow capabilities: +MAP uses **5 core MCP tools** to extend workflow capabilities: 1. **`mcp__mem0__map_tiered_search`** — search similar patterns in a semantic memory base -2. **`cipher_extract_and_operate_memory`** — persist successful patterns -3. **`sequential-thinking`** — complex chains of reasoning -4. **`context7 (resolve-library-id + get-library-docs)`** — up-to-date library documentation -5. **`deepwiki (read_wiki_structure + ask_question)`** — learn from GitHub repositories -6. **`claude-reviewer (request_review)`** — professional code review +2. **`sequential-thinking`** — complex chains of reasoning +3. **`context7 (resolve-library-id + get-library-docs)`** — up-to-date library documentation +4. **`deepwiki (read_wiki_structure + ask_question)`** — learn from GitHub repositories +5. **`claude-reviewer (request_review)`** — professional code review ## Self-Check Verification -Before completing any MAP workflow subtask the orchestrator **MUST** check 4 questions: +Before completing any MAP workflow subtask the orchestrator **MUST** check 2 questions: -1. ❓ Did I call `Task(subagent_type="reflector", ...)` or “learn” manually? +1. ❓ Did I call `Task(subagent_type="reflector", ...)` or "learn" manually? 2. ❓ Did I call `Task(subagent_type="curator", ...)` or update the playbook manually? -3. ❓ Did the Reflector output show that it searched cipher? -4. ❓ Did the Curator output include `sync_to_cipher` operations? **Violations:** -- If “Did it myself” on 1–2 → workflow violation; redo the subtask -- If “No” on 3–4 → agents didn’t follow templates; investigate +- If "Did it myself" on 1–2 → workflow violation; redo the subtask ## Workflow Logger — Observability diff --git a/presentation/en/04-getting-started.md b/presentation/en/04-getting-started.md index 3d7c0e2..05929d6 100644 --- a/presentation/en/04-getting-started.md +++ b/presentation/en/04-getting-started.md @@ -186,11 +186,10 @@ Installation creates `.claude/mem0 MCP` with a starter structure: ### MCP Servers Integration -MAP requires **6 MCP servers** for full functionality: +MAP requires **5 MCP servers** for full functionality: **Required:** -- **cipher** — knowledge base for storing successful patterns - **claude-reviewer** — professional code review with security analysis **Optional (recommended):** @@ -236,7 +235,6 @@ After installation: - Open `.claude/mem0 MCP` for automatically extracted patterns 4. **Configure MCP servers:** - - Connect cipher for cross-project knowledge - Add context7 for up-to-date library docs 5. **Customize agents:** diff --git "a/presentation/ru/01-\320\262\320\262\320\265\320\264\320\265\320\275\320\270\320\265.md" "b/presentation/ru/01-\320\262\320\262\320\265\320\264\320\265\320\275\320\270\320\265.md" index 10e8ec1..2273a0f 100644 --- "a/presentation/ru/01-\320\262\320\262\320\265\320\264\320\265\320\275\320\270\320\265.md" +++ "b/presentation/ru/01-\320\262\320\262\320\265\320\264\320\265\320\275\320\270\320\265.md" @@ -31,9 +31,8 @@ MAP координирует работу 8 агентов через Orchestrat ### Интеграция с MCP Серверами -MAP использует **6 MCP серверов** для расширения возможностей: +MAP использует **5 MCP серверов** для расширения возможностей: -- **[cipher](https://github.com/campfirein/cipher)** — база знаний для хранения успешных паттернов - **[claude-reviewer](https://github.com/rsokolowski/mcp-claude-reviewer)** — профессиональный code review с анализом безопасности - **[sequential-thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking)** — цепочки рассуждений для сложных задач - **[context7](https://github.com/upstash/context7)** — актуальная документация библиотек diff --git "a/presentation/ru/02-\320\260\321\200\321\205\320\270\321\202\320\265\320\272\321\202\321\203\321\200\320\260.md" "b/presentation/ru/02-\320\260\321\200\321\205\320\270\321\202\320\265\320\272\321\202\321\203\321\200\320\260.md" index 4c82c6f..c56d7c5 100644 --- "a/presentation/ru/02-\320\260\321\200\321\205\320\270\321\202\320\265\320\272\321\202\321\203\321\200\320\260.md" +++ "b/presentation/ru/02-\320\260\321\200\321\205\320\270\321\202\320\265\320\272\321\202\321\203\321\200\320\260.md" @@ -27,14 +27,13 @@ MAP Framework построен на основе **8 специализиров **Модель:** sonnet **Назначение:** Senior software engineer, пишет clean, efficient, production-ready код -**MCP интеграции (4 инструмента):** +**MCP интеграции (3 инструмента):** - `mcp__mem0__map_tiered_search` — поиск существующих паттернов (ВСЕГДА ПЕРВЫМ) - `context7__resolve-library-id + get-library-docs` — актуальная документация библиотек - `deepwiki__read_wiki_structure + read_wiki_contents` — обучение на production коде -- `cipher__extract_and_operate_memory` — сохранение успешных паттернов (ТОЛЬКО ПОСЛЕ Monitor approval) -**Критический протокол:** ВСЕГДА ищи в cipher ПЕРЕД реализацией; Сохраняй паттерны ТОЛЬКО ПОСЛЕ одобрения Monitor +**Критический протокол:** ВСЕГДА ищи существующие паттерны ПЕРЕД реализацией; Сохраняй паттерны ТОЛЬКО ПОСЛЕ одобрения Monitor **Входные данные:** {{existing_patterns}} (top_k=5), {{plan_context}} (recitation pattern), {{feedback}} (если retry) @@ -101,7 +100,6 @@ MAP Framework построен на основе **8 специализиров **Критический протокол:** - MANDATORY: mcp__mem0__map_tiered_search ПЕРЕД извлечением паттернов (предотвращает дубликаты) -- map-feature.md lines 263-273 enforce cipher search verification - Извлекай паттерны, не решения (фокус на "why", не "what") **Output:** key_insight, patterns_used, patterns_discovered, bullet_updates (helpful/harmful count), suggested_new_bullets @@ -111,22 +109,19 @@ MAP Framework построен на основе **8 специализиров **Модель:** sonnet **Назначение:** Knowledge curator, управляет evolving playbook без context collapse -**MCP интеграции (4 инструмента):** +**MCP интеграции (3 инструмента):** - `mcp__mem0__map_tiered_search` — проверка cross-project duplicates ПЕРЕД ADD операциями (MANDATORY) - `context7__resolve-library-id + get-library-docs` — верификация current API syntax - `deepwiki__read_wiki_structure + ask_question` — grounding advice в battle-tested коде -- `cipher__extract_and_operate_memory` — синхронизация high-quality bullets (helpful_count >= 5) в cipher **Критический протокол:** -- MANDATORY: Search cipher для дубликатов перед ADD -- MANDATORY: Sync bullets с helpful_count >= 5 в cipher -- map-feature.md lines 309-355 enforce cipher integration +- MANDATORY: Поиск дубликатов перед ADD - Quality > quantity: playbook с 50 high-quality bullets > 500 generic - Только delta операции (ADD/UPDATE/DEPRECATE), никогда полная перезапись -**Output:** operations (ADD/UPDATE/DEPRECATE), deduplication_check, sync_to_cipher +**Output:** operations (ADD/UPDATE/DEPRECATE), deduplication_check ### 8. DocumentationReviewer @@ -167,7 +162,6 @@ MAP Framework построен на основе **8 специализиров 6. Reflector → Извлечение уроков (MANDATORY) 7. Curator → Обновление playbook (MANDATORY) 8. Apply Curator delta operations -9. Sync to cipher если helpful_count >= 5 ``` ### Критические правила enforcement @@ -175,7 +169,7 @@ MAP Framework построен на основе **8 специализиров **MANDATORY agent invocation:** - НИКОГДА не пропускай Reflector: `mcp__mem0__map_tiered_search` выполняется ТОЛЬКО при правильном вызове агента -- НИКОГДА не пропускай Curator: playbook-to-cipher sync происходит ТОЛЬКО через Curator template +- НИКОГДА не пропускай Curator: обновление playbook происходит ТОЛЬКО через Curator template - ВСЕГДА верифицируй MCP tool usage в agent outputs - Manual extraction/curation bypasses MCP tools → знания не дедуплицируются → уроки не усваиваются diff --git a/presentation/ru/03-workflow.md b/presentation/ru/03-workflow.md index cb92ccf..95d1124 100644 --- a/presentation/ru/03-workflow.md +++ b/presentation/ru/03-workflow.md @@ -54,7 +54,7 @@ MAP предоставляет **4 специализированных workflow - ✅ Верифицировать использование `mcp__mem0__map_tiered_search` в output - ✅ Позволить Reflector извлечь паттерны из agent outputs -**Почему:** Шаблон Reflector содержит инструкции по поиску в cipher. При ручной работе `mcp__mem0__map_tiered_search` не вызывается → дублируется knowledge. +**Почему:** Шаблон Reflector содержит инструкции по поиску существующих паттернов. При ручной работе `mcp__mem0__map_tiered_search` не вызывается → дублируется knowledge. ### Правило 2: Обязательный вызов Curator @@ -69,9 +69,7 @@ MAP предоставляет **4 специализированных workflow - ✅ Вызвать `Task(subagent_type="curator", ...)` - ✅ Верифицировать использование `mcp__mem0__map_tiered_search` для дедупликации - ✅ Применить delta операции Curator (ADD/UPDATE/DEPRECATE) -- ✅ Вызвать `cipher_extract_and_operate_memory` если есть `sync_to_cipher` записи - -**Почему:** Шаблон Curator содержит инструкции по проверке cipher на дубликаты ПЕРЕД добавлением bullets И по синхронизации high-quality bullets (helpful_count >= 5) обратно в cipher. +**Почему:** Шаблон Curator содержит инструкции по проверке на дубликаты ПЕРЕД добавлением bullets. ### Правило 3: Верификация MCP Tool Usage @@ -85,34 +83,17 @@ MAP предоставляет **4 специализированных workflow **Curator Output должен показывать:** - Reasoning о deduplication через `mcp__mem0__map_tiered_search` -- Массив `sync_to_cipher` **только когда** bullets достигли helpful_count ≥ 5 (может отсутствовать или быть пустым) - **Если отсутствует:** Агент пропустил обязательные MCP calls → исследовать причину (skip tools, mis-report, template updates). -## Dual Memory System +## Memory System -MAP использует **ДВЕ системы хранения знаний**: - -### 1. Playbook (Проектная Memory) +### Playbook (Проектная Memory) - **Локация:** `.claude/mem0 MCP` - **Назначение:** Структурированные, категоризованные паттерны для ЭТОГО проекта - **Формат:** Bullets с примерами кода, тегами, helpful/harmful counts - **Scope:** Один проект -### 2. Cipher (Кросс-проектная Memory) - -- **Локация:** MCP tool (внешняя семантическая БД) -- **Назначение:** Общее knowledge для ВСЕХ проектов -- **Формат:** Semantic embeddings для similarity search -- **Scope:** Все проекты, использующие cipher - -**Интеграция:** - -- Reflector ищет в cipher похожие паттерны ПЕРЕД анализом -- Curator проверяет cipher на дубликаты ПЕРЕД добавлением bullets -- Curator синхронизирует high-quality bullets (helpful_count >= 5) обратно в cipher - ## Recitation Pattern — Context Engineering **Проблема:** На длинных задачах (8+ subtasks, 50K+ tokens) модель "теряет нить" и забывает исходную цель. @@ -186,28 +167,24 @@ Actor → Monitor (iteration 1) ## MCP Integration в Workflow -MAP использует **6 core MCP tools** для расширения возможностей workflow: +MAP использует **5 core MCP tools** для расширения возможностей workflow: 1. **`mcp__mem0__map_tiered_search`** — поиск похожих паттернов в семантической базе -2. **`cipher_extract_and_operate_memory`** — сохранение успешных паттернов -3. **`sequential-thinking`** — сложные цепочки рассуждений -4. **`context7 (resolve-library-id + get-library-docs)`** — актуальная документация библиотек -5. **`deepwiki (read_wiki_structure + ask_question)`** — обучение на GitHub репозиториях -6. **`claude-reviewer (request_review)`** — профессиональный code review +2. **`sequential-thinking`** — сложные цепочки рассуждений +3. **`context7 (resolve-library-id + get-library-docs)`** — актуальная документация библиотек +4. **`deepwiki (read_wiki_structure + ask_question)`** — обучение на GitHub репозиториях +5. **`claude-reviewer (request_review)`** — профессиональный code review ## Self-Check Verification -Перед завершением любого MAP workflow subtask orchestrator **ОБЯЗАН** проверить 4 вопроса: +Перед завершением любого MAP workflow subtask orchestrator **ОБЯЗАН** проверить 2 вопроса: 1. ❓ Вызвал ли я `Task(subagent_type="reflector", ...)` или извлекал уроки сам? 2. ❓ Вызвал ли я `Task(subagent_type="curator", ...)` или обновлял playbook сам? -3. ❓ Показал ли Reflector output, что он искал в cipher? -4. ❓ Показал ли Curator output операции `sync_to_cipher`? **Нарушения:** - Если "Сделал сам" на вопросы 1-2 → нарушение workflow, переделать subtask -- Если "Нет" на вопросы 3-4 → агенты не следовали шаблонам, исследовать причину ## Workflow Logger — Observability diff --git "a/presentation/ru/04-\320\275\320\260\321\207\320\260\320\273\320\276-\321\200\320\260\320\261\320\276\321\202\321\213.md" "b/presentation/ru/04-\320\275\320\260\321\207\320\260\320\273\320\276-\321\200\320\260\320\261\320\276\321\202\321\213.md" index 7d8d1be..98f28a9 100644 --- "a/presentation/ru/04-\320\275\320\260\321\207\320\260\320\273\320\276-\321\200\320\260\320\261\320\276\321\202\321\213.md" +++ "b/presentation/ru/04-\320\275\320\260\321\207\320\260\320\273\320\276-\321\200\320\260\320\261\320\276\321\202\321\213.md" @@ -186,11 +186,10 @@ cd map-framework ### MCP Servers Integration -MAP требует **6 MCP servers** для полной функциональности: +MAP требует **5 MCP servers** для полной функциональности: **Обязательные:** -- **cipher** — база знаний для хранения успешных паттернов - **claude-reviewer** — профессиональный code review с анализом безопасности **Опциональные (но рекомендуемые):** @@ -236,7 +235,6 @@ MAP требует **6 MCP servers** для полной функциональ - Проверьте `.claude/mcp_config.json` и доступность mem0 MCP 4. **Настройте MCP servers:** - - Подключите cipher для cross-project knowledge - Добавьте context7 для актуальной документации библиотек 5. **Кастомизируйте агентов:** diff --git a/scripts/lint-agent-templates.py b/scripts/lint-agent-templates.py index e8b5e79..09dcaa2 100755 --- a/scripts/lint-agent-templates.py +++ b/scripts/lint-agent-templates.py @@ -237,7 +237,6 @@ def lint_mcp_tool_descriptions(self, file_path: Path, content: str): """Check MCP tool descriptions for consistency""" # Common MCP tools that should be consistently described mcp_tools = { - "cipher_memory_search": ["search", "pattern", "knowledge"], "context7": ["library", "documentation", "resolve-library-id"], "deepwiki": ["wiki", "repository", "production"], } diff --git a/src/mapify_cli/__init__.py b/src/mapify_cli/__init__.py index a74cfc2..5642c99 100644 --- a/src/mapify_cli/__init__.py +++ b/src/mapify_cli/__init__.py @@ -83,14 +83,13 @@ def create_ssl_context(): # Constants MCP_SERVER_CHOICES = { "all": "All available MCP servers", - "essential": "Essential (cipher, claude-reviewer, sequential-thinking)", + "essential": "Essential (claude-reviewer, sequential-thinking)", "docs": "Documentation (context7, deepwiki)", "custom": "Select individually", "none": "Skip MCP setup", } INDIVIDUAL_MCP_SERVERS = { - "cipher": "Knowledge management system", "claude-reviewer": "Professional code review", "sequential-thinking": "Chain-of-thought reasoning", "context7": "Library documentation", @@ -555,32 +554,26 @@ def create_task_decomposer_content(mcp_servers: List[str]) -> str: mcp_section = "" if any( s in mcp_servers - for s in ["cipher", "sequential-thinking", "deepwiki", "context7"] + for s in ["sequential-thinking", "deepwiki", "context7"] ): mcp_section = """ ## MCP Integration **ALWAYS use these MCP tools:** -""" - if "cipher" in mcp_servers: - mcp_section += """ -1. **mcp__cipher__cipher_memory_search** - Search for similar features/patterns - - Query: "feature implementation [feature_name]" - - Query: "task decomposition [similar_goal]" """ if "sequential-thinking" in mcp_servers: mcp_section += """ -2. **mcp__sequential-thinking__sequentialthinking** - For complex planning +1. **mcp__sequential-thinking__sequentialthinking** - For complex planning - Use when goal is ambiguous or has many dependencies """ if "deepwiki" in mcp_servers: mcp_section += """ -3. **mcp__deepwiki__ask_question** - Get insights from GitHub repositories +2. **mcp__deepwiki__ask_question** - Get insights from GitHub repositories - Ask: "How does [repo] implement [feature]?" """ if "context7" in mcp_servers: mcp_section += """ -4. **mcp__context7__get-library-docs** - Get up-to-date library documentation +3. **mcp__context7__get-library-docs** - Get up-to-date library documentation - First use resolve-library-id to find the library """ @@ -611,26 +604,20 @@ def create_task_decomposer_content(mcp_servers: List[str]) -> str: def create_actor_content(mcp_servers: List[str]) -> str: """Create actor agent content""" mcp_section = "" - if any(s in mcp_servers for s in ["cipher", "context7", "deepwiki"]): + if any(s in mcp_servers for s in ["context7", "deepwiki"]): mcp_section = """ # MCP INTEGRATION **ALWAYS use these MCP tools:** -""" - if "cipher" in mcp_servers: - mcp_section += """ -1. **mcp__cipher__cipher_memory_search** - Search for code patterns - - Query: "implementation pattern [feature_type]" - - Store successful implementations after validation """ if "context7" in mcp_servers: mcp_section += """ -2. **mcp__context7__get-library-docs** - Get current library documentation +1. **mcp__context7__get-library-docs** - Get current library documentation - Essential when using external libraries/frameworks """ if "deepwiki" in mcp_servers: mcp_section += """ -3. **mcp__deepwiki__read_wiki_contents** - Study implementation patterns +2. **mcp__deepwiki__read_wiki_contents** - Study implementation patterns - Learn from production code examples """ @@ -768,26 +755,20 @@ def create_monitor_content(mcp_servers: List[str]) -> str: def create_predictor_content(mcp_servers: List[str]) -> str: """Create predictor agent content""" mcp_section = "" - if any(s in mcp_servers for s in ["cipher", "deepwiki", "context7"]): + if any(s in mcp_servers for s in ["deepwiki", "context7"]): mcp_section = """ ## MCP Integration **ALWAYS use these MCP tools:** -""" - if "cipher" in mcp_servers: - mcp_section += """ -1. **mcp__cipher__cipher_memory_search** - Find similar impact patterns - - Query: "impact analysis [change_type]" - - Learn from past breaking changes """ if "deepwiki" in mcp_servers: mcp_section += """ -2. **mcp__deepwiki__ask_question** - Check how repos handle similar changes +1. **mcp__deepwiki__ask_question** - Check how repos handle similar changes - Ask: "What breaks when changing [component]?" """ if "context7" in mcp_servers: mcp_section += """ -3. **mcp__context7__get-library-docs** - Check library compatibility +2. **mcp__context7__get-library-docs** - Check library compatibility - Verify API changes against current documentation """ @@ -846,16 +827,6 @@ def create_evaluator_content(mcp_servers: List[str]) -> str: def create_reflector_content(mcp_servers: List[str]) -> str: """Create reflector agent content""" mcp_section = "" - if "cipher" in mcp_servers: - mcp_section = """ -# MCP INTEGRATION - -**ALWAYS use cipher for knowledge management:** - -1. **mcp__cipher__cipher_memory_search** - Check existing patterns - - Query: "lesson learned [topic]" - - Avoid duplicating existing knowledge -""" return f"""--- name: reflector @@ -890,15 +861,6 @@ def create_reflector_content(mcp_servers: List[str]) -> str: def create_curator_content(mcp_servers: List[str]) -> str: """Create curator agent content""" mcp_section = "" - if "cipher" in mcp_servers: - mcp_section = """ -# MCP INTEGRATION - -**Use cipher for deduplication:** - -1. **mcp__cipher__cipher_memory_search** - Check for duplicate patterns - - Prevents adding redundant playbook entries -""" return f"""--- name: curator @@ -940,27 +902,21 @@ def create_curator_content(mcp_servers: List[str]) -> str: def create_documentation_reviewer_content(mcp_servers: List[str]) -> str: """Create documentation-reviewer agent content""" mcp_section = "" - if any(s in mcp_servers for s in ["cipher", "context7", "deepwiki"]): + if any(s in mcp_servers for s in ["context7", "deepwiki"]): mcp_section = """ # MCP INTEGRATION **ALWAYS use these tools for documentation review:** -""" - if "cipher" in mcp_servers: - mcp_section += """ -1. **mcp__cipher__cipher_memory_search** - Check for known patterns - - Query: "external dependency detection [technology]" - - Query: "CRD installation pattern [project]" """ if "context7" in mcp_servers: mcp_section += """ -2. **mcp__context7__get-library-docs** - Verify library requirements +1. **mcp__context7__get-library-docs** - Verify library requirements - Check official docs for installation requirements - Validate version compatibility """ if "deepwiki" in mcp_servers: mcp_section += """ -3. **mcp__deepwiki__ask_question** - Compare with similar projects +2. **mcp__deepwiki__ask_question** - Compare with similar projects - Ask: "How do other projects handle [integration]?" - Learn from successful implementations """ @@ -1450,15 +1406,6 @@ def create_mcp_config(project_path: Path, mcp_servers: List[str]) -> None: "hypothesis_verification": True, }, }, - "cipher": { - "enabled": True, - "description": "Knowledge management system", - "config": { - "auto_store": True, - "retrieval_limit": 5, - "conflict_resolution": "manual", - }, - }, "context7": { "enabled": True, "description": "Up-to-date library documentation", @@ -1477,10 +1424,6 @@ def create_mcp_config(project_path: Path, mcp_servers: List[str]) -> None: config["mcp_servers"][server] = server_configs[server] # Update agent mappings based on selected servers - if "cipher" in mcp_servers: - for agent in config["agent_mcp_mappings"]: - config["agent_mcp_mappings"][agent].append("cipher") - if "sequential-thinking" in mcp_servers: for agent in [ "task-decomposer", @@ -1646,7 +1589,7 @@ def create_or_merge_project_mcp_json( Args: project_path: Project root directory - mcp_servers: List of MCP server names to configure (e.g., ["cipher", "context7"]) + mcp_servers: List of MCP server names to configure (e.g., ["context7", "deepwiki"]) Behavior: - If mcp_servers is empty: No file created/modified (early return) @@ -2001,7 +1944,7 @@ def init( mcp: str = typer.Option( "all", "--mcp", - help="MCP server installation (default: all). Options: all, essential, docs, none, or comma-separated list (e.g. cipher,context7)", + help="MCP server installation (default: all). Options: all, essential, docs, none, or comma-separated list (e.g. context7,deepwiki)", ), no_git: bool = typer.Option( False, "--no-git", help="Skip git repository initialization" @@ -2029,7 +1972,7 @@ def init( mapify init my-project # Installs all MCP servers mapify init my-project --mcp none # Skip MCP installation mapify init my-project --mcp essential - mapify init my-project --mcp "cipher,context7" + mapify init my-project --mcp "context7,deepwiki" mapify init . mapify init . --force # Force init in non-empty current directory mapify init --debug # Enable workflow logging @@ -2127,7 +2070,7 @@ def init( if mcp == "all": selected_mcp_servers = list(INDIVIDUAL_MCP_SERVERS.keys()) elif mcp == "essential": - selected_mcp_servers = ["cipher", "claude-reviewer", "sequential-thinking"] + selected_mcp_servers = ["claude-reviewer", "sequential-thinking"] elif mcp == "docs": selected_mcp_servers = ["context7", "deepwiki"] elif mcp == "none": diff --git a/src/mapify_cli/templates/agents/actor.md b/src/mapify_cli/templates/agents/actor.md index 98b955d..01cfaf1 100644 --- a/src/mapify_cli/templates/agents/actor.md +++ b/src/mapify_cli/templates/agents/actor.md @@ -1055,7 +1055,7 @@ export class ReconnectingWebSocket { 3. test_reconnect_max_attempts_triggers_callback 4. test_reconnect_handles_immediate_disconnect -**Used Bullets**: `[]` (No similar patterns in cipher. Novel implementation.) +**Used Bullets**: `[]` (No similar patterns in mem0. Novel implementation.) diff --git a/src/mapify_cli/templates/agents/curator.md b/src/mapify_cli/templates/agents/curator.md index da95f68..5fd4e57 100644 --- a/src/mapify_cli/templates/agents/curator.md +++ b/src/mapify_cli/templates/agents/curator.md @@ -125,7 +125,7 @@ run_id: "org:shared" - **Counter**: Increment helpful_count once (not per insight) ### Contradictory Insights (Opposite Recommendations) -- **Action**: Check cipher for existing consensus (helpful_count scores) +- **Action**: Check mem0 for existing consensus (helpful_count scores) - **Validate**: Use deepwiki to verify production patterns - **Output**: Create bullet with BOTH approaches + tradeoffs - **Flag**: Mark `metadata.manual_review_required = true` diff --git a/src/mapify_cli/templates/agents/documentation-reviewer.md b/src/mapify_cli/templates/agents/documentation-reviewer.md index 6dea019..ea32d0f 100644 --- a/src/mapify_cli/templates/agents/documentation-reviewer.md +++ b/src/mapify_cli/templates/agents/documentation-reviewer.md @@ -123,7 +123,7 @@ IF mcp__mem0__* available: → Use for historical pattern matching ELSE: → Skip pattern matching, rely on explicit checks only - → Log: "cipher unavailable, no historical context" + → Log: "mem0 unavailable, no historical context" ``` ## Fallback Protocol @@ -441,7 +441,7 @@ mcp__deepwiki__ask_question( question="How does Gatekeeper handle CRD installation?" ) -# 4. Check historical patterns (if cipher available) +# 4. Check historical patterns (if mem0 available) mcp__mem0__map_tiered_search( query="CRD installation documentation patterns", top_k=5, diff --git a/src/mapify_cli/templates/agents/monitor.md b/src/mapify_cli/templates/agents/monitor.md index 6082665..7bb6cbd 100644 --- a/src/mapify_cli/templates/agents/monitor.md +++ b/src/mapify_cli/templates/agents/monitor.md @@ -935,7 +935,7 @@ def divide(a, b): 2. Verify parameterized queries (no string interpolation) 3. Check command execution (no shell=True with user input) 4. Validate file paths (no path traversal) -5. Search cipher for known vulnerabilities: `"security vulnerability [language]"` +5. Search mem0 for known vulnerabilities: `"security vulnerability [language]"` 6. Use deepwiki to check production security patterns #### Pass Criteria @@ -2236,7 +2236,7 @@ IF false positive rate >15%: IF bug catch rate <70%: → Expand dimension checklists → Add more MCP tool triggers - → Review missed patterns, add to cipher + → Review missed patterns, add to mem0 IF review time consistently >target: → Optimize tool selection @@ -2470,7 +2470,7 @@ def check_rate_limit(user_id, action, limit=100, window=3600): **Before returning your review JSON:** 1. ✅ Did I use request_review for code implementations? -2. ✅ Did I search cipher for known issue patterns? +2. ✅ Did I search mem0 for known issue patterns? 3. ✅ Did I check all 10 validation dimensions systematically? 4. ✅ Did I verify documentation against source of truth (if applicable)? 5. ✅ Are all issues specific with location and actionable suggestions? diff --git a/src/mapify_cli/templates/agents/predictor.md b/src/mapify_cli/templates/agents/predictor.md index c0f6f0c..076c078 100644 --- a/src/mapify_cli/templates/agents/predictor.md +++ b/src/mapify_cli/templates/agents/predictor.md @@ -1710,8 +1710,8 @@ Return **ONLY** valid JSON in this exact structure: "score": 0.85, "tier_base": 0.50, "adjustments": [ - {"category": "A", "factor": "Cipher comprehensive data", "adjustment": 0.20}, - {"category": "B", "factor": "Codex+grep match", "adjustment": 0.15} + {"category": "A", "factor": "mem0 comprehensive data", "adjustment": 0.20}, + {"category": "B", "factor": "mem0+grep match", "adjustment": 0.15} ], "flags": ["MANUAL REVIEW REQUIRED"] }, @@ -1811,17 +1811,17 @@ Confidence is NOT a guess—calculate it using this formula with **tier-specific **Category A: Historical Data** (pick highest applicable) ``` -+0.20: Cipher returned comprehensive patterns for this change type -+0.10: Cipher returned partial/similar patterns ++0.20: mem0 returned comprehensive patterns for this change type ++0.10: mem0 returned partial/similar patterns +0.00: No query made (default for Tier 1) --0.15: Cipher queried but no relevant data found +-0.15: mem0 queried but no relevant data found ``` **Category B: Tool Agreement** (pick one) ``` -+0.15: Codex + grep results match (same usages found) ++0.15: mem0 + grep results match (same usages found) +0.05: Only one tool used, results clear --0.10: Codex and grep conflict (investigate before proceeding) +-0.10: mem0 and grep conflict (investigate before proceeding) ``` **Category C: Code Analyzability** (pick lowest applicable) @@ -1879,7 +1879,7 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) | Factor | Category | Adjustment | Running Total | |--------|----------|------------|---------------| | Tier 2 base score | — | 0.50 | 0.50 | -| Cipher has similar patterns | A | +0.20 | 0.70 | +| mem0 has similar patterns | A | +0.20 | 0.70 | | Codex + grep match | B | +0.15 | 0.85 | | Static code (no flags) | C | +0.00 | 0.85 | | High test coverage | D | +0.10 | 0.95 | @@ -1890,7 +1890,7 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) | Factor | Category | Adjustment | Running Total | |--------|----------|------------|---------------| | Tier 3 base score | — | 0.50 | 0.50 | -| Cipher queried, no data | A | -0.15 | 0.35 | +| mem0 queried, no data | A | -0.15 | 0.35 | | Only grep used | B | +0.05 | 0.40 | | Reflection detected | C | -0.20 | 0.20 | | External API undocumented | D | -0.10 | 0.10 | @@ -1921,9 +1921,9 @@ TIER_1_MIN: 0.70 (if lower → escalate to Tier 2) 4. Be MORE conservative with risk assessment (err on higher risk) ``` -### If cipher and grep results conflict: +### If mem0 and grep results conflict: ``` -Example: cipher graph finds 10 usages, grep finds 15 +Example: mem0 finds 10 usages, grep finds 15 1. Trust manual verification (grep) over semantic tools 2. Investigate discrepancy: @@ -1931,7 +1931,7 @@ Example: cipher graph finds 10 usages, grep finds 15 - Check for generated code - Check for string-based references 3. Report BOTH numbers in output: - "affected_components": ["15 files (cipher: 10, grep: 15 - discrepancy noted)"] + "affected_components": ["15 files (mem0: 10, grep: 15 - discrepancy noted)"] 4. Set confidence to max 0.60 (moderate uncertainty) ``` @@ -1976,7 +1976,7 @@ IF confidence < 0.30 after all adjustments: ### Catastrophic Tool Failure Protocol (All Tools Fail) -**CRITICAL**: If ALL tools fail (cipher AND grep all error/timeout): +**CRITICAL**: If ALL tools fail (mem0 AND grep all error/timeout): ``` 1. DO NOT hallucinate results @@ -1988,7 +1988,7 @@ IF confidence < 0.30 after all adjustments: "tier_rationale": "All analysis tools failed - minimal analysis only", "tools_used": [], "tool_failures": { - "cipher": "timeout/error/unavailable", + "mem0": "timeout/error/unavailable", "grep": "timeout/error/unavailable" }, "catastrophic_failure": true diff --git a/src/mapify_cli/templates/agents/reflector.md b/src/mapify_cli/templates/agents/reflector.md index 5124215..db93dc6 100644 --- a/src/mapify_cli/templates/agents/reflector.md +++ b/src/mapify_cli/templates/agents/reflector.md @@ -537,7 +537,7 @@ Skip if: trivial fix, no technical knowledge, no clear entities. - **correct_approach** (REQUIRED, ≥150 chars, 5+ lines): Incorrect + correct code, why works, principle, {{language}} syntax - **key_insight** (REQUIRED, ≥50 chars): "When X, always Y because Z", actionable, memorable - **bullet_updates** (OPTIONAL): Only if Actor used bullets, tag helpful/harmful with reason -- **suggested_new_bullets** (OPTIONAL): Only if new (check cipher), meet quality framework, code_example for SECURITY/IMPL/PERF +- **suggested_new_bullets** (OPTIONAL): Only if new (check mem0), meet quality framework, code_example for SECURITY/IMPL/PERF ## JSON Schema (For Validation) @@ -608,7 +608,7 @@ Skip if: trivial fix, no technical knowledge, no clear entities. }, "unverified_novelty": { "type": "boolean", - "description": "Set to true if cipher was unavailable during analysis" + "description": "Set to true if mem0 was unavailable during analysis" }, "error": { "type": "boolean", diff --git a/src/mapify_cli/templates/agents/task-decomposer.md b/src/mapify_cli/templates/agents/task-decomposer.md index bd75b98..8f79219 100644 --- a/src/mapify_cli/templates/agents/task-decomposer.md +++ b/src/mapify_cli/templates/agents/task-decomposer.md @@ -34,7 +34,6 @@ machine-readable blueprint for the Actor/Monitor pipeline. │ │ │ 3. GATHER CONTEXT (if complexity ≥ 3) │ │ └─ ALWAYS: mcp__mem0__map_tiered_search (historical decompositions) │ -│ └─ IF similar found: cipher_search_reasoning_patterns │ │ └─ IF ambiguous: sequentialthinking │ │ └─ IF external lib: get-library-docs │ │ └─ Handle fallbacks if tools fail/return empty │ @@ -83,7 +82,6 @@ machine-readable blueprint for the Actor/Monitor pipeline. | Condition | Tool | Query Pattern | |-----------|------|---------------| | **ALWAYS** (complexity ≥ 3) | mcp__mem0__map_tiered_search | `"feature implementation [type]"`, `"task decomposition [domain]"` | -| Similar features found | cipher_search_reasoning_patterns | `"successful task decomposition [type]"`, `"dependency reasoning [domain]"` | | Ambiguous/complex goal | sequentialthinking | Iterative refinement of scope and dependencies | | External library | get-library-docs | Setup/quickstart guides for initialization order | | Unfamiliar domain | deepwiki | `"How does [repo] structure [feature]?"` | @@ -473,7 +471,6 @@ When invoked with `mode: "re_decomposition"` from the orchestrator, you receive **Analysis Completeness**: - [ ] Ran mcp__mem0__map_tiered_search for similar features -- [ ] Ran cipher_search_reasoning_patterns to understand decomposition thinking - [ ] Used sequential-thinking for complex/ambiguous goals - [ ] Checked library docs for initialization requirements - [ ] Identified all risks (not empty for medium/high complexity) diff --git a/src/mapify_cli/templates/commands/map-debug.md b/src/mapify_cli/templates/commands/map-debug.md index 95b1475..19bbfd3 100644 --- a/src/mapify_cli/templates/commands/map-debug.md +++ b/src/mapify_cli/templates/commands/map-debug.md @@ -48,9 +48,8 @@ PATTERN_CONTEXT=$(mcp__mem0__map_tiered_search(query="debug [issue type]", secti ``` 1. **Read error logs/stack traces** (if provided in $ARGUMENTS) -2. **Search cipher for similar issues**: `mcp__mem0__map_tiered_search("debug pattern [error_type]")` -3. **Identify affected files**: Use Grep/Glob to find relevant code -4. **Reproduce the issue** (if possible): Read test files or run commands +2. **Identify affected files**: Use Grep/Glob to find relevant code +3. **Reproduce the issue** (if possible): Read test files or run commands ## Step 2: Decompose Debugging Process @@ -65,7 +64,7 @@ Task( **Context:** - Error logs: [if available] - Affected files: [from analysis] -- Similar past issues: [from cipher search] +- Similar past issues: [from playbook search] Output JSON with: - subtasks: array of {id, description, debug_type: 'investigation'|'fix'|'verification', acceptance_criteria} @@ -259,11 +258,10 @@ User says: `/map-debug TypeError in authentication middleware` You should: 1. Gather context (read error logs, find middleware file) -2. Search cipher for similar authentication errors -3. Task(subagent_type="task-decomposer") → get investigation + fix steps -4. For investigation steps: Task(subagent_type="actor") to analyze -5. For fix steps: actor → monitor → predictor → evaluator → apply -6. Run tests, verify fix -7. Done! Optionally run `/map-learn` to preserve debugging patterns +2. Task(subagent_type="task-decomposer") → get investigation + fix steps +3. For investigation steps: Task(subagent_type="actor") to analyze +4. For fix steps: actor → monitor → predictor → evaluator → apply +5. Run tests, verify fix +6. Done! Optionally run `/map-learn` to preserve debugging patterns Begin debugging now. diff --git a/src/mapify_cli/templates/commands/map-fast.md b/src/mapify_cli/templates/commands/map-fast.md index f8f48d8..7560034 100644 --- a/src/mapify_cli/templates/commands/map-fast.md +++ b/src/mapify_cli/templates/commands/map-fast.md @@ -123,7 +123,7 @@ After all subtasks completed: 2. Create commit with message 3. Summarize what was implemented -**Note:** No playbook updates, no cipher patterns stored (learning disabled). +**Note:** No playbook updates (learning disabled). ## Critical Constraints diff --git a/src/mapify_cli/templates/commands/map-release.md b/src/mapify_cli/templates/commands/map-release.md index 8da07e2..3e6a35f 100644 --- a/src/mapify_cli/templates/commands/map-release.md +++ b/src/mapify_cli/templates/commands/map-release.md @@ -74,16 +74,6 @@ Query playbook for release-related patterns and past release issues: RELEASE_PATTERNS=$(mcp__mem0__map_tiered_search(query="release validation PyPI CI/CD", limit=10)) ``` -**Also search Cipher** for cross-project release patterns: - -``` -mcp__mem0__map_tiered_search( - query="package release validation PyPI deployment best practices", - top_k=5, - similarity_threshold=0.3 -) -``` - ### 1.2 Validation Gates (12 Required) Execute all validation gates in parallel where possible: diff --git a/src/mapify_cli/templates/skills/README.md b/src/mapify_cli/templates/skills/README.md index db39e0f..1e2854c 100644 --- a/src/mapify_cli/templates/skills/README.md +++ b/src/mapify_cli/templates/skills/README.md @@ -55,7 +55,6 @@ MAP: [Shows decision tree and comparison matrix] - `map-refactor-deep-dive.md` - Dependency analysis - `agent-architecture.md` - How 8 agents orchestrate - `playbook-system.md` - Knowledge storage and search -- `cipher-integration.md` - Cross-project learning --- @@ -126,7 +125,6 @@ Skills work seamlessly with the prompt improvement system: ├── map-refactor-deep-dive.md ├── agent-architecture.md ├── playbook-system.md - └── cipher-integration.md ``` --- diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md b/src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md index 2d51ac8..dc12a41 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md @@ -485,7 +485,6 @@ Agent & system details: - **[Agent Architecture](resources/agent-architecture.md)** — How agents orchestrate and coordinate - **[Playbook System (LEGACY)](resources/playbook-system.md)** — Historical pattern storage -- **[mem0 Integration](resources/cipher-integration.md)** — Tiered pattern storage (v4.0+) --- @@ -570,8 +569,6 @@ MAP: 📚 Loads this skill for context 2. **Have a critical feature?** See [map-feature-deep-dive.md](resources/map-feature-deep-dive.md) 3. **Debugging an issue?** See [map-debug-deep-dive.md](resources/map-debug-deep-dive.md) 4. **Understanding agents?** See [Agent Architecture](resources/agent-architecture.md) -5. **Learning about mem0?** See [mem0 Integration](resources/cipher-integration.md) - --- **Skill Version:** 1.0 diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md index 73a1d03..96173ed 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md @@ -243,5 +243,4 @@ Create `.claude/commands/map-custom.md`: **See also:** - [Playbook System](playbook-system.md) - How knowledge is structured -- [Cipher Integration](cipher-integration.md) - Cross-project learning - [map-efficient Deep Dive](map-efficient-deep-dive.md) - Conditional execution example diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/cipher-integration.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/cipher-integration.md deleted file mode 100644 index 93c34fb..0000000 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/cipher-integration.md +++ /dev/null @@ -1,291 +0,0 @@ -# mem0 Integration - -> **MIGRATION NOTE:** As of v4.0, pattern storage has migrated from cipher to mem0 MCP. This document describes the new mem0-based system. - -mem0 is MAP's tiered knowledge system. It stores patterns across namespaces (branch → project → org) for both project-specific and cross-project knowledge sharing. - -## What is mem0? - -**mem0** = MCP (Model Context Protocol) server for tiered pattern storage - -**Key Features:** -- **Tiered namespaces** - L1 (branch), L2 (project), L3 (org) -- **Semantic search** - Find patterns by meaning via tiered search -- **Fingerprint deduplication** - Prevents storing exact duplicates -- **Persistent storage** - Knowledge survives across sessions - ---- - -## Tiered Memory System - -### Tier Overview - -| Tier | Namespace | Scope | Use Case | -|------|-----------|-------|----------| -| **L1 (Recent)** | Branch-scoped | Current work session | Patterns specific to current feature | -| **L2 (Frequent)** | Project-scoped | All project patterns | Shared project knowledge | -| **L3 (Semantic)** | Org-scoped | Cross-project patterns | Organizational best practices | - -### Search Flow - -Tiered search queries tiers in order: L1 → L2 → L3 - -``` -mcp__mem0__map_tiered_search("async implementation") - ↓ -L1 (branch): Check recent patterns from current feature branch - ↓ -L2 (project): Check project-level patterns - ↓ -L3 (org): Check organizational patterns - ↓ -Return merged results (most specific first) -``` - -### Example Pattern Distribution - -**L1 (Branch-specific):** -- "Using new auth middleware pattern for this feature" -- "This branch uses beta API version 2.1" - -**L2 (Project-specific):** -- "Use FastAPI with uvicorn for this API service" -- "JWT secret stored in .env file (JWT_SECRET)" -- "Database migrations via Alembic in migrations/ folder" - -**L3 (Org-wide):** -- "Use async/await for I/O operations to avoid blocking" -- "Validate JWT tokens before processing requests" -- "Database schema changes require migration scripts" - ---- - -## MCP Tools - -### 1. mcp__mem0__map_tiered_search - -**Purpose:** Find existing patterns before implementing - -**Used by:** -- Actor (before implementing) -- Reflector (before suggesting new patterns) -- Curator (before creating ADD operations) - -**Example call:** -```python -mcp__mem0__map_tiered_search( - query="JWT token validation best practices", - category="security" # optional filter -) -``` - -**Returns:** -```json -{ - "patterns": [ - { - "id": "impl-0042", - "content": "Always verify JWT signature before trusting claims", - "tier": "project", - "relevance": 0.89 - } - ], - "tiers_searched": ["branch", "project", "org"] -} -``` - -### 2. mcp__mem0__map_add_pattern - -**Purpose:** Store new patterns - -**Used by:** -- Curator (after validating patterns) - -**Example call:** -```python -mcp__mem0__map_add_pattern( - content="Use async/await for I/O operations", - category="implementation", - tier="project" # default: project -) -``` - -**Returns:** -```json -{ - "created": true, - "pattern_id": "impl-0043", - "fingerprint": "abc123..." -} -``` - -**If duplicate exists:** -```json -{ - "created": false, - "existing_id": "impl-0012", - "reason": "Duplicate fingerprint" -} -``` - -### 3. mcp__mem0__map_archive_pattern - -**Purpose:** Deprecate outdated patterns - -**Used by:** -- Curator (when patterns become obsolete) - -**Example call:** -```python -mcp__mem0__map_archive_pattern( - pattern_id="impl-0042", - reason="Superseded by new auth approach" -) -``` - ---- - -## Deduplication Strategy - -### Fingerprint-Based Deduplication - -Each pattern has a fingerprint (content hash). When adding: - -``` -Curator tries to add pattern - ↓ -map_add_pattern computes fingerprint - ↓ -Check if fingerprint exists in target tier - ↓ -If exists: Return created=false with existing_id -If not: Create new pattern, return created=true -``` - -### Why Fingerprint vs Similarity - -| Approach | Pros | Cons | -|----------|------|------| -| Fingerprint (exact) | Fast, deterministic | Only catches exact duplicates | -| Similarity (semantic) | Catches near-duplicates | Slower, requires embeddings | - -**MAP choice:** Fingerprint for deduplication (fast), semantic for search (smart) - ---- - -## Knowledge Flow - -### Adding New Patterns - -``` -1. Subtask completed successfully -2. Run /map-learn to trigger learning -3. Reflector extracts patterns -4. Reflector searches mem0 (check if similar exists) -5. Curator validates patterns -6. Curator calls map_add_pattern for each new pattern -7. Pattern stored in appropriate tier -``` - -### Searching Patterns - -``` -1. New subtask starts -2. Actor calls map_tiered_search(subtask_description) -3. Results from L1 → L2 → L3 merged -4. Actor applies most relevant patterns -5. Implementation benefits from accumulated knowledge -``` - ---- - -## Tier Promotion - -Patterns can be promoted from project to org tier when: - -1. Pattern used successfully across multiple projects -2. Manual review confirms universal applicability -3. Admin uses `mcp__mem0__map_promote_pattern` - -```python -mcp__mem0__map_promote_pattern( - pattern_id="impl-0042", - from_tier="project", - to_tier="org" -) -``` - ---- - -## Benefits - -### 1. Scoped Knowledge - -- Branch patterns don't pollute project scope -- Project patterns don't pollute org scope -- Clear boundaries for different concerns - -### 2. Fast Local Access - -- L1 (branch) = fastest access -- Most relevant patterns found first -- Cross-project patterns available when needed - -### 3. Quality Through Tiers - -- Experimental patterns stay in branch tier -- Validated patterns promote to project tier -- Universal patterns reach org tier - ---- - -## Troubleshooting - -### Patterns not found in search - -**Check:** -1. Pattern exists in correct tier: Use `mcp__mem0__get_memories` to list -2. Query matches pattern content: Try more specific query -3. Category filter isn't too restrictive - -### Duplicate patterns appearing - -**Check:** -1. Content differs slightly (different fingerprints) -2. Patterns in different tiers (L1 vs L2) - -**Solution:** -- Archive older duplicate -- Standardize pattern wording - -### Pattern not saving - -**Check:** -1. `created: false` in response = duplicate -2. Check `existing_id` to find the duplicate -3. Decide whether to update existing or archive it - ---- - -## Best Practices - -### For Workflows - -1. **Always search before implementing** - Actor should search mem0 first -2. **Use appropriate tier** - Branch for unvalidated, project for validated -3. **Archive instead of delete** - Preserve history for auditing -4. **Include category** - Helps filtering and organization - -### For Users - -1. **Run /map-learn after workflows** - Extracts and stores patterns -2. **Review archived patterns periodically** - May have valuable history -3. **Promote good patterns** - Move validated patterns to higher tiers -4. **Query across tiers** - Don't limit to single tier - ---- - -**See also:** -- [Playbook System (Legacy)](playbook-system.md) - Historical reference -- [Agent Architecture](agent-architecture.md) - Reflector/Curator roles -- [map-efficient Deep Dive](map-efficient-deep-dive.md) - Batched learning workflow diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md index 9976ab2..5797b92 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md @@ -133,7 +133,7 @@ ST-3: Integration tests Reflector (batched): ├─ Analyzed: 3 subtasks -├─ Searched cipher: Found similar pagination patterns +├─ Searched mem0: Found similar pagination patterns └─ Extracted: - Pagination parameter pattern (offset/limit) - API versioning consideration diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md index b4dd1c4..5061426 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md @@ -21,7 +21,7 @@ **Why?** No learning means: - Patterns not captured → team doesn't learn - Playbook not updated → knowledge lost -- Cipher not synced → other projects don't benefit +- Patterns not synced → other projects don't benefit - Technical debt accumulates --- @@ -42,7 +42,7 @@ **Curator (Playbook Updates)** - No playbook bullets created -- No cipher synchronization +- No pattern synchronization - No cross-project learning ### What Remains diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md index 0f860ea..1e0c9e4 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md @@ -206,7 +206,6 @@ ST-2: Authorization code flow **Knowledge captured:** - ✅ Playbook bullets created (N subtasks → N+ bullets) -- ✅ High-quality bullets synced to cipher - ✅ Team can apply patterns immediately **Impact understood:** @@ -224,7 +223,7 @@ ST-2: Authorization code flow **Issue:** Too many playbook bullets created **Cause:** Reflector suggesting redundant patterns -**Solution:** Curator should check cipher more aggressively +**Solution:** Curator should check for duplicates more aggressively **Issue:** Predictor always says "high risk" **Cause:** Overly conservative risk assessment diff --git a/src/mapify_cli/templates/skills/map-workflows-guide/resources/playbook-system.md b/src/mapify_cli/templates/skills/map-workflows-guide/resources/playbook-system.md index f3f8e27..47c5579 100644 --- a/src/mapify_cli/templates/skills/map-workflows-guide/resources/playbook-system.md +++ b/src/mapify_cli/templates/skills/map-workflows-guide/resources/playbook-system.md @@ -68,7 +68,7 @@ High-level design decisions ### 6. PERFORMANCE_OPTIMIZATIONS Performance improvements and profiling -- Example: "Batch cipher search queries to avoid N+1 problem" +- Example: "Batch search queries to avoid N+1 problem" - Example: "FTS5 search 10x faster than grep for large playbooks" --- @@ -87,7 +87,7 @@ quality_score = helpful_count - harmful_count ``` **Usage:** -- Bullets with `quality_score >= 5` are high-quality → synced to cipher +- Bullets with `quality_score >= 5` are high-quality - Bullets with `quality_score < 0` are deprecated → soft-deleted --- @@ -240,7 +240,7 @@ Actor marks bullets as helpful ↓ Curator increments helpful_count ↓ -If helpful_count reaches 5 → sync to cipher +If helpful_count reaches 5 → promote to higher tier ↓ Pattern becomes cross-project knowledge ``` @@ -298,5 +298,4 @@ Pattern becomes cross-project knowledge **See also:** - [Agent Architecture](agent-architecture.md) - How Reflector/Curator work -- [Cipher Integration](cipher-integration.md) - Cross-project knowledge sync - [map-efficient Deep Dive](map-efficient-deep-dive.md) - Batched Curator updates diff --git a/tests/test_mapify_cli.py b/tests/test_mapify_cli.py index d852531..2b3f86b 100644 --- a/tests/test_mapify_cli.py +++ b/tests/test_mapify_cli.py @@ -276,7 +276,7 @@ def test_init_claude_with_essential_mcp(self, tmp_path): Verifies that: - Init succeeds with --mcp essential - - Essential MCP servers are configured (cipher, claude-reviewer, sequential-thinking) + - Essential MCP servers are configured (claude-reviewer, sequential-thinking) - Agent files are created """ os.chdir(tmp_path) @@ -289,7 +289,6 @@ def test_init_claude_with_essential_mcp(self, tmp_path): # Check MCP config contains essential servers mcp_config = json.loads((tmp_path / ".claude" / "mcp_config.json").read_text()) - assert "cipher" in mcp_config["mcp_servers"] assert "claude-reviewer" in mcp_config["mcp_servers"] assert "sequential-thinking" in mcp_config["mcp_servers"] @@ -339,7 +338,7 @@ def test_init_with_mcp_servers(self, tmp_path): Verifies that: - --mcp essential flag installs essential servers - - MCP config contains cipher, claude-reviewer, sequential-thinking + - MCP config contains claude-reviewer, sequential-thinking """ os.chdir(tmp_path) @@ -349,7 +348,6 @@ def test_init_with_mcp_servers(self, tmp_path): assert (tmp_path / ".claude" / "mcp_config.json").exists() mcp_config = json.loads((tmp_path / ".claude" / "mcp_config.json").read_text()) - assert "cipher" in mcp_config["mcp_servers"] assert "claude-reviewer" in mcp_config["mcp_servers"] assert "sequential-thinking" in mcp_config["mcp_servers"] @@ -357,14 +355,14 @@ def test_init_with_mcp_servers(self, tmp_path): reason="Test isolation issue: passes in isolation but fails in full suite after 332 tests due to stdin/stdout state. TODO: Investigate and fix test infrastructure issue." ) def test_init_defaults_to_all_mcp_servers(self, tmp_path, monkeypatch): - """Test that init without --mcp flag defaults to installing all 5 MCP servers. + """Test that init without --mcp flag defaults to installing all 4 MCP servers. Regression test for non-interactive init behavior. Verifies that: - Init completes without interactive prompts - - All 5 MCP servers are installed by default (cipher, claude-reviewer, + - All 4 MCP servers are installed by default (claude-reviewer, sequential-thinking, context7, deepwiki) - - mcp_config.json is created with all 5 servers + - mcp_config.json is created with all 4 servers """ # Use fresh CliRunner to avoid state pollution from previous tests from typer.testing import CliRunner as FreshRunner @@ -396,10 +394,9 @@ def test_init_defaults_to_all_mcp_servers(self, tmp_path, monkeypatch): assert (tmp_path / ".claude" / "agents").exists() assert (tmp_path / ".claude" / "mcp_config.json").exists() - # Verify all 5 MCP servers are configured + # Verify all 4 MCP servers are configured mcp_config = json.loads((tmp_path / ".claude" / "mcp_config.json").read_text()) expected_servers = [ - "cipher", "claude-reviewer", "sequential-thinking", "context7", @@ -412,9 +409,9 @@ def test_init_defaults_to_all_mcp_servers(self, tmp_path, monkeypatch): f"MCP server '{server}' not found in config" ) - # Verify exactly 5 servers (no extras) - assert len(mcp_config["mcp_servers"]) == 5, ( - f"Expected 5 servers, found {len(mcp_config['mcp_servers'])}" + # Verify exactly 4 servers (no extras) + assert len(mcp_config["mcp_servers"]) == 4, ( + f"Expected 4 servers, found {len(mcp_config['mcp_servers'])}" ) def test_init_force_no_prompts(self, tmp_path): @@ -574,7 +571,7 @@ def test_create_agent_files(self, tmp_path): def test_create_agent_files_with_templates(self, tmp_path): """Test creating agent files from templates.""" - create_agent_files(tmp_path, ["cipher", "claude-reviewer"]) + create_agent_files(tmp_path, ["claude-reviewer"]) agents_dir = tmp_path / ".claude" / "agents" assert agents_dir.exists() @@ -598,8 +595,8 @@ def test_create_agent_files_fallback(self, mock_get_templates, tmp_path): mock_templates_path.mkdir(parents=True, exist_ok=True) mock_get_templates.return_value = mock_templates_path - # Call create_agent_files with cipher MCP server - create_agent_files(tmp_path, ["cipher"]) + # Call create_agent_files with MCP servers + create_agent_files(tmp_path, ["claude-reviewer"]) agents_dir = tmp_path / ".claude" / "agents" assert agents_dir.exists() @@ -630,9 +627,12 @@ def test_create_agent_files_fallback(self, mock_get_templates, tmp_path): ) assert has_core_section, f"Agent {agent_file} missing core sections" - # Verify MCP integration for cipher-enabled agents - if any(name in agent_file for name in ["reflector", "curator"]): - assert "cipher" in content.lower() or "mcp" in content.lower(), ( + # Verify MCP integration for agents that use MCP tools + if any( + name in agent_file + for name in ["task-decomposer", "actor", "monitor", "predictor"] + ): + assert "mcp" in content.lower() or "tool" in content.lower(), ( f"Agent {agent_file} missing MCP integration section" )