Drop a comment on any pull request and the bot replies instantly — no setup, no context switching, no copy-pasting into ChatGPT.
@gitagent explain src/auth/token.js#L20-L45
What this code does
This function validates a JWT token and extracts the user payload. It checks the signature against the secret key and throws if the token is expired.
Key points:
- Uses
jsonwebtokenunder the hood — not custom crypto- The
ignoreExpirationflag is intentionally false here- Returns a plain JS object, not a class instance
Watch out for: If
JWT_SECRETis undefined in env, this will throw a confusingsecretOrPrivateKeyerror rather than a missing env error.
Or generate tests instantly:
@gitagent test src/utils/format.js
| Command | What it does |
|---|---|
@gitagent explain <file> |
Explains an entire file in plain English |
@gitagent explain <file>#L10-L30 |
Explains a specific line range |
@gitagent test <file> |
Generates unit tests (auto-detects Jest, pytest, RSpec, etc.) |
mkdir -p .github/workflows
curl -o .github/workflows/agent.yml \
https://raw.githubusercontent.com/hkv-31/Code-Explainer-Git-Agent/main/.github/workflows/agent.ymlGo to your repo → Settings → Secrets → Actions → New repository secret
| Secret name | Value |
|---|---|
GROQ_API_KEY |
Get free at console.groq.com/keys — no card required |
GITHUB_TOKEN is auto-provided by GitHub Actions. Nothing else needed.
Comment @gitagent explain <any-file.js> and watch the bot reply in seconds.
PR comment → GitHub Actions trigger → fetch file via GitHub API
→ send to Groq (Llama 3) → post explanation as comment reply
Built on the gitagent open standard — fully framework-agnostic.
Code-Explainer-Git-Agent/
├── agent.yaml # gitagent manifest
├── SOUL.md # agent identity & tone
├── RULES.md # hard constraints
├── index.js # runtime logic (~120 lines)
├── skills/
│ ├── explain-code/SKILL.md # explain skill
│ └── generate-tests/SKILL.md # test generation skill
└── .github/workflows/
└── agent.yml # GitHub Actions trigger
Export to any framework with zero code changes:
npm install -g @open-gitagent/gitagent
gitagent validate # confirm spec compliance
gitagent export --format system-prompt # plain system prompt
gitagent export --format openai # OpenAI Agents SDK
gitagent export --format claude-code # Claude Code
gitagent run . --adapter lyzr # Lyzr StudioFor new engineers: Understand unfamiliar code in seconds instead of hours. No more "what does this even do?" blocking a review.
For code reviewers: Tag confusing sections mid-review and get instant context without leaving the PR.
For test coverage: Generate test stubs for any file without switching tools or breaking flow.
| Tool | Free tier |
|---|---|
| Groq (Llama 3.3 70B) | ~14,400 req/day on free tier |
| GitHub Actions | 2,000 min/month on public repos |
| GitHub API | 5,000 req/hour |
Zero cost for a typical engineering team.
Made with coffee and one too many @gitagent explain comments