Generate Docs
# Prompt: Generate Documentation
Generate feature documentation for developers and AI context.
---
## Context
Documentation standards: @.cursor/rules/documentation-rules.mdc
Example output style: @docs/examples/product-create-feature.md
Language: **English**
## Input
**Feature name:** `FEATURE_NAME`
**Implemented files (attach with @):**
`@app/Services/...` `@routes/api.php` etc.
**Business rules:**
`BR-001, BR-002, ...` from @docs/business-rules.md
**API endpoints implemented:**
List method, path, auth requirements
## Task
Write a complete feature document with these sections:
1. **Summary** — What the feature does and why (2–4 sentences)
2. **Business rules** — Numbered list with rule IDs
3. **API reference** — Each endpoint with request/response JSON examples
4. **Data model** — Fields, types, constraints, relationships
5. **Architecture** — Which classes participate and call flow (bullet list)
6. **Error responses** — Status codes and example bodies
7. **Testing** — Checklist of scenarios covered by Pest tests
8. **Related files** — Paths to controller, service, repository, tests
## Constraints
- Use real JSON examples (valid syntax)
- No empty sections or "TBD"
- Link file paths in backticks
- Keep tone professional and beginner-friendly
## Output
Single markdown file content ready to save as:
`docs/examples/FEATURE_SLUG.md`
---
## Example (filled)
**Feature name:** Product — Create (API)
**Files:** @examples/laravel/ProductController.php @examples/laravel/ProductService.php
**Rules:** BR-001–BR-006
**Endpoints:** `POST /api/products` (auth required, `products.manage`)
Generate `docs/examples/product-create-feature.md`.when to use it
Community prompt sourced from the open-source GitHub repo YoungC0DE/cursor-ai-template (MIT). A "Generate Docs" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
codingcommunitydeveloper
source
YoungC0DE/cursor-ai-template · MIT
more in Coding
Coding✓ tested
Senior code review (strict mode)
senior staff engineer running a merciless but fair review
Coding✓ tested
Debug by hypothesis, not by guessing
debugging partner who forms theories before touching code
Coding✓ tested
Generate tests from described behavior
test engineer who writes tests that would actually catch regressions