{
  "markdown": "# Swift Server Skills & Linting\n\nA collection of Claude skills for guidance on Swift (Server) development, along with a linting tool that enforces best practices.\n\n## The Technique\n\nClaude, as any LLM (or Human) makes mistakes. When Claude makes a mistake, most people have one of two reactions:\n- Tell Claude it sucks, and let it try again.\n- Open up some social media, and vent about how Claude sucks.\n\nHowever, trying the same with Humans has proven extremely ineffective. *Humans bite back.*\n\n### The solution\n\nThe solution is a pretty simple feedback loop:\n1. Whenever you generate code, _read it_ before you commit.\n2. If you see a mistake, try to articulate what should be improved and _why_.\n3. Iterate 2. until you have a rationale Claude can follow easily.\n4. Add the rationale with a small code sample to a Claude skill, to ensure future iterations have the same context.\n\nAnd now the critical step: **Encode your newfound rule/skill as a linter rule.**\n\nThis last step ensures that future code generated by Claude will follow these same rules, independently of whether the skill is in the LLM's context window.\n\n## Overview\n\nThis repository contains two main components:\n\n1. **Skills** - Knowledge bases that provide expert guidance on Swift server topics\n2. **swift-server-lint** - A linting tool that enforces best practices from the skills\n\n## Setup with Claude Code\n\n### 1. Install Skills\n\nClone this repository and symlink the skills into your Claude home directory:\n\n```bash\ngit clone https://github.com/wendylabsinc/claude-skills.git\nln -s \"$(pwd)/skills\" ~/.claude/skills\n```\n\nClaude Code automatically loads skills from `~/.claude/skills/*/SKILL.md`.\n\n### 2. Build the Linter\n\n```bash\ncd skills/swift-server-lint\nswift build\n```\n\n### 3. Auto-Lint with a Hook\n\nAdd a **PostToolUse hook** to `~/.claude/settings.json` so that `swift-server-lint` runs automatically after every `swift build`:\n\n```json\n{\n  \"hooks\": {\n    \"PostToolUse\": [\n      {\n        \"matcher\": \"Bash\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"~/.claude/hooks/swift-server-lint.sh\"\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThen create `~/.claude/hooks/swift-server-lint.sh`:\n\n```bash\n#!/bin/bash\nINPUT=$(cat)\nCOMMAND=$(echo \"$INPUT\" | jq -r '.tool_input.command // empty')\n\nif echo \"$COMMAND\" | grep -q 'swift build'; then\n  LINT_BIN=~/.claude/skills/swift-server-lint/.build/debug/swift-server-lint\n  if [ -x \"$LINT_BIN\" ]; then\n    OUTPUT=$(\"$LINT_BIN\" 2>&1)\n    EXIT_CODE=$?\n    if [ $EXIT_CODE -ne 0 ]; then\n      echo \"---\"\n      echo \"$OUTPUT\"\n      echo \"---\"\n      echo '{\"decision\": \"block\", \"reason\": \"swift-server-lint found issues. Fix them before continuing.\"}'\n    fi\n  fi\nfi\nexit 0\n```\n\n```bash\nchmod +x ~/.claude/hooks/swift-server-lint.sh\n```\n\n### 4. Allow the Linter in Permissions\n\nAdd the linter to your project's `.claude/settings.local.json` so Claude can run it without prompting:\n\n```json\n{\n  \"permissions\": {\n    \"allow\": [\n      \"Bash(.build/debug/swift-server-lint:*)\"\n    ]\n  }\n}\n```\n\n### IDE Integration\n\n- **VS Code** - Install the \"Claude Code\" extension from the marketplace. All `~/.claude/` configuration (skills, hooks, settings) is shared automatically.\n- **Xcode** - No native extension. Use `claude` in a terminal alongside Xcode.\n",
  "bytes": 3308,
  "sha": "9760518df260235744f4ea174915027efb24abf066e7e0c3e5fc180f7999d5c9",
  "repo_slug": "wendylabsinc/claude-skills",
  "fonte": "repo",
  "truncated": false,
  "api": "https://api.agentalog.com/api/listings/skl_wendylabsinc_claude_skills_wendy_641185d1/readme"
}