Skip to content

[docs] Update documentation for native PolicyPlugin exports (2026-05-11) #144

@github-actions

Description

@github-actions

Documentation Updates - 2026-05-11

This PR updates the documentation based on features merged in the last 24 hours.

Features Documented

Changes Made

  • Updated docs/dev/plugins.md to document the native PolicyPlugin authoring API:
    • Expanded the authoring API list from two to three options (PolicyConfig, native PolicyPlugin, JSON)
    • Added a complete TypeScript example showing a native plugin with detectors, hooks, and recommenders
    • Explained loader detection heuristic (meta vs root-level name) and normalization behavior
    • Noted that native plugins are only supported via --policy flag or npm packages (not agentrc.config.json)
    • Showed how to reference native plugins via npm package names
  • Updated docs/concepts.md Policies overview:
    • Added "Add custom detectors and hooks via native plugin exports" as a policy capability
    • Added TypeScript/JS module policy example alongside the JSON example

Merged PRs Referenced

Notes

The docs/dev/plugins.md already had the PolicyPlugin contract type documented; this PR adds the practical authoring section showing how to actually write and export a native plugin. The auto-enable behavior (engine path auto-enabled when native plugins are present) is an implementation detail not exposed to users directly.

Generated by Daily Documentation Updater · ● 986.2K ·

  • expires on May 12, 2026, 12:43 PM UTC

Note

This was originally intended as a pull request, but GitHub Actions is not permitted to create or approve pull requests in this repository.
The changes have been pushed to branch docs/update-native-plugin-docs-2026-05-11-d75d471a45759b7a.

Click here to create the pull request

To fix the permissions issue, go to SettingsActionsGeneral and enable Allow GitHub Actions to create and approve pull requests. See also: gh-aw FAQ

Show patch preview (149 of 149 lines)
From 1acf65b45038149b4f3ed1d63c37fede8ca8b358 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Mon, 11 May 2026 12:41:22 +0000
Subject: [PATCH] docs: document native PolicyPlugin exports from module files

Add documentation for the native PolicyPlugin export feature introduced
in #141, which allows .ts/.js/.mjs module files and npm packages to
export a full PolicyPlugin object instead of being limited to the
PolicyConfig DSL.

- docs/dev/plugins.md: Add native plugin authoring section with a
  complete TypeScript example showing detectors, hooks, and recommenders.
  Update authoring API list from two to three options.
- docs/concepts.md: Mention native plugin support in the Policies
  overview and add a TypeScript policy example to the code block.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---
 docs/concepts.md    |  4 +++
 docs/dev/plugins.md | 85 +++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 87 insertions(+), 2 deletions(-)

diff --git a/docs/concepts.md b/docs/concepts.md
index cbfaad0..28247b5 100644
--- a/docs/concepts.md
+++ b/docs/concepts.md
@@ -188,9 +188,13 @@ Policies let organizations customize the readiness scoring to match their standa
 - **Disable** criteria that don't apply to your stack
 - **Override** scoring metadata (impact, required level)
 - **Set thresholds** for pass rates
+- **Add custom detectors and hooks** via native plugin exports (TypeScript/JavaScript modules)
 
 ```bash
 agentrc readiness --policy ./policies/strict.json
+
+# TypeScript/JS module policies (supports native PolicyPlugin exports)
+agentrc readiness --policy ./policies/my-policy.ts

AgentRC ships with example policies for common scenarios:
diff --git a/docs/dev/plugins.md b/docs/dev/plugins.md
index 7825af1..45923c8 100644
--- a/docs/dev/plugins.md
+++ b/docs/dev/plugins.md
@@ -81,10 +81,11 @@ Circular supersedes chains drop all involved recommendations.

Writi

... (truncated)


</details>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions