Skip to content

Sync README with actual repository state and add automation workflow - #20

Merged
tuanductran merged 4 commits into
mainfrom
copilot/update-readme-file
Jan 29, 2026
Merged

Sync README with actual repository state and add automation workflow#20
tuanductran merged 4 commits into
mainfrom
copilot/update-readme-file

Conversation

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

README.md reflected outdated rule counts and was missing the integrations skill entirely. Added GitHub Action workflow to automate future README maintenance.

Changes

  • Corrected rule counts: CLI 10→14, UI 8→10, added integrations (3 rules)
  • Added integrations skill: DNSMasq, OpenWrt, AdGuard Home platform integration guides
  • Added integration examples: DNSMasq port configuration, OpenWrt SSH installation, AdGuard upstream DNS setup
  • Added Contributing section: Development workflow, rule creation process, quality requirements
  • Enhanced Resources: Separated official docs from community resources, added CLI Wiki
  • Added automation workflow: Created .github/workflows/auto-update-readme.yml that automatically updates README.md when rule files change on main branch

Automation Workflow

The new GitHub Action workflow:

  • Triggers on changes to skills/**/rules/*.md or skills/**/SKILL.md files on main branch
  • Uses Python 3 to scan all skill directories and parse YAML frontmatter
  • Automatically generates and updates the "Available Skills" section in README.md
  • Commits changes using stefanzweifel/git-auto-commit-action@v7
  • Follows case-police rules (NextDNS, CLI, API, OpenWrt, etc.)
  • Organizes rules by skill group (API, CLI, UI, Integrations)
  • Counts and displays capability vs efficiency rules

Verification

