{"id":31735992,"url":"https://github.com/3ZsForInsomnia/vs-code-companion","last_synced_at":"2025-10-09T09:06:43.881Z","repository":{"id":311254843,"uuid":"1039190650","full_name":"3ZsForInsomnia/vs-code-companion","owner":"3ZsForInsomnia","description":"A CodeCompanion extension for using VS Code Copilot prompts and Chat Mode prompts","archived":false,"fork":false,"pushed_at":"2025-10-06T14:40:44.000Z","size":60,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T16:29:48.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3ZsForInsomnia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-16T17:11:12.000Z","updated_at":"2025-10-06T14:40:48.000Z","dependencies_parsed_at":"2025-08-23T06:22:54.727Z","dependency_job_id":"9f4c2da8-951a-4e02-89ad-df1c35e6ebff","html_url":"https://github.com/3ZsForInsomnia/vs-code-companion","commit_stats":null,"previous_names":["3zsforinsomnia/vs-code-companion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/3ZsForInsomnia/vs-code-companion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ZsForInsomnia%2Fvs-code-companion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ZsForInsomnia%2Fvs-code-companion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ZsForInsomnia%2Fvs-code-companion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ZsForInsomnia%2Fvs-code-companion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3ZsForInsomnia","download_url":"https://codeload.github.com/3ZsForInsomnia/vs-code-companion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3ZsForInsomnia%2Fvs-code-companion/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001177,"owners_count":26083021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T09:01:30.421Z","updated_at":"2025-10-09T09:06:43.876Z","avatar_url":"https://github.com/3ZsForInsomnia.png","language":"Lua","funding_links":[],"categories":["AI"],"sub_categories":["Diagnostics"],"readme":"# vs-code-companion.nvim\n\nImport VS Code AI prompts into Neovim's [CodeCompanion](https://codecompanion.olimorris.dev/). Share prompts across editors without friction.\n\nPerfect for teams using VS Code prompts or developers migrating from VS Code to Neovim.\n\n\u003e **Looking for prompt browsing and selection?** Check out [code-companion-picker](https://github.com/3ZsForInsomnia/code-companion-picker) for advanced prompt selection with fuzzy search, previews, and customizable UI.\n\n## Quick Start\n\n1. **Install** this plugin (requires [CodeCompanion](https://codecompanion.olimorris.dev/))\n2. **Create VS Code prompt files** in `.github/prompts/` in your project (or configure custom directories)\n3. **Import prompts**: Run `:VsccImport` to add VS Code prompts to CodeCompanion's library\n4. **Use prompts**: Access imported prompts as slash commands (e.g., `/vsc_my_prompt`) in CodeCompanion chat buffers\n\n## Why Use This Plugin?\n\n✅ **Use existing VS Code prompts** in Neovim\n✅ **Share prompt libraries** across team members and editors\n✅ **Zero conversion needed** - works with [VS Code's standard format](https://code.visualstudio.com/docs/copilot/customization/prompt-files#_prompt-file-format)\n✅ **Flexible transformation system** - customize how prompts are converted to CodeCompanion format\n✅ **Smart AI model detection** from VS Code frontmatter\n\n## Installation\n\n**Dependencies:**\n- [codecompanion.nvim](https://github.com/olimorris/codecompanion.nvim) - Required\n\n### lazy.nvim\n\n```lua\n{\n  'olimorris/codecompanion.nvim',\n  dependencies = {\n    '3ZsForInsomnia/vs-code-companion.nvim',\n  },\n  opts = {\n    -- your codecompanion config\n  }\n}\n```\n\n## Advanced Configuration\n\n### Customizing Prompt Transformation\n\nThe plugin uses a flexible transformation system to convert VS Code markdown prompts into CodeCompanion format. You can customize how properties are extracted and transformed:\n\n```lua\nlocal getters = require(\"vs-code-companion\").getters()\nlocal transforms = require(\"vs-code-companion\").transforms()\nlocal defaults = require(\"vs-code-companion\").defaults()\n\n{\n  '3ZsForInsomnia/vs-code-companion.nvim',\n  opts = {\n    directories = {'.github/prompts'},\n    transform = {\n      -- Use defaults for most properties\n      description = defaults.description,\n      content = defaults.content,\n      strategy = defaults.strategy,\n\n      -- Customize tools handling\n      tools = {\n        getter = getters.get_tools,\n        transform = transforms.transform_tools_full_stack_dev,\n      },\n\n      -- Disable certain properties\n      mapping = false,\n\n      -- Add custom getter/transform\n      custom_property = {\n        getter = function(file_info) \n          -- Custom logic to extract value\n          return \"custom_value\"\n        end,\n        transform = function(value)\n          -- Custom logic to transform for CodeCompanion\n          return value\n        end,\n      },\n    }\n  }\n}\n```\n\n### Built-in Tool Variants\n\nThe plugin provides several built-in approaches for handling VS Code tools:\n\n```lua\n-- No tools (default)\nlocal config1 = require(\"vs-code-companion\").create_config_with_tools(\"none\")\n\n-- Use CodeCompanion's full_stack_dev tool for all VS Code tool\nlocal config2 = require(\"vs-code-companion\").create_config_with_tools(\"full_stack_dev\")\n\n-- Attempt to map VS Code tools to CodeCompanion tools (future feature)\nlocal config3 = require(\"vs-code-companion\").create_config_with_tools(\"mapped\")\n```\n\n### One-time Import with Custom Config\n\nYou can also import prompts with a custom transformation config without changing your main configuration:\n\n```lua\n-- Import once with full_stack_dev tools\nlocal custom_config = require(\"vs-code-companion\").create_config_with_tools(\"full_stack_dev\")\nrequire(\"vs-code-companion\").import_prompts_with_config(custom_config)\n\n-- Or create a completely custom config\nlocal getters = require(\"vs-code-companion\").getters()\nlocal transforms = require(\"vs-code-companion\").transforms()\n\nlocal my_config = {\n  description = {\n    getter = getters.get_description,\n    transform = transforms.transform_description,\n    required = true,\n  },\n  content = {\n    getter = getters.get_content,\n    transform = function(content, role) \n      -- Custom content transformation\n      return {\n        role = role or \"user\",\n        content = \"CUSTOM PREFIX: \" .. content,\n      }\n    end,\n    required = true,\n  },\n  -- ... other properties\n}\n\nrequire(\"vs-code-companion\").import_prompts_with_config(my_config)\n```\n\n### packer.nvim\n\n```lua\nuse {\n  'olimorris/codecompanion.nvim',\n  requires = {\n    '3ZsForInsomnia/vs-code-companion.nvim',\n  },\n  config = function()\n    require(\"codecompanion\").setup({\n      -- your codecompanion config\n    })\n  end\n}\n```\n\n## Basic Usage\n\n### 1. Create VS Code Prompt Files\n\nCreate markdown files with YAML frontmatter in your project (default: `.github/prompts/`):\n\n```markdown\n---\ndescription: \"Review code for bugs and improvements\"  \nmodel: \"Claude Sonnet 3.5\"\n---\n\nPlease review this code for potential bugs, performance issues, and improvements...\n```\n\nLearn more about [VS Code's prompt format](https://code.visualstudio.com/docs/copilot/customization/prompt-files#_prompt-file-format) and see [examples](https://code.visualstudio.com/docs/copilot/customization/custom-chat-modes#_custom-chat-modes).\n\n### 2. Import Prompts\n\n```vim\n:VsccImport\n```\n\nThis reads VS Code prompt files from configured directories and adds them to CodeCompanion's prompt library as slash commands.\n\n### 3. Use Imported Prompts\n\nOpen a CodeCompanion chat buffer and use imported prompts as slash commands:\n- Type `/` to see all available commands\n- Use `/vsc_\u003cfilename\u003e` where `\u003cfilename\u003e` is your prompt file name (sanitized)\n- Example: `test-prompt.md` becomes `/vsc_test_prompt`\n\n## CodeCompanion Integration\n\n### Slash Commands in Chat Buffers\n\nAdd VS Code prompt functionality directly to CodeCompanion chat buffers by configuring slash commands:\n\n```lua\n{\n  'olimorris/codecompanion.nvim',\n  dependencies = {\n    '3ZsForInsomnia/vs-code-companion.nvim',\n  },\n  opts = {\n    strategies = {\n      chat = {\n        slash_commands = {\n          vs_import = require(\"vs-code-companion\").import_slash_command,\n        },\n      },\n    },\n    -- your other codecompanion config\n  }\n}\n```\n\nThis enables `/vs_import` to import VS Code prompts from within a CodeCompanion buffer.\n\n### VS Code Prompt Format\n\nVS Code prompts use markdown files with YAML frontmatter. Supported fields:\n\n```markdown\n---\ndescription: \"Required - Brief description shown in picker\"\nmodel: \"Optional - AI model name (see docs/models.md)\"\ntools: [\"Optional\", \"array\", \"of\", \"tool\", \"names\"]\n---\n\nYour prompt content here...\n```\n\n**Required:**\n- `description` - Short description shown in pickers and command descriptions\n\n**Optional:**\n- `model` - AI model name (automatically converted from display names to technical names)\n- `tools` - Array of tool names (currently replaced with CodeCompanion's `@{full_stack_dev}`)\n\n## Configuration\n\nBasic configuration options:\n\n```lua\n{\n  '3ZsForInsomnia/vs-code-companion.nvim',\n  opts = {\n    directories = {'.github/prompts', '.github/chatmodes'}, -- Where to find prompt files\n  }\n}\n```\n\n## Future Features\n\n### Planned Enhancements\n\n- **Rules-based Configuration**: Configure different transformation rules based on file paths or names\n  ```lua\n  rules = {\n    {\n      pattern = \"*.chatmode.md\",\n      transform = custom_chatmode_config\n    },\n    {\n      pattern = \".github/prompts/**\",\n      transform = github_prompts_config\n    }\n  }\n  ```\n  \n- **Required Field Validation**: Mark transformation properties as required and fail gracefully\n  ```lua\n  transform = {\n    description = {\n      getter = getters.get_description,\n      transform = transforms.transform_description,\n      required = true  -- Fail if this can't be extracted\n    }\n  }\n  ```\n\n- **VS Code to CodeCompanion Tool Mapping**: Smart mapping of VS Code tools to equivalent CodeCompanion tools\n  ```lua\n  -- Future: automatic mapping like this\n  vs_code_tools = [\"python\", \"typescript\"] \n  -- → codecompanion_tools = \"@{python_dev}@{typescript_dev}\"\n  ```\n\n## Troubleshooting\n\n**\"No prompts found\"**\n\n**\"X files failed to process\"**\n\n**\"Not in git repository\"**  \n\n**Telescope not working**\n\n**Commands not working**\n\n## Advanced Usage\n\nFor advanced configuration, CodeCompanion integration, and technical details, see:\n\n- Git repository (for relative path resolution)  \n- [CodeCompanion.nvim](https://github.com/olimorris/codecompanion.nvim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3ZsForInsomnia%2Fvs-code-companion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3ZsForInsomnia%2Fvs-code-companion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3ZsForInsomnia%2Fvs-code-companion/lists"}