diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..c4dfcaa
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,18 @@
+<ruleset name="flexiform">
+    <description>Default PHP CodeSniffer configuration for Flexiform module.</description>
+    <file>.</file>
+    <arg name="extensions" value="css,inc,install,module,php,profile,test,theme"/>
+    <rule ref="Drupal.Array"/>
+    <rule ref="Drupal.CSS"/>
+    <rule ref="Drupal.Classes"/>
+    <rule ref="Drupal.Commenting">
+        <exclude name="Drupal.Commenting.DocComment.MissingShort"/>
+        <!-- TagsNotGrouped has false positives for @code/@endcode. See
+          https://www.drupal.org/node/2502837 -->
+        <exclude name="Drupal.Commenting.DocComment.TagsNotGrouped"/>
+        <!-- We have to document hooks in a non-standard way in order to be
+          informative -->
+        <exclude name="Drupal.Commenting.HookComment.HookParamDoc"/>
+        <exclude name="Drupal.Commenting.HookComment.HookReturnDoc"/>
+    </rule>
+</ruleset>
