一键导入
setup-config
Analyze a repository and generate an intelligent omen.toml with project-specific defaults. Use when starting Omen in a new project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze a repository and generate an intelligent omen.toml with project-specific defaults. Use when starting Omen in a new project.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze blast radius before changing specific files. Use before refactoring core components, making breaking API changes, or modifying shared code to identify affected files and stakeholders.
Get complexity and debt metrics before editing code
Focus code review on high-risk changes
Generate onboarding guide with key symbols, architecture overview, and subject matter experts. Use when joining a new project, onboarding teammates, or creating project documentation.
Identify highest-ROI refactoring targets
Audit module coupling, cohesion, hidden dependencies, and design smells. Use when conducting architecture reviews, evaluating design decisions, or identifying structural tech debt.
| name | setup-config |
| description | Analyze a repository and generate an intelligent omen.toml with project-specific defaults. Use when starting Omen in a new project. |
Analyze the current repository and generate an omen.toml configuration tailored to the project's tech stack, test patterns, and feature flag usage.
Use Glob to count files by extension:
Glob: **/*.go
Glob: **/*.rb
Glob: **/*.py
Glob: **/*.ts
Glob: **/*.js
Glob: **/*.java
Glob: **/*.rs
Identify the primary language(s) based on file counts. This determines:
Use Grep to search for SDK imports and usage patterns. Add detected providers to feature_flags.providers in the config.
| Provider | Config Value | Search Patterns |
|---|---|---|
| LaunchDarkly | launchdarkly | launchdarkly, ld-client, LDClient, boolVariation, stringVariation |
| Split | split | @splitsoftware, splitio, SplitClient, getTreatment |
| Flipper | flipper | Flipper.enabled?, Flipper[, flipper (in Gemfile) |
| Unleash | unleash | unleash-client, unleashclient, isEnabled with unleash import |
| Generic | generic | feature_flag, featureFlag, is_feature_enabled, isFeatureEnabled |
| ENV-based | env | ENV["FEATURE_, process.env.FEATURE_, os.environ["FEATURE_ |
Also check package manifests:
package.json: launchdarkly-*, @splitsoftware/*, unleash-*Gemfile: launchdarkly-*, flipper, split-*, unleashCargo.toml: launchdarkly, unleashgo.mod: launchdarkly, unleashrequirements.txt/pyproject.toml: launchdarkly-*, split-*, unleashclientOnly include providers that are actually detected. If no providers are found, leave providers = [] with a comment explaining how to add them manually.
If you find feature flag patterns that don't match the built-in providers, the user likely has an in-house system. Ask them about it and help them create a custom provider.
Custom providers use tree-sitter queries to match code patterns. They are defined separately from the providers list and run automatically.
Example: If you see patterns like MyFlags.enabled?("feature_name") in Ruby:
[[feature_flags.custom_providers]]
name = "my_flags"
languages = ["ruby"]
query = '''
(call
receiver: (constant) @receiver
method: (identifier) @method
arguments: (argument_list
(string (string_content) @flag_key)))
(#eq? @receiver "MyFlags")
(#eq? @method "enabled?")
'''
Key points for custom providers:
name: The provider name shown in output (choose something descriptive)languages: List of languages to apply this query to (e.g., ["ruby", "python"])query: A tree-sitter query that captures the flag key as @flag_key or @keyprovidersTo write tree-sitter queries:
omen context <file> to see the AST structure@flag_key or @keyUse Glob to find generated files:
Glob: **/*.pb.go
Glob: **/*.gen.go
Glob: **/*.generated.*
Glob: **/generated/**
Glob: **/gen/**
Glob: **/mocks/**
Add detected patterns to exclude list.
Use Glob to identify test file conventions:
Glob: **/*_test.go
Glob: **/*_spec.rb
Glob: **/*.test.ts
Glob: **/*.spec.js
Glob: **/test_*.py
Glob: **/tests/**
Glob: **/spec/**
Glob: **/__tests__/**
Add detected patterns to exclude list.
Use Glob to find directories containing test fixtures, evaluation data, sample files, and other non-production code that would skew analysis results (especially complexity and SATD):
Glob: **/fixtures/**/*.{rs,go,py,ts,js,java,rb}
Glob: **/test_data/**/*.{rs,go,py,ts,js,java,rb}
Glob: **/testdata/**/*.{rs,go,py,ts,js,java,rb}
Glob: **/evals/fixtures/**
Glob: **/test_fixtures/**
Glob: **/sample_data/**
Glob: **/samples/**/*.{rs,go,py,ts,js,java,rb}
Glob: **/snapshots/**
Glob: **/golden/**
Glob: **/__fixtures__/**
Glob: **/cassettes/**
Glob: **/vcr_cassettes/**
If any of these directories contain source files, add the parent pattern to the exclude list. These directories often contain:
Common patterns to add when detected:
**/fixtures/ - test fixtures**/test_data/ or **/testdata/ - test data directories**/evals/fixtures/ - ML/AI evaluation fixtures**/snapshots/ - snapshot test output**/cassettes/ - HTTP replay cassettesFor Ruby, Java, C#, or TypeScript projects, recommend enabling cohesion:
[score]
enable_cohesion = true
Write the config file to omen.toml with:
# Omen Configuration
# Generated by setup-config skill - customize as needed
# Documentation: https://github.com/panbanda/omen
[analysis]
complexity = true
satd = true
dead_code = true
churn = true
duplicates = true
defect = true
tdg = true
graph = true
churn_days = 30
[thresholds]
cyclomatic_complexity = 10
cognitive_complexity = 15
duplicate_min_lines = 6
duplicate_similarity = 0.8
dead_code_confidence = 0.8
[exclude]
gitignore = true
patterns = [
# Test files - detected patterns
# (add detected test patterns here)
# Generated code - detected patterns
# (add detected generated code patterns here)
# Language-specific excludes
# (add language-specific patterns here)
# Standard excludes
"vendor/",
"node_modules/",
".git/",
".omen/",
"dist/",
"build/",
]
[cache]
enabled = true
dir = ".omen/cache"
ttl = 24
[output]
format = "text"
color = true
[feature_flags]
# Feature flag providers to detect. Empty = no built-in detection.
# Available: launchdarkly, flipper, split, unleash, generic, env
# Populate with providers detected in Step 2, e.g.:
# providers = ["launchdarkly", "split"]
providers = []
# Custom providers for in-house feature flag systems (uses tree-sitter queries)
# [[feature_flags.custom_providers]]
# name = "my_flags"
# languages = ["ruby", "python"]
# query = '''
# (call
# receiver: (constant) @receiver
# method: (identifier) @method
# arguments: (argument_list (string (string_content) @flag_key)))
# (#eq? @receiver "MyFlags")
# (#eq? @method "enabled?")
# '''
[score]
# Set to true for OO-heavy codebases (Ruby, Java, C#)
enable_cohesion = false
patterns = [
"*_test.go",
"vendor/",
"**/*.pb.go",
"**/*.gen.go",
"**/mocks/",
]
patterns = [
"*_spec.rb",
"spec/",
".bundle/",
"sorbet/",
"*_generated.rb",
]
patterns = [
"test_*.py",
"*_test.py",
"tests/",
"__pycache__/",
".venv/",
"venv/",
"site-packages/",
]
patterns = [
"*.test.ts",
"*.spec.ts",
"*.test.js",
"*.spec.js",
"__tests__/",
"node_modules/",
"dist/",
"*.min.js",
]
patterns = [
"*Test.java",
"*Tests.java",
"test/",
"target/",
"build/",
]
patterns = [
"target/",
"Cargo.lock",
# Add if detected:
# "**/fixtures/",
# "**/test_data/",
# "**/evals/fixtures/",
]
After generating the config, display a summary:
Generated omen.toml with:
- Primary language: Ruby
- Feature flag providers: ["flipper"] (or "none detected" if empty)
- Cohesion scoring: enabled
- Exclude patterns: 12 patterns
Run `omen flags` to detect feature flags (requires providers to be configured).
Run `omen all` to verify the configuration works for your project.
If no feature flag providers were detected, remind the user:
No feature flag providers detected. If you use feature flags, add providers manually:
[feature_flags]
providers = ["launchdarkly"] # or: flipper, split, unleash, generic, env