chainlink-cre-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseChainlink CRE Skill
Chainlink CRE 技能模块
Assist developers working with the Chainlink Runtime Environment (CRE) by looking up the latest documentation at runtime.
通过在运行时查阅最新文档,为使用Chainlink Runtime Environment (CRE)的开发者提供协助。
Runtime Pattern
运行时模式
⚠️ IMPORTANT — AGENTS MUST READ BEFORE FETCHING ANYTHING: WebFetch may return an empty shell (nav/metadata only, no prose or code) for some URLs. After every WebFetch call, assess quality before using the content.After every WebFetch, ask: Does the response contain actual prose and/or code blocks with more than ~1000 chars of useful content?Full fetch cascade — follow in order:
- WebFetch → assess content quality → proceed if substantial
- Bash curl (if WebFetch returned a shell) — works on Windows 10+, Linux, and Mac →
bashcurl -s -L -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "<url>"- Tell the user → if both fail, report the URL and suggest they open it directly
Apply this cascade to ALL fetches — doc pages, GitHub URLs, and text dumps.
When a user asks a CRE-related question:
- Match user intent to a reference file — Identify which topic best fits the query from the reference files listed below.
- Read the matching reference file — Each entry includes a summary and key technical details. Use these to orient yourself. Do not fetch yet.
- Act immediately — Write the answer or scaffold from your knowledge and the reference file descriptions. Do not fetch as preparation.
- Iterate — Present your response. Ask the user to test or run it. Then loop:
- Error or gap blocks progress → fetch exactly what the error names → fix → repeat
- Cannot write a specific part → mark it inline (e.g. ) → fetch that one thing → fill it in → continue
// NEED: exact consensus tag for uint256 - No error → done
⚠️ Do not fetch as preparation. Fetch as resolution. Only fetch when you can state the exact piece of information you need. If you can't name it precisely, don't fetch.
CRE has runtime-specific constraints (e.g. WASM environment, encoding requirements) that differ from standard assumptions. When a specific gap involves CRE behaviour you are uncertain about, fetch to resolve it — do not guess.
⚠️ 重要提示 — 智能体在获取任何内容前必须阅读: 对于部分URL,WebFetch可能仅返回空框架(仅包含导航/元数据,无正文或代码)。每次调用WebFetch后,需先评估内容质量再使用。每次WebFetch后需确认: 响应是否包含实际正文和/或代码块,且有用内容字符数超过约1000个?完整获取流程 — 按顺序执行:
- WebFetch → 评估内容质量 → 若内容充足则继续
- Bash curl(若WebFetch返回空框架)—— 适用于Windows 10+、Linux和Mac系统 →
bashcurl -s -L -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "<url>"- 告知用户 → 若上述两种方式均失败,告知用户该URL并建议他们直接打开
所有获取操作均需遵循此流程,包括文档页面、GitHub URL和文本转储。
当用户提出CRE相关问题时:
- 匹配用户意图与参考文件 — 从下方列出的参考文件中,确定最符合查询内容的主题。
- 阅读匹配的参考文件 — 每个条目包含摘要和关键技术细节,用这些内容明确方向,暂不进行获取操作。
- 立即行动 — 凭借已有知识和参考文件描述撰写答案或搭建框架,不要预先进行获取操作。
- 迭代优化 — 呈现你的回复,让用户进行测试或运行,然后循环执行:
- 错误或阻碍导致进度停滞 → 精准获取错误提示中提及的内容 → 修复后重复执行
- 无法编写特定部分 → 在内联位置标记(例如 )→ 获取该特定内容 → 补充完整后继续
// NEED: exact consensus tag for uint256 - 无错误 → 完成
⚠️ 不要预先进行获取操作,仅在需要解决问题时获取。 只有当你能明确说出所需的具体信息时,才进行获取。如果无法精准描述需求,请勿获取。
CRE存在运行时特定约束(例如WASM环境、编码要求),与常规假设不同。当遇到涉及CRE行为的不确定点时,需通过获取内容来解决,切勿猜测。
Code Example Priority
代码示例优先级
When looking for code examples or implementation details, use the most targeted source first. Apply the fetch cascade above to any URL you fetch:
- Individual doc pages first — Most targeted. Fetch the specific page for the topic using the fetch cascade. Full content is accessible via curl if WebFetch returns a shell.
- Repo references second () — Use when the doc page lacks sufficient code, or the user explicitly wants a working implementation (templates, SDK examples, demo apps).
repo-*.md - Full-text doc dumps last (/
llms-full-ts.txt) — 35,000-word plain-text dumps linked fromllms-full-go.txt. Use only when you can't identify a specific doc page or need broad coverage.general.md
How to work through this list:
- Fetch the single most relevant URL from the highest-priority source first. Read it fully.
- Stop as soon as you have enough to answer the question. Do not fetch more to verify or feel confident.
- Only move to the next priority source if the current one was genuinely insufficient.
- Never follow links found in fetched content — only fetch URLs explicitly listed in reference files.
- When fetching from repo reference files, fetch only the specific file you need. Do not browse directories or read adjacent files.
- 3-5 URLs is a ceiling, not a target. Most questions need 1-2 fetches.
查找代码示例或实现细节时,优先使用针对性最强的来源。对任何要获取的URL,均需遵循上述获取流程:
- 优先使用单个文档页面 — 针对性最强。通过获取流程获取该主题的特定页面。若WebFetch返回空框架,可通过curl获取完整内容。
- 其次使用仓库参考文件()—— 当文档页面缺少足够代码,或用户明确需要可运行的实现(模板、SDK示例、演示应用)时使用。
repo-*.md - 最后使用全文文档转储(/
llms-full-ts.txt)—— 从llms-full-go.txt链接的35000字纯文本转储,仅在无法确定特定文档页面或需要广泛覆盖时使用。general.md
使用顺序说明:
- 优先从最高优先级来源获取单个最相关的URL,并完整阅读。
- 一旦获取到足够回答问题的内容,立即停止,无需额外获取来验证或增强信心。
- 仅当当前来源确实不足以解决问题时,才转向下一个优先级来源。
- 切勿跟随获取内容中的链接,仅获取参考文件中明确列出的URL。
- 从仓库参考文件获取时,仅获取所需的特定文件,不要浏览目录或读取相邻文件。
- 最多获取3-5个URL,这是上限而非目标,大多数问题仅需1-2次获取。
CLI Command Priority
CLI命令优先级
When looking up CRE CLI commands, flags, or usage:
- Run locally — Most authoritative and version-accurate. Use this first if the CLI is installed.
cre <command> --help - Individual CLI doc pages — Fetch the specific command page via the fetch cascade. Targeted and accessible.
- — Auto-generated markdown for every command. Use if the above don't cover the query.
repo-cre-cli.md - Full-text doc dumps / other — Last resort.
How to work through this list:
- Fetch the single most relevant URL from the highest-priority source first. Read it fully.
- Stop as soon as you have enough to answer the question. Do not fetch more to verify or feel confident.
- Only move to the next priority source if the current one was genuinely insufficient.
- Never follow links found in fetched content — only fetch URLs explicitly listed in reference files.
- When fetching from repo reference files, fetch only the specific file you need. Do not browse directories or read adjacent files.
- 3-5 URLs is a ceiling, not a target. Most questions need 1-2 fetches.
查找CRE CLI命令、标志或用法时:
- 本地运行 — 最权威且版本准确。若已安装CLI,优先使用此方式。
cre <command> --help - 单个CLI文档页面 — 通过获取流程获取特定命令页面,针对性强且易于访问。
- — 包含每个命令的自动生成Markdown文档,当前述方式无法覆盖查询内容时使用。
repo-cre-cli.md - 全文文档转储/其他来源 — 最后的选择。
使用顺序说明:
- 优先从最高优先级来源获取单个最相关的URL,并完整阅读。
- 一旦获取到足够回答问题的内容,立即停止,无需额外获取来验证或增强信心。
- 仅当当前来源确实不足以解决问题时,才转向下一个优先级来源。
- 切勿跟随获取内容中的链接,仅获取参考文件中明确列出的URL。
- 从仓库参考文件获取时,仅获取所需的特定文件,不要浏览目录或读取相邻文件。
- 最多获取3-5个URL,这是上限而非目标,大多数问题仅需1-2次获取。
Reference Files
参考文件
| File | Topic | When to use |
|---|---|---|
| account-setup.md | Account setup | Creating accounts, CLI login, managing authentication |
| getting-started.md | Getting started | CLI installation, project setup, tutorial walkthrough (Go & TypeScript) |
| capabilities.md | Capabilities | EVM read/write, HTTP capability, triggers overview |
| workflow-building.md | Workflow building | Secrets, time, randomness, triggers (cron/HTTP/EVM log), HTTP client, EVM client, onchain read/write, report generation |
| cli-reference.md | CLI reference | CLI commands for accounts, auth, project setup, secrets, workflows, utilities |
| sdk-reference.md | SDK reference | SDK core, consensus/aggregation, EVM client, HTTP client, trigger APIs (Go & TypeScript) |
| operations.md | Operations | Deploying, simulating, monitoring, activating, pausing, updating, deleting workflows, multi-sig wallets |
| concepts.md | Concepts | Consensus computing, finality, non-determinism, TypeScript WASM runtime |
| organization.md | Organization | Org management, inviting members, linking wallet keys |
| general.md | General | CRE overview, key terms, demos, Gelato migration, project configuration, supported networks, release notes, service quotas, support |
| templates.md | Templates | CRE workflow templates overview and usage |
| 文件 | 主题 | 使用场景 |
|---|---|---|
| account-setup.md | 账户设置 | 创建账户、CLI登录、管理身份验证 |
| getting-started.md | 入门指南 | CLI安装、项目设置、教程演练(Go & TypeScript) |
| capabilities.md | 功能特性 | EVM读写、HTTP功能、触发器概述 |
| workflow-building.md | 工作流构建 | 密钥、时间、随机性、触发器(定时/HTTP/EVM日志)、HTTP客户端、EVM客户端、链上读写、报告生成 |
| cli-reference.md | CLI参考 | 账户、身份验证、项目设置、密钥、工作流、工具类的CLI命令 |
| sdk-reference.md | SDK参考 | SDK核心、共识/聚合、EVM客户端、HTTP客户端、触发器API(Go & TypeScript) |
| operations.md | 运维操作 | 工作流部署、模拟、监控、激活、暂停、更新、删除、多签钱包 |
| concepts.md | 核心概念 | 共识计算、最终性、非确定性、TypeScript WASM运行时 |
| organization.md | 组织管理 | 组织管理、成员邀请、钱包密钥关联 |
| general.md | 通用信息 | CRE概述、关键术语、演示、Gelato迁移、项目配置、支持网络、发布说明、服务配额、支持渠道 |
| templates.md | 模板资源 | CRE工作流模板概述及使用方法 |
Workflow Generation Checklist
工作流生成检查清单
Follow these additional steps when generating or scaffolding a new workflow (not just answering questions):
- Determine language — Before generating any code, confirm whether the user wants Go or TypeScript. Ask directly if not already clear from context.
- Choose HTTP capability — If the workflow involves HTTP requests, ask the user whether they want regular HTTP or Confidential HTTP. Explain the difference: regular HTTP is the default for standard API calls; Confidential HTTP is an optional capability that provides privacy-preserving requests via enclave execution, secret injection, and optional response encryption. Do not assume one or the other — let the user decide.
- Write the scaffold immediately — Generate the complete workflow structure from your knowledge. Do not fetch first. Mark specific uncertainties inline (e.g. ,
// NEED: exact consensus tag for uint256).// NEED: verify project.yaml structure - Present and iterate — Give the user the scaffold with simulation commands. Ask them to run . Then loop:
cre workflow simulate- Simulation error → fetch exactly what the error names → fix → ask user to re-run
- Inline gap → fetch that one specific thing → fill it in → continue
- No error → done
- One fetch per gap. Never fetch speculatively to prevent hypothetical errors.
- Default to simulation — Always include simulation commands. Only provide deployment steps if the user explicitly requests it. Remind them deployment requires Early Access approval, a funded wallet, and a linked key.
当生成或搭建新工作流(而非仅回答问题)时,需遵循以下额外步骤:
- 确定开发语言 — 在生成任何代码前,确认用户需要Go还是TypeScript。若上下文未明确说明,直接询问用户。
- 选择HTTP功能类型 — 若工作流涉及HTTP请求,询问用户需要常规HTTP还是保密HTTP。解释两者区别:常规HTTP是标准API调用的默认选项;保密HTTP是可选功能,通过飞地执行、密钥注入和可选响应加密提供隐私保护请求。请勿自行假设,让用户决定。
- 立即生成框架 — 凭借已有知识生成完整的工作流结构,不要预先进行获取操作。在内联位置标记不确定的部分(例如 ,
// NEED: exact consensus tag for uint256)。// NEED: verify project.yaml structure - 呈现并迭代 — 向用户提供带模拟命令的框架,让他们运行 。然后循环执行:
cre workflow simulate- 模拟报错 → 精准获取错误提示中提及的内容 → 修复后让用户重新运行
- 内联存在空白 → 获取该特定内容 → 补充完整后继续
- 无错误 → 完成
- 每个空白仅获取一次,切勿为预防假设性错误而进行推测性获取。
- 默认使用模拟 — 始终包含模拟命令,仅在用户明确要求时提供部署步骤。提醒用户部署需要提前访问权限、已充值的钱包和关联的密钥。
Repo Reference Files
仓库参考文件
Repo reference files are a reliable source for working code implementations. Use them when individual doc pages lack sufficient code examples, or when the user explicitly wants a template or runnable implementation.
| File | Repo | When to use |
|---|---|---|
| repo-cre-templates.md | cre-templates | Starter templates, building blocks, example workflow patterns |
| repo-cre-sdk-typescript.md | cre-sdk-typescript | TypeScript SDK source, HTTP trigger package, SDK examples |
| repo-cre-sdk-go.md | cre-sdk-go | Go SDK source, capability implementations, consensus code |
| repo-cre-prediction-market-demo.md | cre-gcp-prediction-market-demo | Prediction market demo app, end-to-end workflow example |
| repo-cre-cli.md | cre-cli | CRE CLI source code and auto-generated command reference docs |
仓库参考文件是可靠的工作代码实现来源。当单个文档页面缺少足够代码示例,或用户明确需要模板或可运行实现时使用。
| 文件 | 仓库 | 使用场景 |
|---|---|---|
| repo-cre-templates.md | cre-templates | 入门模板、构建模块、示例工作流模式 |
| repo-cre-sdk-typescript.md | cre-sdk-typescript | TypeScript SDK源码、HTTP触发器包、SDK示例 |
| repo-cre-sdk-go.md | cre-sdk-go | Go SDK源码、功能实现、共识代码 |
| repo-cre-prediction-market-demo.md | cre-gcp-prediction-market-demo | 预测市场演示应用、端到端工作流示例 |
| repo-cre-cli.md | cre-cli | CRE CLI源码及自动生成的命令参考文档 |
Debugging Checklist
调试检查清单
Follow these steps when diagnosing errors or fixing broken CRE code:
- Identify the capability involved — Determine which CRE capability (HTTP client, EVM client, triggers, secrets, consensus, etc.) is related to the error.
- Fetch the relevant doc page — Find the specific doc page for the capability via the matching reference file. Use the fetch cascade to retrieve it.
- Check repo examples — If the doc page lacks a working implementation, consult the matching reference file. If still insufficient, fetch the llms-full text dump from
repo-*.md.general.md - Check known issues — Review the Known Issues section below for any matching bug or workaround.
- Only then propose a fix — Do not guess from type signatures, general programming knowledge, or first principles. CRE's WASM runtime and capability interfaces have specific requirements that may differ from standard assumptions.
- If a fix fails, re-consult docs — Do not iterate by guessing alternatives. Go back to step 2 and re-read the docs more carefully, or fetch additional related pages.
当诊断错误或修复CRE代码问题时,需遵循以下步骤:
- 确定涉及的功能 — 判断错误与CRE的哪个功能(HTTP客户端、EVM客户端、触发器、密钥、共识等)相关。
- 获取相关文档页面 — 通过匹配的参考文件找到该功能的特定文档页面,使用获取流程获取内容。
- 查看仓库示例 — 若文档页面缺少可运行实现,查阅对应的参考文件。若仍不足,从
repo-*.md获取llms-full文本转储。general.md - 检查已知问题 — 查看下方的已知问题部分,寻找匹配的bug或解决方案。
- 之后再提出修复方案 — 切勿从类型签名、通用编程知识或基本原则进行猜测。CRE的WASM运行时和功能接口有特定要求,可能与常规假设不同。
- 若修复失败,重新查阅文档 — 切勿通过猜测替代方案进行迭代,回到步骤2重新仔细阅读文档,或获取更多相关页面。
Known Issues
已知问题
Secret name/env var substring conflict (CRE CLI v1.1.0)
密钥名称/环境变量子串冲突(CRE CLI v1.1.0)
Problem: Secret resolution fails with "secret not found" if the env var name in is a substring or prefix of the secret name (the YAML key). For example, secret name with env var fails because is a prefix of .
secrets.yamlGEMINI_API_KEY_SECRETGEMINI_API_KEYGEMINI_API_KEYGEMINI_API_KEY_SECRETWorkaround: Ensure the env var name is never a substring/prefix of the secret name. Use a suffix like on the env var (e.g., ).
_VARGEMINI_API_KEY_VARObserved in: CRE CLI v1.1.0
Verification test: Create a with a secret name that contains the env var as a prefix (e.g., key , env var ). Run simulation. If it fails with "secret not found", the bug still exists. If it succeeds, the bug is fixed and this issue can be removed.
secrets.yamlMY_SECRET_NAMEMY_SECRET问题: 若中的环境变量名称是密钥名称(YAML键)的子串或前缀,密钥解析会失败并提示“secret not found”。例如,密钥名称为,环境变量为时会失败,因为是的前缀。
secrets.yamlGEMINI_API_KEY_SECRETGEMINI_API_KEYGEMINI_API_KEYGEMINI_API_KEY_SECRET解决方案: 确保环境变量名称永远不是密钥名称的子串/前缀。可在环境变量后添加后缀(例如)。
_VARGEMINI_API_KEY_VAR出现版本: CRE CLI v1.1.0
验证测试: 创建,其中密钥名称包含环境变量作为前缀(例如键为,环境变量为)。运行模拟。若提示“secret not found”则bug仍存在;若成功则bug已修复,可移除该问题记录。
secrets.yamlMY_SECRET_NAMEMY_SECRETTips
提示
- Many topics have separate Go and TypeScript pages. Ask the user which language they're using if unclear, or fetch both.
- For workflow generation tasks, follow the Workflow Generation Checklist above, start with , and supplement with
workflow-building.mdfor API details.sdk-reference.md - For onboarding, start with then
getting-started.md.account-setup.md - For code examples, fetch the specific doc page first (via fetch cascade), then repo reference files if more implementation detail is needed.
- Reference file entries contain enriched descriptions from the docs index. Read them carefully to narrow down which URLs to fetch — don't fetch blindly.
- The full docs index with structured JSON metadata is available at for deeper search if reference file descriptions aren't sufficient.
assets/cre-docs-index.md
- 许多主题有单独的Go和TypeScript页面,若上下文未明确,询问用户使用的语言,或同时获取两种语言的页面。
- 对于工作流生成任务,遵循上述工作流生成检查清单,从开始,补充
workflow-building.md获取API细节。sdk-reference.md - 对于入门指导,从开始,再参考
getting-started.md。account-setup.md - 对于代码示例,优先通过获取流程获取特定文档页面,若需要更多实现细节,再使用仓库参考文件。
- 参考文件条目包含来自文档索引的丰富描述,仔细阅读以缩小要获取的URL范围,不要盲目获取。
- 若参考文件描述不足,可在获取带结构化JSON元数据的完整文档索引,进行深度搜索。
assets/cre-docs-index.md