mapify-cli 3.6.0__tar.gz → 3.8.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 (104) hide show
  1. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/.gitignore +2 -0
  2. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/PKG-INFO +14 -7
  3. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/README.md +13 -6
  4. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/pyproject.toml +1 -1
  5. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/__init__.py +1 -1
  6. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/delivery/file_copier.py +4 -12
  7. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/delivery/managed_file_copier.py +33 -0
  8. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/repo_insight.py +76 -0
  9. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/schemas.py +156 -0
  10. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/actor.md +22 -4
  11. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/monitor.md +77 -27
  12. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/task-decomposer.md +19 -1
  13. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-check.md +13 -0
  14. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-debug.md +13 -3
  15. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-efficient.md +255 -120
  16. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-plan.md +117 -5
  17. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-review.md +28 -1
  18. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-task.md +13 -4
  19. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-tdd.md +82 -10
  20. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/workflow-context-injector.py +80 -3
  21. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/scripts/map_orchestrator.py +519 -17
  22. mapify_cli-3.8.0/src/mapify_cli/templates/map/scripts/map_step_runner.py +2663 -0
  23. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-learn/SKILL.md +37 -5
  24. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/SKILL.md +4 -6
  25. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/skill-rules.json +0 -46
  26. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/workflow-rules.json +0 -19
  27. mapify_cli-3.6.0/src/mapify_cli/templates/commands/map-debate.md +0 -408
  28. mapify_cli-3.6.0/src/mapify_cli/templates/commands/map-learn.md +0 -301
  29. mapify_cli-3.6.0/src/mapify_cli/templates/map/scripts/map_step_runner.py +0 -1092
  30. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-cli-reference/SKILL.md +0 -124
  31. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-cli-reference/scripts/check-command.sh +0 -117
  32. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/SKILL.md +0 -529
  33. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/agent-architecture.md +0 -266
  34. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-debug-deep-dive.md +0 -258
  35. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-efficient-deep-dive.md +0 -202
  36. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-fast-deep-dive.md +0 -234
  37. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-feature-deep-dive.md +0 -235
  38. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/resources/map-refactor-deep-dive.md +0 -332
  39. mapify_cli-3.6.0/src/mapify_cli/templates/skills/map-workflows-guide/scripts/validate-workflow-choice.py +0 -159
  40. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/.claude/skills/README.md +0 -0
  41. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/cli_ui.py +0 -0
  42. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/config/__init__.py +0 -0
  43. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/config/mcp.py +0 -0
  44. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/config/project_config.py +0 -0
  45. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/config/settings.py +0 -0
  46. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/delivery/__init__.py +0 -0
  47. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/delivery/agent_generator.py +0 -0
  48. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/dependency_graph.py +0 -0
  49. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/intent_detector.py +0 -0
  50. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/ralph_state.py +0 -0
  51. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/CLAUDE.md +0 -0
  52. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/debate-arbiter.md +0 -0
  53. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/documentation-reviewer.md +0 -0
  54. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/evaluator.md +0 -0
  55. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/final-verifier.md +0 -0
  56. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/predictor.md +0 -0
  57. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/reflector.md +0 -0
  58. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/research-agent.md +0 -0
  59. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/agents/synthesizer.md +0 -0
  60. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-fast.md +0 -0
  61. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-release.md +0 -0
  62. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/commands/map-resume.md +0 -0
  63. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/end-of-turn.sh +0 -0
  64. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/post-compact-context.py +0 -0
  65. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/pre-compact-save-transcript.py +0 -0
  66. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/ralph-context-pruner.py +0 -0
  67. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/ralph-iteration-logger.py +0 -0
  68. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/safety-guardrails.py +0 -0
  69. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/hooks/workflow-gate.py +0 -0
  70. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/scripts/diagnostics.py +0 -0
  71. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/scripts/map_utils.py +0 -0
  72. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/analyze.sh +0 -0
  73. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/handlers/common.sh +0 -0
  74. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/handlers/go.sh +0 -0
  75. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/handlers/python.sh +0 -0
  76. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/handlers/rust.sh +0 -0
  77. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/map/static-analysis/handlers/typescript.sh +0 -0
  78. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/ralph-loop-config.json +0 -0
  79. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/bash-guidelines.md +0 -0
  80. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/decomposition-examples.md +0 -0
  81. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/escalation-matrix.md +0 -0
  82. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/mcp-usage-examples.md +0 -0
  83. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/step-state-schema.md +0 -0
  84. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/references/workflow-state-schema.md +0 -0
  85. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/rules/learned/README.md +0 -0
  86. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/settings.json +0 -0
  87. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/README.md +0 -0
  88. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-learn/templates/example-rules.md +0 -0
  89. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-learn/templates/rules-unconditional.md +0 -0
  90. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-learn/templates/rules-with-paths.md +0 -0
  91. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/scripts/check-complete.sh +0 -0
  92. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/scripts/get-plan-path.sh +0 -0
  93. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/scripts/init-session.sh +0 -0
  94. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/scripts/show-focus.sh +0 -0
  95. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/templates/findings.md +0 -0
  96. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/templates/iteration_history.md +0 -0
  97. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/templates/progress.md +0 -0
  98. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/templates/skills/map-planning/templates/task_plan.md +0 -0
  99. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/tools/__init__.py +0 -0
  100. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/tools/validate_dependencies.py +0 -0
  101. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/verification_recorder.py +0 -0
  102. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/workflow_finalizer.py +0 -0
  103. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/workflow_logger.py +0 -0
  104. {mapify_cli-3.6.0 → mapify_cli-3.8.0}/src/mapify_cli/workflow_state.py +0 -0
