{
  "name": "Use skills In n8n agent node",
  "nodes": [
    {
      "id": "2f22da99-20e2-413d-aff2-22342ab555f3",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -960,
        0
      ]
    },
    {
      "id": "f48e987d-c929-4cb6-926a-898864202399",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        544,
        0
      ]
    },
    {
      "id": "3813ec64-e25d-4f3a-9f63-667f28d2d75b",
      "name": "List Root Dirs",
      "type": "n8n-nodes-base.github",
      "position": [
        -128,
        -80
      ]
    },
    {
      "id": "2bf04f87-8672-426a-af41-89de278c4f35",
      "name": "Set GitHub Repo URLs",
      "type": "n8n-nodes-base.set",
      "position": [
        -608,
        0
      ]
    },
    {
      "id": "8533f02e-15b2-46e4-8324-8f0b97c438be",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -320,
        0
      ]
    },
    {
      "id": "36b931b8-6bde-4c3c-af00-7d0f41338e3a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1088,
        384
      ],
      "parameters": {
        "width": null,
        "height": 288,
        "content": "HTTP request is used here instead of the built in GitHub node because the node returns base 64, but in the HTTP node we can request it as a text file through headers"
      }
    },
    {
      "id": "3fc14e56-09c1-4450-98d3-aadcc00d20af",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        400
      ],
      "parameters": {
        "width": 192,
        "height": 272,
        "content": "This lets the agent look through the directories to find relevant files"
      }
    },
    {
      "id": "670b4a12-57b3-45dd-8395-bab870d85ef5",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        736,
        384
      ]
    },
    {
      "id": "ee6eacbf-8cc6-4600-81d4-1fee1e519ff5",
      "name": "Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        528,
        384
      ]
    },
    {
      "id": "84ee2f0c-781b-44f0-a9ae-3c43b079b5f1",
      "name": "List Skills Dirs",
      "type": "n8n-nodes-base.github",
      "position": [
        -128,
        80
      ]
    },
    {
      "id": "b1568951-5eef-4445-99b5-32a42d973ab2",
      "name": "Remove Skills Dirs & Dot Files",
      "type": "n8n-nodes-base.filter",
      "position": [
        48,
        -80
      ]
    },
    {
      "id": "89d669a1-936f-476a-bb4e-bcc7b9bd0782",
      "name": "Remove Errors and Dot Files",
      "type": "n8n-nodes-base.filter",
      "position": [
        48,
        80
      ]
    },
    {
      "id": "af4f0351-1c12-4c93-85e7-652910468302",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1024,
        -176
      ],
      "parameters": {
        "width": null,
        "height": 352,
        "content": "## Interact with Chat\nYou can use this with the chat window on the bottom left or by enabling the toggle `Make Available in n8n Chat Hub` to true will let you use it in n8n's [chat hub](https://www.yo"
      }
    },
    {
      "id": "83b10b2b-42ab-4c04-a5cc-3d93ac73cf9b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -272
      ],
      "parameters": {
        "width": 256,
        "height": 448,
        "content": "## TODO Add Skills\nYou can use any skill that is publicly available on GitHub.\n\nPreselected is Anthropic's example [Skills Repo](https://github.com/anthropics/skills) and [Knowledge Work Skills](https"
      }
    },
    {
      "id": "f66b72b8-bb22-4f0e-8f11-8abfb86b9406",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -128
      ],
      "parameters": {
        "width": 384,
        "height": 272,
        "content": "## Just a Regular Ol Agent\nYou can build up from here! Add any other tool you want or add to the system prompt to fit your needs!"
      }
    },
    {
      "id": "10857d7f-a1d7-4f36-a5da-a957a49dbb01",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        208
      ],
      "parameters": {
        "width": 464,
        "height": 464,
        "content": "## How the Agent Uses the Skills\nThe agent uses the `List Files by Path Name` as much as needed to explore the file skills repo. The `Get a File From GitHub` returns the full text from the skill markd"
      }
    },
    {
      "id": "12526c15-4ed3-4bb9-b134-613b4693850d",
      "name": "List Files by Path Name",
      "type": "n8n-nodes-base.githubTool",
      "position": [
        928,
        512
      ]
    },
    {
      "id": "8570e9b5-ded9-4dbd-9a32-a6051d90eee8",
      "name": "Get a File From GitHub",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        1168,
        528
      ]
    },
    {
      "id": "fea5fbb5-1c6c-4c39-a4ba-15f1e2ba7914",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -352,
        -272
      ],
      "parameters": {
        "width": 736,
        "height": 528,
        "content": "## Fetch & Prepare Skills for Agent\nThis:\n1. Gets the directory from the GitHub Repository\n2. Removes duplicates & irrelevant files to save context\n3. Gets nested `/skills` directory if it exists\n4. M"
      }
    },
    {
      "id": "b424a991-955e-4fdb-9427-91e059d50019",
      "name": "Merge Directory Structures",
      "type": "n8n-nodes-base.merge",
      "position": [
        256,
        0
      ]
    },
    {
      "id": "218097a1-4675-4b6f-b05d-3aee56e79b46",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        192
      ],
      "parameters": {
        "width": 224,
        "height": 320,
        "content": "## Replace Me\nIf you want, replace me with the provider and model you prefer!\n\nMaybe pick one out on our [AI Benchmark](https://n8n.io/ai-benchmark)"
      }
    }
  ],
  "connections": {
    "Split Out": {
      "main": [
        [
          {
            "node": "List Root Dirs",
            "type": "main",
            "index": 0
          },
          {
            "node": "List Skills Dirs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "List Root Dirs": {
      "main": [
        [
          {
            "node": "Remove Skills Dirs & Dot Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Skills Dirs": {
      "main": [
        [
          {
            "node": "Remove Errors and Dot Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set GitHub Repo URLs": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get a File From GitHub": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "List Files by Path Name": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Merge Directory Structures": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Set GitHub Repo URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Errors and Dot Files": {
      "main": [
        [
          {
            "node": "Merge Directory Structures",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Remove Skills Dirs & Dot Files": {
      "main": [
        [
          {
            "node": "Merge Directory Structures",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}