diff --git a/README.md b/README.md index 0f3c1e06..f581804f 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ sudo chmod +x /usr/local/bin/coding-context ``` Usage: - coding-context [options] + coding-context [options] Options: -C string @@ -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: @@ -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: @@ -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):** @@ -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 @@ -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 @@ -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:** @@ -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 @@ -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:** @@ -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. @@ -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** @@ -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:** @@ -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:** @@ -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: diff --git a/docs/explanation/agentic-workflows.md b/docs/explanation/agentic-workflows.md index de11d8e2..76790e73 100644 --- a/docs/explanation/agentic-workflows.md +++ b/docs/explanation/agentic-workflows.md @@ -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 @@ -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 @@ -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 diff --git a/docs/explanation/architecture.md b/docs/explanation/architecture.md index 1c11b9b0..dac80697 100644 --- a/docs/explanation/architecture.md +++ b/docs/explanation/architecture.md @@ -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: @@ -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 ``` diff --git a/docs/how-to/create-rules.md b/docs/how-to/create-rules.md index 335b7adf..428ed11f 100644 --- a/docs/how-to/create-rules.md +++ b/docs/how-to/create-rules.md @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/docs/how-to/github-actions.md b/docs/how-to/github-actions.md index afef9384..85e24cd0 100644 --- a/docs/how-to/github-actions.md +++ b/docs/how-to/github-actions.md @@ -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: | @@ -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: | @@ -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 @@ -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: | @@ -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 @@ -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 diff --git a/docs/how-to/use-remote-directories.md b/docs/how-to/use-remote-directories.md index 66cc72b5..b9debfe6 100644 --- a/docs/how-to/use-remote-directories.md +++ b/docs/how-to/use-remote-directories.md @@ -27,7 +27,7 @@ Use the `-d` flag to load rules and tasks from remote directories. The CLI downl ```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 ``` This downloads the repository, searches for rules and tasks in standard locations (`.agents/rules/`, `.agents/tasks/`, etc.), and includes them in the context. @@ -36,13 +36,13 @@ This downloads the repository, searches for rules and tasks in standard location ```bash # Use a specific tag -coding-context -d 'git::https://github.com/company/rules.git?ref=v1.0.0' fix-bug +coding-context -d 'git::https://github.com/company/rules.git?ref=v1.0.0' /fix-bug # Use a specific branch -coding-context -d 'git::https://github.com/company/rules.git?ref=main' fix-bug +coding-context -d 'git::https://github.com/company/rules.git?ref=main' /fix-bug # Use a specific commit -coding-context -d 'git::https://github.com/company/rules.git?ref=abc123def' fix-bug +coding-context -d 'git::https://github.com/company/rules.git?ref=abc123def' /fix-bug ``` ### Use Subdirectory @@ -51,7 +51,7 @@ If your rules are in a subdirectory of a repository, use double slashes (`//`): ```bash # Get rules from the 'coding-standards' subdirectory -coding-context -d 'git::https://github.com/company/mono-repo.git//coding-standards' fix-bug +coding-context -d 'git::https://github.com/company/mono-repo.git//coding-standards' /fix-bug ``` ## Supported Protocols @@ -62,33 +62,33 @@ The `-d` flag uses [go-getter](https://github.com/hashicorp/go-getter), which su ```bash # HTTPS -coding-context -d git::https://github.com/company/rules.git fix-bug +coding-context -d git::https://github.com/company/rules.git /fix-bug # SSH (requires SSH keys configured) -coding-context -d git::git@github.com:company/rules.git fix-bug +coding-context -d git::git@github.com:company/rules.git /fix-bug # With authentication token -coding-context -d 'git::https://token@github.com/company/private-rules.git' fix-bug +coding-context -d 'git::https://token@github.com/company/private-rules.git' /fix-bug ``` ### HTTP/HTTPS ```bash # Download and extract tar.gz -coding-context -d https://example.com/rules.tar.gz fix-bug +coding-context -d https://example.com/rules.tar.gz /fix-bug # Download and extract zip -coding-context -d https://example.com/rules.zip fix-bug +coding-context -d https://example.com/rules.zip /fix-bug ``` ### S3 Buckets ```bash # S3 bucket -coding-context -d s3::https://s3.amazonaws.com/my-bucket/rules fix-bug +coding-context -d s3::https://s3.amazonaws.com/my-bucket/rules /fix-bug # With specific region -coding-context -d s3::https://s3-us-west-2.amazonaws.com/my-bucket/rules fix-bug +coding-context -d s3::https://s3-us-west-2.amazonaws.com/my-bucket/rules /fix-bug ``` ### Local Files @@ -96,7 +96,7 @@ coding-context -d s3::https://s3-us-west-2.amazonaws.com/my-bucket/rules fix-bug Useful for testing: ```bash -coding-context -d file:///path/to/local/rules fix-bug +coding-context -d file:///path/to/local/rules /fix-bug ``` ## Advanced Usage @@ -110,7 +110,7 @@ coding-context \ -d git::https://github.com/company/org-standards.git \ -d git::https://github.com/team/team-rules.git \ -d https://cdn.company.com/archived-rules.tar.gz \ - fix-bug + /fix-bug ``` Rules from all sources are merged together and processed as if they were in a single directory. @@ -127,7 +127,7 @@ Combine remote directories with local project rules: coding-context \ -d git::https://github.com/company/shared-rules.git \ -s language=Go \ - fix-bug + /fix-bug ``` You can also explicitly add local directories: @@ -138,7 +138,7 @@ coding-context \ -d git::https://github.com/company/shared-rules.git \ -d file:///path/to/local/rules \ -s language=Go \ - fix-bug + /fix-bug ``` **Note:** The working directory (`-C` or current directory) and home directory are automatically added to search paths, so you don't need to specify them explicitly. @@ -154,7 +154,7 @@ coding-context \ -s environment=production \ -p component=auth \ -p severity=critical \ - fix-security-issue | llm -m claude-3-5-sonnet-20241022 + /fix-security-issue | llm -m claude-3-5-sonnet-20241022 ``` ## Repository Structure @@ -260,7 +260,7 @@ git push --tags coding-context \ -d 'git::https://github.com/company/shared-coding-rules.git?ref=v1.0.0' \ -s language=Go \ - code-review + /code-review ``` ## Bootstrap Scripts @@ -291,10 +291,10 @@ Remote directories are **not cached** between runs. Each invocation downloads fr ```bash # Downloads repository -coding-context -d git::https://github.com/company/rules.git fix-bug +coding-context -d git::https://github.com/company/rules.git /fix-bug # Downloads again (not cached) -coding-context -d git::https://github.com/company/rules.git code-review +coding-context -d git::https://github.com/company/rules.git /code-review ``` For better performance with frequently-used remote directories, consider: @@ -311,13 +311,13 @@ Downloaded directories are automatically cleaned up after execution. No manual c **Git over HTTPS with token:** ```bash export GITHUB_TOKEN="ghp_your_token_here" -coding-context -d "git::https://${GITHUB_TOKEN}@github.com/company/private-rules.git" fix-bug +coding-context -d "git::https://${GITHUB_TOKEN}@github.com/company/private-rules.git" /fix-bug ``` **Git over SSH:** ```bash # Uses your SSH keys from ~/.ssh/ -coding-context -d git::git@github.com:company/private-rules.git fix-bug +coding-context -d git::git@github.com:company/private-rules.git /fix-bug ``` **S3 with AWS credentials:** @@ -325,7 +325,7 @@ coding-context -d git::git@github.com:company/private-rules.git fix-bug # Uses AWS credentials from environment or ~/.aws/credentials export AWS_ACCESS_KEY_ID="your-key" export AWS_SECRET_ACCESS_KEY="your-secret" -coding-context -d s3::https://s3.amazonaws.com/my-bucket/rules fix-bug +coding-context -d s3::https://s3.amazonaws.com/my-bucket/rules /fix-bug ``` ## Troubleshooting diff --git a/docs/how-to/use-selectors.md b/docs/how-to/use-selectors.md index 9da8a6b8..d7f05c5a 100644 --- a/docs/how-to/use-selectors.md +++ b/docs/how-to/use-selectors.md @@ -15,7 +15,7 @@ Include only rules matching a specific frontmatter field: ```bash # Include only Go rules -coding-context -s language=Go fix-bug +coding-context -s language=Go /fix-bug ``` This includes only rules with `language: Go` in their frontmatter. @@ -26,7 +26,7 @@ Combine multiple selectors - all must match: ```bash # Include only Go testing rules -coding-context -s language=Go -s stage=testing implement-feature +coding-context -s language=Go -s stage=testing /implement-feature ``` This includes only rules with BOTH `language: Go` AND `stage: testing`. @@ -56,10 +56,10 @@ Deploy to production environment. **Usage:** ```bash # Select staging task -coding-context -s environment=staging deploy +coding-context -s environment=staging /deploy # Select production task -coding-context -s environment=production deploy +coding-context -s environment=production /deploy ``` ## Common Selector Patterns @@ -68,47 +68,47 @@ coding-context -s environment=production deploy ```bash # Python project -coding-context -s language=Python fix-bug +coding-context -s language=Python /fix-bug # JavaScript project -coding-context -s language=JavaScript code-review +coding-context -s language=JavaScript /code-review # Multi-language (run separately) -coding-context -s language=Go implement-backend -coding-context -s language=JavaScript implement-frontend +coding-context -s language=Go /implement-backend +coding-context -s language=JavaScript /implement-frontend ``` ### By Stage ```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 # Testing phase -coding-context -s stage=testing test-feature +coding-context -s stage=testing /test-feature ``` ### By Priority ```bash # High priority rules only -coding-context -s priority=high fix-critical-bug +coding-context -s priority=high /fix-critical-bug # Include all priorities (no selector) -coding-context fix-bug +coding-context /fix-bug ``` ### By Source ```bash # Include JIRA context -coding-context -s source=jira fix-bug +coding-context -s source=jira /fix-bug # Include GitHub context -coding-context -s source=github code-review +coding-context -s source=github /code-review ``` ## Resume Mode @@ -117,8 +117,8 @@ The `-r` flag is shorthand for `-s resume=true` plus skipping all rules: ```bash # These are equivalent: -coding-context -r fix-bug -coding-context -s resume=true fix-bug # but also skips rules +coding-context -r /fix-bug +coding-context -s resume=true /fix-bug # but also skips rules ``` Use resume mode when continuing work in a new session to save tokens. @@ -144,12 +144,12 @@ selectors: **Usage:** ```bash # Automatically applies 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 ``` ### Array Selectors (OR Logic) @@ -169,7 +169,7 @@ selectors: **Usage:** ```bash # Includes rules matching (go OR python OR javascript) AND refactoring -coding-context refactor-code +coding-context /refactor-code ``` ### Combining Command-Line and Task Selectors @@ -189,7 +189,7 @@ selectors: ```bash # Combines task selectors with command-line selectors # Result: stage=deployment AND environment=production -coding-context -s environment=production deploy +coding-context -s environment=production /deploy ``` ### When to Use Task Frontmatter Selectors @@ -209,7 +209,7 @@ coding-context -s environment=production deploy Task frontmatter (including selectors) is automatically included in the output: ```bash -coding-context implement-feature +coding-context /implement-feature ``` **Output:** @@ -256,13 +256,13 @@ team: backend **Matching selectors:** ```bash # Matches -coding-context -s language=Go fix-bug -coding-context -s language=Go -s stage=testing fix-bug -coding-context -s priority=high fix-bug +coding-context -s language=Go /fix-bug +coding-context -s language=Go -s stage=testing /fix-bug +coding-context -s priority=high /fix-bug # Does NOT match -coding-context -s language=Python fix-bug -coding-context -s language=Go -s stage=planning fix-bug +coding-context -s language=Python /fix-bug +coding-context -s language=Go -s stage=planning /fix-bug ``` ## Debugging Selectors @@ -271,11 +271,11 @@ Check which rules are included: ```bash # Output to file and review -coding-context -s language=Go fix-bug > output.txt +coding-context -s language=Go /fix-bug > output.txt less output.txt # Check token count -coding-context -s language=Go fix-bug 2>&1 | grep -i token +coding-context -s language=Go /fix-bug 2>&1 | grep -i token ``` ## Best Practices diff --git a/docs/how-to/use-with-ai-agents.md b/docs/how-to/use-with-ai-agents.md index f5cea68a..41f497fb 100644 --- a/docs/how-to/use-with-ai-agents.md +++ b/docs/how-to/use-with-ai-agents.md @@ -14,7 +14,7 @@ This guide shows you how to use the Coding Context CLI with various AI agents an Pipe the assembled context to any AI agent: ```bash -coding-context fix-bug | your-ai-agent +coding-context /fix-bug | your-ai-agent ``` ## With Claude CLI @@ -23,13 +23,13 @@ coding-context fix-bug | your-ai-agent coding-context \ -p issue_key=BUG-123 \ -s language=Go \ - fix-bug | claude + /fix-bug | claude ``` ## With OpenAI API ```bash -coding-context code-review | openai api completions.create \ +coding-context /code-review | openai api completions.create \ -m gpt-4 \ --stream ``` @@ -40,13 +40,13 @@ The [llm](https://llm.datasette.io/) tool supports many models: ```bash # Using Claude -coding-context fix-bug | llm -m claude-3-5-sonnet-20241022 +coding-context /fix-bug | llm -m claude-3-5-sonnet-20241022 # Using Gemini -coding-context code-review | llm -m gemini-pro +coding-context /code-review | llm -m gemini-pro # Using local models -coding-context implement-feature | llm -m llama2 +coding-context /implement-feature | llm -m llama2 ``` ## Saving Context to File @@ -55,7 +55,7 @@ Save the context for later use or inspection: ```bash # Save to file -coding-context fix-bug > context.txt +coding-context /fix-bug > context.txt # Review the context cat context.txt @@ -70,11 +70,11 @@ Use context in iterative workflows: ```bash # Step 1: Initial analysis -coding-context -s resume=false fix-bug > context-initial.txt +coding-context -s resume=false /fix-bug > context-initial.txt cat context-initial.txt | ai-agent > analysis.txt # Step 2: Implementation (skip rules with -r) -coding-context -r fix-bug > context-resume.txt +coding-context -r /fix-bug > context-resume.txt cat context-resume.txt analysis.txt | ai-agent > implementation.txt ``` @@ -84,7 +84,7 @@ If you're using GitHub Copilot, the CLI can prepare context for custom instructi ```bash # Generate context -coding-context implement-feature > .github/copilot-context.md +coding-context /implement-feature > .github/copilot-context.md # Copilot will read this file automatically ``` @@ -100,7 +100,7 @@ export GITHUB_TOKEN="your-token" export DATABASE_URL="your-db-url" # Bootstrap scripts can access these -coding-context -s source=jira fix-bug | ai-agent +coding-context -s source=jira /fix-bug | ai-agent ``` ## Token Count Monitoring @@ -109,10 +109,10 @@ The CLI prints token estimates to stderr: ```bash # See token count while piping to AI -coding-context fix-bug 2>&1 | tee >(grep -i token >&2) | ai-agent +coding-context /fix-bug 2>&1 | tee >(grep -i token >&2) | ai-agent # Or redirect stderr to file -coding-context fix-bug 2> tokens.log | ai-agent +coding-context /fix-bug 2> tokens.log | ai-agent ``` ## Batch Processing @@ -124,7 +124,7 @@ Process multiple tasks: for issue in BUG-101 BUG-102 BUG-103; do coding-context \ -p issue_key=$issue \ - fix-bug | ai-agent > "fix-$issue.txt" + /fix-bug | ai-agent > "fix-$issue.txt" done ``` @@ -144,7 +144,7 @@ coding-context \ -s priority=high \ -p issue_key="$ISSUE_KEY" \ -p description="$DESCRIPTION" \ - fix-bug | llm -m claude-3-5-sonnet-20241022 + /fix-bug | llm -m claude-3-5-sonnet-20241022 ``` Use with: @@ -159,21 +159,21 @@ If your context exceeds token limits: 1. **Use selectors to reduce included rules:** ```bash - coding-context -s language=Go -s priority=high fix-bug + coding-context -s language=Go -s priority=high /fix-bug ``` 2. **Use resume mode to skip rules:** ```bash - coding-context -r fix-bug + coding-context -r /fix-bug ``` 3. **Split into multiple requests:** ```bash # First request: Planning - coding-context -s stage=planning plan-feature | ai-agent + coding-context -s stage=planning /plan-feature | ai-agent # Second request: Implementation - coding-context -s stage=implementation implement-feature | ai-agent + coding-context -s stage=implementation /implement-feature | ai-agent ``` ## See Also diff --git a/docs/index.md b/docs/index.md index e37608c4..622beb9f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -19,7 +19,7 @@ sudo curl -fsL -o /usr/local/bin/coding-context \ sudo chmod +x /usr/local/bin/coding-context # Use with an AI agent -coding-context -p issue_key=BUG-123 -s language=Go fix-bug | llm -m claude-3-5-sonnet-20241022 +coding-context -p issue_key=BUG-123 -s language=Go /fix-bug | llm -m claude-3-5-sonnet-20241022 ``` ## Documentation Structure diff --git a/docs/reference/file-formats.md b/docs/reference/file-formats.md index 5e127cc1..5b5c74f1 100644 --- a/docs/reference/file-formats.md +++ b/docs/reference/file-formats.md @@ -42,7 +42,7 @@ task_name: fix-bug **Usage:** ```bash -coding-context fix-bug +coding-context /fix-bug ``` #### `language` (optional, standard field) @@ -80,8 +80,8 @@ language: **Equivalent command-line usage:** ```bash # These are equivalent: -coding-context implement-feature # (task has language: go) -coding-context -s language=go implement-feature +coding-context /implement-feature # (task has language: go) +coding-context -s language=go /implement-feature ``` #### `single_shot` (optional, standard field) @@ -169,8 +169,8 @@ agent: cursor **Equivalent command-line usage:** ```bash # These are equivalent: -coding-context implement-feature # (task has agent: cursor) -coding-context -a cursor implement-feature +coding-context /implement-feature # (task has agent: cursor) +coding-context -a cursor /implement-feature ``` #### `model` (optional, standard field) @@ -212,7 +212,7 @@ region: us-east-1 **Usage:** ```bash -coding-context -s environment=production -s region=us-east-1 deploy +coding-context -s environment=production -s region=us-east-1 /deploy ``` #### `selectors` (optional) @@ -235,12 +235,12 @@ selectors: **Usage:** ```bash # Automatically includes 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 ``` **OR Logic with Arrays:** @@ -266,7 +266,7 @@ Selectors from the task frontmatter and command-line `-s` flags are combined (ad # Task frontmatter has: selectors.language = Go # Command line adds: -s priority=high # Result: Rules must match language=go AND priority=high -coding-context -s priority=high implement-feature +coding-context -s priority=high /implement-feature ``` **Special Selector: `rule_name`** @@ -305,7 +305,7 @@ coding-context \ -p issue_key=BUG-123 \ -p description="Crashes on startup" \ -p severity=critical \ - fix-bug + /fix-bug ``` ### File Location @@ -536,10 +536,10 @@ metadata: **Selectors match top-level only:** ```bash # Works with top-level fields -coding-context -s language=go fix-bug +coding-context -s language=go /fix-bug # Doesn't work with nested fields -coding-context -s metadata.language=go fix-bug # Won't match +coding-context -s metadata.language=go /fix-bug # Won't match ``` ### Data Types @@ -556,9 +556,9 @@ language: go ```bash # All values are matched as strings -coding-context -s priority=1 task # Matches priority: 1 -coding-context -s enabled=true task # Matches enabled: true -coding-context -s language=go task # Matches language: go +coding-context -s priority=1 /task # Matches priority: 1 +coding-context -s enabled=true /task # Matches enabled: true +coding-context -s language=go /task # Matches language: go ``` ## Special Behaviors @@ -596,8 +596,8 @@ The `-r` flag: **Equivalent commands:** ```bash # These are NOT exactly equivalent: -coding-context -r fix-bug # Skips rules -coding-context -s resume=true fix-bug # Includes rules +coding-context -r /fix-bug # Skips rules +coding-context -s resume=true /fix-bug # Includes rules ``` ## Validation diff --git a/docs/tutorials/getting-started.md b/docs/tutorials/getting-started.md index 1c7f6724..794c67d6 100644 --- a/docs/tutorials/getting-started.md +++ b/docs/tutorials/getting-started.md @@ -126,14 +126,14 @@ coding-context \ -p issue_key=BUG-123 \ -p description="Application crashes on startup" \ -s language=Go \ - fix-bug + /fix-bug ``` **What this command does:** - `-p issue_key=BUG-123` replaces `${issue_key}` in the task - `-p description="..."` replaces `${description}` in the task - `-s language=Go` includes only rules with `language: Go` in frontmatter -- `fix-bug` is the task name to use +- `/fix-bug` is the task name to use (slash indicates task file lookup) You should see output containing: 1. The Go coding standards rule @@ -148,7 +148,7 @@ coding-context \ -p issue_key=BUG-123 \ -p description="Application crashes on startup" \ -s language=Go \ - fix-bug | llm -m claude-3-5-sonnet-20241022 + /fix-bug | llm -m claude-3-5-sonnet-20241022 ``` The AI agent will receive the assembled context and provide a response based on your coding standards and task requirements. @@ -164,7 +164,7 @@ coding-context \ -p issue_key=BUG-123 \ -p description="Application crashes on startup" \ -s language=Go \ - fix-bug | llm -m claude-3-5-sonnet-20241022 + /fix-bug | llm -m claude-3-5-sonnet-20241022 ``` This is useful for: