package-spec
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesepackage-spec
package-spec
Skill authority
技能权威性
The rules and patterns defined in this skill and its reference files are the authoritative source of truth. When examining existing integrations in the repository for reference, you may encounter patterns that conflict with what is specified here -- many integrations contain legacy patterns that predate current standards. Always follow this skill over patterns observed in other integrations. If a reference integration uses a deprecated or prohibited pattern, do not copy it.
elastic/integrations本技能及其参考文件中定义的规则和模式是权威的事实来源。在仓库中查看现有集成作为参考时,你可能会遇到与本规范冲突的模式——许多集成包含的旧模式早于当前标准。请始终遵循本技能的要求,而非其他集成中观察到的模式。如果某个参考集成使用了已弃用或被禁止的模式,请勿复制。
elastic/integrationsWhen to use
使用场景
Use this skill when tasks include:
- building or reviewing at root or data stream level
manifest.yml - adding or validating entries
changelog.yml - selecting the correct change type and semantic version bump
- configuring policy templates, inputs, and variable declarations
- debugging or
elastic-package linterrors on manifests or changelogselastic-package check - reviewing variable scoping across package, policy template, input, and data stream levels
- validating Handlebars template variables against manifest declarations
- configuring routing rules and their required manifest flags
- determining which is needed for a package's features
format_version
当你需要完成以下任务时,使用本技能:
- 构建或审核根目录或数据流级别的
manifest.yml - 添加或验证条目
changelog.yml - 选择正确的变更类型和语义化版本升级规则
- 配置策略模板、输入和变量声明
- 调试或
elastic-package lint在清单或变更日志上的错误elastic-package check - 审核包、策略模板、输入和数据流级别的变量作用域
- 验证Handlebars模板变量与清单声明的一致性
- 配置路由规则及其所需的清单标志
- 确定包的功能需要哪个
format_version
When NOT to use
不适用场景
- Package scaffolding and directory layout ()
create-integration - Ingest pipeline design ()
ingest-pipelines - Field mapping and ECS compliance ()
ecs-field-mappings - CEL programs ()
cel-programs - Transform configuration (see skill's
review-integration)references/transform-guide.md
- 包脚手架和目录布局(参考技能)
create-integration - 摄入管道设计(参考技能)
ingest-pipelines - 字段映射与ECS合规性(参考技能)
ecs-field-mappings - CEL程序(参考技能)
cel-programs - 转换配置(参考技能的
review-integration)references/transform-guide.md
Handoff
交接指引
For package directory layout and required files, see -> . For CLI commands and troubleshooting, see .
create-integrationreferences/package-layout.mdelastic-packageelastic-package-cli关于包目录布局和所需文件,请查看 -> 。关于 CLI命令和故障排除,请查看技能。
create-integrationreferences/package-layout.mdelastic-packageelastic-package-cliformat_version
format_version
The field in declares which elastic/package-spec version the package conforms to. The current standard for new packages is .
format_versionmanifest.yml"3.4.2"Use the minimum version that supports the features the package actually uses, not the latest available spec version. Bumping without needing new features:
- forces users to run a newer Kibana than necessary
- breaks backward compatibility for no reason
- makes it harder to determine which features the package depends on
Only bump when the package uses a feature introduced in a newer spec version:
| Feature | Minimum format_version |
|---|---|
| Basic package structure | 1.0.0 |
| Input-level variables | 2.0.0 |
| 2.3.0 |
| 2.9.0 |
| 3.0.0 |
Secret variables ( | 3.0.0 |
| 3.0.3 |
See for the full feature-to-version table including recent spec additions (3.6.0+), and for the review procedure.
references/format-version-features.mdreferences/manifest-rules.md请使用支持包实际使用功能的最低版本,而非最新可用的规范版本。无需求升级版本会:
- 强制用户运行比实际需要更新的Kibana
- 无故破坏向后兼容性
- 难以确定包依赖的功能
只有当包使用了新版本规范中引入的功能时,才升级版本:
| 功能 | 最低format_version |
|---|---|
| 基础包结构 | 1.0.0 |
| 输入级变量 | 2.0.0 |
| 2.3.0 |
| 2.9.0 |
| 3.0.0 |
机密变量( | 3.0.0 |
| 3.0.3 |
完整的功能对应版本表(包括3.6.0+的最新规范新增内容)请查看,审核流程请查看。
references/format-version-features.mdreferences/manifest-rules.mdconditions.kibana.version
conditions.kibana.version
The current standard constraint is . This is set in the root only -- data stream manifests must NOT set their own .
"^8.19.0 || ^9.1.0"manifest.ymlconditionsWhen an integration uses features that require a newer agent (e.g., CEL functions introduced in v9.3.0), the constraint must be adjusted accordingly. For systematic version verification of CEL features, see the skill's version check references.
review-integration当前的标准约束为。此约束仅在根目录的中设置——数据流清单不得设置自己的。
"^8.19.0 || ^9.1.0"manifest.ymlconditions当集成使用需要更新Agent的功能时(例如,v9.3.0中引入的CEL函数),必须相应调整约束。关于CEL功能的系统版本验证,请查看技能的版本检查参考文档。
review-integrationVariable scoping
变量作用域
Fleet variables exist at four levels:
- Package level -- top-level
manifest.ymlvars: - Policy template level -- under
manifest.ymlpolicy_templates[].vars: - Input level -- under
manifest.ymlpolicy_templates[].inputs[].vars: - Data stream level -- under
data_stream/*/manifest.ymlstreams[].vars:
A variable declared in an inner scope must not reuse the name of a variable in an outer scope. This is variable shadowing and is rejected by validation.
elastic-packageSee -> Variable shadowing for full rules, examples, and common patterns.
references/manifest-rules.mdFleet变量存在四个级别:
- 包级别——顶层的
manifest.ymlvars: - 策略模板级别——中
manifest.yml下的变量policy_templates[].vars: - 输入级别——中
manifest.yml下的变量policy_templates[].inputs[].vars: - 数据流级别——中
data_stream/*/manifest.yml下的变量streams[].vars:
内部作用域中声明的变量不得重用外部作用域中的变量名称。这种变量遮蔽行为会被验证拒绝。
elastic-package完整规则、示例和常见模式请查看 -> 变量遮蔽部分。
references/manifest-rules.mdManifest rules (brief)
清单规则(简要)
-
Every Handlebarsmust be declared in a manifest -- undeclared variables silently resolve to empty strings. Handlebars helpers (
{{var}},{{#if}},{{#each}},{{#unless}}) and built-in variables ({{#contains}},{{data_stream.type}},{{data_stream.dataset}},{{data_stream.namespace}}) are exempt.{{output}} -
Routing rules require dynamic flags -- when a data stream uses, the data stream manifest must declare
routing_rules.ymlandelasticsearch.dynamic_dataset: true.elasticsearch.dynamic_namespace: true -
Use proper YAML nesting, not dotted keys --as a literal key name creates a single flat key, not a nested object. Use nested
elasticsearch.dynamic_dataset->elasticsearch:structure.dynamic_dataset:
See for complete rules, correct/incorrect examples, and the review checklist.
references/manifest-rules.md-
每个Handlebars必须在清单中声明——未声明的变量会静默解析为空字符串。Handlebars辅助函数(
{{var}}、{{#if}}、{{#each}}、{{#unless}})和内置变量({{#contains}}、{{data_stream.type}}、{{data_stream.dataset}}、{{data_stream.namespace}})除外。{{output}} -
路由规则需要动态标志——当数据流使用时,数据流清单必须声明
routing_rules.yml和elasticsearch.dynamic_dataset: true。elasticsearch.dynamic_namespace: true -
使用正确的YAML嵌套,而非点式键——将作为字面键名会创建一个扁平键,而非嵌套对象。请使用嵌套的
elasticsearch.dynamic_dataset->elasticsearch:结构。dynamic_dataset:
完整规则、正确/错误示例和审核清单请查看。
references/manifest-rules.mdChangelog schema
变更日志Schema
changelog.ymlyaml
- version: "1.2.0"
changes:
- description: Added example parsing for edge-case payloads.
type: enhancement
link: https://github.com/elastic/integrations/pull/12345Each entry requires , , and . Valid types: , , .
descriptiontypelinkenhancementbugfixbreaking-changechangelog.ymlyaml
- version: "1.2.0"
changes:
- description: Added example parsing for edge-case payloads.
type: enhancement
link: https://github.com/elastic/integrations/pull/12345每个条目需要、和。有效的类型包括:、、。
descriptiontypelinkenhancementbugfixbreaking-changeVersion bump rules
版本升级规则
- patch (): bug fixes and low-risk fixes
x.y.Z - minor (): new content -- new data streams, new fields, new features
x.Y.z - major (): breaking changes -- field type changes or removals on existing integrations, ECS mapping conflicts, required config/auth changes that break existing policies, data stream restructuring, default behavior changes that alter collected or normalized data
X.y.z
- 补丁版本():bug修复和低风险修复
x.y.Z - 次版本():新增内容——新数据流、新字段、新功能
x.Y.z - 主版本():破坏性变更——现有集成的字段类型变更或移除、ECS映射冲突、破坏现有策略的必需配置/认证变更、数据流重构、改变采集或标准化数据的默认行为变更
X.y.z
Adding changelog entries
添加变更日志条目
Edit directly, or use (see skill for command flags and usage).
changelog.ymlelastic-package changelog addelastic-package-cli--next patch|minor|major直接编辑,或使用(命令标志和用法请查看技能)。
changelog.ymlelastic-package changelog add--next patch|minor|majorelastic-package-cliCommon changelog pitfalls
常见变更日志陷阱
- Adding the entry under the wrong version or not at the top
- Missing field --
linkvalidates that the PR/issue number is a positive integer and rejectselastic-package lint; use a real PR number orpull/0as a development placeholder and replace before mergepull/99999 - Bumping manifest/package version inconsistently with changelog intent
See for detailed patterns, breaking-change checklist, and CI examples.
references/changelog-patterns.md- 将条目添加到错误版本下或未放在顶部
- 缺少字段——
link会验证PR/issue编号是否为正整数,并且拒绝elastic-package lint;使用真实的PR编号或pull/0作为开发占位符,并在合并前替换pull/99999 - 清单/包版本升级与变更日志意图不一致
详细模式、破坏性变更清单和CI示例请查看。
references/changelog-patterns.mdUpstream: elastic/package-spec
上游参考:elastic/package-spec
The elastic/package-spec repository is the upstream authority for package structure, manifest schema, and validation rules. The in that repo documents which features were added in each spec version.
spec/changelog.ymlKey points from the package-spec versioning model:
- Packages must specify in root
format_versionmanifest.yml - A package at must be valid against specs in the range
format_version: x.y.zwhere[x.y.z, X.0.0)X = x + 1 - Patch versions may add stricter validations (e.g., 3.6.0 added pipeline tag and on_failure validation)
- Minor versions add new feature support
- Major versions are reserved for significant format changes
See for the curated feature-to-version table.
references/format-version-features.mdelastic/package-spec仓库是包结构、清单Schema和验证规则的上游权威。该仓库中的记录了每个规范版本中新增的功能。
spec/changelog.yml包规范版本模型的关键点:
- 包必须在根目录中指定
manifest.ymlformat_version - 的包必须在
format_version: x.y.z范围内的规范下有效,其中[x.y.z, X.0.0)X = x + 1 - 补丁版本可能添加更严格的验证(例如,3.6.0新增了管道标签和on_failure验证)
- 次版本添加新功能支持
- 主版本保留用于重大格式变更
整理后的功能对应版本表请查看。
references/format-version-features.mdReference files
参考文件
| File | Contains |
|---|---|
| Full rules for format_version selection, variable shadowing, Handlebars variable declarations, routing rules, YAML structure, and severity-tagged review checklist |
| Changelog entry patterns, semver rules, breaking-change checklist, CI examples |
| Feature-to-version table sourced from elastic/package-spec, including recent spec additions |
| 文件 | 内容 |
|---|---|
| format_version选择、变量遮蔽、Handlebars变量声明、路由规则、YAML结构的完整规则,以及带严重程度标记的审核清单 |
| 变更日志条目模式、语义化版本规则、破坏性变更清单、CI示例 |
| 源自elastic/package-spec的功能对应版本表,包括最新规范新增内容 |