Open sandboxFocusImprove this doc

Configuring AI Coding Agents

AI coding agents such as Claude Code and OpenAI Codex write better PostSharp code when they can look up the real documentation instead of guessing from memory. The PostSharp plugin gives them the complete PostSharp documentation and API reference.

What the plugin provides

The PostSharp plugin gives your AI agent access to:

  • Conceptual documentation. All the articles of this documentation, including custom aspects, multicasting, architecture constraints, configuration, deployment, and licensing.
  • API reference. The documentation of all PostSharp namespaces and types.
  • Pattern libraries. The documentation of PostSharp Caching, Logging, Threading, Contracts, INotifyPropertyChanged, XAML, and undo/redo.
  • Instructions. Guidance on looking up the API before writing code and on checking the build messages afterward.

The plugin matches the version of the documentation it was built from. If your projects reference an older version of PostSharp, the agent is instructed to prefer the XML documentation of the referenced packages.

Installing in Claude Code

  1. Add the PostSharp marketplace to Claude Code:

    /plugin marketplace add https://github.com/postsharp/PostSharp.AI.Skills
    
  2. Install the PostSharp plugin:

    /plugin install postsharp
    

To update to a newer version:

/plugin update postsharp

Installing in OpenAI Codex

  1. Add the PostSharp marketplace to Codex:

    codex plugin marketplace add postsharp/PostSharp.AI.Skills
    
  2. Install the postsharp plugin from the plugin directory (Plugins) in the Codex app.

To update to a newer version:

codex plugin marketplace upgrade

Using the plugin

Once the plugin is installed, the agent uses it when you ask about:

  • Creating or modifying aspects
  • Applying aspects with attribute multicasting
  • Using the PostSharp Patterns libraries
  • Configuring PostSharp builds or fixing PostSharp build errors

If the agent does not seem to use PostSharp-specific knowledge, mention "PostSharp" explicitly in your prompt.

Example prompts

  • "Create an aspect that logs method entry and exit."
  • "Add caching to this service method, and invalidate it when the record is updated."
  • "Make this view model implement INotifyPropertyChanged with PostSharp."
  • "How do I apply an aspect to all public methods in a namespace?"

See Also

Other Resources

Claude Code documentation
OpenAI Codex plugin documentation