@@ -244,9 +244,7 @@ def _scan_skills(output_dir: Path) -> List[Dict[str, Any]]:
244244 "status" : str (fm .get ("status" ) or "draft" ),
245245 "description" : str (fm .get ("description" ) or "" ),
246246 "summary" : str (meta .get ("summary" ) or "" )[:_SUMMARY_CHARS ],
247- "source_refs" : [
248- _norm_rel (str (r ), output_dir ) for r in refs if str (r ).strip ()
249- ],
247+ "source_refs" : [_norm_rel (str (r ), output_dir ) for r in refs if str (r ).strip ()],
250248 }
251249 )
252250 return out
@@ -346,9 +344,7 @@ def _candidate_notes(
346344 from codewiki .src .skill_match import score_skill_material
347345
348346 worth = bool (
349- score_skill_material (body , kind = "note" , note_type = ntype ).get (
350- "worth_compiling"
351- )
347+ score_skill_material (body , kind = "note" , note_type = ntype ).get ("worth_compiling" )
352348 )
353349 except Exception : # advisory only — a scoring failure must not filter
354350 worth = False
@@ -417,9 +413,7 @@ def _skill_capacity(live_count: int) -> Dict[str, Any]:
417413 }
418414
419415
420- def _conflict_precheck (
421- topic : Optional [str ], skills : List [Dict [str , Any ]]
422- ) -> Dict [str , Any ]:
416+ def _conflict_precheck (topic : Optional [str ], skills : List [Dict [str , Any ]]) -> Dict [str , Any ]:
423417 """Jaccard(>0.6) conflict pre-check of *topic* against existing skills."""
424418 if not (topic or "" ).strip ():
425419 return {
@@ -541,14 +535,12 @@ def _err(rule: str, message: str) -> Tuple[Dict[str, Any], Dict[str, Any]]:
541535 if action == "created" and path .is_file ():
542536 return _err (
543537 "name_conflict" ,
544- f"skills/{ name } /SKILL.md already exists; use action='updated' "
545- "(or retire + re-create)." ,
538+ f"skills/{ name } /SKILL.md already exists; use action='updated' (or retire + re-create)." ,
546539 )
547540 if action == "updated" and not path .is_file ():
548541 return _err (
549542 "not_found" ,
550- f"skills/{ name } /SKILL.md not found; action='updated' requires an "
551- "existing draft." ,
543+ f"skills/{ name } /SKILL.md not found; action='updated' requires an existing draft." ,
552544 )
553545
554546 return (
@@ -566,9 +558,7 @@ def _err(rule: str, message: str) -> Tuple[Dict[str, Any], Dict[str, Any]]:
566558 )
567559
568560
569- def _render_skill_doc (
570- fm : Dict [str , Any ], body : str
571- ) -> str :
561+ def _render_skill_doc (fm : Dict [str , Any ], body : str ) -> str :
572562 from codewiki .src .frontmatter import render_frontmatter
573563
574564 return render_frontmatter (fm ) + "\n " + body + "\n "
@@ -791,9 +781,7 @@ def _mode_retire(arguments: Dict[str, Any], output_dir: Path) -> str:
791781 if not name :
792782 return json .dumps ({"error" : "retire requires 'name' and 'reason'." })
793783 if not reason :
794- return json .dumps (
795- {"error" : "retire requires 'reason' (audit trail, design §4.1)." }
796- )
784+ return json .dumps ({"error" : "retire requires 'reason' (audit trail, design §4.1)." })
797785 draft = _skills_dir (output_dir ) / name / "SKILL.md"
798786 if not draft .is_file ():
799787 return json .dumps ({"error" : f"draft skills/{ name } /SKILL.md not found." })
@@ -878,8 +866,10 @@ def handle_skill_creator(arguments: Dict[str, Any], store: Any) -> str:
878866
879867 mode = str (arguments .get ("mode" ) or "prepare" ).lower ()
880868 if mode in ("install" , "retire" ):
881- return _mode_install (arguments , output_dir ) if mode == "install" else _mode_retire (
882- arguments , output_dir
869+ return (
870+ _mode_install (arguments , output_dir )
871+ if mode == "install"
872+ else _mode_retire (arguments , output_dir )
883873 )
884874 if mode not in ("prepare" , "submit" ):
885875 return json .dumps (
@@ -898,23 +888,17 @@ def handle_skill_creator(arguments: Dict[str, Any], store: Any) -> str:
898888 if isinstance (raw_sources , str ):
899889 raw_sources = [raw_sources ]
900890 if isinstance (raw_sources , list ):
901- mapped = {
902- _KIND_ALIASES .get (str (s ).strip ().lower ()) for s in raw_sources
903- } - {None }
891+ mapped = {_KIND_ALIASES .get (str (s ).strip ().lower ()) for s in raw_sources } - {None }
904892 if mapped :
905893 kinds = mapped
906894
907895 skills = _scan_skills (output_dir )
908896 absorbed = _absorbed_paths (skills )
909897 scenarios , scen_avail = (
910- _candidate_scenarios (output_dir , absorbed , limit )
911- if "scenarios" in kinds
912- else ([], 0 )
898+ _candidate_scenarios (output_dir , absorbed , limit ) if "scenarios" in kinds else ([], 0 )
913899 )
914900 notes , note_avail = (
915- _candidate_notes (output_dir , absorbed , limit )
916- if "notes" in kinds
917- else ([], 0 )
901+ _candidate_notes (output_dir , absorbed , limit ) if "notes" in kinds else ([], 0 )
918902 )
919903 scen_trunc = scen_avail > len (scenarios )
920904 note_trunc = note_avail > len (notes )
@@ -938,8 +922,7 @@ def handle_skill_creator(arguments: Dict[str, Any], store: Any) -> str:
938922 },
939923 "open_issues_by_skill" : open_issues ,
940924 "skills_index" : [
941- {k : s [k ] for k in ("name" , "file" , "status" , "summary" )}
942- for s in skills
925+ {k : s [k ] for k in ("name" , "file" , "status" , "summary" )} for s in skills
943926 ],
944927 "conflict_precheck" : conflict ,
945928 "capacity" : capacity ,
@@ -996,7 +979,9 @@ def handle_skill_creator(arguments: Dict[str, Any], store: Any) -> str:
996979 seen_names : Set [str ] = set ()
997980 for entry in entries :
998981 if not isinstance (entry , dict ):
999- errors .append ({"name" : "<invalid>" , "rule" : "entry_invalid" , "message" : "not an object" })
982+ errors .append (
983+ {"name" : "<invalid>" , "rule" : "entry_invalid" , "message" : "not an object" }
984+ )
1000985 continue
1001986 err , values = _validate_entry (entry , output_dir )
1002987 if err :
0 commit comments