AI Constitution for PageSeeds CLI
Defines rules, architecture, and two-agent workflow for AI contributors to the PageSeeds CLI automation toolkit.
What this file does
Defines rules, architecture, and two-agent workflow for AI contributors to the PageSeeds CLI automation toolkit.
When to use it
- Onboarding a new AI agent to the PageSeeds CLI codebase
- Establishing handoff contracts between planner and implementer agents
- Enforcing deterministic CLI usage and subprocess restrictions
- Guiding safe schema migrations and content directory resolution
Assumes this stack
AI Constitution for PageSeeds CLI
Primary guide for AI agents working on the PageSeeds CLI project.
Purpose
PageSeeds CLI is an open-source automation toolkit for:
- SEO research and content operations
- Reddit opportunity search and engagement workflows
- Deterministic utility automations with agent-assisted workflows
Design goal: Provide a complete, installable tool (pageseeds) that users can install via uv/pip and use to manage their website automation workflows.
Architecture Snapshot
pageseeds-cli/
├── packages/
│ ├── automation-cli/ → Core automation commands (reddit, gsc, posthog)
│ ├── seo-cli/ → SEO research tools (ahrefs, keywords)
│ └── seo-content-cli/ → Content lifecycle operations
├── dashboard_ptk/ → Interactive TUI + orchestration engine
└── .github/skills/ → Workflow knowledge source of truth
Command entry point: pageseeds (unified CLI)
Execution context: Target repos under .github/automation/
User Installation
Users install PageSeeds CLI in their workspace:
# Using uv (recommended)
uv tool install git+https://github.com/fstrauf/pageseeds-cli
# Or using pip
pip install git+https://github.com/fstrauf/pageseeds-cli
Then configure in their target website repos:
cd /path/to/website
git init # if not already a git repo
pageseeds automation repo init --site-id my-site
Two-Agent Operating Model
Use this model whenever two agents collaborate on work in this repo.
Agent A: Planner/Architect
Responsibilities:
- Clarify objective, constraints, acceptance criteria
- Define interfaces and boundaries before edits
- Identify migration and rollback implications
- Produce decision-complete change plan
Must deliver:
- scope
- affected files/modules
- invariants to preserve
- test/verification plan
Agent B: Implementer
Responsibilities:
- Execute against the plan
- Keep changes minimal and cohesive
- Preserve backward compatibility unless explicitly changing schema/contracts
- Validate behavior with tests/checks
Must deliver:
- working code
- updated docs
- verification results
- known limitations
Handoff Contract
Before coding handoff, Agent A provides:
- exact modules to create/modify
- expected data contracts
- success/failure behavior
- test scenarios
After implementation handoff, Agent B provides:
- what changed
- what was verified
- residual risks
Core Rules
-
Skills are source of truth.
- Workflow logic belongs in
.github/skills/*/SKILL.md. - Prompts are launchers, not full workflow specs.
- Workflow logic belongs in
-
Never push or commit on behalf of the user.
- Do NOT run
git push,git commit,git add,git checkout -b, or any command that creates branches, commits, or pushes to a remote. - File edits are made to the working tree only. The user commits and deploys when ready.
- Do NOT run
-
Deterministic steps use CLIs.
- Prefer explicit
pageseeds automation seo ...,pageseeds reddit ...calls. - Avoid shell parsing pipelines for core logic.
- Prefer explicit
-
Agentic steps must be observable.
- Persist raw agent output artifacts.
- Normalize to structured artifacts deterministically.
-
Secrets stay machine-local.
- Use env vars or
~/.config/pageseeds/secrets.env. - Never embed keys in repo files.
- Use env vars or
-
No mock data unless explicitly requested.
-
One content-dir resolver.
- Use
dashboard_ptk/dashboard/engine/content_locator.pyfor content directory discovery. - Do not reimplement candidate path scans in UI/runners/utils.
- Project
content_diroverride must take precedence when valid.
- Use
-
No direct subprocess outside engine.
subprocess.runis only allowed indashboard_ptk/dashboard/engine/*.- UI (
dashboard/cli.py) and task runners must call engine services/tool registry instead.
-
Date edits must be frontmatter-safe.
- For markdown date fixes, update YAML frontmatter deterministically first, then sync task metadata/JSON.
- Do not use broad regex replacements that can modify body content.
Where to Change Things
- Dashboard orchestration:
dashboard_ptk/dashboard/engine/ - Dashboard UI shell:
dashboard_ptk/dashboard/cli.py,dashboard_ptk/dashboard/batch.py - Task runners:
dashboard_ptk/dashboard/tasks/ - Task persistence/schema migration:
dashboard_ptk/dashboard/storage/,dashboard_ptk/dashboard/engine/task_store.py,dashboard_ptk/dashboard/engine/migration.py - CLI implementations:
packages/*/src/ - Workflow knowledge:
.github/skills/
Adding Functionality (Standard Path)
- Define capability and acceptance criteria.
- Decide deterministic vs agentic split.
- Add/extend deterministic CLI command first (if needed).
- Wire orchestration in dashboard engine workflows.
- Add/update task schema mappings only when required.
- Add tests for:
- migration/compatibility (if schema touched)
- deterministic execution path
- normalization behavior (if agent output used)
- Update docs in place (
AGENTS.MD,ARCHITECTURE.md, dashboard guide).
Changing Existing Behavior Safely
- Preserve task state compatibility by default.
- If schema changes, provide migration + backup + rollback behavior.
- Keep UI behavior stable unless change is intentional.
- Do not introduce parallel/duplicate runtime paths.
- one canonical execution path through
dashboard/engine
- one canonical execution path through
- If project setup/validation behavior changes, update preflight checks and interactive fix paths together.
Pre-Commit Checklist
- No secrets added
- No hardcoded absolute machine paths in runtime logic
- Deterministic calls go through centralized tool execution
- Agent outputs are persisted and normalized when structured results are required
- Docs updated in existing files (no duplicate guidance)
- Tests executed and reported
test_no_subprocess_outside_engine.pypasses- If content directory logic changed:
test_content_locator.pyandtest_project_preflight.pyupdated/passing - If date-fix logic changed:
test_frontmatter_dates.py(and affected workflow tests) updated/passing
What's inside
10 sections covering purpose, architecture, installation, two-agent model, 8 core rules, change locations, and checklists
Change this for your project
- Replace
fstrauf/pageseeds-cliwith your own repository URL - Replace
pageseedswith your own CLI tool name - Replace
dashboard_ptk/dashboard/engine/content_locator.pywith your own content resolver path
Where it goes
Save as AGENTS.md in your repository root. Read by Codex, Cursor and other agents that follow the AGENTS.md convention.
Worth borrowing
- Two-agent handoff contract with explicit deliverables for planner and implementer
- Pre-commit checklist that ties specific test files to specific change types
- Canonical execution path rule to prevent duplicate runtime logic
Related Documents
Browser-only development
Guides AI assistants on an Electron + React + TypeScript desktop app for browsing and organizing AI-generated images locally.
Claude Agents — Reference & Recommendations
Catalogues 40+ Claude agents and marketing skills for building a cat adoption charity landing page, with a ready-to-paste prompt and backend API reference.
Golden DKG Prototype -- Master Plan
Defines an 8-phase implementation plan for a Rust prototype of the Golden non-interactive DKG protocol using BLS12-381 and tokio.
Swarms Examples Index
Lists 60+ example scripts for building single and multi-agent systems with the Swarms framework, organized by category and use case.