{"id":"df4f6374-a501-4f94-81ba-d71612d07cc0","shortId":"w8rJLb","kind":"skill","title":"Search and rewrite code with structural GritQL patterns before broad migrations","tagline":"Use GritQL when an agent needs reviewable structural search and rewrite passes across a large codebase before a migration, policy cleanup, or API change, instead of relying on regex or hand edits.","description":"# Search and rewrite code with structural GritQL patterns before broad migrations\n\nUse GritQL when an agent needs reviewable structural search and rewrite passes across a large codebase before a migration, policy cleanup, or API change, instead of relying on regex or hand edits.\n\n## Prerequisites\n\nGrit CLI, a local repository to search or rewrite, and a review loop for inspecting the diffs produced by structural patterns.\n\n## Installation\n\nRequirements and caveats from upstream:\n- ♻️ Once you learn GritQL, you can use it to rewrite any [target language](https://docs.grit.io/language/target-languages): JavaScript/TypeScript, Python, JSON, Java, Terraform, Solidity, CSS, Markdown, YAML, Rust, Go,...\n- Patterns can be combined to create complex queries, including [large refactors](https://github.com/getgrit/stdlib/blob/main/.grit/patterns/python/openai.md).\n- Reading/writing a codemod requires mentally translating from AST names back to what source code actually looks like.\n\nBasic usage or getting-started notes:\n- Read the [documentation](https://docs.grit.io/language/overview), [interactive tutorial](https://docs.grit.io/tutorials/gritql), or run grit --help.\n- sh\n- Search for all your console.log calls by putting the desired pattern in backticks:\n\n- Source: https://github.com/biomejs/gritql\n- Extracted from upstream docs: https://raw.githubusercontent.com/biomejs/gritql/HEAD/README.md\n\n## Documentation\n\n- https://docs.grit.io/language/overview\n\n## Source\n\n- [Agent Skill Exchange](https://agentskillexchange.com/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations/)","tags":["search","and","rewrite","code","with","structural","gritql","patterns","before","broad","migrations","skills"],"capabilities":["skill","source-agentskillexchange","skill-search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations","topic-agent-skills","topic-ai-agents","topic-ai-tools","topic-awesome-list","topic-claude-code","topic-codex","topic-cursor","topic-llm","topic-mcp","topic-npx-skills","topic-openclaw","topic-skills-catalog"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/agentskillexchange/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add agentskillexchange/skills","source_repo":"https://github.com/agentskillexchange/skills","install_from":"skills.sh"}},"qualityScore":"0.454","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 8 github stars · SKILL.md body (1,623 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:12:21.212Z","embedding":null,"createdAt":"2026-05-18T13:19:13.223Z","updatedAt":"2026-05-18T19:12:21.212Z","lastSeenAt":"2026-05-18T19:12:21.212Z","tsv":"'/biomejs/gritql':212 '/biomejs/gritql/head/readme.md':219 '/getgrit/stdlib/blob/main/.grit/patterns/python/openai.md).':155 '/language/overview':223 '/language/overview),':185 '/language/target-languages):':130 '/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations/)':230 '/tutorials/gritql),':190 'across':24,67 'actual':170 'agent':16,59,225 'agentskillexchange.com':229 'agentskillexchange.com/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations/)':228 'api':34,77 'ast':163 'back':165 'backtick':208 'basic':173 'broad':10,53 'call':201 'caveat':112 'chang':35,78 'cleanup':32,75 'cli':89 'code':4,47,169 'codebas':27,70 'codemod':158 'combin':145 'complex':148 'console.log':200 'creat':147 'css':137 'desir':205 'diff':104 'doc':216 'docs.grit.io':129,184,189,222 'docs.grit.io/language/overview':221 'docs.grit.io/language/overview),':183 'docs.grit.io/language/target-languages):':128 'docs.grit.io/tutorials/gritql),':188 'document':182,220 'edit':43,86 'exchang':227 'extract':213 'get':177 'getting-start':176 'github.com':154,211 'github.com/biomejs/gritql':210 'github.com/getgrit/stdlib/blob/main/.grit/patterns/python/openai.md).':153 'go':141 'grit':88,193 'gritql':7,13,50,56,118 'hand':42,85 'help':194 'includ':150 'inspect':102 'instal':109 'instead':36,79 'interact':186 'java':134 'javascript/typescript':131 'json':133 'languag':127 'larg':26,69,151 'learn':117 'like':172 'local':91 'look':171 'loop':100 'markdown':138 'mental':160 'migrat':11,30,54,73 'name':164 'need':17,60 'note':179 'pass':23,66 'pattern':8,51,108,142,206 'polici':31,74 'prerequisit':87 'produc':105 'put':203 'python':132 'queri':149 'raw.githubusercontent.com':218 'raw.githubusercontent.com/biomejs/gritql/head/readme.md':217 'read':180 'reading/writing':156 'refactor':152 'regex':40,83 'reli':38,81 'repositori':92 'requir':110,159 'review':18,61,99 'rewrit':3,22,46,65,96,124 'run':192 'rust':140 'search':1,20,44,63,94,196 'sh':195 'skill':226 'skill-search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations' 'solid':136 'sourc':168,209,224 'source-agentskillexchange' 'start':178 'structur':6,19,49,62,107 'target':126 'terraform':135 'topic-agent-skills' 'topic-ai-agents' 'topic-ai-tools' 'topic-awesome-list' 'topic-claude-code' 'topic-codex' 'topic-cursor' 'topic-llm' 'topic-mcp' 'topic-npx-skills' 'topic-openclaw' 'topic-skills-catalog' 'translat':161 'tutori':187 'upstream':114,215 'usag':174 'use':12,55,121 'yaml':139","prices":[{"id":"658cfec7-ada8-4cf0-9e10-dd1b3e838350","listingId":"df4f6374-a501-4f94-81ba-d71612d07cc0","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"agentskillexchange","category":"skills","install_from":"skills.sh"},"createdAt":"2026-05-18T13:19:13.223Z"}],"sources":[{"listingId":"df4f6374-a501-4f94-81ba-d71612d07cc0","source":"github","sourceId":"agentskillexchange/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations","sourceUrl":"https://github.com/agentskillexchange/skills/tree/main/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations","isPrimary":false,"firstSeenAt":"2026-05-18T13:19:13.223Z","lastSeenAt":"2026-05-18T19:12:21.212Z"}],"details":{"listingId":"df4f6374-a501-4f94-81ba-d71612d07cc0","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"agentskillexchange","slug":"search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations","github":{"repo":"agentskillexchange/skills","stars":8,"topics":["agent-skills","ai-agents","ai-tools","awesome-list","claude-code","codex","cursor","llm","mcp","npx-skills","openclaw","skills-catalog"],"license":"mit","html_url":"https://github.com/agentskillexchange/skills","pushed_at":"2026-05-18T19:02:17Z","description":"The open catalog of AI agent skills — 2,000+ security-scanned skills for Claude Code, Cursor, Codex, and more.","skill_md_sha":"89451fca0ab95feb90cbb371681c1674ed87f1c6","skill_md_path":"skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/agentskillexchange/skills/tree/main/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"Search and rewrite code with structural GritQL patterns before broad migrations","description":"Use GritQL when an agent needs reviewable structural search and rewrite passes across a large codebase before a migration, policy cleanup, or API change, instead of relying on regex or hand edits."},"skills_sh_url":"https://skills.sh/agentskillexchange/skills/search-and-rewrite-code-with-structural-gritql-patterns-before-broad-migrations"},"updatedAt":"2026-05-18T19:12:21.212Z"}}