clash.rules.add
Add, prepend, or delete rules in a Clash configuration profile using stable fingerprint anchors to prevent duplicates and drift. Requires two-phase preview and confirmation.
Instructions
Capability-gated rule addition to a section (prepend/append/delete) of the independent Rules owner through the authenticated native Clash Verge Adapter. Stable fingerprint anchors are used instead of line numbers; duplicates and drift are rejected. Two-phase preview/nonce execution.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | No | Rules profile UID (must match ^[A-Za-z0-9_-]{1,120}$). Defaults to active profile's option.rules. | |
| rules | Yes | Rule strings to add (e.g. "DOMAIN-SUFFIX,example.com,Proxy"). Max 100 per operation. | |
| section | Yes | Target section in the Rules owner file. | |
| confirmed | Yes | Must be true to execute (light confirmation). | |
| confirmNonce | No | Nonce from preview call, required for execution. | |
| targetProfileUid | No | Target Profile UID. Defaults to the active Profile; may select an inactive Profile without switching it. | |
| afterRuleFingerprint | No | Insert after this rule fingerprint (stable anchor). | |
| beforeRuleFingerprint | No | Insert before this rule fingerprint (stable anchor). If omitted, append to section end. |