agent-docs 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/plans/OPTIMISE.md +379 -0
- package/.cursor/plans/VERSIONING.md +207 -0
- package/.cursor/rules/IMPORTANT.mdc +97 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +13 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- package/.github/dependabot.yml +38 -0
- package/.github/pull_request_template.md +10 -0
- package/.github/workflows/format.yml +35 -0
- package/CODE_OF_CONDUCT.md +64 -0
- package/CONTRIBUTING.md +52 -0
- package/LICENSE.md +20 -0
- package/PLAN.md +707 -0
- package/README.md +133 -0
- package/SECURITY.md +21 -0
- package/docs/APEXANNOTATIONS.md +472 -0
- package/docs/APEXDOC.md +198 -0
- package/docs/CML.md +877 -0
- package/docs/CODEANALYZER.md +435 -0
- package/docs/CONTEXTDEFINITIONS.md +617 -0
- package/docs/ESLINT.md +827 -0
- package/docs/ESLINTJSDOC.md +520 -0
- package/docs/FIELDSERVICE.md +4452 -0
- package/docs/GRAPHBINARY.md +208 -0
- package/docs/GRAPHENGINE.md +616 -0
- package/docs/GRAPHML.md +337 -0
- package/docs/GRAPHSON.md +302 -0
- package/docs/GREMLIN.md +490 -0
- package/docs/GRYO.md +232 -0
- package/docs/HUSKY.md +106 -0
- package/docs/JEST.md +387 -0
- package/docs/JORJE.md +537 -0
- package/docs/JSDOC.md +621 -0
- package/docs/PMD.md +910 -0
- package/docs/PNPM.md +409 -0
- package/docs/PRETTIER.md +716 -0
- package/docs/PRETTIERAPEX.md +874 -0
- package/docs/REVENUETRANSACTIONMANAGEMENT.md +887 -0
- package/docs/TINKERPOP.md +252 -0
- package/docs/VITEST.md +706 -0
- package/docs/VSCODE.md +231 -0
- package/docs/XPATH31.md +213 -0
- package/package.json +32 -0
- package/postinstall.mjs +51 -0
- package/prettier.config.js +18 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# Optimizing Docs for AI Agents
|
|
2
|
+
|
|
3
|
+
This plan documents the process for converting high token count documentation
|
|
4
|
+
files into AI Agent-friendly low token versions without losing any essential
|
|
5
|
+
details. This plan is used by AI-powered IDEs (like Cursor) to optimize docs,
|
|
6
|
+
not by the CLI tool itself.
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
- **Terse but precise** - Every word counts, no fluff
|
|
11
|
+
- **Tables over prose** - Use tables for structured data
|
|
12
|
+
- **Bullet points for lists** - Use lists for scannability
|
|
13
|
+
- **Minimal code examples** - Only essential examples
|
|
14
|
+
- **Structured sections** - Clear, consistent organization
|
|
15
|
+
- **Reference-style formatting** - Quick reference format
|
|
16
|
+
|
|
17
|
+
## Optimization Techniques
|
|
18
|
+
|
|
19
|
+
### Text Reduction Strategies
|
|
20
|
+
|
|
21
|
+
1. **Remove redundancy:**
|
|
22
|
+
- Eliminate repeated information
|
|
23
|
+
- Remove unnecessary explanations
|
|
24
|
+
- Cut verbose descriptions
|
|
25
|
+
- Remove filler words and phrases
|
|
26
|
+
|
|
27
|
+
2. **Use abbreviations:**
|
|
28
|
+
- Use standard abbreviations where clear
|
|
29
|
+
- Abbreviate common terms (e.g., "config" for "configuration")
|
|
30
|
+
- Use symbols where appropriate (e.g., `&` for "and" in tables)
|
|
31
|
+
|
|
32
|
+
3. **Condense explanations:**
|
|
33
|
+
- Convert paragraphs to bullet points
|
|
34
|
+
- Use concise phrasing
|
|
35
|
+
- Remove examples that don't add value
|
|
36
|
+
- Focus on actionable information
|
|
37
|
+
|
|
38
|
+
### Structural Optimizations
|
|
39
|
+
|
|
40
|
+
#### Prose to Tables
|
|
41
|
+
|
|
42
|
+
Convert verbose descriptions to tables:
|
|
43
|
+
|
|
44
|
+
**Before:**
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
The `enabled` property controls whether the feature is active. It accepts a
|
|
48
|
+
boolean value. The default is `true`. When set to `false`, the feature is
|
|
49
|
+
disabled.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**After:**
|
|
53
|
+
|
|
54
|
+
```markdown
|
|
55
|
+
| Property | Type | Default | Description |
|
|
56
|
+
| -------- | ------- | ------- | -------------------------------------- |
|
|
57
|
+
| enabled | boolean | true | Controls whether the feature is active |
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
#### Lists to Tables
|
|
61
|
+
|
|
62
|
+
Convert property lists to tables:
|
|
63
|
+
|
|
64
|
+
**Before:**
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
- `name` (string): The name of the item
|
|
68
|
+
- `value` (number): The numeric value
|
|
69
|
+
- `active` (boolean): Whether the item is active
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**After:**
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
| Property | Type | Description |
|
|
76
|
+
| -------- | ------- | -------------------------- |
|
|
77
|
+
| name | string | The name of the item |
|
|
78
|
+
| value | number | The numeric value |
|
|
79
|
+
| active | boolean | Whether the item is active |
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### API Documentation to Tables
|
|
83
|
+
|
|
84
|
+
Convert API documentation to tables:
|
|
85
|
+
|
|
86
|
+
**Before:**
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
## Methods
|
|
90
|
+
|
|
91
|
+
### `getData(id: string): Promise<Data>`
|
|
92
|
+
|
|
93
|
+
Retrieves data for the given ID. Returns a Promise that resolves to a Data
|
|
94
|
+
object.
|
|
95
|
+
|
|
96
|
+
### `setData(id: string, data: Data): Promise<void>`
|
|
97
|
+
|
|
98
|
+
Sets data for the given ID. Returns a Promise that resolves when complete.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**After:**
|
|
102
|
+
|
|
103
|
+
```markdown
|
|
104
|
+
## API Reference
|
|
105
|
+
|
|
106
|
+
| Method | Parameters | Returns | Description |
|
|
107
|
+
| --------- | ------------------------ | --------------- | ------------------------------- |
|
|
108
|
+
| `getData` | `id: string` | `Promise<Data>` | Retrieves data for the given ID |
|
|
109
|
+
| `setData` | `id: string, data: Data` | `Promise<void>` | Sets data for the given ID |
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### Property Lists to Tables
|
|
113
|
+
|
|
114
|
+
Convert configuration property lists to tables:
|
|
115
|
+
|
|
116
|
+
**Before:**
|
|
117
|
+
|
|
118
|
+
```markdown
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
- `outputDir`: The output directory for generated files
|
|
122
|
+
- `format`: The output format (json, yaml, or xml)
|
|
123
|
+
- `verbose`: Enable verbose logging
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**After:**
|
|
127
|
+
|
|
128
|
+
```markdown
|
|
129
|
+
## Configuration
|
|
130
|
+
|
|
131
|
+
| Property | Type | Default | Description |
|
|
132
|
+
| --------- | ------------------------- | ---------- | ------------------------------------ |
|
|
133
|
+
| outputDir | string | `./output` | Output directory for generated files |
|
|
134
|
+
| format | 'json' \| 'yaml' \| 'xml' | 'json' | Output format |
|
|
135
|
+
| verbose | boolean | false | Enable verbose logging |
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Content Organization Patterns
|
|
139
|
+
|
|
140
|
+
1. **Group related information:**
|
|
141
|
+
- Organize by topic, not by source
|
|
142
|
+
- Group similar APIs together
|
|
143
|
+
- Cluster configuration options by category
|
|
144
|
+
|
|
145
|
+
2. **Use consistent structure:**
|
|
146
|
+
- Follow standard doc format (Overview, Configuration, API Reference, etc.)
|
|
147
|
+
- Maintain consistent section ordering
|
|
148
|
+
- Use consistent formatting within sections
|
|
149
|
+
|
|
150
|
+
3. **Prioritize essential information:**
|
|
151
|
+
- Put most important information first
|
|
152
|
+
- Move detailed explanations to end
|
|
153
|
+
- Highlight critical gotchas early
|
|
154
|
+
|
|
155
|
+
## Step-by-Step Conversion Process
|
|
156
|
+
|
|
157
|
+
### 1. Analysis
|
|
158
|
+
|
|
159
|
+
1. **Read the entire doc** to understand structure and content
|
|
160
|
+
2. **Identify optimization opportunities:**
|
|
161
|
+
- Long paragraphs that can be condensed
|
|
162
|
+
- Lists that can become tables
|
|
163
|
+
- API documentation that can be tabularized
|
|
164
|
+
- Redundant explanations
|
|
165
|
+
- Verbose examples
|
|
166
|
+
|
|
167
|
+
3. **Categorize content:**
|
|
168
|
+
- Essential information (must keep)
|
|
169
|
+
- Important information (should keep)
|
|
170
|
+
- Nice-to-have information (can condense)
|
|
171
|
+
- Redundant information (can remove)
|
|
172
|
+
|
|
173
|
+
### 2. Structure Planning
|
|
174
|
+
|
|
175
|
+
1. **Plan section organization:**
|
|
176
|
+
- Determine optimal section order
|
|
177
|
+
- Identify sections that can be merged
|
|
178
|
+
- Plan table structures for each section
|
|
179
|
+
|
|
180
|
+
2. **Design table schemas:**
|
|
181
|
+
- Determine columns for each table
|
|
182
|
+
- Plan property/API documentation tables
|
|
183
|
+
- Design configuration option tables
|
|
184
|
+
|
|
185
|
+
3. **Plan content reduction:**
|
|
186
|
+
- Identify text to condense
|
|
187
|
+
- Plan bullet point conversions
|
|
188
|
+
- Design code example reductions
|
|
189
|
+
|
|
190
|
+
### 3. Content Transformation
|
|
191
|
+
|
|
192
|
+
1. **Convert prose to tables:**
|
|
193
|
+
- Transform property descriptions
|
|
194
|
+
- Convert API documentation
|
|
195
|
+
- Tabularize configuration options
|
|
196
|
+
|
|
197
|
+
2. **Condense text:**
|
|
198
|
+
- Reduce verbose explanations
|
|
199
|
+
- Convert paragraphs to bullet points
|
|
200
|
+
- Remove redundant information
|
|
201
|
+
|
|
202
|
+
3. **Optimize code examples:**
|
|
203
|
+
- Keep only essential examples
|
|
204
|
+
- Remove verbose comments
|
|
205
|
+
- Use minimal, clear examples
|
|
206
|
+
|
|
207
|
+
4. **Restructure sections:**
|
|
208
|
+
- Reorganize for better flow
|
|
209
|
+
- Merge related sections
|
|
210
|
+
- Remove unnecessary sections
|
|
211
|
+
|
|
212
|
+
### 4. Validation
|
|
213
|
+
|
|
214
|
+
1. **Verify completeness:**
|
|
215
|
+
- Ensure all essential information retained
|
|
216
|
+
- Check no critical details lost
|
|
217
|
+
- Verify all APIs/configs documented
|
|
218
|
+
|
|
219
|
+
2. **Check accuracy:**
|
|
220
|
+
- Verify table data is correct
|
|
221
|
+
- Check code examples work
|
|
222
|
+
- Confirm no information corrupted
|
|
223
|
+
|
|
224
|
+
3. **Validate format:**
|
|
225
|
+
- Check table formatting
|
|
226
|
+
- Verify markdown syntax
|
|
227
|
+
- Ensure consistent style
|
|
228
|
+
|
|
229
|
+
## Formatting Standards
|
|
230
|
+
|
|
231
|
+
### Tables
|
|
232
|
+
|
|
233
|
+
- Use consistent column headers
|
|
234
|
+
- Align columns appropriately
|
|
235
|
+
- Use minimal but clear descriptions
|
|
236
|
+
- Include type information where relevant
|
|
237
|
+
|
|
238
|
+
### Code Examples
|
|
239
|
+
|
|
240
|
+
- Keep examples minimal and focused
|
|
241
|
+
- Remove unnecessary boilerplate
|
|
242
|
+
- Use clear, descriptive variable names
|
|
243
|
+
- Include only essential comments
|
|
244
|
+
|
|
245
|
+
### Lists
|
|
246
|
+
|
|
247
|
+
- Use bullet points for unordered lists
|
|
248
|
+
- Use numbered lists for sequential steps
|
|
249
|
+
- Keep items concise
|
|
250
|
+
- Group related items
|
|
251
|
+
|
|
252
|
+
### Sections
|
|
253
|
+
|
|
254
|
+
- Use consistent heading levels
|
|
255
|
+
- Maintain logical hierarchy
|
|
256
|
+
- Use descriptive section names
|
|
257
|
+
- Keep sections focused
|
|
258
|
+
|
|
259
|
+
## Quality Checklist
|
|
260
|
+
|
|
261
|
+
After optimization, verify:
|
|
262
|
+
|
|
263
|
+
- [ ] All essential information retained
|
|
264
|
+
- [ ] No critical details lost
|
|
265
|
+
- [ ] Tables properly formatted
|
|
266
|
+
- [ ] Code examples accurate and minimal
|
|
267
|
+
- [ ] Consistent formatting throughout
|
|
268
|
+
- [ ] Token count significantly reduced
|
|
269
|
+
- [ ] Still readable and understandable
|
|
270
|
+
- [ ] Cross-references maintained
|
|
271
|
+
- [ ] Related documentation links intact
|
|
272
|
+
|
|
273
|
+
## Common Pitfalls to Avoid
|
|
274
|
+
|
|
275
|
+
1. **Over-condensation:**
|
|
276
|
+
- Don't remove essential context
|
|
277
|
+
- Don't make information unclear
|
|
278
|
+
- Don't sacrifice clarity for brevity
|
|
279
|
+
|
|
280
|
+
2. **Inconsistent formatting:**
|
|
281
|
+
- Maintain consistent table structures
|
|
282
|
+
- Use consistent terminology
|
|
283
|
+
- Keep formatting uniform
|
|
284
|
+
|
|
285
|
+
3. **Lost information:**
|
|
286
|
+
- Verify all details preserved
|
|
287
|
+
- Check no APIs/configs missing
|
|
288
|
+
- Ensure examples still accurate
|
|
289
|
+
|
|
290
|
+
4. **Poor organization:**
|
|
291
|
+
- Maintain logical flow
|
|
292
|
+
- Keep related information together
|
|
293
|
+
- Don't fragment related content
|
|
294
|
+
|
|
295
|
+
## Success Metrics
|
|
296
|
+
|
|
297
|
+
A successfully optimized doc should:
|
|
298
|
+
|
|
299
|
+
1. **Reduce token count** by 50% or more while retaining all essential
|
|
300
|
+
information
|
|
301
|
+
2. **Maintain readability** - Still clear and understandable
|
|
302
|
+
3. **Preserve completeness** - All essential details retained
|
|
303
|
+
4. **Improve scannability** - Easier to find specific information
|
|
304
|
+
5. **Maintain accuracy** - No information corrupted or lost
|
|
305
|
+
|
|
306
|
+
## Examples
|
|
307
|
+
|
|
308
|
+
### Example 1: API Documentation
|
|
309
|
+
|
|
310
|
+
**Before (high token count):**
|
|
311
|
+
|
|
312
|
+
````markdown
|
|
313
|
+
## API Methods
|
|
314
|
+
|
|
315
|
+
### getData(id: string): Promise<Data>
|
|
316
|
+
|
|
317
|
+
This method retrieves data for the given ID. It takes a string parameter called
|
|
318
|
+
`id` that represents the unique identifier of the data you want to retrieve. The
|
|
319
|
+
method returns a Promise that resolves to a Data object containing the requested
|
|
320
|
+
data. If the data is not found, the Promise will reject with an error.
|
|
321
|
+
|
|
322
|
+
Example usage:
|
|
323
|
+
|
|
324
|
+
```typescript
|
|
325
|
+
const data = await getData('123');
|
|
326
|
+
console.log(data);
|
|
327
|
+
```
|
|
328
|
+
````
|
|
329
|
+
|
|
330
|
+
````
|
|
331
|
+
|
|
332
|
+
**After (low token count):**
|
|
333
|
+
```markdown
|
|
334
|
+
## API Reference
|
|
335
|
+
|
|
336
|
+
| Method | Parameters | Returns | Description |
|
|
337
|
+
| ------ | ---------- | ------- | ----------- |
|
|
338
|
+
| `getData` | `id: string` | `Promise<Data>` | Retrieves data for the given ID |
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
const data = await getData('123');
|
|
342
|
+
````
|
|
343
|
+
|
|
344
|
+
````
|
|
345
|
+
|
|
346
|
+
### Example 2: Configuration Options
|
|
347
|
+
|
|
348
|
+
**Before (high token count):**
|
|
349
|
+
```markdown
|
|
350
|
+
## Configuration Options
|
|
351
|
+
|
|
352
|
+
The `outputDir` option specifies the directory where generated files will be written. This should be a valid directory path. The default value is `./output` if not specified.
|
|
353
|
+
|
|
354
|
+
The `format` option determines the output format of the generated files. It can be set to `json`, `yaml`, or `xml`. The default is `json`.
|
|
355
|
+
|
|
356
|
+
The `verbose` option enables verbose logging. When set to `true`, the tool will output detailed information about its operations. The default is `false`.
|
|
357
|
+
````
|
|
358
|
+
|
|
359
|
+
**After (low token count):**
|
|
360
|
+
|
|
361
|
+
```markdown
|
|
362
|
+
## Configuration
|
|
363
|
+
|
|
364
|
+
| Property | Type | Default | Description |
|
|
365
|
+
| --------- | ------------------------- | ---------- | ------------------------------------ |
|
|
366
|
+
| outputDir | string | `./output` | Output directory for generated files |
|
|
367
|
+
| format | 'json' \| 'yaml' \| 'xml' | 'json' | Output format |
|
|
368
|
+
| verbose | boolean | false | Enable verbose logging |
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Best Practices
|
|
372
|
+
|
|
373
|
+
1. **Optimize after comprehensive** - Only optimize when doc is complete and
|
|
374
|
+
comprehensive
|
|
375
|
+
2. **Preserve essential details** - Never remove critical information
|
|
376
|
+
3. **Maintain accuracy** - Verify all information remains correct
|
|
377
|
+
4. **Test examples** - Ensure code examples still work
|
|
378
|
+
5. **Review thoroughly** - Check optimization quality before finalizing
|
|
379
|
+
6. **Iterate if needed** - Re-optimize if token count still too high
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Versioning System
|
|
2
|
+
|
|
3
|
+
This plan documents the versioning system for docs files and the project as a
|
|
4
|
+
whole.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Every file in the `docs/` directory should be versioned using semantic
|
|
9
|
+
versioning (semver). The project as a whole also maintains a version in
|
|
10
|
+
`package.json`.
|
|
11
|
+
|
|
12
|
+
## Versioning Rules
|
|
13
|
+
|
|
14
|
+
Versions are compared against the latest commit in the `main` branch. Changes
|
|
15
|
+
are categorized as:
|
|
16
|
+
|
|
17
|
+
### Patch Version Bump (x.x.X)
|
|
18
|
+
|
|
19
|
+
Minor changes or corrections:
|
|
20
|
+
|
|
21
|
+
- Typo fixes
|
|
22
|
+
- Clarifications
|
|
23
|
+
- Formatting fixes
|
|
24
|
+
- Minor corrections to existing content
|
|
25
|
+
- Small additions that don't add new sections
|
|
26
|
+
|
|
27
|
+
**Example:** Fixing a typo in an API description, correcting a code example,
|
|
28
|
+
clarifying a configuration option.
|
|
29
|
+
|
|
30
|
+
### Minor Version Bump (x.X.x)
|
|
31
|
+
|
|
32
|
+
New sections added to a file:
|
|
33
|
+
|
|
34
|
+
- Adding new API sections
|
|
35
|
+
- Adding new configuration options
|
|
36
|
+
- Adding new patterns or best practices
|
|
37
|
+
- Adding new architectural information
|
|
38
|
+
- Adding new examples or use cases
|
|
39
|
+
|
|
40
|
+
**Example:** Adding a new "Advanced Patterns" section, documenting a new API
|
|
41
|
+
method, adding new configuration properties.
|
|
42
|
+
|
|
43
|
+
### Major Version Bump (X.x.x)
|
|
44
|
+
|
|
45
|
+
Sections replaced or removed from a file:
|
|
46
|
+
|
|
47
|
+
- Removing entire sections
|
|
48
|
+
- Replacing sections with different content
|
|
49
|
+
- Breaking changes in APIs or configuration
|
|
50
|
+
- Significant restructuring of content
|
|
51
|
+
- Removing deprecated information that changes the doc's scope
|
|
52
|
+
|
|
53
|
+
**Example:** Removing a deprecated API section, restructuring the entire
|
|
54
|
+
Architecture section, removing support for a major feature.
|
|
55
|
+
|
|
56
|
+
## Project Versioning
|
|
57
|
+
|
|
58
|
+
The project as a whole maintains a version in `package.json` (starting at
|
|
59
|
+
`0.0.0`).
|
|
60
|
+
|
|
61
|
+
### Version Bump Rules
|
|
62
|
+
|
|
63
|
+
Changes to docs files should increment the project version based on the
|
|
64
|
+
**greatest change** in any docs file:
|
|
65
|
+
|
|
66
|
+
- If any doc has a **major** version bump → project gets **major** version bump
|
|
67
|
+
- Else if any doc has a **minor** version bump → project gets **minor** version
|
|
68
|
+
bump
|
|
69
|
+
- Else if any doc has a **patch** version bump → project gets **patch** version
|
|
70
|
+
bump
|
|
71
|
+
|
|
72
|
+
**Example:**
|
|
73
|
+
|
|
74
|
+
- PMD.md: patch bump (1.0.0 → 1.0.1)
|
|
75
|
+
- ESLINT.md: minor bump (1.0.0 → 1.1.0)
|
|
76
|
+
- XPATH31.md: no change
|
|
77
|
+
|
|
78
|
+
Project version: minor bump (because ESLINT.md had a minor bump, which is
|
|
79
|
+
greater than PMD.md's patch bump)
|
|
80
|
+
|
|
81
|
+
## Version Tracking
|
|
82
|
+
|
|
83
|
+
Versions can be tracked in several ways:
|
|
84
|
+
|
|
85
|
+
### Option 1: File Metadata
|
|
86
|
+
|
|
87
|
+
Add version information to each doc file:
|
|
88
|
+
|
|
89
|
+
```markdown
|
|
90
|
+
# PMD Quick Reference
|
|
91
|
+
|
|
92
|
+
**Version:** 1.0.0 **Last Updated:** 2024-01-15
|
|
93
|
+
|
|
94
|
+
...
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Option 2: Separate Version File
|
|
98
|
+
|
|
99
|
+
Maintain a `docs/VERSIONS.json` file:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"PMD.md": "1.0.0",
|
|
104
|
+
"ESLINT.md": "1.1.0",
|
|
105
|
+
"XPATH31.md": "1.0.0"
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Option 3: Git Tags
|
|
110
|
+
|
|
111
|
+
Use git tags to track versions:
|
|
112
|
+
|
|
113
|
+
- Tag format: `docs/PMD/v1.0.0`
|
|
114
|
+
- Compare against tagged versions
|
|
115
|
+
|
|
116
|
+
## Scripts for Versioning
|
|
117
|
+
|
|
118
|
+
Scripts can help with versioning by:
|
|
119
|
+
|
|
120
|
+
1. **Reading markdown files:**
|
|
121
|
+
- Detect headers/sections
|
|
122
|
+
- Parse version metadata (if using file metadata approach)
|
|
123
|
+
- Identify content structure
|
|
124
|
+
|
|
125
|
+
2. **Comparing with git:**
|
|
126
|
+
- Compare current state with latest commit in `main` branch
|
|
127
|
+
- Detect added sections (minor bump)
|
|
128
|
+
- Detect removed sections (major bump)
|
|
129
|
+
- Detect changed content (patch bump)
|
|
130
|
+
|
|
131
|
+
3. **Determining version bumps:**
|
|
132
|
+
- Analyze change types across all docs
|
|
133
|
+
- Determine appropriate version bumps
|
|
134
|
+
- Calculate project version based on greatest change
|
|
135
|
+
|
|
136
|
+
4. **Updating versions:**
|
|
137
|
+
- Update version information in docs files
|
|
138
|
+
- Update `package.json` version
|
|
139
|
+
- Generate version metadata
|
|
140
|
+
|
|
141
|
+
5. **Initializing versions:**
|
|
142
|
+
- Add version information to existing docs
|
|
143
|
+
- Initialize version tracking for new docs
|
|
144
|
+
- Set initial versions to `1.0.0`
|
|
145
|
+
|
|
146
|
+
## Workflow
|
|
147
|
+
|
|
148
|
+
1. **Make changes** to doc file(s)
|
|
149
|
+
2. **Analyze changes:**
|
|
150
|
+
- Compare with latest commit in `main` branch
|
|
151
|
+
- Categorize changes (patch/minor/major)
|
|
152
|
+
- Determine version bumps needed
|
|
153
|
+
|
|
154
|
+
3. **Update versions:**
|
|
155
|
+
- Update doc file version(s)
|
|
156
|
+
- Update project version in `package.json`
|
|
157
|
+
- Update version metadata
|
|
158
|
+
|
|
159
|
+
4. **Commit:**
|
|
160
|
+
- Commit changes with version information
|
|
161
|
+
- Include version bumps in commit message
|
|
162
|
+
- Tag release if appropriate
|
|
163
|
+
|
|
164
|
+
## Best Practices
|
|
165
|
+
|
|
166
|
+
1. **Always compare against main** - Use latest commit in `main` branch as
|
|
167
|
+
baseline
|
|
168
|
+
2. **Categorize accurately** - Be precise about patch vs minor vs major changes
|
|
169
|
+
3. **Document changes** - Note significant changes in commit messages
|
|
170
|
+
4. **Initialize properly** - Set initial versions for all existing docs
|
|
171
|
+
5. **Track consistently** - Use the same versioning approach for all docs
|
|
172
|
+
6. **Update project version** - Always update `package.json` when docs change
|
|
173
|
+
7. **Version on merge** - Determine versions when merging to `main`, not on
|
|
174
|
+
feature branches
|
|
175
|
+
|
|
176
|
+
## Examples
|
|
177
|
+
|
|
178
|
+
### Example 1: Patch Bump
|
|
179
|
+
|
|
180
|
+
**Change:** Fixed typo in API description
|
|
181
|
+
|
|
182
|
+
- Before: `getData()` - Retreives data
|
|
183
|
+
- After: `getData()` - Retrieves data
|
|
184
|
+
|
|
185
|
+
**Version:** 1.0.0 → 1.0.1 (patch)
|
|
186
|
+
|
|
187
|
+
### Example 2: Minor Bump
|
|
188
|
+
|
|
189
|
+
**Change:** Added new "Advanced Patterns" section with 5 new patterns
|
|
190
|
+
|
|
191
|
+
**Version:** 1.0.0 → 1.1.0 (minor)
|
|
192
|
+
|
|
193
|
+
### Example 3: Major Bump
|
|
194
|
+
|
|
195
|
+
**Change:** Removed entire "Legacy API" section (deprecated)
|
|
196
|
+
|
|
197
|
+
**Version:** 1.0.0 → 2.0.0 (major)
|
|
198
|
+
|
|
199
|
+
### Example 4: Project Version
|
|
200
|
+
|
|
201
|
+
**Changes:**
|
|
202
|
+
|
|
203
|
+
- PMD.md: 1.0.0 → 1.0.1 (patch)
|
|
204
|
+
- ESLINT.md: 1.0.0 → 1.1.0 (minor)
|
|
205
|
+
- XPATH31.md: 1.0.0 → 2.0.0 (major)
|
|
206
|
+
|
|
207
|
+
**Project Version:** 0.0.0 → 1.0.0 (major, because XPATH31.md had a major bump)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Important Project Guidelines
|
|
2
|
+
|
|
3
|
+
## Documentation Files
|
|
4
|
+
|
|
5
|
+
- **Use `docs/*.md` files**: Refer to and use the documentation files in the `docs/` directory for project-specific information and guidelines.
|
|
6
|
+
|
|
7
|
+
- **Use `.cursor/plans/*.md` files**: Refer to and use planning documents in the `.cursor/plans/` directory for project planning and development guidance.
|
|
8
|
+
|
|
9
|
+
## Updating Existing Documentation - CRITICAL REQUIREMENT
|
|
10
|
+
|
|
11
|
+
**MANDATORY:** When updating any file in the `docs/` directory, you **MUST** follow the documented process. This is **NON-NEGOTIABLE**.
|
|
12
|
+
|
|
13
|
+
**What you MUST do:**
|
|
14
|
+
1. **Understand the workflow first** - Before making any changes to a doc file, understand the complete workflow
|
|
15
|
+
2. **Extract references** - Extract repository URLs, web page URLs, or Salesforce article references from the doc file itself
|
|
16
|
+
3. **Re-research sources** - Extract repository URLs, web page URLs, or other references from the doc file itself. **CRITICAL:** If a repository URL is already present in the existing `docs/*.md` file, extract the repository URL directly from the doc file and proceed to cloning.
|
|
17
|
+
4. **Clone repository** - Clone repo using full permissions to system's temporary folder (if applicable)
|
|
18
|
+
5. **Systematic review** - Go through every URL on the official page and every file in the repo (verify ALL files inspected)
|
|
19
|
+
6. **Verify all content** - All content in markdown file must be verified or removed/changed
|
|
20
|
+
7. **Add missing content** - Anything missing should be added
|
|
21
|
+
8. **Cleanup** - Delete temporary repository directory after inspection
|
|
22
|
+
9. **Verify ALL todos completed** - Before proceeding, verify ALL file inspection todos are completed (count must match file count exactly)
|
|
23
|
+
10. **Optimize** - Actually execute the OPTIMISE.md plan after updates (ONLY after ALL todos completed, read it, apply techniques, don't just mark as done)
|
|
24
|
+
11. **Version** - Follow VERSIONING.md to determine and update version numbers
|
|
25
|
+
|
|
26
|
+
**What you MUST NOT do:**
|
|
27
|
+
- ❌ Update doc files without understanding the workflow first
|
|
28
|
+
- ❌ Make changes without re-researching sources
|
|
29
|
+
- ❌ Skip repository cloning for repository-based docs
|
|
30
|
+
- ❌ Skip the verification process
|
|
31
|
+
- ❌ Skip file inspection (ALL files must be inspected)
|
|
32
|
+
- ❌ Leave temporary directories on the system
|
|
33
|
+
- ❌ Mark optimization as "done" without actually executing it
|
|
34
|
+
- ❌ Skip optimization or versioning steps
|
|
35
|
+
- ❌ Begin optimization before ALL file inspection todos are completed
|
|
36
|
+
- ❌ Cancel or skip remaining todos because "essential review is complete"
|
|
37
|
+
|
|
38
|
+
**Reason:** Following the documented workflow ensures accuracy, completeness, and consistency. Skipping steps leads to incomplete or incorrect documentation.
|
|
39
|
+
|
|
40
|
+
**Enforcement:** If asked to update a doc file, **STOP** and understand the complete workflow before making any changes.
|
|
41
|
+
|
|
42
|
+
## Repository Cloning and File Inspection
|
|
43
|
+
|
|
44
|
+
## Repository File Review (Recommended Approach)
|
|
45
|
+
|
|
46
|
+
- Aim to treat all files in a repository as potentially relevant, not just the obvious ones.
|
|
47
|
+
- When documenting a repository (GitHub, GitLab, etc.), prefer a **systematic, broad review** over focusing only on a few "key files".
|
|
48
|
+
|
|
49
|
+
- When cloning repositories for documentation work:
|
|
50
|
+
- Clone to a temporary location outside the main workspace (for example, using `tmpdir()`).
|
|
51
|
+
- Avoid creating ad-hoc temp folders inside the project workspace.
|
|
52
|
+
|
|
53
|
+
- For a thorough review of a repository:
|
|
54
|
+
- Start by generating a complete file listing, excluding standard build and dependency directories:
|
|
55
|
+
```bash
|
|
56
|
+
find . -type f ! -path './.git/*' ! -path './node_modules/*' ! -path './dist/*' ! -path './coverage/*' | sort
|
|
57
|
+
```
|
|
58
|
+
- Use that listing to drive your review and note-taking process.
|
|
59
|
+
- Prioritize:
|
|
60
|
+
- All markdown files (`**/*.md`)
|
|
61
|
+
- Files that define or document the public API
|
|
62
|
+
- Exported plugins, libraries, or modules that are part of the public surface
|
|
63
|
+
|
|
64
|
+
- If you use a todo system (for example via `todo_write` and a helper script like `repo-todos`):
|
|
65
|
+
- Generate todos based on the full file list rather than hand-picking a few files.
|
|
66
|
+
- Creating todos in small batches (for example, ~20 at a time) can make the process manageable.
|
|
67
|
+
- Keep todos granular (ideally one per file) so progress and coverage are easy to track.
|
|
68
|
+
|
|
69
|
+
- As you review files:
|
|
70
|
+
- Read each file in full and extract the relevant technical and behavioral details.
|
|
71
|
+
- Update documentation incrementally as you go instead of waiting until the end.
|
|
72
|
+
- Keep a simple checkpoint for yourself (for example, “number of files reviewed” vs “number of files in listing”) so you can see whether anything has been skipped.
|
|
73
|
+
|
|
74
|
+
- Before doing higher-level optimization (like running an OPTIMISE-style pass):
|
|
75
|
+
- Make sure the underlying documentation work is complete enough for that effort to be worthwhile.
|
|
76
|
+
- Confirm that all files you decided to cover have actually been reviewed and incorporated where relevant.
|
|
77
|
+
|
|
78
|
+
- After you finish using a cloned repository for documentation:
|
|
79
|
+
- Clean up any temporary clones/directories so they don’t accumulate over time.
|
|
80
|
+
|
|
81
|
+
## Versioning
|
|
82
|
+
|
|
83
|
+
- **MUST follow [VERSIONING.md](.cursor/plans/VERSIONING.md)**: When creating or updating documentation files:
|
|
84
|
+
- **Creating new docs**: Initialize with version `1.0.0` (or appropriate version) and update project version in `package.json`
|
|
85
|
+
- **Updating existing docs**: Determine version bump (patch/minor/major) by comparing against latest commit in `main` branch, update doc version, and update project version in `package.json`
|
|
86
|
+
- See VERSIONING.md for complete rules, examples, and workflow
|
|
87
|
+
- Version changes are **required** and must be completed before finalizing any doc changes
|
|
88
|
+
|
|
89
|
+
## Scripts
|
|
90
|
+
|
|
91
|
+
- **Use scripts via pnpm**: Always run project scripts using `pnpm` as the package manager. For example:
|
|
92
|
+
- `pnpm build` - Build the project (only when explicitly needed)
|
|
93
|
+
- `pnpm test` - Run tests
|
|
94
|
+
- `pnpm lint` - Run linter
|
|
95
|
+
- `pnpm format` - Format code
|
|
96
|
+
|
|
97
|
+
- **CRITICAL PERMISSION REQUIREMENT for pnpm commands**: When running `pnpm` commands (including `pnpm install`, `pnpm build`, `pnpm test`, etc.), you **MUST** use `required_permissions: ['network']` or `required_permissions: ['all']` to ensure pnpm commands have network connectivity. pnpm commands require network access to fetch packages from registries. **DO NOT** attempt pnpm commands without network permissions - they will fail with network connectivity errors.
|