geo-optimizer-skill
AGENTS.md994 starsChanged 6 months agoMITView on GitHub
GEO Optimizer is an open-source Python toolkit for Generative Engine Optimization. It audits and improves websites so they are more discoverable and citable by AI search engines such as ChatGPT, Perplexity, Claude, and Gemini. Current project shape: - Python package with CLI commands, core audit/fix logic, FastAPI web demo, and MCP server support - MIT licensed - Python 3.9+ compatibility is required Primary user-facing surfaces: - geo audit - geo fix - geo llms - geo schema - geo-web Top-level…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- site/llms.txtllms.txt
- SKILL.mdSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 12 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Keep CLI and formatter logic in cli/.
- Very specific: line 49
Do not hardcode scoring weights, AI bot lists, or schema defaults outside models/config.py.
- Very specific: line 52
Every Python file under src/ must include:
- Distinctive: line 70
Never bypass anti-SSRF protections.
- Very specific: line 73
Do not introduce direct requests.get() or equivalent on unvalidated user input.
- Very specific: line 75
Do not enable unsafe redirect behavior.
- Very specific: line 80
Keep response streaming and size checks in place.
- Distinctive: line 104
When modifying scoring or output:
- Distinctive: line 105
keep formatter totals aligned with config weights
- Very specific: line 106
keep _compute_grade behavior aligned with score bands
- Distinctive: line 107
avoid silent drift between display code and scoring code
- Very specific: line 128
prefer unittest.mock.patch, Mock, MagicMock
- Very specific: line 129
use click.testing.CliRunner for CLI tests
- Distinctive: line 130
no real HTTP in normal tests
- Very specific: line 139
keep tests compatible with pythonpath = ["src", "scripts"]
- Distinctive: line 184
prefer small, localized edits that preserve layer boundaries
- Distinctive: line 185
add or update tests with behavior changes
- Distinctive: line 186
do not move business logic into CLI or web handlers
- Distinctive: line 187
do not duplicate config values that already exist centrally
- Distinctive: line 188
treat HTTP, validation, and scoring code as security- and regression-sensitive
- Distinctive: line 194
keep plugin compatibility and mocked testability in mind from the start
- Very specific: line 206
Run graft map first — a token-budgeted orientation (dir clusters, hubs, hotspots), no LLM, no key.
- Very specific: line 209
Run graft ask "<your question>" --source → ranked nodes with the relevant code spans inlined (each hit's ≤8-line crux by default.
- Very specific: line 221
Add --direction out for what it calls, or --depth N to walk transitively for the full blast radius.
- Distinctive: line 229
If a returned span is truncated ("+N more lines"), open the file at that exact range before finalizing.
- Very specific: line 234
After big code changes, refresh the graph with graft build (deterministic, no API key, $0).
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
AGENTS.md
Project Context
GEO Optimizer is an open-source Python toolkit for Generative Engine Optimization. It audits and improves websites so they are more discoverable and citable by AI search engines such as ChatGPT, Perplexity, Claude, and Gemini.
Current project shape:
- Python package with CLI commands, core audit/fix logic, FastAPI web demo, and MCP server support
- MIT licensed
- Python 3.9+ compatibility is required
Primary user-facing surfaces:
geo auditgeo fixgeo llmsgeo schemageo-web
Repository Map
Top-level structure:
src/geo_optimizer/cli/: Click presentation layer and output formatterssrc/geo_optimizer/core/: business logic, scoring, audit execution, fix generationsrc/geo_optimizer/models/: dataclasses and centralized config/constantssrc/geo_optimizer/utils/: HTTP, validation, cache, parserssrc/geo_optimizer/web/: FastAPI app, badge generation, web entrypointssrc/geo_optimizer/mcp/: MCP server tools/resourcessrc/geo_optimizer/i18n/: translationstests/: pytest suite, mostly mocked end-to-end and unit coverage
Important file roles:
models/config.py: centralized constants, scoring weights, schema templates, bot listsmodels/results.py: result dataclassescore/audit.py: full audit orchestrationutils/http.py: secure fetching, anti-SSRF, response size protectionsutils/validators.py: public URL and safe-path validation
Architectural Rules
These are hard constraints:
core/must never print or directly format output. Return dataclasses frommodels/results.py.- Keep CLI and formatter logic in
cli/.cli/*can call core and format results; core must not depend on CLI. - Keep constants centralized.
Do not hardcode scoring weights, AI bot lists, or schema defaults outside
models/config.py. - Preserve Python 3.9 compatibility.
Every Python file under
src/must include:
Also avoid relying on Python 3.10+ only behavior, including newerfrom __future__ import annotationsentry_points()assumptions. - Respect dependency direction.
core/*may import frommodels/*cli/*may import fromcore/*andmodels/*models/*must not import fromcore/*orcli/*
- Preserve plugin architecture.
Plugin checks are loaded through
entry_points("geo_optimizer.checks")and use theAuditCheckprotocol.
Security Rules
Security-sensitive behavior is non-negotiable:
- Never bypass anti-SSRF protections. Any user URL must go through validation and secure fetch flow.
- Do not introduce direct
requests.get()or equivalent on unvalidated user input. - Do not enable unsafe redirect behavior.
allow_redirects=Truemust not be introduced for user-controlled fetches. - Preserve DNS pinning and URL validation behavior in the HTTP stack.
- Keep response streaming and size checks in place.
Large responses must still honor the configured
MAX_RESPONSE_SIZE. - Be careful with circular import boundaries.
utils/http.pyintentionally imports validators inside functions.
Audit and Scoring Model
The GEO score totals 100 points across these categories:
- Robots.txt: 18
- llms.txt: 18
- Schema JSON-LD: 16
- Meta Tags: 14
- Content: 12
- Signals: 6
- AI Discovery: 6
- Brand & Entity: 10
Score bands:
86-100: excellent68-85: good36-67: foundation0-35: critical
When modifying scoring or output:
- keep formatter totals aligned with config weights
- keep
_compute_gradebehavior aligned with score bands - avoid silent drift between display code and scoring code
Data Flow Expectations
Typical audit flow:
URL -> validation -> fetch_url() -> BeautifulSoup -> sub-audits -> dataclasses -> score computation -> formatter/web/API outputSeparation expectations:
- core functions return typed result objects
- formatters convert results to text, JSON, HTML, SARIF, JUnit, GitHub summaries, or rich terminal output
- web endpoints should reuse the same core logic, not fork business rules
Testing Expectations
The test suite is heavily mocked and should remain that way.
Rules:
- use
pytest - prefer
unittest.mock.patch,Mock,MagicMock - use
click.testing.CliRunnerfor CLI tests - no real HTTP in normal tests
- preserve AAA style where practical
Naming convention:
test_{module}_{scenario}_{expectation}
Common testing guidance:
- mock
fetch_url()return values as tuples - maintain compatibility with legacy mocks that use
.contentor._content - keep tests compatible with
pythonpath = ["src", "scripts"]
Markers currently in use:
@pytest.mark.legacy@pytest.mark.network
Project-Specific Gotchas
Watch for these before editing:
from __future__ import annotationsis required in everysrc/Python file.audit_js_renderingmust not mutate the original soup; it should operate on a deep copy.- The JSON-LD parser must support both direct
@typeand@graph. _CTA_REand_CTA_FUNNEL_REincitability.pyare distinct and should not be collapsed.- Formatter max scores must match the scoring config exactly.
- Some legacy tests rely on non-ideal import order and have Ruff exceptions by design.
Style and Conventions
Code style:
snake_case.pyfilenames- snake_case functions
- PascalCase dataclasses
- constants in ALL_CAPS
- docstrings in Google style, in Italian
- inline comments in Italian when useful, often with issue references
Tooling:
- Ruff is the formatter/linter baseline
- line length: 120
- target: py39
Useful commands:
pip install -e ".[dev]"
pytest tests/ -v
pytest tests/ -v --cov=geo_optimizer
ruff check src/geo_optimizer/
ruff format src/geo_optimizer/Guidance for Future Agents
When making changes:
- prefer small, localized edits that preserve layer boundaries
- add or update tests with behavior changes
- do not move business logic into CLI or web handlers
- do not duplicate config values that already exist centrally
- treat HTTP, validation, and scoring code as security- and regression-sensitive
- preserve compatibility with both CLI and web/demo consumers
When adding features:
- wire new user-facing behavior through core result models first
- expose presentation details in formatters or web handlers second
- keep plugin compatibility and mocked testability in mind from the start
<!-- graft:start -->Graft — repo context graph
This repo is indexed in graft/: small linked markdown nodes that explain each
system and carry exact file:line spans, kept in sync with the code through git.
For ANY task here — understanding how something works, finding where code lives,
or scoping a change — get context from the graph before grepping or opening
source files. Re-ask freely (it's cheap) and reuse literal identifiers you
already have (symbol, error string, file name) as the query. New to this repo?
Run graft map first — a token-budgeted orientation (dir clusters, hubs,
hotspots), no LLM, no key.
- Run
graft ask "<your question>" --source→ ranked nodes with the relevant code spans inlined (each hit's ≤8-line crux by default;--fullfor whole definitions when the crux isn't enough). Match the tool to the task shape: for understanding or editing, the top node IS the answer — cite itscovers:file:line spans and edit straight from--source. For exhaustive tasks ("every occurrence / every caller of this pattern"), ranked results are top-N, not complete — rungraft grep "<literal>"instead (exhaustive over indexed files, grouped by enclosing symbol), falling back to rawgrep -rnonly for unindexed files. graft skeleton <file>→ every definition's signature + span, ~10× cheaper than reading the file; use it to skim an API surface.graft callers <symbol>gives precomputed, exact edges — who calls this. Add--direction outfor what it calls, or--depth Nto walk transitively for the full blast radius. For structural questions, skip ranking and use this directly.- Or browse:
graft/INDEX.mdlists every node; follow the links. - Monorepos and folders of multiple repos rank fairly across sub-projects —
hits carry
[scope/]labels naming which one they're from. Narrow withgraft ask "<task>" --in <scope>/once you know where you're working.
If a returned span is truncated ("+N more lines"), open the file at that exact range before finalizing. Only open source files when a node genuinely lacks a needed detail, and then at the exact file:line the node points to — never re-read whole files.
After big code changes, refresh the graph with graft build (deterministic,
no API key, $0).
<!-- graft:end -->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.

