Documentation
¶
Overview ¶
Package skillinject installs the Pilot Protocol skill into the well-known directories of agent tools (Claude Code, OpenClaw, PicoClaw, OpenHands, Hermes, …). The configuration — what to inject, where, and what marker content to upsert into each tool's heartbeat file — is fetched at runtime from the pilot-skills repository on GitHub. There is no embedded fallback: a tick that cannot reach the network is logged and skipped; the next tick retries.
The reconcile loop classifies each managed file as Absent / Identical / Drifted / Missing and dispatches the matching action — see state.go.
Index ¶
Constants ¶
const DefaultInterval = 15 * time.Minute
DefaultInterval is how often the daemon re-runs the scan/reconcile pass after the initial startup tick.
const DefaultManifestURL = "https://raw.githubusercontent.com/TeoSlayer/pilot-skills/main/inject-manifest.json"
DefaultManifestURL is the canonical raw GitHub URL for the inject manifest. Overridable via Config.ManifestURL (test hook).
const DefaultRepoBaseURL = "https://raw.githubusercontent.com/TeoSlayer/pilot-skills/main/"
DefaultRepoBaseURL is the prefix used to fetch any path the manifest references (skills/<name>/SKILL.md, heartbeats/<tool>.md). Overridable via Config.RepoBaseURL.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action string
Action is what the reconcile loop chose to do in response to a State.
type Config ¶
type Config struct {
// Home overrides the user home dir (test hook).
Home string
// Interval between scan ticks after the initial startup tick.
Interval time.Duration
// ManifestURL overrides the canonical raw GitHub URL for inject-manifest.json.
ManifestURL string
// RepoBaseURL overrides the prefix used to resolve relative paths in
// the manifest (skills/<name>/SKILL.md, heartbeats/<tool>.md).
RepoBaseURL string
// HTTPClient overrides the HTTP client used for fetching.
HTTPClient *http.Client
}
Config tunes the injector. Zero values use sensible defaults.
type FileKind ¶
type FileKind string
FileKind names which of a target's two files an Outcome is about.
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Entrypoint string `json:"entrypoint"`
Description string `json:"description,omitempty"`
Tools []ManifestTool `json:"tools"`
}
Manifest mirrors inject-manifest.json. Field tags match the upstream schema. Unknown fields are ignored (forward-compat with new tool fields).
type ManifestTool ¶
type ManifestTool struct {
Name string `json:"name"`
RootDir string `json:"rootDir"`
SkillsDir string `json:"skillsDir"`
HeartbeatPath string `json:"heartbeatPath,omitempty"`
HeartbeatTemplate string `json:"heartbeatTemplate,omitempty"`
SkillNaming string `json:"skillNaming,omitempty"` // "" = "directory" (default), "flat" = single-file
SelfHeartbeat bool `json:"selfHeartbeat,omitempty"`
}
ManifestTool is one tool target row.
type Outcome ¶
type Outcome struct {
Tool string `json:"tool"`
Kind FileKind `json:"kind"`
Path string `json:"path"`
State State `json:"state"`
Action Action `json:"action"`
Hash string `json:"hash,omitempty"`
Err string `json:"err,omitempty"`
}
Outcome records one reconcile decision.
type Report ¶
type Report struct {
At time.Time `json:"at"`
Outcomes []Outcome `json:"outcomes"`
Skipped []string `json:"skipped,omitempty"`
}
Report is the result of one Tick.