重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
qodo-get-rules by qodo-ai/qodo-skills
npx skills add https://github.com/qodo-ai/qodo-skills --skill qodo-get-rules在代码生成或修改任务之前,从 Qodo 平台 API 获取特定于代码仓库的编码规则。这些规则包括在代码生成过程中必须应用的安全要求、命名约定、架构模式、风格指南和团队约定。
如果规则已经加载(在最近的消息中查找"Qodo Rules Loaded"),则跳转到步骤 6。
origin 远程 URL 提取仓库作用域。如果未找到远程仓库,则静默退出。如果无法解析 URL,则告知用户并优雅退出。modules/* 子目录内,则将其用作查询作用域;否则使用仓库级作用域。详情请参阅仓库作用域检测。
检查必需的 Qodo 配置是否存在。默认位置是 ~/.qodo/config.json。
~/.qodo/config.json 读取(API_KEY 字段)。如果未找到,则告知用户需要 API 密钥并提供设置说明,然后优雅退出。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
~/.qodo/config.json 读取(ENVIRONMENT_NAME 字段),QODO_ENVIRONMENT_NAME 环境变量具有优先权。如果未找到,则告知用户需要 API 密钥并提供设置说明,然后优雅退出。~/.qodo/config.json 读取(QODO_API_URL 字段)。如果存在,技能将使用 {QODO_API_URL}/rules/v1 作为 API 端点,忽略 ENVIRONMENT_NAME。如果不存在,则使用基于 ENVIRONMENT_NAME 的 URL。uuidgen 或 python3 -c "import uuid; print(uuid.uuid4())")作为本次调用中所有 API 调用的 request-id。这将在平台端关联单个规则加载的所有页面获取。配置解析示例:
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())")
# 确定 API_URL:QODO_API_URL 优先于 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
API 请求示例(第 1 页):
curl -s \
-H "Authorization: Bearer $API_KEY" \
-H "request-id: $REQUEST_ID" \
-H "qodo-client-type: skill-qodo-get-rules" \
"$API_URL/rules?scopes=$ENCODED_SCOPE&state=active&page=1&page_size=50"
有关完整算法、URL 构建和错误处理的详情,请参阅分页详情。
- **{name}** ({category}): {description}--- 结束输出。有关确切格式的详情,请参阅输出格式详情。
| 严重性 | 执行要求 | 何时跳过 |
|---|---|---|
| ERROR | 必须遵守,没有商量余地。添加注释记录合规性(例如,# Following Qodo rule: No Hardcoded Credentials) | 向用户解释并请求指导 |
| WARNING | 默认情况下应遵守 | 在响应中简要解释原因 |
| RECOMMENDATION | 在适当时考虑 | 无需采取行动 |
代码生成后,告知用户规则应用情况:
根据 git 远程仓库和工作目录确定作用域(见步骤 2):
作用域层次结构 :
/) - 适用于所有地方/org/) - 适用于组织/org/repo/) - 适用于仓库/org/repo/path/) - 适用于特定路径完整的配置说明,包括 API 密钥设置和环境变量选项,请参阅 README.md。
QODO_API_KEY 或创建 ~/.qodo/config.json每周安装次数
61
仓库
GitHub 星标数
12
首次出现
2026年2月23日
安全审计
安装于
github-copilot60
cursor58
codex58
opencode58
gemini-cli57
amp57
Fetches repository-specific coding rules from the Qodo platform API before code generation or modification tasks. Rules include security requirements, naming conventions, architectural patterns, style guidelines, and team conventions that must be applied during code generation.
If rules are already loaded (look for "Qodo Rules Loaded" in recent messages), skip to step 6.
origin remote URL. If no remote is found, exit silently. If the URL cannot be parsed, inform the user and exit gracefully.modules/* subdirectory, use it as the query scope; otherwise use repository-wide scope.See repository scope detection for details.
Check that the required Qodo configuration is present. The default location is ~/.qodo/config.json.
~/.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.~/.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.~/.qodo/config.json (QODO_API_URL field). If present, the skill will use {QODO_API_URL}/rules/v1 as the API endpoint, ignoring ENVIRONMENT_NAME. If absent, the ENVIRONMENT_NAME-based URL is used.uuidgen or python3 -c "import uuid; print(uuid.uuid4())") to use as request-id for all API calls in this invocation. This correlates all page fetches for a single rules load on the platform side.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
Example API request (page 1):
curl -s \
-H "Authorization: Bearer $API_KEY" \
-H "request-id: $REQUEST_ID" \
-H "qodo-client-type: skill-qodo-get-rules" \
"$API_URL/rules?scopes=$ENCODED_SCOPE&state=active&page=1&page_size=50"
See pagination details for the full algorithm, URL construction, and error handling.
- **{name}** ({category}): {description}---.See output format details for the exact format.
| 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 |
After code generation, inform the user about rule application:
Determines scope from git remote and working directory (see Step 2):
Scope Hierarchy :
/) - applies everywhere/org/) - applies to organization/org/repo/) - applies to repository/org/repo/path/) - applies to specific pathsSee README.md for full configuration instructions, including API key setup and environment variable options.
QODO_API_KEY or create ~/.qodo/config.jsonWeekly Installs
61
Repository
GitHub Stars
12
First Seen
Feb 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
github-copilot60
cursor58
codex58
opencode58
gemini-cli57
amp57
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
50,200 周安装
交易心理学教练 - 专业交易员情绪管理、认知偏差识别与交易纪律训练
53 周安装
代码简化器 - 提升代码清晰度与可维护性的AI工具,保持功能不变
53 周安装
Swain Status - 跨项目状态仪表板与智能工作流推荐系统 | 开发运维与项目管理工具
53 周安装
新闻聚合技能 - 实时抓取Hacker News、微博热搜、GitHub等8大平台热点新闻,支持AI关键词扩展与深度内容提取
53 周安装
概念解剖方法论:ljg-learn技能详解,八步深度解析任何概念
53 周安装
Vercel开发服务器验证指南:使用agent-browser检测空白页面、水合错误与性能问题
53 周安装