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 14d 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.
- 14d 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 3mo 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.
Other commands, from other repositories
playwright-test-heal
Run all my tests and fix the failing ones.
verify-bug
Post-merge UAT verification workflow. Walks JIRA reproduce steps, performs comparative audits (Before/After), attaches evidence to JIRA, and transitions status on PASS.
bugfix
Bug fix workflow: root cause analysis → user review → regression test + fix via TDD.
api-aqa-flow-execution-and-report-analysis
Phase 6 Execution & Report Analysis of api-aqa-flow (USER INTERACTION REQUIRED).
timeout-fix
A procedure for diagnosing and fixing tests that exceed their time limit by finding causes such as slow processing, hanging network calls, deadlocks, heavy setup, or leaked resources.
AGENTS
Run the current binary in a temporary test repository with a real PTY. Use tmux-cli when available, capture terminal output, and inspect -vv logs when behavior depends on timing or shell state. Avoid treating a piped command as proof of interactive behavior.