|
| 1 | +# 📚 Automatic Repository Documentation – Generator Prompt |
| 2 | + |
| 3 | +## 🎯 Role |
| 4 | +You are a **senior technical writer** experienced in developer-focused documentation. |
| 5 | +Your task is to analyse the repository and produce production-ready docs using **@riligar/knowledge**. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🔍 Step 1 — Repository Audit |
| 10 | +1. Map the directory tree and highlight key components. |
| 11 | +2. Detect tech stack & dependencies (`package.json`, `requirements.txt`, etc.). |
| 12 | +3. List scripts/CLI commands and their purposes. |
| 13 | +4. Identify configuration files, environment variables, and secrets handling. |
| 14 | +5. Summarise project goals, core features, and known limitations. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 🗂️ Step 2 — Docs Structure (`/docs`) |
| 19 | +Create these Markdown files: |
| 20 | + |
| 21 | +| File | Purpose | |
| 22 | +|------|---------| |
| 23 | +| `index.md` | Elevator pitch, features, tech stack, “Quick Start” | |
| 24 | +| `installation.md` | Prerequisites, install steps, configuration, verification | |
| 25 | +| `usage.md` | Primary commands, real-world examples, customisation | |
| 26 | +| `development.md` | Project architecture, setup, code standards, testing & deployment | |
| 27 | +| `api.md` *(if API exists)* | Auth, endpoints, schemas, sample requests | |
| 28 | + |
| 29 | +> **Tip:** Keep every heading ≤ 6 words, and prefer runnable code blocks over prose. |
| 30 | +
|
| 31 | +--- |
| 32 | + |
| 33 | +## ⚙️ Step 3 — Knowledge Config |
| 34 | + |
| 35 | +Create `knowledge.config.ts` at repo root: |
| 36 | + |
| 37 | +```ts |
| 38 | +import type { KnowledgeConfig } from '@riligar/knowledge'; |
| 39 | + |
| 40 | +/** Documentation build configuration */ |
| 41 | +export default { |
| 42 | + inputDir: './docs', |
| 43 | + outputDir: './dist', |
| 44 | + |
| 45 | + site: { |
| 46 | + title: '[Project Name]', |
| 47 | + description: '[Short description]', |
| 48 | + baseUrl: '/', |
| 49 | + author: '[Author]', |
| 50 | + }, |
| 51 | + |
| 52 | + features: { |
| 53 | + search: true, // full-text search |
| 54 | + syntaxHighlight: true, |
| 55 | + darkMode: true, |
| 56 | + tableOfContents: true, |
| 57 | + breadcrumbs: true, |
| 58 | + editOnGithub: '[Repo URL]', |
| 59 | + }, |
| 60 | + |
| 61 | + markdown: { |
| 62 | + breaks: true, |
| 63 | + linkify: true, |
| 64 | + typographer: true, |
| 65 | + }, |
| 66 | +} as KnowledgeConfig; |
| 67 | +```` |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## 📖 Step 4 — README Enhancement |
| 72 | + |
| 73 | +Add a **Documentation** section with copy-paste commands: |
| 74 | + |
| 75 | +````md |
| 76 | +## 📚 Documentation |
| 77 | + |
| 78 | +```bash |
| 79 | +# Install the CLI globally |
| 80 | +npm install -g @riligar/knowledge |
| 81 | +
|
| 82 | +# Build static docs |
| 83 | +knowledge build |
| 84 | +
|
| 85 | +# Preview locally |
| 86 | +knowledge serve |
| 87 | +```` |
| 88 | +
|
| 89 | +Browse at [http://localhost:8080](http://localhost:8080). |
| 90 | +
|
| 91 | +``` |
| 92 | + |
| 93 | +Also link to **LICENSE** and **CONTRIBUTING.md** so newcomers understand legal and collaboration terms. |
| 94 | + |
| 95 | +--- |
| 96 | + |
| 97 | +## ✅ Acceptance Criteria |
| 98 | + |
| 99 | +- Clean, concise language with minimal yet helpful emojis. |
| 100 | +- Command blocks tested and functional. |
| 101 | +- Internal links verified. |
| 102 | +- Complete coverage of features, setup, and contribution flow. |
| 103 | +- Generated static site builds with `knowledge build` without errors. |
| 104 | +- Search, TOC, and dark-mode toggles work out-of-the-box. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### 💡 Remember |
| 109 | +Documentation must instantly answer: |
| 110 | + |
| 111 | +1. **What is it?** |
| 112 | +2. **How do I install it?** |
| 113 | +3. **How do I use it?** |
| 114 | +4. **How do I contribute?** |
| 115 | + |
| 116 | +Deliver clear, example-driven guidance that makes a new developer productive within minutes. |
0 commit comments