Skip to content

feat(cli): add --project scope to dirctl install/uninstall - #1894

Merged
akijakya merged 2 commits into
mainfrom
feat/dirctl-install-project-scope
Jul 28, 2026
Merged

akijakya merged 2 commits into
mainfrom
feat/dirctl-install-project-scope

Conversation

@akijakya

@akijakya akijakya commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a --project flag to dirctl install / install uninstall (and the top-level dirctl uninstall) that writes a record's artifacts into the current repository instead of the user's global config. Default behavior is unchanged (global).

Which artifacts get installed is still derived from the record's OASF modules; --project only changes where they land (e.g. .cursor/mcp.json, .vscode/mcp.json, .mcp.json, .cursor/skills/…).

Changes

  • agentcfg: new Scope (Global/Project) and MCPTarget.ProjectConfigPath; scope-aware skill + MCP path resolution. An agent with no location for the chosen scope is skipped with a note (ErrNoScopePath → ActionSkipped), replacing the old implicit global→project skill fallback.
  • Registry: per-agent project MCP paths (Claude Code, Cursor, VS Code, Roo, Gemini, OpenCode, Zed) and project skill paths for Claude Code and Continue. Agents without a documented project location are skipped.
  • agentinstall: scope threaded through Install/Uninstall.
  • Command: --project on all install/uninstall entry points, a "Scope: project" banner in the plan/summary, and install list --project; dirctl init is pinned to global scope.
  • Docs: --project documented in the CLI reference and features guide.

Behavior notes

  • Detection is unchanged/orthogonal: --project never writes for an agent the user doesn't have.
  • Removed the dormant implicit skill fallback, so a global install for an agent with no global skill path now reports skipped rather than silently writing a project file.

Testing

go build, go vet, go test ./... (cli module) all pass; task lint:go reports 0 issues. New unit tests cover project-scope skill/MCP install, no-project-path skip, orchestrator scope, and the --project→scope mapping. Manually smoke-tested dirctl install list --project.

Closes #1855

@akijakya akijakya self-assigned this Jul 27, 2026
@akijakya
akijakya requested a review from a team as a code owner July 27, 2026 08:35
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jul 27, 2026
@akijakya
akijakya force-pushed the feat/dirctl-install-project-scope branch from 23b7577 to c8c31e4 Compare July 27, 2026 08:36
@akijakya
akijakya requested a review from Copilot July 27, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a project-scoped install/uninstall mode to dirctl install / dirctl uninstall via a new --project flag, allowing MCP entries and Agent Skills to be written into the current working directory repo (instead of user/global config) while keeping default behavior unchanged.

Changes:

  • Thread a new agentcfg.Scope (Global / Project) through agentcfg engines, agentinstall, and cli/cmd/install, adding project-path support to MCP and skill targets.
  • Add per-agent project config resolvers (where documented) and make missing project locations skip-with-note rather than error.
  • Document --project in the CLI reference and scenarios docs (plus add internal spec/plan docs).

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/superpowers/specs/2026-07-21-dirctl-install-project-scope-design.md Design spec for project-scope install/uninstall behavior.
docs/superpowers/plans/2026-07-21-dirctl-install-project-scope.md Implementation plan outlining scope threading and tests/docs.
docs/content/dir/dir-features-scenarios.md Adds --project usage example and clarifies scope behavior.
docs/content/dir/dir-cli-reference.md Documents --project flag and project-scope behavior/examples.
cli/internal/agentcfg/types.go Introduces Scope; extends MCPTarget with ProjectConfigPath.
cli/internal/agentcfg/skill_path.go Makes skill path display scope-aware; replaces global fallback semantics.
cli/internal/agentcfg/skill_engine.go Threads Scope through skill install/remove and removes fallback behavior.
cli/internal/agentcfg/skill_engine_test.go Updates tests for explicit scope behavior + project-scope cases.
cli/internal/agentcfg/mcp_engine.go Adds scoped MCP path resolution + display helper; threads Scope.
cli/internal/agentcfg/mcp_engine_test.go Updates MCP tests for scope and adds project-scope coverage.
cli/internal/agentcfg/mcp_remove_test.go Updates RemoveMCP calls for new scoped signature.
cli/internal/agentcfg/result.go Adds a helper for consistent skip outcomes on missing scope location.
cli/internal/agentcfg/paths.go Adds project MCP/skill path resolvers for supported agents.
cli/internal/agentcfg/registry.go Wires per-agent project MCP/skill resolvers into the registry.
cli/internal/agentcfg/registry_test.go Updates registry path resolution test for new signature.
cli/internal/agentinstall/apply.go Threads scope through orchestrator install/uninstall flows.
cli/internal/agentinstall/apply_test.go Updates call sites; adds a project-scope integration-style test.
cli/cmd/install/options.go Adds project flag to shared install options.
cli/cmd/install/flags.go Registers --project; adds scopeFromOpts() + scope printing helper.
cli/cmd/install/install.go Introduces shared runApplyCmd and threads scope into apply/plan.
cli/cmd/install/uninstall.go Refactors uninstall to reuse shared apply flow.
cli/cmd/install/batch.go Threads scope through batch apply path and plan/summary generation.
cli/cmd/install/list.go Makes install list scope-aware for displayed MCP/skill paths.
cli/cmd/install/install_test.go Adds unit test coverage for scopeFromOpts().
cli/cmd/init/agents.go Pins dirctl init to global scope explicitly for install/uninstall.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/internal/agentcfg/paths.go Resolved
Comment thread cli/internal/agentcfg/paths.go Resolved
Comment thread cli/internal/agentcfg/paths.go Resolved
Comment thread cli/internal/agentcfg/skill_engine.go Resolved
Comment thread cli/internal/agentcfg/result.go Resolved
Comment thread docs/content/dir/dir-cli-reference.md Resolved
Comment thread docs/content/dir/dir-cli-reference.md Resolved
@akijakya
akijakya force-pushed the feat/dirctl-install-project-scope branch from c8c31e4 to 1e8d8c3 Compare July 27, 2026 10:53
@akijakya
akijakya merged commit 7cd77bb into main Jul 28, 2026
34 checks passed
@akijakya
akijakya deleted the feat/dirctl-install-project-scope branch July 28, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): dirctl install --project — install a record's artifacts at project scope

3 participants