---
name: acquiring-skills
description: Safely discover and install skills from external repositories or other local sf projects. Use when a user asks for something where a specialised skill likely exists (browser testing, PDF processing, infra automation, etc.) and you want to bootstrap rather than start from scratch. Always verify untrusted sources with the user.
---

# Acquiring New Skills

This skill teaches how to safely discover and install skills from external sources into sf.

## SAFETY — READ THIS FIRST

Skills can contain:

- **Markdown files** — risk: prompt injection, misleading instructions.
- **Scripts** (TypeScript, Python, Bash) — risk: arbitrary code execution.

### Trusted sources (no user approval needed for download)

| Source | Why trusted |
|---|---|
| `https://github.com/anthropics/skills` | Anthropic's official Agent Skills. |
| `https://github.com/singularity-ng/singularity-forge` | sf's own repo (never download to overwrite — only as reference). |
| Local sister repos under `/home/mhugo/code/` (ace-coder, letta-workspace, dr-repo, etc.) | User-owned local code; treat as trusted but still inspect scripts. |
| `mikki-bunker:~/code/` | The user's bunker host; trusted but still inspect. |

### Untrusted sources (ALWAYS verify with user)

For ANY source other than the above:

1. Ask the user before downloading.
2. State where the skill comes from (URL, repo, author).
3. Get explicit approval.

### Script safety

Even from trusted sources, ALWAYS:

1. Read and inspect every script before executing it.
2. Understand what it does — especially network calls, file operations, system commands.
3. If it `curl | bash`, refuse to run it without the user explicitly inspecting and approving the URL.

## When to Use This Skill

### DO use when

- The user asks for something where a skill likely exists ("test this webapp", "generate a PDF report", "deploy with terraform").
- You think "there's probably a skill that would bootstrap my understanding".
- The user explicitly asks about available skills or extending sf's capabilities.

### DON'T use for

- General coding tasks you can already handle.
- Simple bug fixes or feature implementations.
- Tasks where you have sufficient knowledge.
- Anything urgent — discovery takes time; sometimes "just code it" is faster.

## Ask Before Searching (Interactive Mode)

If you recognise a task that might have an associated skill, ask first:

> "This sounds like something where a community skill might help (e.g., webapp testing with Playwright). Want me to look in `anthropics/skills` first, or start coding right away?"

The user may prefer to start immediately rather than wait.

Only proceed with skill acquisition if the user agrees.

## Skill Repositories

| Repository | Description |
|---|---|
| `https://github.com/anthropics/skills` | Anthropic's official Agent Skills. |
| `~/code/ace-coder/.claude/skills/` (local) | ACE skills the user has on disk. |
| `~/code/letta-workspace/.agents/skills/` (local) | Letta workspace skills. |
| `mikki-bunker:~/code/letta-workspace/letta-code/skills/` (remote) | Letta Code skills on the bunker host. |
| `mikki-bunker:~/code/singularity-package-intelligence/.claude/skills/` (remote) | Generic agent skills on bunker. |

Browse repo READMEs for skill listings. Don't download blind — pick the one that matches.

## Installation Locations in sf

| Location | Path | When to use |
|---|---|---|
| **Project (sf core)** | `src/resources/extensions/sf/skills/<skill>/` | Skills bundled with sf, available to every sf install. Default for general-purpose skills. |
| **Per-project bundled** | `<other-repo>/.sf/skills/<skill>/` | Skills useful only inside a specific project. |
| **User-local** | `~/.sf/skills/<skill>/` | User-only skills not committed to a repo. |

**Default**: Project (sf core) for skills that benefit anyone running sf. Per-project for things only that project's contributors need.

## Naming Conventions

Before installing, ensure the skill follows sf naming:

- Lowercase kebab-case directory name.
- Match the directory name exactly to the `name:` field in frontmatter.
- No prefixes like `dr-`, `ace-` — strip them. (`dr-spec-first-tdd` → `spec-first-tdd`.)
- See [`creating-skills`](../creating-skills/SKILL.md) for the full convention.

