Documentation
¶
Overview ¶
Package active manages the project active-skill layer: the per-skill entry at .agents/skills/<name> that links into the content store and is the single source of truth every agent target derives from.
The three layers gskill maintains are:
.gskill/store/<algo>/<hash> immutable canonical content (one physical copy)
▲ symlink (copy fallback)
.agents/skills/<name> active project skill (one per installed skill)
▲ symlink (copy fallback)
.<agent>/skills/<name> per-agent targets (claude, codex, cursor, …)
The active layer holds no independent copy of the content: it links into the store, so adding an agent is one cheap link and a skill shared by N agents still exists exactly once on disk. The active layer is gitignored and regenerated by `gskill sync` from the committed manifest + lockfile.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureActive ¶
EnsureActive makes the active entry for name resolve to storePath, preferring a symlink and falling back to a copy where symlinks are unsupported. It is idempotent (an entry already linking to storePath is left untouched) and re-points a stale gskill-managed symlink (one resolving into storeRoot) after a content update. It NEVER destroys foreign content: a symlink resolving outside storeRoot, or a real directory whose content does not match the store, fails closed and is left intact (FR-029/FR-030).
Types ¶
type Health ¶
type Health string
Health classifies the state of an active entry relative to its expected store target.
const ( // HealthOK means the entry is a symlink resolving to the expected store path. HealthOK Health = "ok" // HealthMissing means no entry exists. HealthMissing Health = "missing" // HealthBroken means the entry is a symlink whose target does not exist. HealthBroken Health = "broken" // HealthForeign means a non-symlink path occupies the entry (not gskill-managed). HealthForeign Health = "foreign" // HealthWrongStore means the entry is a symlink into the store but at the // wrong content path (e.g. stale after a content update). HealthWrongStore Health = "wrong-store-target" )
Active-entry health states.