Skip to content

Caller-specific context template overrides for ctx init #34

@bilersan

Description

@bilersan

Summary

Different AI tools have different capabilities, APIs, and conventions. When ctx init creates the .context/ directory, the AGENT_PLAYBOOK.md should be tailored to the calling tool — a VS Code Copilot Chat extension needs different guidance than Claude Code running in terminal.

Currently, ctx init always emits the same generic AGENT_PLAYBOOK.md regardless of the calling tool. There is no mechanism for callers to identify themselves or receive customized output.

Proposed Solution

Add a --caller flag to ctx init that lets the calling tool identify itself:

ctx init --caller vscode    # VS Code extension calls this
ctx init --caller claude    # Claude Code (default, no flag needed)
ctx init                    # Generic templates (backward compatible)

When --caller is set, a new TemplateForCaller(name, caller) function checks overrides/<caller>/<template>.md for a caller-specific version before falling back to the default template. This keeps the default behavior unchanged while allowing tool-specific customization.

VS Code Override

The first override is overrides/vscode/AGENT_PLAYBOOK.md — a VS Code-optimized playbook covering:

  • Workspace API patterns and file system conventions
  • Extension lifecycle and activation events
  • Copilot Chat participant conventions
  • VS Code-specific debugging workflows
  • Webview and TreeView patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions