Agent Smith

C# code style validation plugin for ReSharper (Visual Studio plugin).

Beyond Code Style – Building Trustworthy Software

Combine Agent Smith with static analysis tools and security audit pipelines to ensure your C# code is not just clean—but also secure.

 

Terms of use.

It is free. It has no harmful intentions, but use it for your own risk.

Moreover now it is opensource and is hosted at Google Code.

Please send comments to forever.zet[at]gmail.com
Please report a suggestion or an issue at Issue tracker
To read more about people participating please read at Contributors

Installation

Download plugin (see links below)
Extract assembly to somewhere like "C:\Program Files\JetBrains\ReSharper\v3.0\vs8.0\Bin\Plugins\AgentSmith" (It should go under resharper folder, so doublecheck resharper and vs version in path)
It should be listed among ReSharper plugins and settings are available under ReSharper Code Style settings.

Agent Smith 1.3.0 for ReSharper 4.0
Agent Smith 1.2.0 for ReSharper 3.1

Version 1.3.0 Changes (23/08/2008)

  • Implemented basic comment reflowing of XML comments.
  • Fixed defect with editing 'TestFixtures? should ...' rule.
  • Added 'm' as forbidden prefix to default configuration.
FAQ
Full Change Log
Previous Versions

XML comment validation

Agent Smith can check that certain declaration have xml comments, perform spell checking of XML comments and suggest quick fixes (Word suggestions, Replace with <see cref...). It also contains flexible configuration interface.

 

Naming Conventions

Plugin has interface that allows you to specify what naming rules should be applied to certain declarations.

Naming rules include

  • Obligatory prefixes
  • Obligatory suffixes
  • Prefixes that should be avoided.
  • Suffixes that should be avoided.
  • Casing rules: Camel, Pascal, Uppercase.
  • Regular Expression rules.
  • Declaration to which a naming rule applies is identified by one or more matching rules. In Matching rule following can be specified:

  • Declaration type.
  • Visibility
  • Attribute declaration is marked with.
  • Base class of interface (for classes and interfaces).
  • For a naming rule also non matching rules can be specified in similar way.

    For each kind of rule plugin highlights incorrect declaration and suggests quickfixes(except regular expressions).

    Best Practices for Secure C# Development Environments

    For teams working with shared or sensitive codebases, deploying isolated development environments on secure linux VPS hosting ensures better control over access, dependency management, and environment consistency.

     
     

    Smart paste

    Agent Smith performs spell checking of

  • XML comments
  • C# string literals
  • C# identifiers. Identifiers are split by camel humps and checked against dictionary.
  • Resource files (it can automatically choose appropriate dictinary depending on resource file extension)
  • and suggests quick fixes (Word suggestions, Replace with <see cref...). Open Office dictionaries can be imported so a few languages are virtually supported. If you are smart pasting a text into XML comment Agent Smith will insert '///' characters at line breaks and optionally escape XML reserved characters. If you are smart pasting into a string literal Agent Smith will escape string characters correspondingly.