Open-source project
n0de-sudo/Perfect-Rules avatar
n0de-sudo/Perfect-Rules

Perfect Rules: a drop-in split-routing config for Clash, Mihomo and V2rayN

V2rayN,Clash系列,Karing等主流代理软件的完美分流规则源文件,下载直接使用。

1,070 stars219 forksUnknownLicense varies

At a glance

What is it?
Perfect Rules is a maintained set of routing rule files from Artemis Lab: a Clash/Mihomo merge YAML you paste into an override slot, and a V2rayN JSON you import by hand. It is a rule set, not a proxy client, and the split between the two files is the thing to understand before adopting it.
Who is it for?
Adopt Perfect Rules if you already run Clash, Mihomo or V2rayN and want a pre-sorted rule set you can paste or import rather than write yourself. Do not adopt it if you need a documented upgrade path, an explicit licence, or a V2rayN 3.0 file that does not exist yet.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 10 days ago.
What is it written in?
GitHub does not report a main language for this repository.

Answers come from the project's GitHub data, last synced on October 6, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What Perfect Rules actually is, and who it is for

Perfect Rules is not a proxy client and not a subscription converter. It is a set of routing rule files, hosted in a repository under the name n0de-sudo/Perfect-Rules and maintained by what the README calls Artemis Lab (阿尔忒弥斯实验室). The repository has four top-level entries: .gitignore, Clash/, README.md and V2rayN.json. That is the whole product surface.

The problem it addresses is the one every proxy user hits after installing a client: the default rules send too much traffic through the tunnel. Streaming services, domestic sites, LAN addresses and ad domains all need different treatment, and writing that classification by hand is tedious and never finished. Perfect Rules ships a classification that the README groups into six buckets: domestic sites to DIRECT, overseas sites to the proxy, AI services to a dedicated AI policy, YouTube to a dedicated YouTube policy, ads and trackers to REJECT, and LAN to DIRECT. The audience is narrow and specific: people already running Clash, Mihomo or V2rayN who want someone else to have sorted the domains. If you use a different client, or you route everything through one tunnel and do not care, this project has nothing for you.

One naming warning. The repository name collides with a large amount of unrelated search traffic about parliamentary procedure and about a company called Perfect Rules Inc. Nothing in the README connects this project to either. Read the file listing, not the search results.

The Clash/Mihomo merge file and the V2rayN import are two different products

The README presents two configuration tracks with different version numbers and, more importantly, different levels of automation. Clash and Mihomo users get Perfect Rules 3.0, described as a merge file at Clash/Clash_merge.yaml. The README states that the core configuration is already assembled and that you do not need to modify it: you copy the full contents and paste them into an override slot. V2rayN users get Perfect Rules 2.0, a single file at V2rayN.json, and the README is explicit that this path is not finished for you. After importing, you create your own dedicated proxy groups and routing rules manually, following the linked video.

That asymmetry is the most useful fact about the project. The Clash track is a paste-and-go override; the V2rayN track is a rule source you assemble yourself. The README even labels the V2rayN section "3.0版本尽请期待", which is a promise of a future version rather than a description of one. Treat the two tracks as separate projects that happen to share a repository.

The data flow for Clash is therefore: the client already has your proxy nodes and proxy groups, and the override file replaces or extends the routing and group definitions that decide which node handles which domain. The rule set never touches your credentials or your subscription URL. For V2rayN, the imported JSON contributes rules to the route settings, and the groups you create by hand are what those rules point at.

Installing the Clash 3.0 rules and getting a first routed request

The README gives a three-step procedure for Clash and Mihomo, using Clash Verge as the worked example. There is no installer, no package and no CLI. You copy text and paste it into the client.

Step one is to open Clash/Clash_merge.yaml in the repository and copy the full contents. Step two is to paste that into the client's override slot. In Clash Verge the README says to open the subscriptions tab, double-click "全局覆写扩展配置" (the global override extended configuration entry), paste the code there and save. The README states that the split rules take effect once you save.

The third step is node selection and group tuning, which is where your own setup enters:

yaml
# after pasting Clash_merge.yaml into the global override,
# open the client's proxy groups and pick a node for each policy
# named in the rule set, for example the AI policy and the YouTube policy

The README does not print a sample of the merge file, so the exact group names are only visible in the file itself. Read Clash/Clash_merge.yaml before pasting it, and confirm that the policy names it references exist as groups in your client. If a rule points at a policy your configuration does not define, the client will not route that traffic the way the file intends. The README's own remedy for missing coverage is to open an issue rather than to edit the file in place, which suggests the maintainers expect the file to be replaced wholesale on each update.

Importing V2rayN.json is a manual assembly job

The V2rayN path is documented as follows. Download V2rayN.json from the repository. In V2rayN, go to 设置 (Settings), then 路由设置 (Routing settings), then 添加规则集 (Add rule set), then 从文件中导入规则 (Import rules from file), and select the downloaded V2rayN.json. After that, the README says, create your own dedicated proxy group and dedicated routing rules as needed, following the video tutorial.

The file path is the only thing you need to get right:

text
Perfect-Rules/
├── Clash/          # Clash and Mihomo merge configuration
├── V2rayN.json     # V2rayN 2.0 rule file
└── README.md

What you should see after importing is a populated rule set in the routing settings, not a working configuration. The README is clear that group creation is on you. This is the single biggest difference from the Clash track, and it is the reason a reader who only skims the support table will be surprised. The support table lists V2rayN 2.0 with the usage note "下载文件后配置" (configure after downloading the file), which is accurate but easy to miss next to the Clash entry that says "复制粘贴" (copy and paste).

