PluginBench
Skill
Fail
Audit score 45

qodo-get-rules

qodo-ai/qodo-skills

Load relevant Qodo coding rules for your current task via semantic search.

What is qodo-get-rules?

Fetches the most relevant Qodo coding rules for the current coding task by generating semantic search queries from the assignment. Use when Qodo is configured and you're writing, editing, refactoring, or reviewing code. Skip if rules are already loaded.

  • Generates two structured semantic search queries (topic and cross-cutting) from the coding assignment
  • Searches the Qodo rules database and returns rules ranked by relevance
  • Detects repository scope automatically to narrow results to relevant rules
  • Formats and displays rules with severity labels (ERROR, WARNING, RECOMMENDATION)
  • Applies rules based on severity during code generation with compliance documentation

How to install qodo-get-rules

npx skills add https://github.com/qodo-ai/qodo-skills --skill qodo-get-rules
Prerequisites
  • Qodo configured with API key in ~/.qodo/config.json or QODO_API_KEY environment variable
  • Working inside a git repository
  • Qodo rules already created and indexed in your Qodo environment
Claude Code
Cursor
Windsurf
Cline

How to use qodo-get-rules

  1. 1.Trigger the skill by asking to write, edit, refactor, or review code (or use explicit triggers like 'get qodo rules')
  2. 2.The skill checks if rules are already loaded; if not, it verifies git repo and Qodo configuration
  3. 3.Two semantic search queries are generated from your coding task (topic-focused and cross-cutting)
  4. 4.Rules are fetched from Qodo, ranked by relevance, and displayed with severity labels
  5. 5.Apply returned rules during code generation: ERROR rules are mandatory, WARNING rules should be followed, RECOMMENDATION rules are optional

Use cases

Good for
  • Starting a new feature implementation to ensure code follows org standards
  • Refactoring existing code to apply relevant quality and architecture rules
  • Writing security-sensitive code to load and enforce security-focused rules
  • Code review to check compliance with established patterns and standards
  • Bug fixes to apply correctness and reliability rules relevant to the issue
Who it's for
  • Developers working in Qodo-configured repositories
  • Teams with established coding standards and rule sets
  • Engineers needing to enforce security, compliance, or architecture patterns
  • Code reviewers ensuring consistency with organizational guidelines

qodo-get-rules FAQ

What if I don't have Qodo configured?

The skill will inform you that an API key is required and provide setup instructions. Configure ~/.qodo/config.json with your API_KEY and optionally ENVIRONMENT_NAME and QODO_API_URL.

Can I use this without a git repository?

No, the skill requires a git repository to detect repository scope and narrow rule results. Initialize a git repo first.

What if rules are already loaded?

The skill checks for 'Qodo Rules Loaded' in recent conversation context and skips execution if found, avoiding redundant API calls.

How are rules ranked?

Rules are ranked by relevance score from the semantic search API. Topic query results take priority over cross-cutting query results.

What happens if repository scope detection fails?

The skill gracefully degrades and performs an org-wide search without scope filtering, still returning relevant results.

Full instructions (SKILL.md)

Source of truth, from qodo-ai/qodo-skills.


name: qodo-get-rules description: "Loads coding rules from Qodo most relevant to the current coding task by generating a semantic search query from the assignment. Use when Qodo is configured and the user asks to write, edit, refactor, or review code, or when starting implementation planning. Skip if rules are already loaded." allowed-tools: "Bash" triggers:

  • "get.?qodo.?rules"
  • "get.?rules"
  • "load.?qodo.?rules"
  • "load.?rules"
  • "fetch.?qodo.?rules"
  • "fetch.?rules"
  • "qodo.?rules"
  • "get.?relevant.?rules"
  • "relevant.?rules"
  • "search.?rules"
  • "coding.?rules"
  • "code.?rules"
  • "before.?cod"
  • "start.?coding"
  • "write.?code"
  • "implement"
  • "create.*code"
  • "build.*feature"
  • "add.*feature"
  • "fix.*bug"
  • "refactor"
  • "modify.*code"
  • "update.*code"

Get Qodo Rules Skill

Description

Fetches the most relevant Qodo coding rules for the current coding task. Generates a focused semantic search query from the coding assignment and calls POST /rules/search to retrieve only the rules most relevant to the task at hand, ranked by relevance.

Skip if "Qodo Rules Loaded" already appears in conversation context.


Workflow

Step 1: Check if Rules Already Loaded

If rules are already loaded (look for "Qodo Rules Loaded" in recent messages), skip to Step 6.

Step 2: Verify Working in a Git Repository and Detect Repository Scope

