@@ -34,7 +34,9 @@ print(skill.prompt)
3434
3535### From GitHub
3636
37- ` Skill.from_git() ` downloads a skill from GitHub and caches it locally. Subsequent calls use the cache unless the remote has new commits.
37+ ` Skill.from_git() ` downloads a skill from GitHub and caches it locally. On
38+ subsequent calls, agr checks the remote HEAD commit — if the cached revision
39+ matches, it returns the cached copy without re-downloading.
3840
3941``` python
4042from agr import Skill
@@ -45,7 +47,7 @@ skill = Skill.from_git("kasperjunge/commit")
4547# Explicit repo
4648skill = Skill.from_git(" anthropics/skills/code-review" )
4749
48- # Force re-download (skip cache )
50+ # Force re-download even if cached (useful after upstream changes )
4951skill = Skill.from_git(" kasperjunge/commit" , force_download = True )
5052```
5153
@@ -62,13 +64,53 @@ skill = Skill.from_local("/absolute/path/to/skill")
6264
6365| Property | Type | Description |
6466| ----------| ------| -------------|
65- | ` name ` | ` str ` | Skill name |
67+ | ` name ` | ` str ` | Skill name (directory name) |
6668| ` path ` | ` Path ` | Path to skill directory (cached or local) |
67- | ` prompt ` | ` str ` | Contents of ` SKILL.md ` (lazy-loaded) |
68- | ` files ` | ` list[str] ` | Relative file paths in the skill directory (lazy-loaded) |
69- | ` metadata ` | ` dict ` | Skill metadata (name, path, source, revision, handle, is_local) |
69+ | ` handle ` | ` ParsedHandle \| None ` | Parsed handle with owner, repo, and name components |
70+ | ` source ` | ` str \| None ` | Source name the skill was fetched from (e.g., ` "github" ` ) |
71+ | ` revision ` | ` str \| None ` | Git commit hash (first 12 chars) of the fetched revision |
72+ | ` prompt ` | ` str ` | Contents of ` SKILL.md ` (lazy-loaded on first access) |
73+ | ` files ` | ` list[str] ` | Relative file paths in the skill directory (lazy-loaded on first access) |
74+ | ` metadata ` | ` dict ` | Combined metadata dict (see below) |
7075| ` content_hash ` | ` str \| None ` | Content hash from ` .agr.json ` , if present |
7176
77+ The ` handle ` , ` source ` , and ` revision ` attributes are set by ` from_git() ` . For
78+ locally loaded skills, ` source ` and ` revision ` are ` None ` .
79+
80+ ### Provenance: handle, source, revision
81+
82+ When you load a skill from GitHub, agr records where it came from:
83+
84+ ``` python
85+ skill = Skill.from_git(" anthropics/skills/code-review" )
86+
87+ # Which repo was it fetched from?
88+ print (skill.source) # "github"
89+ print (skill.revision) # "a1b2c3d4e5f6" (short commit hash)
90+
91+ # Access handle components
92+ print (skill.handle.username) # "anthropics"
93+ print (skill.handle.repo) # "skills"
94+ print (skill.handle.name) # "code-review"
95+ ```
96+
97+ ### The metadata dict
98+
99+ The ` metadata ` property returns a dict combining all provenance info:
100+
101+ ``` python
102+ skill = Skill.from_git(" anthropics/skills/code-review" )
103+ print (skill.metadata)
104+ # {
105+ # "name": "code-review",
106+ # "path": "/Users/you/.cache/agr/skills/anthropics/skills/code-review/a1b2c3d4e5f6",
107+ # "source": "github",
108+ # "revision": "a1b2c3d4e5f6",
109+ # "handle": "anthropics/skills/code-review",
110+ # "is_local": False,
111+ # }
112+ ```
113+
72114### Reading Files
73115
74116``` python
0 commit comments