How To Train Your AI Agent's Skills (Claude Code / OpenClaw)
Based on All About AI's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.
Create a new skill.md file for each site capability, starting empty and iterating until the agent can complete the action.
Briefing
Training an AI agent to perform new browser tasks gets dramatically faster once the successful steps are saved into reusable “skill” files. The workflow demonstrated centers on creating a new LinkedIn skill.md file, letting the agent brute-force the UI using JavaScript injection, then capturing the exact working sequence so later runs skip the trial-and-error.
On a dedicated Mac Mini, the agent’s capabilities are organized as Markdown “skills” that describe how to navigate specific sites and complete actions like composing posts, researching, or editing content. To add LinkedIn, the process starts in Cursor: a new file is created under the skills directory (e.g., LinkedIn skill.md), initially empty. Claude is then instructed to read a browser JavaScript helper so the agent can control Chrome via injected scripts. With the agent logged into LinkedIn on the machine, the first test is intentionally hands-off: it attempts to open the post composer and draft content on its own.
That first attempt takes time because LinkedIn’s editor elements don’t always match standard selectors. The agent uses CDP (Chrome DevTools Protocol) to inject JavaScript, searches for the right input fields, and keeps iterating until it finds a workable way to type into the post editor. After roughly six minutes of experimentation, it finally identifies the correct editor element, inserts text, and produces a draft.
The key step comes next: the working workflow is written back into LinkedIn skill.md. After restarting the agent and re-running the same “compose a draft post” task, the saved skill cuts the runtime from minutes down to about 40 seconds. The agent now loads the skill, runs the previously discovered selector-and-injection sequence on the first try, and leaves the post ready without repeated exploration. The practical payoff is reduced token usage, less compute time, and fewer costly retries.
The same pattern is repeated for additional LinkedIn skills. A new task trains the agent to search for employees at Anthropic, scroll through results, and extract names and roles from the interface. The workflow is then saved into the skill.md file so future searches can run quickly and consistently.
Finally, the agent is trained to send LinkedIn DMs. It first checks who it can message, locates the “send” option, and uses JavaScript injection to deliver a short greeting. A follow-up test—sending a “thanks for the connection” message—runs much faster because the successful messaging workflow has already been captured.
By the end, the demonstrated approach frames “training” as iterative UI discovery plus codifying the winning steps into reusable skill files. Those skills then combine into higher-level autonomy, such as running multi-step tasks across platforms (e.g., research, content creation, and posting) without starting from scratch each time. The creator also mentions maintaining a growing repository of working skill.md files for reuse by other agents.
Cornell Notes
The workflow trains an AI agent to perform LinkedIn actions by turning successful browser interactions into reusable skill.md files. A new skill starts empty, then the agent uses Chrome automation (via JavaScript injection and CDP) to brute-force the UI until it finds the right elements to type, search, or message. Once the agent achieves a working sequence, that exact workflow is saved into LinkedIn skill.md. Subsequent runs become far faster—about 6 minutes for the first post draft, then roughly 40 seconds after saving the working workflow. The same loop is applied to finding Anthropic employees and sending DMs, with later messaging tests improving in speed because the learned steps are reused.
How does the agent “learn” a new LinkedIn capability in this workflow?
Why did the first LinkedIn post attempt take minutes, and what changed afterward?
What role does CDP play in making these skills reusable?
How is the “find people” skill structured conceptually?
What’s the difference between training a DM skill and training a post skill here?
Review Questions
- What specific mechanism turns a one-time UI discovery into a reusable skill for later runs?
- Why does saving a working workflow reduce token usage and runtime in these browser automation tasks?
- How would you design a new skill.md for a different LinkedIn action (e.g., commenting on a post) using the same iterative loop?
Key Points
- 1
Create a new skill.md file for each site capability, starting empty and iterating until the agent can complete the action.
- 2
Use Chrome automation via JavaScript injection and CDP to interact with complex UIs like LinkedIn’s post editor.
- 3
Save the exact working selector-and-workflow sequence into the skill.md file after the first successful attempt.
- 4
Re-running the same task with the saved skill sharply reduces runtime (minutes to seconds) by skipping repeated trial-and-error.
- 5
Apply the same loop to multiple LinkedIn tasks: drafting posts, searching for employees, and sending DMs.
- 6
Combine trained skills to enable more autonomous multi-step workflows across platforms without restarting from scratch.