gsd-doc-classifier

gsd-doc-classifier is an agent for Claude Code from open-gsd/gsd-core. It costs 63 tokens per session (2,340 once invoked), scanned A, original, MIT.

Classifies a single planning document as ADR, PRD, SPEC, DOC, or UNKNOWN. Extracts title, scope summary, and cross-references. Spawned in parallel by /gsd:ingest-docs. Writes a JSON classification file and returns a one-line confirmation.

Agent for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: reads .claude/ paths.

Install with agentmods
npx agentmods add agents/open-gsd/gsd-core/gsd-doc-classifier.compact
About the project

GSD Core is a framework that guides AI coding agents through a repeatable cycle of discussing decisions, planning, executing, verifying, and shipping software work. It is used with coding-agent runtimes to organize research and implementation in fresh-context subagents and reduce context degradation. The catalogue entries are its skills, agents, hooks, plugin, and instructions for those workflows.

open-gsd/gsd-core · 9,319 stars · on GitHub · opengsd.net

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.

Clone the repo
git clone --depth 1 https://github.com/open-gsd/gsd-core

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gsd-doc-classifier

README.md
[![agentmods](https://agentmods.dev/badge/agents/open-gsd/gsd-core/gsd-doc-classifier.compact/github.svg)](https://agentmods.dev/agents/open-gsd/gsd-core/gsd-doc-classifier.compact)
Your own site
<a href="https://agentmods.dev/agents/open-gsd/gsd-core/gsd-doc-classifier.compact"><img src="https://agentmods.dev/badge/agents/open-gsd/gsd-core/gsd-doc-classifier.compact/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gsd-doc-classifier

Your own site · 80×15
<a href="https://agentmods.dev/agents/open-gsd/gsd-core/gsd-doc-classifier.compact"><img src="https://agentmods.dev/badge/agents/open-gsd/gsd-core/gsd-doc-classifier.compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,340 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin unknown 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.1 $0.00063 $0.02340
Opus 5 $0.00032 $0.01170
Sonnet 5 $0.00013 $0.00468
Haiku 4.5 $0.00006 $0.00234

Measured today against content hash 7b38df760030, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

gsd-doc-classifier 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 today.

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.

agents/gsd-doc-classifier.compact.md · 193 lines

How it starts

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

If the prompt contains a <required_reading> block, Read every file listed there before doing anything else — primary context.

@~/.claude/gsd-core/references/untrusted-input-boundary.md

<extraction_discipline> Rule-application, not generation. Apply the taxonomy/precedence rules directly to what the source actually contains — do not infer, embellish, or add content not present. When the source is silent on a field, mark it absent rather than guessing.

Classification drives extraction: tag a PRD as DOC → its requirements never reach REQUIREMENTS.md; tag an ADR as PRD → its decisions lose LOCKED status and get overridden by weaker sources. Fidelity here is load-bearing for the entire ingest pipeline. </extraction_discipline>

PRD — what the product/feature should do, user/business perspective. Hallmarks: user stories, acceptance criteria, success metrics, goals/non-goals, "as a user..." language. Produces requirements (mid precedence).

SPEC — how something is built: APIs, schemas, contracts, non-functional requirements. Hallmarks: endpoint tables, request/response schemas, SLOs, protocol definitions, data models. Produces technical constraints (above PRD, below ADR).

DOC — supporting context: guides, tutorials, design rationales, onboarding, runbooks. Prose-heavy, no decision or requirement. Produces context only (lowest precedence).

UNKNOWN — cannot be confidently placed above. Record observed signals; let the synthesizer or user decide.

If MANIFEST_TYPE provided, skip to extract_metadata with that type.

Frontmatter signals (authoritative if present): type: adr|prd|spec|doc → use directly. status: Accepted|Proposed|Superseded|Draft → ADR signal. decision: field → ADR. requirements:/user_stories: → PRD.

Content signals: ## Decision + ## Consequences → ADR. ## User Stories or "As a [user], I want" → PRD. Endpoint/schema tables, OpenAPI snippets, protocol fields → SPEC. None of the above, prose only → DOC.

Ambiguity rule: if two types compete at roughly equal strength, pick the highest-precedence signal (ADR > SPEC > PRD > DOC). Record the ambiguity in notes.

Confidence: high — frontmatter/filename convention + matching content signals. medium — content signals only, one dominant. low — signals conflict or thin (classify as best guess, flag low confidence).

If signals are too thin, output UNKNOWN with low confidence and list observed signals in notes.

Read the full file on GitHub · 193 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. today First seen · 193 lines · 63 tokens per session scan A 7b38df760030

Subscribe to this mod's changes

gsd-doc-classifier is an agent published in the GitHub repository open-gsd/gsd-core (9,319 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 2,340 once invoked, about $0.0003 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-09-10.