Skip to content

feat(#291): preset composition engine — render + set-priority (Slice 3)#372

Merged
azalio merged 2 commits into
mainfrom
claude/compassionate-cerf-eynfn6
Jul 18, 2026
Merged

feat(#291): preset composition engine — render + set-priority (Slice 3)#372
azalio merged 2 commits into
mainfrom
claude/compassionate-cerf-eynfn6

Conversation

@azalio

@azalio azalio commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

Third slice of SpecKit-style preset composition (#291). Implements the actual composition engine on top of Slices 1 and 2.

New commands

  • mapify preset render <template> — composes a template through all enabled preset layers (sorted by priority), starting from the project override or core template; --json returns {template, source, applied_layers, content}
  • mapify preset set-priority <id> <n> — sets composition priority via .state.json sidecar; default 50, higher values are applied first

Composition strategies

Strategy Effect
replace Preset content discards the core entirely
prepend Preset content inserted above core
append Preset content inserted below core
wrap Preset wraps core via {CORE_TEMPLATE} placeholder

Resolution order

  1. Project override (.map/overrides/<template>) or core template — base content
  2. Enabled presets sorted by priority descending, each applying its strategy

Disabled presets are skipped at render time (they still appear in resolve for visibility).

Tests

12 new tests (PC12–PC13): all four strategies, priority ordering, disabled-preset skipping, project override as base, required JSON fields. 57 total tests in tests/test_preset_commands.py.

Full suite: 3943 passed, 4 skipped, 0 failures.

Closes #291 (all acceptance criteria for preset management CLI covered across Slices 1–3; extension hooks and catalog are optional future work).


Generated by Claude Code

claude added 2 commits July 18, 2026 07:03
…lice 3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jmbBkJwJByEJGXFAihgh8
…e 3)

Implements the core preset composition engine for issue #291:

- _compose_template(): applies replace/prepend/append/wrap strategies
  - wrap: uses {CORE_TEMPLATE} placeholder to inject core content
  - prepend/append: inserts layer before/after core respectively
  - replace: discards core and returns preset content
- _build_resolution_order(): collects enabled preset layers sorted by
  priority descending (higher priority applied first)
- mapify preset render <template>: composes template through all enabled
  preset layers, starting from project override or core template;
  --json flag returns {template, source, applied_layers, content}
- mapify preset set-priority <id> <n>: sets composition priority via
  .state.json sidecar (default 50; higher = applied first)

12 new tests (PC12-PC13) cover all four strategies, priority ordering,
disabled-preset skipping, project override as base, and required JSON fields.
57 total preset tests, 3943 passing in full suite.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011jmbBkJwJByEJGXFAihgh8
@azalio
azalio merged commit 268f5a4 into main Jul 18, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@azalio, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e3ec32a-a825-45d7-8a38-9461f6f79fed

📥 Commits

Reviewing files that changed from the base of the PR and between 6076634 and 7efb5be.

📒 Files selected for processing (3)
  • docs/ARCHITECTURE.md
  • src/mapify_cli/__init__.py
  • tests/test_preset_commands.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/compassionate-cerf-eynfn6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

azalio pushed a commit that referenced this pull request Jul 18, 2026
All three slices (PRs #370/#371/#372) merged; update issue tracker section.

Co-Authored-By: Claude <noreply@anthropic.com>
azalio added a commit that referenced this pull request Jul 18, 2026
…ports (#373)

* docs: mark #291 preset composition as CLOSED in ARCHITECTURE.md

All three slices (PRs #370/#371/#372) merged; update issue tracker section.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat(#363): add /map-architecture skill for architecture-deepening reports

Adds the opt-in architecture-deepening report workflow as a new
`/map-architecture` skill. The skill ranks codebase areas by recent
git hotspot frequency and design-friction signals (shallow interface,
low locality, seam leakage, hard-to-test, ADR conflict), writes a
ranked Markdown+Mermaid candidate report under
`.map/<branch>/architecture-report/`, and waits for the user to pick
one candidate before any code changes begin.

Key design choices:
- Three phases: scope → report → select (no implementation in skill)
- Explicit "do not implement yet" guardrail at every decision point
- Companion report.json for future eval assertions
- Hands off to /map-plan (score ≥ 6) or /map-fast (score < 6) after pick
- Deferral notes in .map/architecture-notes.md to avoid re-surfacing

Also registers the skill in skill-rules.json with 7 keywords and 3
intent patterns, adds it to WORKFLOW_EFFORT_PROFILES in test_skills.py
(effort: medium/adaptive), and updates the skill count guard in
test_skills_consistency.py from 19 → 20.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SpecKit-style preset composition: layered template resolution with prepend/append/wrap strategies

2 participants