@@ -1141,6 +1141,62 @@ def test_codex_skill_registration_uses_fallback_script_variant_without_init_opti
11411141 assert '.specify/scripts/bash/setup-plan.sh --json "$ARGUMENTS"' in content
11421142 assert ".specify/scripts/bash/update-agent-context.sh codex" in content
11431143
1144+ def test_codex_skill_registration_handles_non_dict_init_options (
1145+ self , project_dir , temp_dir
1146+ ):
1147+ """Non-dict init-options payloads should not crash skill placeholder resolution."""
1148+ import yaml
1149+
1150+ ext_dir = temp_dir / "ext-script-list-init"
1151+ ext_dir .mkdir ()
1152+ (ext_dir / "commands" ).mkdir ()
1153+
1154+ manifest_data = {
1155+ "schema_version" : "1.0" ,
1156+ "extension" : {
1157+ "id" : "ext-script-list-init" ,
1158+ "name" : "List init options" ,
1159+ "version" : "1.0.0" ,
1160+ "description" : "Test" ,
1161+ },
1162+ "requires" : {"speckit_version" : ">=0.1.0" },
1163+ "provides" : {
1164+ "commands" : [
1165+ {
1166+ "name" : "speckit.list.plan" ,
1167+ "file" : "commands/plan.md" ,
1168+ }
1169+ ]
1170+ },
1171+ }
1172+ with open (ext_dir / "extension.yml" , "w" ) as f :
1173+ yaml .dump (manifest_data , f )
1174+
1175+ (ext_dir / "commands" / "plan.md" ).write_text (
1176+ """---
1177+ description: "List init scripted command"
1178+ scripts:
1179+ sh: ../../scripts/bash/setup-plan.sh --json "{ARGS}"
1180+ ---
1181+
1182+ Run {SCRIPT}
1183+ """
1184+ )
1185+
1186+ init_options = project_dir / ".specify" / "init-options.json"
1187+ init_options .parent .mkdir (parents = True , exist_ok = True )
1188+ init_options .write_text ("[]" )
1189+
1190+ skills_dir = project_dir / ".agents" / "skills"
1191+ skills_dir .mkdir (parents = True )
1192+
1193+ manifest = ExtensionManifest (ext_dir / "extension.yml" )
1194+ registrar = CommandRegistrar ()
1195+ registrar .register_commands_for_agent ("codex" , manifest , ext_dir , project_dir )
1196+
1197+ content = (skills_dir / "speckit-list-plan" / "SKILL.md" ).read_text ()
1198+ assert '.specify/scripts/bash/setup-plan.sh --json "$ARGUMENTS"' in content
1199+
11441200 def test_codex_skill_registration_fallback_prefers_powershell_on_windows (
11451201 self , project_dir , temp_dir , monkeypatch
11461202 ):
0 commit comments