From 94b89da5335da059c75bccc686be91a923726075 Mon Sep 17 00:00:00 2001 From: m3tm3re
Date: Wed, 11 Feb 2026 19:58:06 +0100
Subject: [PATCH] finalize doc-translator skill
---
AGENTS.md | 10 ++
scripts/test-skill.sh | 14 +--
skills/doc-translator/SKILL.md | 116 +++++++++---------
.../scripts/list_outline_collections.sh | 32 -----
.../scripts/upload_image_to_outline.sh | 108 +++++++++-------
skills/skill-creator/scripts/init_skill.py | 4 +-
6 files changed, 142 insertions(+), 142 deletions(-)
delete mode 100755 skills/doc-translator/scripts/list_outline_collections.sh
diff --git a/AGENTS.md b/AGENTS.md
index a353159..a646a5f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,5 +1,15 @@
# Opencode Skills Repository
+## MANDATORY: Use td for Task Management
+
+Run td usage --new-session at conversation start (or after /clear). This tells you what to work on next.
+
+Sessions are automatic (based on terminal/agent context). Optional:
+- td session "name" to label the current session
+- td session --new to force a new session in the same context
+
+Use td usage -q after first read.
+
Configuration repository for Opencode Agent Skills, context files, and agent configurations. Deployed via Nix home-manager to `~/.config/opencode/`.
## Quick Commands
diff --git a/scripts/test-skill.sh b/scripts/test-skill.sh
index b04984c..e499613 100755
--- a/scripts/test-skill.sh
+++ b/scripts/test-skill.sh
@@ -8,7 +8,7 @@
# ./scripts/test-skill.sh --run # Launch interactive opencode session
#
# This script creates a temporary XDG_CONFIG_HOME with symlinks to this
-# repository's skill/, context/, command/, and prompts/ directories,
+# repository's skills/, context/, command/, and prompts/ directories,
# allowing you to test skill changes before deploying via home-manager.
set -euo pipefail
@@ -72,17 +72,17 @@ list_skills() {
validate_skill() {
local skill_name="$1"
- local skill_path="$REPO_ROOT/skill/$skill_name"
+ local skill_path="$REPO_ROOT/skills/$skill_name"
if [[ ! -d "$skill_path" ]]; then
echo -e "${RED}❌ Skill not found: $skill_name${NC}"
echo "Available skills:"
- ls -1 "$REPO_ROOT/skill/"
+ ls -1 "$REPO_ROOT/skills/"
exit 1
fi
echo -e "${YELLOW}Validating skill: $skill_name${NC}"
- if python3 "$REPO_ROOT/skill/skill-creator/scripts/quick_validate.py" "$skill_path"; then
+ if python3 "$REPO_ROOT/skills/skill-creator/scripts/quick_validate.py" "$skill_path"; then
echo -e "${GREEN}✅ Skill '$skill_name' is valid${NC}"
else
echo -e "${RED}❌ Skill '$skill_name' has validation errors${NC}"
@@ -95,14 +95,14 @@ validate_all() {
echo ""
local failed=0
- for skill_dir in "$REPO_ROOT/skill/"*/; do
+ for skill_dir in "$REPO_ROOT/skills/"*/; do
local skill_name=$(basename "$skill_dir")
echo -n " $skill_name: "
- if python3 "$REPO_ROOT/skill/skill-creator/scripts/quick_validate.py" "$skill_dir" > /dev/null 2>&1; then
+ if python3 "$REPO_ROOT/skills/skill-creator/scripts/quick_validate.py" "$skill_dir" > /dev/null 2>&1; then
echo -e "${GREEN}✅${NC}"
else
echo -e "${RED}❌${NC}"
- python3 "$REPO_ROOT/skill/skill-creator/scripts/quick_validate.py" "$skill_dir" 2>&1 | sed 's/^/ /'
+ python3 "$REPO_ROOT/skills/skill-creator/scripts/quick_validate.py" "$skill_dir" 2>&1 | sed 's/^/ /'
((failed++)) || true
fi
done
diff --git a/skills/doc-translator/SKILL.md b/skills/doc-translator/SKILL.md
index 2464c63..9044788 100644
--- a/skills/doc-translator/SKILL.md
+++ b/skills/doc-translator/SKILL.md
@@ -72,76 +72,72 @@ If an image download fails, log it and continue. Use a placeholder in the final
### 4. Upload Images to Outline
-**IMPORTANT:** Always use Outline MCP tools for all Outline operations. If Outline tools throw errors:
-1. Load the outline skill first: `skill name=outline`
-2. Retry with `skill_mcp` tool for outline operations
-3. Only fallback to direct API calls via `bash` after exhausting MCP options
-
-mcp-outline cannot create attachments. Use direct API calls via `bash` for image uploads only.
-
-**Required env:** `OUTLINE_API_KEY` (read from /run/agenix/outline-key)
-
-For each downloaded image:
+MCP-outline does not support attachment creation. Use the bundled script for image uploads:
```bash
-#!/usr/bin/env bash
-set -euo pipefail
+# Upload with optional document association
+bash scripts/upload_image_to_outline.sh "/tmp/doc-images/screenshot.png" "$DOCUMENT_ID"
-IMAGE_PATH="/tmp/doc-images/screenshot.png"
-IMAGE_NAME="$(basename "$IMAGE_PATH")"
-CONTENT_TYPE="image/png" # Detect from extension: png->image/png, jpg/jpeg->image/jpeg, gif->image/gif, svg->image/svg+xml, webp->image/webp
-
-# 1. Get file size (cross-platform)
-FILESIZE=$(stat -f%z "$IMAGE_PATH" 2>/dev/null || stat -c%s "$IMAGE_PATH")
-
-# 2. Create attachment record
-RESPONSE=$(curl -s -X POST "https://wiki.az-gruppe.com/api/attachments.create" \
- -H "Authorization: Bearer $OUTLINE_API_KEY" \
- -H "Content-Type: application/json" \
- -d "{
- \"name\": \"$IMAGE_NAME\",
- \"contentType\": \"$CONTENT_TYPE\",
- \"size\": $FILESIZE
- }")
-
-# 3. Extract URLs from response
-UPLOAD_URL=$(echo "$RESPONSE" | jq -r '.data.uploadUrl')
-ATTACHMENT_URL=$(echo "$RESPONSE" | jq -r '.data.attachment.url')
-
-# 4. Check for errors
-if [ "$UPLOAD_URL" = "null" ] || [ -z "$UPLOAD_URL" ]; then
- echo "ERROR: Failed to create attachment. Response: $RESPONSE" >&2
- exit 1
-fi
-
-# 5. Upload binary to signed URL
-curl -s -X PUT "$UPLOAD_URL" \
- -H "Content-Type: $CONTENT_TYPE" \
- --data-binary "@$IMAGE_PATH"
-
-# 6. Output the attachment URL for use in markdown
-echo "$ATTACHMENT_URL"
+# Upload without document (attach later)
+bash scripts/upload_image_to_outline.sh "/tmp/doc-images/screenshot.png"
```
-Replace image references in the translated markdown:
+The script handles API key loading from `/run/agenix/outline-key`, content-type detection, the two-step presigned POST flow, and retries. Output is JSON: `{"success": true, "attachment_url": "https://..."}`.
+
+Replace image references in the translated markdown with the returned `attachment_url`:
```markdown

```
-**Content-Type detection by extension:**
-
-| Extension | Content-Type |
-|-----------|-------------|
-| `.png` | `image/png` |
-| `.jpg`, `.jpeg` | `image/jpeg` |
-| `.gif` | `image/gif` |
-| `.svg` | `image/svg+xml` |
-| `.webp` | `image/webp` |
+For all other Outline operations (documents, collections, search), use MCP tools (`Outline_*`).
### 5. Translate with TEEM Format
Translate the entire document into each target language. Apply TEEM format to UI elements.
+#### Address Form (CRITICAL)
+
+**Always use the informal "you" form** in ALL target languages:
+- **German**: Use **"Du"** (informal), NEVER "Sie" (formal)
+- **Czech**: Use **"ty"** (informal), NEVER "vy" (formal)
+- This applies to all translations — documentation should feel approachable and direct
+
+#### Infobox / Callout Formatting
+
+Source documentation often uses admonitions, callouts, or info boxes (e.g., GitHub-style `> [!NOTE]`, Docusaurus `:::note`, or custom HTML boxes). **Convert ALL such elements** to Outline's callout syntax:
+
+```markdown
+:::tip
+Tip or best practice content here.
+
+:::
+
+:::info
+Informational content here.
+
+:::
+
+:::warning
+Warning or caution content here.
+
+:::
+
+:::success
+Success message or positive outcome here.
+
+:::
+```
+
+**Mapping rules** (source → Outline):
+| Source pattern | Outline syntax |
+|---|---|
+| Note, Info, Information | `:::info` |
+| Tip, Hint, Best Practice | `:::tip` |
+| Warning, Caution, Danger, Important | `:::warning` |
+| Success, Done, Check | `:::success` |
+
+**CRITICAL formatting**: The closing `:::` MUST be on its own line with an empty line before it. Content goes directly after the opening line.
+
#### TEEM Rules
**Format:** `**English UI Term** (Translation)`
@@ -217,7 +213,7 @@ Use mcp-outline tools to publish:
|-------|--------|
| URL fetch fails | Use `question` to ask for alternative URL or manual paste |
| Image download fails | Continue with placeholder, note in completion report |
-| Outline API error (attachments) | Save markdown to `/tmp/doc-translator-backup-TIMESTAMP.md`, report error |
+| Outline API error (attachments) | Script retries 3x with backoff; on final failure save markdown to `/tmp/doc-translator-backup-TIMESTAMP.md`, report error |
| Outline API error (document) | Save markdown to `/tmp/doc-translator-backup-TIMESTAMP.md`, report error |
| Ambiguous UI term | Use `question` to ask user for correct translation |
| Large document (>5000 words) | Ask user if splitting into multiple docs is preferred |
@@ -254,9 +250,9 @@ Items Needing Review:
## Environment Variables
-| Variable | Purpose |
-|----------|---------|
-| `OUTLINE_API_KEY` | Bearer token for wiki.az-gruppe.com API |
+| Variable | Purpose | Source |
+|----------|---------|--------|
+| `OUTLINE_API_KEY` | Bearer token for wiki.az-gruppe.com API | Auto-loaded from `/run/agenix/outline-key` by upload script |
## Integration with Other Skills
diff --git a/skills/doc-translator/scripts/list_outline_collections.sh b/skills/doc-translator/scripts/list_outline_collections.sh
deleted file mode 100755
index 03dabca..0000000
--- a/skills/doc-translator/scripts/list_outline_collections.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env bash
-# List all collections available in Outline
-#
-# Usage:
-# list_outline_collections.sh
-#
-# Environment:
-# OUTLINE_API_KEY - Bearer token for wiki.az-gruppe.com API
-#
-# Output (JSON):
-# [{"id": "...", "name": "...", "url": "..."}, ...]
-
-set -euo pipefail
-
-# List collections
-RESPONSE=$(curl -s -X POST "https://wiki.az-gruppe.com/api/collections.list" \
- -H "Authorization: Bearer $OUTLINE_API_KEY" \
- -H "Content-Type: application/json" \
- -d '{}')
-
-# Check for errors
-if echo "$RESPONSE" | jq -e '.error' > /dev/null 2>&1; then
- ERROR_MSG=$(echo "$RESPONSE" | jq -r '.message // "Failed to list collections"')
- echo "{\"success\": false, \"error\": \"$ERROR_MSG\", \"response\": \"$RESPONSE\"}" >&2
- exit 1
-fi
-
-# Extract collection list
-COLLECTIONS=$(echo "$RESPONSE" | jq -r '.data[] | {id: .id, name: .name, url: .url}')
-
-# Output as JSON array
-echo "$COLLECTIONS" | jq -s '.'
diff --git a/skills/doc-translator/scripts/upload_image_to_outline.sh b/skills/doc-translator/scripts/upload_image_to_outline.sh
index 3e5f204..e7d392b 100755
--- a/skills/doc-translator/scripts/upload_image_to_outline.sh
+++ b/skills/doc-translator/scripts/upload_image_to_outline.sh
@@ -1,26 +1,40 @@
#!/usr/bin/env bash
-# Upload an image to an Outline document via signed URL
+# Upload an image to Outline via presigned POST (two-step flow)
#
# Usage:
-# upload_image_to_outline.sh