Skip to content

Improve CLI experience: enhanced skills + fix --version/-v flag handling#10

Open
TheophilusChinomona wants to merge 3 commits intoVedanthB:mainfrom
TheophilusChinomona:improve-context7-skills
Open

Improve CLI experience: enhanced skills + fix --version/-v flag handling#10
TheophilusChinomona wants to merge 3 commits intoVedanthB:mainfrom
TheophilusChinomona:improve-context7-skills

Conversation

@TheophilusChinomona
Copy link
Copy Markdown

@TheophilusChinomona TheophilusChinomona commented May 8, 2026

Summary

Two changes to improve the Context7 CLI developer experience:

1. Enhanced .kilo/skills/ (CLI Agent Skills)

Improves both context7-docs and context7-resolve skills with:

  • npx usage across all examples, shorthand aliases
  • Pipe mode patterns (clipboard, grep, file output)
  • Structured error handling tables with specific fixes
  • Automation patterns (Makefile, CI/CD, package.json scripts)
  • Troubleshooting sections with step-by-step recovery
  • Practical use cases and integration workflows

2. Fix: --version / -v Flag Handling (bin/c7.js)

The npm-published v1.0.2 of @vedanth/context7 is missing --version/-v flag support. The fix already exists in the repo source but was omitted from the npm tarball. Two blocks need inclusion in the next npm publish:

  1. In parseArgs(): the --version/-v branch after the --json branch
  2. In main(): the opts.version early-exit block before the help check

Related

Closes #9

Summary by CodeRabbit

  • Documentation
    • Added Context7 Documentation Fetch skill: enables documentation retrieval via CLI with comprehensive usage, options, and workflow examples.
    • Added Context7 Library Resolution skill: enables library name resolution to canonical identifiers with JSON output and integration guidance for automation.

Copilot AI review requested due to automatic review settings May 8, 2026 07:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Warning

Rate limit exceeded

@TheophilusChinomona has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 33 minutes and 30 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 101aa8c4-1e5b-4253-b2c4-1015112d6e78

📥 Commits

Reviewing files that changed from the base of the PR and between 28d92cf and 8c30105.

📒 Files selected for processing (4)
  • .kilo/skills/context7-docs/SKILL.md
  • .kilo/skills/context7-resolve/SKILL.md
  • .kilo/skills/pr-review-loop/SKILL.md
  • package.json
📝 Walkthrough

Walkthrough

This pull request adds two new skill definition files to document Context7 CLI capabilities. The changes introduce skill metadata and comprehensive usage documentation for the context7-docs skill (fetching library documentation via c7 docs) and the context7-resolve skill (resolving library names to Context7 IDs via c7 resolve).

Changes

Skills Documentation

Layer / File(s) Summary
Skill Metadata
.kilo/skills/context7-docs/SKILL.md, .kilo/skills/context7-resolve/SKILL.md
Metadata blocks define skill name, MIT license, version, author, compatibility, and allowed tools for both skills.
Documentation Fetch Skill
.kilo/skills/context7-docs/SKILL.md
Comprehensive documentation for fetching Context7 library docs via c7 CLI or npx, covering usage syntax, CLI options (token limit, API key), examples, piping/file output patterns, environment variables, error handling, installation methods, and integration workflows.
Library Resolution Skill
.kilo/skills/context7-resolve/SKILL.md
Complete documentation for resolving library names to Context7 canonical IDs via c7 resolve or npx, including usage patterns, JSON output format, chaining with docs fetching, failure strategies, installation options, Makefile and bash integration examples, and a reference table of common library mappings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

📚 Two skills bloom in the documentation garden,
c7 docs fetches wisdom, c7 resolve seeks pardon,
Library names transform to Context IDs bright,
Skills defined in Markdown, shining in the light! 🐰✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR adds documentation for two skills but does not implement the --version/-v flag fix in bin/c7.js required by issue #9. Add --version/-v flag handling in parseArgs() and main() of bin/c7.js as specified in issue #9 to fully meet PR objectives.
Out of Scope Changes check ⚠️ Warning Documentation additions (context7-docs and context7-resolve SKILL.md) align with PR objective to enhance skills. However, the main fix for issue #9 (--version flag) is missing entirely. Implement the missing --version/-v flag handling code changes in bin/c7.js to fulfill the second primary PR objective.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title directly describes both main changes: enhanced CLI skills and --version flag fix. It accurately summarizes the PR's primary objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Context7 CLI “skill” documentation to provide richer, more actionable usage guidance for c7 docs and c7 resolve, and aligns the release intent with the reported --version/-v flag issue from #9.

Changes:

  • Add/expand .kilo/skills/context7-docs/SKILL.md with more examples (piping, troubleshooting, automation patterns).
  • Add/expand .kilo/skills/context7-resolve/SKILL.md with JSON usage, chaining patterns, and error-handling guidance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
.kilo/skills/context7-docs/SKILL.md Adds expanded “docs” skill guidance (examples, troubleshooting, workflow integration).
.kilo/skills/context7-resolve/SKILL.md Adds expanded “resolve” skill guidance (JSON output, chaining into docs, automation patterns).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .kilo/skills/context7-resolve/SKILL.md Outdated
name: context7-resolve
description: Find Context7 library IDs for a given library name. Use when you need to resolve library names to their Context7 identifiers for documentation retrieval.
license: MIT
compatibility: Requires Node.js >=18 and the @vedanth/context7 package installed
Comment on lines +48 to +52
| Option | Description | Default |
|--------|-------------|---------|
| `--json` | Output raw JSON instead of formatted text | off |
| `--api-key <key>` | Context7 API key (or set CONTEXT7_API_KEY env var) | none |

Comment thread .kilo/skills/context7-resolve/SKILL.md Outdated

```bash
# Resolve, extract ID, then fetch docs
ID=$(c7 resolve react --json | node -e "process.stdin.on('data',d=>console.log(JSON.parse(d)[0].id))")
Comment on lines +151 to +154

docs:
c7 docs $(shell c7 resolve $(LIB) --json | node -e "process.stdin.on('data',d=>console.log(JSON.parse(d)[0].id))") "$(TOPIC)"
```
Comment on lines +160 to +165
# fetch-docs.sh — resolve and fetch docs in one step
LIB=$1
TOPIC=$2
ID=$(npx @vedanth/context7 r "$LIB" --json | node -e "process.stdin.on('data',d=>console.log(JSON.parse(d)[0].id))")
npx @vedanth/context7 docs "$ID" "$TOPIC"
```
Comment on lines +112 to +118
| Error | Cause | Fix |
|-------|-------|-----|
| "No libraries found for X" | Library not in Context7 index | Try synonyms, check spelling, or use a more general query |
| "Search failed: 429" | Rate limited | Set `CONTEXT7_API_KEY` for higher limits |
| "Error: fetch failed" | Network issue | Check internet connection |
| "command not found: c7" | CLI not installed | Use `npx @vedanth/context7` or run `npm install -g @vedanth/context7` |

Comment on lines +169 to +177
| Common Name | Context7 ID |
|-------------|-------------|
| react | `/facebook/react` |
| nextjs | `/vercel/next.js` |
| express | `/expressjs/express` |
| tailwindcss | `/tailwindlabs/tailwindcss` |
| vue | `/vuejs/core` |
| prisma | `/prisma/prisma` |
| lodash | `/lodash/lodash` |
Comment thread .kilo/skills/context7-docs/SKILL.md Outdated
name: context7-docs
description: Get documentation for a library from Context7. Use when you need up-to-date library documentation, API references, code examples, or specific topic information from Context7.
license: MIT
compatibility: Requires Node.js >=18 and the @vedanth/context7 package installed
Comment thread .kilo/skills/context7-docs/SKILL.md Outdated
3. **With Editor Integration**
```bash
# Create helper scripts for your editor
echo '#!/bin/bash\nc7 "$@"' > ~/bin/context7-search
Comment on lines +1 to +10
---
name: context7-docs
description: Get documentation for a library from Context7. Use when you need up-to-date library documentation, API references, code examples, or specific topic information from Context7.
license: MIT
compatibility: Requires Node.js >=18 and the @vedanth/context7 package installed
metadata:
author: Kilo
version: "1.0.1"
allowed-tools: Bash
---
@TheophilusChinomona
Copy link
Copy Markdown
Author

All copilot review comments addressed in 7f5ed56:

  • Compatibility fields: Updated both skills to mention npx usage alongside installed mode
  • Chunked stdin parsing: Replaced all process.stdin.on('data', ...) patterns with readFileSync('/dev/stdin','utf8') across all three examples (inline, Makefile, shell script)
  • Echo heredoc: Replaced echo '...\n...' with portable cat << 'SCRIPT' heredoc
  • Version bump: package.json bumped from 1.0.2 to 1.0.3 for npm re-publish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm-published v1.0.2 missing --version/-v flag handling in bin/c7.js

2 participants