maintain-clash-mihomo-config
Maintain and update this Clash/Mihomo configuration repo (mihomo.yaml, mihomo.js, rules/*.list, *Merged.list, force_ttl_rules.txt). Use when editing proxy groups, rule providers, DNS/TTL rules, or regenerating merged lists in this project.
When & Why to Use This Skill
This Claude skill automates the maintenance and synchronization of Clash and Mihomo network configurations. It streamlines the management of proxy groups, rule providers, and DNS settings while ensuring consistency across YAML and JavaScript configuration files through automated validation and script execution.
Use Cases
- Automated Proxy Management: Effortlessly update subscription URLs and proxy group names across multiple configuration files (mihomo.yaml and mihomo.js) to ensure seamless network connectivity.
- Custom Routing Rule Optimization: Add, remove, or modify specific domain and IP-based rules in custom list files while maintaining proper Clash keywords and formatting.
- DNS and TTL Configuration: Generate and refresh PaoPaoDNS rules (force_ttl_rules.txt) using integrated Python scripts to optimize network latency and resolution.
- Configuration Validation and Sync: Automatically validate YAML and JS syntax after edits to prevent configuration errors and keep merged rule lists synchronized with their sources.
| name | maintain-clash-mihomo-config |
|---|---|
| description | Maintain and update this Clash/Mihomo configuration repo (mihomo.yaml, mihomo.js, rules/*.list, *Merged.list, force_ttl_rules.txt). Use when editing proxy groups, rule providers, DNS/TTL rules, or regenerating merged lists in this project. |
Maintain Clash Mihomo Config
Overview
Keep the Mihomo/Clash config, custom rules, and generated lists consistent in this repo, following the project guardrails.
Key files
mihomo.yaml: primary Mihomo/Clash config (providers, DNS, proxy groups, rule providers, rules)mihomo.js: JS config generator; keep group and rule names identical tomihomo.yamlrules/*.list: custom rule lists in Clash classical text format*Merged.list: generated/merged rule lists with source headersforce_ttl_rules.txt: generated PaoPaoDNS rulesscripts/update_dns.py: regenerateforce_ttl_rules.txt(requires network andrequests)scripts/update_dns_rules.sh: server-side updater for PaoPaoDNS- Chinese-named directories: ImmortalWrt build notes and ACL4SSR archive (treat as notes/vendor data)
Update workflows
Custom rules
- Edit the relevant file in
rules/. - Ensure the rule list is referenced in
mihomo.yamlormihomo.js. - Keep one rule per line using Clash keywords
DOMAIN,DOMAIN-SUFFIX,DOMAIN-KEYWORD,IP-CIDR,IP-CIDR6with optional,no-resolve.
Mihomo config
- Keep proxy group names and rule targets identical across
mihomo.yamlandmihomo.js. - Keep placeholders
__MEIYING_URL__and__YUNDONG_URL__intact unless updating subscription URLs.
PaoPaoDNS rules
- Run
python scripts/update_dns.pyto refreshforce_ttl_rules.txt. - Expect network access and the
requestspackage to be available.
Merged lists
- Regenerate from the sources listed in each file header.
- Preserve headers and metadata; avoid manual edits unless regenerating.
Validation
- Validate YAML syntax for
mihomo.yaml. - Validate JS syntax for
mihomo.js. - Verify rule list formatting (one rule per line, valid Clash keywords).