Skip to content

Conversation

@peiman
Copy link
Owner

@peiman peiman commented Oct 6, 2025

Summary

Transforms changie into an AI-ready tool with comprehensive integration for AI assistants and automation workflows.

Key Features:

  • JSON output mode (--json flag) for CI/CD pipelines
  • MCP server for Claude Desktop, Cursor, and other AI coding tools
  • Comprehensive integration guides and examples
  • LLM-optimized documentation

Changes

JSON Output Support

  • Add --json flag to all bump commands
  • Structured output with success/error handling
  • CI/CD integration examples (GitHub Actions, GitLab CI)
  • New internal/output package with output structures

MCP Server

  • Official MCP Go SDK v1.0.0 integration
  • 4 tools: changie_bump_version, changie_add_changelog, changie_init, changie_get_version
  • Docker support (52.1MB Alpine-based image)
  • Task commands for building and running

Documentation & Resources

  • Integration guide for Claude Desktop, Cursor, and Claude Code
  • .ai/ directory with agent context, prompts, and workflows
  • llms.txt for LLM-optimized documentation
  • examples/ with CI/CD workflow scripts
  • Updated README with AI features
  • Updated CLAUDE.md with new packages

Impact

For Users:

  • Easy CI/CD integration with JSON output
  • Automated changelog management via AI assistants
  • Copy-paste examples for common workflows

For AI Agents:

  • One-click installation in Claude Desktop (when published to registry)
  • Natural language changelog operations
  • Comprehensive context and decision trees

Test Plan

  • All tests passing (403 tests)
  • All linters passing (30+ linters)
  • No vulnerabilities (govulncheck)
  • Docker image builds successfully
  • MCP server tested with Claude Desktop
  • JSON output validated in CI examples

New Packages:

  • internal/output - JSON output utilities
  • internal/mcp - MCP server tools
  • cmd/mcp-server - MCP server entry point

New Directories:

  • .ai/ - AI agent resources
  • examples/ - Usage examples

peiman added 11 commits October 6, 2025 02:42
Add comprehensive llms.txt file to make changie easily consumable by AI
agents and LLMs. The file provides concise, structured documentation
covering all core commands, workflows, and best practices optimized for
Model Context Protocol (MCP) integration.
Fixed outdated table of contents entry that referenced the old command
structure. The commands were restructured in v1.1.0 to use 'changie bump
<type>' instead of 'changie <type>'.
Add machine-readable JSON output for CLI commands, making changie
agent-friendly and MCP-compatible.

- Added global --json flag to output structured results
- Created internal/output package for output formatting
- Updated version.Bump to return BumpResult struct
- Updated cmd/bump to support JSON output mode
- Added app.json_output to config registry

JSON output provides structured data including success status, versions,
files modified, and error messages, enabling AI agents and tools to easily
parse command results.

Example:
  changie bump minor --json
  # Output: {"success":true,"old_version":"1.0.0","new_version":"1.1.0",...}
Significantly improved help text for major, minor, and patch bump commands
to be more LLM and agent-friendly:

- Added clear "WHAT IT DOES" section with step-by-step workflow
- Added "EXAMPLES" section with practical use cases
- Added "COMMON USE CASES" section to guide when to use each command
- Improved Short descriptions to be more informative
- Added JSON output example to each command

This makes it much easier for AI agents to understand when and how to use
each version bump type, supporting the overall goal of MCP integration.
Created examples/ directory with practical usage scripts demonstrating
changie in various real-world scenarios:

- basic-workflow.sh: Simple day-to-day usage patterns
- ci-integration.sh: CI/CD pipeline integrations (GitHub Actions, GitLab)
- release-workflow.sh: Various release strategies and workflows
- README.md: Complete guide to all examples with best practices

These examples serve multiple purposes:
1. Help new users learn changie quickly
2. Provide copy-paste templates for CI/CD setup
3. Enable AI agents to understand common usage patterns
4. Document best practices and troubleshooting

All examples include JSON output usage, making them particularly
valuable for MCP integration and agent-driven workflows.
Created .ai/ directory following emerging 2025 patterns for AI-augmented
development, providing structured resources for AI agents and LLMs:

- context.md: Complete project context, capabilities, constraints, and
  best practices for AI agents
- prompts/release-new-version.md: Step-by-step release guide
- prompts/add-changelog-entry.md: Changelog entry categorization guide
- workflows/complete-release-workflow.md: End-to-end release workflow
- README.md: Directory documentation and MCP integration guidance

This structure enables:
1. AI agents to quickly understand changie
2. MCP servers to expose changie as tools
3. Automation tools to integrate reliably
4. Consistent agent behavior across platforms

All prompts and workflows emphasize JSON output usage and error handling,
making changie fully agent-ready for MCP and other AI integrations.
Added full test coverage for internal/output package:
- Tests for IsJSONEnabled(), WriteJSON(), WriteString(), Write()
- Tests for all output structs (BumpOutput, InitOutput, etc.)
- JSON indentation verification
- Coverage increased from 0% to 83.3%

