write-test
Skill319 starsChanged 10 days agoMITView on GitHub
Use when adding or modifying JETLS tests. Covers test file and module structure, `@testset` organization, `let` blocks, `withserver` usage, cached syntax trees in helpers that call features directly, and when subroutine tests are sufficient for language-server features.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- ok-oldking/ok-scripttheir own version, first seen Nov 1, 2026
- Univers42/harness42their own version, first seen Nov 1, 2026
- markneonin/panelinetheir own version, first seen Nov 1, 2026
- iPwnPancakes/skillstheir own version, first seen Oct 17, 2026
- aviatesk/JET.jltheir own version, first seen Oct 9, 2026
- ethereum/execution-specstheir own version, first seen Oct 8, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- ethereum/execution-specs★ 1.2ksame name
- aviatesk/JET.jl★ 884same name
- ok-oldking/ok-script★ 831same name
- markneonin/paneline★ 9same name
- Univers42/claude-deal-with-the-devil★ 4same name
- Univers42/harness42★ 4same name
- iPwnPancakes/skills★ 1same name
- rezendefabio/financas-lab★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- changelogSkill
- codex-review-loopSkill
- commitSkill
- run-testSkill
- zed-agent-diagnosticsSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 1 is distinctive, and 5 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when you add new tests or modify existing JETLS test code.
- Very specific: line 16
Test code for new language server features should be written in files that define independent module spaces with a test_ prefix.
- Very specific: line 43
Use @testset "testset name" to organize tests cleanly.
- Very specific: line 49
Use let blocks to avoid unintentionally reusing names across test cases, unless a helper function or do block already provides local scope.
- Very specific: line 131
Leave cache_tree0 unset when the FileInfo is only used to convert positions or stands for a file that is not open in the editor, since …
- Very specific: line 137
When you add or modify tests, use the run-test workflow to run the most specific relevant test command.
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write JETLS tests
Use this skill when you add new tests or modify existing JETLS test code.
Test file structure
Test code for new language server features should be written in files that
define independent module spaces with a test_ prefix. Include those files
from JETLSCore/test/runtests.jl.
This lets each test file run independently from the REPL.
For example, JETLSCore/test/test_completions.jl should look like:
module test_completions
using Test
...
end # module test_completionsThen include it from JETLSCore/test/runtests.jl like this:
@testset "JETLS.jl" begin
...
@testset "completions" include("test_completions.jl")
...
endOrganizing test code
Use @testset "testset name" to organize tests cleanly.
For code clarity, avoid placing using, import, or struct definitions
inside @testset blocks unless it is specifically necessary.
Prefer top-level definitions.
Use let blocks to avoid unintentionally reusing names across test cases,
unless a helper function or do block already provides local scope.
Example:
module test_completions
using Test
using JETLSCore: some_completion_func
function testcase_util(s::AbstractString)
...
end
function with_testcase(s::AbstractString)
...
end
@testset "some_completion_func" begin
let s = "..."
ret = some_completion_func(testcase_util(s))
@test test_with(ret)
end
let s = "..."
ret = some_completion_func(testcase_util(s))
@test test_with(ret)
end
with_testcase(s) do case
ret = some_completion_func(case)
@test test_with(ret)
end
end
end # module test_completionsLanguage-server feature tests
Testing language server functionality is challenging. To fully test such functionality, you need to start a server loop and send requests that mimic realistic user interactions.
For those tests, use withserver from
JETLSCore/test/setup.jl.
Refer to JETLSCore/test/test_full_lifecycle.jl
as an example.
A good pattern is JETLSCore/test/test_definition.jl:
it keeps the full withserver coverage to one request/response sanity test
for the DidOpen → analysis → DefinitionRequest path, while most cases use
definition_test to call find_definition directly and assert on returned
locations. Prefer this split for LSP handlers.
Cached syntax trees
Requests on a synchronized document share the cached syntax tree of its
FileInfo without copying it, so no feature may mutate that tree. Under
JETLS_TEST_MODE, JETLS records a fingerprint of each cached tree and
JETLSCore.check_syntax_tree0(fi) throws if the tree has changed since.
withserver runs this check for every open document when the test finishes.
Helpers that construct their own FileInfo and call a feature directly
should construct it with cache_tree0 = true, as cache_file_info! does for
synchronized documents, and call JETLSCore.check_syntax_tree0(fi) after the
feature call:
function find_definition(text::AbstractString, pos::Position)
server = JETLSCore.Server()
filename = joinpath(@__DIR__, "testfile_$(gensym(:definition)).jl")
fi = JETLSCore.FileInfo(#=version=#0, text, filename; cache_tree0 = true)
furi = filename2uri(filename)
JETLSCore.store!(server.state.file_cache) do cache
Base.PersistentDict(cache, furi => fi), nothing
end
result = JETLSCore.find_definition(server, furi, fi, pos)
JETLSCore.check_syntax_tree0(fi)
return result
endLeave cache_tree0 unset when the FileInfo is only used to convert
positions or stands for a file that is not open in the editor, since JETLS
doesn't cache a tree for such files in production either.
After writing tests
When you add or modify tests, use the run-test
workflow to run the most specific relevant test command.
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.

