## Overview

The **doc skill symlinker** creates an agent skill from your documentation content. Once set up, Claude Code or Codex can load the skill to look up your docs, making all your written documentation available as AI context.

This is especially useful when:

- Working on another project that depends on this one
- Answering questions about configuration, components, or usage patterns
- Sharing institutional knowledge with your team through Claude Code or Codex

## How It Works

The setup script:

1. Creates a `.claude/skills/<skill-name>/` or `.codex/skills/<skill-name>/` directory in your project
2. Generates a `SKILL.md` that tells the agent how to use your docs
3. Symlinks the primary `src/content/docs/` directory into the skill folder
4. Symlinks every configured additional-locale directory (for example, `src/content/docs-ja/` and `src/content/docs-de/`) into the skill folder
5. Symlinks the skill into `~/.claude/skills/` and/or `~/.codex/skills/` so it's available globally

By default, the script auto-detects your agent home directories. It uses Codex when only `~/.codex/` exists, Claude Code when only `~/.claude/` exists, both when both exist, and Claude Code as the fallback for a fresh machine.

## Setup

Run the setup script:

```bash
pnpm run setup:doc-skill
```

The skill name is deterministic: `<project-name>-wisdom` (for example, `zudo-doc-wisdom`). You can override it with the first positional argument or the `SKILL_NAME` environment variable.

```
=== zudo-doc Skill Setup ===

Target: auto -> claude codex

  [claude] Created docs symlink -> ...
  [claude] Generated SKILL.md
  [codex] Created docs symlink -> ...
  [codex] Generated SKILL.md

Done! Skill 'zudo-doc-wisdom' is ready.
```

To force a target, pass `--target`:

```bash
pnpm run setup:doc-skill:claude
pnpm run setup:doc-skill:codex
pnpm run setup:doc-skill:both
```

## Using the Skill

Once set up, use the skill in any Claude Code session:

```
/zudo-doc-wisdom sidebar
```

Claude will look up the relevant documentation article and use it to answer your question. In Codex, mention the skill by name when asking about this documentation. This works from any project directory because the skill is symlinked globally.

### Example Workflow

Suppose you're building a site with zudo-doc and want to know how to configure the footer:

```
/zudo-doc-wisdom footer configuration
```

Claude reads the footer guide from your docs and provides an accurate, documentation-backed answer.

## What Gets Created

After running the setup script, the following files are created:

```
.claude/skills/<skill-name>/
├── SKILL.md       # Skill definition with frontmatter and instructions
├── docs -> src/content/docs/         # Symlink to primary-locale docs
├── docs-ja -> src/content/docs-ja/   # Configured locale link (if present)
└── docs-de -> src/content/docs-de/   # Another configured locale link (if present)
```

The link names follow the configured directory basenames (or a code-qualified
fallback when a custom directory collides). The generated `SKILL.md` records
the exact locale map; version snapshots such as `docs-v1-ja/` are not linked as
current locales. Keep translations structurally aligned and remember that
non-JA starter trees contain English placeholder prose until you translate
them.

For Codex targets, the same layout is created under `.codex/skills/<skill-name>/`.

And a global symlink:

```
~/.claude/skills/<skill-name> -> .claude/skills/<skill-name>
~/.codex/skills/<skill-name> -> .codex/skills/<skill-name>
```

[Dynamic content unavailable in text export]

The `.claude/skills/<skill-name>/` and `.codex/skills/<skill-name>/` directories contain symlinks and generated `SKILL.md` files. It is safe to add them to `.gitignore` if you prefer, or commit the generated skill definition to share it with your team.



## Re-running Setup

You can re-run the setup script at any time to regenerate the skill. Existing symlinks are replaced automatically.

```bash
pnpm run setup:doc-skill
```

[Dynamic content unavailable in text export]

If you rename your project or change the docs directory structure, re-run the setup script to update the skill.