Also updated .golangci.yml to exclude thelper warnings for table-driven
test check functions, which are not actual test helpers.

Overall test coverage: 82.2%
Implements Model Context Protocol (MCP) server using official Go SDK v1.0.0
to expose changie operations as tools for AI agents like Claude.

**What's Added:**
- MCP server binary (cmd/mcp-server/main.go)
- Tool handlers (internal/mcp/tools.go) for:
  - changie_bump_version: Bump semantic versions
  - changie_add_changelog: Add changelog entries
  - changie_init: Initialize changie projects
  - changie_get_version: Get current version from git
- Comprehensive test suite (internal/mcp/tools_test.go)
- Dockerfile.mcp for containerized deployment
- Task command: `task build:mcp`
- Updated .ai/README.md with MCP server documentation

**Architecture:**
- Built with official MCP Go SDK (github.com/modelcontextprotocol/go-sdk)
- Uses stdio transport (JSON-RPC 2.0)
- Leverages existing --json flag from changie commands
- Returns structured output for reliable agent parsing

**Usage:**
Build: `task build:mcp`
Run: `./changie-mcp-server`
Docker: `docker build -f Dockerfile.mcp -t changie-mcp .`

Integrates with Claude Desktop and other MCP-compatible AI tools.
Adds convenient Task commands for Docker workflows:
- task docker:build:mcp - Build Docker image with version tags
- task docker:run:mcp - Run MCP server container
- task docker:test:mcp - Test Docker image
- task docker:clean:mcp - Clean up Docker artifacts

Updated .ai/README.md to document new Task commands.
Follows project pattern of using Task for all automation.
The go.mod requires Go 1.24.0 but Dockerfile was using golang:1.23-alpine,
causing build failures. Updated to golang:1.24-alpine for compatibility.

Docker image builds successfully and is only 52.1MB.
- Add comprehensive integration guide for Claude Desktop, Cursor, and Claude Code
- Document JSON output, MCP server, and AI agent resources in README
- Update CLAUDE.md with new packages (internal/output, internal/mcp)
- Simplify CHANGELOG entries to be user-focused
- Add analysis files to .gitignore
- Fix formatting in MCP tests
@cursor
Copy link

cursor bot commented Oct 6, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 26.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@codecov
Copy link

codecov bot commented Oct 6, 2025

Codecov Report

❌ Patch coverage is 80.98592% with 27 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/version/bump.go 75.00% 12 Missing and 1 partial ⚠️
internal/mcp/tools.go 87.50% 7 Missing and 1 partial ⚠️
internal/output/output.go 75.00% 2 Missing and 2 partials ⚠️
cmd/root.go 33.33% 1 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
+ Coverage   78.99%   79.46%   +0.47%     
==========================================
  Files          30       32       +2     
  Lines        1152     1271     +119     
==========================================
+ Hits          910     1010     +100     
- Misses        194      208      +14     
- Partials       48       53       +5     
Files with missing lines Coverage Δ
cmd/bump.go 51.06% <ø> (ø)
internal/config/core_options.go 100.00% <100.00%> (ø)
cmd/root.go 73.19% <33.33%> (-1.28%) ⬇️
internal/output/output.go 75.00% <75.00%> (ø)
internal/mcp/tools.go 87.50% <87.50%> (ø)
internal/version/bump.go 73.07% <75.00%> (+3.74%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

peiman added 6 commits October 6, 2025 10:24
Move JSON output formatting logic from cmd/bump.go into
internal/version/bump.go to follow architecture principle of
keeping business logic out of cmd layer.

Changes:
- internal/version/bump.go now handles both text and JSON output
- Simplified cmd/bump.go to thin wrapper (removed 25 lines)
- Changed Bump() signature: (*BumpResult, error) → error
- Updated all tests to match new signature
- JSON output still works identically for end users

Adheres to architecture principle: cmd layer should only map
config and delegate to internal packages.
- Add .codecov.yml to exclude cmd/mcp-server/ from coverage
- Add JSON unmarshaling tests for all MCP output types
- Add tests for invalid JSON handling
- Improves test count from 410 to 418 tests
- Add setupIntegrationTestRepo helper to create real git repos
- Add integration tests for BumpVersion (major, minor, patch)
- Add integration tests for AddChangelog, Init, GetVersion
- Build changie binary in TestMain for integration testing
- Coverage improvements:
  - internal/mcp: 63.9% → 86.1% (+22.2pp)
  - BumpVersion: 63.6% → 90.9%
  - AddChangelog: 50.0% → 75.0%
  - Init: 63.6% → 90.9%
- Total test count: 418 → 425 (+7 tests)
The AddChangelog integration tests create a CHANGELOG.md in the
internal/mcp/ directory as a side effect. Ignore this test artifact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants