Generates MVP+ level product documentation. Run when the user is explicitly planning a new product/service/application or asks for help with project structure. Do NOT run for questions about existing code, one-off tasks ("write a script", "fix a bug"), or learning exercises.
81%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The skill creates two documents that fully describe a product for development:
When to run:
When NOT to run:
The user provides a minimal description:
If there isn't enough information — ask no more than 2 clarifying questions.
<project name>/
├── INDEX.md — table of contents
├── 1_PRODUCT_VISION/
│ └── VISION.md — product vision
├── 2_PRODUCT_SPEC/
│ └── SPEC.md — product specification
└── 3_ARTIFACTS/ — supporting materials
├── legal/ — legal documents (contracts, terms of service, privacy policies)
├── media/
│ ├── images/ — images (logos, screenshots, diagrams, mockups)
│ └── video/ — video materials (demos, tutorials)
├── content/ — page copy and marketing materials
└── examples/ — content samples, templates, test dataArtifacts are supporting materials that the documents reference. They are not source code and not additional documentation — they are concrete files needed to develop or launch the product.
| Folder | What to store |
|---|---|
legal/ | Contracts, terms of service, privacy policies, terms of use, license agreements |
media/images/ | Logos, branding, interface screenshots, architecture diagrams, page mockups |
media/video/ | Product demos, tutorial videos, presentations |
content/ | Site page copy, marketing copy, email templates, FAQs |
examples/ | Sample form submissions, content templates, test data sets |
3_ARTIFACTS/ folder and its subfolders only when there is an actual file to place there. Empty folders are not allowed.## Artifacts section with links to all files in 3_ARTIFACTS/../3_ARTIFACTS/legal/privacy-policy.mdprivacy-policy.pdf, logo-main.svgScript:
~/.config/opencode/skills/doc-gen/scripts/doc_gen.pyThe script is NOT copied into the project — it is used directly from the skill folder. In the examples below:{DOC_GEN}= the full path above.
Ask no more than 2 clarifying questions. If the requested functionality is clearly excessive for the first version — point this out before starting generation.
python3 {DOC_GEN} generate "ProjectName"
# Vision only (VISION.md):
python3 {DOC_GEN} generate "ProjectName" --only L1
# Specification only (SPEC.md):
python3 {DOC_GEN} generate "ProjectName" --only L2
# Add to existing files without overwriting them:
python3 {DOC_GEN} generate "ProjectName" --updateThe generate command does not create the 3_ARTIFACTS/ folder automatically. The folder and its subfolders are created only when an actual artifact file is placed there. If there are no artifacts — the ## Artifacts section in SPEC.md must still be present with an explicit note: "No artifacts."
Fill in strictly in this order: VISION.md → SPEC.md. All links are relative.
Mandatory filling rules:
[square brackets])After any change to the documentation, run the full validation:
python3 {DOC_GEN} validate "ProjectName"The documentation is not considered ready until validation passes without errors.
The script runs two blocks of checks in sequence:
Block 1 — Structure and content:
[...]## Artifacts section is present in SPEC.md (either with links or with "No artifacts.")3_ARTIFACTS/ is mentioned in at least one document (no "dead" artifacts)Block 2 — Consistency and contradictions (automatic):
[VISION] Pairwise check: "What's included" ↔ "What's NOT included" (≥2 shared words in a pair → flag)[VISION] Pairwise: "Goal" conflicts with "What's NOT included"[VISION→SPEC] Excluded VISION items found in SPEC operations/pages[VISION→SPEC] Key VISION capabilities not reflected in SPEC (<40% of keywords)[VISION→SPEC] "What's included" items not covered in SPEC (<35% of keywords)[SPEC] Entities not mentioned in "Key operations"[SPEC] Mandatory "Testing" subsections missing[SPEC] Glossary terms used nowhereTo run only the consistency analysis in isolation:
python3 {DOC_GEN} consistency "ProjectName"After a successful validate — perform this manually. The script does not check these things.
Readability and formatting:
**Name**:) and an arrow → — the format "user does X → gets Y"Logic and meaning: 6. The "Goal" concretely solves the "Problem" — no gap between the pain described and the product described 7. Each success metric measures the stated "Goal", not general business growth 8. "What's NOT included" does not contradict the "Key capabilities" in meaning (not just by keywords — check the actual meaning) 9. The test scenarios cover the real risks of this domain, not just boilerplate cases
Language: 10. "Key operations" describe the result for the user, not a technical process ("the user sees a list of orders", not "the system returns an array of objects") 11. The terms in the "Glossary" genuinely need explanation — don't add obvious words like "user" or "system" 12. There is no technical jargon anywhere (endpoint, CRUD, ORM, REST, JSON, etc.) — exception: an API product, where this is acceptable in the "Pages and screens" section
After every change to the documentation, create a commit:
git add docs/
git commit -m "docs: update documentation <ProjectName>"If there is no git repository — create one before the first commit:
git init
git add .
git commit -m "docs: initial documentation <ProjectName>"A git repository is required. Without it, the change history is unavailable.
# All projects in the docs/ folder:
python3 {DOC_GEN} status
# A specific project:
python3 {DOC_GEN} status "ProjectName"Prints a table: project / file / status / date.
python3 {DOC_GEN} update-status "ProjectName" "in review"
python3 {DOC_GEN} update-status "ProjectName" "approved"
python3 {DOC_GEN} update-status "ProjectName" "draft"Atomically updates Status and Date in all three files (INDEX.md, VISION.md, SPEC.md). Afterwards — create a git commit.
python3 {DOC_GEN} consistency "ProjectName"Runs only Block 2 without the structural check. Useful during iterative content edits.
Each document contains a status line at the top:
**Status:** draft | **Date:** YYYY-MM-DD| Status | Transition condition |
|---|---|
draft | Document created, not reviewed by the team |
in review | Document submitted for review |
approved | Document agreed upon and ready for development |
Update the Date on every significant change. Change history — git log -- <file>.
Bad example:
Good example:
# <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Problem
What exactly is inconvenient or doesn't work. The context. 2–4 sentences.
## Target audience
The user's role and work context. Not "all users", but a specific type. 2–4 sentences.
## Goal
What exactly we're building and for whom. 2–4 sentences.
## Key capabilities
1. **<Name>**: the user does X → gets Y
2. ...
## Success metrics
| Metric | Target value |
|---------|------------------|
| ... | a specific number |
## What's included (project scope)
Functionality that will be implemented:
1. ...
## What's NOT included
Explicit exclusions to prevent scope creep:
- Does not include X
- Does not include YThe document describes what the product consists of in business terms. No technical implementation details — but concrete enough that a developer can start without additional questions.
Mandatory sections: Links, How the system works, Glossary, Entities, Pages and screens, Key operations, Integrations, Testing.
# Product specification: <Product name>
**Status:** draft | **Date:** YYYY-MM-DD
## Links
- Vision: [VISION.md](../1_PRODUCT_VISION/VISION.md)
## How the system works
A brief description of what parts the product consists of and how they interact.
Example: "A web application with a personal dashboard and an admin panel. Data is stored
centrally, access is through a browser with no app installation required."
## Glossary
The product's key concepts. Each term has one precise definition with no synonyms.
| Term | Definition |
|--------|-------------|
| ... | ... |
## Entities
The main objects the system works with. In business terms, not database terms.
| Entity | Description | Key properties |
|----------|----------|-------------------|
| User | A registered participant in the system | Name, email, role, registration date |
| ... | ... | ... |
### Entity lifecycle
For each key entity — the allowed statuses and the transitions between them.
| Entity | Statuses | Transitions |
|----------|---------|----------|
| Order | draft → confirmed → completed → cancelled | draft→confirmed: the user clicks "Place order" |
## Pages and screens
An exhaustive list of the pages and screens that must be built.
| Page | Purpose | Key elements |
|----------|------------|-------------------|
| Home | Entry point, overview of capabilities | Navigation, benefits block, call-to-action button |
| Sign-up | Account creation | Form, validation, email confirmation |
| ... | ... | ... |
## Key operations
What users can do in the system. Group by role when there are several types.
**<Role or "All users">:**
- Operation 1: a brief description of the result
- Operation 2: a brief description of the result
## Integrations
External services without which the product doesn't work.
If there are no integrations — write: "No integrations."
| Service | Purpose |
|--------|------------|
| ... | ... |
## Testing
Functionality covered by tests.
**Critical scenarios** (must work without errors):
- The user signs up and logs into the system
- ...
**Business rules** (correctness of calculations and constraints):
- Calculation of X under condition Y
- Validation of Z
- ...
**Negative scenarios** (system behavior on errors and cancellations):
- The user enters a wrong password → the system shows "Invalid login or password", access is denied
- The user cancels an order → the status changes to "cancelled", the money is refunded within 3 business days
- ...
## Artifacts
Supporting materials for developing and launching the product.
If there are no artifacts — write: "No artifacts."
| File | Type | Purpose |
|------|-----|-----------|
| [privacy-policy.md](../3_ARTIFACTS/legal/privacy-policy.md) | Legal | Privacy policy |
| [logo-main.svg](../3_ARTIFACTS/media/images/logo-main.svg) | Image | The product's main logo |
| [homepage-copy.md](../3_ARTIFACTS/content/homepage-copy.md) | Content | Copy for the home page |
| ... | ... | ... |# Product documentation: <Name>
**Status:** draft | **Date:** YYYY-MM-DD
## Navigation
| Document | Description |
|----------|----------|
| [Vision](./1_PRODUCT_VISION/VISION.md) | Problem, audience, goal, project scope |
| [Specification](./2_PRODUCT_SPEC/SPEC.md) | Entities, pages, operations, testing |
## Quick links
- [Key capabilities](./1_PRODUCT_VISION/VISION.md#key-capabilities)
- [Pages and screens](./2_PRODUCT_SPEC/SPEC.md#pages-and-screens)
- [Testing](./2_PRODUCT_SPEC/SPEC.md#testing)
- [Artifacts](./2_PRODUCT_SPEC/SPEC.md#artifacts)
## Artifacts
| File | Description |
|------|----------|
| [Privacy policy](./3_ARTIFACTS/legal/privacy-policy.md) | Terms of personal data processing |
| ... | ... |If there are no artifacts, delete the "Artifacts" section and its table. Also delete the "Artifacts" line from "Quick links".
Replace the "Pages and screens" section with "Endpoints and commands" using a similar table structure. At the top of SPEC.md, state explicitly: "The product has no user interface." The validator accepts the renamed section — the mandatory ## Pages and screens heading must still be present, with the content replaced.
In "Key operations" — a subsection for each role. In the Glossary — a definition of each role. The "User" entity reflects the role split (a "role" property). Success metrics — separately for each role.
The script (validate / consistency) detects contradictions automatically. Resolution priority — VISION.md. Clarify with the user before finalizing SPEC.md. The documentation cannot be considered ready if validate finishes with errors in the "Consistency" block.
--update or edit them directly.Use CamelCase or a hyphen: MyProject, my-project. Spaces and the characters / \ : * ? " < > | are not allowed — doc_gen.py will reject them with an error.
Delete the table. State explicitly: "No integrations." This is the only section where an explicit negation is acceptable instead of a table.
Run doc_gen.py generate separately for each sub-product with different names. The shared top-level INDEX.md is created manually with links to each folder.
Create a git branch. Rewrite VISION.md from scratch. Revise SPEC.md completely. Don't mix the old and new concepts in one document — the old version is kept in the git history.
Until a file physically exists in 3_ARTIFACTS/ — do not mention it in SPEC.md and do not create a subfolder for it. The ## Artifacts section contains only existing links or "No artifacts." The rule: first there's a real file — then a folder is created and a link is added. Never the other way around.
When there are many files of one type — create nested subfolders inside the standard ones:
media/images/screenshots/, media/images/mockups/, legal/agreements/, content/emails/.
The structure should be self-evident without explanation — don't create a subfolder for a single file.
An artifact cannot exist without being mentioned in a document. If a file in 3_ARTIFACTS/ is referenced nowhere — either delete it or add a link in SPEC.md. "Dead" artifacts are not allowed.
A [text] pattern not followed by ( is treated as a placeholder. Exceptions: links [text](url) — not a placeholder. If the content genuinely needs square brackets not as a placeholder (for example, [RFC 7231]), use HTML escapes: [RFC 7231].
{DOC_GEN} validate) and a git commit3_ARTIFACTS/ is not created automatically — only when an actual file is placed there3_ARTIFACTS/ is mentioned in at least one document## Artifacts section (either with a table of links or with "No artifacts.")uxname/kodu
db733be
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.