The AI-native technical debt janitor. Detect, explain, and fix AI-generated code rot — 100% locally.
- Why Code-Steward
- Features
- Installation
- Quick Start
- Usage Guide
- How It Works
- Documentation Hub
- Community & Contributing
- Launch Call to Action
- License
Code-Steward is the public launch platform for local-first AI remediation. It helps teams identify AI-generated technical debt, quantify risk, and fix code safely in a review-friendly workflow.
- Detect AI-generated code rot with purpose-built smell analysis.
- Quantify remediation risk with transparent Technical Debt Ratio (TDR).
- Repair code in an isolated shadow workspace before changing history.
- Create GitHub pull requests with human-readable thought traces.
- Keep everything on your machine with zero cloud egress.
- 🚦 TDR Auditor — compute a clear Technical Debt Ratio from AI-smells and remediation risk.
- 🧠 Refactor Engine — generate fix plans and execute them in a shadow workspace.
- 🕵️ AI-Smell Detection — detect 12 AI-native smells, including context poisoning, silent failure paths, and brittle type boundaries.
- 🛡️ Local-First — analysis and inference stay local; no external LLM APIs required.
- 🧾 PR Generator — push a branch and open a GitHub pull request with verification metadata.
- 🤖 Steward Bot — CI/CD automation that validates PR safety and reports TDR deltas.
- 🌐 Multi-language support — TypeScript, Rust, JSON, YAML, and other common formats.
- 🔗 MCP tool bridge — expose local tools securely to assistant workflows.
- 📊 Verification metrics — track coverage, new smells, and test pass rates.
- 🔄 Repeatable workflow — audit → plan → execute → verify → PR.
- Rust toolchain installed
- Node.js 20+
- Git
- Ollama installed locally
- DeepSeek-R1 model available in Ollama
- GitHub CLI or a GitHub token for PR creation
npm install
npm run build:core
npm run buildcd cli && npm run start
# or start the MCP server service
cd mcp-server && npm run devdocker build -t codesteward/mcp-server .
docker run --rm -p 4200:4200 codesteward/mcp-servernpm run testThe CLI package is now configured for npm publication.
cd cli
npm install
npm run build
npm login
npm publish --access publicIf you want to check the package contents before publishing:
cd cli
npm pack --dry-runMake sure the package name in
cli/package.jsonis unique on npm before publishing.
npm install
npm run builddocker build -t codesteward/mcp-server .
docker run --rm -p 4200:4200 codesteward/mcp-server- Build the Rust core first using
npm run build:coreor let the Dockerfile build it automatically. - Use
npm run testbefore deployment to validate the CLI and MCP server. - Set
CODESTEWARD_AUDIT_LOG_DIRto a persistent storage path in production. - Keep local-only agent metadata out of version control:
.agents/andskills-lock.jsonare ignored. - Prefer container orchestration (Kubernetes, Docker Compose, or systemd) for production runs.
Start in the first five minutes with a new or existing repository.
git clone https://github.com/codesteward/sample-project.git
cd sample-project
codesteward audit --target .
codesteward fix --target .
codesteward pr$ codesteward audit --target .
Analyzing repository...
TDR: 0.41
Smells found: 8
Status: review recommendedThen run the fix pipeline:
$ codesteward fix --target .
Planning remediation...
Applying verified fix in shadow workspace...
Verification passed.
Saved fix metadata to ~/.codesteward/last-fix.jsonOpen a PR when ready:
$ codesteward pr
Creating branch code-steward/fix-2026-05-06...
Applying patch...
Pushing branch...
Pull request created: https://github.com/codesteward/codesteward/pull/123Analyze a repository and compute the Technical Debt Ratio.
codesteward audit --target .
codesteward audit --target ./backend --json- TDR – overall technical debt ratio.
- cost_index – estimated remediation effort.
- velocity_debt – risk of slowing development.
- status – green/yellow/orange/red recommendation.
- smells – counts and categories of detected AI-smells.
0.0–0.3— green: safe to repair automatically.0.31–0.6— yellow: review recommended.0.61–0.8— orange: verify carefully.0.81–1.0— red: avoid automatic remediation without manual review.
Generate and apply a remediation plan.
codesteward fix --target .
codesteward fix --target . --auto- Builds an ordered fix plan from AI-smell data.
- Applies changes inside a shadow workspace.
- Runs verification checks.
- Writes verified patch data to
~/.codesteward/last-fix.json.
- Interactive: prompts before applying changes.
--auto: apply the plan without confirmation.
Show the repository health dashboard.
codesteward status --target .- Current TDR and status
- Smell trends
- Verification confidence
- Fix success rate
Create a pull request from the last verified fix.
codesteward pr
codesteward pr --base main --title "Fix AI-generated debt" --draft~/.codesteward/last-fix.jsonexists.- GitHub remote is configured.
ghCLI installed orGITHUB_TOKEN/GH_TOKENavailable.- Branch state is clean.
✅ Pull request created: https://github.com/codesteward/codesteward/pull/123
✔️ Generated by Code-Steward local AI steward.Code-Steward is a local-first, four-stage workflow:
flowchart TB
A[Audit] --> B[Plan]
B --> C[Execute]
C --> D[Verify]
D --> E[PR]
subgraph Local-Only
F[Ollama + DeepSeek-R1]
end
A --> F
B --> F
C --> F
D --> F
- Audit detects AI-smells and computes TDR.
- Plan creates a repair sequence based on risk and scope.
- Execute applies fixes in an isolated shadow workspace.
- Verify ensures tests and behavior remain stable.
- PR pushes the result as a review-ready pull request.
Code-Steward keeps analysis and inference on your machine. No external LLM API calls are required, and no repository data is sent to the cloud unless you push a pull request through GitHub.
For full architecture details, see ARCHITECTURE.md.
| Document | Description |
|---|---|
| DEVELOPER_GUIDE.md | Build, test, and extend the Code-Steward platform. |
| ARCHITECTURE.md | System design, agents, and data flow. |
| AI_SMELLS_REFERENCE.md | AI-smell taxonomy and detection heuristics. |
| TDR_EXPLAINER.md | How Technical Debt Ratio is computed and used. |
| PR_GENERATION.md | codesteward pr workflow and GitHub integration. |
| CONTRIBUTING.md | Contribution process, bot guidelines, and community norms. |
Help shape the public launch by contributing fixes, docs, test cases, and new smell rules.
- Read the contribution guide: CONTRIBUTING.md
- Report bugs or suggest new features on GitHub.
- Review Steward Bot feedback and improve automation.
- Grow from Contributor to Reviewer to Maintainer.
The Steward Bot runs in CI/CD to inspect PRs, report TDR before and after, and guard against unsafe automated changes. If the bot blocks a PR, update the remediation and push again.
- GitHub Discussions:
https://github.com/codesteward/codesteward/discussions - Issues:
https://github.com/codesteward/codesteward/issues
If Code-Steward helped you reduce risk, please star the repo and share the launch.
- Star us ⭐ if you find the tool useful.
- Share on X/Twitter:
https://twitter.com/intent/tweet?text=Check+out+Code-Steward+%E2%80%94+local+AI+technical+debt+remediation - Share on LinkedIn:
https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/codesteward/codesteward
Join the 50 beta developers who already reduced their TDR by 30%.
Code-Steward is released under the terms of the project license. See LICENSE for details.

