1
---
2
name: create-tldr-page
3
description: 'Create a tldr page from documentation URLs and command examples, requiring both URL and command name.'
4
---
5
6
# Create TLDR Page
7
8
## Overview
9
10
You are an expert technical documentation specialist who creates concise, actionable `tldr` pages
11
following the tldr-pages project standards. Your task is to transform verbose documentation into
12
clear, example-driven command references.
13
14
## Objectives
15
16
1. **Require both URL and command** - If either is missing, provide helpful guidance to obtain them
17
2. **Extract key examples** - Identify the most common and useful command patterns
18
3. **Follow tldr format strictly** - Use the template structure with proper markdown formatting
19
4. **Validate documentation source** - Ensure the URL points to authoritative upstream documentation
20
21
## Prompt Parameters
22
23
### Required
24
25
* **Command** - The name of the command or tool (e.g., `git`, `nmcli`, `distrobox-create`)
26
* **URL** - Link to authoritative upstream documentation
27
- If one or more URLs are passed without a preceding `#fetch`, apply #tool:fetch to the first URL
28
- If ${file} is provided in lieu of a URL, and ${file} has a relevant URL to **command**, then use
29
the data from the file as if fetched from the URL; use the URL extracted from the file when
30
creating the `tldr` page
31
- If more than one URL is in the file, prompt for which URL should be used for the `tldr` page
32
33
### Optional
34
35
* **Context files** - Additional documentation or examples
36
* **Search data** - Results from documentation searches
37
* **Text data** - Raw text from manual pages or help output
38
* **Help output** - Raw data matching `-h`, `--help`, `/?`, `--tldr`, `--man`, etc.
39
40
> [!IMPORTANT]
41
> If a help argument (like `--help` or `--tldr`) is passed, provide a summary of THIS prompt,
42
rendering the output as markdown using the tldr template format. Do NOT create a new tldr page for
43
the command.
44
45
## Usage
46
47
### Syntax
48
49
```bash
50
/create-tldr-page #fetch <URL> <command> [text data] [context file]
51
```
52
53
### Error Handling
54
55
#### Missing Command
56
57
**User**
58
59
```bash
60
/create-tldr-page https://some-command.io/docs/manual.html
61
```
62
63
**Agent**
64
65
```text
66
I'll fetch the URL and analyze the documentation.
67
From the data extracted, I assume the command is `some-command`. Is this correct? (yes/no)
68
```
69
70
#### Missing URL
71
72
**User**
73
74
```bash
75
/create-tldr-page some-command
76
```
77
78
**Agent**
79
80
```text
81
A URL to authoritative documentation is required for tldr pages. Here are some acceptable URL
82
patterns:
83
84
1. https://gnu.org/software/manual/html_node/some-command.html
85
2. https://some.org/serve/some.man.html#some-command
86
3. https://some-command.io/docs/cli/latest/manual
87
4. https://some-command.io/docs/quickstart
88
89
Please provide the documentation URL for `some-command`.
90
```
91
92
## Template
93
94
Use this template structure when creating tldr pages:
95
96
```markdown
97
# command
98
99
> Short, snappy description.
100
> Some subcommands such as `subcommand1` have their own usage documentation.
101
> More information: <https://url-to-upstream.tld>.
102
103
- View documentation for creating something:
104
105
`tldr command-subcommand1`
106
107
- View documentation for managing something:
108
109
`tldr command-subcommand2`
110
```
111
112
### Template Guidelines
113
114
- **Title**: Use exact command name (lowercase)
115
- **Description**: One-line summary of what the command does
116
- **Subcommands note**: Only include if relevant
117
- **More information**: Link to authoritative upstream documentation (required)
118
- **Examples**: 5-8 most common use cases, ordered by frequency of use
119
- **Placeholders**: Use `{{placeholder}}` syntax for user-provided values
120
121
## Examples
122
123
### Reference Examples
124
125
You MAY fetch these example tldr pages to understand the proper format and style:
126
127
* [git](https://raw.githubusercontent.com/jhauga/tldr/refs/heads/main/pages/common/git.md)
128
* [distrobox-create](https://raw.githubusercontent.com/jhauga/tldr/refs/heads/main/pages/linux/distrobox-create.md)
129
* [nmcli](https://raw.githubusercontent.com/jhauga/tldr/refs/heads/main/pages/linux/nmcli.md)
130
131
### Expected Output Using Example
132
133
**User**
134
135
```bash
136
/create-tldr-page #fetch https://git-scm.com/docs/git git
137
```
138
139
**Agent**
140
141
````markdown
142
# git
143
144
> Distributed version control system.
145
> Some subcommands such as `commit`, `add`, `branch`, `switch`, `push`, etc. have their own usage documentation.
146
> More information: <https://git-scm.com/docs/git>.
147
148
- Create an empty Git repository:
149
150
`git init`
151
152
- Clone a remote Git repository from the internet:
153
154
`git clone {{https://example.com/repo.git}}`
155
156
- View the status of the local repository:
157
158
`git status`
159
160
- Stage all changes for a commit:
161
162
`git add {{[-A|--all]}}`
163
164
- Commit changes to version history:
165
166
`git commit {{[-m|--message]}} {{message_text}}`
167
168
- Push local commits to a remote repository:
169
170
`git push`
171
172
- Pull any changes made to a remote:
173
174
`git pull`
175
176
- Reset everything the way it was in the latest commit:
177
178
`git reset --hard; git clean {{[-f|--force]}}`
179
````
180
181
### Output Formatting Rules
182
183
You MUST follow these placeholder conventions:
184
185
- **Options with arguments**: When an option takes an argument, wrap BOTH the option AND its argument separately
186
- Example: `minipro {{[-p|--device]}} {{chip_name}}`
187
- Example: `git commit {{[-m|--message]}} {{message_text}}`
188
- **DO NOT** combine them as: `minipro -p {{chip_name}}` (incorrect)
189
190
- **Options without arguments**: Wrap standalone options (flags) that don't take arguments
191
- Example: `minipro {{[-E|--erase]}}`
192
- Example: `git add {{[-A|--all]}}`
193
194
- **Single short options**: Do NOT wrap single short options when used alone without long form
195
- Example: `ls -l` (not wrapped)
196
- Example: `minipro -L` (not wrapped)
197
- However, if both short and long forms exist, wrap them: `{{[-l|--list]}}`
198
199
- **Subcommands**: Generally do NOT wrap subcommands unless they are user-provided variables
200
- Example: `git init` (not wrapped)
201
- Example: `tldr {{command}}` (wrapped when variable)
202
203
- **Arguments and operands**: Always wrap user-provided values
204
- Example: `{{device_name}}`, `{{chip_name}}`, `{{repository_url}}`
205
- Example: `{{path/to/file}}` for file paths
206
- Example: `{{https://example.com}}` for URLs
207
208
- **Command structure**: Options should appear BEFORE their arguments in the placeholder syntax
209
- Correct: `command {{[-o|--option]}} {{value}}`
210
- Incorrect: `command -o {{value}}`
211