$npx -y skills add totvs/engpro-advpl-tlpp-skills --skill documentation-writerGenerate ProtheusDOC comment blocks for AdvPL and TLPP source code. Use when a user says "document this function", "add ProtheusDOC", "write documentation block", "document this class/method", or needs structured source-code documentation following the Protheus.doc standard for f
| 1 | # ProtheusDOC Documentation Writer |
| 2 | |
| 3 | You are an expert in writing ProtheusDOC comment blocks for AdvPL and TLPP source code following the official TOTVS standard. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | ProtheusDOC is a structured comment format that self-documents AdvPL/TLPP source files. Each block starts with `/*/{Protheus.doc}`, contains an identifier (the element name), a brief description, a required `@type` tag, optional tags, and closes with `/*/`. The generated HTML documentation comes from these blocks. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - Adding documentation to new or existing functions, classes, methods |
| 12 | - Generating ProtheusDOC blocks for undocumented source files |
| 13 | - Reviewing and correcting existing ProtheusDOC blocks for completeness |
| 14 | - Batch-documenting all elements in a `.prw` or `.tlpp` source file |
| 15 | |
| 16 | --- |
| 17 | |
| 18 | ## ProtheusDOC Block Structure |
| 19 | |
| 20 | Every ProtheusDOC block follows this structure: |
| 21 | |
| 22 | ``` |
| 23 | /*/{Protheus.doc} <Identifier> |
| 24 | <Brief description of the element> |
| 25 | @type <element-type> |
| 26 | [optional tags...] |
| 27 | /*/ |
| 28 | ``` |
| 29 | |
| 30 | ### Rules |
| 31 | |
| 32 | - The block **must** open with `/*/{Protheus.doc}` followed by a space and the identifier |
| 33 | - The **identifier** must match exactly: |
| 34 | - **Functions**: the function name (e.g., `areaQuad`) |
| 35 | - **Classes**: the class name (e.g., `TReceivable`) |
| 36 | - **Methods**: `ClassName::MethodName` (e.g., `TReceivable::New`) |
| 37 | - The **brief description** is a concise sentence immediately after the identifier line |
| 38 | - The `@type` tag is **mandatory** — it disambiguates elements with the same name |
| 39 | - The block **must** close with `/*/` |
| 40 | - Optional parameters use brackets: `[paramName]` |
| 41 | |
| 42 | --- |
| 43 | |
| 44 | ## Supported Tags Reference |
| 45 | |
| 46 | | Tag | Parameters | Multiple | Description | |
| 47 | | -------------- | --------------------------------- | -------- | --------------------------------------------------------- | |
| 48 | | `@type` | `function` \| `class` \| `method` | No | **Required.** Element type being documented | |
| 49 | | `@author` | name-text | No | Author name | |
| 50 | | `@since` | date or version text | No | When the element was introduced | |
| 51 | | `@version` | version-text | No | Product/server version required | |
| 52 | | `@param` | name, type, description | Yes | Parameter specification. Use `[name]` for optional params | |
| 53 | | `@return` | type, description | No | Return value specification | |
| 54 | | `@description` | text | No | Extended description for additional detail | |
| 55 | | `@example` | code-text | Yes | Code usage example | |
| 56 | | `@sample` | code-text | Yes | Alias for `@example` | |
| 57 | | `@see` | reference-text | Yes | Cross-reference ("See also") | |
| 58 | | `@table` | table-name [, table-name]\* | No | Tables used by the element | |
| 59 | | `@obs` | text | Yes | Observation/note | |
| 60 | | `@deprecated` | text | No | Deprecation reason and replacement | |
| 61 | | `@history` | date, author, description | Yes | Change history entries | |
| 62 | | `@link` | URI [, label] | Yes | Hyperlink reference | |
| 63 | | `@todo` | text | Yes | Pending task | |
| 64 | | `@protected` | _(none)_ | No | Marks method as non-public scope | |
| 65 | | `@readonly` | _(none)_ | No | Marks property as read-only | |
| 66 | | `@proptype` | type-text | No | Property data type | |
| 67 | | `@defvalue` | value-text | No | Default value for property | |
| 68 | | `@accessLevel` | level-text | No | Access level |