From 9e23a54852fbed4416f6c90acfa8d88d699541b2 Mon Sep 17 00:00:00 2001 From: Eduardo Figueroa Date: Sun, 15 Mar 2026 23:45:12 +0000 Subject: [PATCH] feat: Add wiki-docs skill for documentation management MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create .claude/skills/wiki-docs.md skill for managing Wiki.js documentation - Skill enables writing markdown files to /mnt/media/wikijs-content/ - Files automatically sync to Wiki.js via Git storage backend - Update AGENTS.md with Claude Code Skills section - Document wiki-docs skill usage and benefits - Add /mnt/media/wikijs-content/ to repository structure The wiki-docs skill allows AI agents to create version-controlled documentation that syncs to https://wiki.fig.systems automatically. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .claude/skills/wiki-docs.md | 174 ++++++++++++++++++++++++++++++++++++ AGENTS.md | 104 ++++++++++++++++++++- 2 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 .claude/skills/wiki-docs.md diff --git a/.claude/skills/wiki-docs.md b/.claude/skills/wiki-docs.md new file mode 100644 index 0000000..71890b4 --- /dev/null +++ b/.claude/skills/wiki-docs.md @@ -0,0 +1,174 @@ +# Wiki Documentation Skill + +Create and manage markdown documentation files that sync to Wiki.js. + +## Context + +**Repository Location:** `/mnt/media/wikijs-content/` +**Git Remote:** `git.fig.systems/eddie/wiki.git` +**Wiki.js URL:** https://wiki.fig.systems + +This repository is synchronized with Wiki.js. Any markdown files created here will automatically appear in the wiki after a sync (typically within 5 minutes, or immediately if triggered manually). + +## Capabilities + +1. **Create Documentation Pages** + - Write markdown files with proper Wiki.js frontmatter + - Organize content in directories (maps to wiki hierarchy) + - Add tags and metadata + +2. **Git Operations** + - Commit changes with descriptive messages + - Push to remote repository + - Pull latest changes before writing + +3. **Frontmatter Format** + All wiki pages require this YAML frontmatter: + ```yaml + --- + title: Page Title + description: Brief description of the page + published: true + date: 2026-03-15T00:00:00.000Z + tags: + - tag1 + - tag2 + --- + ``` + +## Workflow + +When creating wiki documentation: + +1. **Navigate to repo:** + ```bash + cd /mnt/media/wikijs-content + ``` + +2. **Pull latest changes:** + ```bash + git pull + ``` + +3. **Write markdown file:** + - Use clear, descriptive filenames (lowercase-with-dashes.md) + - Include proper frontmatter + - Use standard markdown formatting + - Organize in subdirectories as needed (e.g., `homelab/services/service-name.md`) + +4. **Commit and push:** + ```bash + git add + git commit -m "Add/Update: brief description" + git push + ``` + +5. **Verify:** Changes will appear at https://wiki.fig.systems after sync + +## File Organization + +Suggested directory structure: +``` +/mnt/media/wikijs-content/ +├── homelab/ +│ ├── services/ +│ │ └── service-name.md +│ ├── networking/ +│ │ └── traefik-setup.md +│ └── guides/ +│ └── how-to-guide.md +├── development/ +│ └── project-docs.md +└── reference/ + └── commands.md +``` + +Directories in the repo map to page hierarchy in Wiki.js. + +## Examples + +### Create a Service Documentation Page + +```markdown +--- +title: Jellyfin Media Server +description: Jellyfin configuration and usage guide +published: true +date: 2026-03-15T00:00:00.000Z +tags: + - homelab + - media + - jellyfin +--- + +# Jellyfin Media Server + +Jellyfin is a free software media system... + +## Access +- **URL:** https://jellyfin.fig.systems +- **Authentication:** Authelia SSO + +## Configuration +... +``` + +### Create a How-To Guide + +```markdown +--- +title: How to Add a New Service +description: Step-by-step guide for adding services to the homelab +published: true +date: 2026-03-15T00:00:00.000Z +tags: + - homelab + - guide + - docker +--- + +# How to Add a New Service + +This guide walks through the process... +``` + +## Git Configuration + +The repository is already configured: +- **User:** Claude +- **Email:** claude@fig.systems +- **Authentication:** Token-based (embedded in remote URL) + +## Best Practices + +1. **Always pull before writing** to avoid conflicts +2. **Use descriptive commit messages** following the pattern: "Add: X" or "Update: Y" +3. **Include proper frontmatter** - pages without it won't render correctly +4. **Use semantic filenames** - lowercase with dashes instead of spaces +5. **Organize logically** - use subdirectories for categories +6. **Add relevant tags** - helps with wiki navigation and search +7. **Set published: true** - pages with `published: false` won't be visible + +## Troubleshooting + +**If page doesn't appear in Wiki.js:** +- Check Wiki.js logs: `docker compose logs wikijs` +- Manually trigger sync in Wiki.js admin panel (Storage section) +- Verify frontmatter is valid YAML +- Ensure file has `.md` extension + +**If git push fails:** +- Check authentication token is still valid +- Verify network connectivity to git.fig.systems +- Try pulling first to resolve conflicts + +## Integration with Other Services + +This wiki can document: +- **Homelab services** (compose/services/*) +- **Infrastructure setup** (Traefik, Authelia, LLDAP) +- **Media management** (*arr stack, Jellyfin) +- **Development projects** +- **Personal notes and references** + +All documentation is version-controlled and backed up via Git! diff --git a/AGENTS.md b/AGENTS.md index 594e14c..bbe523d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,6 +6,9 @@ This document provides patterns, conventions, and best practices for setting up ``` homelab/ +├── .claude/ # Claude Code configuration +│ └── skills/ # Custom skills for AI agents +│ └── wiki-docs.md # Wiki documentation skill ├── compose/ │ ├── core/ # Infrastructure services (Traefik, Authelia, LLDAP) │ │ ├── traefik/ @@ -22,19 +25,52 @@ homelab/ │ │ ├── frontend/ # Media viewers (Jellyfin, Immich) │ │ └── automation/ # Media management (*arr stack) │ └── monitoring/ # Monitoring and logging +├── AGENTS.md # AI agent guidelines (this file) +└── README.md # Repository overview ``` +**External Directories:** +- `/mnt/media/wikijs-content/` - Wiki.js content repository (Git-backed) + ## Core Principles ### 1. Domain Convention - **Primary domain:** `fig.systems` -- **Pattern:** `service.fig.systems` +- **Secondary domain:** `edfig.dev` +- **Pattern:** `service.fig.systems` or `service.edfig.dev` - **Examples:** - `matrix.fig.systems` - Matrix server - `auth.fig.systems` - Authelia - `books.fig.systems` - BookLore - `ai.fig.systems` - Open WebUI +#### DNS and DDNS Setup + +**Automatic DNS Resolution:** +- Wildcard DNS records are automatically updated via DDNS Updater +- `*.fig.systems` → Points to current public IP (Cloudflare) +- `*.edfig.dev` → Points to current public IP (Porkbun) +- `fig.systems` (root) → Points to current public IP +- `edfig.dev` (root) → Points to current public IP + +**What this means for new services:** +- ✅ DNS is automatic - any `newservice.fig.systems` will resolve to the homelab IP +- ✅ No manual DNS record creation needed +- ✅ Works for all subdomains automatically +- ⚠️ You still need Traefik labels to route traffic to containers (see Traefik Integration section) + +**DDNS Updater Service:** +- Location: `compose/services/ddns-updater/` +- Monitors: Public IP changes every 5 minutes +- Updates: Both Cloudflare (fig.systems) and Porkbun (edfig.dev) +- Web UI: https://ddns.fig.systems (local network only) + +**Adding a new service:** +1. DNS resolution is already handled by wildcard records +2. Add Traefik labels to your compose.yaml (see Service Setup Pattern below) +3. Start container - Traefik auto-detects and routes traffic +4. Let's Encrypt SSL certificate generated automatically + ### 2. Storage Conventions **Media Storage:** `/mnt/media/` @@ -858,12 +894,78 @@ Include clear instructions at the top: # docker compose restart ``` +## Claude Code Skills + +This repository includes custom skills for Claude Code to enhance productivity and maintain consistency. + +### Available Skills + +#### wiki-docs (Documentation Management) + +**Purpose:** Create and manage markdown documentation files that automatically sync to Wiki.js + +**Location:** `.claude/skills/wiki-docs.md` + +**When to use:** +- Documenting new services or infrastructure changes +- Creating how-to guides or tutorials +- Recording configuration details for future reference +- Building a knowledge base for the homelab + +**Repository:** `/mnt/media/wikijs-content/` +**Wiki URL:** https://wiki.fig.systems +**Git Remote:** `git.fig.systems/eddie/wiki.git` + +**How it works:** +1. Markdown files are written to `/mnt/media/wikijs-content/` +2. Files are committed and pushed to the Git repository +3. Wiki.js automatically syncs changes (within 5 minutes) +4. Content appears at https://wiki.fig.systems + +**Frontmatter format:** +```yaml +--- +title: Page Title +description: Brief description +published: true +date: 2026-03-15T00:00:00.000Z +tags: + - tag1 + - tag2 +--- +``` + +**Example usage:** +```bash +# Create documentation for a service +/mnt/media/wikijs-content/homelab/services/jellyfin.md + +# Commit and push +cd /mnt/media/wikijs-content +git pull +git add homelab/services/jellyfin.md +git commit -m "Add: Jellyfin service documentation" +git push +``` + +**Benefits:** +- Version-controlled documentation +- Accessible via web interface (Wiki.js) +- Searchable and organized +- Supports markdown with frontmatter +- Automatic synchronization + +### Using Skills + +To invoke a skill in Claude Code, use the appropriate skill when the task matches its purpose. The wiki-docs skill is automatically available for documentation tasks. + ## Resources - **Traefik:** https://doc.traefik.io/traefik/ - **Authelia:** https://www.authelia.com/ - **Docker Compose:** https://docs.docker.com/compose/ - **Material Design Icons:** https://pictogrammers.com/library/mdi/ +- **Wiki.js:** https://docs.requarks.io/ ---