Check that the current directory is inside a git repository. If not, inform the user that a git repository is required and exit gracefully.

After confirming a git repository exists, extract the repository scope to pass to the search API. Scope narrows results to rules relevant to this specific repository.

# 1. Confirm inside a git repository
git rev-parse --is-inside-work-tree

# 2. Get the remote URL
REMOTE_URL=$(git remote get-url origin 2>/dev/null)

# 3. Parse the URL into a scope path
if [ -n "$REMOTE_URL" ]; then
  # Strip .git suffix if present
  REMOTE_URL="${REMOTE_URL%.git}"

  # Handle SSH format: git@github.com:org/repo
  if echo "$REMOTE_URL" | grep -q "^git@"; then
    REPO_PATH=$(echo "$REMOTE_URL" | sed 's/^git@[^:]*://')
  # Handle HTTPS format: https://github.com/org/repo
  elif echo "$REMOTE_URL" | grep -q "^https\?://"; then
    REPO_PATH=$(echo "$REMOTE_URL" | sed 's|^https\?://[^/]*/||')
  else
    REPO_PATH=""
  fi

  if [ -n "$REPO_PATH" ]; then
    # 4. Detect module-level scope: check if cwd is inside modules/<name>/
    REPO_ROOT=$(git rev-parse --show-toplevel)
    REL_PATH=$(realpath --relative-to="$REPO_ROOT" "$(pwd)" 2>/dev/null || python3 -c "import os; print(os.path.relpath('$(pwd)', '$REPO_ROOT'))")
    MODULE=$(echo "$REL_PATH" | sed -n 's|^modules/\([^/]*\).*|\1|p')

    if [ -n "$MODULE" ]; then
      SCOPE="/${REPO_PATH}/modules/${MODULE}/"
    else
      SCOPE="/${REPO_PATH}/"
    fi
  fi
fi
# If SCOPE is empty (no remote, unparseable URL), proceed without scope — graceful degradation

Pass SCOPE in the search request body if set (see Step 5). If SCOPE is empty or unset, omit the scopes field entirely and proceed — org-wide search still returns relevant results.

See repository scope detection for URL format details and degradation behavior.

Step 3: Verify Qodo Configuration

Check that the required Qodo configuration is present. The default location is ~/.qodo/config.json.

  • API key: Read from ~/.qodo/config.json (API_KEY field). Environment variable QODO_API_KEY takes precedence. If not found, inform the user that an API key is required and provide setup instructions, then exit gracefully.
  • Environment name: Read from ~/.qodo/config.json (ENVIRONMENT_NAME field), with QODO_ENVIRONMENT_NAME environment variable taking precedence. If not found or empty, use production.
  • API URL override (optional): Read from ~/.qodo/config.json (QODO_API_URL field). If present, use {QODO_API_URL}/rules/v1 as the API base URL. If absent, the ENVIRONMENT_NAME-based URL is used.
  • Request ID: Generate a UUID (e.g. python3 -c "import uuid; print(uuid.uuid4())") to use as request-id for all API calls in this invocation.

Example config parsing:

API_KEY=$(python3 -c "import json,os; c=json.load(open(os.path.expanduser('~/.qodo/config.json'))); print(c['API_KEY'])")
ENV_NAME=$(python3 -c "import json,os; c=json.load(open(os.path.expanduser('~/.qodo/config.json'))); print(c.get('ENVIRONMENT_NAME',''))")
QODO_API_URL=$(python3 -c "import json,os; c=json.load(open(os.path.expanduser('~/.qodo/config.json'))); print(c.get('QODO_API_URL',''))")
REQUEST_ID=$(uuidgen || python3 -c "import uuid; print(uuid.uuid4())")
# Determine API_URL: QODO_API_URL takes precedence over ENVIRONMENT_NAME
if [ -n "$QODO_API_URL" ]; then
  API_URL="${QODO_API_URL}/rules/v1"
elif [ -z "$ENV_NAME" ]; then
  API_URL="https://qodo-platform.qodo.ai/rules/v1"
else
  API_URL="https://qodo-platform.${ENV_NAME}.qodo.ai/rules/v1"
fi

Step 4: Generate Structured Search Queries from Coding Assignment

Generate two structured search queries that mirror the rule embedding format. Query quality directly determines retrieval quality.

Each query must use this exact three-line structure:

Name: {concise 5-10 word title of the rule this task would trigger}
Category: {one of: Security, Correctness, Quality, Reliability, Performance, Testability, Compliance, Accessibility, Observability, Architecture}
Content: {1-2 sentences describing what should be checked or enforced}

Query 1 (Topic query): Focused on the coding assignment's primary concern. Pick the most relevant Category and describe the specific check in Content. When the repository's tech stack is known, mention it in the Content field.

Query 2 (Cross-cutting query): Targets recurring quality and standards patterns that apply to most code changes. Choose Category based on the org's rule emphasis (Security, Compliance, Observability, or Architecture as default). Include concerns like module structure, type annotations, structured logging, and repository patterns in Content.

Do not write keyword lists or flat sentences — they perform poorly with the embedding model.

See query generation guidelines for the full strategy, category selection rules, and examples.

Step 5: Call POST /rules/search

Call the search endpoint once per query (topic query and cross-cutting query), each with the configured TOP_K value (default: 20 — see search endpoint for tuning guidance). When parallel execution is available, run both calls in parallel. Merge results, deduplicating by rule ID. Topic query results take priority.

Include scopes in the request body if SCOPE was detected in Step 2. If SCOPE is empty, omit the field entirely — do not send "scopes": null or "scopes": [].

See search endpoint for the full request/response contract, URL construction, scopes field usage, and error handling.

Step 6: Format and Output Rules

Print the "📋 Qodo Rules Loaded" header and list rules in relevance order with severity as a label per rule.

See output format for the exact format.

Step 7: Apply Rules by Severity

Apply all returned rules to the coding task. Rules are ranked by relevance — apply all returned rules based on their severity:

SeverityEnforcementWhen Skipped
ERRORMust comply, non-negotiable. Add a comment documenting compliance (e.g., # Following Qodo rule: No Hardcoded Credentials)Explain to user and ask for guidance
WARNINGShould comply by defaultBriefly explain why in response
RECOMMENDATIONConsider when appropriateNo action needed

Step 8: Report

After code generation, inform the user about rule application:

  • Rules applied: List which rules were followed and their severity
  • WARNING rules skipped: Explain why
  • No applicable rules: Inform: "No Qodo rules were applicable to this code change"
  • RECOMMENDATION rules: Mention only if they influenced a design decision

Configuration

See README.md for full configuration instructions, including API key setup and environment variable options.


Common Mistakes

  • Re-running when rules are loaded - Check for "Qodo Rules Loaded" in context first
  • Wrong query format - Write queries using the structured Name/Category/Content format, not keyword lists or flat sentences
  • Single query only - Always generate both a topic query and a cross-cutting query; a single topic query misses cross-cutting rules
  • Vague query - The query must capture the nature of the task; generic Name or Content returns irrelevant rules
  • Crashing on empty results - An empty rules list is valid; proceed without rule constraints
  • Not in git repo - Inform the user that a git repository is required and exit gracefully
  • No API key - Inform the user with setup instructions; set QODO_API_KEY or create ~/.qodo/config.json
  • Missing compliance comments on ERROR rules - ERROR rules require a comment documenting compliance

Related skills

More from qodo-ai/qodo-skills and the wider catalog.

QOqodo-pr-resolver logo

qodo-pr-resolver

qodo-ai/qodo-skills

Review and fix Qodo AI code review feedback across GitHub, GitLab, Bitbucket, Azure DevOps, and Gerrit.

2.2k installs
NEnewapi logo

newapi

quantumnous/skills

Assistant for newapi (new-api), an open-source unified AI gateway platform (https://github.com/QuantumNous/new-api). Use when the user asks about New API, managing models, groups, balance, or tokens, or securely copying keys, applying them to config files, or using them in commands without exposing secrets.

764 installs
CEcentral-station logo

central-station

railwayapp/railway-skills

Search Railway's Central Station community threads, discussions, and support knowledge base.

1.5k installs
DAdatabase logo

database

railwayapp/railway-skills

This skill should be used when the user wants to add a database (Postgres, Redis, MySQL, MongoDB), says "add postgres", "add redis", "add database", "connect to database", or "wire up the database". For other templates (Ghost, Strapi, n8n, etc.), use the templates skill.

898 installs
DEdeploy logo

deploy

railwayapp/railway-skills

This skill should be used when the user wants to push code to Railway, says "railway up", "deploy", "deploy to railway", "ship", or "push". For initial setup or creating services, use new skill. For Docker images, use environment skill.

967 installs
DEdeployment logo

deployment

railwayapp/railway-skills

This skill should be used when the user wants to manage Railway deployments, view logs, or debug issues. Covers deployment lifecycle (remove, stop, redeploy, restart), deployment visibility (list, status, history), and troubleshooting (logs, errors, failures, crashes, why deploy failed). NOT for deleting services - use environment skill with isDeleted for that.

1.1k installsAudited