codeql / unified
AGENTS.md10k starsChanged 4 years agoMITView on GitHub
This is a CodeQL extractor that maps a language's parse tree onto a shared AST using the yeast desugaring engine. Swift, the only language so far, is parsed by Apple's swift-syntax rather than by tree-sitter. - The raw parse tree's shape is described by extractor/swift_node_types.yml, which is generated from swift-syntax by swift-syntax-rs/schemagen. Do not edit it by hand; regenerate it with scripts/regenerate-node-types.sh after changing the pinned swift-syntax version, then review the diff alongside the mapping in extractor/src/languages/swift/swift.rs. - To run…
Trending
Quiet this year.thin dataabout the whole repository
Who's talking about github/codeql
- A Hacker News story“GitHub CodeQL”Hacker News · May 6, 2020 · 35 points
- github/securitylab“[ruby]: ZipSlip/TarSlip vulnerability detection”GitHub · Feb 16, 2023 · 7 reactions
- pwntester/octo.nvim“Add menu to pick GitHub emojis”GitHub · Feb 25, 2021 · 5 reactions
- A Hacker News story“GitHub introduces CodeQL, a new tool for automated code review and vulnerability”Hacker News · Jan 20, 2023 · 4 points
- A Hacker News story“CodeQL”Hacker News · Aug 18, 2024 · 1 points
The biggest 5 of 5 mentions linking to the repository that our crawl found. Each line is their own headline.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- bazelSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Check the output files for correctness but do not edit them manually.
- Very specific: line 41
If you changed the extractor code, always rebuild it before running CodeQL tests.
- Very specific: line 45
Do not edit .expected files manually.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent instructions
This is a CodeQL extractor that maps a language's parse tree onto a shared AST
using the yeast desugaring engine. Swift, the only language so far, is parsed
by Apple's swift-syntax rather than by tree-sitter.
Building
- To build the extractor, run
scripts/create-extractor-pack.sh
Swift Parser
- Swift source is parsed by the
swift-syntax-rscrate, which wraps Apple's swift-syntax. The extractor callsswift_syntax_rs::parse_to_jsonin-process to obtain the parse tree as JSON; the extractor does not invoke a separate parser binary, and there is no grammar in this repository to edit. extractor/src/languages/swift/adapter.rsconverts that JSON into a yeast AST.- The raw parse tree's shape is described by
extractor/swift_node_types.yml, which is generated from swift-syntax byswift-syntax-rs/schemagen. Do not edit it by hand; regenerate it withscripts/regenerate-node-types.shafter changing the pinned swift-syntax version, then review the diff alongside the mapping inextractor/src/languages/swift/swift.rs.
AST Mapping
- The target AST shape is described by
extractor/ast_types.yml. - The mapping from the parse tree to the target AST is found in
extractor/src/languages/swift/swift.rs - To run tests for the parser and mapping, run
cargo testin theextractordirectory. Since the parser is linked in-process, this needs a working Swift toolchain (soswift-syntax-rscan build). The tests can also be run under Bazel viabazel test //unified/extractor:all_tests. - Extractor test cases are located at
extractor/tests/corpus/swift/*/*.swift. - Each test case has a corresponding
.outputfile containing its generated output along with a copy of the test case itself. - Check the output files for correctness but do not edit them manually. Regenerate them with
scripts/update-corpus.sh.
CodeQL Testing
- If you changed the extractor code, always rebuild it before running CodeQL tests.
- To run all CodeQL tests, run
codeql test run --search-path extractor-pack ql/test - Do not edit
.expectedfiles manually. To update the expected output, pass--learnto thecodeql test runcommand. - To run a specific test, pass the specific directory to the
codeql test runcommand instead ofql/test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

