ruleset-lifecycle-operations
Add or update rule definitions, create and manage rule groups, and migrate rules across groups in skeptic using the property-based layout. Use when the user asks to add/update rules, add/manage groups, or reorganize `internal/rules`.
- License 许可
- GPL-3.0
- 所属仓库
- TGPSKI/skeptic
- 最近更新
- 2026-08-27
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- ruleset-lifecycle-operations
- description
- Add or update rule definitions, create and manage rule groups, and migrate rules across groups in skeptic using the property-based layout. Use when the user asks to add/update rules, add/manage groups, or reorganize `internal/rules`.
03 SKILL.md 正文
Ruleset Lifecycle Operations
Required Reference
Before making any rule or group change, read:
docs/RULESET_GROUPING.md
This document is the source of truth for:
- active group files
- deterministic
DefaultRules()composition order - per-group testing expectations
- maintenance constraints (property-based groups, no versioned buckets)
Operations
1) Add Rule
- Pick the target group file by threat property:
- behavior/payload signals:
rules_behavioral_signals.go - agentic/LLM surfaces:
rules_agentic_surfaces.go - non-code SCM/config surfaces:
rules_non_code_surfaces.go - identity/IaC exposure:
rules_identity_exposure.go - broad ATT&CK heuristics:
rules_attack_tactics.go - campaign IOCs: use the
threat-rules-ingestionskill (signed JSON rulepacks inrulepacks/campaigns/, not built-in rule files)
- behavior/payload signals:
- Add a
Ruleliteral with full metadata (ID,Title,Description,Category,Mitre,Severity,Pattern,Target). Optionally setConfidenceClassto override the default derived from the rule ID prefix (seemodel.DefaultConfidenceForRuleID); most rules should omit this and rely on the prefix-based default (AGT-TRUST-→ definitive,AGT-SKL-→ heuristic,COR-/DRIFT-→ correlated, etc.). - Use
PathPatternand/orContextPatternonly when narrowing is required to avoid broad false positives. - Update that group's
_test.go:- expected rule count
- sentinel IDs where appropriate
- If total rules changed, update
rules_core_test.gototal count and docs metadata indocs/RULESET_GROUPING.md.
2) Update Rule
- Locate rule by stable
ID(keepIDunchanged unless there is explicit migration intent). - Apply the minimal change (pattern, severity, description, context gates).
- Ensure RE2 compatibility (
regexppackage only; no lookaheads/backreferences). - Re-run group tests and full rules tests.
- Update docs only if behavior, grouping, or metadata summaries changed.
3) Add Group
- Create a new descriptive file name:
rules_<property>_<surface>.go(no version/phase naming). - Add one top-level function returning
[]Rulefor that group. - Create matching test file
rules_<property>_<surface>_test.gowith:assertRuleCountvalidateRuleSlicesentinel checks
- Wire the group into
DefaultRules()inrules_core.goat the correct risk-order boundary. - Update:
docs/RULESET_GROUPING.mddocs/ARCHITECTURE.mdrules layout table
4) Manage Group
Use when tuning a group without introducing a new file:
- rebalance categories/severity
- tighten patterns with
PathPattern/ContextPattern - remove overlap or duplicates
- keep group cohesive by threat property
Always keep the group's test count/sentinels current.
5) Migrate Group
Use when moving rules between group files:
- Move rules by property (not chronology).
- Keep deterministic order stable unless explicitly changing strategy.
- Update both source and target group tests (counts + sentinels).
- Update
DefaultRules()composition if boundaries changed. - Refresh docs in
docs/RULESET_GROUPING.mdanddocs/ARCHITECTURE.md.
Validation Commands
# Fast package validation
go test ./internal/rules -count=1
# Full verification
go test ./... -count=1
go vet ./...
Non-Rule Findings
Some finding families are emitted by internal/checks/ rather than rule files:
DOM-TYPO-001–003: structural domain typosquat (emitted byinternal/checks/domain_checks.go)DEP-TYPO-001–002: dependency typosquat (emitted byinternal/checks/dep_checks.go)GRAPH-001–010,MID-*: identity graph findings (emitted byinternal/checks/graph*.go)POL-GHA-002–004,POL-DOCKER-001: policy checks (emitted byinternal/checks/policy_checks.go)BHV-*: behavior chain findings (emitted byinternal/checks/behavior_checks.go)COR-*,DRIFT-*: correlation findings (emitted byinternal/correlation/)
These are not in internal/rules/ group files and do not count toward the built-in rule total.
Guardrails
- Keep property-based naming and grouping.
- Avoid reintroducing versioned/phase buckets.
- Every group file must have a corresponding test file.
- Keep
DefaultRules()as the single composition/ordering point. - Update documentation when group structure, counts, or strategy changes.
04 同仓库更多 Skills
correlation-multi
暂无简介
agentic-mcp-creds
暂无简介
workflow-action-updates
Audit and update GitHub Actions workflow files to use the latest action releases pinned to full commit SHAs. Scans all .github/workflows/*.yml files, resolves current vs latest versions, and applies upgrades. Use when the user asks to update actions, check for outdated workflow dependencies, pin actions to SHAs, or audit CI workflow hygiene.
threat-rules-ingestion
Ingest fresh security research from URLs/files, generate signed scanner rule packs, and validate with policy and behavior scan styles across ecosystems. Use when the user asks to operationalize new threat intel into skeptic detections.
go-release
Manage the full Go module release lifecycle: determine next semver version, update CHANGELOG.md, create and push a git tag, and verify pkg.go.dev picks up the new version. Use when the user asks to tag a release, bump the version, update the changelog, or publish a new module version.
documentation-lifecycle
Generate, update, and maintain per-module documentation under docs/modules/, keep ARCHITECTURE.md and README.md current, and produce Mermaid diagrams for data-flow, block, and dependency views. Use when the user asks to document a package, update architecture docs, generate diagrams, or audit documentation freshness.