Orchardcore ai chat claude

From CrestApps/CrestApps.AgentSkills · View interactive version

Orchardcore ai chat claude is an AI agent skill from the GitHub repository CrestApps/CrestApps.AgentSkills. Skill for configuring the Claude chat orchestrator in Orchard Core using the CrestApps AI Chat Claude module. Covers tenant Claude options from CrestApps AI Claude configuration and site settings, encrypted Anthropic credentials, model discovery, the anthropic orchestrator name, ClaudeSessionMetadat

How to use this skill

Skill file

Orchard Core AI Chat Claude - Prompt Templates

Configure the Claude Chat Orchestrator

You are an Orchard Core expert. Generate configuration, recipes, and extension code for Claude as an Orchard-managed chat orchestrator using CrestApps modules. Claude is not an AI provider connection or deployment provider in this integration.

Guidelines

Feature Overview

| Feature | Feature ID | Purpose |

|---|---|---|

| AI Services | CrestApps.OrchardCore.AI | Shared profile, deployment, and orchestration infrastructure |

| AI Claude Orchestrator | CrestApps.OrchardCore.AI.Chat.Claude | Claude orchestration, settings, and profile editors |

| AI Chat | CrestApps.OrchardCore.AI.Chat | Profile chat user interface when an in-site chat UI is required |

| AI Chat Interactions | CrestApps.OrchardCore.AI.Chat.Interactions | Ad-hoc chat interaction editor and hub |

Install and Enable

Install the orchestrator package in the web/startup project:

dotnet add package CrestApps.OrchardCore.AI.Chat.Claude

Enable the core and Claude features. Add a chat UI feature only when the application needs it:

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "CrestApps.OrchardCore.AI",
        "CrestApps.OrchardCore.AI.Chat.Claude",
        "CrestApps.OrchardCore.AI.Chat"
      ],
      "disable": []
    }
  ]
}

Configure Shell Defaults

Provide non-secret defaults through the tenant shell configuration. Use user secrets, environment variables, or a secret store for the API key.

{
  "CrestApps": {
    "AI": {
      "Claude": {
        "BaseUrl": "https://api.anthropic.com",
        "DefaultModel": "claude-sonnet-4-5"
      }
    }
  }
}

The configuration key is CrestApps:AI:Claude (ApiKey, BaseUrl default https://api.anthropic.com, DefaultModel). This module binds ClaudeOptions from that section before it reads tenant site settings. The example above is a tenant App_Data/Sites/{tenant}/appsettings.json; the host appsettings.json wraps the same keys in OrchardCore, and the environment-variable form is OrchardCore__CrestApps__AI__Claude__ApiKey.

CrestApps.Core reads ClaudeOptions through IOptionsSnapshot<ClaudeOptions>, so saved site settings apply on the next request without a tenant restart.

Configure Tenant Settings

  1. Enable AI Claude Orchestrator.
  2. Go to Settings → Artificial Intelligence → Claude.
  3. Set authentication to API Key.
  4. Enter the Anthropic API key, base URL, and default model.
  5. Save the settings. The editor protects the API key before it is persisted.
  6. Reopen the profile or interaction editor and select a discovered Claude model.

ClaudeOptionsConfiguration uses a data-protection purpose specific to Claude settings to unprotect the saved key for runtime use. A decryption failure logs a warning and leaves the key unavailable instead of exposing the secret.

Select Claude for an AI Profile

  1. Create or edit an AI Profile.
  2. Select the Claude orchestrator.
  3. Choose a Claude model and effort level.
  4. Configure the profile system message and capabilities normally.
  5. Save and test the profile with a user authorized to query it.

Use Claude session settings for per-profile behavior. Do not create an AIProviderConnection or an AIDeployment merely to select the Claude orchestration runtime.

The orchestrator is registered under the name anthropic (title Claude). In a recipe, set OrchestratorName and store the per-profile values in ClaudeSessionMetadata:

{
  "steps": [
    {
      "name": "AIProfile",
      "Profiles": [
        {
          "Name": "claude-assistant",
          "DisplayText": "Claude Assistant",
          "Type": "Chat",
          "OrchestratorName": "anthropic",
          "Properties": {
            "AIProfileMetadata": {
              "SystemMessage": "You are a concise technical assistant."
            },
            "ClaudeSessionMetadata": {
              "ClaudeModel": "claude-sonnet-4-5",
              "EffortLevel": "Medium"
            }
          }
        }
      ]
    }
  ]
}

Reuse Claude Settings with Templates

Use a profile-source AI Profile Template when multiple profiles should start with the same Claude model and reasoning effort:

  1. Create a template whose source is Profile.
  2. Select the Claude orchestrator.
  3. Choose the model and effort level.
  4. Create profiles from that template.

AIProfileTemplateClaudeDisplayDriver stores the template settings, and the template-to-profile flow propagates them to the generated profile.

Configure Chat Interactions

Enable CrestApps.OrchardCore.AI.Chat.Interactions when administrators need ad-hoc interactions rather than predefined profiles:

{
  "steps": [
    {
      "name": "Feature",
      "enable": [
        "CrestApps.OrchardCore.AI",
        "CrestApps.OrchardCore.AI.Chat.Claude",
        "CrestApps.OrchardCore.AI.Chat.Interactions"
      ],
      "disable": []
    }
  ]
}

In the interaction settings panel, select Claude, then select an available model and effort level. ChatInteractionClaudeDisplayDriver renders the fields, and CrestApps.Core's ClaudeChatInteractionSettingsHandler (an IChatInteractionSettingsHandler) stores them as ClaudeSessionMetadata when the panel saves over SignalR, without changing the generic interaction infrastructure.

Permission Management

The module registers ClaudePermissionProvider and the ManageClaudeSettings permission. Administrators receive it by default.

Assign the permission through a role only to trusted operators:

  1. Go to Security → Roles.
  2. Edit the operations role.
  3. Grant Manage Claude Settings.
  4. Do not grant the permission to ordinary profile authors unless they must manage tenant credentials.

Key Implementation Types

| Type | Responsibility |

|---|---|

| ClaudeOptionsConfiguration | Binds shell options, overlays site settings, and unprotects the API key |

| ClaudeSettingsDisplayDriver | Renders and updates tenant Claude settings |

| ClaudeModelSelectListFactory | Builds model choices from the configured Claude service |

| ClaudeOrchestratorAvailabilityProvider | Reports whether Claude can be selected |

| AIProfileClaudeDisplayDriver | Adds Claude settings to an AI Profile editor |

| AIProfileTemplateClaudeDisplayDriver | Adds Claude settings to a profile-template editor |

| ChatInteractionClaudeDisplayDriver | Adds Claude settings to a Chat Interaction editor |

| ClaudePermissionProvider | Provides ManageClaudeSettings, which AddSiteSettingsPermission also accepts for the Settings → Artificial Intelligence group |

| ClaudeChatInteractionSettingsHandler | CrestApps.Core handler that saves the interaction's Claude fields |

Security Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.