2727from .models import (
2828 Config ,
2929 Feature ,
30- FeatureCategory ,
3130 FeatureRegistry ,
3231 FeatureStatus ,
3332 PriorityFeatureRef ,
@@ -501,8 +500,8 @@ def _feature_add(
501500 config = load_config ()
502501
503502 feature_id = registry .next_feature_id ()
504- # Use config defaults if not specified
505- cat = FeatureCategory ( category ) if category else config .default_category
503+ # Use config defaults if not specified, accept any category string
504+ cat = category if category else config .default_category
506505 # Ensure priority is an integer (CLI may pass as string)
507506 prio = int (priority ) if priority is not None else config .default_priority
508507 acceptance = (
@@ -532,7 +531,7 @@ def _feature_add(
532531 regenerate_progress_md ()
533532
534533 echo (f"✅ Added feature { feature_id } : { description } " )
535- echo (f" Category: { cat . value } , Priority: { prio } " )
534+ echo (f" Category: { cat } , Priority: { prio } " )
536535
537536
538537def _feature_list (status_filter : str | None , json_output : bool ) -> None :
@@ -678,7 +677,7 @@ def _feature_show(feature_id: str | None, json_output: bool) -> None:
678677
679678 echo (f"📋 Feature: { feature .id } " )
680679 echo (f" Description: { feature .description } " )
681- echo (f" Category: { feature .category . value } " )
680+ echo (f" Category: { feature .category } " )
682681 echo (f" Priority: { feature .priority } " )
683682 echo (f" Status: { status_icon } " )
684683 echo (f" Passes: { 'Yes' if feature .passes else 'No' } " )
@@ -744,13 +743,9 @@ def _feature_edit(
744743 changes .append (f"added criteria: { ', ' .join (new_criteria )} " )
745744
746745 if category is not None :
747- try :
748- new_category = FeatureCategory (category )
749- feature .category = new_category
750- changes .append (f"category: { new_category .value } " )
751- except ValueError as e :
752- valid_cats = ", " .join (c .value for c in FeatureCategory )
753- raise PithException (f"Invalid category: { category } . Use: { valid_cats } " ) from e
746+ # Accept any category string
747+ feature .category = category
748+ changes .append (f"category: { category } " )
754749
755750 if priority is not None :
756751 # Ensure priority is an integer (CLI may pass as string)
@@ -803,7 +798,7 @@ def _feature_prompt(
803798 "" ,
804799 f"**Description:** { feature .description } " ,
805800 "" ,
806- f"**Category:** { feature .category . value } " ,
801+ f"**Category:** { feature .category } " ,
807802 f"**Priority:** { feature .priority } " ,
808803 f"**Status:** { feature .status .value } " ,
809804 "" ,
@@ -1296,9 +1291,7 @@ def config(
12961291 if key is None :
12971292 # Show all config
12981293 echo ("⚙️ Configuration:" )
1299- echo (
1300- f" default_category: { cfg .default_category .value if hasattr (cfg .default_category , 'value' ) else cfg .default_category } "
1301- )
1294+ echo (f" default_category: { cfg .default_category } " )
13021295 echo (f" default_priority: { cfg .default_priority } " )
13031296 echo (f" verified_by: { cfg .verified_by } " )
13041297 echo (f" progress_output_path: { cfg .progress_output_path } " )
@@ -1314,13 +1307,8 @@ def config(
13141307 if key == "prd_source" :
13151308 cfg .prd_source = value if value .lower () != "null" else None
13161309 elif key == "default_category" :
1317- from klondike_spec_cli .models import FeatureCategory
1318-
1319- try :
1320- cfg .default_category = FeatureCategory (value .lower ())
1321- except ValueError :
1322- valid = ", " .join (c .value for c in FeatureCategory )
1323- raise PithException (f"Invalid category: { value } . Valid: { valid } " ) from None
1310+ # Accept any category string
1311+ cfg .default_category = value .lower ()
13241312 elif key == "default_priority" :
13251313 try :
13261314 priority = int (value )
@@ -1351,11 +1339,7 @@ def config(
13511339 if key == "prd_source" :
13521340 echo (cfg .prd_source or "(not set)" )
13531341 elif key == "default_category" :
1354- echo (
1355- cfg .default_category .value
1356- if hasattr (cfg .default_category , "value" )
1357- else cfg .default_category
1358- )
1342+ echo (cfg .default_category )
13591343 elif key == "default_priority" :
13601344 echo (str (cfg .default_priority ))
13611345 elif key == "verified_by" :
@@ -1942,11 +1926,8 @@ def import_features(
19421926
19431927 # Parse optional fields with defaults
19441928 cat_str = feat_data .get ("category" , "core" )
1945- try :
1946- category = FeatureCategory (cat_str )
1947- except ValueError :
1948- errors .append (f"Feature { i + 1 } : invalid category '{ cat_str } '" )
1949- continue
1929+ # Accept any category string
1930+ category = cat_str
19501931
19511932 priority = feat_data .get ("priority" , 3 )
19521933 if not isinstance (priority , int ) or priority < 1 or priority > 5 :
@@ -2245,7 +2226,7 @@ def export_features(
22452226 feat_dict = {
22462227 "id" : f .id ,
22472228 "description" : f .description ,
2248- "category" : f .category . value ,
2229+ "category" : f .category ,
22492230 "priority" : f .priority ,
22502231 "acceptance_criteria" : f .acceptance_criteria ,
22512232 }
@@ -2415,7 +2396,7 @@ def agents(action: str = Argument(..., pith="Action: generate")) -> None:
24152396 lines .append ("```" )
24162397 lines .append ("" )
24172398 lines .append ("## Configuration" )
2418- lines .append (f"- default_category: { config .default_category . value } " )
2399+ lines .append (f"- default_category: { config .default_category } " )
24192400 lines .append (f"- default_priority: { config .default_priority } " )
24202401 lines .append (f"- verified_by: { config .verified_by } " )
24212402 lines .append (f"- progress_output_path: { config .progress_output_path } " )
0 commit comments