af1832af1b
- Simplified `bash` guidance to tighten allowed command patterns, pipeline limits, and launch-based process handling. - Reworked `browser` instructions into grouped helper sections while preserving selector restrictions and key action semantics. - Harmonized `eval`, `irc`, `read`, and `todo` prompt wording around state reuse, messaging, selector formats, and task operations.
903 B
903 B
Structural AST-aware rewrites via ast-grep. Use for codemods where text replace is unsafe. Narrow each call to one language.
- Metavariables in
pat($A,$$$ARGS) substitute intoout. - Patterns match AST structure, not text.
$NAME= one node;$_= unbound;$$$NAME= zero-or-more.- Use
$$$NAME, NOT$$NAME(invalid). Names UPPERCASE, whole node — partial likeprefix$VARfails.
- Use
- Same metavariable twice → MUST match identical code (
$A == $Amatchesx == x, notx == y). - Rewrite patterns MUST parse as single AST node. Non-standalone → wrap:
class $_ { … }. - TS: tolerate annotations —
async function $NAME($$$ARGS): $_ { $$$BODY }. Delete with emptyout:{"pat":"console.log($$$)","out":""}. - 1:1 substitution — no splitting/merging captures.
- Parse issues → malformed rewrite, not clean no-op. For one-off text edits, prefer the Edit tool.