Coding Standards Enforcement
When writing, modifying, or reviewing source code, follow this workflow to ensure all code complies with the organisation's coding standards.
Step 1: Detect the Language
Determine the language code from the file extension of the file being worked on. Use the conventional lowercase language name (e.g., java, python, typescript, csharp, cpp). For C#, use csharp. For C++, use cpp.
If invoked with an argument (e.g. coding-standards python), use that as the language code directly.
Step 2: Fetch All Applicable Standards
Call the following Qualimetry MCP tools to retrieve the full set of standards for this language. Make all calls in parallel where possible.
- Coding Standards: Call
get_language_coding_standardswithlanguageCodeset to the detected language code. - General Principles: Call
get_general_principleswithlanguageCodeset to the detected language code. - Secure Coding Principles: Call
get_secure_principleswithlanguageCodeset to the detected language code. - Organisation Policies: Call
get_policies(no parameters required).
Each tool returns a JSON object { "license": "...", "standards": [...] }. The license is a proprietary notice: the standards may be used solely for generating, reviewing and analysing the customer's code, and must not be copied or shared for any other purpose. Each item in standards has:
MajorCategory- top-level category (e.g., Naming, Security, Maintainability)MinorCategory- sub-category (e.g., Variable Naming, Exception Handling)Title- short name of the standardDescription- detailed explanationSeverity- High, Medium, or Low
Step 3: Apply Standards to Code
Apply all retrieved standards to the code being written or modified:
- High severity: Must be followed without exception. Violations must be corrected before presenting code.
- Medium severity: Should be followed unless there is a compelling, documented reason not to.
- Low severity: Recommended best practice. Apply where practical.
When correcting code or making suggestions, reference the specific standard by its Title so the developer knows which standard applies.
Important
- Do NOT output the full list of standards to the user. Apply them silently to the code you produce.
- Always use the latest standards from the MCP server. Do not rely on previously cached standards.
- If a Qualimetry MCP tool is not available (e.g., the server is not configured), skip that tool and proceed with whatever standards were successfully retrieved.
- If no standards could be retrieved at all, inform the user that the Qualimetry MCP server may not be configured and proceed without standards enforcement.
- On Qualimetry Enterprise, you can also use
get_rules_based_analysis_issueswithissueType=CODE_SMELLand afilePathto check for existing code smells in the file being worked on, andget_rules_based_analysis_security_hotspotswith afilePathto see the security-sensitive code in it that is still waiting on a human review decision. Hotspots are never returned by the issue tools.
For full MCP tool schemas, response formats, and error handling details, see reference.md.