Execute the generator. Returns the path to the produced artifact. Side-effects, in order: compile → validate → (skill only) publish manifest. ``self.validation`` holds the result so callers can surface issues without re-running the validator. For deck target, validat
(self)
| 90 | self.validation: AnyValidationResult | None = None |
| 91 | |
| 92 | async def run(self) -> Path: |
| 93 | """Execute the generator. Returns the path to the produced artifact. |
| 94 | |
| 95 | Side-effects, in order: compile → validate → (skill only) publish |
| 96 | manifest. ``self.validation`` holds the result so callers can |
| 97 | surface issues without re-running the validator. For deck target, |
| 98 | validation runs inside ``run_skill`` via the producing skill's |
| 99 | frontmatter-declared grammar; we propagate it up. |
| 100 | """ |
| 101 | if self.target_type == "skill": |
| 102 | await run_skill_create( |
| 103 | kb_dir=self.kb_dir, |
| 104 | skill_name=self.name, |
| 105 | intent=self.intent, |
| 106 | model=self.model, |
| 107 | ) |
| 108 | self.validation = validate_skill(self.output_dir) |
| 109 | regenerate_marketplace(self.kb_dir) |
| 110 | return self.output_dir |
| 111 | |
| 112 | # target_type == "deck" |
| 113 | deck_result = await run_deck_create( |
| 114 | kb_dir=self.kb_dir, |
| 115 | deck_name=self.name, |
| 116 | intent=self.intent, |
| 117 | model=self.model, |
| 118 | critique=self.critique, |
| 119 | skill_name=self.skill_name, |
| 120 | ) |
| 121 | # run_deck_create returns a SkillRunResult-like (or Path) — use its |
| 122 | # validation if present; otherwise fall back to None (skill didn't |
| 123 | # declare a grammar to validate against). |
| 124 | self.validation = deck_result.validation |
| 125 | return self.output_dir |