Skip to content

Commit b4152de

Browse files
Copilotalexec
andauthored
Add "Why" and "How" sections to README (#11)
* Initial plan * Initial plan for adding usage explanation Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Add comprehensive "Why" and "How It Works" sections to README Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Address code review feedback: improve diagram and clarify Quick Start Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Improve ASCII diagram with standard box-drawing characters Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Delete coding-context * Update README.md --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> Co-authored-by: Alex Collins <alexec@users.noreply.github.com>
1 parent d5afb2b commit b4152de

1 file changed

Lines changed: 85 additions & 6 deletions

File tree

README.md

Lines changed: 85 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,63 @@
22

33
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.
44

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+
```
662

763
## Installation
864

@@ -52,32 +108,55 @@ coding-context -s env=production -S language=python deploy
52108

53109
## Quick Start
54110

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**
56114
```bash
57115
mkdir -p .coding-context/{prompts,memories}
58116
```
59117

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+
61122
```markdown
62123
# Project Context
63124

64125
- Framework: Go CLI
65126
- Purpose: Manage AI agent context
66127
```
67128

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+
69133
```markdown
70134
# Task: {{ .taskName }}
71135

72136
Please help me with this task. The project uses {{ .language }}.
73137
```
74138

75-
4. Run the tool:
139+
**Step 4: Generate your context file**
140+
76141
```bash
77142
coding-context -p taskName="Fix Bug" -p language=Go my-task
78143
```
79144

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+
```
81160

82161

83162
## Directory Structure

0 commit comments

Comments
 (0)