# Oak - [GitHub - go-go-golems/oak: GO GO PARSE YOUR CODE GO GO](https://github.com/go-go-golems/oak) Use [[tree-sitter]] to run queries against programming language files. ## See also - [[SK - 2n5 - LLMs for Programming]] - [[Prompt Engineering]] ## Ideas [[2023-08-08]] Processing [[SKETCHBOOK - 2023-05-29 - weinheim sketchbook]] p. 8-9 which is mostly about [[IDEA - GO GO GOLEMS - 2023-08–05 - Prompt Context Manager]], but prompts quite a few ideas for Oak, since really oak was built to support the context manager as a building block. ## Git support See [[IDEA - GO GO GOLEMS - Idea repository#Add git support to PROJ - GO GO GOLEMS - OAK]] and [[2023-08-08#Claude for comments on code]] ### Tree like output structure Currently, we handle matches as mostly a flat list of matches, but what would it mean for tree-sitter to be a simplifying AST kind of filter, where one matching query would then apply further matching query on its body, and do the replacement with a YAML template instead of a text template at the end. We could have nested queries, and each query has a structured template for its output. Potentially the top output template also has access to the structured data of the submatches, and vice versa. That is, we match the queries recursively first, construct a tree of matches, then pass that tree of matches to the template renderer, along with a tree of templates. ### diff + oak for pull request feedback See [[2023-08-08#Claude for comments on code]] Which leads me to: This is really cool and something I should add to my workflow. Potentially I can couple this with a diff, use the diff to extract functions/files/methods that changed, and then use that in combination with oak to query for comments… - [ ] #toDesign brainstorm out what a diff pull request functionality would be and see how efficient it is ➕ 2023-08-08