POLISCI 158 · Section 7

Week 8 · Section 7 · Lab

Research with agent skills: from the literature to your own analysis

Three parts. 1 · Skills and principles: what a skill is, and how to install and call one. 2 · Empirical research: one published paper, four steps, and at each step what the agent can do and what only you can decide. 3 · Lab: move your own project forward with an agent, then submit a 200-word reflection on Canvas, due before next section.

I'm using

Folder names and wording below switch to match your tool.

0 of 3 lab steps done
Next due: Implementation milestone · Sun, Nov 15

Part 1 · Skills and principles

What is a skill?

A written procedure the agent follows: the instructions you'd give a careful research assistant, written once and followed the same way every time. It's a folder with a SKILL.md file, plus scripts if it needs them, in .claude/skills/.

A real one: Pedro Sant'Anna's lit-review

  • Description, always loaded: the phrases that tell the agent to use it ("find papers on X").
  • Allowed tools: what it may touch.
  • Steps, read only when used: start from a named paper, search, sort into theory, empirics, methods and debates, find gaps and null results, write BibTeX, save a report.
  • Verification: it checks its citations before it reports back.

Five principles

  1. The harness decides. Model + loop, tools, permissions, skills. Choose them on purpose.
  2. Write repeated work down as a skill. Optional: a clear prompt often does the job.
  3. Keep context short. Plan, instruct, verify, correct: "Before you start, tell me your plan in three steps. Wait for my OK."
  4. Delegate the procedural, keep the substantive. The most important one today; see below.
  5. Be transparent. Keep your chats. Every project submission needs an AI-use note.

4 · Delegate the procedural, keep the substantive

delegate, then check Searches, downloads, code, figures.

keep The question, the design, the assumptions, what the result means. Where the agent lacks what you know, it fills the gap with something plausible and made up.

Install a skill (optional, after class)

Open your project folder in the Claude app's Code tabCodex and give your agent the link to the skill's folder:

Example prompt
Install the lit-review skill from github.com/pedrohcgs/claude-code-my-workflow/tree/main/.claude/skills/lit-review into .claude/skills/ in this folder. Before you copy anything, show me its SKILL.md and tell me what it will do.
Check with "Which skills can you use here?" Not listed? Run /reload-skills or start a new session in the same folder.
Check with "Which skills can you use here?" Codex reads .agents/skills/; not listed? Restart Codex in the same folder.

Read before you install: a skill can run scripts on your computer. Skills are optional and can go out of date as tools and models change: adapt one, or just write a clear prompt.

Skills from researchers

Call a skill

In plain words (its description matches), or name it:

Plain words
I need literature on [your question]. Start from [a paper you know].
Name it
Use the lit-review skill on [your question].

The principles are adapted from Simone Paci, With Great Powers: A Practical Guide to Agentic AI for Social Science Research (2026).

Part 2 · Empirical research with an agent

The paper: Anelli, Colantone & Stanig (2021), "Individual vulnerability to industrial robot adoption increases support for the radical right", PNAS. European Social Survey, 13 western European countries, elections 1999–2015. Exposure to robots = how automatable your likely job is × how fast robots spread in your country. Nobody assigns robots at random, so it's observational.

Stepagent canonly you canA published skill
1 · LiteratureStart from one paper; map key papers into themes; find gaps and null results; write BibTeX.Open the key papers: is each method and finding right?Sant'Anna's lit-review
2 · DataDownload the replication data and plot it, in seconds.Spot that the first chart compares countries, not people.Sant'Anna's data-analysis
3 · Text as dataLabel thousands of texts with your codebook; report agreement with your hand codes.Define the categories; decide if agreement is good enough.None needed
4 · AnalysisRun the regression and the instrumental-variable version, with a table and a chart.Judge each assumption: unmeasured differences, other paths from robots abroad.Sant'Anna's data-analysis; Cunningham's referee2 to audit

Step 2 · Data: the first chart compares countries, not people

Bar chart: share voting radical right by exposure group, all countries pooled. The least-exposed group has the highest share, 8.0 percent; the others range from 3.4 to 5.0 percent.
First try: all countries pooled. The least exposed vote radical right most.
Bar chart: radical-right vote relative to the country-year average, by exposure group, rising from minus 2.2 points to plus 1.4 points.
Second try: each person compared with others in the same country and year. It rises steadily.
Why: the least-exposed group has many Swiss respondents, and Switzerland has the highest radical-right vote in the sample (about 24%).

Step 3 · Text as data: check it before you scale it

An agent can sort speeches, manifestos or survey answers into categories with your codebook. On 6,183 tweets and news articles, ChatGPT beat crowd workers by about 25 points in accuracy, at under $0.003 per label (Gilardi, Alizadeh & Kubli 2023, PNAS). Accuracy meant agreement with trained human coders, so:

  1. you Write a codebook, and hand-code a sample (say 100 texts).
  2. agent Label the same sample; report agreement, category by category.
  3. agent If you judge it good enough, label everything. Report the agreement.

Step 4 · Analysis: from a correlation to a causal claim

Estimates with 95 percent intervals: selection on observables (regression) plus 1.1 percentage points, interval about 0.2 to 2.0; instrumental variable plus 2.8, interval about 1.4 to 4.2
Per one standard deviation more exposure, on a base of 4.8% voting radical right; 97,035 respondents. The instrumental-variable estimate (+2.8) matches the paper's Figure 3.

Five designs, and what to ask your agent

DesignIt works if…Ask your agent for
Randomized trialTreatment was assigned at randomA balance table
Selection on observablesNothing important is left unmeasuredWhat could still differ; a sensitivity check
Regression discontinuityUnits either side of a cutoff are comparableSorting at the cutoff; balance near it
Instrumental variableThe instrument reaches the outcome only through the treatmentThe first stage; other paths
Difference-in-differencesTrends would have stayed parallelThe pre-treatment plot

agent can Run each check.

only you can Decide whether the assumption is believable for your question, and which design to defend.

Not an empirical project? The same test works. Theoretical: the agent finds the literature on your mechanism and the strongest rival explanation; the mechanism is yours. Argumentative: it makes the strongest objection to your position; your position and standard are yours.

Part 3 · Lab: move your project forward with an agent

What you submit: a 200-word reflection on Canvas about what you try here, due before next section.

Questions about your project? Come by and ask your TA, about AI or anything else.

  1. 1Pick a next stepWhat will you hand over, what will you decide?

    Pick one stage from the cards below. Write down what the agent does and what you decide yourself.

  2. 2Try it, then check itWith or without a skill

    Ask for its plan first. When something matters, ask how it knows, then check one thing yourself.

    Start with
    Before you start, tell me your plan in three steps. Wait for my OK.
  3. 3Submit your reflectionAbout 200 words, on Canvas, due before next section

    Note what you tried, what worked and what went wrong, then write the reflection. Keep the chat for your AI-use note.

Example prompts, with a skill where one fits

Skills are optional: without one, send the prompt without naming the skill.

Literature

Skill: Sant'Anna's lit-review
Use the lit-review skill: find literature on [your question], starting from [a paper you know].

you Open every source you plan to cite.

Data

Skill: Sant'Anna's data-analysis
Find and download a public dataset for [your question]. Tell me the source, unit and years first. Then clean it and list every change you made.

you Check three numbers against the source.

Figure

No skill needed
Plot [y] by [x] from [my cleaned file], in a clean journal style. Before you draw it, tell me what each bar compares.

you Does it compare like with like?

Text coding

No skill needed
Here are my codebook and 100 texts I coded by hand. Label them, then compare with my labels, category by category. Don't change the codebook.

you Is the agreement good enough?

Analysis

Skill: Sant'Anna's data-analysis
Use the data-analysis skill on [my data file]: run [my model], with a table and a figure. Show me the code.

you Choose the design first; name the assumption you're least sure of.

Second opinion

Skill: Cunningham's referee2
In a fresh session: use the referee2 skill on my code, or list the three biggest threats to my main claim. Don't edit my files.

you Decide which threats are real.

Submit: a 200-word reflection on Canvas

Due before next section · Section Assignment 7 · Pass / No-Pass · submit on Canvas

Answer two questions about what you tried

  1. Delegate or decide? Which work could you hand to an AI agent, and which judgments must stay yours? Why?
  2. What happened? What did you try, what worked, what went wrong, and how did you check?

To pass: about 200 words · both questions, about something you actually tried on your project. Write it yourself.

0 words so far · aim for about 200

Saved in this browser as you type, so you can come back before the deadline. Nothing is sent anywhere.

    1. Press Download my reflection. You get a text file with your name and your reflection.
    2. On Canvas, open Section Assignment 7 and upload the file. (Or press Copy and paste it into the text box.)
    Preview
    
        
    Next due: Implementation milestone · Sun, Nov 15

    Hints

    The agent doesn't see the skill
    Check the path: .claude/skills/[skill-name]/SKILL.md, inside the folder you opened. Then run /reload-skills or start a new sessionchat.
    The agent forgets what we agreed
    Ask it to write a short summary to a file, then start a fresh sessionchat that begins by reading it.
    Words you'll need
    Harness: the model plus its loop, tools, permissions and skills. Context: what the model can see right now; long sessions lose track. Fixed effects: comparing people only within the same group, here the same country and year. Instrumental variable: moves the treatment and affects the outcome only through it; that second part can't be tested, you argue it. Parallel trends: without treatment, the two groups would have changed by the same amount.

    No match. Ask your agent, a neighbour, or your TA.