Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ sudo chmod +x /usr/local/bin/coding-context

```
Usage:
coding-context [options] <task-name>
coding-context [options] <task-prompt>

Options:
-C string
Expand All @@ -100,7 +100,7 @@ Options:

**Basic usage with local files:**
```bash
coding-context -p jira_issue_key=PROJ-1234 fix-bug | llm -m gemini-pro
coding-context -p jira_issue_key=PROJ-1234 /fix-bug | llm -m gemini-pro
```

This command will:
Expand All @@ -117,7 +117,7 @@ This command will:
coding-context \
-d git::https://github.com/company/shared-rules.git \
-d s3::https://s3.amazonaws.com/my-bucket/coding-standards \
fix-bug | llm -m gemini-pro
/fix-bug | llm -m gemini-pro
```

This command will:
Expand Down Expand Up @@ -192,19 +192,19 @@ The tool supports loading rules and tasks from remote locations via HTTP/HTTPS U

```bash
# Clone a Git repository containing rules
coding-context -d git::https://github.com/company/shared-rules.git fix-bug
coding-context -d git::https://github.com/company/shared-rules.git /fix-bug

# Use multiple remote sources
coding-context \
-d git::https://github.com/company/shared-rules.git \
-d https://cdn.company.com/coding-standards \
deploy
/deploy

# Mix local and remote directories
coding-context \
-d git::https://github.com/company/shared-rules.git \
-s language=Go \
implement-feature
/implement-feature
```

**Supported protocols (via go-getter):**
Expand All @@ -226,12 +226,12 @@ coding-context \
# Use a specific branch or tag
coding-context \
-d 'git::https://github.com/company/shared-rules.git?ref=v1.0' \
fix-bug
/fix-bug

# Use a subdirectory within the repo
coding-context \
-d 'git::https://github.com/company/mono-repo.git//coding-standards' \
implement-feature
/implement-feature
```

## File Formats
Expand Down Expand Up @@ -275,10 +275,10 @@ Deploy the application to production with all safety checks.
You can then select the appropriate task using:
```bash
# Deploy to staging
coding-context -s environment=staging deploy
coding-context -s environment=staging /deploy

# Deploy to production
coding-context -s environment=production deploy
coding-context -s environment=production /deploy
```

#### Task Frontmatter Selectors
Expand All @@ -301,12 +301,12 @@ Implement the feature following Go best practices and implementation guidelines.
When you run this task, it automatically applies the selectors:
```bash
# This command automatically includes only rules with language=Go and stage=implementation
coding-context implement-feature
coding-context /implement-feature
```

This is equivalent to:
```bash
coding-context -s language=Go -s stage=implementation implement-feature
coding-context -s language=Go -s stage=implementation /implement-feature
```

**Selectors support OR logic for the same key using arrays:**
Expand All @@ -328,7 +328,7 @@ Selectors from both the task frontmatter and command line are combined (additive
# Task has: selectors.language = Go
# Command adds: -s priority=high
# Result: includes rules matching language=Go AND priority=high
coding-context -s priority=high implement-feature
coding-context -s priority=high /implement-feature
```

### Resume Mode
Expand All @@ -348,10 +348,10 @@ This is particularly useful in agentic workflows where an AI agent has already b

```bash
# Initial task invocation (includes all rules, uses task with resume: false)
coding-context -s resume=false fix-bug | ai-agent
coding-context -s resume=false /fix-bug | ai-agent

# Resume the task (skips rules, uses task with resume: true)
coding-context -r fix-bug | ai-agent
coding-context -r /fix-bug | ai-agent
```

**Example task files for resume mode:**
Expand Down Expand Up @@ -401,7 +401,7 @@ language: Go
To include this rule only when working on Go code, you would use `-s language=Go`:

```bash
coding-context -s language=Go fix-bug
coding-context -s language=Go /fix-bug
```

This will include all rules with `language: Go` in their frontmatter, excluding rules for other languages.
Expand All @@ -418,10 +418,10 @@ Then select only the relevant rules:

```bash
# Work on Python code with Python-specific rules
coding-context -s language=Python fix-bug
coding-context -s language=Python /fix-bug

# Work on JavaScript code with JavaScript-specific rules
coding-context -s language=JavaScript enhance-feature
coding-context -s language=JavaScript /enhance-feature
```

**Common Linguist Languages**
Expand Down Expand Up @@ -480,7 +480,7 @@ When working with a specific AI coding agent, the agent itself will read its own
```bash
# When using Cursor, exclude .cursor/ and .cursorrules (Cursor reads those itself)
# But include rules from other agents and generic rules
coding-context -a cursor fix-bug
coding-context -a cursor /fix-bug
```

**How it works:**
Expand Down Expand Up @@ -546,7 +546,7 @@ Task frontmatter is automatically included at the beginning of the output. This

**Example usage:**
```bash
coding-context -p issue_number=123 fix-bug
coding-context -p issue_number=123 /fix-bug
```

