mapify-cli 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. mapify_cli-1.0.0/.claude/agents/README.md +183 -0
  2. mapify_cli-1.0.0/.claude/hooks/README.md +55 -0
  3. mapify_cli-1.0.0/.gitignore +57 -0
  4. mapify_cli-1.0.0/PKG-INFO +310 -0
  5. mapify_cli-1.0.0/README.md +280 -0
  6. mapify_cli-1.0.0/docs/context-engineering/README.md +315 -0
  7. mapify_cli-1.0.0/pyproject.toml +53 -0
  8. mapify_cli-1.0.0/src/mapify_cli/__init__.py +1946 -0
  9. mapify_cli-1.0.0/src/mapify_cli/playbook_manager.py +517 -0
  10. mapify_cli-1.0.0/src/mapify_cli/recitation_manager.py +551 -0
  11. mapify_cli-1.0.0/src/mapify_cli/semantic_search.py +405 -0
  12. mapify_cli-1.0.0/src/mapify_cli/templates/agents/CHANGELOG.md +108 -0
  13. mapify_cli-1.0.0/src/mapify_cli/templates/agents/MCP-PATTERNS.md +343 -0
  14. mapify_cli-1.0.0/src/mapify_cli/templates/agents/README.md +183 -0
  15. mapify_cli-1.0.0/src/mapify_cli/templates/agents/actor.md +650 -0
  16. mapify_cli-1.0.0/src/mapify_cli/templates/agents/curator.md +1155 -0
  17. mapify_cli-1.0.0/src/mapify_cli/templates/agents/documentation-reviewer.md +1282 -0
  18. mapify_cli-1.0.0/src/mapify_cli/templates/agents/evaluator.md +843 -0
  19. mapify_cli-1.0.0/src/mapify_cli/templates/agents/monitor.md +977 -0
  20. mapify_cli-1.0.0/src/mapify_cli/templates/agents/predictor.md +965 -0
  21. mapify_cli-1.0.0/src/mapify_cli/templates/agents/reflector.md +1048 -0
  22. mapify_cli-1.0.0/src/mapify_cli/templates/agents/task-decomposer.md +1169 -0
  23. mapify_cli-1.0.0/src/mapify_cli/templates/agents/test-generator.md +1175 -0
  24. mapify_cli-1.0.0/src/mapify_cli/templates/commands/map-debug.md +315 -0
  25. mapify_cli-1.0.0/src/mapify_cli/templates/commands/map-feature.md +454 -0
  26. mapify_cli-1.0.0/src/mapify_cli/templates/commands/map-refactor.md +317 -0
  27. mapify_cli-1.0.0/src/mapify_cli/templates/commands/map-review.md +29 -0
  28. mapify_cli-1.0.0/src/mapify_cli/templates/hooks/README.md +55 -0
  29. mapify_cli-1.0.0/src/mapify_cli/templates/hooks/validate-agent-templates.sh +94 -0
  30. mapify_cli-1.0.0/src/mapify_cli/templates/settings.hooks.json +20 -0
  31. mapify_cli-1.0.0/src/mapify_cli/workflow_logger.py +411 -0
