agentsclimarketplace

Cleantest syntax filter

Skill jimmy0717/cleantest-agent/skills/cleantest-syntax-filter

Detects and removes syntactic noise from unit test training data using tree-sitter AST parsing with optional LLM enhancement for borderline cases. Covers 6 noise types from the CleanTest framework (FSE 2025). Triggers: "check syntax noise", "detect noisy test syntax", "filter syntax errors", "检测语法噪声"From its SKILL.md

Install
npx -y skills add jimmy0717/cleantest-agent --skill cleantest-syntax-filter

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.6 KB, 593 tokens by cl100k_base, as published. Nobody here has run it

Syntax Noise Filter

Prerequisites

This skill depends on the open-source cleantest-agent Python package:

pip install cleantest-agent
# or, from a checkout of the project repository:
pip install -e .

The 21,954-pattern annotation dictionary is shipped as package data (cleantest_agent/data/noise_modifier_fm.txt), so the filter works even when this skill is installed in isolation in ~/.codebuddy/skills/ / ~/.claude/skills/ etc.

This skill detects 6 types of syntactic noise in Java unit test training data, corresponding to the original CleanTest paper's syntax filter.

Noise Types

IDTypeDetection MethodLLM Enhanced
N1Syntax Errorstree-sitter ERROR nodeYes (confirm if code is truly broken)
N2Empty Exception Handlingcatch/finally with empty block--
N3Missing Implementationmethod body < 3 childrenYes (check if trivial test is valid)
N4Ambiguous Data Typegenerics markers (<E>, <T>, <?>, etc.)--
N5Unnecessary AnnotationsAho-Corasick automaton (21,954 patterns)--
N6Non-English Literalsregex for CJK characters--

Usage

python skills/cleantest-syntax-filter/scripts/syntax_filter.py \
  --input_csv <path> \
  --output_csv <path> \
  [--llm_enhance]

Example

Input (focal method):

@GetMapping("/api/users")
public List<User> getUsers() { return repo.findAll(); }

Output: NOISE (unnecessary_annotations) -- matched via Aho-Corasick.

LLM Enhancement Protocol

For noise types N1 and N3, when the rule-based detector flags a sample, the LLM is asked to confirm:

You are a Java test quality expert. The following code was flagged by
static analysis as [{noise_type}]:

```java
{code_snippet}

Static analysis result: {rule_result}

Is this truly a defective/noisy test that should be removed from training data? Answer ONLY with:

  • "NOISE: <one-line reason>" (confirm removal)
  • "KEEP: <one-line reason>" (override, this is valid code)

Only ~5% of samples typically require LLM confirmation.

## Scripts

- `scripts/syntax_filter.py` -- Main filter logic
- `references/noise_rules.md` -- Detailed noise type documentation

What ships with it: 3 files

5.4 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 326,851. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.