Skip to content

Commit f1d17cc

Browse files
Copilotalexec
andauthored
Fix documentation inconsistencies with code implementation (#144)
* Initial plan * Fix README.md: task search paths, language field naming, add -m flag Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Fix reference docs: task_names plural, task vs command paths, add -m flag Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Fix architecture and how-to docs for task matching consistency Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> * Remove slash prefix from task invocation examples throughout docs Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
1 parent c50ec1f commit f1d17cc

9 files changed

Lines changed: 157 additions & 117 deletions

File tree

README.md

Lines changed: 55 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Options:
8686
Change to directory before doing anything. (default ".")
8787
-d value
8888
Remote directory containing rules and tasks. Can be specified multiple times. Supports various protocols via go-getter (http://, https://, git::, s3::, etc.).
89+
-m string
90+
Go Getter URL to a manifest file containing search paths (one per line). Every line is included as-is.
8991
-p value
9092
Parameter to substitute in the prompt. Can be specified multiple times as key=value.
9193
-r Resume mode: skip outputting rules and select task with 'resume: true' in frontmatter.
@@ -166,18 +168,20 @@ The tool looks for task and rule files in the following locations, in order of p
166168

167169
**Tasks:**
168170
- `./.agents/tasks/*.md` (task name matches filename without `.md` extension)
171+
- `~/.agents/tasks/*.md`
172+
173+
**Commands** (referenced via slash commands inside task content):
169174
- `./.agents/commands/*.md`
170175
- `./.cursor/commands/*.md`
171176
- `./.opencode/command/*.md`
172-
- `~/.agents/tasks/*.md`
173177

174178
**Rules:**
175179
The tool searches for a variety of files and directories, including:
176180
- `CLAUDE.local.md`
177-
- `.agents/rules`, `.cursor/rules`, `.augment/rules`, `.windsurf/rules`, `.opencode/agent`, `.opencode/command`
178-
- `.github/copilot-instructions.md`, `.gemini/styleguide.md`
179-
- `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` (and in parent directories)
180-
- User-specific rules in `~/.agents/rules`, `~/.claude/CLAUDE.md`, `~/.opencode/rules`, etc.
181+
- `.agents/rules`, `.cursor/rules`, `.augment/rules`, `.windsurf/rules`, `.opencode/agent`, `.opencode/rules`
182+
- `.github/copilot-instructions.md`, `.github/agents`, `.gemini/styleguide.md`
183+
- `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.codex/AGENTS.md`
184+
- User-specific rules in `~/.agents/rules`, `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md`, `~/.gemini/GEMINI.md`, `~/.opencode/rules`, etc.
181185

182186
### Remote File System Support
183187

@@ -203,7 +207,7 @@ coding-context \
203207
# Mix local and remote directories
204208
coding-context \
205209
-d git::https://github.com/company/shared-rules.git \
206-
-s language=Go \
210+
-s languages=go \
207211
/implement-feature
208212
```
209213

@@ -290,7 +294,7 @@ Task files can include a `selectors` field in their frontmatter to automatically
290294
---
291295
task_name: implement-feature
292296
selectors:
293-
language: Go
297+
languages: go
294298
stage: implementation
295299
---
296300
# Implement Feature
@@ -300,34 +304,34 @@ Implement the feature following Go best practices and implementation guidelines.
300304

301305
When you run this task, it automatically applies the selectors:
302306
```bash
303-
# This command automatically includes only rules with language=Go and stage=implementation
304-
coding-context /implement-feature
307+
# This command automatically includes only rules with languages=go and stage=implementation
308+
coding-context implement-feature
305309
```
306310

307311
This is equivalent to:
308312
```bash
309-
coding-context -s language=Go -s stage=implementation /implement-feature
313+
coding-context -s languages=go -s stage=implementation /implement-feature
310314
```
311315

312316
**Selectors support OR logic for the same key using arrays:**
313317
```markdown
314318
---
315319
task_name: test-code
316320
selectors:
317-
language: [Go, Python]
321+
languages: [go, python]
318322
stage: testing
319323
---
320324
```
321325

322-
This will include rules that match `(language=Go OR language=Python) AND stage=testing`.
326+
This will include rules that match `(languages=go OR languages=python) AND stage=testing`.
323327

324328
**Combining task selectors with command-line selectors:**
325329

326330
Selectors from both the task frontmatter and command line are combined (additive):
327331
```bash
328-
# Task has: selectors.language = Go
332+
# Task has: selectors.languages = go
329333
# Command adds: -s priority=high
330-
# Result: includes rules matching language=Go AND priority=high
334+
# Result: includes rules matching languages=go AND priority=high
331335
coding-context -s priority=high /implement-feature
332336
```
333337

@@ -389,7 +393,8 @@ Rule files are Markdown (`.md`) or `.mdc` files, optionally with YAML frontmatte
389393
**Example (`.agents/rules/backend.md`):**
390394
```markdown
391395
---
392-
language: Go
396+
languages:
397+
- go
393398
---
394399

395400
# Backend Coding Standards
@@ -398,65 +403,57 @@ language: Go
398403
- Use the standard logging library.
399404
```
400405

401-
To include this rule only when working on Go code, you would use `-s language=Go`:
406+
To include this rule only when working on Go code, you would use `-s languages=go`:
402407

403408
```bash
404-
coding-context -s language=Go /fix-bug
409+
coding-context -s languages=go /fix-bug
405410
```
406411

407-
This will include all rules with `language: Go` in their frontmatter, excluding rules for other languages.
412+
This will include all rules with `languages: [ go ]` in their frontmatter, excluding rules for other languages.
413+
414+
**Note:** Language values should be lowercase (e.g., `go`, `python`, `javascript`). The frontmatter field is `languages` (plural) with array format.
408415

409416
**Example: Language-Specific Rules**
410417

411418
You can create multiple language-specific rule files:
412419

413-
- `.agents/rules/python-standards.md` with `language: Python`
414-
- `.agents/rules/javascript-standards.md` with `language: JavaScript`
415-
- `.agents/rules/go-standards.md` with `language: Go`
420+
- `.agents/rules/python-standards.md` with `languages: [ python ]`
421+
- `.agents/rules/javascript-standards.md` with `languages: [ javascript ]`
422+
- `.agents/rules/go-standards.md` with `languages: [ go ]`
416423

417424
Then select only the relevant rules:
418425

419426
```bash
420427
# Work on Python code with Python-specific rules
421-
coding-context -s language=Python /fix-bug
428+
coding-context -s languages=python /fix-bug
422429

423430
# Work on JavaScript code with JavaScript-specific rules
424-
coding-context -s language=JavaScript /enhance-feature
425-
```
426-
427-
**Common Linguist Languages**
428-
429-
When using language selectors, use the exact language names as defined by [GitHub Linguist](https://github.com/github-linguist/linguist/blob/master/lib/linguist/languages.yml). Here are common languages with correct capitalization:
430-
431-
- **C**: `C`
432-
- **C#**: `C#`
433-
- **C++**: `C++`
434-
- **CSS**: `CSS`
435-
- **Dart**: `Dart`
436-
- **Elixir**: `Elixir`
437-
- **Go**: `Go`
438-
- **Haskell**: `Haskell`
439-
- **HTML**: `HTML`
440-
- **Java**: `Java`
441-
- **JavaScript**: `JavaScript`
442-
- **Kotlin**: `Kotlin`
443-
- **Lua**: `Lua`
444-
- **Markdown**: `Markdown`
445-
- **Objective-C**: `Objective-C`
446-
- **PHP**: `PHP`
447-
- **Python**: `Python`
448-
- **Ruby**: `Ruby`
449-
- **Rust**: `Rust`
450-
- **Scala**: `Scala`
451-
- **Shell**: `Shell`
452-
- **Swift**: `Swift`
453-
- **TypeScript**: `TypeScript`
454-
- **YAML**: `YAML`
455-
456-
Note the capitalization - for example, use `Go` not `go`, `JavaScript` not `javascript`, and `TypeScript` not `typescript`.
431+
coding-context -s languages=javascript /enhance-feature
432+
```
433+
434+
**Language Values**
435+
436+
When using language selectors, language values should be **lowercase** (e.g., `go`, `python`, `javascript`, `java`, `typescript`). The frontmatter field should be `languages` (plural) in array format:
437+
438+
```yaml
439+
---
440+
languages:
441+
- go
442+
- python
443+
---
444+
```
445+
446+
**Common languages (lowercase):**
447+
- `c`, `csharp` (C#), `cpp` (C++), `css`
448+
- `dart`, `elixir`, `go`, `haskell`, `html`
449+
- `java`, `javascript`, `kotlin`, `lua`, `markdown`
450+
- `objectivec` (Objective-C), `php`, `python`, `ruby`, `rust`
451+
- `scala`, `shell`, `swift`, `typescript`, `yaml`
452+
453+
**Note:** Language values should be lowercase in frontmatter and selectors.
457454

458455
**Note:** Frontmatter selectors can only match top-level YAML fields. For example:
459-
- ✅ Works: `language: Go` matches `-s language=Go`
456+
- ✅ Works: `languages: [ go ]` matches `-s languages=go`
460457
- ❌ Doesn't work: Nested fields like `metadata.version: 1.0` cannot be matched with `-s metadata.version=1.0`
461458

462459
If you need to filter on nested data, flatten your frontmatter structure to use top-level fields only.
@@ -567,15 +564,15 @@ This can be useful for:
567564

568565
**Example with selectors in frontmatter:**
569566
```bash
570-
coding-context /implement-feature
567+
coding-context implement-feature
571568
```
572569

573570
If the task has `selectors` in its frontmatter, they will be visible in the output:
574571
```yaml
575572
---
576573
task_name: implement-feature
577574
selectors:
578-
language: Go
575+
languages: go
579576
stage: implementation
580577
---
581578
# Implementation Task

docs/explanation/agentic-workflows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ Scripts fetch current state before agent execution:
116116
```bash
117117
# Fetch JIRA issue details automatically
118118
export JIRA_ISSUE_KEY="BUG-123"
119-
coding-context /fix-bug # Bootstrap fetches latest data
119+
coding-context fix-bug # Bootstrap fetches latest data
120120
```
121121

122122
## The Agentic Workflow Ecosystem

docs/explanation/architecture.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Rules without frontmatter are always included (unless resume mode).
110110

111111
### 6. Discover Task Files
112112

113-
Search task file locations for files with matching `task_name`:
113+
Search task file locations for files with matching filename:
114114

115115
```
116116
Search paths:
@@ -119,11 +119,13 @@ Search paths:
119119
```
120120

121121
For each `.md` file:
122+
- Check if filename (without `.md` extension) matches requested task name
122123
- Parse frontmatter
123-
- Check if `task_name` matches requested task
124124
- Check if selectors match (if specified)
125125
- Store matching tasks
126126

127+
**Note:** Tasks are matched by filename, not by `task_name` in frontmatter. The `task_name` field is optional metadata.
128+
127129
### 7. Select Task
128130

129131
From matching tasks:

docs/how-to/create-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Save as `.agents/tasks/code-review.md` (or `.agents/commands/code-review.md`).
2929

3030
Use with:
3131
```bash
32-
coding-context /code-review
32+
coding-context code-review
3333
```
3434

3535
## Task with Parameters
@@ -187,7 +187,7 @@ Task frontmatter is **always** automatically included in the output when present
187187

188188
**Example:**
189189
```bash
190-
coding-context /implement-feature
190+
coding-context implement-feature
191191
```
192192

193193
**Output:**

docs/how-to/use-selectors.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ coding-context -s stage=testing /test-feature
100100
coding-context -s priority=high /fix-critical-bug
101101

102102
# Include all priorities (no selector)
103-
coding-context /fix-bug
103+
coding-context fix-bug
104104
```
105105

106106
### By Source
@@ -146,7 +146,7 @@ selectors:
146146
**Usage:**
147147
```bash
148148
# Automatically applies language=go and stage=implementation
149-
coding-context /implement-feature
149+
coding-context implement-feature
150150
```
151151

152152
This is equivalent to:
@@ -171,7 +171,7 @@ selectors:
171171
**Usage:**
172172
```bash
173173
# Includes rules matching (go OR python OR javascript) AND refactoring
174-
coding-context /refactor-code
174+
coding-context refactor-code
175175
```
176176

177177
### Combining Command-Line and Task Selectors
@@ -211,7 +211,7 @@ coding-context -s environment=production /deploy
211211
Task frontmatter (including selectors) is automatically included in the output:
212212

213213
```bash
214-
coding-context /implement-feature
214+
coding-context implement-feature
215215
```
216216

217217
**Output:**
@@ -303,7 +303,8 @@ coding-context -s languages=go /fix-bug 2>&1 | grep -i token
303303
- Verify unique frontmatter values across rules
304304

305305
**Task not found:**
306-
- Ensure `task_name` matches exactly
306+
- Ensure filename (without `.md` extension) matches the task name exactly
307+
- Tasks are matched by filename, not by `task_name` in frontmatter
307308
- Check that selectors don't over-filter (try without selectors)
308309

309310
## See Also

docs/how-to/use-with-ai-agents.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This guide shows you how to use the Coding Context CLI with various AI agents an
1414
Pipe the assembled context to any AI agent:
1515

1616
```bash
17-
coding-context /fix-bug | your-ai-agent
17+
coding-context fix-bug | your-ai-agent
1818
```
1919

2020
## With Claude CLI
@@ -29,7 +29,7 @@ coding-context \
2929
## With OpenAI API
3030

3131
```bash
32-
coding-context /code-review | openai api completions.create \
32+
coding-context code-review | openai api completions.create \
3333
-m gpt-4 \
3434
--stream
3535
```
@@ -40,13 +40,13 @@ The [llm](https://llm.datasette.io/) tool supports many models:
4040

4141
```bash
4242
# Using Claude
43-
coding-context /fix-bug | llm -m claude-3-5-sonnet-20241022
43+
coding-context fix-bug | llm -m claude-3-5-sonnet-20241022
4444

4545
# Using Gemini
46-
coding-context /code-review | llm -m gemini-pro
46+
coding-context code-review | llm -m gemini-pro
4747

4848
# Using local models
49-
coding-context /implement-feature | llm -m llama2
49+
coding-context implement-feature | llm -m llama2
5050
```
5151

5252
## Saving Context to File
@@ -55,7 +55,7 @@ Save the context for later use or inspection:
5555

5656
```bash
5757
# Save to file
58-
coding-context /fix-bug > context.txt
58+
coding-context fix-bug > context.txt
5959

6060
# Review the context
6161
cat context.txt
@@ -84,7 +84,7 @@ If you're using GitHub Copilot, the CLI can prepare context for custom instructi
8484

8585
```bash
8686
# Generate context
87-
coding-context /implement-feature > .github/copilot-context.md
87+
coding-context implement-feature > .github/copilot-context.md
8888

8989
# Copilot will read this file automatically
9090
```
@@ -109,10 +109,10 @@ The CLI prints token estimates to stderr:
109109

110110
```bash
111111
# See token count while piping to AI
112-
coding-context /fix-bug 2>&1 | tee >(grep -i token >&2) | ai-agent
112+
coding-context fix-bug 2>&1 | tee >(grep -i token >&2) | ai-agent
113113

114114
# Or redirect stderr to file
115-
coding-context /fix-bug 2> tokens.log | ai-agent
115+
coding-context fix-bug 2> tokens.log | ai-agent
116116
```
117117

118118
## Batch Processing

0 commit comments

Comments
 (0)