Because the README describes the manual step as depending on a video, the written documentation for this track is thin by design. If you prefer written instructions over video, the Clash track is the better fit even if you would otherwise use V2rayN.

Where Perfect Rules stops being the right tool

The project is a rule list, so its failure modes are the failure modes of rule lists. It cannot decide policy for domains it has not classified. When a rule is missing, the traffic falls through to whatever your client's default rule is, and the README treats that as a bug report rather than a user configuration task: it asks you to submit an issue so the rule can be added. That is a reasonable workflow for a public list, but it means your routing behaviour depends on someone else's update cadence.

The second limitation is the version gap. The V2rayN file is at 2.0 while Clash is at 3.0, and the README describes the newer V2rayN version only as something to look forward to. Anyone whose primary client is V2rayN is adopting the less complete half of this repository.

The third is that the README does not document rollback. There is no stated way to revert to a previous rule revision, no changelog entry format, and no versioning scheme for the files themselves beyond the 2.0 and 3.0 labels in the prose. If a new revision of Clash_merge.yaml breaks a policy you depend on, the documented remedy is the same as for a missing rule: open an issue. Keep your previous copy of the file before you replace it, because the project itself does not tell you how to go back.

Finally, this is not a tool for anyone who wants a single global tunnel. The whole point of the file is that different destinations take different paths, and if you do not want that, the classification is pure overhead.

How it compares with writing your own rules or using a client preset

The obvious alternative is the rule set that ships with your client or with your subscription provider. Those presets are maintained by the client authors or the provider, they update automatically with the subscription, and they require no paste step. The difference in approach is who owns the classification. A client preset is bundled and updated for you; Perfect Rules is a file you copy into an override slot, which means you control when it changes and you see the change. That control is the reason to pick it, and it is also the cost, because an override you pasted does not refresh itself.

The second alternative is writing the rules yourself. That gives exact coverage of the domains you care about and no dependency on anyone's update cadence, at the price of maintaining the list indefinitely. Perfect Rules sits between the two: more control than a bundled preset, less maintenance than a personal list, and a public issue tracker as the mechanism for fixing gaps.

A third comparison worth naming is the split between the two files in this very repository. Choosing Clash_merge.yaml over V2rayN.json is not a client preference in this case, it is a choice between a finished override and a rule source you finish yourself. If you are on the fence between clients, the Clash track is the one where the README's promise of "no modification needed" actually holds.

Maintenance, updates and the licence question

The repository is not archived, and the last push was on 2026-09-15. That is recent, and it is the only maintenance signal available here: the README's claim that the project is continuously maintained (会持续维护) is a statement of intent, and the push date is the evidence behind it. There are no retrieved releases, so updates arrive as commits to the files rather than as tagged versions. The README lists the kinds of changes to expect: new sites and services, new AI domains, rule optimisation, fixes for wrong routing, Clash/Mihomo configuration updates, and adjustments from user feedback.

The practical upgrade cost follows from that. Because the Clash file is pasted rather than referenced, an update means copying the file again and re-pasting it into the override slot. The README does not describe a diff view, a changelog file or a versioned release, so you cannot tell from the README what changed between two copies of Clash_merge.yaml without comparing them yourself. For V2rayN, an update means re-importing the JSON and re-checking the groups you built by hand.

On licensing, the README and the repository metadata are both silent. No licence is recorded, and the README contains no licence section. That matters more than usual for a rule file, because you are redistributing and modifying someone else's classification when you paste it into your own configuration. The README's disclaimer limits the project's stated purpose to network technology research, study and configuration exchange, and asks users to follow local laws and the terms of the software and services involved. It does not grant any rights. If you need a clear licence before adopting, this repository does not currently provide one, and that is a fact to weigh rather than a legal conclusion.

Editorial conclusion

Adopt Perfect Rules if you already run Clash, Mihomo or V2rayN and want a pre-sorted rule set you can paste or import rather than write yourself. Do not adopt it if you need a documented upgrade path, an explicit licence, or a V2rayN 3.0 file that does not exist yet. Verify the V2rayN.json contents first, since the README says you must create proxy groups and rules manually after importing it, and check that the repository still has an unarchived main branch with a recent push before you commit to it. The Clash path is the one that works with the least effort: copy Clash_merge.yaml, paste it into the global override, save.

Frequently asked questions

Which clients does Perfect Rules support?

The README's support table lists Clash and Mihomo at version 3.0, using the file in the Clash/ directory, and V2rayN at version 2.0, using V2rayN.json. No other clients are named.

How do I install the Clash rules from Perfect Rules?

Copy the full contents of Clash/Clash_merge.yaml, then in your client paste it into the global override extended configuration slot and save. The README uses Clash Verge as the example, where that slot is reached by double-clicking the override entry on the subscriptions tab.

Does the V2rayN.json file from Perfect Rules work on its own?

No. The README says that after importing the file through Settings, Routing settings, Add rule set, Import rules from file, you still need to create your own dedicated proxy groups and routing rules, following the video tutorial.

What licence does Perfect Rules use?

No licence is recorded in the repository metadata and the README has no licence section, so no licence is established. The README only carries a disclaimer limiting the project to network technology research, study and configuration exchange.

Official sources

  1. Issues
  2. n0de-sudo/Perfect-Rules on GitHub
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/n0de-sudo-perfect-rules.svg)](https://hysenlabs.com/projects/n0de-sudo-perfect-rules)