create-guardrail-plugin

Scaffold Drupal AI guardrail plugins with deterministic or non-deterministic design choices.

10|4|Updated Jan 5, 2018
One-click install
npx skills add https://github.com/markconroy/markie --skill create-guardrail-plugin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-guardrail-plugin
Source: https://github.com/markconroy/markie/tree/main/web/modules/contrib/ai/.agents/skills/create-guardrail-plugin
Command: npx skills add https://github.com/markconroy/markie --skill create-guardrail-plugin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the problem of creating a new Drupal AI guardrail plugin by turning the guardrail concept (rules, AI-based checks, and configuration) into a working plugin scaffold plus the exact implementation checklist you need.

Core Features & Use Cases

  • Deterministic or Non-Deterministic Scaffolding: Choose deterministic validation or AI-driven classification to determine the correct plugin interfaces and class structure.
  • Input/Output Guardrail Implementation Guidance: Generate method stubs for processInput() and processOutput() so you can validate or rewrite user/AI content.
  • Admin Configuration + Config Schema Planning: Provide steps to implement ConfigurableInterface + PluginFormInterface and add the required config/schema entries for strict Drupal validation.
  • Testing Guidance (Deterministic Kernel Tests): Produce a kernel test template for end-to-end verification using EchoAI and guardrail entities.

Quick Start

Use the create-guardrail-plugin skill to scaffold a new guardrail for your Drupal AI module by answering whether it is deterministic or non-deterministic and providing the plugin ID, label, description, checked logic, and configuration needs.

Frequently Asked Questions about create-guardrail-plugin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Drupal AI guardrail plugin for validating chat inputs?

Scaffolding a Drupal AI guardrail plugin involves defining its ID and label to generate processInput() and processOutput() method stubs for validating chat inputs. You then implement your specific validation logic within those generated stubs.

What is the difference between deterministic and non-deterministic AI guardrails in Drupal?

Deterministic Drupal AI guardrails apply fixed rule-based validation to chat inputs, whereas non-deterministic guardrails use AI provider integration for dynamic content classification. Your choice dictates the required plugin interfaces and class structure.

How do I add admin configuration forms to a Drupal AI guardrail plugin?

You add admin configuration to a Drupal AI guardrail plugin by implementing ConfigurableInterface and PluginFormInterface to define settings forms. You must also create corresponding config schema entries for strict Drupal configuration validation.

How do I write a kernel test for a deterministic Drupal AI guardrail?

You write a kernel test for a deterministic Drupal AI guardrail using a test template that verifies end-to-end behavior with EchoAI and guardrail entities. This validates that your deterministic logic executes correctly within the Drupal environment.

Does a non-deterministic Drupal AI guardrail require an AI provider model selection?

Yes, non-deterministic Drupal AI guardrails require AI provider and model selection for AI-driven classification. The scaffolding process includes optional AI integration setup to manage this behavior during chat input and output processing.

What configuration schema is needed for a Drupal AI guardrail plugin?

A Drupal AI guardrail plugin requires strict config schema entries matching its configurable form fields to pass Drupal configuration validation. The scaffolding process provides steps to define these schema entries alongside your plugin implementation.