feat: caller-specific context template overrides#35
Closed
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
Closed
feat: caller-specific context template overrides#35bilersan wants to merge 1 commit intoActiveMemory:mainfrom
bilersan wants to merge 1 commit intoActiveMemory:mainfrom
Conversation
Add a --caller flag to 'ctx init' that lets calling tools (e.g. VS Code extension) identify themselves so ctx can emit tailored context files. When --caller is set, TemplateForCaller checks for a caller-specific override in overrides/<caller>/<template>.md before falling back to the default template. This allows different AI tools to get optimized playbooks without changing the core template set. Includes a VS Code-specific AGENT_PLAYBOOK.md override (268 lines) that provides VS Code-aware instructions: workspace API patterns, extension lifecycle, Copilot Chat participant conventions, and VS Code-specific debugging workflows. Changes: - internal/assets/embed.go: add TemplateForCaller() + embed overrides - internal/assets/overrides/vscode/AGENT_PLAYBOOK.md: VS Code playbook - internal/cli/initialize/cmd/root/run.go: accept caller, use override - internal/cli/initialize/init.go: add --caller flag Signed-off-by: ersan bilik <ersanbilik@gmail.com>
49bdd62 to
db15c88
Compare
Contributor
Author
|
Superseded by consolidated VS Code extension PR — caller overrides included. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #34 — Adds caller-specific template overrides to
ctx init.How It Works
When
--calleris set,TemplateForCaller(name, caller)checks foroverrides/<caller>/<template>.mdbefore falling back to the default template incontext/. If no override exists for a given template, the default is used — fully backward compatible.Changes
internal/assets/embed.goTemplateForCaller()function, update embed pattern to includeoverrides/*/*.mdinternal/assets/overrides/vscode/AGENT_PLAYBOOK.mdinternal/cli/initialize/cmd/root/run.gocallerparameter, useTemplateForCallerinstead ofTemplateinternal/cli/initialize/init.go--callerflagVS Code Override
The
vscode/AGENT_PLAYBOOK.mdprovides VS Code-optimized guidance:Testing