mcpField
E
enonic-library-reference

enonic-library-reference

github.com/webmaxruDevelopment0309 installsUpdated 22w ago
Repository

About enonic-library-reference

enonic-library-reference is an agent skill for developers working with Enonic XP server-side libraries. It routes questions to API references and examples, then guides answers on signatures, parameters, return values, and version requirements.

Key features

  1. 01Routes queries to library references
  2. 02Looks up function signatures and parameters
  3. 03Provides return types and usage examples
  4. 04Handles cross-library patterns
  5. 05Checks troubleshooting and version notes
  6. 06Generates import blocks from a template

Use cases

  1. 01Finding an Enonic XP library function
  2. 02Combining APIs across multiple libraries
  3. 03Investigating errors or version compatibility
  4. 04Preparing controller import blocks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/webmaxru/enonic-agent-skills --skill enonic-library-reference

After installing, type/enonic-library-referencein Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

assets/
enonic-imports.template.ts
references/
examples.md
lib-auth-reference.md
lib-cms-reference.md
lib-content-reference.md
lib-context-reference.md
lib-node-reference.md
lib-platform-reference.md
lib-portal-reference.md
lib-utilities-reference.md
lib-web-reference.md
troubleshooting.md
scripts/
.gitkeep

Details

From the project README

Enonic XP Server-Side Library Reference

Procedures

Step 1: Identify the Target Library

  1. Determine which /lib/xp/* library the query relates to.

  2. Map the library to the appropriate reference file:

    LibraryReference File
    lib-contentreferences/lib-content-reference.md
    lib-nodereferences/lib-node-reference.md
    lib-authreferences/lib-auth-reference.md
    lib-portalreferences/lib-portal-reference.md
    lib-context, lib-event, lib-taskreferences/lib-context-reference.md
    lib-io, lib-mail, lib-repo, lib-schemareferences/lib-utilities-reference.md
    lib-project, lib-export, lib-scheduler, lib-valuereferences/lib-cms-reference.md
    lib-i18n, lib-websocketreferences/lib-web-reference.md
    lib-admin, lib-app, lib-auditlog, lib-cluster, lib-common, lib-grid, lib-vhostreferences/lib-platform-reference.md
  3. If the query spans multiple libraries or asks for a usage pattern, read references/examples.md.

Step 2: Look Up the Function

  1. Read the identified reference file.
  2. Locate the specific function by name.
  3. Extract the following details:
    • Signature: Function name and import path.
    • Parameters: Name, type, required/optional, default value, description.
    • Return type: Type and shape of the returned value.
    • Example: Code snippet demonstrating correct usage.

Step 3: Provide the Answer

  1. Present the function signature with its import statement.
  2. Include the parameter table with types and descriptions.
  3. Include the return type and shape.
  4. Add a usage example. If the reference file includes one, use it. Otherwise, compose a minimal working example consistent with the documented signature.
  5. Note any version requirements (e.g., "Requires XP 7.8.0+").

Step 4: Handle Cross-Library Patterns

  1. If the query involves combining multiple libraries (e.g., "create content as admin"), read references/examples.md for established patterns.
  2. If a pattern is not documented, compose it by combining individual function signatures from the relevant reference files.

Step 5: Troubleshoot Common Issues

  1. If the query describes an error or unexpected behavior, read references/troubleshooting.md.
  2. Match the error message or symptom to a known issue.
  3. Provide the documented fix and any version-compatibility notes.

Step 6: Generate Import Blocks

  1. If the user needs a reusable import block, read assets/enonic-imports.template.ts.
  2. Uncomment only the libraries required for the user's controller.

Error Handling

  • If a function is not found in any reference file, report that it may belong to a community library or a newer XP version not yet documented, and suggest checking https://developer.enonic.com/docs/xp/7.x/api.
  • If the query relates to Guillotine/GraphQL, content type schemas, or Enonic CLI, indicate that this skill does not cover those topics.
  • If a version mismatch is suspected, consult the version compatibility table in references/troubleshooting.md.

Comments

Markdown supported