Skip to content

Commit 45ecc14

Browse files
Fix Local AI Use Agents.md location (#55)
1 parent d61e131 commit 45ecc14

3 files changed

Lines changed: 19 additions & 4 deletions

File tree

skills/local-ai-use/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The single command that does steps 1, 2, and 3 in one shot is:
7171
python scripts/setup_local_ai.py
7272
```
7373

74-
(Run from this skill's folder.) The script is idempotent: re-running it on a
74+
The script is idempotent: re-running it on a
7575
fully configured workspace is a no-op apart from a healthcheck. Read the
7676
sections below for what to do when each step fails.
7777

skills/local-ai-use/scripts/setup_local_ai.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@
6060
INSTALL_URL = "https://lemonade-server.ai/install_options.html"
6161

6262

63+
def _default_workspace() -> Path:
64+
"""Workspace root for AGENTS.md.
65+
66+
Defaults to cwd, but if launched from inside an agent's skill folder
67+
(the universal `<.dot-config>/skills/<skill>/` layout used by Claude,
68+
Cursor, Codex, Gemini, etc.), climb out to the real workspace root so
69+
AGENTS.md is never buried inside the skill folder.
70+
"""
71+
cwd = Path.cwd().resolve()
72+
for parent in cwd.parents:
73+
if parent.name == "skills" and parent.parent.name.startswith("."):
74+
return parent.parent.parent
75+
return cwd
76+
77+
6378
def _print(msg: str) -> None:
6479
"""Single-line, prefix-tagged status print so the agent's output stays parseable."""
6580
print(f"[local-ai-use] {msg}", flush=True)
@@ -247,8 +262,8 @@ def main(argv: list[str] | None = None) -> int:
247262
parser.add_argument(
248263
"--workspace",
249264
type=Path,
250-
default=Path.cwd(),
251-
help="Workspace root where AGENTS.md should be written (default: cwd).",
265+
default=_default_workspace(),
266+
help="Workspace root where AGENTS.md should be written (default: workspace root, auto-detected).",
252267
)
253268
parser.add_argument(
254269
"--host",

walkthroughs/local-ai-use.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The goal of this skill is to teach your AI agent to use image generation, text g
66
## Step 1 - Understanding which skills are available
77

88
* Run `claude "Which skills can you see?" --model sonnet`. You should see a list of skills that should not include anythink related to local LLM usage.
9-
* Make sure there is no `AFENTS.md` file on your local folder.
9+
* Make sure there is no `AGENTS.md` file on your local folder.
1010

1111
## Step 2 - Enabling claude to see `local-ai-use`
1212

0 commit comments

Comments
 (0)