Skip to content

Conversation

@Kiran1689
Copy link

@Kiran1689 Kiran1689 commented Oct 12, 2025

User description

Clean Code Description Agent

A specialized Qodo agent that ensures your codebase remains clean, readable, and well-documented by reviewing docstrings, comments, and naming conventions.

Competition Category

Best Agent for Clean Code Description

🧭 Overview

The Clean Code Description Agent reviews code to detect:

  • Missing or incomplete docstrings
  • Outdated or incorrect descriptions
  • Redundant or low-value comments
  • Poorly named variables or functions
  • Inconsistent documentation style

The agent supports both local CLI runs and automated PR checks through CI/CD integrations (GitHub, GitLab, Jenkins, Azure).

🧩 Key Features

  • Context-Aware Documentation Analysis
  • Structured Output Summary
  • Highly Configurable
  • Runs Anywhere
    • Locally via CLI
    • Automatically on Pull Requests (via CI/CD)
    • As a pre-commit hook
    • In IDEs like VS Code or IntelliJ
  • Quality Gate Support
    • Fails CI builds if thresholds exceeded (e.g., >5 missing docstrings)
    • Provides warnings instead of hard stops for minor naming issues

📁 New Files Added

agents/
└── clean-code-description/
    ├── agent.toml
    ├── agent.yaml
    ├── README.md
    └── examples/
        ├── usage.md
        ├── ci-configs/
           ├── github-actions.yml
           ├── gitlab-ci.yml
           ├── jenkins-pipeline.groovy
           └── azure-devops.yml
        

👨‍💻Testing and Demo


PR Type

Other


Description

  • Add Clean Code Description Agent for documentation quality

  • Include CI/CD pipeline configurations for multiple platforms

  • Provide comprehensive usage examples and integration guides

  • Support configurable analysis with severity thresholds


Diagram Walkthrough

flowchart LR
  A["Agent Configuration"] --> B["Clean Code Analysis"]
  B --> C["CI/CD Integration"]
  C --> D["GitHub Actions"]
  C --> E["GitLab CI"]
  C --> F["Jenkins Pipeline"]
  C --> G["Azure DevOps"]
  B --> H["Usage Examples"]
  H --> I["IDE Integration"]
  H --> J["Pre-commit Hooks"]
Loading

File Walkthrough

Relevant files
Documentation
README.md
Complete agent documentation and usage guide                         

agents/clean-code-description/README.md

  • Comprehensive documentation for Clean Code Description Agent
  • Usage examples with CLI commands and configuration options
  • Integration guides for GitHub Actions, VS Code, and pre-commit hooks
  • Structured output format examples and troubleshooting section
+252/-0 
usage.md
Comprehensive usage examples and integrations                       

agents/clean-code-description/examples/usage.md

  • Detailed usage examples for various scenarios and languages
  • Advanced CI/CD configurations with quality gates
  • IDE integration examples for VS Code and IntelliJ
  • Pre-commit hook implementations and output examples
+417/-0 
Configuration changes
agent.toml
Agent configuration in TOML format                                             

agents/clean-code-description/agent.toml

  • TOML configuration defining clean code analysis command
  • Configurable parameters for severity thresholds and focus areas
  • JSON schema for structured output with issue categorization
  • Integration with qodo_merge, git, and filesystem tools
+109/-0 
agent.yaml
Agent configuration in YAML format                                             

agents/clean-code-description/agent.yaml

  • YAML version of agent configuration with identical functionality
  • Same parameters and output schema as TOML version
  • Alternative format for different deployment preferences
+108/-0 
github-actions.yml
GitHub Actions CI configuration                                                   

agents/clean-code-description/examples/ci-configs/github-actions.yml

  • GitHub Actions workflow for PR-based code reviews
  • Configurable parameters for branch targeting and focus areas
  • Proper permissions setup for PR comments and checks
+33/-0   
gitlab-ci.yml
GitLab CI pipeline configuration                                                 

agents/clean-code-description/examples/ci-configs/gitlab-ci.yml

  • GitLab CI pipeline configuration for merge request reviews
  • Environment variable setup for API keys and tokens
  • Conditional execution rules for merge request events
+18/-0   
jenkins-pipeline.groovy
Jenkins pipeline configuration                                                     

agents/clean-code-description/examples/ci-configs/jenkins-pipeline.groovy

  • Jenkins pipeline script with Docker-based execution
  • Environment credentials management for API keys
  • Artifact archiving for review results
+34/-0   
azure-devops.yml
Azure DevOps pipeline configuration                                           

agents/clean-code-description/examples/ci-configs/azure-devops.yml

  • Azure DevOps pipeline with Docker task execution
  • Variable group integration for credential management
  • Multi-branch trigger configuration for PRs
+38/-0   

