|
2 | 2 |
|
3 | 3 | A CLI tool for managing context files for coding agents. It helps you organize prompts, memories (reusable context), and bootstrap scripts that can be assembled into a single context file for AI coding agents. |
4 | 4 |
|
5 | | -It's aimed at coding agents with a simple interface for managing task-specific context and reusable knowledge. |
| 5 | +## Why Use This? |
| 6 | + |
| 7 | +When working with AI coding agents (like GitHub Copilot, ChatGPT, Claude, etc.), providing the right context is crucial for getting quality results. However, managing this context becomes challenging when: |
| 8 | + |
| 9 | +- **Context is scattered**: Project conventions, coding standards, and setup instructions are spread across multiple documents |
| 10 | +- **Repetition is tedious**: You find yourself copy-pasting the same information into every AI chat session |
| 11 | +- **Context size is limited**: AI models have token limits, so you need to efficiently select what's relevant |
| 12 | +- **Onboarding is manual**: New team members or agents need step-by-step setup instructions |
| 13 | + |
| 14 | +**This tool solves these problems by:** |
| 15 | + |
| 16 | +1. **Centralizing reusable context** - Store project conventions, coding standards, and setup instructions once in "memory" files |
| 17 | +2. **Creating task-specific prompts** - Define templated prompts for common tasks (e.g., "add feature", "fix bug", "refactor") |
| 18 | +3. **Automating environment setup** - Package bootstrap scripts that prepare the environment before an agent starts work |
| 19 | +4. **Filtering context dynamically** - Use selectors to include only relevant context (e.g., production vs. development, Python vs. Go) |
| 20 | +5. **Composing everything together** - Generate a single `prompt.md` file combining all relevant context and the task prompt |
| 21 | + |
| 22 | +## When to Use |
| 23 | + |
| 24 | +This tool is ideal for: |
| 25 | + |
| 26 | +- **Working with AI coding agents** - Prepare comprehensive context before starting a coding session |
| 27 | +- **Team standardization** - Share common prompts and conventions across your team |
| 28 | +- **Complex projects** - Manage large amounts of project-specific context efficiently |
| 29 | +- **Onboarding automation** - New developers or agents can run bootstrap scripts to set up their environment |
| 30 | +- **Multi-environment projects** - Filter context based on environment (dev/staging/prod) or technology stack |
| 31 | + |
| 32 | +## How It Works |
| 33 | + |
| 34 | +The basic workflow is: |
| 35 | + |
| 36 | +1. **Organize your context** - Create memory files (shared context) and prompt files (task-specific instructions) |
| 37 | +2. **Run the CLI** - Execute `coding-context <task-name>` with optional parameters |
| 38 | +3. **Get assembled output** - The tool generates: |
| 39 | + - `prompt.md` - Combined context + task prompt with template variables filled in |
| 40 | + - `bootstrap` - Executable script to set up the environment |
| 41 | + - `bootstrap.d/` - Individual bootstrap scripts from your memory files |
| 42 | +4. **Use with AI agents** - Share `prompt.md` with your AI coding agent, or run `./bootstrap` to prepare the environment first |
| 43 | + |
| 44 | +**Visual flow:** |
| 45 | +``` |
| 46 | ++---------------------+ +--------------------------+ |
| 47 | +| Memory Files (*.md) | | Prompt Template | |
| 48 | +| | | (task-name.md) | |
| 49 | ++----------+----------+ +------------+-------------+ |
| 50 | + | | |
| 51 | + | Filter by selectors | Apply template params |
| 52 | + v v |
| 53 | ++---------------------+ +--------------------------+ |
| 54 | +| Filtered Memories +-------+ Rendered Prompt | |
| 55 | ++---------------------+ +------------+-------------+ |
| 56 | + | |
| 57 | + v |
| 58 | + +----------------------------+ |
| 59 | + | prompt.md (combined output)| |
| 60 | + +----------------------------+ |
| 61 | +``` |
6 | 62 |
|
7 | 63 | ## Installation |
8 | 64 |
|
@@ -52,32 +108,55 @@ coding-context -s env=production -S language=python deploy |
52 | 108 |
|
53 | 109 | ## Quick Start |
54 | 110 |
|
55 | | -1. Create a context directory structure: |
| 111 | +This 4-step guide shows how to set up and generate your first context: |
| 112 | + |
| 113 | +**Step 1: Create a context directory structure** |
56 | 114 | ```bash |
57 | 115 | mkdir -p .coding-context/{prompts,memories} |
58 | 116 | ``` |
59 | 117 |
|
60 | | -2. Create a memory file (`.coding-context/memories/project-info.md`): |
| 118 | +**Step 2: Create a memory file** (`.coding-context/memories/project-info.md`) |
| 119 | + |
| 120 | +Memory files are included in every generated context. They contain reusable information like project conventions, architecture notes, or coding standards. |
| 121 | + |
61 | 122 | ```markdown |
62 | 123 | # Project Context |
63 | 124 |
|
64 | 125 | - Framework: Go CLI |
65 | 126 | - Purpose: Manage AI agent context |
66 | 127 | ``` |
67 | 128 |
|
68 | | -3. Create a prompt file (`.coding-context/prompts/my-task.md`): |
| 129 | +**Step 3: Create a prompt file** (`.coding-context/prompts/my-task.md`) |
| 130 | + |
| 131 | +Prompt files define specific tasks. They can use template variables (like `{{ .taskName }}`) that you provide via command-line parameters. |
| 132 | + |
69 | 133 | ```markdown |
70 | 134 | # Task: {{ .taskName }} |
71 | 135 |
|
72 | 136 | Please help me with this task. The project uses {{ .language }}. |
73 | 137 | ``` |
74 | 138 |
|
75 | | -4. Run the tool: |
| 139 | +**Step 4: Generate your context file** |
| 140 | + |
76 | 141 | ```bash |
77 | 142 | coding-context -p taskName="Fix Bug" -p language=Go my-task |
78 | 143 | ``` |
79 | 144 |
|
80 | | -This generates `./prompt.md` combining your memories and the task prompt. |
| 145 | +**Result:** This generates `./prompt.md` combining your memories and the task prompt with template variables filled in. You can now share this complete context with your AI coding agent! |
| 146 | + |
| 147 | +**What you'll see in `prompt.md`:** |
| 148 | +```markdown |
| 149 | +# Project Context |
| 150 | + |
| 151 | +- Framework: Go CLI |
| 152 | +- Purpose: Manage AI agent context |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | +# Task: Fix Bug |
| 157 | + |
| 158 | +Please help me with this task. The project uses Go. |
| 159 | +``` |
81 | 160 |
|
82 | 161 |
|
83 | 162 | ## Directory Structure |
|
0 commit comments