rw_git 3.0.8
rw_git: ^3.0.8 copied to clipboard
A Dart git wrapper and MCP server that facilitates the execution of various git commands and AI repository analysis.
3.0.8 #
- FEAT (Library): Exposed the intelligence/analysis algorithms (bus factor, bug hotspots, logical coupling, code volatility, etc.) directly from
package:rw_git/rw_git.dart, so consumers can use the same analyses the MCP tools rely on without running the MCP server. - FEAT (Intelligence): Added package freshness check for
analyze_dependency_drifttool. - FEAT (MCP):
McpToolFileOffloadDecoratornow returns small responses (under 8KB,offloadSizeThresholdBytes) inline instead of unconditionally offloading them to disk, eliminating a wasted file-write/file-read round trip for low-volume tools likeget_statsandget_contributions_by_author. - FIX (MCP): Implemented the
return_full_jsonopt-out argument onMcpToolFileOffloadDecorator. It was documented (and referenced in earlier CHANGELOG entries) but never actually wired into the decorator'sexecute()orinputSchema— passing it had no effect. It now correctly skips file offloading and returns the full JSON inline. - FEAT (MCP): Offload summaries now include a
previewfield (top-level keys, value types, array lengths) so LLMs can target reads without guessing the offloaded file's shape. - FEAT (MCP): Added
read_report_slicetool to fetch a targeted key-path/array-slice from a previously offloaded report file, instead of reading the entire file into context. - CHORE (MCP): Shrunk the offload boilerplate appended to all 27 wrapped tools' descriptions from a ~70-word paragraph to one sentence pointing at
get_rw_git_documentation, reducing the fixed token cost of everytools/listcall. - DOCS: Updated
get_rw_git_documentationwith the new size threshold,return_full_json,read_report_slice, and an advisoryformat: summary|fullparameter-naming convention for future tools. - PERF (MCP): Cut the fixed
tools/listcost from ~43KB (~12k tokens) to ~30KB (~8.4k tokens) by deferring the offload contract toget_rw_git_documentationinstead of stamping a verbose paragraph plus two long property descriptions onto all 35 tool schemas. A regression test (tools_list_size_test.dart) now guards the budget. This lowers the floor enough for 8–16K-context local models to hold the full tool surface. - FEAT (MCP):
tools/listnow advertises standard tool annotations (readOnlyHint/idempotentHint) — 30 read-only analysis tools are marked auto-approvable and 5 repository-mutating tools (clone/checkout/init/fetch) are flagged — plus anoutputSchemaonanalyze_bus_factor. Metadata is attached centrally viaMcpToolWithMetadatawithout touching individual tools. - FEAT (MCP): Bumped the implemented protocol revision to 2025-06-18 with version negotiation (older revisions still accepted), accurate capability advertisement, and
serverInfo.versionsourced from a single constant. - FEAT (MCP): Offloaded reports are now exposed as MCP Resources (
resources/list/resources/read); offload summaries include aresource_uri. Only files produced this session are readable. The existingread_report_slicepath is unchanged for small/local models. - FEAT (MCP): Optional
tools/listpagination (opaque cursor) via theRW_GIT_TOOLS_PAGE_SIZEenv var, for clients with very small context windows. Off by default (full list returned). - REFACTOR (MCP): Extracted tool/prompt registration into a single
buildDefaultRegistry()shared by therw_git_mcpexecutable and the test suite, removing duplication between production and tests. - CHORE (Build): Agent workflows now have a single source of truth — MCP prompt Dart sources are generated from the canonical
.agents/skills/<name>/SKILL.mdviatool/sync_prompts.dart, with a drift-guard test (prompts_sync_test.dart). - DOCS: Documented all five reporting prompts and the six bundled skills in
README.md; added a "Adding or modifying prompts and skills" section toCONTRIBUTING.md; addeddoc/SMALL_LLM_EFFICIENCY_EVALUATION.md(token-cost model and local/frontier model suitability matrix).
3.0.7 #
- REFACTOR: Refactored the MCP tools implementation, adhering to SRP principles and making the repository future-proof and easily extendable.
- FEAT (Quality): Based on academic papers, enhanced the MCP tools underlying technical foundations and documented under
doc/tools.
3.0.6 #
- TEST (Quality): Added
documentation_formatting_test.dartto enforce 80 column wrapping for the README file. - DOCS: Formatted
README.mdand.agents/skills/**/SKILL.mdto adhere strictly to the 80 column wrap limit. - FEAT (MCP): Added
find_bugs_by_developertool to track bugs introduced by specific developers using a sophisticated SZZ algorithm. Extracted SZZ logic into a reusableSzzAlgorithmcore class. - FEAT (MCP): Added average time to fix a bug / time taken to fix a bug for both bug-hotspots and bugs-per-developer tools.
- FEAT (SKILL): Added specialized skills for different aspects of reporting to cover a variety of stakeholders needs.
- FEAT (Quality): Removed duplicate SKILL and README files from root repo and distribution/npm. These are now packaged for npm with a pre-package step.
- REFACTOR (MCP): Updated the
get_rw_git_documentationtool to dynamically generate its markdown list of available tools from theMcpRegistry, eliminating duplicate documentation across the codebase. - FIX (MCP): Implemented safe argument extraction (
getStringArgument,getOptionalStringArgument) for all MCP tools to provide clear, actionable error messages to LLMs when required arguments are missing or malformed, instead of crashing with a cryptic Dart type cast error (type 'Null' is not a subtype of type 'String' in type cast). - FEAT (MCP): Implemented
McpToolFileOffloadDecoratorto automatically offload heavy analytical tool JSON responses to the local filesystem by default, preventing LLM context window overflow. - FEAT (MCP): Added
output_fileandreturn_full_jsonarguments to all verbose analysis tools to allow LLMs to control context ingestion and orchestration paths. - FEAT (MCP):: Implemented 4 new Mining Software Repositories (MSR) algorithms with corresponding MCP tools:
- Analyze Logical Coupling: Detects files that frequently change together to identify architectural decay.
- Analyze Bus Factor: Calculates the project's Truck Factor to highlight knowledge concentration risks.
- Analyze Code Volatility: Predicts defect-prone files based on historical code churn and author count.
- Analyze Refactoring: Detects structural refactorings and code simplifications approximating AST differencing.
3.0.5 #
- FIX (Quality): Fixed an issue where the secret scanner (
detect_secrets_in_commits) produced false positives for integrity hashes in lockfiles (likepackage-lock.json), generic placeholder variables in test files, and CI workflow variables. The scanner now uses improved context-aware risk scoring to exclude lockfiles, broadens test exclusions, and filters out common placeholder patterns. - FIX (SKILL): Overhauled the reporting SKILL to guide LLMs efficiently, especially small/less capable ones which drift easily.
3.0.4 #
- FEAT (MCP): Because many small LLMs completely ignore the file offloading, made the behaviour default and mandatory. This approach saves tokens and increases efficiency.
3.0.3 #
- FIX (MCP): Fixed issue with small LLMs hallucinating tool calls and not reading the offloaded JSON results.
- CHORE (Agent Skills): Updated agent skills to provide more comprehensive documentation and guidance.
3.0.2 #
- FIX (MCP): Implemented safe argument extraction (
getStringArgument,getOptionalStringArgument) for all MCP tools to provide clear, actionable error messages to LLMs when required arguments are missing or malformed, instead of crashing with a cryptic Dart type cast error (type 'Null' is not a subtype of type 'String' in type cast). - FEAT (MCP): Implemented
McpToolFileOffloadDecoratorto automatically offload heavy analytical tool JSON responses to the local filesystem by default, preventing LLM context window overflow. - FEAT (MCP): Added
output_fileandreturn_full_jsonarguments to all verbose analysis tools to allow LLMs to control context ingestion and orchestration paths.
3.0.1 #
- FIX (MCP/NPM): Resolved an issue where
npx @gbrandtio/rw-git-mcpwould fail with anENOEXECerror. The npm package'sinstall.jsscript now correctly handles non-200 HTTP responses and expects the raw, uncompressed binary executable to be available on GitHub Releases. - CHORE (Distribution): Updated the GitHub Actions release workflow (
release_mcp.yml) to upload the raw uncompressed executables in addition to the.tar.gzand.ziparchives.
3.0.0 #
- BREAKING (Core): All major Git commands (
branch,status,diff,blame,show,getCommitsBetween,stats) now return strongly-typed model classes (GitBranch,GitStatus,GitDiff,GitBlame,GitCommit, etc.) instead of raw Strings orList<String>. - BREAKING (MCP): The MCP server now returns structured JSON representations of these Git domain models, enabling LLMs to deterministically parse and reason about Git repository state.
- PERF (Core): Migrated internal Git parsing logic to use
Isolate.run()for large CLI outputs (over 10,000 characters), significantly reducing main-thread blocking in heavy Git operations. - FEAT (Core): Added new models (
GitCommit,GitTag,GitBranch,GitStatus,GitFileChange,GitDiff,GitFileDiff,GitBlame,GitBlameLine) underlib/src/models/git/to provide a robust object-oriented representation of Git objects.
2.0.2 #
- FEAT (MCP): Added AST & architecture analysis tools and metrics (
analyze_dart_ast_quality,analyze_architecture_drift,analyze_clean_code). - FEAT (MCP): Added
calculate_universal_lexical_metricstool to compute language-agnostic code quality metrics (Cyclomatic, Halstead, Cognitive, Maintainability Index) using a fast zero-allocation FSM Lexer. - BREAKING (Core & MCP): Completely removed
cloneAndGetStatisticsmethod fromRwGitfacade and its corresponding MCP tool (clone_and_get_statistics) as this functionality is fully covered by the corecloneandstatsmethods. - DOCS: Added explicit documentation restricting LLMs from running intrusive custom commands (e.g.,
git push). - CHORE: Improved and expanded the report orchestration MCP skill with new tools.
- CHORE: Added comprehensive tests to achieve 100% test coverage.
2.0.1 #
- FEAT (MCP): Added native support for MCP Resources and Prompts protocol capabilities.
- DOCS: Added comprehensive agent skills for installing the
rw-gitMCP server and for orchestrating comprehensive repository reports. - CHORE (Core): Removed
git2dartFFI integration and reverted to process-based executions with latest path dependency. - CHORE: Fixed NPM package configuration, README, and GitHub Actions release workflows (
release_mcp.yml).
2.0.0 #
-
FEAT (MCP): Added
analyze_pr_difftool to analyze PR diffs for risk signals by combining churn history, bus factor, and secret detection into per-file composite risk scores. -
FEAT (MCP): Added
predict_merge_conflictstool to identify files modified on both branches since their merge base, predicting potential merge conflicts before a merge attempt. -
FEAT (MCP): Added
analyze_commit_velocitytool to compute time-series commit velocity with per-author breakdown, trend analysis (accelerating/decelerating/stable), and anomaly detection. -
FEAT (MCP): Added
analyze_dependency_drifttool to parse dependency manifests (pubspec.yaml, package.json, requirements.txt, go.mod, Cargo.toml, Gemfile) for supply chain risk analysis. -
FEAT (MCP): Added
generate_changelogtool to generate structured changelogs using Conventional Commits conventions (feat/fix/BREAKING CHANGE). -
FEAT (MCP): Added
audit_compliancetool to scan commit history for unsigned commits, empty messages, and unrecognized author emails. -
FEAT (MCP): Added
analyze_file_ownershiptool to cross-reference CODEOWNERS with git blame history for ownership drift detection. -
FEAT (Core): Added
findConflictRiskFiles,calculateCommitVelocity,parseDependencyManifests,scanComplianceIssuesmethods toCodeQualityTracker. -
FEAT (MCP): Added
detect_secrets_in_commitstool to scan commit history for exposed secrets using Isolates. -
FEAT (MCP): Added an optional
includeCodeDiffboolean parameter to the code quality tools to provide actual git diffs for LLM code smell analysis, replacing the previous hardcoded hallucination-prone prompt. -
BREAKING (MCP):
analyze_code_quality,analyze_code_quality_with_authors, and allevaluate_comment_*tools now return structured JSON instead of prescriptive prose prompts. This aligns them with theanalyze_release_deltaandanalyze_bus_factoroutput conventions and significantly reduces token consumption. -
PERF (MCP): Replaced
git log --statwithgit log --shortstat --format=%H %sin the code quality tools, reducing the raw commit log payload by ~95% for large repositories. -
FIX (MCP): Removed the hardcoded "Staff Software Engineer" persona from all analysis and comment evaluation tools to avoid conflicting with the calling LLM's own identity.
-
FIX (MCP): The
topNparameter now applies consistently to all lists (suspicious commits, mega commits, high-churn files, classes, and blocks). Previously, suspicious and mega lists were unbounded whentopNwas not set. -
REFACTOR (MCP):
BaseEvaluateCommentsToolhook method changed fromgetPromptInstructions()(returning a String) togetEvaluationCriteria()(returningList<String>). -
REFACTOR (MCP):
BaseAnalyzeCodeQualityToolhook methods changed fromgetChurnMetricsString()/getPromptInstructions()togetChurnData()/getAnalysisGuidance()returning structured Maps. -
RENAME (MCP): The
includeRawLogparameter has been renamed toincludeCommitLogto better reflect the compact--shortstatformat. -
FEAT (Core): Implemented the
Result<T, E>pattern (Result.getOrThrow()) across all internal commands and public facades, removing raw Exceptions and unhandledProcessExceptions from the execution flow. -
FEAT (Core): Added 9 new highly-requested git operations to
RwGit:branch,status,pull,push,diff,merge,stash,blame, andshow. -
FEAT (Core): Upgraded
GitCommandexecution to support path sanitization (directory traversal protection), observability viadart:developertiming logs, and extensibility hooks (onBeforeRun,onAfterRun). -
FEAT (Core): Unified argument handling by allowing
List<String> extraArgsin all internal git commands. -
PERF (Quality): Optimized
CodeQualityTracker.calculateChurnandcalculateChurnWithAuthorsto streamgit logoutput asynchronously, eliminating Out of Memory crashes on massive repositories. -
FIX (Quality): Fixed a bug in
RwGitParser.parseGitShortLogStdoutwhere multi-word author names were incorrectly truncated. -
CHORE: Removed
dynamictyping entirely from the codebase, updatedlintsto^5.0.0, and strictly enforceddart analyze --fatal-infos. -
Architecture:
RwGitis now an abstract factory interface, preparing the core library for non-CLI Git operations. -
Architecture: Added
CliRwGitto encapsulate existingProcess.runfunctionality, ensuring no breaking changes to default behavior. -
Tooling: Added
executablesdeclaration inpubspec.yamlto allow running the MCP server globally viadart pub global activate rw_git. -
Distribution: Created GitHub Actions workflow
.github/workflows/release_mcp.ymlfor automated cross-platform binary compilation. -
Distribution: Created scaffolding for npm packaging.
-
[REFACTOR]
analyze_code_qualityandanalyze_code_quality_with_authorstools to use Template Method pattern (BaseAnalyzeCodeQualityTool) eliminating duplicated code logic. -
Exposing RwGitParser through the rw_git package for enhanced flexibility.
-
Memory Efficiency: Refactored
CodeQualityTrackerto use an asynchronous stream state-machine (runStream) for processinggit logoutputs. This eliminates unbounded memory consumption when analyzing massive diffs in large repositories. -
MCP: Changed the
analyze_code_qualityandanalyze_code_quality_with_authorstools to usegit log --statinstead ofgit log -pfor their LLM context payload. This significantly reduces token usage and improves LLM accuracy when assessing commit size versus message quality. -
MCP: Rephrased the
get_rw_git_documentationinstructions to prevent LLMs from erroneously attempting to write Python scripts to manually construct JSON-RPC requests to the MCP server. -
MCP: Applied the
limitparameter toCodeQualityTrackermethods so that code quality metrics correctly reflect the specified recent commits window instead of parsing the entire repository history. -
MCP:
analyze_code_qualityandanalyze_code_quality_with_authorsnow successfully bound their analysis to the requested commitlimit. -
MCP: Added 10 individual, strongly-typed tools to directly invoke
RwGitfacade methods (init_repository,clone_repository,get_stats, etc.) to provide LLMs with perfect parameter schemas. -
MCP: Cleaned up
execute_git_commandto strictly accept raw git CLI args, preventing hallucination of facade function names. -
MCP: Transformed
get_rw_git_documentationinto a unified Agent Guide to route LLMs natively across all tools. -
Added
streamOutputopt-in flag across allRwGitmethods to support real-time streaming of Git standard output and standard error to the console. -
Refactored
ProcessRunnerto useProcess.startto support seamless output streaming without blocking. -
MCP: Updated tool descriptions to include explicit invocation instructions for better LLM context.
-
MCP: Improved code quality tracker outputs for suspicious and mega commits to include author, date, and commit message.
1.2.0 #
- FEAT: Added
evaluate_comment_llm_generationMCP tool to detect LLM artifacts in comments. - FEAT: Added
evaluate_comment_qualityMCP tool to analyze the quality of newly added or modified comments. - FEAT: Added
evaluate_comment_necessityMCP tool to evaluate whether comments are redundant and if code could be self-documenting instead. - REFACTOR: Consolidated CodeQuality tools.
1.1.0 #
- [REFACTOR]
analyze_code_qualityandanalyze_code_quality_with_authorstools to use Template Method pattern (BaseAnalyzeCodeQualityTool) eliminating duplicated code logic.
1.0.4 #
- MCP: Combined
retrieve_commits_for_ai_reviewfunctionality intoanalyze_code_qualityandanalyze_code_quality_with_authorsto provide an internal AI prompt combined with code quality metrics and recent commits for a comprehensive code review context. - MCP: Removed
retrieve_commits_for_ai_review.
1.0.2 #
- Fixed various bugs surfaced from unit testing.
- Code coverage 100%.
- Improved performance and logical output of some commands.
1.0.1 #
- Support for common git commands and operations:
git initgit clonegit fetch tags- Count commits between two tags
- Retrieve statistics regarding code changes (insertions, deletions, number of files changed).