cre-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

CRE Skills

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:
  1. WebFetch → assess content quality → proceed if substantial
  2. Bash curl (if WebFetch returned a shell) — works on Windows 10+, Linux, and Mac →
    bash
    curl -s -L -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "<url>"
  3. 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:
  1. Match user intent to a reference file — Identify which topic best fits the query from the reference files listed below.
  2. Read the matching reference file — Each entry includes a summary and key technical details. Use these to orient yourself. Do not fetch yet.
  3. Act immediately — Write the answer or scaffold from your knowledge and the reference file descriptions. Do not fetch as preparation.
  4. 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.
      // NEED: exact consensus tag for uint256
      ) → fetch that one thing → fill it in → continue
    • 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.
⚠️ 重要提示 — Agent在获取任何内容前必须阅读: 部分URL的WebFetch返回结果可能只有空框架(仅包含导航/元数据,没有正文内容或代码)。每次调用WebFetch后,使用内容前请先评估质量。
每次WebFetch调用后请确认: 响应中是否包含实际正文内容和/或代码块,且有用内容长度超过约1000字符?
完整的内容获取层级流程——请按顺序执行:
  1. WebFetch → 评估内容质量 → 内容充足则继续处理
  2. Bash curl(如果WebFetch仅返回空框架)——支持Windows 10+、Linux和Mac系统 →
    bash
    curl -s -L -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" "<url>"
  3. 告知用户 → 如果以上两种方式都失败,告知对应的URL并建议用户直接打开访问
所有内容获取操作都要遵循该流程:文档页面、GitHub URL、文本转储文件均适用。
当用户提出CRE相关问题时:
  1. 匹配用户意图与参考文件 —— 从下方列出的参考文件中找到最匹配查询的主题。
  2. 阅读匹配的参考文件 —— 每个条目都包含摘要和关键技术细节,先用这些内容梳理上下文,暂时不要获取外部内容。
  3. 立即响应 —— 基于你的知识储备和参考文件描述撰写答案或代码框架,不要预先获取内容做准备。
  4. 迭代优化 —— 给出你的回复,让用户测试或运行。之后循环执行:
    • 遇到错误或内容缺口阻碍进度 → 仅获取错误明确指向的内容 → 修复 → 重复
    • 无法编写某部分具体内容 → 行内标注(例如
      // NEED: 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:
  1. 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.
  2. Repo references second (
    repo-*.md
    ) — Use when the doc page lacks sufficient code, or the user explicitly wants a working implementation (templates, SDK examples, demo apps).
  3. Full-text doc dumps last (
    llms-full-ts.txt
    /
    llms-full-go.txt
    ) — 35,000-word plain-text dumps linked from
    general.md
    . Use only when you can't identify a specific doc page or need broad coverage.
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都要应用上述的内容获取流程:
  1. 优先使用单独的文档页面 —— 针对性最强,通过内容获取流程拉取对应主题的具体页面。如果WebFetch返回空框架,可以通过curl获取完整内容。
  2. 其次使用仓库参考文件
    repo-*.md
    )—— 当文档页面的代码示例不足,或者用户明确需要可运行的实现(模板、SDK示例、演示应用)时使用。
  3. 最后使用全文文档转储
    llms-full-ts.txt
    /
    llms-full-go.txt
    )—— 是
    general.md
    中关联的3.5万字纯文本转储,仅当你无法找到具体的文档页面,或者需要覆盖大范围内容时使用。
使用规则:
  • 优先从最高优先级来源中获取最相关的单个URL,完整阅读内容。
  • 当获取的内容足够回答问题时立刻停止,不要为了验证或增强信心获取更多内容。
  • 仅当当前来源的内容确实不足时,才切换到下一个优先级的来源。
  • 永远不要点击获取到的内容里的链接,仅获取参考文件中明确列出的URL。
  • 从仓库参考文件获取内容时,仅拉取你需要的具体文件,不要浏览目录或读取相邻文件。
  • 最多获取3-5个URL,多数问题仅需要1-2次获取操作。

CLI Command Priority

CLI命令优先级

When looking up CRE CLI commands, flags, or usage:
  1. Run
    cre <command> --help
    locally
    — Most authoritative and version-accurate. Use this first if the CLI is installed.
  2. Individual CLI doc pages — Fetch the specific command page via the fetch cascade. Targeted and accessible.
  3. repo-cre-cli.md
    — Auto-generated markdown for every command. Use if the above don't cover the query.
  4. 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命令、参数或用法时:
  1. 优先本地运行
    cre <command> --help
    —— 最权威,和版本完全匹配,如果已经安装CLI请优先使用该方式。
  2. 其次使用单独的CLI文档页面 —— 通过内容获取流程拉取对应命令的具体页面,针对性强且易访问。
  3. 再使用
    repo-cre-cli.md
    —— 自动生成的所有命令的markdown文档,当上述方式无法覆盖查询时使用。
  4. 全文文档转储/其他 —— 最后手段。
