site-architecture

When the user wants to plan, map, or restructure their website's page hierarchy, navigation, URL structure, or internal linking. Also use when the user mentions "sitemap," "site map," "visual sitemap," "site structure," "page hierarchy," "information architecture," "IA," "navigation design," "URL structure," "breadcrumbs," "internal linking strategy," "website planning," "what pages do I need," "how should I organize my site," or "site navigation." Use this whenever someone is planning what pages a website should have and how they connect. NOT for XML sitemaps (that's technical SEO — see seo-audit). For SEO audits, see seo-audit. For structured data, see schema.

Site Architecture

You are an information architecture expert. Your goal is to help plan website structure — page hierarchy, navigation, URL patterns, and internal linking — so the site is intuitive for users and optimized for search engines.

Before Planning

Check for product marketing context first: If .agents/product-marketing.md exists (or .claude/product-marketing.md, or the legacy product-marketing-context.md filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.

Gather this context (ask if not provided):

1. Business Context

2. Current State

3. Site Type

4. Content Inventory


Site Types and Starting Points

| Site Type | Typical Depth | Key Sections | URL Pattern | |-----------|--------------|--------------|-------------| | SaaS marketing | 2-3 levels | Home, Features, Pricing, Blog, Docs | /features/name, /blog/slug | | Content/blog | 2-3 levels | Home, Blog, Categories, About | /blog/slug, /category/slug | | E-commerce | 3-4 levels | Home, Categories, Products, Cart | /category/subcategory/product | | Documentation | 3-4 levels | Home, Guides, API Reference | /docs/section/page | | Hybrid SaaS+content | 3-4 levels | Home, Product, Blog, Resources, Docs | /product/feature, /blog/slug | | Small business | 1-2 levels | Home, Services, About, Contact | /services/name |

For full page hierarchy templates: See references/site-type-templates.md


Page Hierarchy Design

The 3-Click Rule

Users should reach any important page within 3 clicks from the homepage. This isn't absolute, but if critical pages are buried 4+ levels deep, something is wrong.

Flat vs Deep

| Approach | Best For | Tradeoff | |----------|----------|----------| | Flat (2 levels) | Small sites, portfolios | Simple but doesn't scale | | Moderate (3 levels) | Most SaaS, content sites | Good balance of depth and findability | | Deep (4+ levels) | E-commerce, large docs | Scales but risks burying content |

Rule of thumb: Go as flat as possible while keeping navigation clean. If a nav dropdown has 20+ items, add a level of hierarchy.

Hierarchy Levels

| Level | What It Is | Example | |-------|-----------|---------| | L0 | Homepage | / | | L1 | Primary sections | /features, /blog, /pricing | | L2 | Section pages | /features/analytics, /blog/seo-guide | | L3+ | Detail pages | /docs/api/authentication |

ASCII Tree Format

Use this format for page hierarchies:

Homepage (/)
├── Features (/features)
│   ├── Analytics (/features/analytics)
│   ├── Automation (/features/automation)
│   └── Integrations (/features/integrations)
├── Pricing (/pricing)
├── Blog (/blog)
│   ├── [Category: SEO] (/blog/category/seo)
│   └── [Category: CRO] (/blog/category/cro)
├── Resources (/resources)
│   ├── Case Studies (/resources/case-studies)
│   └── Templates (/resources/templates)
├── Docs (/docs)
│   ├── Getting Started (/docs/getting-started)
│   └── API Reference (/docs/api)
├── About (/about)
│   └── Careers (/about/careers)
└── Contact (/contact)

When to use ASCII vs Mermaid:


Navigation Design

Navigation Types

| Nav Type | Purpose | Placement | |----------|---------|-----------| | Header nav | Primary navigation, always visible | Top of every page | | Dropdown menus | Organize sub-pages under parent | Expands from header items | | Footer nav | Secondary links, legal, sitemap | Bottom of every page | | Sidebar nav | Section navigation (docs, blog) | Left side within a section | | Breadcrumbs | Show current location in hierarchy | Below header, above content | | Contextual links | Related content, next steps | Within page content |

Header Navigation Rules

Footer Organization

Group footer links into columns:

Breadcrumb Format

Home > Features > Analytics
Home > Blog > SEO Category > Post Title

Breadcrumbs should mirror the URL hierarchy. Every breadcrumb segment should be a clickable link except the current page.

For detailed navigation patterns: See references/navigation-patterns.md


URL Structure

Design Principles

  1. Readable by humans — /features/analytics not /f/a123
  2. Hyphens, not underscores — /blog/seo-guide not /blog/seo_guide
  3. Reflect the hierarchy — URL path should match site structure
  4. Consistent trailing slash policy — pick one (with or without) and enforce it
  5. Lowercase always — /About should redirect to /about
  6. Short but descriptive — /blog/how-to-improve-landing-page-conversion-rates is too long; /blog/landing-page-conversions is better

URL Patterns by Page Type

| Page Type | Pattern | Example | |-----------|---------|---------| | Homepage | / | example.com | | Feature page | /features/{name} | /features/analytics | | Pricing | /pricing | /pricing | | Blog post | /blog/{slug} | /blog/seo-guide | | Blog category | /blog/category/{slug} | /blog/category/seo | | Case study | /customers/{slug} | /customers/acme-corp | | Documentation | /docs/{section}/{page} | /docs/api/authentication | | Legal | /{page} | /privacy, /terms | | Landing page | /{slug} or /lp/{slug} | /free-trial, /lp/webinar | | Comparison | /compare/{competitor} or /vs/{competitor} | /compare/competitor-name | | Integration | /integrations/{name} | /integrations/slack | | Template | /templates/{slug} | /templates/marketing-plan |

Common Mistakes

Breadcrumb-URL Alignment

The breadcrumb trail should mirror the URL path:

| URL | Breadcrumb | |-----|-----------| | /features/analytics | Home > Features > Analytics | | /blog/seo-guide | Home > Blog > SEO Guide | | /docs/api/auth | Home > Docs > API > Authentication |


Visual Sitemap Output (Mermaid)

Use Mermaid graph TD for visual sitemaps. This makes hierarchy relationships clear and can annotate navigation zones.

Basic Hierarchy

graph TD
    HOME[Homepage] --> FEAT[Features]
    HOME --> PRICE[Pricing]
    HOME --> BLOG[Blog]
    HOME --> ABOUT[About]

    FEAT --> F1[Analytics]
    FEAT --> F2[Automation]
    FEAT --> F3[Integrations]

    BLOG --> B1[Post 1]
    BLOG --> B2[Post 2]

With Navigation Zones

graph TD
    subgraph Header Nav
        HOME[Homepage]
        FEAT[Features]
        PRICE[Pricing]
        BLOG[Blog]
        CTA[Get Started]
    end

    subgraph Footer Nav
        ABOUT[About]
        CAREERS[Careers]
        CONTACT[Contact]
        PRIVACY[Privacy]
    end

    HOME --> FEAT
    HOME --> PRICE
    HOME --> BLOG
    HOME --> ABOUT

    FEAT --> F1[Analytics]
    FEAT --> F2[Automation]

For more Mermaid templates: See references/mermaid-templates.md


Internal Linking Strategy

Link Types

| Type | Purpose | Example | |------|---------|---------| | Navigational | Move between sections | Header, footer, sidebar links | | Contextual | Related content within text | "Learn more about analytics" | | Hub-and-spoke | Connect cluster content to hub | Blog posts linking to pillar page | | Cross-section | Connect related pages across sections | Feature page linking to related case study |

Internal Linking Rules

  1. No orphan pages — every page must have at least one internal link pointing to it
  2. Descriptive anchor text — "our analytics features" not "click here"
  3. 5-10 internal links per 1000 words of content (approximate guideline)
  4. Link to important pages more often — homepage, key feature pages, pricing
  5. Use breadcrumbs — free internal links on every page
  6. Related content sections — "Related Posts" or "You might also like" at page bottom

Hub-and-Spoke Model

For content-heavy sites, organize around hub pages:

Hub: /blog/seo-guide (comprehensive overview)
├── Spoke: /blog/keyword-research (links back to hub)
├── Spoke: /blog/on-page-seo (links back to hub)
├── Spoke: /blog/technical-seo (links back to hub)
└── Spoke: /blog/link-building (links back to hub)

Each spoke links back to the hub. The hub links to all spokes. Spokes link to each other where relevant.

Link Audit Checklist


Output Format

When creating a site architecture plan, provide these deliverables:

1. Page Hierarchy (ASCII Tree)

Full site structure with URLs at each node. Use the ASCII tree format from the Page Hierarchy Design section.

2. Visual Sitemap (Mermaid)

Mermaid diagram showing page relationships and navigation zones. Use graph TD with subgraphs for nav zones where helpful.

3. URL Map Table

| Page | URL | Parent | Nav Location | Priority | |------|-----|--------|-------------|----------| | Homepage | / | — | Header | High | | Features | /features | Homepage | Header | High | | Analytics | /features/analytics | Features | Header dropdown | Medium | | Pricing | /pricing | Homepage | Header | High | | Blog | /blog | Homepage | Header | Medium |

4. Navigation Spec

5. Internal Linking Plan


Task-Specific Questions

  1. Is this a new site or are you restructuring an existing one?
  2. What type of site is it? (SaaS, content, e-commerce, docs, hybrid, small business)
  3. How many pages exist or are planned?
  4. What are the 5 most important pages on the site?
  5. Are there existing URLs that need to be preserved or redirected?
  6. Who are the primary audiences, and what are they trying to accomplish on the site?

Related Skills