4141
4242@dataclass (frozen = True )
4343class Target :
44+ """Resolved install destination: agent name + absolute path."""
45+
4446 name : str
4547 path : Path
4648
@@ -50,6 +52,7 @@ def _home() -> Path:
5052
5153
5254def resolve_target (agent : str , override : Path | None ) -> Target :
55+ """Return the default install Target for the given agent, or use override path."""
5356 if agent == "generic" :
5457 if override is None :
5558 raise ValueError ("generic target requires --path PATH" )
@@ -126,6 +129,7 @@ def install_all_skills(
126129
127130
128131def resolve_marketplace_target (agent : str , override : Path | None ) -> Target :
132+ """Return the marketplace install Target for the given agent, or use override path."""
129133 if agent == "generic" :
130134 if override is None :
131135 raise ValueError ("generic marketplace target requires --path PATH" )
@@ -181,6 +185,7 @@ def render(source_text: str, dest_existing: str | None, agent: str) -> str:
181185
182186
183187def find_markers (text : str ) -> tuple [int , int ] | None :
188+ """Return (start, end) byte offsets of the managed region, or None if absent."""
184189 a = text .find (MARKER_BEGIN )
185190 if a < 0 :
186191 return None
@@ -202,12 +207,15 @@ def overlay(dest_text: str, source_body: str) -> str:
202207
203208@dataclass
204209class Plan :
210+ """Pending install action computed by plan_install or plan_marketplace."""
211+
205212 action : str # "create" | "update" | "skip" | "abort"
206213 reason : str
207214 target : Target
208215 new_content : str | None = None
209216
210217 def write (self ) -> None :
218+ """Execute the plan: create or update the destination file."""
211219 if self .action in ("skip" , "abort" ):
212220 return
213221 assert self .new_content is not None
@@ -306,6 +314,7 @@ def install(
306314 out = None ,
307315 err = None ,
308316) -> int :
317+ """Run one install operation (skill or marketplace). Returns an EXIT_* code."""
309318 out = out or sys .stdout
310319 err = err or sys .stderr
311320
@@ -356,6 +365,7 @@ def install(
356365
357366
358367def add_subparser (sub : argparse ._SubParsersAction ) -> None :
368+ """Register the `forerunner install` subcommand onto *sub*."""
359369 p = sub .add_parser ("install" , help = "install skill(s) into agent-specific directories (D.installer)" )
360370 p .add_argument ("agent" , choices = ["codex" , "claude" , "generic" ], nargs = "?" ,
361371 help = "target agent (omit with --all to install to all detected agents)" )
0 commit comments