Codemend
v1.1.0Monitor, report, and get AI-generated fixes for JavaScript and TypeScript production errors with automated analysis and pull request integration.
Like a lobster shell, security has layers — review code before you run it.
License
SKILL.md
Codemend AI Skill
Codemend captures production JavaScript/TypeScript errors, analyzes them with AI, and generates fixes — either as GitHub PRs or paste-back prompts for AI coding tools like Lovable, Replit, and Cursor.
Tools
report_error
Report a production error to Codemend. The error will be analyzed by AI within seconds.
curl -X POST "https://codemend.ai/api/errors/ingest" \
-H "Content-Type: application/json" \
-d '{
"key": "'$CODEMEND_API_KEY'",
"message": "TypeError: Cannot read properties of undefined (reading '\''map'\'')",
"stack": "TypeError: Cannot read properties of undefined\n at renderList (src/components/List.tsx:15:23)",
"source_url": "https://myapp.com/dashboard",
"source_type": "openclaw"
}'
Response:
{ "status": "queued", "error_id": "uuid-here" }
get_fix
Get the AI-generated fix for a reported error. Includes explanation, root cause, confidence score, and a fix prompt you can paste into your AI coding tool.
curl -s "https://codemend.ai/api/errors/{ERROR_ID}/fix" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"error": {
"id": "uuid",
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"stack_trace": "...",
"source_url": "https://myapp.com/dashboard"
},
"fix": {
"id": "uuid",
"explanation": "The map() call fails because data is undefined on first render",
"root_cause": "Missing null check before array operation",
"confidence": 0.92,
"fix_prompt": "In src/components/List.tsx, add an early return if data is undefined...",
"pr_url": "https://github.com/user/repo/pull/42"
},
"dashboard_url": "https://codemend.ai/errors/uuid"
}
If the error is still being analyzed, the fix field will be null. Poll with check_status first.
check_status
Check if an error has been analyzed yet.
curl -s "https://codemend.ai/api/errors/{ERROR_ID}/status" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"has_fix": true,
"fix_id": "uuid-here",
"dashboard_url": "https://codemend.ai/dashboard/errors/uuid"
}
Statuses: new → analyzing → analyzed / fix_applied / ignored
list_errors
List recent errors for this project.
curl -s "https://codemend.ai/api/errors?limit=10&status=analyzed" \
-H "x-api-key: $CODEMEND_API_KEY"
Response:
{
"errors": [
{
"id": "uuid",
"status": "analyzed",
"message": "TypeError: Cannot read properties of undefined",
"source_type": "openclaw",
"has_fix": true,
"fix_id": "uuid",
"created_at": "2026-03-11T12:00:00Z"
}
],
"total": 42
}
Setup in a Project
Browser (React, Next.js, Vue, etc.)
Add to your HTML <head>:
<script src="https://codemend.ai/s.js" data-key="YOUR_API_KEY"></script>
Or if using an AI coding tool (Lovable, Replit, Bolt, etc.), paste this prompt:
Add this error monitoring script to my app. Put it in the
<head>section of index.html:<script src="https://codemend.ai/s.js" data-key="YOUR_API_KEY"></script>
Node.js / Backend
npm install codemend
const codemend = require('codemend');
codemend.init({ apiKey: process.env.CODEMEND_API_KEY });
codemend.setupProcessHandlers();
Express
const codemend = require('codemend');
codemend.init({ apiKey: process.env.CODEMEND_API_KEY });
app.use(codemend.expressErrorHandler());
React Native
import codemend from 'codemend/react-native';
codemend.init({ apiKey: 'YOUR_API_KEY' });
codemend.setupErrorHandler();
Typical Workflow
- Set up error monitoring in your project (above)
- Errors are automatically captured and sent to Codemend
- Use
list_errorsto see recent errors - Use
get_fixto get the AI-generated fix - Apply the fix: paste the
fix_promptinto your AI tool, or review the PR on GitHub
Files
3 totalComments
Loading comments…
