| name | create-ruleset-groups |
| description | Propose and Write Ruleset Groups for a Domain |
Propose and Write Ruleset Groups for a Domain
Scan the per-file files under policy_facets/computations/ for stage signals, propose ruleset_groups, and write them to guidance/ruleset-groups.yaml. The deterministic (1a) explicit-stage: scan, the UPDATE-m merge precedence, and the display_name-derived catch-all all run in xlator scan-ruleset-groups; this skill owns the domain menu, the UPDATE-mode [a/r/m] prompt, the optional AI heading-text top-up (1b) when the tool flags it, and the manifest record call.
A "Ruleset Group" is synonymous with a "ruleset group".
Input
/create-ruleset-groups <domain>
Read ../../core/output-fencing.md now.
Pre-flight
- Domain argument provided?
- NO → List all directories matching
$DOMAINS_DIR/*/ as a numbered menu and prompt:
:::user_input
Available domains:
- snap
- ak_doh
Which domain? Enter a number or domain name:
:::
Await the user's response and use it as
<domain>. Then continue.
The tool re-validates every other pre-flight condition (domain folder, metadata.yaml, skeleton.yaml, and a non-empty policy_facets/computations/) and exits 2 with a clear stderr message if any required file is missing. Relay the stderr verbatim inside :::error and stop.
Mode Detection
Check whether $DOMAINS_DIR/<domain>/specs/guidance/ruleset-groups.yaml exists:
-
Absent → CREATE mode. Tool mode: create. Proceed to Process.
-
Present → UPDATE mode. Display the existing list and prompt:
:::user_input
ruleset_groups already defined:
- —
- —
[a]ccept / [r]eplace / [m]erge?
:::
a → Exit without invoking the tool. Emit:
:::next_step
Next: Run /create-ruleset-modules to detect ruleset module candidates.
:::
r → Tool mode: replace. Proceed to Process.
m → Tool mode: merge. Proceed to Process.
Process
-
Run the deterministic scan tool:
xlator scan-ruleset-groups <domain> --mode <create|replace|merge>
-
Parse the tool's stdout. The first line is a single-line JSON header; the line --- SCAN-RULESET-GROUPS-HEADER-END --- divides the header from the human-readable proposal table.
-
Optional heuristic (1b) heading-text top-up. When the JSON header has heading_text_fallback_recommended == true, the tool has produced nothing the skill can use:
-
Relay the proposal table (everything after the sentinel divider) verbatim inside :::detail.
-
Print:
:::important
$DOMAINS_DIR//specs/guidance/ruleset-groups.yaml [CREATED]
:::
-
Record the guidance-tier manifest so /check-freshness can later detect drift between policy_facets/ and this skill's outputs:
xlator record-tier-manifest <domain> --tier guidance
If the command exits non-zero, emit :::error with the captured stderr and stop — do not proceed to :::next_step.
-
Suggest next steps:
:::next_step
Next: Run /create-ruleset-modules to detect ruleset module candidates.
:::
Output
| File | Action |
|---|
$DOMAINS_DIR/<domain>/specs/guidance/ruleset-groups.yaml | Created (first run) or merged (subsequent runs) |
Common Mistakes to Avoid
- The tool enforces the suffix-normalization rule (
stage: income_test and stage: income collapse to one canonical income group) and analyst-edit stickiness on merge collisions for stage-derived candidates — do not bypass either by hand-editing the file mid-run.
- The optional (1b) heading-text AI top-up only fires when
heading_text_fallback_recommended == true in the JSON header. Do not AI-scan headings when the tool has already produced candidates.
- In UPDATE mode
[a]ccept, exit without invoking the tool — do not overwrite existing ruleset-groups.yaml content.