ev-flow/quark-engine/rule-gen
- community
Checking that the SKILL.md file is still in the repository.
Generate a Quark Engine detection rule from a behavior description and decompiled code. Validates the rule against a real APK before outputting it.
Install
npx vskill@latest install ev-flow/quark-engine/rule-genSKILL.md
Generate Quark Rule
Use this skill when the user wants to create a Quark rule that detects a specific malicious behavior. The skill guides you through identifying the right API pair, formatting Dalvik descriptors correctly, and validating that the rule actually matches the target APK.
Step 0 — Verify Quark is installed
If this fails, stop and tell the user: "Quark not found — run pip install quark-engine and try again."
Step 1 — Get behavior description
Ask the user to describe the behavior they want to detect in plain English. Example: "Send the device's GPS location via SMS to a remote number."
Step 2 — Get code reference (required before proceeding)
A decompiled code snippet is required to identify the correct class names, method names, and descriptors. Without it, any generated rule is a guess and the retry loop has no new information.
If the user provides a code snippet: proceed to Step 3.
If no snippet is available: extract relevant method listings from the APK:
Ask the user which package namespace to search for, or search for the most likely Android SDK classes for the described behavior (e.g., SmsManager, LocationManager, TelephonyManager).
Step 3 — Identify the API pair
From the code snippet, identify exactly two Android API calls that together characterize the behavior:
- Both calls must appear in the same execution context
- Together, they must describe the malicious intent (e.g., "get location" + "send SMS")
- Neither call alone is sufficient — the pair is what makes it malicious
Step 4 — Format Dalvik descriptors
Quark rules use Dalvik bytecode descriptor syntax. Getting this wrong causes the rule to silently return zero results.
Class names:
- Format:
L+ package path (with/separators) +; - Example:
Landroid/telephony/SmsManager;
Method descriptors:
- Format:
(param1param2...)ReturnType - No spaces between parameters — the parser uses type boundaries
- Reference type params end with
;, primitive params are single chars - Example (two reference params, void return):
(Ljava/lang/String;Landroid/content/Context;)V - Wrong (space breaks parsing):
(Ljava/lang/String; Landroid/content/Context;)V
Primitive types:
| Java type | Dalvik | |
|---|---|---|
| void | V | |
| int | I | |
| boolean | Z | |
| byte | B | |
| long | J | |
| byte[] | [B |
Verified example rule (sendLocation_SMS.json):
Step 5 — Assign score and labels
Score — always set 1 for a newly generated rule. The final score depends on how the behavior is distributed across real malware samples, so an analyst must study that distribution and adjust the score later.
Labels — use canonical labels from the existing rules repo:
collection, sms, network, file, command, control, reflection, telephony, accessibility service, record, wifi, location, screen, calllog, camera, applications, http, calendar, socket, evasion
Invent a new label only if none of the above apply — document it in your PR.
Step 6 — Generate and save the rule
Write the rule JSON to a temp file:
Step 7 — Validate the rule
If behaviors detected (exit 0): proceed to Step 8.
If zero behaviors (exit 1): return to Step 3 with the code snippet still in context. Revise the API pair or descriptor — common causes of zero results:
- Wrong class name (missing
Lprefix or;suffix) - Space in descriptor between parameters
- Method not found at this class level (may be in a parent class)
- Wrong method name (check the snippet again)
Maximum 3 attempts total. If still zero after 3 tries, tell the user what was tried and ask them to provide a more specific code snippet or a different API pair.
Step 8 — Output the final rule
Present the validated rule JSON and suggest a filename:
Example: send_location_via_sms.json
Tell the user: "Place this file in your rules directory (~/.quark-engine/quark-rules/rules/ for the default set, or a custom directory passed with -r)."
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingquark-ai-plugin/skills/rule-gen/SKILL.md
Popularity
- Repository stars
- 1,730
- Repository forks
- 218
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ev-flow/quark-engine/rule-gen)