document-generate — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited document-generate (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use when asked to "write docs", "generate documentation", "document this feature", "create a tutorial", or "explain this module".
eval "$(~/.vibestack/bin/vibe-slug 2>/dev/null)" 2>/dev/null || SLUG="unknown"
_LEARN_FILE="${VIBESTACK_HOME:-$HOME/.vibestack}/projects/${SLUG:-unknown}/learnings.jsonl"
if [ -f "$_LEARN_FILE" ]; then
_LEARN_COUNT=$(wc -l < "$_LEARN_FILE" 2>/dev/null | tr -d ' ')
echo "LEARNINGS: $_LEARN_COUNT entries loaded"
if [ "$_LEARN_COUNT" -gt 5 ] 2>/dev/null; then
~/.vibestack/bin/vibe-learnings-search --limit 5 2>/dev/null || true
fi
else
echo "LEARNINGS: none yet"
fi{{include lib/snippets/session-host.md}}
{{include lib/snippets/decision-brief.md}}
{{include lib/snippets/working-protocols.md}}
{{include lib/snippets/state-protocols.md}}
Determine which branch this work targets, or the repo's default branch:
BASE=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null \
|| git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||' \
|| git rev-parse --verify origin/main >/dev/null 2>&1 && echo main \
|| git rev-parse --verify origin/master >/dev/null 2>&1 && echo master \
|| echo main)
echo "Base branch: $BASE"Use $BASE in subsequent git diff / git log commands.
You are running the /document-generate workflow. Your job: produce high-quality, structured documentation for features, modules, or an entire project. You research the code thoroughly before writing a single line of documentation.
This skill can be invoked two ways:
You follow the Diataxis framework — four quadrants of documentation, each serving a different reader need:
Philosophy: research the whole, then write the parts. Like an architect who surveys the entire site before drawing a single room, you read the full codebase surface before writing any documentation. This prevents the "documentation that describes half the feature" failure mode.
docs/ directory)RECOMMENDATION: Choose C because it maximizes both discoverability and depth.
docs/ directory, follow its conventionsdocs/This is the most important step. Do not skip or rush it. The quality of your documentation is directly proportional to how well you understand the code.
find . -type f -not -path "./.git/*" -not -path "./node_modules/*" -not -path "./.vibestack/*" -not -path "./dist/*" -not -path "./build/*" -not -path "./.next/*" | head -200// NOTE:, // DESIGN:, // WHY:Target: [feature/module name]
Purpose: [one sentence — what problem does it solve?]
Key concepts: [list the 3-5 concepts a reader must understand]
Public surface: [commands, functions, config options, API endpoints]
Dependencies: [what it needs from other modules]
Dependents: [what relies on it]
Edge cases: [from reading tests and code]
Design decisions: [any non-obvious "why" choices]For each target entity, decide which Diataxis quadrants to produce. Not every entity needs all four.
Decision matrix:
| Entity type | Tutorial? | How-to? | Reference? | Explanation? |
|---|---|---|---|---|
| New feature a user interacts with | ✅ | ✅ | ✅ | Maybe |
| CLI command or flag | Maybe | ✅ | ✅ | No |
| Internal module/architecture | No | No | ✅ | ✅ |
| Config option | No | ✅ | ✅ | No |
| Design pattern / philosophy | No | No | No | ✅ |
| API endpoint | Maybe | ✅ | ✅ | No |
| Workflow (multi-step process) | ✅ | ✅ | No | Maybe |
Output the partition plan:
Documentation plan:
[entity] [tutorial] [how-to] [reference] [explanation]
Widget system ✅ new ✅ new ✅ new ✅ new
--verbose flag ❌ ✅ new ✅ inline ❌
Bayesian scheduler ❌ ❌ ✅ new ✅ newIf the plan has more than 5 documents to create, use AskUserQuestion to confirm before proceeding. For smaller scopes, proceed directly.
Reference docs are the foundation. They are factual, complete, and derived directly from code. Write these before tutorials or how-tos because they establish the vocabulary.
Reference doc template:
# [Entity Name]
[One paragraph: what it is, what it does, when you'd use it.]
## API / Interface
[Complete listing of public surface: functions, commands, config options, parameters.
Include types, defaults, and constraints. Pull directly from code — do not paraphrase
loosely.]
## Options / Configuration
[If applicable: every option with its type, default, and effect.]
## Examples
[2-3 concrete examples showing actual usage. Prefer real command output or code that
would actually compile/run.]
## Related
[Links to other reference docs, how-tos, or explanations that provide context.]Rules for reference docs:
string (max 256 chars, must match ^[a-z-]+$)" is reference-grade.
Explanation docs answer "why does this work this way?" They are the design rationale.
Explanation doc template:
# [Concept / Design Decision]
[Opening paragraph: the problem this design solves, stated in terms a smart reader
who hasn't seen the code would understand.]
## The problem
[Concrete description of what goes wrong without this design. Real failure modes,
not abstract risks.]
## The approach
[How the design solves the problem. Include diagrams (ASCII or Mermaid) for
architectural concepts.]
## Trade-offs
[What was given up. Every design decision trades something — name it explicitly.]
## Alternatives considered
[If discoverable from code comments, ADRs, or git history: what was tried or
rejected and why.]Rules for explanation docs:
How-tos are task-oriented. They assume the reader knows the basics and wants to accomplish something specific.
How-to doc template:
# How to [accomplish specific task]
[One sentence: what you'll accomplish and the end result.]
## Prerequisites
[What the reader needs before starting. Be specific — versions, installed tools,
config state.]
## Steps
1. [Action verb] [specific instruction]
[exact command]
[Expected output or result, if non-obvious.]
2. [Next step...]
## Verification
[How to confirm it worked. A command, a URL to visit, a test to run.]
## Troubleshooting
[Common failure modes and their fixes. Pull from tests and error handling code.]Rules for how-to docs:
Tutorials are learning-oriented. They take a newcomer from zero to a working example. These are the hardest to write well and the most valuable.
Tutorial doc template:
# [Tutorial title — describes what you'll build/learn]
[Opening paragraph: what you'll build, why it's useful, and what you'll understand
by the end. Keep it concrete — "You'll build a working X that does Y" not
"This tutorial covers X".]
## What you'll need
[Prerequisites: tools, versions, prior knowledge. Link to installation guides.]
## Step 1: [Set up the foundation]
[Start from a clean state. Show every command. Explain what each does on first
encounter — but briefly, not a lecture.]
[exact command]
[Brief explanation of what just happened.]
## Step 2: [Build the first working piece]
[Get to a working, visible result as fast as possible. The reader should see
something happen within the first 3 steps.]
...
## Step N: [Final step]
## What you built
[Recap: what the reader now has and what it can do. Link to reference docs
for deeper exploration. Suggest next steps.]Rules for tutorials:
the tutorial is too slow.
what changes.
After writing all documents:
Every how-to should link to its reference. Tutorials should link to both.
README.md. If a docs framework is in use, add to the sidebar/nav config.
]( references that point to files that don't exist.Before committing, review each document against these criteria:
Accuracy gate:
Completeness gate:
Voice gate:
Fix any failures before proceeding.
Secret scan before commit. Doc generators routinely emit example credentials that look real. Before staging, scan every generated/updated documentation file for high-confidence secrets. On a match, stop: name the file and matched pattern, and tell the user to redact (and rotate if the secret is real) before re-running. Do not commit.
{{include lib/snippets/secret-scan-patterns.md}}
git add -A or git add .).git commit -m "$(cat <<'EOF'
docs: generate [scope] documentation (Diataxis)
[One-line summary of what was documented]
Quadrants: [list which quadrants were produced]
Co-Authored-By: Claude Opus 4.7 <[email protected]>
EOF
)"git push## Documentation Generated section listingevery new file with its Diataxis quadrant and a one-line description:
## Documentation Generated
| File | Quadrant | Description |
|------|----------|-------------|
| docs/tutorial-getting-started.md | Tutorial | Walk-through from install to first working example |
| docs/reference-widget-api.md | Reference | Complete widget API with types, defaults, examples |
| docs/explanation-bayesian-scheduler.md | Explanation | Why the scheduler uses Bayesian inference |
| docs/howto-custom-widgets.md | How-to | Creating and registering custom widgets |Documentation generated:
Scope: [what was documented]
Files: [N] new, [M] updated
Coverage:
Tutorials: [count] ([list])
How-tos: [count] ([list])
Reference: [count] ([list])
Explanation: [count] ([list])
Quality: [pass/fail on each gate]existing docs. Insufficient research produces surface-level documentation.
the actual code. If you're unsure about a detail, read the source again — do not guess.
or reference content into how-tos. Each quadrant has a specific reader in a specific mode.
restructure the tutorial.
who hasn't seen the code. Never corporate, never academic.
"minimal viable docs" — write complete docs. Boil the lake.
If you discovered a non-obvious documentation pattern, Diataxis pitfall, or source-of-truth quirk during this session, log it for future sessions:
~/.vibestack/bin/vibe-learnings-log '{"skill":"document-generate","type":"TYPE","key":"SHORT_KEY","insight":"DESCRIPTION","confidence":N,"source":"SOURCE","files":["path/to/relevant/file"]}'Types: pattern (reusable approach), pitfall (what NOT to do), preference (user stated), architecture (structural decision).
Only log genuine discoveries. A good test: would this insight save time in a future session?
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.