@@ -42,11 +42,13 @@ coverage.json
42
42
  .claude/sessions/
43
43
  .claude/metrics/
44
44
  .claude/cache/
45
+ .claude/worktrees/
45
46
 
46
47
  # MAP runtime files (but keep static-analysis and orchestrator scripts)
47
48
  .map/*
48
49
  !.map/static-analysis/
49
50
  !.map/scripts/
51
+ .map/scripts/.map/
50
52
 
51
53
  # Temporary verification files
52
54
  mapify_cli_verification_*.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapify-cli
3
- Version: 3.6.0
3
+ Version: 3.8.0
4
4
  Summary: MAP Framework installer - Modular Agentic Planner for Claude Code
5
5
  Project-URL: Homepage, https://github.com/azalio/map-framework
6
6
  Project-URL: Repository, https://github.com/azalio/map-framework.git
@@ -80,7 +80,6 @@ claude
80
80
  | `/map-efficient` | Production features, refactoring, complex tasks (recommended) |
81
81
  | `/map-debug` | Bug fixes and debugging |
82
82
  | `/map-fast` | Small, low-risk changes |
83
- | `/map-debate` | Complex decisions with multi-variant synthesis |
84
83
  | `/map-review` | Pre-commit code review |
85
84
  | `/map-check` | Quality gates and verification |
86
85
  | `/map-plan` | Task decomposition without implementation |
@@ -88,17 +87,21 @@ claude
88
87
  | `/map-tdd` | Test-first implementation workflow |
89
88
  | `/map-release` | Package release workflow |
90
89
  | `/map-resume` | Resume interrupted workflows |
91
- | `/map-learn` | Extract lessons after workflow completion |
90
+ | `/map-learn` | Extract lessons after workflow completion; optional `[workflow-summary]` |
92
91
 
93
92
  [Detailed usage and options →](docs/USAGE.md)
94
93
 
95
94
  Canonical MAP flows:
96
95
 
97
- - Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review`
98
- - Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review`
99
- - Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review`
96
+ - Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review` -> `/map-learn` (when you want to pay the learning cost)
97
+ - Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review` -> `/map-learn`
98
+ - Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review` -> `/map-learn`
100
99
 
101
- These workflows maintain branch-scoped artifacts like `code-review-001.md`, `qa-001.md`, `verification-summary.md`, `pr-draft.md`, and run dossiers under `.map/<branch>/`.
100
+ `/map-plan` now 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.
101
+
102
+ These workflows maintain branch-scoped artifacts like `code-review-001.md`, `qa-001.md`, `verification-summary.md`, `pr-draft.md`, `artifact_manifest.json`, 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.
103
+
104
+ `LEARN` is still the philosophical end of the MAP cycle, but runtime keeps it soft: `/map-efficient`, `/map-debug`, `/map-check`, and `/map-review` now write `learning-handoff.md` / `.json` under `.map/<branch>/`, so `/map-learn [workflow-summary]` can run immediately with an explicit summary or later with no argument by auto-loading the generated handoff.
102
105
 
103
106
  ## How It Works
104
107
 
@@ -127,6 +130,10 @@ The orchestration lives in `.claude/commands/map-*.md` prompts created by `mapif
127
130
  | [Architecture](docs/ARCHITECTURE.md) | Agents, MCP integration, customization |
128
131
  | [Platform Spec](docs/MAP_PLATFORM_SPEC.md) | Platform refactor roadmap, codebase analysis |
129
132
 
133
+ ## Case Study
134
+
135
+ - [DevOpsConf 2026 case study](https://github.com/azalio/devopsconf-ai-develop) — real production case: SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN
136
+
130
137
  ## Trouble?
131
138
 
132
139
  - **Command not found** → Run `mapify init` in your project first
@@ -48,7 +48,6 @@ claude
48
48
  | `/map-efficient` | Production features, refactoring, complex tasks (recommended) |
49
49
  | `/map-debug` | Bug fixes and debugging |
50
50
  | `/map-fast` | Small, low-risk changes |
51
- | `/map-debate` | Complex decisions with multi-variant synthesis |
52
51
  | `/map-review` | Pre-commit code review |
53
52
  | `/map-check` | Quality gates and verification |
54
53
  | `/map-plan` | Task decomposition without implementation |
@@ -56,17 +55,21 @@ claude
56
55
  | `/map-tdd` | Test-first implementation workflow |
57
56
  | `/map-release` | Package release workflow |
58
57
  | `/map-resume` | Resume interrupted workflows |
59
- | `/map-learn` | Extract lessons after workflow completion |
58
+ | `/map-learn` | Extract lessons after workflow completion; optional `[workflow-summary]` |
60
59
 
61
60
  [Detailed usage and options →](docs/USAGE.md)
62
61
 
63
62
  Canonical MAP flows:
64
63
 
65
- - Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review`
66
- - Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review`
67
- - Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review`
64
+ - Standard: `/map-plan` -> `/map-efficient` -> `/map-check` -> `/map-review` -> `/map-learn` (when you want to pay the learning cost)
65
+ - Full TDD: `/map-plan` -> `/map-tdd` -> `/map-check` -> `/map-review` -> `/map-learn`
66
+ - Targeted subtask TDD: `/map-plan` -> `/map-tdd ST-001` -> `/map-task ST-001` -> ... -> `/map-check` -> `/map-review` -> `/map-learn`
68
67
 
69
- These workflows maintain branch-scoped artifacts like `code-review-001.md`, `qa-001.md`, `verification-summary.md`, `pr-draft.md`, and run dossiers under `.map/<branch>/`.
68
+ `/map-plan` now 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.
69
+
70
+ These workflows maintain branch-scoped artifacts like `code-review-001.md`, `qa-001.md`, `verification-summary.md`, `pr-draft.md`, `artifact_manifest.json`, 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.
71
+
72
+ `LEARN` is still the philosophical end of the MAP cycle, but runtime keeps it soft: `/map-efficient`, `/map-debug`, `/map-check`, and `/map-review` now write `learning-handoff.md` / `.json` under `.map/<branch>/`, so `/map-learn [workflow-summary]` can run immediately with an explicit summary or later with no argument by auto-loading the generated handoff.
70
73
 
71
74
  ## How It Works
72
75
 
@@ -95,6 +98,10 @@ The orchestration lives in `.claude/commands/map-*.md` prompts created by `mapif
95
98
  | [Architecture](docs/ARCHITECTURE.md) | Agents, MCP integration, customization |
96
99
  | [Platform Spec](docs/MAP_PLATFORM_SPEC.md) | Platform refactor roadmap, codebase analysis |
97
100
 
101
+ ## Case Study
102
+
103
+ - [DevOpsConf 2026 case study](https://github.com/azalio/devopsconf-ai-develop) — real production case: SPEC -> PLAN -> TEST -> CODE -> REVIEW -> LEARN
104
+
98
105
  ## Trouble?
99
106
 
100
107
  - **Command not found** → Run `mapify init` in your project first
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mapify-cli"
3
- version = "3.6.0"
3
+ version = "3.8.0"
4
4
  description = "MAP Framework installer - Modular Agentic Planner for Claude Code"
5
5
  authors = [{ name = "MAP Framework Contributors" }]
6
6
  readme = "README.md"
@@ -23,7 +23,7 @@ Or install globally:
23
23
  mapify check
24
24
  """
25
25
 
26
- __version__ = "3.6.0"
26
+ __version__ = "3.8.0"
27
27
 
28
28
  import os
29
29
  import subprocess
@@ -184,16 +184,6 @@ $ARGUMENTS
184
184
 
185
185
  Implement quickly with basic monitor validation only. No learning, no predictor.
186
186
  Use for small, low-risk changes where speed matters.
187
- """,
188
- "map-learn": """---
189
- description: Extract lessons from completed workflows
190
- ---
191
-
192
- Extract and preserve lessons from recent workflow:
193
-
194
- $ARGUMENTS
195
-
196
- Call Reflector to extract patterns from recent workflow.
197
187
  """,
198
188
  }
199
189
 
@@ -312,14 +302,16 @@ This directory contains custom slash commands for Claude Code.
312
302
  - `/map-task` - Execute a single subtask from an existing plan
313
303
  - `/map-tdd` - Run a test-first workflow for one task or plan
314
304
  - `/map-debug` - Debug issues using MAP analysis
315
- - `/map-debate` - Generate variants and synthesize the best result
316
305
  - `/map-review` - Run a structured review workflow
317
306
  - `/map-check` - Run workflow quality gates and verification
318
307
  - `/map-fast` - Quick implementation with minimal validation
319
- - `/map-learn` - Extract lessons from completed workflows
320
308
  - `/map-release` - Execute MAP Framework package release workflow
321
309
  - `/map-resume` - Resume an interrupted workflow from `.map/`
322
310
 
311
+ ## Skill-Backed Slash Surfaces
312
+
313
+ - `/map-learn` - Extract lessons from completed workflows (implemented via `.claude/skills/map-learn/SKILL.md`)
314
+
323
315
  ## Creating Custom Commands
324
316
 
325
317
  Create a new `.md` file in this directory with the following format:
@@ -103,6 +103,17 @@ def inject_metadata(content: str, ext: str, version: str, template_hash: str) ->
103
103
 
104
104
  if ext == ".md":
105
105
  header = f"<!-- {_MANAGED_TAG}: {meta_json} -->\n"
106
+ # If content has YAML frontmatter (starts with ---), insert after
107
+ # closing --- to preserve frontmatter parsing by tools like Claude Code.
108
+ if content.startswith("---\n"):
109
+ end_idx = content.find("\n---\n", 3)
110
+ if end_idx != -1:
111
+ insert_pos = end_idx + 5 # after \n---\n
112
+ return content[:insert_pos] + header + content[insert_pos:]
113
+ # Edge case: closing --- at very end (no trailing newline)
114
+ end_idx = content.find("\n---", 3)
115
+ if end_idx != -1 and end_idx + 4 == len(content):
116
+ return content + "\n" + header
106
117
  return header + content
107
118
 
108
119
  if ext == ".py":
@@ -135,6 +146,7 @@ def extract_metadata(content: str, ext: str) -> tuple[Optional[dict[str, Any]],
135
146
  Returns (None, original_content) if no metadata found.
136
147
  """
137
148
  if ext == ".md":
149
+ # Try at start of file (non-frontmatter .md files)
138
150
  m = _MD_PATTERN.match(content)
139
151
  if m:
140
152
  try:
@@ -142,6 +154,27 @@ def extract_metadata(content: str, ext: str) -> tuple[Optional[dict[str, Any]],
142
154
  return meta, content[m.end() :]
143
155
  except json.JSONDecodeError:
144
156
  pass
157
+ # Try after YAML frontmatter (agent .md files with ---)
158
+ if content.startswith("---\n"):
159
+ end_idx = content.find("\n---\n", 3)
160
+ if end_idx != -1:
161
+ after_fm = end_idx + 5
162
+ rest = content[after_fm:]
163
+ m = _MD_PATTERN.match(rest)
164
+ if m:
165
+ try:
166
+ meta = json.loads(m.group(1))
167
+ clean = content[:after_fm] + rest[m.end() :]
168
+ # If nothing followed the MAP-MANAGED comment (it was
169
+ # at EOF) and clean ends with "\n---\n", the trailing
170
+ # newline was injected by inject_metadata for the
171
+ # frontmatter-at-EOF edge case. Strip it to restore
172
+ # the original content that had no trailing newline.
173
+ if not rest[m.end() :] and clean.endswith("\n---\n"):
174
+ clean = clean[:-1]
175
+ return meta, clean
176
+ except json.JSONDecodeError:
177
+ pass
145
178
  return None, content
146
179
 
147
180
  if ext == ".py":
@@ -7,6 +7,7 @@ and key directories for workflow initialization.
7
7
  from pathlib import Path
8
8
  from typing import List
9
9
  import json
10
+ import subprocess
10
11
 
11
12
 
12
13
  def detect_language(project_root: Path) -> str:
@@ -201,3 +202,78 @@ def _validate_repo_insight_schema(data: dict) -> None:
201
202
  for dir_path in data["key_dirs"]:
202
203
  if dir_path.startswith("/"):
203
204
  raise ValueError(f"key_dirs must be relative paths: {dir_path}")
205
+
206
+
207
+ def compute_differential_insight(project_root: Path, since_sha: str | None) -> dict:
208
+ """Compute file changes since a given git SHA.
209
+
210
+ Used for context-aware injection: shows Actor only files
211
+ that changed since the last subtask completed.
212
+
213
+ Args:
214
+ project_root: Path to project root
215
+ since_sha: Git SHA to diff against (None = no baseline)
216
+
217
+ Returns:
218
+ Dict with changed_files, deleted_files. On success also includes
219
+ since_sha and current_sha. On error: empty lists and error key.
220
+ When since_sha is None: empty lists and note key.
221
+ """
222
+ if since_sha is None:
223
+ return {"changed_files": [], "deleted_files": [], "note": "no baseline SHA"}
224
+
225
+ try:
226
+ # Get changed/added/modified/renamed files
227
+ result = subprocess.run(
228
+ ["git", "diff", "--name-only", "--diff-filter=ACMR", since_sha, "HEAD"],
229
+ capture_output=True,
230
+ text=True,
231
+ cwd=project_root,
232
+ timeout=2,
233
+ )
234
+ if result.returncode != 0:
235
+ return {
236
+ "changed_files": [],
237
+ "deleted_files": [],
238
+ "error": f"git diff failed: {result.stderr.strip()}",
239
+ }
240
+ changed = [f for f in result.stdout.strip().split("\n") if f]
241
+
242
+ # Get deleted files
243
+ result_del = subprocess.run(
244
+ ["git", "diff", "--name-only", "--diff-filter=D", since_sha, "HEAD"],
245
+ capture_output=True,
246
+ text=True,
247
+ cwd=project_root,
248
+ timeout=2,
249
+ )
250
+ deleted = (
251
+ [f for f in result_del.stdout.strip().split("\n") if f]
252
+ if result_del.returncode == 0
253
+ else []
254
+ )
255
+
256
+ # Get current HEAD SHA
257
+ head_result = subprocess.run(
258
+ ["git", "rev-parse", "HEAD"],
259
+ capture_output=True,
260
+ text=True,
261
+ cwd=project_root,
262
+ timeout=2,
263
+ )
264
+ current_sha = (
265
+ head_result.stdout.strip() if head_result.returncode == 0 else "unknown"
266
+ )
267
+
268
+ return {
269
+ "changed_files": changed,
270
+ "deleted_files": deleted,
271
+ "since_sha": since_sha,
272
+ "current_sha": current_sha,
273
+ }
274
+ except (subprocess.TimeoutExpired, FileNotFoundError, OSError) as e:
275
+ return {
276
+ "changed_files": [],
277
+ "deleted_files": [],
278
+ "error": str(e),
279
+ }
@@ -464,3 +464,159 @@ REPO_INSIGHT_SCHEMA = {
464
464
  "required": ["language", "suggested_checks", "key_dirs"],
465
465
  "additionalProperties": True,
466
466
  }
467
+
468
+
469
+ WORKFLOW_FIT_DECISION_SCHEMA = {
470
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
471
+ "$id": "https://mapframework.dev/schemas/workflow-fit-decision.json",
472
+ "title": "MAP Workflow Fit Decision",
473
+ "description": "Preflight workflow-fit decision stored in .map/<branch>/workflow-fit.json",
474
+ "type": "object",
475
+ "properties": {
476
+ "version": {"type": "string"},
477
+ "recommended_workflow": {
478
+ "type": "string",
479
+ "enum": [
480
+ "direct-edit",
481
+ "map-fast",
482
+ "map-efficient",
483
+ "map-tdd",
484
+ "map-plan",
485
+ ],
486
+ },
487
+ "needs_map": {"type": "boolean"},
488
+ "decision_summary": {"type": "string"},
489
+ "signals": {
490
+ "type": "object",
491
+ "properties": {
492
+ "expected_diff_size": {
493
+ "type": "string",
494
+ "enum": ["tiny", "small", "medium", "large"],
495
+ },
496
+ "has_new_invariants": {"type": "boolean"},
497
+ "needs_independent_review": {"type": "boolean"},
498
+ "has_clear_acceptance_criteria": {"type": "boolean"},
499
+ "test_first_required": {"type": "boolean"},
500
+ },
501
+ "required": [
502
+ "expected_diff_size",
503
+ "has_new_invariants",
504
+ "needs_independent_review",
505
+ "has_clear_acceptance_criteria",
506
+ "test_first_required",
507
+ ],
508
+ "additionalProperties": False,
509
+ },
510
+ "updated_at": {"type": "string", "format": "date-time"},
511
+ },
512
+ "required": [
513
+ "version",
514
+ "recommended_workflow",
515
+ "needs_map",
516
+ "decision_summary",
517
+ "signals",
518
+ "updated_at",
519
+ ],
520
+ "additionalProperties": False,
521
+ }
522
+
523
+
524
+ ARTIFACT_STAGE_SCHEMA = {
525
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
526
+ "$id": "https://mapframework.dev/schemas/artifact-stage.json",
527
+ "title": "MAP Artifact Stage",
528
+ "description": "One stage entry inside artifact_manifest.json",
529
+ "type": "object",
530
+ "properties": {
531
+ "status": {"type": "string"},
532
+ "updated_at": {"type": "string", "format": "date-time"},
533
+ "artifacts": {
534
+ "type": "array",
535
+ "items": {
536
+ "type": "object",
537
+ "properties": {
538
+ "path": {"type": "string"},
539
+ "kind": {"type": "string"},
540
+ },
541
+ "required": ["path", "kind"],
542
+ "additionalProperties": False,
543
+ },
544
+ },
545
+ "metadata": {"type": "object"},
546
+ },
547
+ "required": ["status", "updated_at", "artifacts", "metadata"],
548
+ "additionalProperties": False,
549
+ }
550
+
551
+
552
+ ARTIFACT_MANIFEST_SCHEMA = {
553
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
554
+ "$id": "https://mapframework.dev/schemas/artifact-manifest.json",
555
+ "title": "MAP Artifact Manifest",
556
+ "description": "Branch-scoped artifact manifest stored in .map/<branch>/artifact_manifest.json",
557
+ "type": "object",
558
+ "properties": {
559
+ "schema_version": {"type": "string"},
560
+ "branch": {"type": "string"},
561
+ "updated_at": {"type": "string", "format": "date-time"},
562
+ "stages": {
563
+ "type": "object",
564
+ "properties": {
565
+ "workflow_fit": ARTIFACT_STAGE_SCHEMA,
566
+ "spec": ARTIFACT_STAGE_SCHEMA,
567
+ "plan": ARTIFACT_STAGE_SCHEMA,
568
+ "test_contract": ARTIFACT_STAGE_SCHEMA,
569
+ "implementation": ARTIFACT_STAGE_SCHEMA,
570
+ "review": ARTIFACT_STAGE_SCHEMA,
571
+ "verification": ARTIFACT_STAGE_SCHEMA,
572
+ "learn_handoff": ARTIFACT_STAGE_SCHEMA,
573
+ },
574
+ "required": [
575
+ "workflow_fit",
576
+ "spec",
577
+ "plan",
578
+ "test_contract",
579
+ "implementation",
580
+ "review",
581
+ "verification",
582
+ "learn_handoff",
583
+ ],
584
+ "additionalProperties": False,
585
+ },
586
+ },
587
+ "required": ["schema_version", "branch", "updated_at", "stages"],
588
+ "additionalProperties": False,
589
+ }
590
+
591
+
592
+ TEST_HANDOFF_SCHEMA = {
593
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
594
+ "$id": "https://mapframework.dev/schemas/test-handoff.json",
595
+ "title": "MAP Test Handoff",
596
+ "description": "Persisted TDD handoff stored in .map/<branch>/test_handoff_<subtask>.json",
597
+ "type": "object",
598
+ "properties": {
599
+ "subtask_id": {"type": "string"},
600
+ "status": {"type": "string", "enum": ["contract_ready"]},
601
+ "contract_path": {"type": "string"},
602
+ "failing_test_command": {"type": ["string", "null"]},
603
+ "test_files": {
604
+ "type": "array",
605
+ "items": {"type": "string"},
606
+ },
607
+ "contract_summary": {"type": "string"},
608
+ "notes": {"type": "string"},
609
+ "updated_at": {"type": "string", "format": "date-time"},
610
+ },
611
+ "required": [
612
+ "subtask_id",
613
+ "status",
614
+ "contract_path",
615
+ "failing_test_command",
616
+ "test_files",
617
+ "contract_summary",
618
+ "notes",
619
+ "updated_at",
620
+ ],
621
+ "additionalProperties": False,
622
+ }
@@ -200,10 +200,15 @@ Task(
200
200
  - Use Read(path, offset=lines[0], limit=lines[1]-lines[0]+1) # lines = [start, end], inclusive
201
201
  - Don't read all locations — only what you actually need
202
202
 
203
- ## Skip Research If
203
+ ## Research Usage
204
204
 
205
- - Task is self-contained (new file, no dependencies)
206
- - Existing patterns from context already cover the need
205
+ Research is run by the orchestrator BEFORE Actor is invoked. The findings file
206
+ (`.map/<branch>/findings_<branch>.md`) contains distilled context. If it exists,
207
+ read it before implementation — it has import patterns, module structure, and
208
+ build configuration that prevent integration failures.
209
+
210
+ Do NOT skip reading the findings file even for "new file" tasks — new files still
211
+ need correct imports, types, and build configuration from the existing project.
207
212
 
208
213
  ---
209
214
 
@@ -276,6 +281,9 @@ Rules:
276
281
  5. Include edge cases from the spec's `## Edge Cases` section if available in the packet.
277
282
  6. Use standard test patterns for the project's language and framework.
278
283
  7. Tests SHOULD fail when run (implementation doesn't exist yet). This is expected.
284
+ 8. Do NOT add temporal comments about test failure status (e.g., "currently FAILS",
285
+ "expected to FAIL", "will PASS once fix is applied"). Write tests as permanent,
286
+ clean code — the Red/Green state is transient and must not leak into comments.
279
287
 
280
288
  Output:
281
289
  - Test files created via Write tool
@@ -408,7 +416,17 @@ VC1: <criterion text>
408
416
  - Tests: path/to/test_file.ext::test_name (or N/A with reason)
409
417
  ```
410
418
 
411
- ## 7. Integration Notes (If Applicable)
419
+ ## 7. Downstream Consumption Check
420
+
421
+ When implementing a component whose output is consumed by another component:
422
+
423
+ - **Identify the consumer**: What reads your output? Verify your output populates ALL fields it expects.
424
+ - **Self-bootstrap**: Does your code load its own dependencies from config/storage, or does it silently return empty results when input is not pre-populated by the caller?
425
+ - **Stub replacement**: If implementing a real version of a placeholder, verify it is wired into the runtime — not just available as a standalone function.
426
+
427
+ Skip this section for leaf components with no downstream consumers.
428
+
429
+ ## 8. Integration Notes (If Applicable)
412
430
 
413
431
  Only include if changes affect:
414
432
  - Database schema (migrations needed?)