seoagent
AGENTS.md0 starsChanged 8 months agoMITView on GitHub
This file provides instructions for AI coding agents (Claude Code, Codex, Gemini, Cursor, etc.) working on the SEOAgent codebase. 24 tools prefixed seoagent_. Install config: Global --format flag: table (default), json, markdown.
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 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.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
Add types to packages/core/src/types.ts (if needed)
- Very specific: line 28
Write failing test in packages/core/src/__tests__/
- Very specific: line 31
Add CLI command in packages/cli/src/commands/
- Very specific: line 32
Add MCP tool in packages/mcp/src/tools/
- Distinctive: line 33
Add dashboard endpoint + page if applicable
- Very specific: line 39
Use SEOAGENT_HOME env var pointing to temp dir for isolated tests
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
SEOAgent — Agent Instructions
This file provides instructions for AI coding agents (Claude Code, Codex, Gemini, Cursor, etc.) working on the SEOAgent codebase.
Quick Start
pnpm install && pnpm build && pnpm testWhere Things Live
| What | Where |
| All business logic | packages/core/src/ |
| Public API | packages/core/src/index.ts (barrel export) |
| Types | packages/core/src/types.ts |
| Database schema | packages/core/src/schema.ts |
| Tests | packages/core/src/__tests__/*.test.ts |
| CLI commands | packages/cli/src/commands/ |
| MCP tool handlers | packages/mcp/src/tools/ |
| Dashboard API | packages/dashboard/src/server/routes.ts |
| Dashboard pages | packages/dashboard/src/app/pages/ |
Adding a New Feature
- Add types to
packages/core/src/types.ts(if needed) - Write failing test in
packages/core/src/__tests__/ - Implement in
packages/core/src/(new file or existing module) - Export from
packages/core/src/index.ts - Add CLI command in
packages/cli/src/commands/ - Add MCP tool in
packages/mcp/src/tools/ - Add dashboard endpoint + page if applicable
Testing Patterns
- Mock HTTP calls with
vitest.mock("undici")orvitest.mock("googleapis") - Mock DataForSEO with
vitest.mock("../dataforseo.js") - Use
SEOAGENT_HOMEenv var pointing to temp dir for isolated tests - Database tests: create temp dir,
openDatabase(), cleanup inafterEach
let tmpDir: string;
beforeEach(() => {
tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "seoagent-test-"));
process.env.SEOAGENT_HOME = tmpDir;
});
afterEach(() => {
fs.rmSync(tmpDir, { recursive: true, force: true });
});MCP Server
24 tools prefixed seoagent_. Install config:
{
"mcpServers": {
"seoagent": {
"command": "node",
"args": ["<absolute-path>/packages/mcp/dist/index.js"],
"env": { "SEOAGENT_PROJECT": "<project-slug>" }
}
}
}CLI
seoagent project add mysite --domain example.com --niche tech
seoagent project use mysite
seoagent config set dataforseo.login <login>
seoagent config set dataforseo.password <password>
seoagent keywords research "seo tips" --format json
seoagent audit crawl --max-pages 100
seoagent strategy generateGlobal --format flag: table (default), json, markdown.
Core Function Groups
Project Management
addProject, listProjects, getProject, removeProject, setActiveProject, getActiveProject
Config
loadConfig, saveConfig, setConfigValue, getConfigValue
Database
openDatabase(dbPath), closeDatabase(db) — creates all 9 tables via schema.ts
Site Audit
auditCrawl(domain, db, options?), auditReport(db), auditPage(url, db)
Keywords & Rank Tracking
keywordResearch(db, provider, keywords, locale), keywordSuggestions(db, provider, seed, locale, limit?)
rankTrackAdd(db, keywords, locale), rankTrackCheck(db, provider, domain, locale), rankTrackHistory(db, keyword, locale), rankTrackReport(db, locale)
Competitors
competitorKeywords(provider, domain, locale), competitorCompare(provider, yourDomain, competitor, locale), contentGaps(db, provider, yourDomain, competitors), contentGapsForProject(provider, slug)
Domain Reputation
domainReputation(domain, db, credentials), domainReputationHistory(db, options?), backlinkProfile(domain, db, credentials), backlinkOpportunities(domain, competitors, credentials)
Google Search Console
generateAuthUrl(clientId, secret), gscPerformance(slug, options?), gscPages(slug, options?), gscQueries(slug, options?)
Strategy Engine
strategyGenerate(db, project), strategyRefresh(db, project), generateRuleBasedStrategy(data) (fallback without LLM)
Provider
createProvider(login, password) — creates DataForSEO provider implementing SearchDataProvider interface
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.