@qodo-free-for-open-source-projects qodo-free-for-open-source-projects bot changed the title Clean Code Description Agent - #QodoAgentChallenge Competition Submission Clean Code Description Agent - #QodoAgentChallenge Competition Submission Oct 12, 2025
@qodo-free-for-open-source-projects
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Credential leakage risk

Description: Jenkinsfile exposes credential IDs ('qodo-api-key', 'github-token') and uses them as
environment variables, which may risk accidental echoing in logs if subsequent steps print
environment or command lines; ensure sh commands do not echo secrets and use
withCredentials/Masking.
jenkins-pipeline.groovy [6-8]

Referred Code
    QODO_API_KEY = credentials('qodo-api-key')
    GITHUB_TOKEN = credentials('github-token')
}
Supply-chain exposure

Description: GitHub Actions passes 'GITHUB_TOKEN' and 'QODO_API_KEY' to a third-party action; ensure
the action is trusted and versions are pinned to avoid supply-chain risks.
github-actions.yml [22-25]

Referred Code
env:
  QODO_API_KEY: ${{ secrets.QODO_API_KEY }}
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Token exposure in logs

Description: Azure DevOps Docker task passes tokens via envVars; without masking and with command
arguments logged, tokens could be exposed in build logs—ensure secret variables are marked
secret and logging is minimized.
azure-devops.yml [31-37]

Referred Code
image: 'qodoai/command:latest'
arguments: >
  --prompt clean_code_description
  --agent-file path/to/agent.toml
  --key-value-pairs "target_branch=$(System.PullRequest.TargetBranch),severity_threshold=medium,focus_areas=docstrings,comments,naming,include_suggestions=true"
envVars: |
  QODO_API_KEY=$(qodo-api-key)
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Agent's scope overlaps with static linters

The agent's scope currently overlaps with static linters for tasks like finding
missing docstrings. It should be refined to focus on semantic analysis, like
verifying if documentation accurately reflects code logic, to provide unique
value.

Examples:

agents/clean-code-description/agent.toml [7-23]
instructions = """
You are an expert in code documentation and clean code practices. Your task is to:

1. Analyze code changes using Qodo Merge to identify documentation issues
2. Focus on:
   - Missing or incomplete docstrings
   - Outdated or incorrect docstrings/comments
   - Redundant or low-value comments
   - Inconsistent documentation styles
   - Poorly named functions, classes, or variables

 ... (clipped 7 lines)
agents/clean-code-description/README.md [7-19]
This agent analyzes your codebase to maintain high documentation quality and consistency by checking for:

- 📝 **Missing or incomplete docstrings**

- 🔄 **Outdated or inaccurate descriptions**

- 💬 **Redundant or low-value comments**

- ⚖️ **Inconsistent documentation styles**


 ... (clipped 3 lines)

Solution Walkthrough:

Before:

# agent.toml
[commands.clean_code_description]
instructions = """
You are an expert in code documentation... Your task is to:
1. Analyze code changes...
2. Focus on:
   - Missing or incomplete docstrings
   - Outdated or incorrect docstrings/comments
   - Redundant or low-value comments
   - Poorly named functions, classes, or variables
...
6. Ensure that the documentation aligns with the actual behavior of the code
"""

After:

# agent.toml
[commands.clean_code_description]
instructions = """
You are an expert in code documentation... Your task is to:
1. Analyze code changes to semantically verify documentation.
2. Focus on what static linters cannot check:
   - Does the docstring accurately reflect the function's logic and behavior?
   - Are comments outdated or misleading given the code changes?
   - Is the description of parameters and return values correct?