## How to Acquire

### Method 1 — Clone to `/tmp`, inspect, copy

```bash
# 1. Clone the repo (shallow)
git clone --depth 1 https://github.com/anthropics/skills /tmp/skills-temp

# 2. Inspect the skill you want
cat /tmp/skills-temp/skills/webapp-testing/SKILL.md
ls /tmp/skills-temp/skills/webapp-testing/scripts/   # if any
# Read every script before running anything

# 3. Copy to sf (default location)
cp -r /tmp/skills-temp/skills/webapp-testing \
  /home/mhugo/code/singularity-forge/src/resources/extensions/sf/skills/

# 4. Cleanup
rm -rf /tmp/skills-temp
```

### Method 2 — rsync from another local repo

```bash
rsync -av ~/code/ace-coder/.claude/skills/ace-systematic-debugging/ \
  /tmp/bunker-skills/systematic-debugging/

# Inspect, then port (rename without ace- prefix, sf-adapt tooling references)
```

### Method 3 — rsync from bunker (over SSH)

```bash
mkdir -p /tmp/bunker-skills
rsync -av -e ssh \
  mikki-bunker:'~/code/letta-workspace/letta-code/skills/<skill>/' \
  /tmp/bunker-skills/<skill>/
```

After fetching, **adapt for sf**:

- Strip foreign prefixes (`dr-`, `ace-`, `letta-`).
- Replace foreign tooling references (Letta MCP tool calls, claude-flow CLIs) with sf-native equivalents (`rg`, `npm test`, `sf_*` tools, `advisory-partner` skill, etc.).
- Drop bootstrap gates that don't apply (`onboarding()`, `IN_NIX_SHELL`, etc.).
- Cite sf doctrine: `AGENTS.md`, `docs/SPEC_FIRST_TDD.md`, the relevant sister skill.

See [`creating-skills`](../creating-skills/SKILL.md) for the conventions adapted skills must follow.

## Registering the New Skill

Skills under `src/resources/extensions/sf/skills/` are auto-discovered on the next sf launch — no manual registration.

For per-project skills under `<repo>/.sf/skills/`, check `auto-loop`/`bootstrap` logs to confirm discovery.

## Complete Example

User asks: "Can you help me test my React app's UI?"

1. **Recognise opportunity**: webapp testing — likely has an Anthropic skill.
2. **Ask user**: "Want me to look for a webapp-testing skill in `anthropics/skills`, or start coding now?"
3. **If user agrees, fetch**:
   ```bash
   git clone --depth 1 https://github.com/anthropics/skills /tmp/skills-temp
   cat /tmp/skills-temp/skills/webapp-testing/SKILL.md
   ls /tmp/skills-temp/skills/webapp-testing/scripts/
   # Read each script
   ```
4. **Adapt for sf**: rename if needed, strip foreign tooling, point doctrine references at sf docs.
5. **Install**:
   ```bash
   cp -r /tmp/skills-temp/skills/webapp-testing \
     /home/mhugo/code/singularity-forge/src/resources/extensions/sf/skills/
   rm -rf /tmp/skills-temp
   ```
6. **Use**: `Skill(skill: "webapp-testing")`.

## Rules

- **Read every script before executing it.** No exceptions, even from trusted sources.
- **Don't `curl | bash`** unless the user has personally inspected and approved the URL.
- **Untrusted sources require explicit user approval** before download.
- **Strip foreign prefixes** when porting (`dr-`, `ace-`, `letta-`).
- **Adapt tooling references** to sf-native equivalents.
- **Cite sf doctrine** — link `AGENTS.md` and `docs/SPEC_FIRST_TDD.md` rather than restating their rules.
- **Don't overwrite an existing sf skill** without diffing first; if names collide, decide whether to merge, supersede, or rename.
