---
title:  Writing a custom rule
tags: [extending, userdocs]
last_updated: February 2020 (6.22.0)
permalink: pmd_userdocs_extending_writing_pmd_rules.html
---

The information on this page has been split into several separate pages. Please update your bookmarks:

* [Introduction to writing rules](pmd_userdocs_extending_writing_rules_intro.html)
    * [Your First Rule](pmd_userdocs_extending_your_first_rule.html)
      introduces the basic development process of a rule with a running example
    * [Writing XPath Rules](pmd_userdocs_extending_writing_xpath_rules.html)
      explains a bit more about XPath rules and our XPath API
    * [Writing Java Rules](pmd_userdocs_extending_writing_java_rules.html)
      describes how to write a rule in Java

To go further:
* [Defining Properties](pmd_userdocs_extending_defining_properties.html)
  describes how to make your rules more configurable with rule properties
* [Testing your Rules](pmd_userdocs_extending_testing.html) introduces
  our testing framework and how you can use it to safeguard the quality of
  your rule
