Skip to content

Apply a plugin profile to a folder from the command line #16429

Description

@kyle-sexton

Parent

Refs #16428: Ship the plugin-profiles plugin and remove the core bundle

Depends on

  • none: on the frontier now (after the build-time probes recorded in the plan)

Outcome

A user runs the plugin-profiles command-line tool to apply a profile to a folder: it previews every change, checks the prerequisites of each plugin it would switch on, writes only the plugin and hidden-skill entries in the folder's local settings in one all-or-nothing write, records what it changed, and clear puts the folder back exactly. Ships the always-on and build profiles.

Demo: apply build to a temporary project folder with --dry-run, then for real, start a session there and compare claude plugin list --json with the preview; run clear and the settings file matches its original byte for byte.

Decisions

  • Q55: Node .mjs engine, no npm packages, vendored YAML and config readers.
  • Q56: one YAML file per profile; every plugin id written name@marketplace, shipped files included.
  • Q57: profiles live in the plugin, in ~/.claude/plugin-profiles/ for the user, and in the repository's convention home.
  • Q58: the applied-profile record lives in the plugin's data folder and keeps each entry's value from before the tool's first write.
  • Q62: write through a temp file and rename after re-checking the file's hash; one re-plan, then fail unchanged.
  • Q64 / D8: --dry-run preview and a confirm before writing; an off-pending record state for a switch cut off between its two writes.
  • Q65: a profile governs only the marketplaces it names; other plugins are never written and are listed.
  • Q66: same-named profiles extend the one below with plugins and remove.
  • Q67: profile keys description, plugins, optional, remove, exclude, hide_skills.
  • AC26 (owner): missing required prerequisites are listed with install lines and stated consequence; writing needs an explicit yes; nobody to ask means no write.
  • D4: the session-start inventory reads installed plugins without starting a nested claude.
  • D6: the data folder is found from the script's own install path.
  • harness-ops and context-budget stay in always-on as interim members until the hook-unit item lands.

Key interfaces

From the design: a pure planner turns (profile catalog, inventory, settings layers, target) into a plan with writes, pinned, missing, untouched and hook-plugins-off lists; one module each owns profile files, the plugin inventory, settings reads and writes, and the applied-profile record. The CLI verbs are apply <name> --for session|folder|initial [--dry-run] [--yes], status, clear, inventory. Desired set = always-on ∪ profile members ∪ installed optional members ∪ repository-enabled ∪ dependencies − exclude; a committed false wins and is reported. Variation verdicts: settings files, the plugin CLI and the mods API are each contained in one module; no abstraction layer. Conventions followed: ADR 0019 (vendoring with a sync gate), ADR 0075 (repository convention home), the plugin philosophy's cross-platform contract, the prerequisites contract.

Review criterion (owner): "Make sure we're applying solid principles: Single Responsibility Principle, DRY, Single Source of Truth principle, so no duplication. Make sure we're adhering to general good practice, best practice, and software engineering principles: low coupling, high cohesion; things that change together live together; feature vertical slice architecture."

Done when

  • AC1, AC16, AC17, AC18, AC23, AC24: planner table tests cover the desired set, governed marketplaces, repository plugins, pins, hidden skills and the always-on rule, and pass under node --test.
  • AC3: a user build.yaml with one plugins line and one remove line extends the shipped one in a test.
  • AC8, AC21: a forced failure and a concurrent-writer race each leave the settings file unchanged in a CLI test. (The Windows rename retry moved to Verify the plugin-profiles CLI on the Windows lane and time status on the owner's machine #16455.)
  • AC19: clear after apply restores the file byte for byte (cmp exits 0); with no file before the apply, clear removes it.
  • AC26: a fixture plugin with a missing required prerequisite makes apply --yes exit non-zero with the file unchanged; the preview lists the tool, install line and stated consequence.
  • Only enabledPlugins and skillOverrides change: jq -S 'del(.enabledPlugins,.skillOverrides)' before and after is identical.
  • status --json timing on the owner's machine moved to host-run Verify the plugin-profiles CLI on the Windows lane and time status on the owner's machine #16455.
  • AC7 (process criterion of this container): the container's PR also removes core.

Out of scope

  • The /plugin-profile command, the guided setup, the other five profiles, and the core removal: their own items in this container.
  • Moving harness-ops' hooks: its own item.

Activity

  1. added
    agent-ready
    on Nov 15, 2026
  2. self-assigned this
    on Nov 15, 2026
  3. added
    needs-triage
    on Nov 15, 2026
  4. github-actions commented on Nov 15, 2026

    @github-actions
    Contributor

    Size: Large
    Complexity: High
    Uncertainty: Knowable
    Flags: none
    Blocked by: none

    Understood: you want a plugin-profiles command-line tool that applies a profile (always-on, build) to a folder. It previews every change, checks each plugin's prerequisites, and writes only enabledPlugins and skillOverrides in the folder's local settings in one all-or-nothing write. It records what it changed, and clear restores the file byte for byte.

    The body states the outcome, decisions and done-when items exactly, so I asked no open questions. Some done-when items need a person or another host, namely the status --json timing on the owner's machine and the Windows rename retry on the Windows lane. They are not a reason to hold the issue.

    This is a large, multi-module piece of work (planner, profile files, inventory, settings writer, applied-profile record, CLI). It probably needs splitting. The build-time probes mentioned under "Depends on" may settle some approach details.

    No duplicate open issues and no merged pull request that already covers this. Parent: #16428.

    Automated triage. A maintainer reviews it.

  5. removed
    needs-triage
    on Nov 15, 2026
  6. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: its done-when asks for what an unattended lane run cannot perform: item 3 (named-host: "AC8, AC21: a forced failure and a concurrent-writer race each leave the setti..."), item 7 (named-host: "status --json runs in under 2 s on the owner's machine."); recommended split: keep the other items here as the admissible issue and move these to a child issue for the host queue (host-run). Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  7. melodic-automation-lanes commented on Nov 15, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: A new plugin-profiles plugin ships an apply/status/clear/inventory Node CLI that applies the always-on and build profiles to a folder's local settings, writing only enabledPlugins and skillOverrides atomically and restoring byte for byte on clear.

    Related work

    Open questions

    1. Done-when AC7 says this issue's PR also removes core, but Out of scope lists the core removal as its own item. Does this issue remove core or not?
      RECOMMENDED: No. Treat AC7 as a container-level check owned by #​16436, drop it from this issue's done-when, and keep this PR to the new plugin only. Basis: 16436
    2. Depends on says work starts after build-time probes recorded in the plan, but the repository has no plugin-profiles plugin and the issue links no plan. Are the probes done and where are their results recorded?
      RECOMMENDED: Name the plan file path and probe results in the issue, or list the probes as a dependency, so a run does not guess plugin CLI and settings-layer behavior. Basis: judgment

    Sources read

    • /home/runner/work/claude-code-plugins/claude-code-plugins/.base/plugins/core/.claude-plugin/plugin.json: the core plugin still exists in the catalog
    • plugins/plugin-profiles: no files found in the checkout, so the work is greenfield

    To answer, post a comment that starts with this line:

    **Decision recorded.** <answer>
    

    Automated refinement by the lanes App. Answer with a comment whose first line is **Decision recorded.**.

  8. added
    host-run
    on Nov 16, 2026
  9. removed
    host-run
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-ready

Fields

Work status

needs-owner-decision

Priority

medium

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions