-
Notifications
You must be signed in to change notification settings - Fork 2
Release v0.2.0: Major feature additions and improvements #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Existing main function has complexity of 20. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add /postmortem command to generate postmortem documents - Extract timeline, root cause, and action items from issue comments - Output structured markdown with incident summary, timeline, and lessons learned - Add E2E test for postmortem command - Update documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(commands): add postmortem command for incident documentation
fix(deps): update module golang.org/x/oauth2 to v0.34.0
- Add Slack client with webhook support for notifications - Send notifications when AI responds to commands - Support config file and CLI flag for webhook URL - Add channel override option - Update documentation with Slack setup guide Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(notifications): add Slack notification integration
- Add workflow_dispatch for manual E2E test triggering - Add explicit warnings when secrets are not configured - Document CI E2E test skip issues in CLAUDE.md - Add troubleshooting steps for secrets configuration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Anthropic SDK integration (anthropics/anthropic-sdk-go)
- Support text and image inputs via Claude API
- Add anthropic provider option in config
- Update E2E tests to use configurable test repo (nwiizo/alert-menta-test)
- Add E2E_TEST_REPO, E2E_TEST_OWNER, E2E_TEST_ISSUE env vars
Usage:
ai:
provider: "anthropic"
anthropic:
model: "claude-sonnet-4-20250514"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix config file path resolution using runtime.Caller - Add .envrc.example template for secure local testing - Add .envrc to .gitignore All E2E tests now pass: - TestE2E_DescribeCommand - TestE2E_SuggestCommand - TestE2E_AskCommand - TestE2E_AnalysisCommand - TestE2E_PostmortemCommand Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…55) - Add /runbook command to generate step-by-step incident response procedures - Output includes: overview, prerequisites, investigation steps, resolution options, validation, escalation criteria, and rollback procedures - Add E2E test for runbook command - Update documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(commands): add runbook command for incident response procedures
) - Add /timeline command to generate chronological incident timeline - Extract events from Issue comments with timestamps and actors - Include key metrics: Time to Acknowledge (TTA), Time to Resolve (TTR) - Use emojis to categorize event types (🚨 alert, 🔍 investigation, ✅ resolved, etc.) - Add E2E test for timeline command - Update documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(commands): add timeline command for incident activity tracking
- Add MCP server using mark3labs/mcp-go SDK
- Implement tools: get_incident, analyze_incident, post_comment, list_commands
- Support all analysis commands: describe, suggest, analysis, postmortem, runbook, timeline
- Reuse existing internal packages for GitHub and AI operations
- Add documentation in README.md and CLAUDE.md
Usage:
go run ./cmd/mcp/main.go -config .alert-menta.user.yaml
Claude Code settings.json:
{
"mcpServers": {
"alert-menta": {
"command": "go",
"args": ["run", "./cmd/mcp/main.go", "-config", ".alert-menta.user.yaml"],
"env": { "GITHUB_TOKEN": "...", "OPENAI_API_KEY": "..." }
}
}
}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(mcp): add MCP server for Claude Code integration
Add automatic failover between AI providers when primary fails. - Add FallbackConfig struct with retry settings - Create FallbackClient wrapper that tries providers in order - Support configurable max_retries, delay_ms per provider - Auto-detect retryable errors (timeout, rate limit, 5xx) - Update MCP server to support fallback - Document fallback configuration in README Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Automatically posts an incident response guide when Issues with specific labels (incident, alert, outage) are created. Features: - Automatic severity detection from labels and body keywords - Severity-specific guide templates (high/medium/low) - Configurable trigger labels and escalation settings - Dry-run mode for testing - GitHub Actions workflow template New files: - cmd/firstresponse/main.go - CLI entry point - internal/firstresponse/ - Guide generation logic - .github/workflows/first-response.yaml.example - Workflow template Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add JSON structured output support for commands that need machine-parseable responses. - Add StructuredOutputOptions to Prompt struct - OpenAI: Use JSON mode via ResponseFormat - Anthropic: Use prompt engineering + JSON validation - VertexAI: Use application/json MIME type - Add triage command as example with schema definition - Document structured output in README Providers validate JSON output and return errors for invalid responses. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Add feature summary table at top - List all implemented commands including triage - Add all supported providers (OpenAI, Anthropic, VertexAI) - Document integrations (Slack, MCP) - Document automation features (First Response, Fallback, Structured Output) - Remove RAG from features (not implemented) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Automatically analyze and label new issues based on AI triage. Features: - Automatic priority detection (critical/high/medium/low) - Automatic category detection (bug/feature/docs/incident) - Confidence scores for each classification - Reasoning explanation in comments - Configurable confidence threshold - Dry-run mode for testing New files: - cmd/triage/main.go - CLI entry point - internal/triage/ - Triage logic and config - .github/workflows/triage.yaml.example - Workflow template Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Update GoReleaser to v2 with all 4 binaries (alert-menta, alert-menta-mcp, alert-menta-firstresponse, alert-menta-triage) - Add arm64 architecture support for all platforms - Add checksums and changelog grouping - Add release workflow for automated GitHub releases on tag push - Update Makefile with build targets for all binaries Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update golang.org/x/crypto, golang.org/x/oauth2, golang.org/x/net - Update google.golang.org/grpc to v1.78.0 - Update other transitive dependencies Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add govulncheck and gosec workflows - Configure Dependabot for Go modules and GitHub Actions - Group dependencies by source for cleaner PRs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add -version flag to CLI with build info (version, commit, date) - Add security and vuln targets for gosec and govulncheck - Embed version info via ldflags during build - Update tools target to include security scanners Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Refactor cmd/triage/main.go to reduce cyclomatic complexity - Extract functions: parseFlags, run, validateConfig, getIssueInfo, etc. - Fix error string capitalization (staticcheck ST1005) - Fix gofmt/gofumpt formatting issues Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add security scanning commands and workflow info - Add GoReleaser usage and multi-binary build info - Add Dependabot configuration notes - Add version flag documentation - Add gocyclo/nestif complexity fix patterns - Add Makefile validation tips Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Extract 399-line CLAUDE.md into focused modules: Before: 399 lines (single file) After: 47 lines (CLAUDE.md) + 274 lines (extracted) Extracted files: - .claude/rules/go-development.md (55 lines) - Build commands, code quality - .claude/rules/git-workflow.md (21 lines) - Branch strategy, commits - .claude/skills/mcp-server/SKILL.md (38 lines) - MCP server setup - .claude/skills/release/SKILL.md (32 lines) - GoReleaser workflow - .claude/agents/troubleshooter.md (128 lines) - Self-diagnosis patterns Startup context reduced by 88% (399 → 47 lines) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(release): enhance GoReleaser config and add release workflow
Docker configuration: - Multi-stage build with golang:1.23-alpine builder - Distroless runtime image (gcr.io/distroless/static-debian12:nonroot) - Non-root user for security - Optimized layer caching (go.mod/go.sum first) - Build args for version info - OCI labels for container metadata Security best practices: - CGO_ENABLED=0 for static binary - -trimpath to remove file paths - Read-only filesystem in docker-compose - no-new-privileges security option Makefile additions: - docker-build: Build image with version info - docker-push: Push to ghcr.io registry - docker-run: Run container with config - Reorganized help output by category Closes #24 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update go.mod to Go 1.24 - Update all GitHub Actions workflows to use Go 1.24 - Update Dockerfile to use golang:1.24-alpine - Update Makefile GO_VERSION - Upgrade dependencies that require Go 1.24: - google.golang.org/grpc v1.78.0 - golang.org/x/crypto, net, oauth2, text, sys, sync Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Go 1.24 best practices: - Add tool directive in go.mod for gosec, govulncheck, gofumpt - Use `go tool <name>` instead of direct binary invocation - Use `go install tool` to install all tools from go.mod - Upgrade dependencies to latest compatible versions Benefits: - Centralized tool version management in go.mod - Consistent development environment across team - Cached tool execution for faster repeated runs Sources: - https://go.dev/doc/go1.24 - https://aran.dev/posts/go-124/go-124-new-tool-directive/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces v0.2.0, adding major incident response automation features and multi-provider AI support. Key additions include an MCP server for Claude Code integration, auto-triage for issues, first response guides, provider fallback, and structured JSON output capabilities.
Changes:
- Added MCP server, auto-triage, and first response automation features
- Implemented provider fallback (OpenAI/Anthropic/VertexAI) with automatic failover
- Added Slack notifications, structured JSON output, and new commands (postmortem, runbook, timeline)
- Upgraded to Go 1.24 with tool directive, added Docker support with distroless runtime
Reviewed changes
Copilot reviewed 46 out of 48 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated to Go 1.24, added anthropic/mcp-go dependencies, defined tool directive |
| internal/utils/utils.go | Added config structs for notifications, triage, first response, fallback, structured output |
| internal/ai/anthropic.go | New Anthropic AI provider implementation with structured output support |
| internal/ai/fallback.go | New fallback client for automatic provider switching on failures |
| internal/ai/openai.go | Added structured JSON output support via ChatCompletionsJSONResponseFormat |
| internal/ai/vertexai.go | Added JSON mode and structured output validation |
| internal/ai/ai.go | Added StructuredOutputOptions interface for JSON schema responses |
| internal/github/github.go | Added GetLabels and AddLabels methods for issue label management |
| internal/slack/slack.go | New Slack webhook client for notifications |
| internal/slack/slack_test.go | Unit tests for Slack client with httptest mock server |
| internal/mcp/server.go | New MCP server implementation for Claude Code integration |
| internal/triage/triage.go | New auto-triage logic with AI-powered label suggestions |
| internal/triage/config.go | Triage configuration with label definitions and confidence thresholds |
| internal/firstresponse/guide.go | First response guide generator with template rendering |
| internal/firstresponse/severity.go | Severity detection from labels and issue body |
| internal/firstresponse/trigger.go | Logic for triggering first response based on labels |
| cmd/main.go | Added version flag, Slack notification integration, fallback support |
| cmd/mcp/main.go | New MCP server CLI binary |
| cmd/triage/main.go | New auto-triage CLI binary |
| cmd/firstresponse/main.go | New first response guide CLI binary |
| e2e/e2e_test.go | Refactored with helper functions, added tests for new commands |
| Dockerfile | New multi-stage build with distroless runtime |
| docker-compose.yaml | Service definitions for all binaries |
| .goreleaser.yaml | Multi-binary release configuration for 4 binaries across 6 platforms |
| Makefile | Updated build targets, added security/vuln checks, Docker targets |
| README.md | Comprehensive documentation for all new features |
| CLAUDE.md | Refactored into modular .claude/ structure |
| .github/workflows/*.yaml | Updated Go version to 1.24, added security/release workflows |
| .alert-menta.user.yaml | Added configs for all new features with examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| systemPrompt := prompt.SystemPrompt | ||
| if prompt.StructuredOutput != nil && prompt.StructuredOutput.Enabled { | ||
| schemaJSON, err := prompt.StructuredOutput.GetSchemaJSON() | ||
| if err == nil && schemaJSON != nil { |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error from GetSchemaJSON is being silently ignored. If schema marshaling fails, the AI won't receive schema instructions, potentially leading to incorrect output format. Consider logging the error or handling it explicitly.
| if err == nil && schemaJSON != nil { | |
| if err != nil { | |
| return "", fmt.Errorf("failed to get structured output schema JSON: %w", err) | |
| } | |
| if schemaJSON != nil { |
| if err == nil && schemaJSON != nil { | ||
| systemPrompt += fmt.Sprintf("\n\nYou MUST respond with valid JSON that conforms to this schema:\n```json\n%s\n```\nRespond ONLY with the JSON object, no additional text.", string(schemaJSON)) | ||
| } else { | ||
| systemPrompt += "\n\nYou MUST respond with valid JSON. Respond ONLY with the JSON object, no additional text." | ||
| } |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to VertexAI, the error from GetSchemaJSON is silently ignored. The else branch provides a generic JSON instruction without the schema, which may not produce the expected structure. Consider logging the marshaling error or returning it.
| if err == nil && schemaJSON != nil { | |
| systemPrompt += fmt.Sprintf("\n\nYou MUST respond with valid JSON that conforms to this schema:\n```json\n%s\n```\nRespond ONLY with the JSON object, no additional text.", string(schemaJSON)) | |
| } else { | |
| systemPrompt += "\n\nYou MUST respond with valid JSON. Respond ONLY with the JSON object, no additional text." | |
| } | |
| if err != nil { | |
| return "", fmt.Errorf("failed to get structured output schema: %w", err) | |
| } | |
| if schemaJSON == nil { | |
| return "", fmt.Errorf("failed to get structured output schema: schema is nil") | |
| } | |
| systemPrompt += fmt.Sprintf("\n\nYou MUST respond with valid JSON that conforms to this schema:\n```json\n%s\n```\nRespond ONLY with the JSON object, no additional text.", string(schemaJSON)) |
Summary
This PR includes all v0.2.0 features and improvements from the develop branch.
New Features
New Commands
/analysis- Root cause analysis/postmortem- Post-incident documentation/runbook- Response procedure suggestions/timeline- Activity timelineInfrastructure
Go 1.24 Best Practices
go.modfor gosec, govulncheck, gofumptgo tool <name>for tool executionCode Quality
.claude/structure (399 → 47 lines)-versionflag to CLIBinaries Built
alert-mentaalert-menta-mcpalert-menta-triagealert-menta-firstresponsePlatforms Supported
Test Plan
Breaking Changes
🤖 Generated with Claude Code