Skip to content

Copilot CLI: no way to inject superpowers bootstrap at startup from a plugin #792

@obra

Description

@obra

Summary

Copilot CLI v1.0.7 loads superpowers skills correctly from a plugin directory, but there is no working mechanism for a plugin to inject the "always check skills first" bootstrap context at session start.

What works

  • Skills load perfectly — all 19 superpowers skills are discovered and shown in /skills
  • Skill invocation worksskill(brainstorming), skill(using-superpowers) etc. all work
  • Agent uses skills proactively when descriptions match (e.g., brainstorming auto-fires for "build a todo app")
  • .claude-plugin/plugin.json is discovered by Copilot CLI (checked from .plugin/, ., .github/plugin/, .claude-plugin/)

What doesn't work

1. type: "prompt" hooks don't fire from plugins

Copilot CLI supports type: "prompt" entries in sessionStart hooks that auto-submit a prompt at session start. However, startup prompts are only extracted from project-level (.github/hooks/) and user-level (~/.copilot/hooks/) hook configs — not from plugin hooks.

In the source (app.js v1.0.7), _startupPrompts is populated from user and project hooks dirs only:

let {hooksDir: a, configs: l, userHooksDir: c, userConfigs: I} = await this.loadAllHooks(e, o);
let d = await xBt(c, q, I);  // user hooks
let u = await xBt(a, q, l);  // project hooks  
this._startupPrompts = [...d, ...u];  // no plugin hooks

2. sessionStart command hooks discard output

Even if a plugin's sessionStart command hook returns JSON with additionalContext, the output handler is a no-op:

// sessionStart output handler:
l => {}  // discarded

// Compare to subagentStart which DOES extract additionalContext:
l => l?.additionalContext !== void 0 ? { additionalContext: l.additionalContext } : void 0

The SDK types define SessionStartHookOutput.additionalContext but the CLI doesn't read it from command hooks.

3. AGENTS.md not loaded from plugin directories

Copilot loads AGENTS.md as custom instructions from the working directory only, not from plugin directories. So a plugin can't use AGENTS.md to inject bootstrap instructions.

4. copilot-instructions.md not loaded from plugin directories

Same — only loaded from the working directory's .github/ and ~/.copilot/.

What we need

Any ONE of these would unblock superpowers on Copilot CLI:

  1. Extract type: "prompt" entries from plugin hooks (alongside project/user hooks)
  2. Process additionalContext from sessionStart command hook output (like subagentStart already does)
  3. Load AGENTS.md or custom instruction files from plugin directories

Option 2 would give parity with how Claude Code's SessionStart hook works (plugin returns JSON with context that gets injected into the session).

Environment

  • Copilot CLI: 1.0.7
  • Platform: macOS (Darwin 25.2.0)
  • Plugin: superpowers v5.0.5

Workaround

Skills work without the bootstrap — agents invoke them when descriptions match. The gap is the enforcement: without the bootstrap, the agent doesn't know it MUST check skills before every action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcopilotGitHub Copilot integrationhooksHook system (SessionStart, Stop, etc.)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions