senior-engineer-agent
v0.1.1
Published
A LangChain/LangGraph agent that codes like a senior software engineer — install globally, use anywhere
Maintainers
Readme
Senior Engineer Agent
A LangChain/LangGraph agent that codes like a senior software engineer. Install it globally once, use it in any project — no agent code in your repo.
Quick Start
# 1. Install globally
npm install -g senior-engineer-agent
# 2. Configure your API key (one-time)
senior-engineer setup
# 3. Add the agent to any Kiro workspace
cd your-project
senior-engineer init
# 4. Use it — from CLI or Kiro
senior-engineer "Write a Python LRU cache with O(1) get and put"That's it. Open the project in Kiro and invoke /senior-engineer from chat.
How It Works
The agent runs from your global npm install. Your project only gets a thin
.kiro/agents/senior-engineer.md file (created by senior-engineer init)
that tells Kiro how to invoke the globally installed CLI. No agent source
code is downloaded into your project.
┌─────────────────────────────────────────────────┐
│ Your Project │
│ .kiro/agents/senior-engineer.md (tiny file) │
│ │ │
│ ▼ invokes │
│ senior-engineer CLI (global npm package) │
│ │ │
│ ▼ calls │
│ Groq / OpenAI API │
└─────────────────────────────────────────────────┘Architecture
The agent uses a LangGraph state graph with six nodes:
analyze_task ──► plan_approach ──► generate_code ──► generate_tests
│
▼
review_code
│ │
(approved) │ │ (needs_refactor)
▼ ▼
END refactor_code ──► generate_tests
│ ...
▼ (max iterations)
END| Node | Purpose |
|------|---------|
| analyzeTask | Extracts language, complexity, requirements, and constraints |
| planApproach | Creates architecture plan, implementation steps, design patterns |
| generateCode | Writes production-quality code following the plan |
| generateTests | Generates comprehensive tests |
| reviewCode | Reviews for bugs, security, performance, and style |
| refactorCode | Addresses review issues and loops back for re-testing |
CLI Reference
# Run the agent on a task
senior-engineer "Build a REST API rate limiter in Go"
# With options
senior-engineer --max-iterations 5 --verbose "Implement a B-tree in Rust"
# Pipe from stdin
echo "Write a binary search in TypeScript" | senior-engineer
# Setup & init
senior-engineer setup # Configure API key (one-time)
senior-engineer init # Add agent to current Kiro workspace
senior-engineer --help # Show helpNode.js API
import { run } from "senior-engineer-agent";
const result = await run(
"Write a thread-safe singleton pattern in Java",
{ maxIterations: 3 },
);
console.log(result.code);
console.log(result.tests);
console.log(result.reviewVerdict); // "approved" or "needs_refactor"Configuration
Config is loaded in this order (first wins):
- Environment variables
- Local
.envin current directory - Global
~/.senior-engineer/.env(created bysenior-engineer setup)
| Variable | Default | Description |
|----------|---------|-------------|
| LLM_PROVIDER | groq | groq (free) or openai |
| GROQ_API_KEY | — | Free at console.groq.com/keys |
| OPENAI_API_KEY | — | Only if using openai provider |
| LLM_MODEL | provider default | Model name override |
| LLM_TEMPERATURE | 0.2 | Sampling temperature |
Available Groq Models (free)
| Model | Context | Best for |
|-------|---------|----------|
| llama-3.3-70b-versatile (default) | 128k | Complex coding tasks |
| llama-3.1-8b-instant | 128k | Fast, simple tasks |
| gemma2-9b-it | 8k | Balanced performance |
| mixtral-8x7b-32768 | 32k | Good reasoning |
For Other Developers
Any developer on your team can start using the agent in 3 commands:
npm install -g senior-engineer-agent
senior-engineer setup
senior-engineer initNo agent code ends up in the project. The .kiro/agents/senior-engineer.md
file is safe to commit — it just tells Kiro to call the global CLI.
Testing
# Clone the repo for development
git clone <repo-url> && cd senior-engineer-agent
npm install
# Run tests
npm test
# Type checking
npm run typecheckLicense
MIT
