Skip to content

feat(#353): add mapify prompt-profile list command (slice 1)#374

Merged
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-eynfn6
Jul 18, 2026
Merged

feat(#353): add mapify prompt-profile list command (slice 1)#374
azalio merged 1 commit into
mainfrom
claude/compassionate-cerf-eynfn6

Conversation

@azalio

@azalio azalio commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

What the command does

mapify prompt-profile list [--project-path <path>] [--json]
  • Reads all profile directories under .map/prompt-profiles/<id>/
  • For each, reads manifest.json (required: id, title, version; optional: description, owner, targets, eval_requirements, rollback_notes)
  • Reads .map/prompt-profiles/active.json to determine which profile is currently active
  • Displays a Rich table (ID / Title / Version / Status / Description) with active vs installed status
  • --json emits {"profiles": [...], "active": "<id>"|null} for machine-readable output
  • Gracefully skips directories without a valid manifest (no error)
  • Warns when active.json names a profile that no longer exists (stale pointer)

Manifest format

.map/prompt-profiles/<id>/manifest.json:

{
  "id": "efficiency-v2",
  "title": "Efficiency v2",
  "version": "1.0.0",
  "description": "Tighter actor prompts for token efficiency",
  "owner": "azalio",
  "targets": [{"surface": "skill:map-efficient"}],
  "eval_requirements": ["skill-eval:map-efficient"],
  "rollback_notes": "Revert if Monitor false-positive rate increases"
}

.map/prompt-profiles/active.json (rollback primitive — change pointer = rollback):

{"active": "efficiency-v2"}

Test plan

  • PP1 (3 tests): empty project returns "no profiles found" message with creation hint
  • PP2 (4 tests): installed profiles appear with ID/title/description
  • PP3 (4 tests): missing/malformed manifests skipped gracefully, valid siblings still shown
  • PP4 (4 tests): --json output shape and required fields
  • PP5 (3 tests): active profile marked in table and JSON
  • PP6 (2 tests): stale active pointer shows warning but still displays real profiles
  • Full suite: 3947+ passed, 0 failed

Closes #353 slice 1


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added mapify prompt-profile list to display installed prompt profiles.
    • Supports table and JSON output formats.
    • Shows the currently active profile and warns when the active selection is unavailable.
  • Documentation

    • Updated architecture documentation to mark architecture reporting and prompt-profile management features as shipped.

Adds the `mapify prompt-profile` sub-command group and the first
command `prompt-profile list` implementing the prompt profile lifecycle
manifest format for issue #353.

Manifest format: `.map/prompt-profiles/<id>/manifest.json` with
required keys (id, title, version) and optional keys (description,
owner, targets, eval_requirements, rollback_notes).

Active pointer: `.map/prompt-profiles/active.json` with `{"active":
"<id>"|null}` as the rollback primitive.

The `list` command:
- reads all valid profile manifests from .map/prompt-profiles/
- checks active.json for the current active profile
- displays a Rich table with ID/title/version/status/description
- marks the active profile in the Status column
- emits a stale-pointer warning when active.json names a profile that
  no longer exists
- supports --json for machine-readable output
- gracefully skips directories without valid manifests

20 tests in tests/test_prompt_profile_commands.py covering empty list,
installed profiles, malformed manifest degradation, JSON output,
active profile marking, and stale pointer warning.

Co-Authored-By: Claude <noreply@anthropic.com>
@azalio
azalio merged commit 7e80fd8 into main Jul 18, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cc40935-7d46-43bc-bdff-b400d5a402ac

📥 Commits

Reviewing files that changed from the base of the PR and between 60f6c7b and 4223bc2.

📒 Files selected for processing (3)
  • docs/ARCHITECTURE.md
  • src/mapify_cli/__init__.py
  • tests/test_prompt_profile_commands.py

📝 Walkthrough

Walkthrough

The PR adds prompt-profile list to the Mapify CLI, including table/JSON output, manifest validation, active-profile detection, and stale-pointer warnings. It adds comprehensive tests and documents completed architecture and prompt-profile work.

Changes

Prompt profile listing

Layer / File(s) Summary
Prompt profile CLI command
src/mapify_cli/__init__.py
Registers the prompt-profile command group and implements profile discovery, validation, active-state handling, table output, JSON output, and stale-pointer warnings.
Prompt profile behavior coverage
tests/test_prompt_profile_commands.py
Tests empty states, valid and invalid manifests, JSON output, active-profile marking, and stale pointers.
Prompt profile architecture documentation
docs/ARCHITECTURE.md
Documents the command’s file formats, output behavior, tests, and future command roadmap.

Architecture skill status

Layer / File(s) Summary
Architecture report completion
docs/ARCHITECTURE.md
Records the completed /map-architecture workflow, scoring signals, report artifacts, candidate selection, and handoff rules.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant prompt_profile_list
  participant PromptProfiles
  participant Output
  Operator->>prompt_profile_list: invoke list
  prompt_profile_list->>PromptProfiles: read manifests and active.json
  PromptProfiles-->>prompt_profile_list: return valid profiles and active pointer
  prompt_profile_list->>Output: render table or JSON
Loading

Poem

I’m a rabbit with profiles in line,
Reading manifests crisp and fine.
The active one gets ears held high,
Bad files quietly hop by.
JSON or tables, neat and bright—
Architecture blooms tonight!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 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.

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.

[Prompt lifecycle] Add eval-gated prompt profile canary and rollback controls

2 participants