scaffold

A command for extracting project context from docs/PRD.md, a product-requirements document, into docs/GLOBAL-CONTEXT.md using a provided template. It can also apply narrowly targeted corrections from a FAIL or DECISION list.

In plain words
What is it for?
Use it to scaffold global context from a PRD, repair listed context problems, and report whether the extraction passed or needs a documented decision.
Why use it?
It creates a shared project summary from existing requirements while preventing unsupported additions, placeholders, and unrelated edits.

Command for Claude Code

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 commands/snakeying/textum/scaffold
Clone the repo
git clone --depth 1 https://github.com/snakeying/Textum

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,313 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01313
Opus 5 $0.00000 $0.00656
Sonnet 5 $0.00000 $0.00263
Haiku 4.5 $0.00000 $0.00131

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

Security

Grade A, and why

scaffold 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.

outdated/.claude_outdated/commands/scaffold.md · 62 lines

How it starts

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

阶段2: 上下文提取

读取:docs/PRD.md(只读) | 写入:docs/GLOBAL-CONTEXT.md | 模板:.claude/textum/GLOBAL-CONTEXT-template.md | 可选输入:FAIL/DECISION 清单

从 PRD 抽取生成 GLOBAL-CONTEXT:只抽取/归纳;不新增信息。

输入(可选)

  • FAIL/DECISION 清单(用于精准修正)

修正模式(当提供 FAIL/DECISION 清单时必须遵守)

  • 以现有 docs/GLOBAL-CONTEXT.md 为基线:只修改清单命中的位置,其余内容不做无关改动(最小 diff)
  • 若清单需要补充事实但 PRD 无法支撑:不要新增信息;保持 N/A 并输出 DECISION(需要先更新 PRD)

输出规则(必须遵守)

  • 不输出 GC 原文
  • 输出必须二选一:
    1. PASS:在末尾追加:
      • 已写入:docs/GLOBAL-CONTEXT.md
      • 下一步:/scaffold-check
    2. DECISION:当且仅当“修正模式”中存在需要 PRD 补充事实但 PRD 无法支撑的条目时输出(D-001 起编号;每条包含:定位 / 问题 / 影响 / 建议动作),并在末尾追加:
      • 已写入:docs/GLOBAL-CONTEXT.md
      • 下一步:/scaffold-check

硬约束(必须遵守)

N/A_STRICT 判定口径(权威;逐字一致;禁止改写):

  • 定位 PRD 小节 ### 9.2 接口清单(必填) 的正文(标题行之后到下一同级小节标题之前)

  • 判定 N/A_STRICT = true 当且仅当:正文去掉空行并 Trim 后仅剩 1 行且该行严格等于 N/A

  • 只做抽取/归纳:不得新增 PRD 中不存在的新规则/新枚举/新接口/新字段/新默认值

  • 禁止占位符:输出中不得出现 TBD / [...]

  • 禁止 fenced code blocks:输出中不得出现任何 ```

  • 禁止 PRD 锚点:docs/GLOBAL-CONTEXT.md 中不得出现任何 PRD#...<!-- PRD#... -->

  • 技术栈(GC 第 1 节):只允许从 PRD 显式抽取;PRD 未提供则写 N/A;不得猜测/推荐

  • 若提供 FAIL/DECISION 清单:必须逐条完成清单中的“修复方式/建议动作”

  • 必须按模板输出全部一级章节:

    • 模板中为 N/A 的小节:保持该小节正文仅一行 N/A(不加额外解释)
    • 模板中为表格的小节:无信息则保留 N/A 行/单元格(不加额外解释)

抽取口径(按节;只取“已确认事实”)

  • 第 1 节 技术栈:只写 PRD 明确出现的语言/框架/数据库等;否则保持 N/A
  • 第 2 节 项目结构:
    • | Path | 职责 | 表:仅列 PRD 8.0 功能点→落点映射 中出现的 FILE:<path>(去重;Path 写 <path>,去掉 FILE: 前缀)
    • ### 项目验证命令 表:PRD 未提供可执行命令则保持 N/A
  • 第 3 节 枚举值:从 PRD 第 7 节抽取;无则 N/A
  • 第 4 节 业务规则:从 PRD 第 6 节规则表抽取 BR-### 与一句话规则描述(不扩写、不补充)
  • 第 5 节 权限矩阵:从 PRD 第 4 节抽取为行式表格 操作|角色|权限|说明(权限只能 A / D / O
  • 第 6 节 数据模型概览:仅抽取 PRD 8.1 表清单8.3 表关系 的摘要;无则 N/A(不要复制 8.2 字段表)
  • 第 7 节 命名规范:仅抽取 PRD 明确给出的命名约定;无则 N/A
  • 第 8 节 API规范:
    • 先按 N/A_STRICT 判定 PRD 是否有 API
    • 若无 API:该节正文必须严格为 1 行 N/A
    • 若有 API:只抽取 PRD 9.1 通用约定 中已确认的项;缺失项写 N/A;不要新增默认错误码/示例 JSON

最小读取范围(必须;避免通读)

  • PRD:4(权限矩阵)、6(规则表)、7.1/7.2(枚举/状态机)、7.3(命名规范;若正文为单行 N/A 则 GC 第 7 节保持单行 N/A)、8.0(落点映射)、8.1/8.3(表清单/关系)、9.1/9.2(API 约定/清单;若 N/A_STRICT 则跳过)、10(非功能底线)

Read the full file on GitHub · 62 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 · 62 lines · 0 tokens per session scan A 25d7cb3d4c51

Subscribe to this mod's changes

scaffold is a command published in the GitHub repository snakeying/Textum (41 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,313 tokens. 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.