**Output format:**
Expand All @@ -567,7 +567,7 @@ This can be useful for:

**Example with selectors in frontmatter:**
```bash
coding-context implement-feature
coding-context /implement-feature
```

If the task has `selectors` in its frontmatter, they will be visible in the output:
Expand Down
8 changes: 4 additions & 4 deletions docs/explanation/agentic-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ Context is assembled at runtime based on the specific task:

```bash
# Bug fix: Include only relevant rules
coding-context -s language=Go -s priority=high fix-bug
coding-context -s language=Go -s priority=high /fix-bug

# Code review: Different context
coding-context -s stage=review code-review
coding-context -s stage=review /code-review
```

### 3. Parameter Injection
Expand All @@ -106,7 +106,7 @@ Runtime information flows into task prompts:
coding-context \
-p issue_key=BUG-123 \
-p description="Crashes on startup" \
fix-bug
/fix-bug
```

### 4. Bootstrap for Live Data
Expand All @@ -116,7 +116,7 @@ Scripts fetch current state before agent execution:
```bash
# Fetch JIRA issue details automatically
export JIRA_ISSUE_KEY="BUG-123"
coding-context fix-bug # Bootstrap fetches latest data
coding-context /fix-bug # Bootstrap fetches latest data
```

## The Agentic Workflow Ecosystem
Expand Down
4 changes: 2 additions & 2 deletions docs/explanation/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Each stage transforms data before passing it to the next stage.
### 1. Parse Command-Line Arguments

```
coding-context -C /project -s language=Go -p issue=BUG-123 fix-bug
coding-context -C /project -s language=Go -p issue=BUG-123 /fix-bug
```

The CLI parses:
Expand Down Expand Up @@ -387,7 +387,7 @@ Multiple selectors use AND logic:

```bash
# Requires BOTH language=Go AND stage=testing
coding-context -s language=Go -s stage=testing fix-bug
coding-context -s language=Go -s stage=testing /fix-bug

# No way to specify: language=Go OR language=Python
```
Expand Down
12 changes: 6 additions & 6 deletions docs/how-to/create-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ language: Python
Use with:
```bash
# Include only Go rules
coding-context -s language=Go fix-bug
coding-context -s language=Go /fix-bug

# Include only Python rules
coding-context -s language=Python fix-bug
coding-context -s language=Python /fix-bug
```

## Rules with Multiple Selectors
Expand All @@ -90,7 +90,7 @@ When writing tests:
Use with:
```bash
# Include rules for Go testing
coding-context -s language=Go -s stage=testing implement-feature
coding-context -s language=Go -s stage=testing /implement-feature
```

## Stage-Specific Rules
Expand Down Expand Up @@ -128,10 +128,10 @@ stage: implementation
Use with:
```bash
# Planning phase
coding-context -s stage=planning plan-feature
coding-context -s stage=planning /plan-feature

# Implementation phase
coding-context -s stage=implementation implement-feature
coding-context -s stage=implementation /implement-feature
```

## Rules with Bootstrap Scripts
Expand Down Expand Up @@ -172,7 +172,7 @@ Use with:
export JIRA_ISSUE_KEY="PROJ-123"
export JIRA_API_TOKEN="your-token"

coding-context -s source=jira fix-bug
coding-context -s source=jira /fix-bug
```

## Best Practices
Expand Down
12 changes: 6 additions & 6 deletions docs/how-to/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
-s stage=review \
-p pr_number=${{ github.event.pull_request.number }} \
-p pr_title="${{ github.event.pull_request.title }}" \
code-review > context.txt
/code-review > context.txt

- name: Review with AI
run: |
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
-p issue_number=${{ github.event.issue.number }} \
-p issue_title="${{ github.event.issue.title }}" \
-p issue_body="${{ github.event.issue.body }}" \
fix-bug > context.txt
/fix-bug > context.txt

- name: Apply AI Fix
run: |
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:

- name: Planning Context
run: |
coding-context -s stage=planning plan-feature > plan-context.txt
coding-context -s stage=planning /plan-feature > plan-context.txt

- name: Create Plan
run: cat plan-context.txt | your-ai-agent > plan.md
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:

- name: Implementation Context
run: |
coding-context -s stage=implementation implement-feature > impl-context.txt
coding-context -s stage=implementation /implement-feature > impl-context.txt

- name: Implement
run: |
Expand All @@ -179,7 +179,7 @@ Pass secrets to bootstrap scripts:
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
coding-context -s source=jira fix-bug > context.txt
coding-context -s source=jira /fix-bug > context.txt
```

## Caching CLI Binary
Expand Down Expand Up @@ -209,7 +209,7 @@ Use the `-C` flag to run from a different directory:
```yaml
- name: Assemble Context
run: |
coding-context -C ./backend -s language=Go fix-bug > context.txt
coding-context -C ./backend -s language=Go /fix-bug > context.txt
```

## Best Practices
Expand Down
Loading