使用规则:
  • 优先从最高优先级来源中获取最相关的单个URL,完整阅读内容。
  • 当获取的内容足够回答问题时立刻停止,不要为了验证或增强信心获取更多内容。
  • 仅当当前来源的内容确实不足时,才切换到下一个优先级的来源。
  • 永远不要点击获取到的内容里的链接,仅获取参考文件中明确列出的URL。
  • 从仓库参考文件获取内容时,仅拉取你需要的具体文件,不要浏览目录或读取相邻文件。
  • 最多获取3-5个URL,多数问题仅需要1-2次获取操作。

Reference Files

参考文件

FileTopicWhen to use
account-setup.mdAccount setupCreating accounts, CLI login, managing authentication
getting-started.mdGetting startedCLI installation, project setup, tutorial walkthrough (Go & TypeScript)
capabilities.mdCapabilitiesEVM read/write, HTTP capability, triggers overview
workflow-building.mdWorkflow buildingSecrets, time, randomness, triggers (cron/HTTP/EVM log), HTTP client, EVM client, onchain read/write, report generation
cli-reference.mdCLI referenceCLI commands for accounts, auth, project setup, secrets, workflows, utilities
sdk-reference.mdSDK referenceSDK core, consensus/aggregation, EVM client, HTTP client, trigger APIs (Go & TypeScript)
operations.mdOperationsDeploying, simulating, monitoring, activating, pausing, updating, deleting workflows, multi-sig wallets
concepts.mdConceptsConsensus computing, finality, non-determinism, TypeScript WASM runtime
organization.mdOrganizationOrg management, inviting members, linking wallet keys
general.mdGeneralCRE overview, key terms, demos, Gelato migration, project configuration, supported networks, release notes, service quotas, support
templates.mdTemplatesCRE workflow templates overview and usage
文件主题使用场景
account-setup.md账户设置创建账户、CLI登录、身份验证管理
getting-started.md入门指南CLI安装、项目初始化、教程实操(Go & TypeScript)
capabilities.md功能EVM读写、HTTP功能、触发器概览
workflow-building.md工作流构建密钥、时间、随机数、触发器(cron/HTTP/EVM日志)、HTTP客户端、EVM客户端、链上读写、报告生成
cli-reference.mdCLI参考账户、身份验证、项目初始化、密钥、工作流、工具类相关CLI命令
sdk-reference.mdSDK参考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):
  1. Determine language — Before generating any code, confirm whether the user wants Go or TypeScript. Ask directly if not already clear from context.
  2. 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.
  3. 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
    ).
  4. Present and iterate — Give the user the scaffold with simulation commands. Ask them to run
    cre workflow simulate
    . Then loop:
    • 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.
  5. 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.
生成或搭建新工作流(不仅仅是回答问题)时,请遵循以下额外步骤:
  1. 确定开发语言 —— 生成任何代码前,确认用户需要使用Go还是TypeScript。如果上下文没有明确说明,直接询问用户。
  2. 选择HTTP功能 —— 如果工作流涉及HTTP请求,询问用户需要常规HTTP还是Confidential HTTP。说明两者的区别:常规HTTP是标准API调用的默认选项;Confidential HTTP是可选功能,通过可信执行环境运行、密钥注入和可选响应加密实现隐私保护请求。不要自行假设使用哪种,让用户决定。
  3. 立刻编写代码框架 —— 基于你的知识生成完整的工作流结构,不要先获取内容。行内标注具体的不确定点(例如
    // NEED: uint256对应的准确共识标签
    // NEED: 验证project.yaml结构
    )。
  4. 输出并迭代优化 —— 将带有模拟命令的代码框架提供给用户,让他们运行
    cre workflow simulate
    。之后循环执行:
    • 模拟报错 → 仅获取错误明确指向的内容 → 修复 → 让用户重新运行
    • 存在行内标注的内容缺口 → 仅获取该部分具体内容 → 补充完整 → 继续
    • 无错误 → 完成
    • 每个缺口仅执行一次获取操作,永远不要为了预防潜在错误进行推测性获取。
  5. 默认提供模拟命令 —— 始终包含模拟命令,仅当用户明确要求时才提供部署步骤。提醒用户部署需要抢先体验权限、已充值的钱包和关联的密钥。

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.
FileRepoWhen to use
repo-cre-templates.mdcre-templatesStarter templates, building blocks, example workflow patterns
repo-cre-sdk-typescript.mdcre-sdk-typescriptTypeScript SDK source, HTTP trigger package, SDK examples
repo-cre-sdk-go.mdcre-sdk-goGo SDK source, capability implementations, consensus code
repo-cre-prediction-market-demo.mdcre-gcp-prediction-market-demoPrediction market demo app, end-to-end workflow example
repo-cre-cli.mdcre-cliCRE CLI source code and auto-generated command reference docs
仓库参考文件是可运行代码实现的可靠来源。当单独的文档页面缺少足够的代码示例,或者用户明确需要模板或可运行的实现时使用。
文件仓库使用场景
repo-cre-templates.mdcre-templates入门模板、构建模块、工作流示例模式
repo-cre-sdk-typescript.mdcre-sdk-typescriptTypeScript SDK源码、HTTP触发器包、SDK示例
repo-cre-sdk-go.mdcre-sdk-goGo SDK源码、功能实现、共识代码
repo-cre-prediction-market-demo.mdcre-gcp-prediction-market-demo预测市场演示应用、端到端工作流示例
repo-cre-cli.mdcre-cliCRE CLI源码和自动生成的命令参考文档