3. Provide clear, actionable feedback on semantic discrepancies.
...
"""
Suggestion importance[1-10]: 9

__

Why: The suggestion addresses a critical design flaw by pointing out the overlap with faster, deterministic linters and correctly advises focusing on semantic analysis, which is the unique value an LLM-based agent can provide.

High
Possible issue
Use correct executable in CI script

In the GitLab CI script, replace the incorrect executable command with qodo to
ensure the agent runs correctly within the Docker image.

agents/clean-code-description/examples/ci-configs/gitlab-ci.yml [5-18]

 clean_code_review:
   stage: review
   image: qodoai/command:latest
   script:
     - |
-      command \
+      qodo \
         --prompt clean_code_description \
         --agent-file path/to/agent.toml \
         --key-value-pairs "target_branch=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-main},severity_threshold=medium,focus_areas=docstrings,comments,naming,include_suggestions=true"
   variables:
     QODO_API_KEY: $QODO_API_KEY
     GITLAB_TOKEN: $CI_JOB_TOKEN
   rules:
     - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  • Apply / Chat
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a critical error in the GitLab CI script where an incorrect executable command is used instead of qodo, which would cause the job to fail.

Medium
Fix boolean argument's default value

In agent.yaml, change the default value for the include_suggestions argument
from the string "true" to the boolean true to match its defined type.

agents/clean-code-description/agent.yaml [34-38]

 - name: "include_suggestions"
   type: "boolean"
   required: false
-  default: "true"
+  default: true
   description: "Include improvement suggestions"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a type mismatch in the YAML file where a boolean argument has a string default value, and fixing it improves the configuration's correctness.

Low
General
Add missing descriptions to schema

Add missing description fields to the output_schema in agent.yaml to match the
more detailed schema in agent.toml, improving clarity and consistency.

agents/clean-code-description/agent.yaml [51-106]

 output_schema: |
   {
     "type": "object",
     "properties": {
       "summary": {
         "type": "object",
+        "description": "High-level summary of documentation and naming quality issues found",
         "properties": {
-          "total_issues": {"type": "number"},
-          "critical_issues": {"type": "number"},
-          "high_issues": {"type": "number"},
-          "medium_issues": {"type": "number"},
-          "low_issues": {"type": "number"},
-          "missing_docstrings": {"type": "number"},
-          "outdated_descriptions": {"type": "number"},
-          "redundant_comments": {"type": "number"},
-          "poor_names": {"type": "number"},
-          "files_reviewed": {"type": "number"},
-          "overall_score": {"type": "number","minimum":0,"maximum":10}
+          "total_issues": {"type": "number", "description": "Total number of issues identified"},
+          "critical_issues": {"type": "number", "description": "Number of issues categorized as critical"},
+          "high_issues": {"type": "number", "description": "Number of high severity issues"},
+          "medium_issues": {"type": "number", "description": "Number of medium severity issues"},
+          "low_issues": {"type": "number", "description": "Number of low severity issues"},
+          "missing_docstrings": {"type": "number", "description": "Number of functions/classes missing docstrings"},
+          "outdated_descriptions": {"type": "number", "description": "Number of outdated or incorrect docstrings/comments"},
+          "redundant_comments": {"type": "number", "description": "Number of unnecessary or low-value comments"},
+          "poor_names": {"type": "number", "description": "Number of functions, classes, or variables with unclear or inconsistent names"},
+          "files_reviewed": {"type": "number", "description": "Total number of files analyzed"},
+          "overall_score": {"type": "number", "minimum": 0, "maximum": 10, "description": "Overall documentation quality score (0-10)"}
         },
         "required":["total_issues","critical_issues","high_issues","medium_issues","low_issues","missing_docstrings","outdated_descriptions","redundant_comments","poor_names","files_reviewed","overall_score"]
       },
       "issues": {
         "type": "array",
+        "description": "Detailed list of individual issues identified in the codebase",
         "items": {
           "type": "object",
           "properties": {
-            "file": {"type": "string"},
-            "line": {"type": "number"},
-            "severity": {"type": "string","enum":["critical","high","medium","low"]},
-            "category": {"type": "string"},
-            "title": {"type": "string"},
-            "description": {"type": "string"},
-            "suggestion": {"type": "string"},
-            "code_example": {"type": "string"}
+            "file": {"type": "string", "description": "Path to the file containing the issue"},
+            "line": {"type": "number", "description": "Line number where the issue occurs"},
+            "severity": {"type": "string", "enum": ["critical", "high", "medium", "low"], "description": "Severity level of the issue"},
+            "category": {"type": "string", "description": "Category of the issue (e.g., docstring, comment, naming)"},
+            "title": {"type": "string", "description": "Short title summarizing the issue"},
+            "description": {"type": "string", "description": "Detailed explanation of the problem"},
+            "suggestion": {"type": "string", "description": "Suggested fix or improvement"},
+            "code_example": {"type": "string", "description": "Example of improved or corrected code"}
           },
           "required":["file","severity","category","title","description"]
         }
       },
       "suggestions": {
         "type": "array",
+        "description": "List of broader improvement suggestions for code cleanliness and documentation",
         "items": {
           "type": "object",
           "properties": {
-            "file": {"type": "string"},
-            "type": {"type": "string"},
-            "description": {"type": "string"},
-            "implementation": {"type": "string"}
+            "file": {"type": "string", "description": "File path for the suggestion"},
+            "type": {"type": "string", "description": "Type of suggestion (e.g., naming, docstring, structure)"},
+            "description": {"type": "string", "description": "Description of the suggested improvement"},
+            "implementation": {"type": "string", "description": "Recommended way to apply the suggestion"}
           },
           "required":["file","type","description"]
         }
       },
-      "approved": {"type": "boolean"},
-      "requires_changes": {"type": "boolean"}
+      "approved": {"type": "boolean", "description": "Indicates if code meets cleanliness standards"},
+      "requires_changes": {"type": "boolean", "description": "Indicates if changes are required before approval"}
     },
     "required":["summary","issues","approved","requires_changes"]
   }
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly points out an inconsistency between the agent.yaml and agent.toml files, and the proposed change improves the self-documentation and maintainability of the YAML configuration.

Low
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant