‹ 首页

get-qodo-rules

@nanocoai · 收录于 3 周前 · 上游提交 2 天前

Loads org- and repo-level coding rules from Qodo before code tasks begin, ensuring all generation and modification follows team standards. Use before any code generation or modification task when rules are not already loaded. Invoke when user asks to write, edit, refactor, or review code, or when starting implementation planning.

适合你,如果团队有编码规则需要自动遵守

/ 下载安装
get-qodo-rules.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add nanocoai/nanoclaw/get-qodo-rules
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- nanocoai/nanoclaw/get-qodo-rules
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify nanocoai/nanoclaw/get-qodo-rules
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
30380GitHub stars
~1.2K最小装载
~1.9K含声明引用
~1.9K文本包总量
镜像托管

怎么用

商店整理自技能原文 · 版本 879835b · 表述以原文为准
它做什么

当代码任务开始时,自动检查是否已加载Qodo编码规则。若未加载,从Qodo平台获取并按错误、警告、建议三个等级应用规则,最后报告哪些规则被遵循或跳过。

什么时候触发

在要求编写、修改、重构或审查代码时触发。也可以直接说'加载Qodo规则'等关键词触发。如果已加载过则跳过。

装好后可以这样说
触发加载Qodo规则,然后在代码中遵循错误级规则。
重写代码时自动获取并应用Qodo规则。
技能原文 SKILL.md作者撰写 · MIT · 879835b

Get Qodo Rules Skill

Description

Fetches repository-specific coding rules from the Qodo platform API before code generation or modification tasks. Rules include security requirements, coding standards, quality guidelines, and team conventions that must be applied during code generation. Use before any code generation or modification task when rules are not already loaded. Invoke when user asks to write, edit, refactor, or review code, or when starting implementation planning. 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
  • Check that the current directory is inside a git repository. If not, inform the user that a git repository is required and exit gracefully.
  • Extract the repository scope from the git origin remote URL. If no remote is found, exit silently. If the URL cannot be parsed, inform the user and exit gracefully.
  • Detect module-level scope: if inside a modules/* subdirectory, use it as the query scope; otherwise use repository-wide scope.

See [repository scope detection](references/repository-scope.md) for details.

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). 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, inform the user that an API key is required and provide setup instructions, then exit gracefully.
Step 4: Fetch Rules with Pagination
  • Fetch all pages from the API (50 rules per page) until no more results are returned.
  • On each page, handle HTTP errors and exit gracefully with a user-friendly message.
  • Accumulate all rules across pages into a single list.
  • Stop after 100 pages maximum (safety limit).
  • If no rules are found after all pages, inform the user and exit gracefully.

See [pagination details](references/pagination.md) for the full algorithm and error handling.

Step 5: Format and Output Rules
  • Print the "📋 Qodo Rules Loaded" header with repository scope, scope context, and total rule count.
  • Group rules by severity and print each non-empty group: ERROR, WARNING, RECOMMENDATION.
  • Each rule is formatted as: - **{name}** ({category}): {description}
  • End output with ---.

See [output format details](references/output-format.md) for the exact format.

Step 6: Apply Rules by Severity

| Severity | Enforcement | When Skipped | |---|---|---| | ERROR | Must comply, non-negotiable. Add comment documenting compliance (e.g., # Following Qodo rule: No Hardcoded Credentials) | Explain to user and ask for guidance | | WARNING | Should comply by default | Briefly explain why in response | | RECOMMENDATION | Consider when appropriate | No action needed |

Step 7: Report

After code generation, inform the user about rule application:

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

How Scope Levels Work

Determines scope from git remote and working directory (see [Step 2](#step-2-verify-working-in-a-git-repository)):

Scope Hierarchy:

  • Universal (/) - applies everywhere
  • Org Level (/org/) - applies to organization
  • Repo Level (/org/repo/) - applies to repository
  • Path Level (/org/repo/path/) - applies to specific paths

Configuration

See ~/.qodo/config.json for API key setup. Set QODO_ENVIRONMENT_NAME env var or ENVIRONMENT_NAME in config to select environment.


Common Mistakes
  • Re-running when rules are loaded - Check for "Qodo Rules Loaded" in context first
  • Missing compliance comments on ERROR rules - ERROR rules require a comment documenting compliance
  • Forgetting to report when no rules apply - Always inform the user when no rules were applicable, so they know the rules system is active
  • Not in git repo - Inform the user that a git repository is required and exit gracefully; do not attempt code generation
  • No API key - Inform the user with setup instructions; set QODO_API_KEY or create ~/.qodo/config.json
  • No rules found - Inform the user; set up rules at app.qodo.ai
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。