mcp-changelog
AGENTS.md0 starsChanged 3 months agoMITView on GitHub
This document provides guidelines for AI agents working on the mcp-changelog project. It establishes coding standards, architectural patterns, and development workflows to ensure consistency and quality. mcp-changelog is an automated changelog and migration guide generator for MCP servers. It watches your MCP server's tool schemas across git commits/tags, detects changes, and generates: - Human-readable changelog (Markdown) - Migration guide with before/after examples - Machine-readable diff (JSON) Related Project: mcp-schema-evolution (../mcp-schema-evolution) — that project prevents breaking changes; this one documents them.
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- change-detectionSkill
- changelog-generationSkill
- cli-developmentSkill
- config-loaderSkill
- github-actionSkill
- git-integrationSkill
- json-diffSkill
- migration-guide-generationSkill
- performance-optimizationSkill
- schema-discoverySkill
- security-auditSkill
- testing-strategySkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
29 rules. About 1 is common, 21 are distinctive, and 7 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Type Safety First: Use TypeScript strict mode, avoid any, leverage shared types from mcp-schema-evolution
- Distinctive: line 19
Git-Native Design: All schema resolution flows through git refs
- Distinctive: line 20
Narrow Scope: Only document changes, don't validate or adapt schemas
- Distinctive: line 45
Read ARCHITECTURE.md to understand the module structure
- Very specific: line 46
Check existing skills/ directory for relevant agent skills (files are named SKILL.md)
- Distinctive: line 50
Use functional composition over classes where possible
- Very specific: line 51
Prefer const over let, avoid var
- Distinctive: line 52
Use template literals for string interpolation
- Very specific: line 54
Use descriptive variable names (no abbreviations except well-known ones like schema, ref)
- Distinctive: line 55
Add JSDoc comments for public functions and complex logic
- Very specific: line 62
No long-lived develop branch — trunk-based workflow
- Distinctive: line 72
Every module must have unit tests covering:
- Distinctive: line 106
Always validate git refs before use
- Distinctive: line 118
Add thin wrapper for git-specific context if needed
- Very specific: line 119
Always check
Result.ok: before using the diff output - Distinctive: line 123
Default template should match Keep a Changelog format
- Distinctive: line 129
Always include before/after code examples for breaking changes
- Distinctive: line 130
Use JSON for examples (language-agnostic)
- Very specific: line 135
Use Commander.js for argument parsing
- Distinctive: line 138
Use consistent option naming (kebab-case)
- Distinctive: line 144
Use GitHub's action toolkit patterns
- Distinctive: line 249
Never execute user-provided code
- Distinctive: line 252
Use minimal GitHub API permissions
- Common: line 253
No secrets in code or logs
- Distinctive: line 258
Use streaming for large schema files
- Distinctive: line 264
Update ARCHITECTURE.md for significant changes
- Distinctive: line 265
Add JSDoc for public functions
- Distinctive: line 267
Update README.md for user-facing changes
- Distinctive: line 272
Ensure new agents initialize the project with:
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
MCP Changelog - AI Agent Guidelines
Overview
This document provides guidelines for AI agents working on the mcp-changelog project. It establishes coding standards, architectural patterns, and development workflows to ensure consistency and quality.
Project Context
mcp-changelog is an automated changelog and migration guide generator for MCP servers. It watches your MCP server's tool schemas across git commits/tags, detects changes, and generates:
- Human-readable changelog (Markdown)
- Migration guide with before/after examples
- Machine-readable diff (JSON)
Related Project: mcp-schema-evolution (../mcp-schema-evolution) — that project prevents breaking changes; this one documents them.
Core Principles
- Type Safety First: Use TypeScript strict mode, avoid
any, leverage shared types from mcp-schema-evolution - Git-Native Design: All schema resolution flows through git refs
- Narrow Scope: Only document changes, don't validate or adapt schemas
- Composability: CLI, library, and GitHub Action share the same core engine
- Test Coverage: >90% coverage for core modules, integration tests for full pipeline
Technology Stack
- TypeScript 5.x with strict mode
- pnpm package manager
- Vitest for testing
- ESLint + Prettier for code quality
- Commander.js for CLI
- Octokit for GitHub API
- simple-git for git operations
- @mcp-schema-evolution/core for change detection and shared types
Development Workflow
Setup
pnpm install
pnpm run build
pnpm run testBefore Writing Code
- Read ARCHITECTURE.md to understand the module structure
- Check existing
skills/directory for relevant agent skills (files are namedSKILL.md) - Review related types in mcp-schema-evolution if working with schema types
Code Style
- Use functional composition over classes where possible
- Prefer
constoverlet, avoidvar - Use template literals for string interpolation
- Export only public API from module index files
- Use descriptive variable names (no abbreviations except well-known ones like
schema,ref) - Add JSDoc comments for public functions and complex logic
Git Hygiene
- Small, focused commits
- Descriptive commit messages following conventional commits
- One feature/fix per branch off
main - Rebase before merging to keep history clean
- No long-lived
developbranch — trunk-based workflow
Testing Requirements
Coverage Targets
- Minimum: >85% for all modules
- Core engine: >90% for git, discovery, changelog, migration, and diff modules
- CLI & Action: >85%
Unit Tests
Every module must have unit tests covering:
- Happy path scenarios
- Edge cases (empty inputs, malformed data)
- Error handling paths
- Type safety (tests should fail to compile with wrong types)
Integration Tests
- Full pipeline tests using fixture git repos
- End-to-end CLI tests
- GitHub Action simulation tests
- Coverage enforced in CI via Vitest
--coveragewith thresholds
Test Structure
describe('ModuleName', () => {
describe('functionName', () => {
it('should handle happy path', () => {
// test
});
it('should handle edge case: description', () => {
// test
});
it('should throw error for invalid input', () => {
// test
});
});
});Module-Specific Guidelines
Git Integration (src/git/)
- Always validate git refs before use
- Handle detached HEAD state gracefully
- Support both local and remote (GitHub API) git access
- Cache git operations within a single run
Schema Discovery (src/discovery/)
- Support multiple schema file conventions
- Provide clear error messages when schemas can't be found
- Handle malformed JSON gracefully with helpful error messages
Change Detector (src/detector/)
- Reuse
@mcp-schema-evolution/core(diffToolSnapshots,classifyChange), don't reimplement - Add thin wrapper for git-specific context if needed
- Always check
Result.okbefore using the diff output - Remember: change categories are
snake_case(e.g.,tool_added,field_renamed)
Changelog Generator (src/changelog/)
- Default template should match Keep a Changelog format
- Support custom templates via configuration
- Include emoji indicators for change types
- Generate proper Markdown with consistent formatting
Migration Guide Generator (src/migration/)
- Always include before/after code examples for breaking changes
- Use JSON for examples (language-agnostic)
- Include step-by-step migration instructions
- Link to affected tools and fields
CLI (src/cli/)
- Use Commander.js for argument parsing
- Provide helpful error messages and usage hints
- Support
--helpon all commands - Use consistent option naming (kebab-case)
GitHub Action (src/action/)
- Minimal permissions (read contents, write PR comments)
- Fail gracefully with clear error messages
- Support both comment-on-PR and file-output modes
- Use GitHub's action toolkit patterns
Common Patterns
Error Handling
// Good: Specific error with context
if (!schema) {
throw new SchemaNotFoundError(ref.name, schemaPath);
}
// Bad: Generic error
if (!schema) {
throw new Error('Schema not found');
}Configuration
// Good: Type-safe config with defaults
const config: ChangelogConfig = {
outputDir: './changelog',
formats: ['markdown', 'json'],
...loadConfig(options.config),
...options,
};
// Bad: Loose config
const config = { ...options };Async Operations
// Good: Parallel independent operations
const [oldSchemas, newSchemas] = await Promise.all([
discoverSchemas(oldRef),
discoverSchemas(newRef),
]);
// Bad: Sequential when parallel is possible
const oldSchemas = await discoverSchemas(oldRef);
const newSchemas = await discoverSchemas(newRef);Common Pitfalls
1. Forgetting Result.ok Checks
@mcp-schema-evolution/core functions return Result<T> (never throw). Always handle the error branch:
// Good
const result = diffToolSnapshots(oldTools, newTools);
if (!result.ok) {
throw new SchemaDiffError(result.error);
}
const changes = result.value;
// Bad
const changes = diffToolSnapshots(oldTools, newTools).value; // May be undefined2. Wrong Change Category Casing
mcp-schema-evolution uses snake_case categories:
// Correct
change.category === 'field_renamed'
change.category === 'tool_added'
// Wrong
change.category === 'FIELD_RENAMED'
change.category === 'TOOL_ADDED'3. Using tool Instead of toolName
// Correct
const name = change.toolName;
// Wrong
const name = change.tool; // Property does not exist4. Treating ToolSnapshot as a Single Schema
A snapshot is a Tool[] array, not a wrapper object:
// Correct
const snapshot: Tool[] = JSON.parse(content);
// Wrong
const schema = JSON.parse(content).tools; // Only if your JSON wraps toolsCode Review Checklist
- TypeScript strict mode compliance (no
any) - Unit tests for new functionality (>85% coverage, >90% for core)
- Integration tests for pipeline changes
- Error handling for edge cases
- Descriptive variable and function names
- JSDoc comments for public API
- Consistent code formatting (Prettier)
- No ESLint warnings
- Git commit message follows conventions
Security Considerations
- Never execute user-provided code
- Validate all git refs before use
- Sanitize schema content (treat as untrusted data)
- Use minimal GitHub API permissions
- No secrets in code or logs
Performance Guidelines
- Cache git operations within a run
- Use streaming for large schema files
- Parallelize independent operations
- Target <2 seconds for full pipeline on typical schemas
Documentation
- Update ARCHITECTURE.md for significant changes
- Add JSDoc for public functions
- Include usage examples in skill files
- Update README.md for user-facing changes
Project Setup Reminders
.gitignore Template
Ensure new agents initialize the project with:
node_modules/
dist/
coverage/
*.log
.DS_Store
.envLocal Development with mcp-schema-evolution
Since mcp-schema-evolution is a local sibling project (../mcp-schema-evolution), use pnpm workspace or link: protocol during active development:
"dependencies": {
"@reaatech/mcp-schema-evolution": "workspace:*"
}Support
For questions about:
- Architecture: See ARCHITECTURE.md
- Development plan: See DEV_PLAN.md
- Specific skills: See
skills/directory (files areSKILL.md) - Related types: See
../mcp-schema-evolution/packages/core/src/types.ts
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