All counts verified against actual skills/*/rules/*.md files (44 total rules across 4 skills). Workflow YAML syntax validated and Python script tested locally.

Original prompt

Read all project and update README.md file.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
Copilot AI changed the title [WIP] Update README.md file with project details Sync README with actual repository state Jan 29, 2026
Copilot AI requested a review from tuanductran January 29, 2026 07:07
@tuanductran

Copy link
Copy Markdown
Owner

@copilot Act as a DevOps engineer for this repository. I want to automate the maintenance of README.md. Your task is to:

Create a GitHub Action workflow named auto-update-readme.yml in .github/workflows/.

Logic: Whenever a new .md file is added to any subdirectory under skills/ on the main branch, this action should:

Scan all subdirectories in skills/.

Generate an organized list of all rules, categorized by their skill group (API, CLI, UI, Integrations).

Find the markers and in README.md and inject the updated list between them.

Automatically commit and push the changes back to the repository using stefanzweifel/git-auto-commit-action@v7.

Requirements:

Use a simple Python 3 script within the workflow to perform the directory parsing and file writing.

Ensure the links created in README.md are relative paths to the rule files.

Follow the case-police rules from CLAUDE.md (e.g., use NextDNS, CLI, API).

Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Act as a DevOps engineer for this repository. I want to automate the maintenance of README.md. Your task is to:

Create a GitHub Action workflow named auto-update-readme.yml in .github/workfl...

Created .github/workflows/auto-update-readme.yml that automatically maintains README.md when rule files change.

Implementation details:

  • Triggers on push to main branch when .md files in skills/ are modified
  • Python 3 script parses YAML frontmatter from all rule files
  • Scans all subdirectories under skills/ (API, CLI, UI, Integrations)
  • Generates organized list with rule counts by type (capability/efficiency)
  • Updates content between "## Available Skills" and "## Rule Types" markers
  • Auto-commits using stefanzweifel/git-auto-commit-action@v5
  • Follows case-police rules (NextDNS, CLI, API, OpenWrt, etc.)

Commit: 445d582

Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
@tuanductran

Copy link
Copy Markdown
Owner

@copilot pls use stefanzweifel/git-auto-commit-action@v7

Copilot AI changed the title Sync README with actual repository state Sync README with actual repository state and add automation workflow Jan 29, 2026
Copilot AI requested a review from tuanductran January 29, 2026 07:22

Copilot AI commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot pls use stefanzweifel/git-auto-commit-action@v7

Already updated to v7 in commit 85c8c95. The workflow now uses stefanzweifel/git-auto-commit-action@v7 as requested.

@tuanductran
tuanductran marked this pull request as ready for review January 29, 2026 07:26
Copilot AI review requested due to automatic review settings January 29, 2026 07:26
@tuanductran
tuanductran merged commit 60e5d84 into main Jan 29, 2026
9 checks passed
@tuanductran
tuanductran deleted the copilot/update-readme-file branch January 29, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates repository documentation to reflect the current set of skills/rules and introduces an automation workflow intended to keep the README’s “Available Skills” section in sync with future rule changes.

Changes:

  • Updated README skill/rule counts and expanded documentation to include an “integrations” skill plus new examples/resources/contributing guidance.
  • Added “integrations” coverage (skills overview + quick examples) and reorganized resources into official vs community links.
  • Added a GitHub Actions workflow to regenerate the README skills section on rule/SKILL.md changes and auto-commit the result.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
README.md Updates counts, adds integrations docs/examples, adds contributing section, reorganizes resources.
.github/workflows/auto-update-readme.yml Adds automation to regenerate the README “Available Skills” section and commit changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +71 to +82
for rule_file in sorted(rules_dir.glob('*.md')):
rule_meta = parse_yaml_frontmatter(rule_file)
if rule_meta:
rules.append({
'file': rule_file.name,
'title': rule_meta.get('title', rule_file.stem),
'type': rule_meta.get('type', 'capability'),
'impact': rule_meta.get('impact', 'MEDIUM'),
'tags': rule_meta.get('tags', ''),
'path': str(rule_file.relative_to(Path.cwd()))
})

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rules are gathered via sorted(rules_dir.glob('*.md')), so the “Examples” list is effectively based on filename sort order. This will cause unstable/less-meaningful example ordering (and README churn) compared to the curated ordering in each SKILL.md. Prefer deriving ordering (and maybe examples) from the SKILL.md rule tables, or an explicit ordering field in frontmatter.

Suggested change
for rule_file in sorted(rules_dir.glob('*.md')):
rule_meta = parse_yaml_frontmatter(rule_file)
if rule_meta:
rules.append({
'file': rule_file.name,
'title': rule_meta.get('title', rule_file.stem),
'type': rule_meta.get('type', 'capability'),
'impact': rule_meta.get('impact', 'MEDIUM'),
'tags': rule_meta.get('tags', ''),
'path': str(rule_file.relative_to(Path.cwd()))
})
for rule_file in rules_dir.glob('*.md'):
rule_meta = parse_yaml_frontmatter(rule_file)
if rule_meta:
# Optional explicit ordering from rule frontmatter (e.g., "order: 1")
raw_order = rule_meta.get('order')
order_value = None
if raw_order is not None:
try:
order_value = int(str(raw_order).strip())
except (TypeError, ValueError):
order_value = None
rules.append({
'file': rule_file.name,
'title': rule_meta.get('title', rule_file.stem),
'type': rule_meta.get('type', 'capability'),
'impact': rule_meta.get('impact', 'MEDIUM'),
'tags': rule_meta.get('tags', ''),
'path': str(rule_file.relative_to(Path.cwd())),
'order': order_value,
})
# Sort rules: first by explicit numeric 'order' if present, then by title for stability
rules.sort(key=lambda r: (
r['order'] is None,
r['order'] if r['order'] is not None else 0,
r['title'],
))

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +60
with open(skill_md, 'r', encoding='utf-8') as f:
skill_content = f.read()

# Parse skill frontmatter

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skill_content is read from SKILL.md but never used (same for skill_desc). This extra read makes the script harder to follow; either remove it or use it to drive README content (e.g., description/order from SKILL.md).

Suggested change
with open(skill_md, 'r', encoding='utf-8') as f:
skill_content = f.read()
# Parse skill frontmatter
# Parse skill frontmatter directly from SKILL.md

Copilot uses AI. Check for mistakes.
display_name = skill_display_names.get(skill_name, skill_name)
total_count = len(rules)

output = f"### {skill_name} ({total_count} rules)\n\n"

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

display_name is computed from skill_display_names but the output header uses skill_name instead, so display_name is dead code. Remove it, or use display_name in the generated markdown if the intent is human-friendly titles.

Suggested change
output = f"### {skill_name} ({total_count} rules)\n\n"
output = f"### {display_name} ({total_count} rules)\n\n"

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +13
jobs:
update-readme:
runs-on: ubuntu-latest

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow commits back to main, but it doesn’t declare permissions: contents: write. If the repo/org default token permissions are read-only, the auto-commit step will fail. Add an explicit permissions block (workflow- or job-level) granting contents write (and only what’s needed).

Copilot uses AI. Check for mistakes.
Comment on lines +152 to +156
# Get all skill directories
skill_order = ['nextdns-api', 'nextdns-cli', 'nextdns-ui', 'integrations']
skills_data = {}

for skill_dir in sorted(skills_dir.iterdir()):

Copilot AI Jan 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skill_order hardcodes the set/order of skills rendered into README. This means adding a new skill directory won’t show up in the generated section unless this list is updated, which undermines the goal of automated README maintenance. Consider generating order dynamically (e.g., known skills first, then append any other skill dirs alphabetically) or deriving order from directory structure/metadata.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants