Cookbook 07: Skill — It tries, learns, applies.
It does a job once and writes down how. Once you've read that and switched it on, the next run follows it.
By The Pine Computer team
A purchase order comes in as a spreadsheet, and it has to go into the company’s ERP as one sales order. The AI gets the job with no instructions for this ERP.
On its first try, Confirm is refused: the customer had only been typed into its field, never picked from the list. The AI works that out and confirms the order. Then session.learn has it write down how the job is done, down to how to tell it worked: the saved order’s status reads Sales Order, where a Quotation doesn’t count.
What it writes is a draft, and nothing follows a draft. computer.skills.activate puts it in force, once someone has read it. The next order goes in with the skill named, and Confirm goes through the first time.
# first_run.rb
require_relative "setup" # the client, the computer, the session
JOB = <<~TXT
Enter PO-4471.csv into the ERP as one sales order.
Match every line to a product, then confirm it.
TXT
session.agent.run("Sign in as admin.", secrets: SECRETS) # never part of a skill
session.agent.run(JOB) # TRY — it works the ERP out
learned = session.learn # LEARN — it writes down how
puts computer.skills.drafts.first["body"] # you read it# second_run.rb
require_relative "setup" # the same computer, still signed in
SKILL = "enter-po-csv-as-odoo-sales-order"
computer.skills.activate(SKILL, version: 1) # LEARN — you approved it
session.agent.run(<<~TXT, skills: [SKILL]) # APPLY — it uses what it learned
Enter PO-4488.csv into the ERP as one sales order.
Match every line to a product, then confirm it.
TXTsession.learn drafts from the session’s latest turn, the job, so the sign-in before it never goes into the skill. Following a skill, the AI still does the work; the skill gives it the steps and what to watch for. Both runs were recorded on 10 October 2026, on an Odoo instance we run, with invented company and customer names. More in the docs.