mapify-cli 3.8.0__tar.gz → 3.10.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.
- mapify_cli-3.10.0/.claude/hooks/README.md +101 -0
- mapify_cli-3.10.0/.claude/skills/README.md +82 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/.gitignore +4 -0
- mapify_cli-3.10.0/PKG-INFO +256 -0
- mapify_cli-3.10.0/README.md +219 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/pyproject.toml +7 -2
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/__init__.py +340 -201
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/cli_ui.py +1 -1
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/config/project_config.py +113 -1
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/delivery/__init__.py +4 -0
- mapify_cli-3.10.0/src/mapify_cli/delivery/codex_copier.py +167 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/delivery/file_copier.py +21 -69
- mapify_cli-3.10.0/src/mapify_cli/delivery/providers.py +89 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/schemas.py +531 -3
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/CLAUDE.md +3 -2
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/actor.md +11 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/evaluator.md +5 -2
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/final-verifier.md +9 -3
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/monitor.md +32 -19
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/reflector.md +59 -3
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/research-agent.md +6 -3
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/task-decomposer.md +121 -23
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/AGENTS.md +38 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/agents/decomposer.toml +873 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/agents/monitor.toml +1144 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/agents/researcher.toml +74 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/config.toml +17 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates → mapify_cli-3.10.0/src/mapify_cli/templates/codex}/hooks/workflow-gate.py +58 -26
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/hooks.json +16 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/skills/map-check/SKILL.md +21 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/skills/map-explain/SKILL.md +166 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/skills/map-fast/SKILL.md +22 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/codex/skills/map-plan/SKILL.md +629 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/hooks/README.md +101 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/hooks/context-meter.py +154 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/hooks/detect-clarification-triggers.py +185 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/pre-compact-save-transcript.py +15 -1
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/workflow-context-injector.py +120 -23
- mapify_cli-3.10.0/src/mapify_cli/templates/hooks/workflow-gate.py +305 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/scripts/diagnostics.py +3 -3
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/scripts/map_orchestrator.py +190 -13
- mapify_cli-3.10.0/src/mapify_cli/templates/map/scripts/map_step_runner.py +4799 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/map/scripts/map_utils.py +43 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/decomposition-examples.md +33 -19
- mapify_cli-3.10.0/src/mapify_cli/templates/references/map-json-output-contracts.md +82 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/references/map-output-examples.md +74 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/settings.json +24 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/skills/README.md +82 -0
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-check.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-check/SKILL.md +48 -2
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-debug.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-debug/SKILL.md +82 -29
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-efficient.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-efficient/SKILL.md +81 -20
- mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-explain/SKILL.md +147 -0
- mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-fast/SKILL.md +175 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/skills/map-learn/SKILL.md +14 -0
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-plan.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-plan/SKILL.md +175 -64
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-release.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-release/SKILL.md +28 -2
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-resume.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-resume/SKILL.md +24 -3
- mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-review/SKILL.md +688 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/SKILL.md +1 -1
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/scripts/get-plan-path.sh +4 -4
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-task.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-task/SKILL.md +36 -4
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-tdd.md → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-tdd/SKILL.md +31 -5
- mapify_cli-3.10.0/src/mapify_cli/templates/skills/skill-rules.json +282 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/workflow-rules.json +13 -1
- mapify_cli-3.10.0/src/mapify_cli/token_budget.py +190 -0
- mapify_cli-3.8.0/.claude/skills/README.md +0 -199
- mapify_cli-3.8.0/PKG-INFO +0 -153
- mapify_cli-3.8.0/README.md +0 -121
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-fast.md +0 -133
- mapify_cli-3.8.0/src/mapify_cli/templates/commands/map-review.md +0 -392
- mapify_cli-3.8.0/src/mapify_cli/templates/map/scripts/map_step_runner.py +0 -2663
- mapify_cli-3.8.0/src/mapify_cli/templates/map/scripts/map_utils.py +0 -30
- mapify_cli-3.8.0/src/mapify_cli/templates/skills/README.md +0 -199
- mapify_cli-3.8.0/src/mapify_cli/templates/skills/skill-rules.json +0 -51
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/config/__init__.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/config/mcp.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/config/settings.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/delivery/agent_generator.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/delivery/managed_file_copier.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/dependency_graph.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/intent_detector.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/ralph_state.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/repo_insight.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/debate-arbiter.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/documentation-reviewer.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/predictor.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/agents/synthesizer.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/end-of-turn.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/post-compact-context.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/ralph-context-pruner.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/ralph-iteration-logger.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/hooks/safety-guardrails.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/analyze.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/handlers/common.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/handlers/go.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/handlers/python.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/handlers/rust.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/map/static-analysis/handlers/typescript.sh +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/ralph-loop-config.json +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/bash-guidelines.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/escalation-matrix.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/mcp-usage-examples.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/step-state-schema.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/references/workflow-state-schema.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/rules/learned/README.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/skills/map-learn/templates/example-rules.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/skills/map-learn/templates/rules-unconditional.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/templates/skills/map-learn/templates/rules-with-paths.md +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/scripts/check-complete.sh +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/scripts/init-session.sh +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/scripts/show-focus.sh +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/templates/findings.md +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/templates/iteration_history.md +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/templates/progress.md +0 -0
- {mapify_cli-3.8.0/src/mapify_cli/templates/skills/map-planning → mapify_cli-3.10.0/src/mapify_cli/templates/skills/map-state}/templates/task_plan.md +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/tools/__init__.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/tools/validate_dependencies.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/verification_recorder.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/workflow_finalizer.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/workflow_logger.py +0 -0
- {mapify_cli-3.8.0 → mapify_cli-3.10.0}/src/mapify_cli/workflow_state.py +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# MAP Hooks — Rules of the Road
|
|
2
|
+
|
|
3
|
+
This directory contains Claude Code hook scripts wired in via
|
|
4
|
+
`.claude/settings.json`. The conventions below are non-negotiable for any
|
|
5
|
+
new or modified hook.
|
|
6
|
+
|
|
7
|
+
## Exit codes
|
|
8
|
+
|
|
9
|
+
Per the official Claude Code hook docs, **only exit code 2 blocks the
|
|
10
|
+
action** for most hook events. Any other non-zero exit (including `1`) is
|
|
11
|
+
treated as a **non-blocking error** — Claude logs a warning and proceeds.
|
|
12
|
+
|
|
13
|
+
This means:
|
|
14
|
+
|
|
15
|
+
- **Never use `sys.exit(1)` to block.** It silently fails closed (the
|
|
16
|
+
blocked tool runs anyway).
|
|
17
|
+
- To block: emit a JSON `permissionDecision: "deny"` via stdout AND/OR
|
|
18
|
+
use `sys.exit(2)`. The current MAP hooks (`safety-guardrails.py`,
|
|
19
|
+
`workflow-gate.py`) use the JSON approach exclusively — follow that
|
|
20
|
+
pattern.
|
|
21
|
+
- For informational hooks (the majority — `workflow-context-injector.py`,
|
|
22
|
+
`detect-clarification-triggers.py`, etc.): **always exit 0** and emit
|
|
23
|
+
context via `hookSpecificOutput.additionalContext`.
|
|
24
|
+
|
|
25
|
+
Audited 2026-04-28: every existing hook in this directory exits 0 and
|
|
26
|
+
delegates blocking decisions to stdout JSON. No `sys.exit(1)` blocks
|
|
27
|
+
anywhere. Keep it that way.
|
|
28
|
+
|
|
29
|
+
## Special case: `WorktreeCreate`
|
|
30
|
+
|
|
31
|
+
Per the docs, `WorktreeCreate` blocks on **any** non-zero exit. None of
|
|
32
|
+
the current MAP hooks target this event, but if a future hook does:
|
|
33
|
+
explicit `sys.exit(0)` is mandatory unless intent is to block.
|
|
34
|
+
|
|
35
|
+
## JSON output schema (PreToolUse)
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"hookSpecificOutput": {
|
|
40
|
+
"hookEventName": "PreToolUse",
|
|
41
|
+
"permissionDecision": "deny", // or "allow", "ask", "defer"
|
|
42
|
+
"permissionDecisionReason": "<why>"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
For non-PreToolUse events (e.g., `UserPromptSubmit`, `SessionStart`):
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"hookSpecificOutput": {
|
|
52
|
+
"hookEventName": "<event-name>",
|
|
53
|
+
"additionalContext": "<text injected into Claude's context>"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Output is capped at 10,000 characters by Claude Code — keep messages
|
|
59
|
+
terse.
|
|
60
|
+
|
|
61
|
+
## Multi-hook precedence
|
|
62
|
+
|
|
63
|
+
When multiple hooks fire on the same event, decisions resolve as:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
deny > defer > ask > allow
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Practical implication: a single `deny` from any hook in the chain wins,
|
|
70
|
+
even if other hooks in the chain return `allow`. This is why MAP layers
|
|
71
|
+
`safety-guardrails.py` (always-on file/command blocklist) before
|
|
72
|
+
`workflow-gate.py` (workflow-state gate) — neither can override the
|
|
73
|
+
other's deny.
|
|
74
|
+
|
|
75
|
+
## Inputs
|
|
76
|
+
|
|
77
|
+
All hooks receive a JSON payload via stdin. Common fields:
|
|
78
|
+
|
|
79
|
+
- `session_id`, `transcript_path`, `cwd`, `permission_mode`,
|
|
80
|
+
`hook_event_name`
|
|
81
|
+
- `agent_id`, `agent_type` — present only when the hook fires inside a
|
|
82
|
+
subagent context
|
|
83
|
+
|
|
84
|
+
Event-specific fields (e.g., `tool_name`, `tool_input`, `prompt`) are
|
|
85
|
+
documented per event in the official Claude Code docs.
|
|
86
|
+
|
|
87
|
+
## Hook inventory
|
|
88
|
+
|
|
89
|
+
| Hook | Event | Blocking? | Purpose |
|
|
90
|
+
|------|-------|-----------|---------|
|
|
91
|
+
| `safety-guardrails.py` | `PreToolUse` (Edit/Write/Read/MultiEdit/Bash) | Yes (JSON deny) | Block sensitive files, dangerous commands |
|
|
92
|
+
| `workflow-gate.py` | `PreToolUse` (Edit/Write/MultiEdit) | Yes (JSON deny) | Enforce Actor+Monitor workflow before edits |
|
|
93
|
+
| `workflow-context-injector.py` | `PreToolUse` (Edit/Write/Bash) | No | Inject MAP workflow reminder |
|
|
94
|
+
| `ralph-iteration-logger.py` | `PostToolUse` | No | Log iterations, detect file thrashing |
|
|
95
|
+
| `ralph-context-pruner.py` | `PreCompact` | No | Save restore point, prune logs |
|
|
96
|
+
| `pre-compact-save-transcript.py` | `PreCompact` | No | Save full conversation transcript |
|
|
97
|
+
| `post-compact-context.py` | `SessionStart` (compact) | No | Inject restore-point context |
|
|
98
|
+
| `end-of-turn.sh` | `Stop` | No | Auto-fix lint/format silently |
|
|
99
|
+
| `detect-clarification-triggers.py` | `UserPromptSubmit` | No | Detect "ask if unclear" + async/durability language |
|
|
100
|
+
|
|
101
|
+
Last reviewed: 2026-04-28.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# MAP Skills System
|
|
2
|
+
|
|
3
|
+
MAP ships Claude Code skills as the runtime slash surface for MAP workflows and as supporting reference material. Skills are not agents, but they are not all passive documentation either: some skills define task procedures that call agents, run scripts, or write workflow artifacts.
|
|
4
|
+
|
|
5
|
+
## Skill Classes
|
|
6
|
+
|
|
7
|
+
MAP uses `skillClass` in `skill-rules.json` to make the runtime role explicit.
|
|
8
|
+
|
|
9
|
+
| Class | Use For | Runtime Boundary |
|
|
10
|
+
|-------|---------|------------------|
|
|
11
|
+
| `reference` | Conventions, heuristics, explanations, and decision support | Loads knowledge into the current session; should not own a deterministic workflow |
|
|
12
|
+
| `task` | Manual slash workflows such as `/map-efficient`, `/map-review`, and `/map-learn` | May orchestrate agents, run validation, and write artifacts when invoked |
|
|
13
|
+
| `hybrid` | Operational guidance with supporting hooks/scripts, currently `map-state` | Provides reference guidance and declares explicit `runtimeEffects` for hook or artifact side effects |
|
|
14
|
+
|
|
15
|
+
`type` and `enforcement` still describe activation behavior. `skillClass` describes what the skill is allowed to do after it is invoked.
|
|
16
|
+
|
|
17
|
+
## Current Classification
|
|
18
|
+
|
|
19
|
+
| Skill | Class | Notes |
|
|
20
|
+
|-------|-------|-------|
|
|
21
|
+
| `map-state` | `hybrid` | Explains branch-scoped planning and ships hooks/scripts that surface focus and completion checks |
|
|
22
|
+
| `map-learn` | `task` | Manual slash workflow with `disable-model-invocation: true`; writes learned rules from a completed workflow handoff |
|
|
23
|
+
| `map-plan`, `map-efficient`, `map-fast`, `map-debug`, `map-tdd`, `map-task`, `map-check`, `map-review`, `map-resume`, `map-release`, `map-explain` | `task` | Skill-backed slash workflows invoked directly by the user |
|
|
24
|
+
|
|
25
|
+
## Skills vs Agents
|
|
26
|
+
|
|
27
|
+
| Skills | Agents |
|
|
28
|
+
|--------|--------|
|
|
29
|
+
| Loaded through the Skill surface or invoked as slash workflows | Launched through the Task tool by a workflow |
|
|
30
|
+
| Define instructions, policies, hooks, scripts, and supporting files | Perform specialized analysis, implementation, review, or learning work |
|
|
31
|
+
| Own provider-facing runtime contracts under `.claude/skills/` | Own role-specific prompts under `.claude/agents/` |
|
|
32
|
+
| May call agents when the skill is a task workflow | Do not define slash surfaces themselves |
|
|
33
|
+
|
|
34
|
+
## File Structure
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
.claude/skills/
|
|
38
|
+
├── skill-rules.json # Activation and skillClass metadata
|
|
39
|
+
├── README.md # This file
|
|
40
|
+
├── map-state/
|
|
41
|
+
│ ├── SKILL.md
|
|
42
|
+
│ └── scripts/
|
|
43
|
+
├── map-learn/
|
|
44
|
+
│ ├── SKILL.md
|
|
45
|
+
│ └── templates/
|
|
46
|
+
└── map-*/SKILL.md # Skill-backed MAP slash workflows
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Authoring Guidance
|
|
50
|
+
|
|
51
|
+
Use a `reference` skill when the content is mostly durable knowledge: conventions, decision trees, examples, troubleshooting, or domain guidance. Reference skills should be safe to load opportunistically and should avoid owning multi-step mutation procedures.
|
|
52
|
+
|
|
53
|
+
Use a `task` skill when the skill behaves like a workflow: it has required steps, validation gates, agent calls, file writes, commits, releases, or other deterministic procedures. Manual slash task skills should normally use `disable-model-invocation: true` and an `argument-hint` so users see a clear invocation shape.
|
|
54
|
+
|
|
55
|
+
Use `hybrid` only when both are true: the skill is useful as reference material, and it also ships runtime helpers such as hooks or scripts. Hybrid skills must list `runtimeEffects` in `skill-rules.json` so users can tell which behavior comes from reading instructions and which behavior comes from installed hooks or scripts.
|
|
56
|
+
|
|
57
|
+
Keep `SKILL.md` focused on invocation policy, decision rules, and navigation to supporting files. Move long examples, troubleshooting matrices, and templates into supporting files so invoked skill content stays compact.
|
|
58
|
+
|
|
59
|
+
## Template Sync
|
|
60
|
+
|
|
61
|
+
The development copy under `.claude/skills/` must stay byte-for-byte synced with `src/mapify_cli/templates/skills/`, because `mapify init` installs the template copy into user projects.
|
|
62
|
+
|
|
63
|
+
Use:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
make sync-templates
|
|
67
|
+
pytest tests/test_skills.py tests/test_template_sync.py -v
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Troubleshooting
|
|
71
|
+
|
|
72
|
+
### Skill metadata drift
|
|
73
|
+
|
|
74
|
+
Run `pytest tests/test_skills.py -v`. The suite checks frontmatter, direct invocation metadata, skillClass values, hybrid runtime effects, trigger rules, supporting-file links, hook script paths, and template sync.
|
|
75
|
+
|
|
76
|
+
### Generated project does not match this branch
|
|
77
|
+
|
|
78
|
+
Run `uv run mapify init <new-temp-path> --no-git --mcp none` from this repo. Do not use a globally installed `mapify` binary for branch validation because it can lag behind local templates.
|
|
79
|
+
|
|
80
|
+
### New task skill is not invocable
|
|
81
|
+
|
|
82
|
+
Check that the skill has `argument-hint`, the direct `map-*` name appears in `skill-rules.json` keywords and intent patterns, and `skillClass` is `task`.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mapify-cli
|
|
3
|
+
Version: 3.10.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: hypothesis>=6.0.0; extra == 'dev'
|
|
19
|
+
Requires-Dist: jsonschema>=4.0.0; extra == 'dev'
|
|
20
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pyyaml>=6.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: truststore>=0.9.0; extra == 'dev'
|
|
27
|
+
Provides-Extra: ssl
|
|
28
|
+
Requires-Dist: truststore>=0.9.0; extra == 'ssl'
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: hypothesis>=6.0.0; extra == 'test'
|
|
31
|
+
Requires-Dist: jsonschema>=4.0.0; extra == 'test'
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
|
|
33
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == 'test'
|
|
34
|
+
Requires-Dist: pytest>=7.0.0; extra == 'test'
|
|
35
|
+
Requires-Dist: pyyaml>=6.0.0; extra == 'test'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
# MAP Framework
|
|
39
|
+
|
|
40
|
+
[](https://pypi.org/project/mapify-cli/)
|
|
41
|
+
[](https://www.python.org/downloads/)
|
|
42
|
+
|
|
43
|
+
> A structured AI development workflow for engineers who need control, not just generated code.
|
|
44
|
+
|
|
45
|
+
MAP turns Claude Code and Codex CLI from ad-hoc coding assistants into a repeatable engineering loop with explicit artifacts, review points, and project memory.
|
|
46
|
+
|
|
47
|
+
Without MAP:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
idea -> prompt -> code -> hope
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
With MAP:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
AI already writes code quickly. MAP helps you keep the architecture, scope, tests, and review process under control while it does.
|
|
60
|
+
|
|
61
|
+
## Why MAP Exists
|
|
62
|
+
|
|
63
|
+
Ad-hoc prompting feels fast on simple tasks. On complex systems, it often creates a different problem: code appears quickly, but the engineering process disappears.
|
|
64
|
+
|
|
65
|
+
Common failure modes:
|
|
66
|
+
|
|
67
|
+
- AI silently makes architecture decisions you did not approve.
|
|
68
|
+
- One prompt produces a large diff that is hard to review.
|
|
69
|
+
- Tests are written around the generated implementation, including its mistakes.
|
|
70
|
+
- The output compiles, but you cannot explain why the design is correct.
|
|
71
|
+
- The next session forgets the gotchas you already paid to discover.
|
|
72
|
+
|
|
73
|
+
MAP is a lightweight workflow for moving engineering judgment earlier: write down the behavior, split the work into small contracts, verify each stage, review against the spec, and save lessons for the next run.
|
|
74
|
+
|
|
75
|
+
## When To Use MAP
|
|
76
|
+
|
|
77
|
+
| Good fits | Poor fits |
|
|
78
|
+
|-----------|-----------|
|
|
79
|
+
| Complex backend features | Typos and tiny edits |
|
|
80
|
+
| Kubernetes controllers and operators | Small one-off scripts |
|
|
81
|
+
| Internal platform tooling | Product ideas where the desired behavior is still unknown |
|
|
82
|
+
| API, CRD, or domain-model changes with invariants | Broad rewrites without clear boundaries |
|
|
83
|
+
| Refactoring with a meaningful test harness | Tasks cheaper to do directly than to plan |
|
|
84
|
+
|
|
85
|
+
## Quick Start
|
|
86
|
+
|
|
87
|
+
**1. Install**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uv tool install mapify-cli
|
|
91
|
+
|
|
92
|
+
# or with pip
|
|
93
|
+
pip install mapify-cli
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**2. Initialize your project**
|
|
97
|
+
|
|
98
|
+
Claude Code is the default provider:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cd your-project
|
|
102
|
+
mapify init
|
|
103
|
+
claude
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Codex CLI is also supported:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
cd your-project
|
|
110
|
+
mapify init . --provider codex
|
|
111
|
+
codex
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Then enable the Codex hook manually: run `/hooks`, select `PreToolUse`, press `t` to toggle it on, then press `Esc`.
|
|
115
|
+
|
|
116
|
+
If your Codex version does not support the `hooks` feature key yet, either start it with `codex --enable codex_hooks` or upgrade Codex first. Upgrading is recommended.
|
|
117
|
+
|
|
118
|
+
Pick a context-compression policy if you want non-default behaviour
|
|
119
|
+
(`auto` is the default; see [docs/USAGE.md#context-budget-policy](docs/USAGE.md)):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
mapify init . --compression never # quality > cost
|
|
123
|
+
mapify init . --compression aggressive # cost > quality
|
|
124
|
+
mapify init . --compression-threshold 250000 # Opus 1M project
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**3. Use the golden path for serious work**
|
|
128
|
+
|
|
129
|
+
When a task has unclear behavior, multiple files, or real review risk, run the full loop:
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
/map-plan define the behavior and split the task
|
|
133
|
+
/map-efficient implement the approved plan
|
|
134
|
+
/map-check
|
|
135
|
+
/map-review
|
|
136
|
+
/map-learn
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Direct `/map-efficient` is for already-scoped tasks. If you are unsure, start with `/map-plan`.
|
|
140
|
+
|
|
141
|
+
Codex users should invoke MAP skills with `$`: type `$map-plan`, `$map-fast`, or `$map-check` instead of `/map-plan`, `/map-fast`, or `/map-check`. See the [Usage Guide](docs/USAGE.md#codex-cli-provider) for provider details.
|
|
142
|
+
|
|
143
|
+
## What Success Looks Like
|
|
144
|
+
|
|
145
|
+
After a good first workflow, you should see:
|
|
146
|
+
|
|
147
|
+
- a written plan or spec before implementation starts;
|
|
148
|
+
- small implementation contracts instead of one giant AI diff;
|
|
149
|
+
- verification and review artifacts under `.map/<branch>/`;
|
|
150
|
+
- review comments focused on correctness and semantics, not formatting noise;
|
|
151
|
+
- `/map-learn` preserving project rules, gotchas, and handoffs for future sessions.
|
|
152
|
+
|
|
153
|
+
MAP review is useful, but it is not a replacement for engineering judgment. Serious changes still need human review. The goal is to make that review smaller, earlier, and better grounded.
|
|
154
|
+
|
|
155
|
+
## Why Engineers Stick With It
|
|
156
|
+
|
|
157
|
+
- **Daily-driver speed** - optimized for repeated use, not occasional demo workflows.
|
|
158
|
+
- **Low overhead** - structured enough to prevent chaos, lightweight enough to keep token and time cost under control.
|
|
159
|
+
- **Calibrated workflow effort** - each shipped slash skill declares a `thinking_policy` and `parallel_tool_policy`, so lightweight commands stay direct while planning, review, and release workflows reserve deeper reasoning and parallel fan-out for the stages that benefit from it. Non-release prompts use targeted guardrails instead of blanket all-caps prohibition blocks, reducing over-triggered agents and tool calls while keeping true hard stops explicit.
|
|
160
|
+
- **Reviewable diffs** - planning and task contracts keep changes small enough to inspect.
|
|
161
|
+
- **Contract-sized subtasks** - `/map-plan` and `/map-efficient` require per-subtask `expected_diff_size`, `concern_type`, `one_logical_step`, `hard_constraints`, `soft_constraints`, and `coverage_map` metadata, then validate `blueprint.json` before implementation so oversized, mixed-concern, untraceable, or hard-constraint-dropping plans fail early instead of surprising reviewers later. Soft constraints can be consciously traded off only with explicit rationale.
|
|
162
|
+
- **Useful quality gates** - `/map-check` and `/map-review` validate against the plan instead of just asking whether code "looks fine".
|
|
163
|
+
- **Review bundle** - `/map-review` auto-generates `.map/<branch>/review-bundle.json` and `.map/<branch>/review-bundle.md` before launching reviewer agents, bundling spec, plan, tests, verification, latest code review, `coverage_map` acceptance-tag evidence, and prior-stage consumption status into a single durable input contract. Reviewers read the bundle first; raw diff is secondary. Use `/map-review --detached` to open an isolated read-only git worktree at `.map/<branch>/detached-review/` for clean-room inspection without touching the source branch. Bundle generation records the `review` stage in `.map/<branch>/artifact_manifest.json`; `python3 .map/scripts/map_step_runner.py validate_prior_stage_consumption review` can fail missing spec/blueprint/test/diff inputs before review. Section-order flags reduce anchoring bias: `--reverse-sections` (invert order), `--shuffle-sections [--seed N]` (seeded random order), `--compare-orderings` (run default + reverse, aggregate via strict-wins, surface drift).
|
|
164
|
+
- **Run health report** - `/map-efficient`, `/map-debug`, `/map-check`, and `/map-review` write `.map/<branch>/run_health_report.json` during closeout via `.map/scripts/map_step_runner.py write_run_health_report`. The report is a machine-readable snapshot of terminal status, step progress, retry counters, artifact presence, and latest hook-injection status, including explicit skipped reasons for malformed hook input or insignificant Bash commands when branch state can be safely updated. CI or operators can fail inconsistent closeouts with `python3 .map/scripts/map_step_runner.py validate_run_health_report`.
|
|
165
|
+
- **Project memory** - `/map-learn` turns hard-won fixes and gotchas into reusable context for the next session.
|
|
166
|
+
|
|
167
|
+
## Core Commands
|
|
168
|
+
|
|
169
|
+
| Command | Use For |
|
|
170
|
+
|---------|---------|
|
|
171
|
+
| `/map-plan` | Start here for non-trivial work; clarify behavior and decompose tasks |
|
|
172
|
+
| `/map-efficient` | Implement an approved plan or already-scoped task |
|
|
173
|
+
| `/map-fast` | Small, low-risk changes where full planning would be overhead |
|
|
174
|
+
| `/map-check` | Quality gates, verification, and artifact checks |
|
|
175
|
+
| `/map-review` | Pre-commit semantic review against the plan, tests, and diff |
|
|
176
|
+
| `/map-learn` | Capture project memory and reusable lessons |
|
|
177
|
+
| `/map-debug` | Bug fixes and debugging |
|
|
178
|
+
| `/map-task` | Execute a single subtask from an existing plan |
|
|
179
|
+
| `/map-tdd` | Test-first implementation workflow |
|
|
180
|
+
| `/map-release` | Package release workflow |
|
|
181
|
+
| `/map-resume` | Resume interrupted workflows |
|
|
182
|
+
|
|
183
|
+
[Detailed usage and options ->](docs/USAGE.md)
|
|
184
|
+
|
|
185
|
+
Canonical MAP flows:
|
|
186
|
+
|
|
187
|
+
- Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
188
|
+
- Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
189
|
+
- Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
190
|
+
|
|
191
|
+
`/map-plan` records a workflow-fit decision first, so trivial work can exit early with a direct edit or `/map-fast` recommendation instead of forcing full MAP planning.
|
|
192
|
+
|
|
193
|
+
These workflows maintain branch-scoped artifacts like `blueprint.json` with subtask size/concern contracts, `code-review-001.md`, `qa-001.md`, `verification-summary.md` with acceptance coverage and prior-stage consumption, `pr-draft.md`, `artifact_manifest.json`, `run_health_report.json` diagnostics, and run dossiers under `.map/<branch>/`. Targeted TDD flows also persist `test_contract_ST-00N.md` and `test_handoff_ST-00N.json` so `/map-task` can resume implementation from a clean red-phase handoff.
|
|
194
|
+
|
|
195
|
+
`LEARN` is the memory step of the MAP cycle. After implementation, checks, or review, MAP writes a learning handoff under `.map/<branch>/` so `/map-learn` can run later without reconstructing context. Pass `/map-learn [workflow-summary]` when you want to provide an explicit summary.
|
|
196
|
+
|
|
197
|
+
## Case Study
|
|
198
|
+
|
|
199
|
+
The DevOpsConf 2026 case study applies this process to a production Kubernetes Project Operator, not a toy CRUD app:
|
|
200
|
+
|
|
201
|
+
- human estimate: 90 days;
|
|
202
|
+
- MAP-style delivery: 7 days;
|
|
203
|
+
- workflow: `SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN`;
|
|
204
|
+
- small reviewable PRs instead of one giant generated diff;
|
|
205
|
+
- tests before implementation for critical pieces;
|
|
206
|
+
- semantic bugs caught in review before merge.
|
|
207
|
+
|
|
208
|
+
[DevOpsConf 2026 case study ->](https://github.com/azalio/devopsconf-ai-develop)
|
|
209
|
+
|
|
210
|
+
## How It Works
|
|
211
|
+
|
|
212
|
+
MAP orchestrates specialized roles through slash commands and skills:
|
|
213
|
+
|
|
214
|
+
```text
|
|
215
|
+
TaskDecomposer -> breaks goals into subtasks
|
|
216
|
+
Actor -> implements scoped tasks
|
|
217
|
+
Monitor -> validates quality and blocks invalid output
|
|
218
|
+
Predictor -> analyzes impact for risky changes
|
|
219
|
+
Learner -> captures reusable project memory
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
For Claude Code, MAP slash surfaces live in `.claude/skills/map-*/SKILL.md` files created by `mapify init`. The `.claude/commands/` directory is reserved for user-custom commands and a README that points back to the skill-backed MAP surfaces. The shipped skill catalog classifies skills with `skillClass`: MAP slash workflows are `task` skills, while `map-state` is a `hybrid` skill because it combines planning guidance with hooks/scripts that manage `.map/<branch>/` focus artifacts.
|
|
223
|
+
|
|
224
|
+
For Codex CLI, `mapify init . --provider codex` creates `.codex/skills/`, `.codex/agents/`, `.codex/config.toml`, hooks, and shared `.map/scripts/`.
|
|
225
|
+
|
|
226
|
+
MAP is inspired by [MAP cognitive architecture](https://github.com/Shanka123/MAP) (Nature Communications, 2025), which reported a 74% improvement in planning tasks. The CLI turns that idea into a practical software development workflow.
|
|
227
|
+
|
|
228
|
+
[Architecture deep-dive ->](docs/ARCHITECTURE.md)
|
|
229
|
+
|
|
230
|
+
## Documentation
|
|
231
|
+
|
|
232
|
+
| Guide | Description |
|
|
233
|
+
|-------|-------------|
|
|
234
|
+
| [Installation](docs/INSTALL.md) | All install methods, PATH setup, troubleshooting |
|
|
235
|
+
| [Usage Guide](docs/USAGE.md) | Workflows, examples, cost optimization, playbook |
|
|
236
|
+
| [Architecture](docs/ARCHITECTURE.md) | Agents, MCP integration, customization |
|
|
237
|
+
| [Platform Spec](docs/MAP_PLATFORM_SPEC.md) | Platform refactor roadmap, codebase analysis |
|
|
238
|
+
|
|
239
|
+
## Trouble?
|
|
240
|
+
|
|
241
|
+
- **Command not found** -> Run `mapify init` in your project first.
|
|
242
|
+
- **Agent errors** -> Check `.claude/agents/` has all shipped agent `.md` files, or run `mapify doctor`.
|
|
243
|
+
- **Poor output on a complex task** -> Start with `/map-plan` and feed `/map-efficient` the approved plan instead of asking it to infer the architecture.
|
|
244
|
+
- [More help ->](docs/INSTALL.md#troubleshooting)
|
|
245
|
+
|
|
246
|
+
## Contributing
|
|
247
|
+
|
|
248
|
+
Improvements welcome: prompts for specific languages, new agents, provider integrations, and CI/CD workflow support.
|
|
249
|
+
|
|
250
|
+
## License
|
|
251
|
+
|
|
252
|
+
MIT
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
Start with `/map-plan`. Keep the model inside your engineering process, not the other way around.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# MAP Framework
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/mapify-cli/)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
|
|
6
|
+
> A structured AI development workflow for engineers who need control, not just generated code.
|
|
7
|
+
|
|
8
|
+
MAP turns Claude Code and Codex CLI from ad-hoc coding assistants into a repeatable engineering loop with explicit artifacts, review points, and project memory.
|
|
9
|
+
|
|
10
|
+
Without MAP:
|
|
11
|
+
|
|
12
|
+
```text
|
|
13
|
+
idea -> prompt -> code -> hope
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
With MAP:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
AI already writes code quickly. MAP helps you keep the architecture, scope, tests, and review process under control while it does.
|
|
23
|
+
|
|
24
|
+
## Why MAP Exists
|
|
25
|
+
|
|
26
|
+
Ad-hoc prompting feels fast on simple tasks. On complex systems, it often creates a different problem: code appears quickly, but the engineering process disappears.
|
|
27
|
+
|
|
28
|
+
Common failure modes:
|
|
29
|
+
|
|
30
|
+
- AI silently makes architecture decisions you did not approve.
|
|
31
|
+
- One prompt produces a large diff that is hard to review.
|
|
32
|
+
- Tests are written around the generated implementation, including its mistakes.
|
|
33
|
+
- The output compiles, but you cannot explain why the design is correct.
|
|
34
|
+
- The next session forgets the gotchas you already paid to discover.
|
|
35
|
+
|
|
36
|
+
MAP is a lightweight workflow for moving engineering judgment earlier: write down the behavior, split the work into small contracts, verify each stage, review against the spec, and save lessons for the next run.
|
|
37
|
+
|
|
38
|
+
## When To Use MAP
|
|
39
|
+
|
|
40
|
+
| Good fits | Poor fits |
|
|
41
|
+
|-----------|-----------|
|
|
42
|
+
| Complex backend features | Typos and tiny edits |
|
|
43
|
+
| Kubernetes controllers and operators | Small one-off scripts |
|
|
44
|
+
| Internal platform tooling | Product ideas where the desired behavior is still unknown |
|
|
45
|
+
| API, CRD, or domain-model changes with invariants | Broad rewrites without clear boundaries |
|
|
46
|
+
| Refactoring with a meaningful test harness | Tasks cheaper to do directly than to plan |
|
|
47
|
+
|
|
48
|
+
## Quick Start
|
|
49
|
+
|
|
50
|
+
**1. Install**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv tool install mapify-cli
|
|
54
|
+
|
|
55
|
+
# or with pip
|
|
56
|
+
pip install mapify-cli
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**2. Initialize your project**
|
|
60
|
+
|
|
61
|
+
Claude Code is the default provider:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
cd your-project
|
|
65
|
+
mapify init
|
|
66
|
+
claude
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Codex CLI is also supported:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
cd your-project
|
|
73
|
+
mapify init . --provider codex
|
|
74
|
+
codex
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Then enable the Codex hook manually: run `/hooks`, select `PreToolUse`, press `t` to toggle it on, then press `Esc`.
|
|
78
|
+
|
|
79
|
+
If your Codex version does not support the `hooks` feature key yet, either start it with `codex --enable codex_hooks` or upgrade Codex first. Upgrading is recommended.
|
|
80
|
+
|
|
81
|
+
Pick a context-compression policy if you want non-default behaviour
|
|
82
|
+
(`auto` is the default; see [docs/USAGE.md#context-budget-policy](docs/USAGE.md)):
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
mapify init . --compression never # quality > cost
|
|
86
|
+
mapify init . --compression aggressive # cost > quality
|
|
87
|
+
mapify init . --compression-threshold 250000 # Opus 1M project
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**3. Use the golden path for serious work**
|
|
91
|
+
|
|
92
|
+
When a task has unclear behavior, multiple files, or real review risk, run the full loop:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
/map-plan define the behavior and split the task
|
|
96
|
+
/map-efficient implement the approved plan
|
|
97
|
+
/map-check
|
|
98
|
+
/map-review
|
|
99
|
+
/map-learn
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Direct `/map-efficient` is for already-scoped tasks. If you are unsure, start with `/map-plan`.
|
|
103
|
+
|
|
104
|
+
Codex users should invoke MAP skills with `$`: type `$map-plan`, `$map-fast`, or `$map-check` instead of `/map-plan`, `/map-fast`, or `/map-check`. See the [Usage Guide](docs/USAGE.md#codex-cli-provider) for provider details.
|
|
105
|
+
|
|
106
|
+
## What Success Looks Like
|
|
107
|
+
|
|
108
|
+
After a good first workflow, you should see:
|
|
109
|
+
|
|
110
|
+
- a written plan or spec before implementation starts;
|
|
111
|
+
- small implementation contracts instead of one giant AI diff;
|
|
112
|
+
- verification and review artifacts under `.map/<branch>/`;
|
|
113
|
+
- review comments focused on correctness and semantics, not formatting noise;
|
|
114
|
+
- `/map-learn` preserving project rules, gotchas, and handoffs for future sessions.
|
|
115
|
+
|
|
116
|
+
MAP review is useful, but it is not a replacement for engineering judgment. Serious changes still need human review. The goal is to make that review smaller, earlier, and better grounded.
|
|
117
|
+
|
|
118
|
+
## Why Engineers Stick With It
|
|
119
|
+
|
|
120
|
+
- **Daily-driver speed** - optimized for repeated use, not occasional demo workflows.
|
|
121
|
+
- **Low overhead** - structured enough to prevent chaos, lightweight enough to keep token and time cost under control.
|
|
122
|
+
- **Calibrated workflow effort** - each shipped slash skill declares a `thinking_policy` and `parallel_tool_policy`, so lightweight commands stay direct while planning, review, and release workflows reserve deeper reasoning and parallel fan-out for the stages that benefit from it. Non-release prompts use targeted guardrails instead of blanket all-caps prohibition blocks, reducing over-triggered agents and tool calls while keeping true hard stops explicit.
|
|
123
|
+
- **Reviewable diffs** - planning and task contracts keep changes small enough to inspect.
|
|
124
|
+
- **Contract-sized subtasks** - `/map-plan` and `/map-efficient` require per-subtask `expected_diff_size`, `concern_type`, `one_logical_step`, `hard_constraints`, `soft_constraints`, and `coverage_map` metadata, then validate `blueprint.json` before implementation so oversized, mixed-concern, untraceable, or hard-constraint-dropping plans fail early instead of surprising reviewers later. Soft constraints can be consciously traded off only with explicit rationale.
|
|
125
|
+
- **Useful quality gates** - `/map-check` and `/map-review` validate against the plan instead of just asking whether code "looks fine".
|
|
126
|
+
- **Review bundle** - `/map-review` auto-generates `.map/<branch>/review-bundle.json` and `.map/<branch>/review-bundle.md` before launching reviewer agents, bundling spec, plan, tests, verification, latest code review, `coverage_map` acceptance-tag evidence, and prior-stage consumption status into a single durable input contract. Reviewers read the bundle first; raw diff is secondary. Use `/map-review --detached` to open an isolated read-only git worktree at `.map/<branch>/detached-review/` for clean-room inspection without touching the source branch. Bundle generation records the `review` stage in `.map/<branch>/artifact_manifest.json`; `python3 .map/scripts/map_step_runner.py validate_prior_stage_consumption review` can fail missing spec/blueprint/test/diff inputs before review. Section-order flags reduce anchoring bias: `--reverse-sections` (invert order), `--shuffle-sections [--seed N]` (seeded random order), `--compare-orderings` (run default + reverse, aggregate via strict-wins, surface drift).
|
|
127
|
+
- **Run health report** - `/map-efficient`, `/map-debug`, `/map-check`, and `/map-review` write `.map/<branch>/run_health_report.json` during closeout via `.map/scripts/map_step_runner.py write_run_health_report`. The report is a machine-readable snapshot of terminal status, step progress, retry counters, artifact presence, and latest hook-injection status, including explicit skipped reasons for malformed hook input or insignificant Bash commands when branch state can be safely updated. CI or operators can fail inconsistent closeouts with `python3 .map/scripts/map_step_runner.py validate_run_health_report`.
|
|
128
|
+
- **Project memory** - `/map-learn` turns hard-won fixes and gotchas into reusable context for the next session.
|
|
129
|
+
|
|
130
|
+
## Core Commands
|
|
131
|
+
|
|
132
|
+
| Command | Use For |
|
|
133
|
+
|---------|---------|
|
|
134
|
+
| `/map-plan` | Start here for non-trivial work; clarify behavior and decompose tasks |
|
|
135
|
+
| `/map-efficient` | Implement an approved plan or already-scoped task |
|
|
136
|
+
| `/map-fast` | Small, low-risk changes where full planning would be overhead |
|
|
137
|
+
| `/map-check` | Quality gates, verification, and artifact checks |
|
|
138
|
+
| `/map-review` | Pre-commit semantic review against the plan, tests, and diff |
|
|
139
|
+
| `/map-learn` | Capture project memory and reusable lessons |
|
|
140
|
+
| `/map-debug` | Bug fixes and debugging |
|
|
141
|
+
| `/map-task` | Execute a single subtask from an existing plan |
|
|
142
|
+
| `/map-tdd` | Test-first implementation workflow |
|
|
143
|
+
| `/map-release` | Package release workflow |
|
|
144
|
+
| `/map-resume` | Resume interrupted workflows |
|
|
145
|
+
|
|
146
|
+
[Detailed usage and options ->](docs/USAGE.md)
|
|
147
|
+
|
|
148
|
+
Canonical MAP flows:
|
|
149
|
+
|
|
150
|
+
- Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
151
|
+
- Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
152
|
+
- Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review` -> `/map-learn`
|
|
153
|
+
|
|
154
|
+
`/map-plan` records a workflow-fit decision first, so trivial work can exit early with a direct edit or `/map-fast` recommendation instead of forcing full MAP planning.
|
|
155
|
+
|
|
156
|
+
These workflows maintain branch-scoped artifacts like `blueprint.json` with subtask size/concern contracts, `code-review-001.md`, `qa-001.md`, `verification-summary.md` with acceptance coverage and prior-stage consumption, `pr-draft.md`, `artifact_manifest.json`, `run_health_report.json` diagnostics, and run dossiers under `.map/<branch>/`. Targeted TDD flows also persist `test_contract_ST-00N.md` and `test_handoff_ST-00N.json` so `/map-task` can resume implementation from a clean red-phase handoff.
|
|
157
|
+
|
|
158
|
+
`LEARN` is the memory step of the MAP cycle. After implementation, checks, or review, MAP writes a learning handoff under `.map/<branch>/` so `/map-learn` can run later without reconstructing context. Pass `/map-learn [workflow-summary]` when you want to provide an explicit summary.
|
|
159
|
+
|
|
160
|
+
## Case Study
|
|
161
|
+
|
|
162
|
+
The DevOpsConf 2026 case study applies this process to a production Kubernetes Project Operator, not a toy CRUD app:
|
|
163
|
+
|
|
164
|
+
- human estimate: 90 days;
|
|
165
|
+
- MAP-style delivery: 7 days;
|
|
166
|
+
- workflow: `SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN`;
|
|
167
|
+
- small reviewable PRs instead of one giant generated diff;
|
|
168
|
+
- tests before implementation for critical pieces;
|
|
169
|
+
- semantic bugs caught in review before merge.
|
|
170
|
+
|
|
171
|
+
[DevOpsConf 2026 case study ->](https://github.com/azalio/devopsconf-ai-develop)
|
|
172
|
+
|
|
173
|
+
## How It Works
|
|
174
|
+
|
|
175
|
+
MAP orchestrates specialized roles through slash commands and skills:
|
|
176
|
+
|
|
177
|
+
```text
|
|
178
|
+
TaskDecomposer -> breaks goals into subtasks
|
|
179
|
+
Actor -> implements scoped tasks
|
|
180
|
+
Monitor -> validates quality and blocks invalid output
|
|
181
|
+
Predictor -> analyzes impact for risky changes
|
|
182
|
+
Learner -> captures reusable project memory
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
For Claude Code, MAP slash surfaces live in `.claude/skills/map-*/SKILL.md` files created by `mapify init`. The `.claude/commands/` directory is reserved for user-custom commands and a README that points back to the skill-backed MAP surfaces. The shipped skill catalog classifies skills with `skillClass`: MAP slash workflows are `task` skills, while `map-state` is a `hybrid` skill because it combines planning guidance with hooks/scripts that manage `.map/<branch>/` focus artifacts.
|
|
186
|
+
|
|
187
|
+
For Codex CLI, `mapify init . --provider codex` creates `.codex/skills/`, `.codex/agents/`, `.codex/config.toml`, hooks, and shared `.map/scripts/`.
|
|
188
|
+
|
|
189
|
+
MAP is inspired by [MAP cognitive architecture](https://github.com/Shanka123/MAP) (Nature Communications, 2025), which reported a 74% improvement in planning tasks. The CLI turns that idea into a practical software development workflow.
|
|
190
|
+
|
|
191
|
+
[Architecture deep-dive ->](docs/ARCHITECTURE.md)
|
|
192
|
+
|
|
193
|
+
## Documentation
|
|
194
|
+
|
|
195
|
+
| Guide | Description |
|
|
196
|
+
|-------|-------------|
|
|
197
|
+
| [Installation](docs/INSTALL.md) | All install methods, PATH setup, troubleshooting |
|
|
198
|
+
| [Usage Guide](docs/USAGE.md) | Workflows, examples, cost optimization, playbook |
|
|
199
|
+
| [Architecture](docs/ARCHITECTURE.md) | Agents, MCP integration, customization |
|
|
200
|
+
| [Platform Spec](docs/MAP_PLATFORM_SPEC.md) | Platform refactor roadmap, codebase analysis |
|
|
201
|
+
|
|
202
|
+
## Trouble?
|
|
203
|
+
|
|
204
|
+
- **Command not found** -> Run `mapify init` in your project first.
|
|
205
|
+
- **Agent errors** -> Check `.claude/agents/` has all shipped agent `.md` files, or run `mapify doctor`.
|
|
206
|
+
- **Poor output on a complex task** -> Start with `/map-plan` and feed `/map-efficient` the approved plan instead of asking it to infer the architecture.
|
|
207
|
+
- [More help ->](docs/INSTALL.md#troubleshooting)
|
|
208
|
+
|
|
209
|
+
## Contributing
|
|
210
|
+
|
|
211
|
+
Improvements welcome: prompts for specific languages, new agents, provider integrations, and CI/CD workflow support.
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
MIT
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
Start with `/map-plan`. Keep the model inside your engineering process, not the other way around.
|