Documentation
¶
Overview ¶
Package app is gskill's orchestration layer. It exposes use-case methods that the cli and tui views call, and is the only layer that drives the domain packages (resolver, installer, store, and the rest). Views never import the domain packages directly.
Index ¶
- Constants
- type AddRequest
- type AddResult
- type App
- func (a *App) Add(ctx context.Context, req AddRequest) (AddResult, error)
- func (a *App) Agents() *agent.Registry
- func (a *App) Check(_ context.Context, root string, failOnDrift bool) (CheckReport, error)
- func (a *App) Config() *config.Config
- func (a *App) Diff(_ context.Context, root string) ([]DiffEntry, error)
- func (a *App) Doctor(ctx context.Context, root string) (DoctorReport, error)
- func (a *App) Info(_ context.Context, root, name string) (SkillInfo, error)
- func (a *App) Init(_ context.Context, root string) (InitResult, error)
- func (a *App) Install(ctx context.Context, req InstallRequest) (InstallResult, error)
- func (a *App) List(_ context.Context, root string) ([]ListedSkill, error)
- func (a *App) Lock(ctx context.Context, root string) (InstallResult, error)
- func (a *App) Logger() *slog.Logger
- func (a *App) Outdated(ctx context.Context, root string) (OutdatedReport, error)
- func (a *App) Remove(ctx context.Context, root string, names []string) (RemoveResult, error)
- func (a *App) Repair(ctx context.Context, root string) (RepairResult, error)
- func (a *App) SkillMarkdown(_ context.Context, root, name string) (string, error)
- func (a *App) Sync(ctx context.Context, req SyncRequest) (SyncResult, error)
- func (a *App) Update(ctx context.Context, root string, names []string) (InstallResult, error)
- func (a *App) Verify(_ context.Context, root string) (VerifyReport, error)
- type CheckReport
- type DiffEntry
- type DoctorReport
- type InitResult
- type InstallRequest
- type InstallResult
- type ListedSkill
- type Options
- type OutdatedReport
- type OutdatedSkill
- type RemoveResult
- type RepairResult
- type RequirementCheck
- type SkillChange
- type SkillCheck
- type SkillInfo
- type SkillVerify
- type SyncRequest
- type SyncResult
- type VerifyReport
Constants ¶
const ( ManifestName = "gskill.toml" LockName = "gskill.lock" )
Project file and directory names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddRequest ¶
type AddRequest struct {
Root string
Source string
Version string
Ref string
Commit string
Agents []string
Force bool
Scope string
Mode string
}
AddRequest describes an `add` invocation.
type AddResult ¶
type AddResult struct {
Name string
ContentHash string
Targets map[string]string
Warnings []string
}
AddResult reports the outcome of an add.
type App ¶
type App struct {
// contains filtered or unexported fields
}
App holds the injected dependencies shared by every use-case. Business logic is added by sibling files (install.go, inspect.go, lifecycle.go, ...).
func (*App) Add ¶
Add resolves, installs, and records a new skill, updating the manifest and lockfile. It errors on an already-declared key unless Force is set (FR-047), and writes nothing when no target agent is available (FR-029).
func (*App) Check ¶
Check produces a fast, metadata-only drift report. With failOnDrift, any drift returns exit 7 (FR-016, FR-017).
func (*App) Doctor ¶
Doctor checks the environment (git, detected agents) and reports declared requirements, warning on any that are unmet (FR-032). It never installs.
func (*App) Init ¶
Init scaffolds the project: a gskill.toml manifest, a .gskill state dir, and a .gitignore hint (FR-001). It is idempotent.
func (*App) Install ¶
func (a *App) Install(ctx context.Context, req InstallRequest) (InstallResult, error)
Install materializes every declared skill, additively and idempotently, updating the lockfile only when resolved content changes (FR-022).
func (*App) Lock ¶
Lock recomputes the lockfile from the manifest, honoring existing pins without bumping skills whose declaration is unchanged.
func (*App) Remove ¶
Remove uninstalls the named skills from the manifest, lockfile, and every agent directory, then garbage-collects unreferenced store entries.
func (*App) Repair ¶
Repair re-materializes broken or modified installs from the store/cache without changing the lockfile, and cleans up orphaned staging left by an interrupted install (FR-024, SC-007).
func (*App) SkillMarkdown ¶
SkillMarkdown returns the installed SKILL.md content for a skill, read from its first available agent target (for the TUI preview).
func (*App) Sync ¶
func (a *App) Sync(ctx context.Context, req SyncRequest) (SyncResult, error)
Sync makes disk exactly match the lockfile, reinstalling each locked skill. With Prune, agent skill directories not referenced by the lock are removed (FR-023).
type CheckReport ¶
type CheckReport struct {
Skills []SkillCheck
HasDrift bool
}
CheckReport aggregates a check run.
type DoctorReport ¶
type DoctorReport struct {
GitAvailable bool
DetectedAgents []string
Requirements []RequirementCheck
Warnings []string
}
DoctorReport is the result of `gskill doctor`.
type InitResult ¶
InitResult reports what Init created.
type InstallRequest ¶
type InstallRequest struct {
Root string
Scope string
Mode string
Frozen bool
Offline bool
NoCache bool
UpdateLockfile bool
}
InstallRequest describes an `install` invocation over the existing manifest.
type InstallResult ¶
type InstallResult struct {
Skills []SkillChange
Changed bool
}
InstallResult reports an install run.
type ListedSkill ¶
ListedSkill is one row of `gskill list`.
type Options ¶
type Options struct {
Config *config.Config
Logger *slog.Logger
Agents *agent.Registry
Git git.Runner
}
Options configures New. Nil dependencies are replaced with safe defaults.
type OutdatedReport ¶
type OutdatedReport struct {
Skills []OutdatedSkill
AnyAvailable bool
}
OutdatedReport aggregates an outdated run.
type OutdatedSkill ¶
OutdatedSkill reports one skill's update availability.
type RemoveResult ¶
RemoveResult reports a remove run.
type RepairResult ¶
RepairResult reports a repair run.
type RequirementCheck ¶
type RequirementCheck struct {
Skill string
Kind string // command | environment | skill | mcp
Name string
Satisfied bool
Checked bool // false for kinds gskill cannot verify (e.g. mcp)
}
RequirementCheck is one declared requirement and whether the environment satisfies it. Requirements are recorded and surfaced only — gskill never resolves them transitively or auto-installs anything (FR-032).
type SkillChange ¶
SkillChange records the per-skill outcome of an install.
type SkillCheck ¶
SkillCheck is one skill's fast drift status.
type SkillInfo ¶
type SkillInfo struct {
Name string
Source string
Version string
Commit string
ContentHash string
Description string
License string
Requires lockfile.Requires
Agents []string
Targets map[string]string
}
SkillInfo is the detail shown by `gskill info`.
type SkillVerify ¶
type SkillVerify struct {
Name string
OK bool
Expected string
Actual string
Issue string // ok | missing | mismatch
}
SkillVerify is one skill's integrity-verification outcome.
type SyncRequest ¶
SyncRequest describes a `sync` invocation.
type SyncResult ¶
type SyncResult struct {
Reconciled []SkillChange
Pruned []string
}
SyncResult reports a sync run.
type VerifyReport ¶
type VerifyReport struct {
Skills []SkillVerify
OK bool
}
VerifyReport aggregates a verify run.