diff --git a/.chatgpt_config.yaml b/.chatgpt_config.yaml index 78b7251..83a99c9 100644 --- a/.chatgpt_config.yaml +++ b/.chatgpt_config.yaml @@ -1,15 +1,4 @@ -initial_prompt: | - You are a coding assistant who receives a project’s context and user instructions. The user will provide a prompt, and you will return modifications to the project in a YAML structure. This YAML must have a top-level key named files, which should be a list of file changes. Each element in files must be a mapping with the keys path and content. The path should be the file path relative to the project’s root directory, and content should contain the new file content as a multiline string (using the YAML | literal style). Do not include additional commentary outside of the YAML. - Here is the structure expected in your final answer: - files: - - path: "relative/path/to/file1.ext" - content: | - - - path: "relative/path/to/file2.ext" - content: | - - Based on the prompt and project context provided, you must only return the YAML structure shown above (with actual file paths and contents substituted in). Any file that should be created or modified must appear as one of the files entries. The content should contain the complete and final code for that file, reflecting all changes requested by the user. - +default_prompt_blocks: + - "basic prompt" directories: - - "lua" - - "plugin" + - "." diff --git a/README.md b/README.md index babd30b..376f03d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,46 @@ -# ChatGPT NeoVim Plugin (Updated for YAML) +# ChatGPT NeoVim Plugin (Updated for YAML and Default Prompt Blocks) This plugin integrates a ChatGPT O1 model workflow into Neovim. It allows you to generate prompts containing: - An **initial prompt** configured via a `.chatgpt_config.yaml` file in your project root. - A list of directories (also specified in the `.chatgpt_config.yaml`) from which it gathers the complete project structure and file contents. -- The current file and the project's `README.md`, if present. -- It uses YAML for configuration and also expects the ChatGPT response in YAML. +- The content of the current file you are editing and the project's `README.md`, if present. +- Prompts are combined and copied to your clipboard, ready to be pasted into ChatGPT O1. -It also respects `.gitignore` entries, skipping those files from the prompt. +The ChatGPT O1 model is then expected to return modifications in a **YAML** format. You will then use the `:ChatGPTPaste` command to read these changes from the clipboard and apply them to your files. -## Configuration +## Default Prompt Blocks -Create a `.chatgpt_config.yaml` in your project root. For example: +The configuration now supports specifying one or more "default prompt blocks." These blocks allow you to quickly switch between different kinds of specialized instructions for ChatGPT. For example: +- **go-development**: Focused on Go (Golang) coding best practices, idiomatic patterns, and Go-specific guidance. +- **typo3-development**: Focused on TYPO3 development practices, TypoScript, and extension coding guidelines. +- **basic-prompt**: A generic prompt that explains how to return modifications in the required YAML structure. + +If you specify multiple blocks in `default_prompt_blocks`, their instructions are concatenated. This lets you combine multiple focus areas or start with a base prompt and add a specialized layer on top. + +## Example Configuration + +Below is an example `.chatgpt_config.yaml` that sets a custom initial prompt, limits directories to scan, and selects default prompt blocks: ```yaml -initial_prompt: "You are a helpful coding assistant that follows instructions meticulously." +initial_prompt: "You are a coding assistant who will provide modifications in YAML form." directories: - "lua" - "plugin" +default_prompt_blocks: + - "basic-prompt" + - "go-development" +``` + +With this configuration: +- The prompt shown to ChatGPT will include both the "basic-prompt" and "go-development" instructions, as well as the user’s message. +- Only the `lua` and `plugin` directories of your project will be included in the prompt. + +## Usage + +1. Run `:ChatGPT` and enter your message. The combined prompt is copied to your clipboard. +2. Paste it into the ChatGPT O1 model. +3. Copy the YAML response from ChatGPT into your clipboard. +4. Run `:ChatGPTPaste` to apply the changes to your files. + +This workflow allows you to iterate quickly, making changes guided by AI while keeping a clear history and a structured approach.