Borrowing it
Nothing to install: this file belongs to asynkron/Asynkron.JsEngine. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/asynkron/Asynkron.JsEngine/main/.claude/commands/layered-test.mdgit clone --depth 1 https://github.com/asynkron/Asynkron.JsEngineWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/asynkron/asynkron.jsengine/layered-test)<a href="https://agentmods.dev/commands/asynkron/asynkron.jsengine/layered-test"><img src="https://agentmods.dev/badge/commands/asynkron/asynkron.jsengine/layered-test/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/asynkron/asynkron.jsengine/layered-test"><img src="https://agentmods.dev/badge/commands/asynkron/asynkron.jsengine/layered-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00009 | $0.00743 |
| Opus 5.5 | $0.00004 | $0.00297 |
| Sonnet 5.5 | $0.00002 | $0.00149 |
| Haiku 4.5 | $0.00001 | $0.00074 |
Grade A, and why
layered-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate layered tests that verify each pipeline stage before full end-to-end runs.
For full methodology, see agents/how-to-layered-tests.md.
Pipeline Layers
Source -> Lexer -> Parser -> AST -> Analyzers -> Evaluator -> Result
L0 L1 L2 L3 L4 L5
When to Use
- Bug manifests at runtime but stage is unclear
- Need to inspect AST/metadata before evaluation
- Validate scope/slot metadata, CPS, loop normalization
- Debug closure capture, environment chains, or slot lookups
Instructions
Given $ARGUMENTS (test name and JS code), create a test class with tests for each layer:
- L2 Parser - Assert AST structure is correct
- L3 Analyzers - Assert metadata (SlotMap, ScopeId, PerIterationBindings)
- L4 Plans - Assert plan contents (e.g., LoopPlan, ExecutionPlan)
- L5 Runtime - Enable debug logging and assert internal operations
- L6 Result - Full evaluation assertion
Template
public class [TestName]LayeredTests
{
private readonly ITestOutputHelper _output;
public [TestName]LayeredTests(ITestOutputHelper output) => _output = output;
private const string Source = @"/* javascript code */";
[Fact]
public void L2_Parser_AstStructure()
{
var pipeline = AstTestHelpers.ParseAndAnalyze(Source);
var node = AstTestHelpers.FindFirst<ForStatement>(pipeline.Analyzed);
Assert.NotNull(node);
_output.WriteLine($"Found: {node.GetType().Name}");
}
[Fact]
public void L3_Analyzers_SlotMetadata()
{
var pipeline = AstTestHelpers.ParseAndAnalyze(Source);
var func = AstTestHelpers.FindFirst<FunctionExpression>(pipeline.Analyzed);
Assert.NotNull(func?.SlotMap);
Assert.True(func.SlotMap.ContainsKey(Symbol.Create("i")));
}
[Fact]
public void L4_Plans_LoopPlan()
{
var pipeline = AstTestHelpers.ParseAndAnalyze(Source);
var node = AstTestHelpers.FindFirst<ForStatement>(pipeline.Analyzed);
var plan = ((IAstCacheable<LoopPlan>)node).GetOrCreateCache();
var bindingNames = plan.PerIterationBindings.Select(b => b.Name).ToArray();
Assert.Contains("i", bindingNames);
}
[Fact(Timeout = 10000)]
public async Task L5_Result_Evaluation()
{
await using var engine = new JsEngine();
var result = await engine.Evaluate(Source);
Assert.Equal("expected", result?.ToString());
}
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 96 lines · 9 tokens per session scan A 7fbe4629c6eb
layered-test is a command published in the GitHub repository asynkron/Asynkron.JsEngine (11 stars, last pushed 4mo ago), licensed MIT. It adds 9 tokens to every session and 743 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.
layered-test compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| layered-testasynkron/Asynkron.JsEngine | Command | 11 | 4mo ago | MIT | A | 9 | Claude Code |
| qa-changesOpenHands/extensions | Command | 190 | yesterday | MIT | A | 63 | Claude Code |
| auditar-cascadingluanpdd/kit-mcp | Command | 5 | yesterday | MIT | A | 54 | Claude Code |
| react-nativegetsentry/toolkit | Command | 977 | yesterday | none | A | 0 | Claude Code |
| http-serviceMadAppGang/magus | Command | 16 | today | MIT | A | 27 | Claude Code |
| doctordoncheli/don-cheli-sdd | Command | 59 | 3mo ago | Apache-2.0 | A | 76 | Claude Code |
| doctorfatihkan/badi | Command | 8 | 1mo ago | MIT | A | 0 | Claude Code |