LLM Skill
If you use an LLM to assist with documentation — whether integrated in your IDE or at a website — you can give it the following skill to produce consistent LPCDoc comment blocks. Click the copy button on the code block to grab the full instruction set.
For Claude Code, save this as .claude/skills/lpcdoc/SKILL.md in your
project. For other tools, paste it into your LLM’s system prompt, project
instructions, or conversation context.
Select the tab for your driver.
The Skill
Section titled “The Skill”---name: lpcdocdescription: LPCDoc comment block generation guide for FluffOS. Consult when writing or updating documentation headers for LPC functions, variables, classes, and modules targeting the FluffOS driver.---
# LPCDoc Generation Guide
LPCDoc is a documentation format for LPC (Lars Pensjö C) source code.This guide targets the FluffOS driver. Follow these guidelines to produceaccurate, consistent, and useful documentation.
## Comment Block Structure
LPCDoc comments must be placed directly before the code element they documentand follow this structure:
/** * Description of the element (function, variable, etc.) * * Additional details if needed, forming a complete paragraph. * * @tags and other structured elements */
Key points:- Start with /** and end with */- Each line within the comment begins with ` * ` (space, asterisk, space)- Always leave a blank doc line (` *`) between the description and the first tag. This is mandatory even for short one-line descriptions.- Place tags after the description
## Function Documentation
For functions, document:1. Purpose/behavior of the function2. Each parameter3. Return value4. Any errors/exceptions
Example:
/** * Calculates the total damage based on attack power and defense. * * @param {int} attack - The attack power value * @param {int} defense - The defense value * @returns {int} The calculated damage amount * @throws If either value is negative */int calculate_damage(int attack, int defense) { // Implementation}
## Variable Documentation
For variables, document:1. Purpose/use of the variable2. Type information
Example:
/** * Maximum health points allowed for any player character. * * @type {int} */int MAX_PLAYER_HP = 100;
## Essential Tags
### @paramDocuments a function parameter.Syntax: @param {type} name - Description
### @returnsDocuments the function's return value.Syntax: @returns {type} Description
### @throwsDocuments what condition(s) result(s) in a throw().Syntax: @throws Condition that causes a throwThis will be evident by the appearance of throw() in the function body.
### @errorsDocuments what condition(s) result(s) in an error().Syntax: @errors Condition that causes an errorThis will be evident by the appearance of error() in the function body.
### @typeDocuments a variable's type.Syntax: @type {type}
### @exampleProvides example usage.Syntax: @example followed by code on subsequent lines
### @propertyDocuments a property of a class, struct, or @typedef.Syntax: @property {type} name - Description
### @typedefDefines a named type alias or structured shape. Use with @property tags todescribe the expected shape of a data structure.Syntax: @typedef {type} Name (simple alias)Syntax: @typedef Name followed by @property tags (structured shape)
Example:/** * @typedef PlayerData * @property {string} name - The player's display name. * @property {int} level - Current experience level. */
Then use in annotations: @param {PlayerData} data
### @fileProvides file-level documentation at the top of a file.Syntax: @file path/to/file.c
### @seeReferences another function, file, or resource.Syntax: @see reference
### @overrideIndicates a function overrides an inherited definition.
### @inheritdocInherits documentation from the parent function definition. The languageserver pulls description, params, and returns from the inherited function.Can be combined with additional text to extend the inherited docs.
### @deprecatedMarks code as deprecated. Include what to use instead.Syntax: @deprecated Use replacement() instead.
### @private / @protected / @publicDocuments visibility of a function or variable.
### @linkInline link to another element within descriptions.Syntax: {@link reference}
## Types Reference
### Primitive Types- int - Integer- float - Floating-point number- string - Text string- object - Generic object- mapping - Key-value structure- function - Function reference- buffer - Binary data buffer- class - Structured data type- struct - Structured data type- mixed - Any type- void - No return value
### Named ObjectsFor objects of specific types, enclose the path in quotes:{"/path/to/object.c"}Example: {"/std/player.c"}
If a macro is defined for a common object path(e.g. #define STD_USER "/std/user.c"), use the macro name directly:{STD_USER}
### ArraysAppend * to a type:{type*}Example: {string*} for string array
### MappingsFor mappings with specific key/value types:{([ keytype: valuetype ])}Example: {([ string: int ])} for string-to-int mapping
### Union TypesSeparate types with pipe:{type1 | type2}Example: {int | string}
### Reference & Variadic ParametersThese markers attach to the parameter, not the type:- Pass-by-reference: put & after the {type}, before the name. @param {int} & value (mirrors the signature `int & value` / `int ref value`)- Variadic (rest): prefix the type with ... @param {...int} rest (a function taking any number of trailing ints)
### Optional ParametersWrap the name in brackets:@param {type} [name] - Description
With default values:@param {type} [name=default] - Description
### Undefined ValuesFor values that might be undefined:@returns {type | undefined} Description
### ClassesDocument with @property tags above the definition:
/** * Description of the class. * * @property {type} name - Description */class ClassName { // members}
## Function/Variable Visibility
Visibility tags (@public, @protected, @private) should be the first tag whenapplicable. Functions and variables are public by default.
Visibility sections affect everything that follows:
protected:void func1(); // protected
private:void func2(); // private
public:void func3(); // public
## Practical Guidelines
1. Be concise but complete in descriptions2. Document all parameters and return values3. Note any side effects or state changes4. Include @example for complex functions5. Specify types as precisely as possible6. Document error conditions with @errors and throw conditions with @throws7. Do not modify code — only add or update documentation comments---name: lpcdocdescription: LPCDoc comment block generation guide for LDMud. Consult when writing or updating documentation headers for LPC functions, variables, structs, and modules targeting the LDMud driver.---
# LPCDoc Generation Guide
LPCDoc is a documentation format for LPC (Lars Pensjö C) source code.This guide targets the LDMud driver. Follow these guidelines to produceaccurate, consistent, and useful documentation.
## Comment Block Structure
LPCDoc comments must be placed directly before the code element they documentand follow this structure:
/** * Description of the element (function, variable, etc.) * * Additional details if needed, forming a complete paragraph. * * @tags and other structured elements */
Key points:- Start with /** and end with */- Each line within the comment begins with ` * ` (space, asterisk, space)- Always leave a blank doc line (` *`) between the description and the first tag. This is mandatory even for short one-line descriptions.- Place tags after the description
## Function Documentation
For functions, document:1. Purpose/behavior of the function2. Each parameter3. Return value4. Any errors/exceptions
Example:
/** * Calculates the total damage based on attack power and defense. * * @param {int} attack - The attack power value * @param {int} defense - The defense value * @returns {int} The calculated damage amount * @throws If either value is negative */int calculate_damage(int attack, int defense) { // Implementation}
## Variable Documentation
For variables, document:1. Purpose/use of the variable2. Type information
Example:
/** * Maximum health points allowed for any player character. * * @type {int} */int MAX_PLAYER_HP = 100;
## Essential Tags
### @paramDocuments a function parameter.Syntax: @param {type} name - Description
### @returnsDocuments the function's return value.Syntax: @returns {type} Description
### @throwsDocuments what condition(s) result(s) in a throw().Syntax: @throws Condition that causes a throwThis will be evident by the appearance of throw() in the function body.
### @errorsDocuments what condition(s) result(s) in an error().Syntax: @errors Condition that causes an errorThis will be evident by the appearance of error(), raise_error(), or similarin the function body.
### @typeDocuments a variable's type.Syntax: @type {type}
### @exampleProvides example usage.Syntax: @example followed by code on subsequent lines
### @propertyDocuments a property of a struct or @typedef.Syntax: @property {type} name - Description
### @typedefDefines a named type alias or structured shape. Use with @property tags todescribe the expected shape of a data structure.Syntax: @typedef {type} Name (simple alias)Syntax: @typedef Name followed by @property tags (structured shape)
Example:/** * @typedef PlayerData * @property {string} name - The player's display name. * @property {int} level - Current experience level. */
Then use in annotations: @param {PlayerData} data
### @fileProvides file-level documentation at the top of a file.Syntax: @file path/to/file.c
### @seeReferences another function, file, or resource.Syntax: @see reference
### @overrideIndicates a function overrides an inherited definition.
### @inheritdocInherits documentation from the parent function definition. The languageserver pulls description, params, and returns from the inherited function.Can be combined with additional text to extend the inherited docs.
### @deprecatedMarks code as deprecated. Include what to use instead.Syntax: @deprecated Use replacement() instead.
### @private / @protected / @publicDocuments visibility of a function or variable.
### @linkInline link to another element within descriptions.Syntax: {@link reference}
## Types Reference
### Primitive Types- int - Integer- float - Floating-point number- string - Text string- object - Generic object- mapping - Key-value structure- closure - Closure value (callable reference)- symbol - Quoted identifier for use with lambda closures- lwobject - Lightweight object- bytes - Byte sequence for raw binary data- struct - Structured data type- status - Historical alias for int- mixed - Any type- void - No return value
### Named ObjectsFor objects of specific types, use the named object syntax:{object "/path/to/object.c"} or {"/path/to/object.c"}Example: {object "/std/player.c"}
If a macro is defined for a common object path(e.g. #define STD_USER "/std/user.c"), use the macro name directly:{STD_USER}
### ArraysAppend * to a type:{type*}Example: {string*} for string array
### MappingsFor mappings with specific key/value types:{([ keytype: valuetype ])}Example: {([ string: int ])} for string-to-int mapping
### Union TypesSeparate types with pipe:{type1 | type2}Example: {int | string}
### Variadic ParametersFor a parameter that takes any number of trailing arguments, prefix the typewith ...:@param {...int} rest
### Optional ParametersWrap the name in brackets:@param {type} [name] - Description
With default values:@param {type} [name=default] - Description
### Undefined ValuesFor values that might be undefined:@returns {type | undefined} Description
### StructsDocument with @property tags above the definition:
/** * Description of the struct. * * @property {type} name - Description */struct StructName { // members};
## Function/Variable Visibility
Visibility tags (@public, @protected, @private) should be the first tag whenapplicable. Functions and variables are public by default.
Visibility sections affect everything that follows:
protected:void func1(); // protected
private:void func2(); // private
public:void func3(); // public
## Practical Guidelines
1. Be concise but complete in descriptions2. Document all parameters and return values3. Note any side effects or state changes4. Include @example for complex functions5. Specify types as precisely as possible6. Document error conditions with @errors and throw conditions with @throws7. Do not modify code — only add or update documentation commentsFleshing Out Your Skill
Section titled “Fleshing Out Your Skill”The base skill above covers the LPCDoc format itself. Most projects benefit from appending additional sections that tell the LLM how you want it applied. Below are some common conventions you can copy into your skill.
Tag Ordering
Section titled “Tag Ordering”Establishing a consistent tag order makes doc blocks predictable and scannable.
## Tag Ordering
Tags should appear in the following order:
1. Visibility tags (@public, @protected, @private) always come first2. @override (if applicable)3. @apply (if this is a driver apply)4. @param (one per parameter, in declaration order)5. @returns6. @errors (only if error() is called)7. @throws (only if throw() is called)8. @example9. Any other tagsLine Length
Section titled “Line Length”If your project enforces a line width, tell the LLM explicitly.
## Line Length
- All documentation lines should wrap at 79 characters- Maintain proper indentation when wrapping- Use complete sentences even when wrappingWhat Not to Document
Section titled “What Not to Document”Every project has elements that don’t need doc blocks. Listing exclusions prevents the LLM from generating unnecessary noise.
## What Not to Document
Unless specifically instructed, do not document:
1. Forward declarations2. Preprocessor directives (#include, #define, etc.)3. inherit statements4. Standard setup functions (list the function names for your lib)File Header Documentation
Section titled “File Header Documentation”A structured file header gives every source file a consistent preamble. Tags
like @created, @last_modified, and @history are not recognised by the
language server, but they are useful metadata for humans and LLMs alike.
## File Header Documentation
Every file should have a header block in this format:
/** * @file /path/to/file.c * * Description of this file and its purpose. * * @created YYYY-MM-DD - Author * @last_modified YYYY-MM-DD - Author * * @history * YYYY-MM-DD - Author - Created */Custom Tags
Section titled “Custom Tags”LPCDoc tags do not need to be recognised by the language server to be useful. If your project has conventions that benefit from structured tags, define them.
## Custom Tags
### @applyMarks a function as a driver apply (called by the driver, not by user code).Place this tag before @param.
### @errorsDocuments conditions that trigger an error() call. Distinct from @throws,which documents throw() calls.Code-Only Restrictions
Section titled “Code-Only Restrictions”When using an LLM specifically for documentation passes, it helps to be explicit about scope.
## Imperative Information
Do not touch the code. For documentation purposes, we only need comments.There will be no reason to opine on things like parens placement, semicolonchanges, etc., by updating the code sections of a file. Restrict activitiesto only documentation.