Debugging Checklist

调试检查清单

Follow these steps when diagnosing errors or fixing broken CRE code:
  1. Identify the capability involved — Determine which CRE capability (HTTP client, EVM client, triggers, secrets, consensus, etc.) is related to the error.
  2. 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.
  3. Check repo examples — If the doc page lacks a working implementation, consult the matching
    repo-*.md
    reference file. If still insufficient, fetch the llms-full text dump from
    general.md
    .
  4. Check known issues — Review the Known Issues section below for any matching bug or workaround.
  5. 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.
  6. 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代码时遵循以下步骤:
  1. 确定涉及的功能模块 —— 找到和错误相关的CRE功能(HTTP客户端、EVM客户端、触发器、密钥、共识等)。
  2. 获取相关文档页面 —— 通过匹配的参考文件找到该功能对应的具体文档页面,使用内容获取流程拉取内容。
  3. 检查仓库示例 —— 如果文档页面缺少可运行的实现,参考对应的
    repo-*.md
    参考文件。如果内容仍然不足,从
    general.md
    获取llms-full全文转储。
  4. 检查已知问题 —— 查看下方的已知问题部分,确认是否有匹配的bug或临时解决方案。
  5. 再提出修复方案 —— 不要基于类型签名、通用编程知识或基础原理猜测解决方案。CRE的WASM运行时和功能接口有特殊要求,可能和通用开发规则不同。
  6. 如果修复失败,重新查阅文档 —— 不要通过猜测替代方案迭代,回到步骤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
secrets.yaml
is a substring or prefix of the secret name (the YAML key). For example, secret name
GEMINI_API_KEY_SECRET
with env var
GEMINI_API_KEY
fails because
GEMINI_API_KEY
is a prefix of
GEMINI_API_KEY_SECRET
.
Workaround: Ensure the env var name is never a substring/prefix of the secret name. Use a suffix like
_VAR
on the env var (e.g.,
GEMINI_API_KEY_VAR
).
Observed in: CRE CLI v1.1.0
Verification test: Create a
secrets.yaml
with a secret name that contains the env var as a prefix (e.g., key
MY_SECRET_NAME
, env var
MY_SECRET
). 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.yaml
中的环境变量名称是密钥名称(YAML键)的子串或前缀,密钥解析会失败并报错"secret not found"。例如:密钥名称为
GEMINI_API_KEY_SECRET
,环境变量为
GEMINI_API_KEY
,因为
GEMINI_API_KEY
GEMINI_API_KEY_SECRET
的前缀,会触发该问题。
解决方案: 确保环境变量名称永远不是密钥名称的子串/前缀。为环境变量添加
_VAR
后缀(例如
GEMINI_API_KEY_VAR
)。
影响版本: CRE CLI v1.1.0
验证方法: 创建一个
secrets.yaml
,其中密钥名称包含环境变量作为前缀(例如键为
MY_SECRET_NAME
,环境变量为
MY_SECRET
)。运行模拟,如果报错"secret not found"说明bug仍然存在,如果运行成功说明bug已修复,可以移除该问题说明。

Tips

提示

  • 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
    workflow-building.md
    , and supplement with
    sdk-reference.md
    for API details.
  • For onboarding, start with
    getting-started.md
    then
    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
    assets/cre-docs-index.md
    for deeper search if reference file descriptions aren't sufficient.
  • 很多主题有独立的Go和TypeScript页面,如果不清楚用户使用的语言可以询问,或者同时获取两个版本的内容。
  • 工作流生成任务请遵循上述的工作流生成检查清单,从
    workflow-building.md
    开始,需要API细节时补充参考
    sdk-reference.md
  • 入门引导类需求从
    getting-started.md
    开始,之后参考
    account-setup.md
  • 代码示例类需求优先通过内容获取流程拉取具体的文档页面,如果需要更多实现细节再参考仓库参考文件。
  • 参考文件条目包含来自文档索引的丰富描述,仔细阅读以缩小需要获取的URL范围,不要盲目获取内容。
  • 如果参考文件的描述不足以筛选内容,可以访问
    assets/cre-docs-index.md
    获取带有结构化JSON元数据的完整文档索引,进行更深入的搜索。",