geofeed-tuner
Skill40k starsChanged 2 months agoMITView on GitHub
Use this skill whenever the user mentions IP geolocation feeds, RFC 8805, geofeeds, or wants help creating, tuning, validating, or publishing a self-published IP geolocation feed in CSV format. Intended user audience is a network operator, ISP, mobile carrier, cloud provider, hosting company, IXP, or satellite provider asking about IP geolocation accuracy, or geofeed authoring best practices. Helps create, refine, and improve CSV-format IP geolocation feeds with opinionated recommendations beyond RFC 8805 compliance. Do NOT use for private or internal IP address management — applies only to publicly routable IP addresses.
Trending
More talk lately.about the whole repository
Who's talking about github/awesome-copilot
- vercel-labs/skills“[Bug]: `npx skills update <skill-name>` adds all other skills from the skill repo”GitHub · Apr 12, 2026 · 46 reactions
- @vscode.dev“Less vibes, more standards. Custom instructions, prompts, and chat modes for Copilot → …”Bluesky · Jul 2, 2025 · 28 likes
- microsoft/copilot-intellij-feedback“Support for *.instructions.md files in IntelliJ for project-scoped Copilot customization”GitHub · Jul 9, 2025 · 25 reactions
- @aaron-powell.com“I did an overhaul of the Awesome Copilot README to make it easier to install the prompts, instructions, and …”Bluesky · Aug 20, 2025 · 14 likes
- vercel-labs/skills“[Bug]: `npx skills update` downloads entire repository instead of specific skill when using subpaths”GitHub · Apr 26, 2026 · 6 reactions
The biggest 5 of 79 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 79
Talked about on Bluesky, GitHub and Hacker News (79 times).
On Bluesky · 42
- Jul 2, 2025Less vibes, more standards. Custom instructions, prompts, and chat modes for Copilot → github.com/github/aweso... — @vscode.dev28 likes and reposts
- Aug 20, 2025I did an overhaul of the Awesome Copilot README to make it easier to install the prompts, instructions, and chat modes to VS Code - there… — @aaron-powell.com14 likes and reposts
- Jul 31, 2025Fixed a bug on github.com/github/aweso... so you can now one-click add Chat Modes to your VS Code environment (it worked for prompts and… — @aaron-powell.com5 likes and reposts
- Jul 1, 2025Community-contributed instructions, prompts, and configurations to help you make the most of GitHub Copilot. github.com/github/aweso... — @garrytrinder.dev5 likes and reposts
- Jul 3, 2025Want GitHub Copilot to follow the most modern best practices in your language of choice? Guide it with custom instructions, starting from… — @pamelafox.bsky.social4 likes and reposts
37 more on Bluesky
- Oct 1, 2026📦 github / awesome-copilot ⭐ 39,586 (+59) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social3 likes and reposts
- Mar 5, 2026It's honestly been a lot of a trial and error for me. I did do some training at work but applying it to real-world problems and picking the… — @adamrdriscoll.com3 likes and reposts
- Dec 11, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 13,991 (+111) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social3 likes and reposts
- Oct 23, 2025📦 github / awesome-copilot ⭐ 10,301 (+73) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social3 likes and reposts
- Sep 25, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 8,027 (+102) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- Jul 4, 2025👀 Check this :A community-powered repo to enhance your GitHub Copilot experience > shared prompts, instructions, and configs so Copilot… — @elbruno.com3 likes and reposts
- Sep 24, 2026📦 github / awesome-copilot ⭐ 39,304 (+43) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social2 likes and reposts
- Aug 26, 2026📦 github / awesome-copilot ⭐ 38,267 (+44) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social2 likes and reposts
- Mar 7, 2026github / awesome-copilot Community-contributed instructions, prompts, and configurations to help you make the most of GitHub Copilot.… — @pythonhub.dev2 likes and reposts
- Mar 1, 2026Community-curated collection of specialized agents, instructions, and workflows that transform GitHub Copilot from basic autocomplete into… — @arifsolmaz.bsky.social2 likes and reposts
- Feb 26, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 22,634 (+146) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social2 likes and reposts
- Jan 10, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 16,762 (+165) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending.bsky.social2 likes and reposts
- Dec 2, 2025📦 github / awesome-copilot ⭐ 13,317 (+77) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social2 likes and reposts
- Nov 19, 2025Awesome GitHub Copilot Customizations github.com/github/aweso... — @adamrdriscoll.com2 likes and reposts
- Nov 7, 2025📦 github / awesome-copilot ⭐ 11,436 (+79) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social2 likes and reposts
- Oct 9, 2025I've enrolled the Awesome Copilot repo for #Hacktoberfest, so if you want to join the challenge, you now can with github.com/github/aweso... — @aaron-powell.com2 likes and reposts
- Nov 3, 2026📦 github / awesome-copilot ⭐ 40,747 (+52) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Oct 28, 2026📦 github / awesome-copilot ⭐ 40,463 (+45) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Sep 11, 2026📦 github / awesome-copilot ⭐ 38,893 (+53) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social1 likes and repost
- Mar 17, 2026Vous connaissez peut être le repository Github awesome-copilot (github.com/github/aweso...) contenant des skills, prompts, etc. pour Github… — @devdevdev.net1 likes and repost
- Feb 20, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 21,816 (+133) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Feb 5, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 20,129 (+137) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Jan 28, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 19,270 (+147) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Jan 15, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 17,630 (+180) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 31, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 15,940 (+100) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 20, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 github / awesome-copilot ⭐ 14,836 (+217) 🗒 JavaScript Community-contributed instructions, prompts,… — @github-trending.bsky.social1 likes and repost
- Dec 19, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 14,605 (+172) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Dec 6, 2025📦 github / awesome-copilot ⭐ 13,645 (+52) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending-js.bsky.social1 likes and repost
- Nov 23, 202511월의 남은 쿼터를 소진하기 위한 작업은 Chatmode + Agent 지원방법에 대한 공부. 이번달은 대부분 직접 코딩하거나, GPT5-mini를 사용했기 때문에 Sonnet 펑펑 돌리면서 공부해도 되겠다. Chatmode 기반으로 작업할때는… — @luncliff.bsky.social1 likes and repost
- Nov 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 11,788 (+110) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Nov 1, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 10,993 (+115) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social1 likes and repost
- Oct 1, 2025📦 github / awesome-copilot ⭐ 8,546 (+91) 🗒 JavaScript Community-contributed instructions, prompts, and configurations to help you make… — @github-trending.bsky.social1 likes and repost
- Sep 23, 2025Join the AMA at 4PM SF time, here: discord.gg/YZbkuKb3?eve... Check out the awesome-copilot repo, here: github.com/github/aweso... — @nonfamous.bsky.social1 likes and repost · 1 reply
- Aug 15, 2025Shape Copilot to your workflow. Use the Awesome-Copilot repo’s custom instructions, reusable prompts, and chat modes to get AI suggestions… — @martinrojas.dev1 likes and repost
- Jul 2, 2025Awesome GitHub Copilot Customizations github.com/github/aweso... #GitHub #Copilot #GitHubCopilot — @yzhums.bsky.social1 likes and repost
- Nov 19, 2026📦 github / awesome-copilot ⭐ 41,301 (+61) 🗒 JavaScript Community-contributed instructions, agents, skills, and configurations to help you… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Jan 22, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 github / awesome-copilot ⭐ 18,469 (+149) 🗒 JavaScript Community-contributed instructions, prompts, and… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On GitHub · 32
- Apr 12, 2026[Bug]: `npx skills update <skill-name>` adds all other skills from the skill repo — vercel-labs/skills46 reactions · 8 comments
- Jul 9, 2025Support for *.instructions.md files in IntelliJ for project-scoped Copilot customization — microsoft/copilot-intellij-feedback25 reactions · 9 comments
- Apr 26, 2026[Bug]: `npx skills update` downloads entire repository instead of specific skill when using subpaths — vercel-labs/skills6 reactions · 4 comments
- Jul 16, 2026docs(agent-skills): point the public catalog at the public org — chainguard-dev/edu2 reactions · 3 comments
- Jun 21, 2026[Feature]: Is there a way to specify .github/skills as the install location for skills? — vercel-labs/skills2 reactions
27 more on GitHub
- Oct 31, 2025Links to awesome-copilot are broken and result in 404 — github/docs2 reactions · 2 comments
- Nov 12, 2026https://github.com/github/awesome-copilot/blob/b13e55f85ffdf451d40d09839cb1e337bf3eda98/skills%2Fdebian-linux-triage%2FSKILL.md — CypherpunkArmory/UserLAnd1 reaction
- Oct 30, 2026feat(skills): add public Git installation to the CLI — alex-de-haas/docker-host1 reaction · 2 comments
- Oct 28, 2026docs(skills): correct the [dependabot skip] wording in the dependabot skill — docdyhr/mcp-wordpress1 reaction · 3 comments
- Sep 25, 2026Unblock learning-hub activation job by bumping blocked gh-aw compile version — Vbddr/awesome-copilot1 reaction · 1 comment
- Sep 24, 2026Automate agent package releases — socialbu/socialbu-agent1 reaction · 13 comments
- Sep 20, 2026fix(deps): clear Critical Dependabot alert for astro — Wicked-Sick-Ltd/awesome-copilot1 reaction
- Sep 20, 2026fix(security): CodeQL clear-text storage + hostBridge allowlist (#1–#2) — Wicked-Sick-Ltd/awesome-copilot1 reaction
- Sep 10, 2026Create Skill.md — 1napz/crystalcastleX1 reaction
- Sep 4, 2026fix(plugin): conform manifest to Agent Plugins 1.0.0 — BigCactusLabs/blotter1 reaction · 1 comment
- Aug 31, 2026fix(agents): launch Droid at High autonomy in yolo mode — stablyai/orca1 reaction · 3 comments
- Aug 21, 2026chore(skills): awesome-copilot update candidate 83561bd7 — KraineOpasen/bukerov-twitch-miner-go1 reaction
- Aug 10, 2026Bundled github-issues skill documents an unsafe shell-quoting pattern, and its locus is a synced file — devantler-tech/agent-plugins1 reaction · 1 comment
- Jul 23, 2026Plugin plan — charlyautomatiza/playwright-plugin1 reaction
- Jun 9, 2026Problem with the description length on using `az boards work-item create` — Azure/azure-cli1 reaction · 4 comments
- May 26, 2026[BUG] Unable to specify Skills/Agents when installing via the UI — runkids/skillshare1 reaction · 1 comment
- May 16, 2026[Ensure Agent skills follow the standards] — ralphke/Agentic-Coding1 reaction · 3 comments
- Apr 13, 2026Simplify, transfer/reorganize `.github/copilot-instructions.md` into `AGENTS.md` and other more appropriate agent context files — huanshankeji/compose-multiplatform-html-unified1 reaction · 1 comment
- Apr 9, 2026[broken-links] Broken external links detected (2 confirmed 404s) — htekdev/gh-aw-overview1 reaction
- Mar 31, 2026Add the awesome-copilot repo-architect agent to this repository — derecskey/valleypaintingco1 reaction
- Mar 22, 2026Add createagents.md skill — sparkfabrik/sf-agents-harness1 reaction
- Mar 22, 2026Code architecture inspection — davidamitchell/Research1 reaction
- Mar 10, 2026Git fatal: destination path error due to Windows long paths in Extensions view — microsoft/vscode1 reaction
- Mar 4, 2026Migrate to copilot-sdk — george-cz/ai-plan-comparator1 reaction
- Feb 6, 2026Add plugins for other Microsoft owned MCPs (Docs, playwright, etc). — github/copilot-plugins1 reaction · 2 comments
- Dec 25, 2025リポジトリ内の全ファイルの日本語への翻訳 — yamayuski/awesome-copilot1 reaction
- Oct 19, 2025File protocol handler for installing custom instructions, prompts, and chat modes — github/CopilotForXcode1 reaction
On Hacker News · 5
- Nov 11, 2025Copilot modes you probably didn't know exist4 points · 1 comment
- Aug 10, 2025Awesome-copilot: Community-contributed instructions, prompts, and configurations3 points
- Feb 17, 2026Rug – Repeat Until Good1 point
- Dec 22, 2025Gilfoyle code review agent skill that roasts your code1 point
- Oct 28, 2025GitHub Copilot Customizations1 point
In this repository448 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/repo-standardizer/templates/AGENTS.mdAGENTS.md
- skills/setup-my-iq/assets/templates/AGENTS.mdAGENTS.md
- skills/repo-standardizer/templates/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agentic-workflowsSkill
- code-reviewSkill
- create-canvas-extensionSkill
- acquire-codebase-knowledgeSkill
- acreadiness-assessSkill
- acreadiness-generate-instructionsSkill
- acreadiness-policySkill
- ad-campaign-analyzerSkill
- add-educational-commentsSkill
- adobe-illustrator-scriptingSkill
- agent-architectureSkill
- agent-governanceSkill
- agentic-evalSkill
- agent-owasp-complianceSkill
- agent-skill-stackSkill
- agent-supply-chainSkill
- ai-prompt-engineering-safety-reviewSkill
- ai-readySkill
- ai-team-orchestrationSkill
- anti-ui-slopSkill
- api-breaking-change-detectorSkill
- appinsights-instrumentationSkill
- apple-appstore-reviewerSkill
- architecture-blueprint-generatorSkill
- arch-linux-triageSkill
- arduino-azure-iot-edge-integrationSkill
- arize-ai-provider-integrationSkill
- arize-annotationSkill
- arize-datasetSkill
- arize-evaluatorSkill
- arize-experimentSkill
- arize-instrumentationSkill
- arize-linkSkill
- arize-prompt-optimizationSkill
- arize-traceSkill
- aspireSkill
- aspnet-minimal-api-openapiSkill
- audit-integritySkill
- automate-thisSkill
- autoresearchSkill
- aws-cdk-python-setupSkill
- aws-cloudwatch-investigationSkill
- aws-cost-optimizeSkill
- aws-resource-health-diagnoseSkill
- aws-resource-querySkill
- aws-well-architected-reviewSkill
- az-cost-optimizeSkill
- azure-architecture-autopilotSkill
- azure-container-registry-cliSkill
- azure-deployment-preflightSkill
- azure-developer-cliSkill
- azure-devops-cliSkill
- azure-pricingSkill
- azure-resource-health-diagnoseSkill
- azure-resource-visualizerSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
47 rules. About 0 are common, 21 are distinctive, and 26 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
26
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Use this skill when a user asks for help creating, improving, or publishing an IP geolocation feed file in CSV format.
- Distinctive: line 29
Use it to tune and troubleshoot CSV geolocation feeds — catching errors, suggesting improvements, and ensuring real-world usability beyond …
- Distinctive: line 55
All generated, temporary, and output files go in these directories:
- Very specific: line 67
All generated HTML reports: must be saved to ./run/report/.
- Very specific: line 68
All generated Python scripts: must be saved to ./run/.
- Very specific: line 70
Working directory for execution: All generated scripts in ./run/ must be executed with the skill root directory (the directory containing …
- Distinctive: line 75
All phases must be executed in order, from Phase 1 through Phase 6.
- Distinctive: line 93
Before executing each phase, the agent MUST generate a visible TODO checklist.
- Distinctive: line 98
Use a checkbox format
- Very specific: line 134
If the user has not already provided a list of IP subnets or ranges (sometimes referred to as inetnum or inet6num), prompt them to supply …
- Distinctive: line 139
If the input is a remote URL:
- Distinctive: line 143
Do not proceed to Phase 3 with an incomplete or empty download.
- Distinctive: line 145
If the input is a local file, process it directly without downloading.
- Very specific: line 149
If a UnicodeDecodeError is raised, try utf-8-sig (UTF-8 with BOM), then latin-1.
- Very specific: line 151
If no encoding succeeds, stop and report: Unable to decode input file.
- Distinctive: line 158
Do NOT combine this phase with others.
- Distinctive: line 159
Do NOT precompute future-phase data.
- Very specific: line 260
When adding messages to an entry, use the ID, Type, Text, and Checked values from this table.
- Very specific: line 284
When a validation check matches, add a message to the entry's Messages array using the values from the reference table:
- Distinctive: line 294
After populating all messages for an entry, derive the entry-level flags:
- Distinctive: line 317
Add or remove fields
- Distinctive: line 324
If a value is unknown, leave it empty — never invent data.
- Very specific: line 336
If pandas is available, use it for CSV parsing.
- Distinctive: line 339
Ensure the CSV contains exactly 4 or 5 logical columns.
- Distinctive: line 342
If no header row exists, assume the implicit column order:
- Distinctive: line 352
Write the output file with a UTF-8 BOM.
- Very specific: line 355
Remove comment rows where the first column begins with #.
- Distinctive: line 357
Create a map of comments using the 1-based line number as the key and the full original line as the value.
- Very specific: line 366
Check that the IPPrefix field is present and non-empty for each entry.
- Very specific: line 367
Check for duplicate IPPrefix values across entries.
- Very specific: line 368
If duplicates are found, stop the skill and report to the user with the message: Duplicate IP prefix detected: {ip_prefix_value} appears on …
- Distinctive: line 369
If no duplicates are found, continue with the analysis.
- Very specific: line 410
Use the locally available data table ISO3166-1 for checking.
- Very specific: line 417
Check the entry's CountryCode (RFC 8805 Section 2.1.1.2, column alpha2code) against the alpha_2 attribute.
- Very specific: line 420
If a country is found in assets/small-territories.json, mark the entry internally as a small territory.
- Very specific: line 448
If a RegionCode value is provided (RFC 8805 Section 2.1.1.3):
- Very specific: line 449
Check that the format matches {COUNTRY}-{SUBDIVISION} (e.g., US-CA, AU-NSW).
- Very specific: line 450
Check the value against the code attribute (already prefixed with the country code).
- Very specific: line 541
On MCP failure: If the MCP server is unreachable, returns an error, or returns no results for any batch, log a warning and continue to …
- Very specific: line 547
Read the Entries array. Each entry will be used to build the MCP lookup payload.
- Very specific: line 551
Create a deduplication map: { contentHash -> { rowKey, payload, entryIndices: [] } }.
- Very specific: line 552
If an entry's hash already exists, append its 0-based array index in Entries to that deduplication entry's entryIndices array.
- Distinctive: line 553
If hash is new, generate a UUID (rowKey) and create a new deduplication entry.
- Very specific: line 559
When writing the MCP payload file, include the rowKey field with each payload object:
- Very specific: line 569
When reading responses, match each response rowKey field to the corresponding deduplication entry to retrieve all associated entryIndices.
- Very specific: line 572
Write payload to: ./run/data/mcp-server-payload.json
- Distinctive: line 586
Use the discovered schema as the authoritative source for field names, types, and constraints.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Geofeed Tuner – Create Better IP Geolocation Feeds
This skill helps you create and improve IP geolocation feeds in CSV format by:
- Ensuring your CSV is well-formed and consistent
- Checking alignment with RFC 8805 (the industry standard)
- Applying opinionated best practices learned from real-world deployments
- Suggesting improvements for accuracy, completeness, and privacy
When to Use This Skill
- Use this skill when a user asks for help creating, improving, or publishing an IP geolocation feed file in CSV format.
- Use it to tune and troubleshoot CSV geolocation feeds — catching errors, suggesting improvements, and ensuring real-world usability beyond RFC compliance.
- Intended audience:
- Network operators, administrators, and engineers responsible for publicly routable IP address space
- Organizations such as ISPs, mobile carriers, cloud providers, hosting and colocation companies, Internet Exchange operators, and satellite internet providers
- Do not use this skill for private or internal IP address management; it applies only to publicly routable IP addresses.
Prerequisites
- Python 3 is required.
Directory Structure and File Management
This skill uses a clear separation between distribution files (read-only) and working files (generated at runtime).
Read-Only Directories (Do Not Modify)
The following directories contain static distribution assets. Do not create, modify, or delete files in these directories:
| Directory | Purpose |
assets/ | Static data files (ISO codes, examples) |
references/ | RFC specifications and code snippets for reference |
scripts/ | Executable code and HTML template files for reports |
Working Directories (Generated Content)
All generated, temporary, and output files go in these directories:
| Directory | Purpose |
run/ | Working directory for all agent-generated content |
run/data/ | Downloaded CSV files from remote URLs |
run/report/ | Generated HTML tuning reports |
File Management Rules
- Never write to
assets/,references/, orscripts/— these are part of the skill distribution and must remain unchanged. - All downloaded input files (from remote URLs) must be saved to
./run/data/. - All generated HTML reports must be saved to
./run/report/. - All generated Python scripts must be saved to
./run/. - The
run/directory may be cleared between sessions; do not store permanent data there. - Working directory for execution: All generated scripts in
./run/must be executed with the skill root directory (the directory containingSKILL.md) as the current working directory, so that relative paths likeassets/iso3166-1.jsonand./run/data/report-data.jsonresolve correctly. Do notcdinto./run/before running scripts.
Processing Pipeline: Sequential Phase Execution
All phases must be executed in order, from Phase 1 through Phase 6. Each phase depends on the successful completion of the previous phase. For example, structure checks must complete before quality analysis can run.
The phases are summarized below. The agent must follow the detailed steps outlined further in each phase section.
| Phase | Name | Description |
| 1 | Understand the Standard | Review the key requirements of RFC 8805 for self-published IP geolocation feeds |
| 2 | Gather Input | Collect IP subnet data from local files or remote URLs |
| 3 | Checks & Suggestions | Validate CSV structure, analyze IP prefixes, and check data quality |
| 4 | Tuning Data Lookup | Use Fastah's MCP tool to retrieve tuning data for improving geolocation accuracy |
| 5 | Generate Tuning Report | Create an HTML report summarizing the analysis and suggestions |
| 6 | Final Review | Verify consistency and completeness of the report data |
Do not skip phases. Each phase provides critical checks or data transformations required by subsequent stages.
Execution Plan Rules
Before executing each phase, the agent MUST generate a visible TODO checklist.
The plan MUST:
- Appear at the very start of the phase
- List every step in order
- Use a checkbox format
- Be updated live as steps complete
Phase 1: Understand the Standard
The key requirements from RFC 8805 that this skill enforces are summarized below. Use this summary as your working reference. Only consult the full RFC 8805 text for edge cases, ambiguous situations, or when the user asks a standards question not covered here.
RFC 8805 Key Facts
Purpose: A self-published IP geolocation feed lets network operators publish authoritative location data for their IP address space in a simple CSV format, allowing geolocation providers to incorporate operator-supplied corrections.
CSV Column Order (Sections 2.1.1.1–2.1.1.5):
| Column | Field | Required | Notes |
| 1 | ip_prefix | Yes | CIDR notation; IPv4 or IPv6; must be a network address |
| 2 | alpha2code | No | ISO 3166-1 alpha-2 country code; empty or "ZZ" = do-not-geolocate |
| 3 | region | No | ISO 3166-2 subdivision code (e.g., US-CA) |
| 4 | city | No | Free-text city name; no authoritative validation set |
| 5 | postal_code | No | Deprecated — must be left empty or absent |
Structural rules:
- Files may contain comment lines beginning with
#(including the header, if present). - A header row is optional; if present, it is treated as a comment if it starts with
#. - Files must be encoded in UTF-8.
- Subnet host bits must not be set (i.e.,
192.168.1.1/24is invalid; use192.168.1.0/24). - Applies only to globally routable unicast addresses — not private, loopback, link-local, or multicast space.
Do-not-geolocate: An entry with an empty alpha2code or case-insensitive ZZ (irrespective of values of region/city) is an explicit signal that the operator does not want geolocation applied to that prefix.
Postal codes deprecated (Section 2.1.1.5): The fifth column must not contain postal or ZIP codes. They are too fine-grained for IP-range mapping and raise privacy concerns.
Phase 2: Gather Input
- If the user has not already provided a list of IP subnets or ranges (sometimes referred to as
inetnumorinet6num), prompt them to supply it. Accepted input formats:- Text pasted into the chat
- A local CSV file
- A remote URL pointing to a CSV file
- If the input is a remote URL:
- Attempt to download the CSV file to
./run/data/before processing. - On HTTP error (4xx, 5xx, timeout, or redirect loop), stop immediately and report to the user:
Feed URL is not reachable: HTTP {status_code}. Please verify the URL is publicly accessible. - Do not proceed to Phase 3 with an incomplete or empty download.
- Attempt to download the CSV file to
- If the input is a local file, process it directly without downloading.
- Encoding detection and normalization:
- Attempt to read the file as UTF-8 first.
- If a
UnicodeDecodeErroris raised, tryutf-8-sig(UTF-8 with BOM), thenlatin-1. - Once successfully decoded, re-encode and write the working copy as UTF-8.
- If no encoding succeeds, stop and report:
Unable to decode input file. Please save it as UTF-8 and try again.
Phase 3: Checks & Suggestions
Execution Rules
- Generate a script for this phase.
- Do NOT combine this phase with others.
- Do NOT precompute future-phase data.
- Store the output as a JSON file at:
./run/data/report-data.json
Schema Definition
The JSON structure below is IMMUTABLE during Phase 3. Phase 4 will later add a TunedEntry object to each object in Entries — this is the only permitted schema extension and happens in a separate phase.
JSON keys map directly to template placeholders like {{.CountryCode}}, {{.HasError}}, etc.
{
"InputFile": "",
"Timestamp": 0,
"TotalEntries": 0,
"IpV4Entries": 0,
"IpV6Entries": 0,
"InvalidEntries": 0,
"Errors": 0,
"Warnings": 0,
"OK": 0,
"Suggestions": 0,
"CityLevelAccuracy": 0,
"RegionLevelAccuracy": 0,
"CountryLevelAccuracy": 0,
"DoNotGeolocate": 0,
"Entries": [
{
"Line": 0,
"IPPrefix": "",
"CountryCode": "",
"RegionCode": "",
"City": "",
"Status": "",
"IPVersion": "",
"Messages": [
{
"ID": "",
"Type": "",
"Text": "",
"Checked": false
}
],
"HasError": false,
"HasWarning": false,
"HasSuggestion": false,
"DoNotGeolocate": false,
"GeocodingHint": "",
"Tunable": false
}
]
}Field definitions:
Top-level metadata:
InputFile: The original input source, either a local filename or a remote URL.Timestamp: Milliseconds since Unix epoch when the tuning was performed.TotalEntries: Total number of data rows processed (excluding comment and blank lines).IpV4Entries: Count of entries that are IPv4 subnets.IpV6Entries: Count of entries that are IPv6 subnets.InvalidEntries: Count of entries that failed IP prefix parsing and CSV parsing.Errors: Total entries whoseStatusisERROR.Warnings: Total entries whoseStatusisWARNING.OK: Total entries whoseStatusisOK.Suggestions: Total entries whoseStatusisSUGGESTION.CityLevelAccuracy: Count of valid entries whereCityis non-empty.RegionLevelAccuracy: Count of valid entries whereRegionCodeis non-empty andCityis empty.CountryLevelAccuracy: Count of valid entries whereCountryCodeis non-empty,RegionCodeis empty, andCityis empty.DoNotGeolocate(metadata): Count of valid entries whereCountryCode,RegionCode, andCityare all empty.
Entry fields:
Entries: Array of objects, one per data row, with the following per-entry fields:Line: 1-based line number in the original CSV (counting all lines including comments and blanks).IPPrefix: The normalized IP prefix in CIDR slash notation.CountryCode: The ISO 3166-1 alpha-2 country code, or empty string.RegionCode: The ISO 3166-2 region code (e.g.,US-CA), or empty string.City: The city name, or empty string.Status: Highest severity assigned:ERROR>WARNING>SUGGESTION>OK.IPVersion:"IPv4"or"IPv6"based on the parsed IP prefix.Messages: Array of message objects, each with:ID: String identifier from the Validation Rules Reference table below (e.g.,"1101","3301").Type: The severity type:"ERROR","WARNING", or"SUGGESTION".Text: The human-readable validation message string.Checked:trueif the validation rule is auto-tunable (Tunable: truein the reference table),falseotherwise. Controls whether the checkbox in the report ischeckedordisabled.
HasError:trueif any message hasType"ERROR".HasWarning:trueif any message hasType"WARNING".HasSuggestion:trueif any message hasType"SUGGESTION".DoNotGeolocate(entry):trueifCountryCodeis empty or"ZZ"— the entry is an explicit do-not-geolocate signal.GeocodingHint: Always empty string""in Phase 3. Reserved for future use.Tunable:trueif any message in the entry hasChecked: true. Computed as logical OR across all messages'Checkedvalues. This flag drives the "Tune" button visibility in the report.
Validation Rules Reference
When adding messages to an entry, use the ID, Type, Text, and Checked values from this table.
| ID | Type | Text | Checked | Condition Reference |
1101 | ERROR | IP prefix is empty | false | IP Prefix Analysis: empty |
1102 | ERROR | Invalid IP prefix: unable to parse as IPv4 or IPv6 network | false | IP Prefix Analysis: invalid syntax |
1103 | ERROR | Non-public IP range is not allowed in an RFC 8805 feed | false | IP Prefix Analysis: non-public |
3101 | SUGGESTION | IPv4 prefix is unusually large and may indicate a typo | false | IP Prefix Analysis: IPv4 < /22 |
3102 | SUGGESTION | IPv6 prefix is unusually large and may indicate a typo | false | IP Prefix Analysis: IPv6 < /64 |
1201 | ERROR | Invalid country code: not a valid ISO 3166-1 alpha-2 value | true | Country Code Analysis: invalid |
1301 | ERROR | Invalid region format; expected COUNTRY-SUBDIVISION (e.g., US-CA) | true | Region Code Analysis: bad format |
1302 | ERROR | Invalid region code: not a valid ISO 3166-2 subdivision | true | Region Code Analysis: unknown code |
1303 | ERROR | Region code does not match the specified country code | true | Region Code Analysis: mismatch |
1401 | ERROR | Invalid city name: placeholder value is not allowed | false | City Name Analysis: placeholder |
1402 | ERROR | Invalid city name: abbreviated or code-based value detected | true | City Name Analysis: abbreviation |
2401 | WARNING | City name formatting is inconsistent; consider normalizing the value | true | City Name Analysis: formatting |
1501 | ERROR | Postal codes are deprecated by RFC 8805 and must be removed for privacy reasons | true | Postal Code Check |
3301 | SUGGESTION | Region is usually unnecessary for small territories; consider removing the region value | true | Tuning: small territory region |
3402 | SUGGESTION | City-level granularity is usually unnecessary for small territories; consider removing the city value | true | Tuning: small territory city |
3303 | SUGGESTION | Region code is recommended when a city is specified; choose a region from the dropdown | true | Tuning: missing region with city |
3104 | SUGGESTION | Confirm whether this subnet is intentionally marked as do-not-geolocate or missing location data | true | Tuning: unspecified geolocation |
Populating Messages
When a validation check matches, add a message to the entry's Messages array using the values from the reference table:
entry["Messages"].append({
"ID": "1201", # From the table
"Type": "ERROR", # From the table
"Text": "Invalid country code: not a valid ISO 3166-1 alpha-2 value", # From the table
"Checked": True # From the table (True = tunable)
})After populating all messages for an entry, derive the entry-level flags:
entry["HasError"] = any(m["Type"] == "ERROR" for m in entry["Messages"])
entry["HasWarning"] = any(m["Type"] == "WARNING" for m in entry["Messages"])
entry["HasSuggestion"] = any(m["Type"] == "SUGGESTION" for m in entry["Messages"])
entry["Tunable"] = any(m["Checked"] for m in entry["Messages"])Accuracy Level Counting Rules
Accuracy levels are mutually exclusive. Assign each valid (non-ERROR, non-invalid) entry to exactly one bucket based on the most granular non-empty geo field:
| Condition | Bucket |
City is non-empty | CityLevelAccuracy |
RegionCode non-empty AND City is empty | RegionLevelAccuracy |
CountryCode non-empty, RegionCode and City empty | CountryLevelAccuracy |
DoNotGeolocate (entry) is true | DoNotGeolocate (metadata) |
Do not count entries with HasError: true or entries in InvalidEntries in any accuracy bucket.
The agent MUST NOT:
- Rename fields
- Add or remove fields
- Change data types
- Reorder keys
- Alter nesting
- Wrap the object
- Split into multiple files
If a value is unknown, leave it empty — never invent data.
Structure & Format Check
This phase verifies that your feed is well-formed and parseable. Critical structural errors must be resolved before the tuner can analyze geolocation quality.
CSV Structure
This subsection defines rules for CSV-formatted input files used for IP geolocation feeds. The goal is to ensure the file can be parsed reliably and normalized into a consistent internal representation.
- CSV Structure Checks
- If
pandasis available, use it for CSV parsing. - Otherwise, fall back to Python's built-in
csvmodule. - Ensure the CSV contains exactly 4 or 5 logical columns.
- Comment lines are allowed.
- A header row may or may not be present.
- If no header row exists, assume the implicit column order:
ip_prefix, alpha2code, region, city, postal code (deprecated) - Refer to the example input file:
assets/example/01-user-input-rfc8805-feed.csv
- If
- CSV Cleansing and Normalization
- Clean and normalize the CSV using Python logic equivalent to the following operations:
- Select only the first five columns, dropping any columns beyond the fifth.
- Write the output file with a UTF-8 BOM.
- Comments
- Remove comment rows where the first column begins with
#. - This also removes a header row if it begins with
#. - Create a map of comments using the 1-based line number as the key and the full original line as the value. Also store blank lines.
- Store this map in a JSON file at:
./run/data/comments.json - Example:
{ "4": "# It's OK for small city states to leave state ISO2 code unspecified" }
- Remove comment rows where the first column begins with
- Clean and normalize the CSV using Python logic equivalent to the following operations:
- Notes
- Both implementation paths (
pandasand built-incsv) must write output using theutf-8-sigencoding to ensure a UTF-8 BOM is present.
- Both implementation paths (
IP Prefix Analysis
- Check that the
IPPrefixfield is present and non-empty for each entry. - Check for duplicate
IPPrefixvalues across entries. - If duplicates are found, stop the skill and report to the user with the message:
Duplicate IP prefix detected: {ip_prefix_value} appears on lines {line_numbers} - If no duplicates are found, continue with the analysis.
- Checks
- Each subnet must parse cleanly as either an IPv4 or IPv6 network using the code snippets in the
references/folder. - Subnets must be normalized and displayed in CIDR slash notation.
- Single-host IPv4 subnets must be represented as
/32. - Single-host IPv6 subnets must be represented as
/128.
- Single-host IPv4 subnets must be represented as
- Each subnet must parse cleanly as either an IPv4 or IPv6 network using the code snippets in the
- ERROR
- Report the following conditions as ERROR:
- Invalid subnet syntax
- Message ID:
1102
- Message ID:
- Non-public address space
- Applies to subnets that are private, loopback, link-local, multicast, or otherwise non-public
- In Python, detect non-public ranges using
is_privateand related address properties as shown in./references.
- In Python, detect non-public ranges using
- Message ID:
1103
- Applies to subnets that are private, loopback, link-local, multicast, or otherwise non-public
- SUGGESTION
- Report the following conditions as SUGGESTION:
- Overly large IPv6 subnets
- Prefixes shorter than
/64 - Message ID:
3102
- Prefixes shorter than
- Overly large IPv4 subnets
- Prefixes shorter than
/22 - Message ID:
3101
- Prefixes shorter than
Geolocation Quality Check
Analyze the accuracy and consistency of geolocation data:
- Country codes
- Region codes
- City names
- Deprecated fields
This phase runs after structural checks pass.
Country Code Analysis
- Use the locally available data table
ISO3166-1for checking.- JSON array of countries and territories with ISO codes
- Each object includes:
alpha_2: two-letter country codename: short country nameflag: flag emoji
- This file represents the superset of valid
CountryCodevalues for an RFC 8805 CSV.
- Check the entry's
CountryCode(RFC 8805 Section 2.1.1.2, columnalpha2code) against thealpha_2attribute. - Sample code is available in the
references/directory. - If a country is found in
assets/small-territories.json, mark the entry internally as a small territory. This flag is used in later checks and suggestions but is not stored in the output JSON (it is transient validation state). - Note:
small-territories.jsoncontains some historic/disputed codes (AN,CS,XK) that are not present iniso3166-1.json. An entry using one of these as itsCountryCodewill fail the country code validation (ERROR) even though it matches as a small territory. The country code ERROR takes precedence — do not suppress it based on the small-territory flag. - ERROR
- Report the following conditions as ERROR:
- Invalid country code
- Condition:
CountryCodeis present but not found in thealpha_2set - Message ID:
1201
- Condition:
- SUGGESTION
- Report the following conditions as SUGGESTION:
- Unspecified geolocation for subnet
- Condition: All geographical fields (
CountryCode,RegionCode,City) are empty for a subnet. - Action:
- Set
DoNotGeolocate = truefor the entry. - Set
CountryCodetoZZfor the entry.
- Set
- Message ID:
3104
- Condition: All geographical fields (
Region Code Analysis
- Use the locally available data table
ISO3166-2for checking.- JSON array of country subdivisions with ISO-assigned codes
- Each object includes:
code: subdivision code prefixed with country code (e.g.,US-CA)name: short subdivision name
- This file represents the superset of valid
RegionCodevalues for an RFC 8805 CSV.
- If a
RegionCodevalue is provided (RFC 8805 Section 2.1.1.3):- Check that the format matches
{COUNTRY}-{SUBDIVISION}(e.g.,US-CA,AU-NSW). - Check the value against the
codeattribute (already prefixed with the country code).
- Check that the format matches
- Small-territory exception: If the entry is a small territory and the
RegionCodevalue equals the entry'sCountryCode(e.g.,SGas both country and region for Singapore), treat the region as acceptable — skip all region validation checks for this entry. Small territories are effectively city-states with no meaningful ISO 3166-2 administrative subdivisions. - ERROR
- Report the following conditions as ERROR:
- Invalid region format
- Condition:
RegionCodedoes not match{COUNTRY}-{SUBDIVISION}and the small-territory exception does not apply - Message ID:
1301
- Condition:
- Unknown region code
- Condition:
RegionCodevalue is not found in thecodeset and the small-territory exception does not apply - Message ID:
1302
- Condition:
- Country–region mismatch
- Condition: Country portion of
RegionCodedoes not matchCountryCode - Message ID:
1303
- Condition: Country portion of
City Name Analysis
- City names are validated using heuristic checks only.
- There is currently no authoritative dataset available for validating city names.
- ERROR
- Report the following conditions as ERROR:
- Placeholder or non-meaningful values
- Condition: Placeholder or non-meaningful values including but not limited to:
undefinedPlease selectnullN/ATBDunknown
- Message ID:
1401
- Condition: Placeholder or non-meaningful values including but not limited to:
- Truncated names, abbreviations, or airport codes
- Condition: Truncated names, abbreviations, or airport codes that do not represent valid city names:
LAFrftsin01LHRSINMAA
- Message ID:
1402
- Condition: Truncated names, abbreviations, or airport codes that do not represent valid city names:
- WARNING
- Report the following conditions as WARNING:
- Inconsistent casing or formatting
- Condition: City names with inconsistent casing, spacing, or formatting that may reduce data quality, for example:
HongKongvsHong Kong- Mixed casing or unexpected script usage
- Message ID:
2401
- Condition: City names with inconsistent casing, spacing, or formatting that may reduce data quality, for example:
Postal Code Check
- RFC 8805 Section 2.1.1.5 explicitly deprecates postal or ZIP codes.
- Postal codes can represent very small populations and are not considered privacy-safe for mapping IP address ranges, which are statistical in nature.
- ERROR
- Report the following conditions as ERROR:
- Postal code present
- Condition: A non-empty value is present in the postal/ZIP code field.
- Message ID:
1501
Tuning & Recommendations
This phase applies opinionated recommendations beyond RFC 8805, learned from real-world geofeed deployments, that improve accuracy and usability.
- SUGGESTION
- Report the following conditions as SUGGESTION:
- Region or city specified for small territory
- Condition:
- Entry is a small territory
RegionCodeis non-empty ORCityis non-empty.
- Message IDs:
3301(for region),3402(for city)
- Condition:
- Missing region code when city is specified
- Condition:
Cityis non-emptyRegionCodeis empty- Entry is not a small territory
- Message ID:
3303
- Condition:
Phase 4: Tuning Data Lookup
Objective
Lookup all the Entries using Fastah's rfc8805-row-place-search tool.
Execution Rules
- Generate a new script only for payload generation (read the dataset and write one or more payload JSON files; do not call MCP from this script).
- Server only accepts 1000 entries per request, so if there are more than 1000 entries, split into multiple requests.
- The agent must read the generated payload files, construct the requests from them, and send those requests to the MCP server in batches of at most 1000 entries each.
- On MCP failure: If the MCP server is unreachable, returns an error, or returns no results for any batch, log a warning and continue to Phase 5. Set
TunedEntry: {}for all affected entries. Do not block report generation. Notify the user clearly:Tuning data lookup unavailable; the report will show validation results only. - Suggestions are advisory only — never auto-populate them.
Step 1: Build Lookup Payload with Deduplication
Load the dataset from: ./run/data/report-data.json
- Read the
Entriesarray. Each entry will be used to build the MCP lookup payload.
Reduce server requests by deduplicating identical entries:
- For each entry in
Entries, compute a content hash (hash ofCountryCode+RegionCode+City). - Create a deduplication map:
{ contentHash -> { rowKey, payload, entryIndices: [] } }. rowKey is a UUID that will be sent to the MCP server for matching responses. - If an entry's hash already exists, append its 0-based array index in
Entriesto that deduplication entry'sentryIndicesarray. - If hash is new, generate a UUID (rowKey) and create a new deduplication entry.
Build request batches:
- Extract unique deduplicated entries from the map, keeping them in deduplication order.
- Build request batches of up to 1000 items each.
- For each batch, keep an in-memory structure like
[{ rowKey, payload, entryIndices }, ...]to match responses back by rowKey. - When writing the MCP payload file, include the
rowKeyfield with each payload object:
[
{"rowKey": "550e8400-e29b-41d4-a716-446655440000", "countryCode":"CA","regionCode":"CA-ON","cityName":"Toronto"},
{"rowKey": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "countryCode":"IN","regionCode":"IN-KA","cityName":"Bangalore"},
{"rowKey": "6ba7b811-9dad-11d1-80b4-00c04fd430c8", "countryCode":"IN","regionCode":"IN-KA"}
]- When reading responses, match each response
rowKeyfield to the corresponding deduplication entry to retrieve all associatedentryIndices.
Rules:
- Write payload to:
./run/data/mcp-server-payload.json - Exit the script after writing the payload.
Step 2: Invoke Fastah MCP Tool
- An example
mcp.jsonstyle configuration of Fastah MCP server is as follows:
"fastah-ip-geofeed": {
"type": "http",
"url": "https://mcp.fastah.ai/mcp"
}- Server:
https://mcp.fastah.ai/mcp - Tool and its Schema: before the first
tools/call, the agent MUST send atools/listrequest to read the input and output schema forrfc8805-row-place-search. Use the discovered schema as the authoritative source for field names, types, and constraints. The following is an illustrative example only; always defer to the schema returned by
tools/list:[ {"rowKey": "550e8400-...", "countryCode":"CA", ...}, {"rowKey": "690e9301-...", "countryCode":"ZZ", ...} ]- Open
./run/data/mcp-server-payload.jsonand send all deduplicated entries with their rowKeys. - If there are more than 1000 deduplicated entries after deduplication, split into multiple requests of 1000 entries each.
- The server will respond with the same
rowKeyfield in each response for mapping back. - Do NOT use local data.
Step 3: Attach Tuned Data to Entries
- Generate a new script for attaching tuned data.
- Load both
./run/data/report-data.jsonand the deduplication map (held in memory from Step 1, or re-derived from the payload file). - For each response from the MCP server:
- Extract the
rowKeyfrom the response. - Look up the
entryIndicesarray associated with thatrowKeyfrom the deduplication map. - For each index in
entryIndices, attach the best match toEntries[index].
- Extract the
- Use the first (best) match from the response when available.
Create the field on each affected entry if it does not exist. Remap the MCP API response keys to Go struct field names:
"TunedEntry": {
"Name": "",
"CountryCode": "",
"RegionCode": "",
"PlaceType": "",
"H3Cells": [],
"BoundingBox": []
}The TunedEntry field is a single object (not an array). It holds the best match from the MCP server.
MCP response key → JSON key mapping:
| MCP API response key | JSON key |
placeName | Name |
countryCode | CountryCode |
stateCode | RegionCode |
placeType | PlaceType |
h3Cells | H3Cells |
boundingBox | BoundingBox |
Entries with no UUID match (i.e. the MCP server returned no response for their UUID) must receive an empty TunedEntry: {} object — never leave the field absent.
- Write the dataset back to:
./run/data/report-data.json - Rules:
- Maintain all existing validation flags.
- Do NOT create additional intermediate files.
Phase 5: Generate Tuning Report
Generate a self-contained HTML report by rendering the template at ./scripts/templates/index.html with data from ./run/data/report-data.json and ./run/data/comments.json.
Write the completed report to ./run/report/geofeed-report.html. After generating, attempt to open it in the system's default browser (e.g., webbrowser.open()). If running in a headless environment, CI pipeline, or remote container where no browser is available, skip the browser step and instead present the file path to the user so they can open or download it.
The template uses Go html/template syntax ({{.Field}}, {{range}}, {{if eq}}, etc.). Write a Python script that reads the template, builds a rendering context from the JSON data files, and processes the template placeholders to produce final HTML. Do not modify the template file itself — all processing happens in the Python script at render time.
Step 1: Replace Metadata Placeholders
Replace each {{.Metadata.X}} placeholder in the template with the corresponding value from report-data.json. Since JSON keys match the template placeholder, the mapping is direct — {{.Metadata.InputFile}} maps to the InputFile JSON key, etc.
| Template placeholder | JSON key (report-data.json) |
{{.Metadata.InputFile}} | InputFile |
{{.Metadata.Timestamp}} | Timestamp |
{{.Metadata.TotalEntries}} | TotalEntries |
{{.Metadata.IpV4Entries}} | IpV4Entries |
{{.Metadata.IpV6Entries}} | IpV6Entries |
{{.Metadata.InvalidEntries}} | InvalidEntries |
{{.Metadata.Errors}} | Errors |
{{.Metadata.Warnings}} | Warnings |
{{.Metadata.Suggestions}} | Suggestions |
{{.Metadata.OK}} | OK |
{{.Metadata.CityLevelAccuracy}} | CityLevelAccuracy |
{{.Metadata.RegionLevelAccuracy}} | RegionLevelAccuracy |
{{.Metadata.CountryLevelAccuracy}} | CountryLevelAccuracy |
{{.Metadata.DoNotGeolocate}} | DoNotGeolocate (metadata) |
Note on {{.Metadata.Timestamp}}: This placeholder appears inside a JavaScript new Date(...) call. Replace it with the raw integer value (no HTML escaping needed for a numeric literal inside <script>). All other metadata values should be HTML-escaped since they appear inside HTML element text.
Step 2: Replace the Comment Map Placeholder
Locate this pattern in the template:
const commentMap = {{.Comments}};Replace {{.Comments}} with the serialized JSON object from ./run/data/comments.json. The JSON is embedded directly as a JavaScript object literal (not inside a string), so no extra escaping is needed:
comments_json = json.dumps(comments)
template = template.replace("{{.Comments}}", comments_json)Step 3: Expand the Entries Range Block
The template contains a {{range .Entries}}...{{end}} block inside <tbody id="entriesTableBody">. Process it as follows:
- Extract the range block body using regex. Critical: The block contains nested
{{end}}tags (from{{if eq .Status ...}},{{if .Checked}}, and{{range .Messages}}). A naive non-greedy match like\{\{range \.Entries\}\}(.*?)\{\{end\}\}will match the first inner{{end}}, truncating the block. Instead, anchor the outer{{end}}to the</tbody>that follows it:
This ensures you capture the full block body including all threem = re.search( r'\{\{range \.Entries\}\}(.*?)\{\{end\}\}\s*</tbody>', template, re.DOTALL, ) entry_body = m.group(1) # template text for one entry iteration<tr>rows and the nested{{range .Messages}}...{{end}}. - Iterate over each entry in
report-data.json'sEntriesarray. - Expand the block body for each entry using the processing order below.
- Replace the entire match (from
{{range .Entries}}through</tbody>) with the concatenated expanded HTML followed by</tbody>.
Processing order for each entry (innermost constructs first to avoid {{end}} confusion):
- Evaluate
{{if eq .Status ...}}...{{end}}conditionals (status badge class and icon). - Evaluate
{{if .Checked}}...{{end}}conditional (message checkbox). - Expand
{{range .Messages}}...{{end}}inner range. - Replace simple
{{.Field}}placeholders.
Entry Field Mapping
Within the range block body, replace these placeholders for each entry. Since JSON keys match the template placeholder, the template placeholder {{.X}} maps directly to JSON key X:
| Template placeholder | JSON key (Entries[]) | Notes |
{{.Line}} | Line | Direct integer value |
{{.IPPrefix}} | IPPrefix | HTML-escaped |
{{.CountryCode}} | CountryCode | HTML-escaped |
{{.RegionCode}} | RegionCode | HTML-escaped |
{{.City}} | City | HTML-escaped |
{{.Status}} | Status | HTML-escaped |
{{.HasError}} | HasError | Lowercase string: "true" or "false" |
{{.HasWarning}} | HasWarning | Lowercase string: "true" or "false" |
{{.HasSuggestion}} | HasSuggestion | Lowercase string: "true" or "false" |
{{.GeocodingHint}} | GeocodingHint | Empty string "" |
{{.DoNotGeolocate}} | DoNotGeolocate | "true" or "false" |
{{.Tunable}} | Tunable | "true" or "false" |
{{.TunedEntry.CountryCode}} | TunedEntry.CountryCode | "" if TunedEntry is empty {} |
{{.TunedEntry.RegionCode}} | TunedEntry.RegionCode | "" if TunedEntry is empty {} |
{{.TunedEntry.Name}} | TunedEntry.Name | "" if TunedEntry is empty {} |
{{.TunedEntry.H3Cells}} | TunedEntry.H3Cells | Bracket-wrapped space-separated; "[]" if empty (see format below) |
{{.TunedEntry.BoundingBox}} | TunedEntry.BoundingBox | Bracket-wrapped space-separated; "[]" if empty (see format below) |
data-h3-cells and data-bounding-box format: These are NOT JSON arrays. They are bracket-wrapped, space-separated values. Do not use JSON serialization (no quotes around string elements, no commas between numbers). Examples:
[836752fffffffff 836755fffffffff]— correct["836752fffffffff","836755fffffffff"]— WRONG, quotes will break parsing[-71.70 10.73 -71.52 10.55]— correct[]— correct for empty
Evaluating Status Conditionals
Process these BEFORE replacing simple {{.Field}} placeholders — otherwise the {{end}} markers get consumed and the regex won't match.
The template uses {{if eq .Status "..."}} conditionals for the status badge CSS class and icon. Evaluate these by checking the entry's status value and keeping only the matching branch text.
The status badge line contains two {{if eq .Status ...}}...{{end}} blocks on a single line — one for the CSS class, one for the icon. Use re.sub with a callback to resolve all occurrences:
STATUS_CSS = {"ERROR": "error", "WARNING": "warning", "SUGGESTION": "suggestion", "OK": "ok"}
STATUS_ICON = {
"ERROR": "bi-x-circle-fill",
"WARNING": "bi-exclamation-triangle-fill",
"SUGGESTION": "bi-lightbulb-fill",
"OK": "bi-check-circle-fill",
}
def resolve_status_if(match_obj, status):
"""Pick the branch matching `status` from a {{if eq .Status ...}}...{{end}} block."""
block = match_obj.group(0)
# Try each branch: {{if eq .Status "X"}}val{{else if ...}}val{{else}}val{{end}}
for st, val in [("ERROR",), ("WARNING",), ("SUGGESTION",)]:
# not needed to parse generically — just map from the known patterns
...A simpler approach: since there are exactly two known patterns, replace them as literal strings:
css_class = STATUS_CSS.get(status, "ok")
icon_class = STATUS_ICON.get(status, "bi-check-circle-fill")
body = body.replace(
'{{if eq .Status "ERROR"}}error{{else if eq .Status "WARNING"}}warning{{else if eq .Status "SUGGESTION"}}suggestion{{else}}ok{{end}}',
css_class,
)
body = body.replace(
'{{if eq .Status "ERROR"}}bi-x-circle-fill{{else if eq .Status "WARNING"}}bi-exclamation-triangle-fill{{else if eq .Status "SUGGESTION"}}bi-lightbulb-fill{{else}}bi-check-circle-fill{{end}}',
icon_class,
)This avoids regex entirely and is safe because these exact strings appear verbatim in the template.
Step 4: Expand the Nested Messages Range
The {{range .Messages}}...{{end}} block contains a nested {{if .Checked}} checked{{else}} disabled{{end}} conditional, so its inner {{end}} would cause a simple non-greedy regex to match too early. Anchor the regex to </td> (the tag immediately after the messages range closing {{end}}) to capture the full block body:
msg_match = re.search(
r'\{\{range \.Messages\}\}(.*?)\{\{end\}\}\s*(?=</td>)',
body, re.DOTALL
)The lookahead (?=</td>) ensures the regex skips past the checkbox conditional's {{end}} (which is followed by >, not </td>) and matches only the range-closing {{end}} (which is followed by whitespace then </td>).
For each message in the entry's Messages array, clone the captured block body and expand it:
- Resolve the checkbox conditional per message (must happen before simple placeholder replacement to remove the nested
{{end}}):if msg.get("Checked"): msg_body = msg_body.replace( '{{if .Checked}} checked{{else}} disabled{{end}}', ' checked' ) else: msg_body = msg_body.replace( '{{if .Checked}} checked{{else}} disabled{{end}}', ' disabled' ) Replace message field placeholders:
Template placeholder Source Notes {{.ID}}Messages[i].IDDirect string value from JSON {{.Text}}Messages[i].TextHTML-escaped - Concatenate all expanded message blocks and replace the original
{{range .Messages}}...{{end}}match (msg_match.group(0)) with the result:body = body[:msg_match.start()] + "".join(expanded_msgs) + body[msg_match.end():]
If Messages is empty, replace the entire matched region with an empty string (no message divs — only the issues header remains).
Output Guarantees
- The report must be readable in any modern browser without extra network dependencies beyond the CDN links already in the template (
leaflet,h3-js,bootstrap-icons, Raleway font). - All values embedded in HTML must be HTML-escaped (
<,>,&,") to prevent rendering issues. commentMapis embedded as a direct JavaScript object literal (not inside a string), so no JS string escaping is needed — just emit valid JSON.- All values must be derived only from analysis output, not recomputed heuristically.
Phase 6: Final Review
Perform a final verification pass using concrete, checkable assertions before presenting results to the user.
Check 1 — Entry count integrity
- Count non-comment, non-blank data rows in the original input CSV.
- Assert:
len(entries) in report-data.json == data_row_count - On failure:
Row count mismatch: input has {N} data rows but report contains {M} entries.
Check 2 — Summary counter integrity
- These counters use mutual exclusion based on the boolean flags, which mirrors the highest-severity
Statusfield. An entry with bothHasError: trueandHasWarning: trueis counted only inErrors, never inWarnings. This is equivalent to counting by the entry'sStatusfield. - Assert all of the following; correct any that fail before generating the report:
Errors == sum(1 for e in Entries if e['HasError'])Warnings == sum(1 for e in Entries if e['HasWarning'] and not e['HasError'])Suggestions == sum(1 for e in Entries if e['HasSuggestion'] and not e['HasError'] and not e['HasWarning'])OK == sum(1 for e in Entries if not e['HasError'] and not e['HasWarning'] and not e['HasSuggestion'])Errors + Warnings + Suggestions + OK == TotalEntries - InvalidEntries
Check 3 — Accuracy bucket integrity
- Assert:
CityLevelAccuracy + RegionLevelAccuracy + CountryLevelAccuracy + DoNotGeolocate == TotalEntries - InvalidEntries - Note: The accuracy buckets defined in Phase 3 say "Do not count entries with
HasError: true", but the Check 3 formula above usesTotalEntries - InvalidEntries(which still includes ERROR entries). This means ERROR entries (those that parsed as valid IPs but failed validation) are counted in accuracy buckets by their geo-field presence. OnlyInvalidEntries(unparsable IP prefixes) are excluded. Follow the Check 3 formula as the authoritative rule. - On failure, trace and fix the bucketing logic before proceeding.
Check 4 — No duplicate line numbers
- Assert: all
Linevalues inEntriesare unique. - On failure, report the duplicated line numbers to the user.
Check 5 — TunedEntry completeness
- Assert: every object in
Entrieshas aTunedEntrykey (even if its value is{}). - On failure, add
"TunedEntry": {}to any entry missing the key, then re-savereport-data.json.
Check 6 — Report file is present and non-empty
- Confirm
./run/report/geofeed-report.htmlwas written and has a file size greater than zero bytes. - On failure, regenerate the report before presenting to the user.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

