Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/local-ai-use/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The single command that does steps 1, 2, and 3 in one shot is:
python scripts/setup_local_ai.py
```

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

Expand Down
19 changes: 17 additions & 2 deletions skills/local-ai-use/scripts/setup_local_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
INSTALL_URL = "https://lemonade-server.ai/install_options.html"


def _default_workspace() -> Path:
"""Workspace root for AGENTS.md.

Defaults to cwd, but if launched from inside an agent's skill folder
(the universal `<.dot-config>/skills/<skill>/` layout used by Claude,
Cursor, Codex, Gemini, etc.), climb out to the real workspace root so
AGENTS.md is never buried inside the skill folder.
"""
cwd = Path.cwd().resolve()
for parent in cwd.parents:
if parent.name == "skills" and parent.parent.name.startswith("."):
return parent.parent.parent
return cwd


def _print(msg: str) -> None:
"""Single-line, prefix-tagged status print so the agent's output stays parseable."""
print(f"[local-ai-use] {msg}", flush=True)
Expand Down Expand Up @@ -247,8 +262,8 @@ def main(argv: list[str] | None = None) -> int:
parser.add_argument(
"--workspace",
type=Path,
default=Path.cwd(),
help="Workspace root where AGENTS.md should be written (default: cwd).",
default=_default_workspace(),
help="Workspace root where AGENTS.md should be written (default: workspace root, auto-detected).",
)
parser.add_argument(
"--host",
Expand Down
2 changes: 1 addition & 1 deletion walkthroughs/local-ai-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The goal of this skill is to teach your AI agent to use image generation, text g
## Step 1 - Understanding which skills are available

* 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.
* Make sure there is no `AFENTS.md` file on your local folder.
* Make sure there is no `AGENTS.md` file on your local folder.

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

Expand Down
Loading