|
/ Documentation /Developers Documentation/ Add or Remove Agent Skills surerank_pro_agent_skills

Add or Remove Agent Skills surerank_pro_agent_skills

Hook: surerank_pro_agent_skills

Description: The surerank_pro_agent_skills filter changes the skills that SureRank Pro lists in the Agent Skills index at /.well-known/agent-skills/index.json. A skill is a short instruction file that tells an AI agent how to do one task on the site. By default the index has skills for reading the site as Markdown, using the REST API, and connecting to the MCP server. The filter can add a skill of your own, or remove a built-in skill.

Source: inc/modules/ai-readability/agent-skills.php (SureRank Pro)

Usage: Use this filter to add, change, or remove skills. The filter receives one value, $skills, which is an array, and it must return an array. Each skill is listed under its name, and it has two parts:

  • description: one sentence that says what the skill does.
  • body: the full text of the skill file, including the lines at the top between --- marks.

SureRank serves the body at /.well-known/agent-skills/<name>/SKILL.md and adds a digest of the text to the index on its own.

Note:

This filter is available in SureRank Pro, version 1.12.0 or later, and it needs the Publish an Agent Skills Index switch to be on. See How to Publish Agent Discovery Files in SureRank.

Example: Add a Skill

If you’re looking to teach agents one task on your site, add the code below. Replace the name, the description, and the text with your own. The name in the first lines of the body should match the name used as the key.

// Add a skill to the Agent Skills index.
add_filter( 'surerank_pro_agent_skills', 'my_agent_skill' );

function my_agent_skill( $skills ) {
    // The key is the name of the skill. It becomes part of the address of its SKILL.md file.
    $skills['check-store-hours'] = array(
        // One sentence that says what the skill does.
        'description' => 'Find the opening hours of the store.',

        // The full text of the SKILL.md file, including the lines between the --- marks at the top.
        'body'        => "---\nname: check-store-hours\ndescription: \"Find the opening hours of the store.\"\n---\n\n# Check the store hours\n\n- The opening hours are on the page at https://example.com/contact/.\n",
    );

    // Always return the array.
    return $skills;
}

Example: Remove a Built-in Skill

If you’re looking to stop listing a built-in skill, add the code below. To remove a different skill, replace use-rest-api with its name: read-site-content or connect-mcp-server.

// Remove a built-in skill from the Agent Skills index.
add_filter( 'surerank_pro_agent_skills', 'my_remove_skill' );

function my_remove_skill( $skills ) {
    // Remove the skill by its name.
    unset( $skills['use-rest-api'] );

    // Always return the array.
    return $skills;
}

You can add the example code to your child theme’s functions.php file or use a plugin like Code Snippets to safely insert custom code. Using a code snippet plugin is recommended for easier management and to ensure the code remains active even if you switch themes.

Expected Outcome

After you add the first example, open https://example.com/.well-known/agent-skills/index.json in a browser. Replace example.com with your domain. The index now lists the new skill with its name, description, address, and digest.

Open the address shown in the url line to read the skill file. After you add the second example instead, the removed skill is missing from the index, and its file shows “page not found”.

Notes

  • Give every skill both a description and a body. A skill without a body shows an error message in the index and its file cannot be opened.
  • The name becomes part of the address of the skill file, so it is recommended to use only lowercase letters, numbers, and hyphens. SureRank does not check the name, and a name with a space or a slash gives an address that does not work.
  • The connect-mcp-server skill is in the list only while the MCP server card is published.
  • The AI catalog lists the Agent Skills index as one entry. It does not list each skill.
  • SureRank does not check the skills that the filter returns. Check the index and the skill file in a browser after each change.

Related Docs

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top