@@ -0,0 +1,183 @@
1
+ # MAP Agent Architecture
2
+
3
+ This directory contains agent prompts for the MAP (Modular Agentic Planner) framework.
4
+
5
+ ## ⚠️ CRITICAL: Template Variables
6
+
7
+ **DO NOT REMOVE Handlebars template syntax!**
8
+
9
+ Agent files use **Handlebars templating** (`{{variable}}`, `{{#if}}...{{/if}}`) for runtime context injection by the Orchestrator agent.
10
+
11
+ ### Why Template Variables Exist
12
+
13
+ ```
14
+ ┌─────────────────┐
15
+ │ Orchestrator │ Fills in context at runtime
16
+ └────────┬────────┘
17
+ │ {{language}} = "python"
18
+ │ {{project_name}} = "my-api"
19
+ │ {{#if playbook_bullets}} = [patterns from Curator]
20
+ │ {{#if feedback}} = [corrections from Monitor]
21
+
22
+ ┌─────────────────┐
23
+ │ Actor Agent │ Receives fully-populated prompt
24
+ └─────────────────┘
25
+ ```
26
+
27
+ ### Template Variables by Category
28
+
29
+ #### Context Injection (Orchestrator → All Agents)
30
+ - `{{language}}` - Project programming language (python, go, javascript, etc.)
31
+ - `{{framework}}` - Framework in use (FastAPI, Django, React, etc.)
32
+ - `{{project_name}}` - Current project name
33
+ - `{{standards_url}}` - Link to coding standards
34
+ - `{{branch}}` - Current git branch
35
+ - `{{related_files}}` - Files relevant to the task
36
+
37
+ #### Task Specification (TaskDecomposer → Actor)
38
+ - `{{subtask_description}}` - The specific subtask to implement
39
+ - `{{allowed_scope}}` - Files/directories Actor is allowed to modify
40
+
41
+ #### ACE Learning System (Curator → Actor)
42
+ - `{{#if playbook_bullets}}...{{/if}}` - Proven patterns from past successes
43
+ - This is how the system learns and improves over time
44
+ - Curator analyzes successful implementations and adds to playbook
45
+ - Actor gets relevant patterns automatically injected
46
+
47
+ #### Feedback Loops (Monitor → Actor)
48
+ - `{{#if feedback}}...{{/if}}` - Corrections from Monitor after failed attempt
49
+ - Enables iterative refinement: Actor → Monitor → Actor (with feedback)
50
+ - Critical for quality assurance
51
+
52
+ ### What Happens If You Remove Them
53
+
54
+ | Removed | Impact | Severity |
55
+ |---------|--------|----------|
56
+ | `{{language}}` | Actor doesn't know what language to use | 🔴 Critical |
57
+ | `{{project_name}}` | Generic code, doesn't match project style | 🟡 Major |
58
+ | `{{#if playbook_bullets}}` | **Breaks ACE learning system** | 🔴 Critical |
59
+ | `{{#if feedback}}` | **Breaks Monitor → Actor retry** | 🔴 Critical |
60
+ | `{{subtask_description}}` | Actor doesn't know what to implement | 🔴 Critical |
61
+
62
+ ### How to Safely Customize Agents
63
+
64
+ ✅ **Safe modifications:**
65
+ ```markdown
66
+ # Add new MCP tools
67
+ 6. **mcp__my-tool__my-function** - Custom functionality
68
+ - Use for specific use cases
69
+ - Example: my_tool(param="value")
70
+
71
+ # Add domain-specific instructions
72
+ # SECURITY REQUIREMENTS
73
+ - All inputs must be validated
74
+ - Use parameterized queries for SQL
75
+ - Never log sensitive data
76
+
77
+ # Adjust output format
78
+ # OUTPUT FORMAT (extended)
79
+ 5. **Security Analysis**: List potential vulnerabilities
80
+ 6. **Performance Impact**: Expected performance characteristics
81
+ ```
82
+
83
+ ❌ **Unsafe modifications:**
84
+ ```markdown
85
+ # ❌ Removing template variables
86
+ -{{language}} # DON'T DO THIS
87
+ -{{project_name}} # DON'T DO THIS
88
+
89
+ # ❌ Removing conditional blocks
90
+ -{{#if playbook_bullets}} # DON'T DO THIS
91
+ -{{/if}}
92
+
93
+ # ❌ Simplifying "verbose" sections
94
+ -# PLAYBOOK CONTEXT (ACE) # This is critical infrastructure!
95
+ ```
96
+
97
+ ## Git Pre-commit Hook
98
+
99
+ A pre-commit hook at `.git/hooks/pre-commit` validates that critical template variables are present before allowing commits.
100
+
101
+ **Required patterns checked:**
102
+ - `{{language}}`
103
+ - `{{project_name}}`
104
+ - `{{#if playbook_bullets}}`
105
+ - `{{#if feedback}}`
106
+ - `{{subtask_description}}`
107
+
108
+ **To bypass (not recommended):**
109
+ ```bash
110
+ git commit --no-verify
111
+ ```
112
+
113
+ ## Testing Agent Modifications
114
+
115
+ After modifying an agent, test the **full workflow**, not just the agent in isolation:
116
+
117
+ ```bash
118
+ # ❌ Wrong: Test agent standalone
119
+ claude --agents '{"actor": {"prompt": "$(cat .claude/agents/actor.md)"}}' --print "implement feature"
120
+
121
+ # ✅ Right: Test via Orchestrator (full MAP workflow)
122
+ /map-feature implement simple calculator with add/subtract
123
+ ```
124
+
125
+ The Orchestrator workflow ensures:
126
+ 1. TaskDecomposer breaks down the task
127
+ 2. Orchestrator fills in all template variables
128
+ 3. Actor receives fully-populated prompt with context
129
+ 4. Monitor validates the output
130
+ 5. Feedback loops work correctly
131
+
132
+ ## Understanding Handlebars Syntax
133
+
134
+ If you see these patterns in agent files, **they are NOT comments**:
135
+
136
+ ```handlebars
137
+ {{variable}} → Replaced with actual value
138
+ {{#if condition}}...{{/if}} → Conditional block (included if condition true)
139
+ {{#each items}}...{{/each}} → Loop over items
140
+ ```
141
+
142
+ **Example:**
143
+
144
+ Before (in agent file):
145
+ ```markdown
146
+ Project: {{project_name}}
147
+ Language: {{language}}
148
+
149
+ {{#if feedback}}
150
+ FEEDBACK FROM PREVIOUS ATTEMPT:
151
+ {{feedback}}
152
+ {{/if}}
153
+ ```
154
+
155
+ After (when Orchestrator invokes Actor):
156
+ ```markdown
157
+ Project: my-api
158
+ Language: python
159
+
160
+ FEEDBACK FROM PREVIOUS ATTEMPT:
161
+ The function is missing error handling for invalid inputs.
162
+ Please add try/except blocks.
163
+ ```
164
+
165
+ ## Need Help?
166
+
167
+ - **Question:** "Can I simplify this verbose agent prompt?"
168
+ - **Answer:** Check if it contains `{{templates}}` first. If yes, **DO NOT remove**.
169
+
170
+ - **Question:** "Why is the playbook section so long?"
171
+ - **Answer:** It's dynamically filled by Curator. It's empty initially, grows with learning.
172
+
173
+ - **Question:** "Can I remove unused template variables?"
174
+ - **Answer:** No. They're used by Orchestrator even if they look unused in the file.
175
+
176
+ - **Question:** "The agent works fine without templates in my test."
177
+ - **Answer:** You tested it standalone. Test via `/map-feature` (Orchestrator workflow).
178
+
179
+ ## References
180
+
181
+ - [MAP Framework Paper](https://github.com/Shanka123/MAP)
182
+ - [ACE Framework Paper](https://arxiv.org/abs/2510.04618v1)
183
+ - [Handlebars Documentation](https://handlebarsjs.com/)
@@ -0,0 +1,55 @@
1
+ # MAP Framework - Claude Code Hooks
2
+
3
+ This directory contains Claude Code hooks for the MAP Framework.
4
+
5
+ ## Active Hooks
6
+
7
+ ### PreToolUse - Template Variable Validation
8
+
9
+ **Hook**: `validate-agent-templates.sh`
10
+ **Triggers**: Before `Edit` or `Write` operations on `.claude/agents/*.md` files
11
+ **Purpose**: Prevents accidental removal of critical template variables
12
+
13
+ **Template Variables Protected**:
14
+ - `{{language}}` - Programming language context
15
+ - `{{project_name}}` - Project name
16
+ - `{{framework}}` - Framework context
17
+ - `{{#if playbook_bullets}}` - ACE learning system
18
+ - `{{#if feedback}}` - Monitor→Actor retry loops
19
+ - `{{subtask_description}}` - Task specification
20
+
21
+ **How It Works**:
22
+ 1. Detects when agent files are being modified
23
+ 2. Checks staged content for required template variables
24
+ 3. Blocks commit if variables are missing
25
+ 4. Provides clear error message
26
+
27
+ **Override** (use carefully):
28
+ ```bash
29
+ git commit --no-verify
30
+ ```
31
+
32
+ ## Removed Hooks
33
+
34
+ The following hooks were removed because **bash hooks cannot call MCP tools**:
35
+
36
+ - ❌ `auto-store-knowledge.sh` (PostToolUse) - Tried to call cipher MCP
37
+ - ❌ `enrich-context.sh` (UserPromptSubmit) - Tried to search cipher MCP
38
+ - ❌ `session-init.sh` (SessionStart) - Tried to load from cipher MCP
39
+ - ❌ `track-metrics.sh` (SubagentStop) - Tried to store metrics in cipher MCP
40
+
41
+ **Why Removed**: Bash hooks execute outside Claude Code's context and cannot invoke MCP tools.
42
+
43
+ **Alternative**: Call MCP tools directly within agent prompts or slash commands.
44
+
45
+ ## Best Practices
46
+
47
+ **DO Use Hooks For**:
48
+ - ✅ File validation (grep, regex)
49
+ - ✅ Git operations (status, diff)
50
+ - ✅ Static analysis (linters)
51
+
52
+ **DON'T Use Hooks For**:
53
+ - ❌ MCP tool calls
54
+ - ❌ Interactive prompts
55
+ - ❌ Long operations (>10s timeout)
@@ -0,0 +1,57 @@
1
+
2
+ .clinerules/cipher-rules.md
3
+ .kilocode/rules/cipher-rules.md
4
+ .roo/rules/cipher-rules.md
5
+ .windsurf/rules/cipher-rules.md
6
+ .cursor/rules/cipher-rules.mdc
7
+ .kiro/steering/cipher-rules.md
8
+ .qoder/rules/cipher-rules.md
9
+ .augment/rules/cipher-rules.md
10
+ .reviews
11
+ .coverage
12
+
13
+ # Python
14
+ __pycache__/
15
+ *.py[cod]
16
+ *$py.class
17
+ *.so
18
+ .Python
19
+ build/
20
+ develop-eggs/
21
+ dist/
22
+ downloads/
23
+ eggs/
24
+ .eggs/
25
+ lib/
26
+ lib64/
27
+ parts/
28
+ sdist/
29
+ var/
30
+ wheels/
31
+ *.egg-info/
32
+ .installed.cfg
33
+ *.egg
34
+
35
+ data/
36
+ htmlcov/
37
+
38
+ # ACE Playbook - user-specific data
39
+ .claude/embeddings_cache/
40
+ .claude/playbook.json
41
+ .claude/mcp_config.json
42
+ .claude/commands/
43
+
44
+ # Agent template backups
45
+ src/mapify_cli/templates/agents.backup/
46
+
47
+ # Research papers (optional, can commit if needed as docs)
48
+ *.pdf
49
+ coverage.json
50
+
51
+ # Claude Code hooks runtime files
52
+ .claude/sessions/
53
+ .claude/metrics/
54
+ .map/
55
+
56
+ # Temporary verification files
57
+ mapify_cli_verification_*.json
@@ -0,0 +1,310 @@
1
+ Metadata-Version: 2.4
2
+ Name: mapify-cli
3
+ Version: 1.0.0
4
+ Summary: MAP Framework installer - Modular Agentic Planner for Claude Code
5
+ Project-URL: Homepage, https://github.com/azalio/map-framework
6
+ Project-URL: Repository, https://github.com/azalio/map-framework.git
7
+ Project-URL: Issues, https://github.com/azalio/map-framework/issues
8
+ Author: MAP Framework Contributors
9
+ Requires-Python: >=3.11
10
+ Requires-Dist: httpx>=0.25.0
11
+ Requires-Dist: platformdirs>=4.0.0
12
+ Requires-Dist: questionary>=2.0.0
13
+ Requires-Dist: readchar>=4.0.0
14
+ Requires-Dist: rich>=13.0.0
15
+ Requires-Dist: typer>=0.9.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: black>=23.0.0; extra == 'dev'
18
+ Requires-Dist: mypy>=1.0.0; extra == 'dev'
19
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
20
+ Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
21
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
22
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
23
+ Provides-Extra: ssl
24
+ Requires-Dist: truststore>=0.9.0; extra == 'ssl'
25
+ Provides-Extra: test
26
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
27
+ Requires-Dist: pytest-mock>=3.10.0; extra == 'test'
28
+ Requires-Dist: pytest>=7.0.0; extra == 'test'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # MAP Framework for Claude Code
32
+
33
+ Implementation of **Modular Agentic Planner (MAP)** — a cognitive architecture for AI agents inspired by prefrontal cortex functions. Orchestrates 8 specialized agents for development with automatic quality validation.
34
+
35
+ > **Based on:** [Nature Communications research (2025)](https://github.com/Shanka123/MAP) — 74% improvement in planning tasks
36
+ > **Enhanced with:** [ACE (Agentic Context Engineering)](https://arxiv.org/abs/2510.04618v1) — continuous learning from experience
37
+
38
+ ## 📖 Documentation Structure
39
+
40
+ - **README** (this file) - Quick start and overview
41
+ - **[INSTALL.md](docs/INSTALL.md)** - Complete installation guide with PATH setup and troubleshooting
42
+ - **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** - Technical deep dive, customization, and MCP integration
43
+ - **[USAGE.md](docs/USAGE.md)** - Practical examples, best practices, and cost optimization
44
+
45
+ ## 🚀 Quick Start
46
+
47
+ ### Inside Claude Code (Recommended)
48
+
49
+ ```bash
50
+ # Feature development
51
+ /map-feature implement user authentication with JWT tokens
52
+
53
+ # Debugging
54
+ /map-debug fix the API 500 error on login endpoint
55
+
56
+ # Refactoring
57
+ /map-refactor refactor UserService class with dependency injection
58
+
59
+ # Code review
60
+ /map-review review the recent changes in auth.py
61
+ ```
62
+
63
+ ### Command Line Usage
64
+
65
+ MAP Framework works exclusively through slash commands in Claude Code:
66
+
67
+ ```bash
68
+ # Start Claude Code in your project directory
69
+ cd your-project
70
+ claude
71
+
72
+ # Use slash commands inside Claude Code
73
+ /map-feature implement user authentication with JWT tokens
74
+ ```
75
+
76
+ **Note:** Direct `claude --agents` syntax is not applicable to MAP Framework, as the orchestration logic is implemented in slash command prompts (`.claude/commands/map-*.md`), not as a separate agent file.
77
+
78
+ ## 📦 Installation
79
+
80
+ ### Stable Release (Recommended)
81
+
82
+ ```bash
83
+ # Using pip
84
+ pip install mapify-cli
85
+
86
+ # OR using UV (recommended for isolated tools)
87
+ uv tool install mapify-cli
88
+
89
+ # Verify installation
90
+ mapify --version
91
+
92
+ # Initialize in your project
93
+ cd your-project
94
+ mapify init
95
+ ```
96
+
97
+ **Version Pinning:**
98
+ ```bash
99
+ # Install specific version
100
+ pip install mapify-cli==1.0.0
101
+
102
+ # Install with version constraints (semantic versioning: MAJOR.MINOR.PATCH)
103
+ pip install "mapify-cli>=1.0.0,<2.0.0" # Allow 1.x versions, exclude 2.0.0+
104
+ ```
105
+
106
+ **Version Information:**
107
+ - Check installed version: `mapify --version`
108
+ - [PyPI releases](https://pypi.org/project/mapify-cli/) - Available versions and package details
109
+ - [GitHub releases](https://github.com/azalio/map-framework/releases) - Changelog and release notes
110
+
111
+ ### Development Installation
112
+
113
+ For contributors or testing bleeding-edge features:
114
+
115
+ ```bash
116
+ # Install from git repository
117
+ uv tool install --from git+https://github.com/azalio/map-framework.git mapify-cli
118
+
119
+ # OR clone and install locally
120
+ git clone https://github.com/azalio/map-framework.git
121
+ cd map-framework
122
+ pip install -e .
123
+ ```
124
+
125
+ **Other installation methods** (manual copy, troubleshooting): See [INSTALL.md](docs/INSTALL.md)
126
+
127
+ **For maintainers**: Release process documented in [RELEASING.md](RELEASING.md)
128
+
129
+ ## Requirements
130
+
131
+ - **Claude Code CLI** — installed and configured
132
+ - **Python 3.11+** — for mapify CLI (optional)
133
+ - **Git** — for cloning repository
134
+
135
+ ## 🏗️ Architecture
136
+
137
+ MAP Framework orchestrates 8 specialized agents through slash commands:
138
+
139
+ - **TaskDecomposer** breaks goals into subtasks
140
+ - **Actor** generates code, **Monitor** validates quality
141
+ - **Predictor** analyzes impact, **Evaluator** scores solutions
142
+ - **Reflector/Curator** enable continuous learning via ACE playbook
143
+
144
+ The orchestration logic lives in `.claude/commands/map-*.md` prompts, coordinating agents via the Task tool.
145
+
146
+ **See [ARCHITECTURE.md](docs/ARCHITECTURE.md) for:**
147
+ - Detailed agent specifications and responsibilities
148
+ - MCP integration architecture and tool usage patterns
149
+ - Agent coordination protocol and workflow stages
150
+ - Template customization guide with examples
151
+ - Hooks integration (automated validation, knowledge storage, context enrichment)
152
+ - Context engineering principles and optimizations
153
+
154
+ ## 🔌 MCP Integration
155
+
156
+ MAP uses MCP (Model Context Protocol) servers for enhanced capabilities:
157
+
158
+ - **cipher** - Knowledge base for storing and retrieving successful patterns
159
+ - **claude-reviewer** - Professional code review with security analysis
160
+ - **context7** - Up-to-date library documentation
161
+ - **sequential-thinking** - Chain-of-thought reasoning for complex problems
162
+ - **codex-bridge** - AI code generation (requires extended timeout)
163
+ - **deepwiki** - GitHub repository intelligence
164
+
165
+ Configuration files: `.claude/mcp_config.json` and `mcp_config.json`
166
+
167
+ **See [ARCHITECTURE.md](docs/ARCHITECTURE.md#mcp-integration) for complete setup and usage patterns**
168
+
169
+ ## 📚 Usage Examples
170
+
171
+ ```bash
172
+ # Feature development
173
+ /map-feature implement user profile page with avatar upload
174
+
175
+ # Bug fixing
176
+ /map-debug debug why payment processing fails for amounts over $1000
177
+
178
+ # Refactoring
179
+ /map-refactor refactor OrderService to use dependency injection
180
+ ```
181
+
182
+ **See [USAGE.md](docs/USAGE.md) for:**
183
+ - Comprehensive usage examples with detailed scenarios
184
+ - Best practices for optimal results
185
+ - Cost optimization strategies (40-60% savings)
186
+ - Playbook management commands
187
+
188
+ ## 🎓 ACE Playbook
189
+
190
+ Built-in learning system that improves with each task:
191
+
192
+ - **Reflector** extracts patterns from successes and failures
193
+ - **Curator** maintains structured knowledge base with quality tracking
194
+ - **Semantic search** (optional) finds patterns by meaning, not keywords
195
+ - Automatically grows high-quality pattern library
196
+
197
+ ### Playbook Commands
198
+
199
+ ```bash
200
+ # View statistics
201
+ mapify playbook stats
202
+
203
+ # Search patterns
204
+ mapify playbook search "JWT authentication"
205
+
206
+ # View high-quality patterns
207
+ mapify playbook sync
208
+ ```
209
+
210
+ **Optional semantic search**: `pip install -r requirements-semantic.txt` for meaning-based matching. Details in [SEMANTIC_SEARCH_SETUP.md](docs/SEMANTIC_SEARCH_SETUP.md) and [ARCHITECTURE.md](docs/ARCHITECTURE.md#semantic-search).
211
+
212
+ **Playbook configuration**: See [ARCHITECTURE.md](docs/ARCHITECTURE.md#playbook-configuration) for top_k settings and optimization.
213
+
214
+ ## 💰 Cost Optimization
215
+
216
+ MAP Framework uses intelligent model selection per agent:
217
+
218
+ - **Predictor & Evaluator** use **haiku** (fast analysis) → ⬇️⬇️⬇️ cost
219
+ - **Actor, Monitor, Reflector, Curator** use **sonnet** (quality-critical) → balanced cost
220
+
221
+ **Result:** 40-60% cost reduction vs all-sonnet while maintaining code quality.
222
+
223
+ **See [USAGE.md](docs/USAGE.md#cost-optimization) for detailed cost breakdown and model override strategies**
224
+
225
+ ## 🔗 Hooks Integration
226
+
227
+ MAP integrates with Claude Code hooks for automated validation, knowledge storage, and context enrichment. Active hooks protect template variables, auto-store successful patterns, enrich prompts with relevant knowledge, and track performance metrics.
228
+
229
+ **See [ARCHITECTURE.md](docs/ARCHITECTURE.md#hooks-integration) and [.claude/hooks/README.md](.claude/hooks/README.md) for configuration**
230
+
231
+ ## 🛠️ Troubleshooting
232
+
233
+ ### Command Not Found
234
+
235
+ ```
236
+ Error: Slash command not recognized
237
+ ```
238
+
239
+ **Solution:**
240
+ - Ensure you're in a directory with `.claude/commands/` containing `map-*.md` files
241
+ - Use `/map-feature`, `/map-debug`, `/map-refactor`, or `/map-review`
242
+ - Run `/help` to see available commands
243
+
244
+ ### Agent Not Found
245
+
246
+ ```
247
+ Error: Agent file not found
248
+ ```
249
+
250
+ **Solution:** Ensure `.claude/agents/` directory contains all 8 agent files (task-decomposer.md, actor.md, monitor.md, predictor.md, evaluator.md, reflector.md, curator.md, documentation-reviewer.md)
251
+
252
+ ### Semantic Search Warning
253
+
254
+ ```
255
+ Warning: sentence-transformers not installed
256
+ ```
257
+
258
+ **Solution:** `pip install -r requirements-semantic.txt`
259
+ See [SEMANTIC_SEARCH_SETUP.md](docs/SEMANTIC_SEARCH_SETUP.md) for detailed troubleshooting
260
+
261
+ ### Infinite Loops
262
+
263
+ ```
264
+ Actor-Monitor loop exceeding iterations
265
+ ```
266
+
267
+ **Solution:** Orchestrator limits iterations to 3-5. Clarify requirements or add constraints.
268
+
269
+ **More troubleshooting**: See [INSTALL.md](docs/INSTALL.md#troubleshooting) for PATH issues, MCP configuration, and installation problems
270
+
271
+ ## 🔧 Customization
272
+
273
+ Agent prompts in `.claude/agents/*.md` use Handlebars template syntax for dynamic context injection. You can safely modify instructions, examples, and validation criteria, but **MUST NOT remove template variables** like `{{language}}`, `{{#if playbook_bullets}}`, or `{{feedback}}` — these are critical for orchestration and ACE learning.
274
+
275
+ **See [ARCHITECTURE.md](docs/ARCHITECTURE.md#customization-guide) for:**
276
+ - Safe vs unsafe modifications with examples
277
+ - Template variable reference
278
+ - Model selection per agent
279
+ - Adding custom agents
280
+ - Template validation and git hooks
281
+
282
+ ## 📊 Success Metrics
283
+
284
+ - **Monitor approval rate:** >80% first try
285
+ - **Evaluator scores:** average >7.0/10
286
+ - **Iteration count:** <3 per subtask
287
+ - **Playbook growth:** increasing high-quality patterns
288
+
289
+ ## 🤝 Contributing
290
+
291
+ Improvements welcome:
292
+ - Prompts for specific languages/frameworks
293
+ - New specialized agents
294
+ - CI/CD integrations
295
+ - Success story examples
296
+ - Plugin extensions for MAP Framework
297
+
298
+ ## 📄 License
299
+
300
+ MIT License — see LICENSE file for details
301
+
302
+ ## 🔗 References
303
+
304
+ - [MAP Paper - Nature Communications](https://github.com/Shanka123/MAP)
305
+ - [ACE Paper - arXiv:2510.04618v1](https://arxiv.org/abs/2510.04618v1)
306
+ - [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
307
+
308
+ ---
309
+
310
+ **MAP is not just automation — it's systematic quality improvement through structured validation and iterative refinement.**