structpages CLAUDE.md

Repository instructions for Structpages, a Go web-framework library that defines routes with Go structs and supports the Templ tool for generating web templates. They document the project, development commands, examples, and testing practices.

In plain words
What is it for?
Use them when changing Structpages routes, templates, examples, or framework code, or when installing dependencies, generating Templ files, and running focused or complete tests.
Why use it?
They give a coding assistant the project context and the commands needed to build generated files and run the Go test suite correctly.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jackielii/structpages/claude-md
Clone the repo
git clone --depth 1 https://github.com/jackielii/structpages
Per session 1,472 This file is loaded in full into every session.
When invoked 1,472 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01472 $0.01472
Opus 5 $0.00736 $0.00736
Sonnet 5 $0.00294 $0.00294
Haiku 4.5 $0.00147 $0.00147

Measured 2d ago against content hash f7bd2a0bccd4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

structpages CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 120 lines

How it starts

The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Structpages is a Go web framework library that provides struct-based routing. It integrates with Go's standard http.ServeMux and provides a declarative way to define routes using struct tags. The framework is designed to reduce boilerplate code when building web pages and components, with built-in support for the Templ templating engine.

Status: Beta (API settled; battle-tested in production by medium-to-large applications)

Development Commands

Testing

# Run all tests
go test ./...

# Run tests with coverage
go test -cover ./...

# Run a specific test
go test -run TestName ./...

# Run tests with verbose output
go test -v ./...

Working with Examples

# Navigate to an example directory
cd examples/simple  # or examples/htmx or examples/todo

# Install dependencies
go mod download

# Generate Go code from Templ files (required before running)
# Each example pins the templ CLI as a `tool` dep, so `go tool` resolves the
# correct version automatically — no global install needed.
go tool templ generate -include-version=false

# Run the example server (typically on :8080)
go run main.go

# Watch mode for Templ files during development
go tool templ generate -include-version=false --watch

Required Tools

  • Go 1.24 or later (for the tool directive in example go.mod files)

Architecture Overview

Core Components

  1. Router System: Built on top of http.ServeMux, the router parses struct tags to create routes

    • struct_pages.go: Mount, StructPages, options, and request dispatch
    • parse.go: Parses struct tags like route:"/path Title", builds the page tree, handles DI matching
    • page_node.go: PageNode struct and tree traversal (All, FullRoute)
  2. Struct-Based Routing Pattern: Routes are defined as struct fields with route tags

    type pages struct {
        product `route:"/product Product"`
        team    `route:"POST /team Team"`
    }
    

    Each leaf page handles requests via one of: a Page() templ method (most common), a Props method (Props-only pages), or a ServeHTTP method (form actions, redirects). Promoted (embedded) methods are skipped.

Read the full file on GitHub · 120 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 120 lines · 1,472 tokens per session scan A f7bd2a0bccd4

Subscribe to this mod's changes

structpages CLAUDE.md is an instructions file published in the GitHub repository jackielii/structpages (24 stars, last pushed 1mo ago), licensed BSD-3-Clause. It adds 1,472 tokens to every session, about $0.0074 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories