Skip to main content

Purpose

The main package is not a reusable library surface. Its job is to assemble the default hrns application from the reusable packages.

Current startup behavior

main.go performs three concrete tasks:

1. Load skills

It calls:
skills.LoadAllSkills([]string{
    skills.DefaultGlobalRootPath,
    skills.DefaultLocalRootPath,
})
Then it creates load_skill with skills.NewLoadSkillTool(...).

2. Build the default prompt and tool map

The system prompt starts as:
You are a coding assistant that talks like a pirate.
If skills were found, the prompt is extended with their names, descriptions, and a note that they can be loaded with load_skill. The default tool map includes:
  • read_file
  • list_files
  • write_file
  • run_command
  • web_fetch
  • load_skill

3. Start the TUI

The package creates:
tui.New(
    systemPrompt,
    tui.WithTools(...),
)
and then calls Run(ctx). Provider loading, onboarding, client creation, and loop creation now happen inside tui.Run(...).

When to reuse it

In most cases, you should not reuse main directly. If you want a custom prompt, custom tools, or a different UI, copy the wiring pattern into your own program and compose the packages yourself.