Initialize Rihal project configuration and load config variables. Use when any skill needs module-specific configuration values, or when setting up a new Rihal project.
This skill is the configuration entry point for all Rihal skills. It has two modes:
Every Rihal skill should call this on activation to get its config vars. The caller never needs to know whether init happened — they just get their config back.
The script rihal_init.py is located in this skill's scripts/ directory. Locate and run it using python for all commands below.
Run the rihal_init.py script with the load subcommand. Pass --project-root set to the project root directory.
--module {module_code}--all--vars var1:default1,var2--module to get core vars onlyIf the script returns JSON vars — store them as {var-name} and return to the calling skill. Done.
If the script returns an error or init_required — proceed to the Init Path below.
When the fast path fails (config missing for a module), run this init flow.
Run rihal_init.py with the check subcommand, passing --module {module_code}, --skill-path {calling_skill_path}, and --project-root.
The response tells you what's needed:
"status": "ready" — Config is fine. Re-run load."status": "no_project" — Can't find project root. Ask user to confirm the project path."status": "core_missing" — Core config doesn't exist. Must ask core questions first."status": "module_missing" — Core exists but module config doesn't. Ask module questions.The response includes:
core_module — Core module.yaml questions (when core setup needed)target_module — Target module.yaml questions (when module setup needed, discovered from --skill-path or _rihal/{module}/)core_vars — Existing core config values (when core exists but module doesn't)core_missing)The check response includes core_module with header, subheader, and variable definitions.
header and subheader to the userprompt and defaultsingle-select, show the options as a numbered listprompt (array), show all linesThe check response includes target_module with the module's questions. Variables may reference core answers in their defaults (e.g., {output_folder}).
rihal_init.py with the resolve-defaults subcommand, passing --module {module_code}, --core-answers '{core_answers_json}', and --project-rootheader and subheadersingle-select variables, show options as a numbered listCollect all answers and run rihal_init.py with the write subcommand, passing --answers '{all_answers_json}' and --project-root.
The --answers JSON format:
{
"core": {
"user_name": "Rihal",
"communication_language": "English",
"document_output_language": "English",
"output_folder": "_rihal-output"
},
"bmb": {
"rihal_builder_output_folder": "_rihal-output/skills",
"rihal_builder_reports": "_rihal-output/reports"
}
}
Note: Pass the raw user answers (before result template expansion). The script applies result templates and {project-root} expansion when writing.
The script:
_rihal/core/config.yaml with core values (if core answers provided)_rihal/{module}/config.yaml with core values + module values (result-expanded)directories arrayAfter writing, re-run rihal_init.py with the load subcommand (same as the fast path) to return resolved vars. Store returned vars as {var-name} and return them to the calling skill.