feat(dora): add ast-grep provider for AST-aware code search - #35
Merged
amondnet merged 9 commits intoDec 19, 2025
Merged
Conversation
12 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
==========================================
+ Coverage 47.94% 49.37% +1.42%
==========================================
Files 15 21 +6
Lines 3341 4324 +983
==========================================
+ Hits 1602 2135 +533
- Misses 1739 2189 +450 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…formation - Add AstGrepProvider with 4 tools: - ast_grep_search: Search code patterns across files (25 languages) - ast_grep_replace: Replace patterns with AST-aware rewriting - ast_grep_analyze: In-memory analysis via NAPI (5 languages) - ast_grep_transform: In-memory transformation via NAPI - Implement auto-download of ast-grep binary from GitHub releases - Platform detection (win/linux/osx, x64/arm64) - Version tracking and caching in ~/.cache/dora/ast-grep/ - System PATH detection with binary verification - Add agent skill for writing ast-grep patterns and YAML rules - Meta-variable syntax guide ($VAR, $$$, _) - YAML rule structure with relational/composite operators - Common pattern examples for JS/TS, Python, Go - Create ADR documenting architecture decision Closes #34
amondnet
marked this pull request as ready for review
December 19, 2025 04:19
…entation - Fix silent failures in error handling: - Add error logging when JSON parsing fails (cli.ts) - Add error logging in binary verification (downloader.ts) - Add warning when reading version marker fails (downloader.ts) - Improve error handling robustness: - Use .finally() instead of .then() for timeout cleanup (cli.ts) - Include error details in nested catch blocks (cli.ts) - Add retry counter to prevent infinite download loops (cli.ts) - Return exit code when process exits with no output (cli.ts) - Log full error on NAPI load failure (napi.ts) - Security improvements: - Escape single quotes in PowerShell extractZip command - Use -LiteralPath for safer path handling - Better error messages: - Add Zod-specific error formatting for validation errors (index.ts) - Documentation updates: - Update ADR to document all 4 tools (search, replace, analyze, transform) - Update agent skill frontmatter with correct MCP tool names - Add NAPI tool documentation (ast_grep_analyze, ast_grep_transform)
- Add process import from node:process in constants.ts and downloader.ts - Convert capturing groups to non-capturing in utils.ts regex - Add YAML document separators (---) in ast-grep.md examples - Apply auto-fixes for import ordering and code style
Separate ast-grep knowledge into skill and agent:
- skills/ast-grep/SKILL.md: Pattern writing guide (reusable)
- skills/ast-grep/references/rule_reference.md: Detailed rule docs
- agents/ast-grep.md: Simplified to focus on MCP tool usage
Agent now references skill via Skill("code-please:ast-grep")
Align skill content with official ast-grep/claude-skill repository: - Add 5-step workflow for writing ast-grep rules - Document ast-grep scan with --inline-rules for testing - Add pattern object form with selector, context, strictness - Add stopBy and field options for relational rules - Expand metavariables documentation - Add best practices and troubleshooting sections
Move version and lastUpdated fields into metadata block per the official Agent Skills specification at agentskills.io.
amondnet
deleted the
34-add-ast-grep-provider-for-ast-aware-code-search-and-transformation
branch
December 19, 2025 06:23
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add ast-grep tools and skill to dora MCP server for AST-aware code search and transformation capabilities.
ast_grep_searchandast_grep_replaceMCP toolsArchitecture Decision
See ADR-0001 for detailed architecture decision.
Implementation Plan
Parallel Group 1 (independent tasks)
Sequential Tasks
Test Plan
Closes #34