document-app

document-app is a command for coding agents from phuryn/pm-skills. It costs 44 tokens per session (783 once invoked), scanned A, original, MIT.

A command that reconstructs an AI-built app’s design and behavior from its code into documents about its architecture, user flows, permissions, variables, and applicable features.

In plain words
What is it for?
Use it on a whole repository or a selected backend or folder to create the review documents, including conditional documents for features such as email, scheduled tasks, search-engine visibility, or automation.
Why use it?
Reviewers need to know what the app is, who may do what, and where sensitive behavior occurs. The documents also provide the intended behavior that later security, performance, and testing reviews compare against.

Command

Part of the pm-ai-shipping plugin — 2 skills, 5 commands shipped together

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/phuryn/pm-skills/document-app
Clone the repo
git clone --depth 1 https://github.com/phuryn/pm-skills

Or install pm-ai-shipping, the plugin that ships this one along with the rest of its 2 skills, 5 commands.

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 document-app

README.md
[![agentmods](https://agentmods.dev/badge/commands/phuryn/pm-skills/document-app.svg)](https://agentmods.dev/commands/phuryn/pm-skills/document-app)
Your own site
<a href="https://agentmods.dev/commands/phuryn/pm-skills/document-app"><img src="https://agentmods.dev/badge/commands/phuryn/pm-skills/document-app.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 783 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.00044 $0.00783
Opus 5 $0.00022 $0.00392
Sonnet 5 $0.00009 $0.00157
Haiku 4.5 $0.00004 $0.00078

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

Security

Grade A, and why

document-app 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 4d 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.

pm-ai-shipping/commands/document-app.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.

/document-app -- Make the System Reviewable

Produce the durable documentation an AI-built app is missing: an honest map of what the system is, who can do what, and where the risk lives. These docs are the foundation every later audit compares the code against.

Invocation

/document-app
/document-app supabase/functions
/document-app the backend

Workflow

Step 1: Scope

Audit $ARGUMENTS. If empty, document the whole repository, prioritizing backend code, auth, data access, background jobs, and anything that sends, schedules, or exposes data.

Step 2: Reverse-Engineer the Docs

Apply the shipping-artifacts skill. Reading the code as the source of truth, produce the applicable documents in documentation/ at the repo root. For large scopes, fan out with parallel subagents — one per core document, each reading the code slice its doc describes — then reconcile the cross-references yourself.

Core (always):

  • architecture.md — system overview, stack, auth flow, trust boundaries
  • flows.md — the permission-relevant journeys: each protected step's authz check, the trust-boundary crossings, and the side effects each flow causes
  • permissions.md — roles, scope derivation, resource × operation × role matrix, RLS vs. code-enforced checks
  • variables.md — config & secrets mapped to risk and rotation

Conditional (only if the capability exists — otherwise note its absence in one line):

  • emails.md — notification path, templates, retry/backoff, failure visibility
  • cron.md — scheduled-work inventory, idempotency, internal-call auth
  • seo.md — SPA preview approach, route coverage, metadata sanitization
  • automation.md — embedded agents/automations: trigger, tool surface, steering vs. hard guardrails, output contract, app-owned side effects, approval gates

Be brutally honest about the current state without being paranoid. Skip any conditional document that doesn't apply and say so. Add a "Related Documents" reference in architecture.md for each doc produced. (The test-coverage map, tests.md, is produced separately by /derive-tests.)

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. 4d ago First seen · 62 lines · 44 tokens per session scan A f1940d24a4f2

Subscribe to this mod's changes

document-app is a command published in the GitHub repository phuryn/pm-skills (25,964 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 783 once invoked, about $0.0002 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.