一键导入
sync-config
Audit and fix CLI options that are missing from config file structs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit and fix CLI options that are missing from config file structs
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sync-config |
| description | Audit and fix CLI options that are missing from config file structs |
Audits src/cli.rs against src/config.rs and src/main.rs to detect CLI options that are not exposed through the config file layer, and guides fixing any gaps found.
/sync-configEvery CLI option intended to be user-configurable must appear in five places:
| Location | What to add |
|---|---|
src/config.rs — ConfigFile struct | pub <field>: Option<T> |
src/config.rs — CONFIG_TEMPLATE | Commented-out YAML entry with description |
src/main.rs — MergedConfig struct | <field>: T |
src/main.rs — merge_config() | CLI > config > default priority logic |
src/main.rs — request builder | Pass merged value to SbomRequest |
check_cveUse check_cve as the canonical pattern when adding a new boolean flag:
src/config.rs — ConfigFile:
pub check_cve: Option<bool>,
src/config.rs — CONFIG_TEMPLATE:
# Enable CVE vulnerability checking
# check_cve: false
src/main.rs — MergedConfig:
check_cve: bool,
src/main.rs — merge_config():
// check_cve: CLI flag || config value
let check_cve = args.check_cve || config.check_cve.unwrap_or(false);
src/main.rs — request builder:
.check_cve(merged.check_cve)
Read src/cli.rs and list all pub fields in the Args struct.
Exclude from audit (infrastructure, not user-configurable features):
config (-c / --config) — selects the config file itselfinit (--init) — generates the config templatepath (-p) — project pathoutput (-o) — output file pathConfigFile CoverageRead src/config.rs and list all fields in the ConfigFile struct (excluding unknown_fields).
Map CLI field names to config field names (they may differ):
CLI field (Args) | Config field (ConfigFile) |
|---|---|
exclude | exclude_packages |
ignore_cve | ignore_cves |
license_allow / license_deny | license_policy |
| others | same name |
Report any CLI options absent from ConfigFile.
MergedConfig CoverageRead src/main.rs and list all fields in the MergedConfig struct.
Report any CLI options (that passed Step 2) absent from MergedConfig.
CONFIG_TEMPLATE CoverageRead the CONFIG_TEMPLATE const in src/config.rs.
For each field in ConfigFile, verify a corresponding commented-out YAML entry exists.
Report any ConfigFile fields missing from the template.
Present a summary table:
CLI option | ConfigFile | MergedConfig | CONFIG_TEMPLATE | Status
-----------------|------------|--------------|-----------------|--------
check_cve | YES | YES | YES | OK
suggest_fix | NO | NO | NO | MISSING
verify_links | NO | NO | NO | MISSING
If no gaps are found, report "All CLI options are reflected in config — no action needed."
For each missing option, implement all required locations following the reference pattern:
pub <field>: Option<T> to ConfigFile in src/config.rsCONFIG_TEMPLATE in src/config.rs<field>: T to MergedConfig in src/main.rsmerge_config() in src/main.rsSbomRequest in the request builderPriority rule for booleans: CLI flag || config.field.unwrap_or(false)
Priority rule for Options: args.field.or(config.field)
After fixing, ensure merge_config logic is covered by unit tests:
truetrueRun tests:
cargo test --lib merge_config
cargo fmt --all -- --check
cargo clippy -- -D warnings
cargo test
If any check fails, fix before committing.
suggest_fix and verify_links are intentionally CLI-only as of PR #275 — confirm with user before adding config supportfalse; Option fields default to NoneCONFIG_TEMPLATE must remain valid YAML when uncommented (verified by test_template_is_valid_yaml_when_uncommented)Orchestrate complete issue implementation workflow from branch to PR
Create Pull Requests with pre-flight checks and proper formatting
Decompose a large GitHub Issue (epic, refactor, or feature) into subtask Issues, each small enough for a single focused PR
Standardized release workflow with version updates and CHANGELOG management
Spawn a Reviewer Agent to evaluate code changes against architecture, design, and quality criteria
Create commits with code quality checks and conventional commit messages