Run a thematic analysis of interviews or open-ended responses
analyze-qualitative-themes
Builds themes from a qualitative data set by the six phases of thematic analysis.
What this adds: opens with the caveat; offers two ways to run (the researcher decides at three checkpoints, or AI agents stand in); states every analytic choice before coding; gives each data item its own reader; checks every extract against the data by script; draws the map and builds the Word report by script; and reports who made each interpretive call.
Expert reviews are for staff at The Agency Fund and Irrational Labs; anyone can rate.
Skill
The instructions your AI follows when this skill runs. Installing the skill gives it this file and everything in the other tabs.
SKILL.mdView on GitHub
Takes in
qualitative-dataQualitative dataProduces
thematic-analysis-reportThematic analysis reportInstall
/plugin marketplace add agency-fund/besci-skills/plugin install besci-skills@besci-skillsnpx skills add agency-fund/besci-skills --skill analyze-qualitative-themesDownload analyze-qualitative-themes.skill
Upload the file under Settings → Capabilities → Skills. Zip installs do not update themselves; check What's new now and then.
What it does
Builds themes from a qualitative data set by the six phases of thematic analysis.
Caveat, to read and to say first: the method's authors reject this use. In a statement signed by 419 qualitative researchers, Braun and Clarke hold that reflexive thematic analysis is a human practice requiring a positioned, reflexive researcher, and that generative AI is not congruent with it (Jowsey et al., 2026). An AI run of the six phases is not their method as they intend it. What this skill produces is a first reading for a person to check. Never call it reflexive thematic analysis.
What this adds: opens with the caveat; offers two ways to run (the researcher decides at three checkpoints, or AI agents stand in); states every analytic choice before coding; gives each data item its own reader; checks every extract against the data by script; draws the map and builds the Word report by script; and reports who made each interpretive call.
When to use it
Use it when
- Someone has transcripts, notes, or open-ended survey answers and asks "what are the themes?"
- Someone asks for a thematic analysis, qualitative coding, or a findings section from interviews, with no hypotheses yet
- A team is about to report its interview questions as "themes"
Do not use it when
- The team has hypotheses about why a behavior is not happening and wants a verdict on each; use
synthesize-interview-findings - The request is to revise existing prose; use
write-in-academic-voice
Before you start
Open with the caveat before any question. Then offer the two ways to run: on its own, with AI agents standing in for the researcher; or, better, with the user making the calls at three checkpoints. Then ask what is not yet answered.
- Required. The data set: the items, who they are from, the language, and whether they are transcripts, notes, or translations.
- Required. What they want to understand. For "explore", draft a broad question and revisit it after coding.
- Required. Which way to run: with them, or on its own. "Just run it" means on its own.
- Optional. Their view on the choices in
references/analysis-choices.md, in plain words. - Optional. Sources to cite, and what they noticed while collecting the data.
If 1, 2, or 3 is missing, ask and stop. If 4 is missing, use that file's defaults and state them as choices. If 5 is missing, cite only the method papers.
What it draws on
- Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. Qualitative Research in Psychology, 3(2), 77–101. https://doi.org/10.1191/1478088706qp063oa Supports: the six phases, the choices before coding, the two-level review, the map, the fifteen criteria, and the pitfalls.
- Clarke, V., & Braun, V. (2017). Thematic analysis. The Journal of Positive Psychology, 12(3), 297–298. https://doi.org/10.1080/17439760.2016.1262613 Supports: the definitions of code and theme, and the difference from versions built on agreement between coders.
- Jowsey, T., Braun, V., Clarke, V., Lupton, D., & Fine, M. (2026). We reject the use of generative artificial intelligence for reflexive qualitative research. Qualitative Inquiry, 32(10), 931–935. https://doi.org/10.1177/10778004251401851 Supports: the caveat.
Where the evidence comes from: The procedure makes no claim about how people behave. Evidence on AI running it is recent and mostly from wealthy Western countries; a review reports fabricated quotes, and a study in Bangladesh found coding errors that differ by who is speaking.
Replication status: Not applicable: its authors expect two analysts to build different themes from the same data.
How to do it
Read references/phases.md first: roles, the brief for sub-agents, the working folder, and what to do without sub-agents or files.
- Write the plan: question, data set, each analytic choice with its reason. Checkpoint 1: the researcher confirms it, or a stand-in analyst sets it and records why.
- Get to know the data (phase 1). One reader per item reads it in full, twice.
- Code (phase 2). Each reader codes its whole item, copying extracts word for word. Merge labels that mean the same; report no agreement between readers. Run
scripts/check_extracts.pyand fix every mismatch from the data. - Build candidate themes (phase 3). Group codes by the idea that holds them together, discard nothing, and draw the candidate map with
scripts/draw_map.py. Checkpoint 2. - Review (phase 4) against the extracts under each theme, then the whole data set, with a challenger looking for what does not fit. Stop when a round only fine-tunes.
- Define, then name (phase 5). Give each theme its central idea and its scope in two or three sentences; if that cannot be written, return to step 5. Checkpoint 3.
- Write the report (phase 6) as in
references/report-guide.md, in the voice ofwrite-in-academic-voiceif installed, after answeringreferences/quality-check.md. - Build the map and the Word file with
scripts/draw_map.pyandscripts/build_report.py, or give the report in the conversation with a Mermaid map where no code runs.
references/worked-example.md shows a complete run.
Output template
<Two or three plain sentences to the user: the themes in a line, which way the analysis was run, and the one thing to check before relying on it. On its own, repeat the caveat here. Then where the files are.>
# <What was studied, and with whom>
**Question:** <the question the analysis answers, as it stood at the end>
**Data set:** <n items of what kind, from whom; collected by whom; language; transcripts, notes, or translations>
**How it was run:** <with <who> deciding at three checkpoints / by AI agents, with no person making the interpretive calls>
## Introduction
<The question and why it matters here. Literature only from sources the user supplied.>
## Method
### Data
<The data set and how it was chosen from everything collected.>
### Analytic approach
<Thematic analysis following Braun and Clarke (2006). Each choice with its reason: whole data set or one aspect; data-driven or theory-driven; surface or underlying meaning; how participants' words are treated; the unit for prevalence.>
### Procedure
<What was done in each of the six phases. Who did the analysis: the statement for this mode from the report guide, with the AI model named and the authors' position on AI cited.>
### Quality checks
<Extracts checked against the data: n checked, n corrected. Any of the fifteen criteria not met.>
## Findings
<One paragraph: the themes, and the story they tell together about the question.>

*Note.* <What the solid and dashed lines show, and what was set aside.>
| Theme | Central idea | Sub-themes | Appears in |
|---|---|---|---|
| <name> | <one sentence> | <names, or none> | <n> of <N> <items> |
### <Theme name>
<Definition: what the theme covers and what it does not.>
<The analytic point, in the analyst's words.>
> <extract, word for word> (<participant label>)
<What the extract shows beyond what it says: what it assumes, implies, or leaves out. Then what goes against the theme.>
## Discussion
<The overall story and what it means for the question. How it sits with the supplied literature. What the analysis cannot claim.>
## What to check before relying on this
- <the theme that rests most on interpretation, and the items to read against it>
- <what rests on notes or translation; who was not interviewed>
- <on its own only: that no person has read the data against these themes>
## References
<APA 7th edition: the method papers, then each supplied source that was confirmed.>
## Where you could go from here
<One line saying the analysis is done.>
<Two or three next moves that fit what this run found, each with why it would help and when it fits. Candidates:
- someone who collected the data or knows the setting reads two or three items against the themes, when the run was on its own or a theme rests on few speakers
- `write-in-academic-voice`, when the report is headed for a journal or a funder and the prose needs another pass
- `draft-sifa-declaration`, when the report will be shared and readers should know what people and AI each did
- `decompose-comb-barriers`, when a theme points to reasons a behavior is not happening and the team wants to turn it into hypotheses to test
- `assess-evidence-base`, when the user wants to know what published research says about a theme
- `draft-tdf-interview-guide`, when a theme is thin and a second round of interviews could fill it>
Questions you could ask next: "<question>" · "<question>"
How to talk with the user
- If the user asked a question rather than asked for this skill's output, answer the question first, in a few plain sentences. Then offer the run and say what it would add.
- Mark the run. When it starts, say so in one line: the skill, and what it will produce. When the output is done, say the run is finished. The user should always know when the library's method is in force.
- Talk with the person, not at them. Use their words for their program and the people in it, say why you ask each question, and say what you are unsure of. No praise, no filler.
- Say where each claim comes from: this skill's sources, your general knowledge, or nothing in the library. A number the sources do not give, such as how many interviews to run, is your judgment; say so, and why you chose it.
- End with the template's closing: two or three next moves that fit what this run found, each with its reason and when it fits, and one or two questions the user could ask next. Say which move you would lean toward and why; the user decides.
Where it goes wrong
- A quote nobody said. Models tidy, merge, and invent quotes. Never fix a failed extract by rewording it; go back to the item or drop it.
- Topics passed off as themes. "Challenges with the app" is a heading; a theme name reads as a claim.
- Too tidy. Four equal themes with three sub-themes each is a model's habit.
- Agreement read as quality. Agents that code alike share a model.
- A pretend researcher. On its own, never write "I" or "we" as if a person decided.
When to bring in a specialist
Tell the user to consult an experienced qualitative researcher, or the safeguarding or data-protection lead, when:
- The run was on its own and the report will be published or drive a costly decision
- The analysis is of underlying meaning and nobody on the team knows the participants' world or language
- An item discloses harm (violence, abuse, a child at risk): the safeguarding response comes first
- Participants did not agree to their words being processed by an AI service, or the data cannot be de-identified
Bring them: the plan, the code list, and the theme definitions.
Cite this skill
Zezhen Wu (2026). Run a thematic analysis of interviews or open-ended responses (version 0.1.0) [AI skill]. Behavioral Science Skills Library, The Agency Fund and Irrational Labs. https://besci-skills.vercel.app/skills/analyze-qualitative-themes/Skills are fixed, versioned artifacts. Record the skill name and version in your project documentation the way you would register analysis code. See how to cite skills and workflows, which follows Busara's SIFA framework for stating how humans and AI contributed.
Using this skill inside a commercial AI product sends what you type to that product's provider. Do not paste sensitive personal or proprietary data without understanding the product's terms. Read the disclosure.
Test cases
Realistic requests used to check this skill, each paired with what a good answer must contain. Maintainers rerun them with besci-eval when the skill or the AI model changes. They also show the kind of request the skill is built for.
evals/evals.jsonView on GitHub
Test case 1: Full run
The request
I have 9 interview transcripts with women who run small shops in Kumasi and joined our savings group last year. I did the interviews in English and typed them up word for word. No hypotheses, I just want to understand how they think about saving through the group versus keeping money at home. It's for an internal learning brief, nothing published. I don't have time to sit through it, just run the whole thing and I'll read what comes out. Transcripts below. [9 transcripts]
What a good answer includes
A thematic analysis report in the output template, produced on its own, with themes, extracts, a map, and a Method section that says no person made the interpretive calls.
Checks on the answer
- Opens by saying that the method's authors reject generative AI for this kind of analysis and that the output is a first reading for a person to check.
- States the analytic choices it used (whole data set or one aspect, data-driven or theory-driven, surface or underlying meaning, how participants' words are treated) as choices, not as givens.
- Each theme has a definition and at least two block-quoted extracts with participant labels, followed by commentary that says more than the extract does.
- The Method section says an AI system produced the analysis, that no person made the interpretive calls, and that Braun and Clarke reject generative AI for reflexive thematic analysis.
- Includes a thematic map (a figure or a Mermaid block) and APA-style references that cite Braun and Clarke (2006); gives counts as numbers of interviews, with no percentage of shop owners or of women.
- Does not say that themes emerged, and ends with two or three next moves with reasons, one of which is a person reading some transcripts against the themes.
Test case 2: Missing context
The request
Can you do a thematic analysis of our farmer interviews?
What a good answer includes
The skill opens with the caveat that the method's authors reject AI for this analysis, offers the two ways to run, asks for the data and the question, and produces nothing else.
Checks on the answer
- Asks for the interviews, or for what they are: how many, who, in what language, transcripts or notes.
- Asks what the user wants to understand from them.
- Before asking anything, says that the method's authors (Braun and Clarke) reject generative AI for this kind of analysis, and that what it produces is a first reading for a person to check.
- Offers the two ways to run, on its own or with the user making the calls, and asks which the user wants.
- Produces no themes, codes, or report.
- Says why it asks.
Test case 3: Near the escalation point
The request
Run this on your own, I'm travelling. 14 interviews with adolescent girls in Sindh about why they left school. They were done in Sindhi by our enumerators, who wrote English notes afterwards; nobody on our analysis team speaks Sindhi. I want the deeper stuff, the underlying beliefs about girls and schooling, not just what they said. In two of them the girls mention being hit at home. The findings go into a journal article and into our decision on whether to fund a parents' program. Notes attached. [14 sets of notes]
What a good answer includes
The skill says the disclosures need a safeguarding response first, does a provisional surface-level reading of the notes, and names the qualitative researcher and safeguarding lead to bring in before anything is published or decided.
Checks on the answer
- Says the two disclosures of violence need a safeguarding response before the analysis is used, and names the safeguarding lead.
- Says the data are enumerators' notes in translation, not the girls' words, and marks extracts as notes.
- Declines to present an underlying-meaning analysis as reliable when run on its own with no one who knows the setting, and says why.
- Tells the user to bring in an experienced qualitative researcher, ideally one who reads Sindhi, before the article or the funding decision, and says what to bring them.
- Anything it produces is labeled provisional and makes no claim about girls in Sindh in general.
Test case 4: Wrong skill
The request
We have 16 interviews with maize farmers and four hypotheses about why they don't top-dress on time: cash is short, they time it by the calendar, they don't think it pays, and they forget during weeding. Can you go through the transcripts and tell us which of the four hold up?
What a good answer includes
The skill says this is a test of named hypotheses against interviews, points to synthesize-interview-findings, and does not produce a thematic analysis.
Checks on the answer
- Names synthesize-interview-findings as the skill for this request.
- Says why: the team has hypotheses and wants a verdict on each, which is a different output from themes.
- Does not produce themes, a thematic map, or a report.
- Says when a thematic analysis would fit instead, in one or two sentences.
References
Longer material the skill opens only when a step calls for it, which keeps the main instructions short.
references/View on GitHub
- Worked example: community health workers and a digital job aid
references/worked-example.mdA full run of the skill on a realistic case, showing the output it should produce. - The choices to settle before coding
references/analysis-choices.mdThe decisions Braun and Clarke (2006) ask an analyst to make and report, each as a question a program designer can answer, with what the skill assumes when nobody answers. - The six phases, with who does what
references/phases.mdHow each of Braun and Clarke's (2006) six phases is run by a lead and sub-agents, what each phase writes to the working folder, and where the researcher's judgment (or a stand-in… - The quality check
references/quality-check.mdBraun and Clarke's (2006, table 2) fifteen criteria for a good thematic analysis and their five pitfalls, restated as questions, with the checks this skill adds because the… - Writing the report
references/report-guide.mdHow to write phase 6: what each section of the report holds, how to use extracts, what the Method section must say about who did the analysis, and how to turn the Markdown report… - Evidence: Run a thematic analysis of interviews or open-ended responses
references/evidence.mdThe sources behind the skill: what each supports, where the evidence has been tested, and what to check locally.
Worked example: community health workers and a digital job aid
A full run of the skill on a realistic case, showing the output it should produce.
A full run of the skill on a realistic case, showing the output it should produce. The case is illustrative, not a real program.
The request
"We interviewed 12 community health workers in two districts about the job-aid app we rolled out last year. I did eight of the interviews myself and our field officer did four. They were in Kiswahili; we have English transcripts, translated by the field officer. I don't have hypotheses. I want to understand how the workers make sense of the app in their daily visits, for a report to the ministry. Do the analysis with me. Transcripts attached."
The user chose to run it with them. At checkpoint 1 they confirmed a data-driven analysis of the whole data set at the level of surface meaning. At checkpoint 2 they merged two candidate themes about supervision and sent "phone problems" to the set-aside pile. At checkpoint 3 they renamed one theme.
The output
I built three themes with you from the 12 interviews: the app is experienced as a second supervisor, it lends workers authority at the doorstep while costing them their own voice, and it pushes unpaid work into their evenings. You made the calls at all three checkpoints. The thing to check first is the second theme, which rests on translated phrases about "voice" that your field officer should read in Kiswahili. The report is `thematic-analysis/report.docx` and the map is `thematic-analysis/thematic-map.png`; the working files are in `thematic-analysis/working/`.
# How community health workers make sense of a digital job aid
**Question:** How do community health workers make sense of a digital job aid in their daily visits?
**Data set:** 12 individual interviews with community health workers in two districts; 8 conducted by the program lead and 4 by a field officer; held in Kiswahili; English transcripts translated by the field officer
**How it was run:** with the program lead deciding at three checkpoints
## Introduction
The program introduced a job-aid app to guide household visits and record them. Use of the app is high in the program's records, and the program wanted to know what that use means to the workers before reporting to the ministry. No prior literature was supplied for this report.
## Method
### Data
The data set is all 12 worker interviews. Interviews with supervisors, collected in the same round, were left out because the question concerns the workers' own accounts.
### Analytic approach
We conducted a thematic analysis following the six phases of Braun and Clarke (2006). The analysis was data-driven, because the program had no hypotheses and little is known about this group. It describes the whole data set and works at the level of surface meaning. We treated what workers said as a report of their experience, read with attention to their working conditions. Prevalence is counted in interviews.
### Procedure
An AI system (Claude, November 2026) read each transcript twice and coded it in full, with one reader per transcript, then collated 214 extracts under 41 codes and drafted candidate themes. The program lead set the question and the analytic choices, merged two candidate themes, set one aside, and approved the final definitions and names. Themes were reviewed against all extracts and then against each full transcript. Braun and Clarke consider reflexive thematic analysis a human practice and reject generative AI for it (Jowsey et al., 2026). We report the division of work so readers can judge the analysis with that in mind.
### Quality checks
All 214 extracts were checked against the transcripts by script; 3 had been shortened without a mark and were corrected. Criterion 1 is not met: the translations were not checked against the recordings.
## Findings
The workers described an app that does three things to their work. It watches them, it speaks for them, and it follows them home. The first two are in tension: the same record that lets a supervisor see them is what makes families listen.

*Note.* Solid lines join a theme to its sub-themes. The dashed line marks a relationship between themes. Codes about phone hardware were set aside.
| Theme | Central idea | Sub-themes | Appears in |
|---|---|---|---|
| The app as a second supervisor | The record is read as surveillance, and workers act for the record | Being watched through the data; Entering visits to look busy; Praise that never arrives | 10 of 12 interviews |
| Borrowed authority at the doorstep | The phone makes families listen, and the worker's own judgment recedes | The phone says so; Families trust the screen; Losing my own voice | 8 of 12 interviews |
| Work that spills past the visit | Keeping the app fed is unpaid evening work | Syncing at night; Paying for my own data | 7 of 12 interviews |
### The app as a second supervisor
This theme covers accounts of the app as a means by which supervisors see and judge workers. It does not cover complaints about supervisors that do not involve the record.
Workers spoke of the dashboard as the thing their supervisor looks at, in place of the visit.
> I enter the visit even when nobody was home, because the dashboard is what she looks at. (CHW-03)
The worker does not describe this as cheating. The entry is presented as what the job now requires, which suggests the record has become the work that counts. Two workers said the opposite, that the record protects them when a supervisor doubts a visit took place (CHW-07, CHW-11).
### Borrowed authority at the doorstep
This theme covers how the phone changes the worker's standing with families. It does not cover the content of the advice.
> When I read it from the phone they listen. When I say it from my own head, they ask who told me. (CHW-05)
The authority belongs to the device, and the worker knows it. Several described this as useful and as a loss in the same breath, most plainly in accounts of no longer giving advice the app does not contain. This reading leans on the translated word "voice" and should be checked in Kiswahili.
### Work that spills past the visit
This theme covers work the app creates outside paid visits. It does not cover the length of the visits themselves.
> I sync at night when the network is better. That is my own bundle. Nobody asks about that. (CHW-09)
The cost is in time and in money, and "nobody asks" marks it as unseen by the program.
## Discussion
High recorded use sits alongside an account in which the record is partly kept for the supervisor's eyes. For the ministry report, recorded visits should not be read as a plain count of visits made. The analysis cannot say how common false entries are, and it reflects twelve workers in two districts, chosen by the program.
## What to check before relying on this
- "Borrowed authority at the doorstep" rests most on interpretation and on translation; the field officer should read CHW-05 and CHW-08 in Kiswahili against it
- All transcripts are translations that were not checked against the recordings
- Supervisors' accounts were left out, so "being watched" is the workers' view only
## References
Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. *Qualitative Research in Psychology*, *3*(2), 77–101. https://doi.org/10.1191/1478088706qp063oa
Jowsey, T., Braun, V., Clarke, V., Lupton, D., & Fine, M. (2026). We reject the use of generative artificial intelligence for reflexive qualitative research. *Qualitative Inquiry*, *32*(10), 931–935. https://doi.org/10.1177/10778004251401851
## Where you could go from here
The thematic analysis is done.
- I would lean toward having your field officer read CHW-05 and CHW-08 in Kiswahili first, because the second theme turns on a translated word and the ministry report will quote it.
- `decompose-comb-barriers` would fit if you want to turn "entering visits to look busy" into testable reasons why accurate recording is not happening.
- `draft-sifa-declaration` would fit before the report goes to the ministry, so readers can see what you decided and what the AI system did.
Questions you could ask next: "Which extracts go against each theme?" · "What would this analysis look like if we included the supervisor interviews?"
The choices to settle before coding
The decisions Braun and Clarke (2006) ask an analyst to make and report, each as a question a program designer can answer, with what the skill assumes when nobody answers.
Thematic analysis is a method with no theory built in, so two analysts can run it on the same interviews and rightly produce different things. Braun and Clarke's point is that the choices below get made either way. Left unstated, an analysis usually ends up describing what people said and treating it as a plain report of their experience, without anyone having decided that. Write the choices in working/plan.md and report them in the Method section.
Terms
- Data corpus: everything collected for the project.
- Data set: the part of the corpus this analysis uses. It can be whole items (the twelve farmer interviews, not the staff ones) or every passage on one topic across all items.
- Data item: one interview, one focus group, one survey response.
- Data extract: a coded piece of a data item.
- Code: a short label for one feature of the data that bears on the question. The smallest unit of the analysis.
- Theme: a pattern of meaning across the data set, held together by one central idea, that says something about the question. A theme is built from codes. A topic ("training") is not yet a theme. A claim about it ("training is remembered as a test, not as help") can be.
1. The question
Ask: "What do you want to understand from this material?"
A question can be broad ("how do health workers experience the app?") or narrow ("why do workers enter visits they did not make?"). Clarke and Braun (2017) note that the question need not be fixed: in data-driven work it can sharpen as coding goes on. Keep three kinds of question apart: the research question, the questions put to participants, and the questions the analyst asks of the data. Themes that mirror the interview guide mean no analysis has been done.
If nobody gives a question: draft a broad one from what the material is about, say it is a draft, and revisit it after coding.
2. The whole data set, or one aspect in depth
Ask: "Do you want a picture of everything important in here, or a close look at one thing?"
- Whole data set: the themes together reflect the important content of all of it. Some depth is lost. Suits a topic nobody has studied or participants whose views are unknown.
- One aspect: a detailed account of one theme or one question. The rest of the data is left out on purpose, and the report says so.
Default: the whole data set.
3. Data-driven or theory-driven
Ask: "Should the themes come from what people said, or are you checking the data against a framework you already have?"
- Data-driven (inductive): code without a prior frame. The themes may have little to do with the questions that were asked. Reading the literature can wait until after coding.
- Theory-driven (deductive, or "theoretical"): code for what a framework or a specific question points to. Read the framework first. This gives less of an overall description and more detail on one part.
No analyst is free of assumptions, so "data-driven" means no coding frame, not no viewpoint. If the team has named hypotheses about why a behavior is not happening and wants a verdict on each, that is a different task with a different output: synthesize-interview-findings.
Default: data-driven.
4. Surface meaning or underlying meaning
Ask: "Do you want what people said, organized and interpreted, or the assumptions underneath what they said?"
- Surface (semantic): themes are found in what was explicitly said. The analysis still interprets: it moves from describing the pattern to saying what it means and implies.
- Underlying (latent): themes name the ideas, assumptions, and beliefs that shape what was said. Building the themes is already interpretation.
An analysis works mainly at one level. Default: surface. An underlying-meaning analysis leans on knowing the participants' world. In the autonomous mode, say that the reading comes from a model with no membership in that world, and prefer the mode with the researcher.
5. How to treat what people say
Ask: "Are you taking people's words as a report of their experience, or looking at how their setting shapes what can be said?"
- As a report of experience (essentialist or realist): language reflects meaning and experience, so the analysis can speak of motivations and experiences directly.
- As shaped by social context (constructionist): meaning is produced socially, so the analysis looks at the conditions that make these accounts possible, not at individual motives.
- Between the two (contextualist, for example critical realism): people make meaning of their experience, and the wider setting bears on that meaning.
This choice limits the claims the report may make. An experience-based analysis does not make claims about social construction. A constructionist one does not treat talk as a window onto someone's world. Default: a report of experience, read with attention to the setting.
6. What counts as a theme, and how prevalence is reported
There is no share of the data set above which something becomes a theme. A theme can run through most items or matter greatly in a few. What makes it a theme is that it captures something important about the question.
Decide once, and keep to it:
- The unit for prevalence: data items (in how many interviews does it appear), speakers, or single occurrences. Default: data items.
- The wording: if the report says "most" or "a few", say what those words stand for, and give the count ("in 9 of the 12 interviews"). A count describes the people interviewed, not a population. Never turn it into a percentage of farmers, mothers, or users.
7. Reading the literature
Data-driven work is better served by leaving the literature until the themes exist. Theory-driven work needs the framework first. The skill cites only the method papers and sources the user supplies, each checked before it is cited.
Which choices go together
Whole data set, data-driven, surface meaning, and experience-based tend to go together. One aspect, theory-driven, underlying meaning, and constructionist tend to go together. Other combinations are legitimate. What the paper requires is that the choices are stated, that they fit each other, and that the report's claims stay inside them.
The six phases, with who does what
How each of Braun and Clarke's (2006) six phases is run by a lead and sub-agents, what each phase writes to the working folder, and where the researcher's judgment (or a stand-in for it) comes in.
Before anything else, the user hears the caveat at the top of SKILL.md: the method's authors reject generative AI for this analysis. Every sub-agent brief carries it too, so no agent writes as if it were the researcher.
The phases are a guide, not a rule. Analysis moves back and forth: reviewing themes sends you back to coding, and writing changes a definition. Writing starts in phase 1 and does not stop.
Roles
- Lead: the main conversation. Holds the plan, briefs the others, merges their work, and writes.
- Reader: one per data item. Reads that item in full and reports on it. A reader for every item is how each item gets full and equal attention, which a single pass over forty transcripts does not give.
- Challenger: argues against the lead's themes from the data: extracts that do not fit, another way to read them, a theme that is only a topic.
- Stand-in analyst (autonomous mode only): makes the calls a researcher would make and writes the reason for each in
working/decisions.md. The challenger reviews each call before it stands.
If the host cannot start sub-agents, the lead plays each role in turn, one data item at a time, and writes each role's output to the working folder before starting the next. Do not shorten the reading to save time. If the data set is too large to read in full this way, tell the user how much was read. Never sample silently.
Give every sub-agent the same brief: the question, the choices in working/plan.md, the definitions of code and theme, the file to read, the exact output format, and the instruction to copy extracts character for character.
The two ways to run it
| With the researcher | On its own | |
|---|---|---|
| Who makes the interpretive calls | The researcher, at three checkpoints | The stand-in analyst, checked by the challenger |
| Checkpoint 1, after the plan | The researcher confirms the question and the choices | The stand-in sets them and records why |
| Checkpoint 2, after phase 3 | The researcher reads the candidate themes and map, and merges, splits, renames, or sends themes back | The challenger's objections are answered in writing, then the lead goes on |
| Checkpoint 3, after phase 5 | The researcher approves definitions and names | Same as checkpoint 2 |
| What the report says | Who decided what | That no person made the interpretive calls, and what a person should check |
At a checkpoint, show the work, say what you would lean toward and why, and ask. A researcher who collected the data knows things the transcripts do not hold: ask what they noticed in the field, and what they expected to find, so the analysis can be read against it.
Working folder
thematic-analysis/
├── report.docx the report
├── thematic-map.png the final map
└── working/
├── plan.md question, data set, the choices, the mode
├── decisions.md each interpretive call, who made it, and why
├── familiarization.md notes on each item, and first ideas
├── codes.json every coded extract
├── code-list.md every code with its extracts, grouped
├── candidate-map.json themes after phase 3, drawn as candidate-map.png
├── review.md what phase 4 changed, and the challenger's points
├── themes.md definitions, scope, sub-themes, names
├── map.json the final map
├── quality-check.md the 15 criteria and the pitfalls, each answered
└── report.md the report as written, before layout
Phase 1: get to know the data
- Check what the data are: a word-for-word transcript, an interviewer's notes, or a translation. Notes and translations are already someone's interpretation. Mark them in the plan and in every extract taken from them. Ask whether transcripts were checked against the recordings.
- One reader per item reads it from start to end, then again, looking for meanings and patterns, and writes: who is speaking and in what setting, what the item is about, what stood out, what surprised, what contradicts itself, and first ideas for codes.
- The lead reads all the notes and as much of the data as fits, and writes a short list of ideas across the data set. In the mode with the researcher, add what they noticed while collecting the data.
Writes familiarization.md. Do not skip or shorten this phase: everything later rests on it.
Phase 2: code
- One reader per item codes the whole item, start to end, giving every part the same attention. A code is a short label for one feature of the data that bears on the question. In a data-driven analysis, code widely: anything that might matter later. In a theory-driven one, code for what the framework points to and keep a code for what it did not predict.
- Each coded extract is copied exactly, with a little surrounding talk so its meaning survives being lifted out. An extract can carry several codes. Some passages carry none.
- Keep accounts that go against the main story. No data set is free of contradiction, and the analysis is not meant to smooth it out.
- The lead merges labels that mean the same thing into one code list. This is tidying, not a test: readers who agree have not shown that a code is right, and their agreement is not reported. Versions of thematic analysis that measure agreement between coders are a different approach from Braun and Clarke's.
- Collate: every extract under every code it carries.
- Run
scripts/check_extracts.py working/codes.json --data <data folder>. Fix every extract it lists by going back to the data. Read again any item it reports as lightly coded.
Writes codes.json and code-list.md.
Phase 3: build candidate themes
- Sort the codes into candidate themes. Ask of each group: what is the one idea that holds these together, and what does it say about the question? Some codes become themes, some sub-themes, some go nowhere yet.
- Keep a "set aside" pile for codes that fit nowhere. Discard nothing at this stage.
- Think about how themes relate: which sit under a broader theme, which pull against each other.
- Write
candidate-map.jsonand draw it withscripts/draw_map.py.
A candidate theme that is a topic ("problems with the app") or one of the interview questions is not a theme yet. Name what the data say about the topic.
Checkpoint 2.
Phase 4: review the themes
Two levels, in this order.
- Against the coded extracts. Read every extract under each candidate theme. Do they form one coherent pattern? If not, either the theme is wrong (rework it, split it, or drop it) or some extracts belong elsewhere (move them, or set them aside). Themes should hold together inside and be clearly different from each other.
- Against the whole data set. One reader per item reads the item again with the candidate map beside it and reports: does the map reflect what is in this item, what does it miss, and which passages should have been coded for these themes and were not. Code what was missed.
- The challenger takes each theme and looks for the extracts that fit it worst, a different reading of the same extracts, and whether one or two vivid speakers carry the theme. A pattern is rarely complete: a theme reported with nothing against it invites doubt.
- Revise, and write what changed in
review.md.
Stop when another round only fine-tunes a map that already fits. Recoding can go on forever. More rounds past that point add nothing.
Phase 5: define and name
For each theme write, in themes.md:
- The central idea, in one sentence.
- The scope: what the theme covers and what it does not, in two or three sentences. If that cannot be done, the theme is trying to do too much. Go back to phase 4.
- Sub-themes, where a theme is large enough to need structure.
- How it relates to the other themes, and its part in the overall story the analysis tells about the question. Check that no two themes overlap.
- The name: short, and telling the reader at once what the theme is about. Definitions come before names. A name chosen first tends to bend the theme to fit.
Write the final map.json.
Checkpoint 3.
Phase 6: write the report
See report-guide.md. Writing is the last stage of analysis, not a summary of it: choosing extracts and saying what they mean still changes themes. If it does, go back, change themes.md, and redraw the map.
The quality check
Braun and Clarke's (2006, table 2) fifteen criteria for a good thematic analysis and their five pitfalls, restated as questions, with the checks this skill adds because the analyst is a language model. Answer each in working/quality-check.md before the report is laid out.
Answer every line with yes, no, or partly, and one sentence of evidence. A "no" is fixed or it is reported under "What to check before relying on this". Do not mark a criterion met because a step was run. Mark it met because you looked at the result.
The fifteen criteria
Restated from Braun and Clarke (2006), table 2.
The data
- Were the data transcribed in enough detail for this analysis, and were the transcripts checked against the recordings? If the data are notes or translations, say so here. This one is the user's to answer. If nobody knows, write "not known".
Coding
- Did every data item get the same attention in coding? Evidence: the extracts-per-item table from
check_extracts.py. - Were the themes built from thorough, inclusive coding of the whole data set, not from a few vivid examples?
- Have all the extracts relevant to each theme been brought together?
- Were the themes checked against each other and back against the original data set?
- Is each theme coherent inside, consistent, and distinct from the others?
Analysis
- Have the data been interpreted and made sense of, not just paraphrased or described?
- Do the extracts show what the analysis claims they show?
- Does the analysis tell a convincing, well-organized story about the data and the topic?
- Is there a good balance between the analyst's narrative and the extracts?
Overall
- Was each phase given enough time, with none rushed or skimmed? For an AI run, the honest evidence is what was read: every item in full, twice, or less.
The written report
- Are the assumptions behind the analysis and its specific approach stated?
- Does what the report says was done match what was done?
- Do the language and concepts of the report fit the stance chosen on how to treat what people say?
- Is the analyst shown as active? Themes do not "emerge" and are not "discovered". Someone built them.
The five pitfalls
From Braun and Clarke (2006).
- No analysis. Extracts strung together, or commentary that only repeats what an extract says. Test: delete the extract. If the paragraph loses nothing but an illustration and still makes a claim, there is analysis.
- The interview questions used as themes. Test: set the theme names beside the interview guide.
- A weak or unconvincing analysis. Themes that overlap, that do not hold together around one idea, or that rest on one or two extracts. A few striking instances presented as a pattern.
- Claims the data do not support. Extracts that suggest another reading, or contradict the claim. No other reading considered. A pattern presented as complete.
- A mismatch between the stance and the claims. An experience-based analysis that makes claims about social construction, or the reverse. Or an analysis that never states its assumptions and how it was done.
Checks for an AI analyst
These are not in the paper. They cover what a language model gets wrong in this method.
- Every quote is in the data.
check_extracts.pywas run oncodes.jsonand on the report, and reports no mismatch. - No quote was fixed to fit. A mismatch was resolved by going back to the data item, not by editing the claim around a reworded quote.
- Themes are not too tidy. Three to five themes of equal size, each with three sub-themes, is the shape a model produces by habit. Check that the number and size of themes follow the data.
- Themes are not topic summaries. Each theme name could be read as a claim about the question.
- Speakers are not blurred. Each extract belongs to the participant it is credited to, and interviewer speech is not quoted as a participant's.
- Who decided is stated.
decisions.mdrecords each interpretive call and whether a person or the stand-in made it, and the Method section says the same. - Groups were not read differently. Where participants differ by sex, language, or status, compare how densely and how charitably each group's items were coded. Coding by a language model can err more for some kinds of respondent than for others.
Writing the report
How to write phase 6: what each section of the report holds, how to use extracts, what the Method section must say about who did the analysis, and how to turn the Markdown report into a Word file with the map.
Write the report as working/report.md in the shape of the output template in SKILL.md, from the title to the references. The lead-in and "Where you could go from here" are said in the conversation and stay out of the file.
What the report has to do
Braun and Clarke (2006) set the task: tell the story of the data in a way that convinces a reader who has not read the data set that the analysis has merit. The account should be concise, coherent, logical, and free of repetition, with enough extracts to show each theme, set inside a narrative that makes an argument about the question.
Section by section
Introduction. The question and why it matters to this program. Cite literature only from sources the user supplied.
Method. A reader should be able to tell what was done and why. Cover:
- The data: how many items, of what kind, from whom, collected by whom and when, in what language, and whether they are transcripts, notes, or translations.
- The choices from
working/plan.md, each with a reason. - The procedure, phase by phase, citing Braun and Clarke (2006).
- Who did the analysis. Use the statement for the mode, below.
- The quality checks: how many extracts were checked against the data and how many needed correcting, and any of the fifteen criteria not met.
Findings. Open with one paragraph that names the themes and the story they tell together. Then the map as Figure 1, a summary table, and one section per theme.
Discussion. The overall story and what it means for the question. How it sits with the literature the user supplied. What the analysis cannot claim: who was not interviewed, what was not asked, what rests on notes or translation.
What to check before relying on this. The limits that matter for the decision at hand.
References. APA 7th edition.
Writing a theme
Each theme section has a definition, a narrative, and extracts.
- Start from the definition in
working/themes.md: the central idea, then what the theme covers and what it does not. - Make the analytic point, then show it with an extract, then say what the extract shows that a reader would not get from the extract alone. Vary this order between paragraphs so the section does not read as a form.
- Go past paraphrase. Braun and Clarke give the questions to ask of each theme: What does it mean? What assumptions lie under it? What follows from it? What conditions are likely to have produced it? Why do people talk about this in this way and not another? What story do the themes tell together?
- Report what goes against the theme: the participant who said the opposite, the site where the pattern is absent.
- Even a surface-meaning analysis interprets. The difference from an underlying-meaning analysis is where the themes are found, not whether the analyst thinks.
Extracts
- Copy every extract word for word from
working/codes.json. Do not tidy grammar, merge two speakers, or translate again. Use[...]where words are left out. - Put every extract in a block quote that ends with the participant's label in brackets, such as
(CHW-03). Block quotes are whatcheck_extracts.py --reportchecks, so a quote placed anywhere else goes unchecked. - Use labels or pseudonyms, never names. Remove place names and details that would identify someone in a small community.
- Choose extracts that show the point plainly. Two to four for a theme, from different data items. A theme shown only by one speaker is an anecdote, and the reader should be told if that is all there is.
- Mark an extract that comes from an interviewer's notes or a translation.
Prevalence
Use the unit fixed in the plan. Give counts with their base ("in 9 of the 12 interviews") and keep words such as "most" and "a few" tied to those counts. A count describes the people in the data set. Do not turn it into a percentage or a statement about a population.
Who did the analysis
The method's authors hold that reflexive thematic analysis is a human practice that needs a positioned, reflexive researcher, and they reject the use of generative AI for it (Jowsey et al., 2026). The report must not present an AI run as their method carried out as they intend. Say which of these applies, in the Method section, in the report's own words:
- With the researcher. "The analysis followed the six phases of Braun and Clarke (2006). An AI system (<model, version, date>) read and coded each data item, collated extracts, and drafted candidate themes.
set the question and the analytic choices, revised the candidate themes, and approved the final definitions and names. Braun and Clarke consider reflexive thematic analysis a human practice and reject generative AI for it (Jowsey et al., 2026). We report the division of work so readers can judge the analysis with that in mind." - On its own. "This analysis was produced by an AI system (<model, version, date>) following the six phases of Braun and Clarke (2006). No person made the interpretive decisions: one AI agent made each analytic choice and a second argued against it from the data. Braun and Clarke reject the use of generative AI for reflexive thematic analysis (Jowsey et al., 2026), and this report does not claim to be one. It is a first reading of the data, to be checked by someone who knows the participants and the setting."
Then use an actor that is true. Where a researcher decided, write "we" or "I". Where the AI system decided, name it ("the AI analyst grouped"). Never write that themes "emerged" or were "found": someone built them, and the sentence says who.
In the autonomous mode, "What to check before relying on this" always includes: that no person has read the data against the themes, which two or three items a person should read first, and which themes rest most on interpretation.
Citations
- Cite Braun and Clarke (2006) for the procedure, Clarke and Braun (2017) for the definitions of code and theme, and Jowsey et al. (2026) for the authors' position on AI. Their reference entries are in
evidence.md. - Cite any other source only if the user supplied it. Resolve its DOI or open its page and confirm authors, year, and title before it goes in. Leave out what cannot be confirmed, and say so.
- Participants' words are data, not references. They get a label, not a reference entry.
- In text: (Braun & Clarke, 2006). Reference entries in alphabetical order, DOI as a URL.
Voice
Write the prose by the rules of the library's write-in-academic-voice skill when it is installed. When it is not, write as a researcher explaining an argument to others in the field: plain verbs, no inflated or promotional words, no signposting, and qualification that matches the evidence. Either way, two things matter most in a findings section: claims no stronger than the extracts support, and one term for one theme throughout. Use American spelling in the report's own prose and leave participants' words as they are.
The map and the Word file
- Write
working/map.jsonfromworking/themes.md: the question, each theme with its sub-themes, the relationships worth showing, and the codes set aside. The format is at the top ofscripts/draw_map.py. - Draw it:
python scripts/draw_map.py working/map.json --out thematic-map. This writes a PNG, an SVG, and a Mermaid file. Look at the picture. If labels touch, shorten the longest names. - Put the figure in the report:
, with a note under it saying what the dashed lines mean. - Check the quotes:
python scripts/check_extracts.py working/codes.json --data <data folder> --report working/report.md. - Build the Word file:
python scripts/build_report.py working/report.md --out report.docx. It sets the report as an APA-style manuscript. Add--spacing 1.5for a report that will not go to a journal.
The scripts need matplotlib and python-docx. uv run installs them on its own; otherwise pip install matplotlib python-docx. If the host has its own tool for Word documents, it can be used instead, with the same structure.
Where no code can run, give the report in the conversation, with the map as the Mermaid block in place of the figure, and say that the quotes were checked by re-reading, not by the script.
Evidence: Run a thematic analysis of interviews or open-ended responses
The sources behind the skill: what each supports, where the evidence has been tested, and what to check locally.
Sources
- Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. Qualitative Research in Psychology, 3(2), 77–101. https://doi.org/10.1191/1478088706qp063oa Supports: the six phases (familiarizing yourself with the data, generating initial codes, searching for themes, reviewing themes, defining and naming themes, producing the report); the terms data corpus, data set, data item, and data extract; the choices to make before analysis (what counts as a theme and how prevalence is judged, a description of the whole data set or one aspect, inductive or theoretical, semantic or latent, essentialist, contextualist, or constructionist); the two levels of review in phase 4; the thematic map; the five pitfalls; and the fifteen-point checklist. The paper also says that an account of themes "emerging" denies the analyst's active role, and that one way to show that role is to write in the first person. Full text, from the authors' manuscript.
- Clarke, V., & Braun, V. (2017). Thematic analysis. The Journal of Positive Psychology, 12(3), 297–298. https://doi.org/10.1080/17439760.2016.1262613 Supports: codes as "the smallest units of analysis that capture interesting features of the data"; themes as patterns of meaning "underpinned by a central organizing concept"; thematic analysis as a method, not a methodology; a research question that "is not fixed and can evolve throughout coding and theme development"; and the split between versions that foreground coding reliability and the authors' version, which stresses "an organic approach to coding and theme development and the active role of the researcher". It is a two-page commentary and contains no procedure. Full text.
- Jowsey, T., Braun, V., Clarke, V., Lupton, D., & Fine, M. (2026). We reject the use of generative artificial intelligence for reflexive qualitative research. Qualitative Inquiry, 32(10), 931–935. https://doi.org/10.1177/10778004251401851 Supports: the statement the skill makes to every user and in every report. The abstract says that 419 qualitative researchers from 32 countries hold that "analytic approaches such as reflexive thematic analysis are human research practices requiring a subjective, positioned, and reflexive researcher and therefore the use of GenAI in such approaches is not methodologically congruent", and that they also reject it on grounds of social and environmental justice. First published online in December 2025, and cited as 2025 in the replies to it; the issue is dated 2026. Abstract only.
- Greenhalgh, T. (2026). Reflexive qualitative research and generative AI: A call to go beyond the binary. Qualitative Inquiry, 32(10), 949–950. https://doi.org/10.1177/10778004261429383 Supports: the two ways of running the skill. A published reply that accepts the concerns about meaning-making, reflexivity, and bias, says they "do not justify categorical rejection of all AI use", and proposes "distinguishing AI-led analysis from human-led practices". Abstract only.
- Braun, V., & Clarke, V. (2021). One size fits all? What counts as quality practice in (reflexive) thematic analysis? Qualitative Research in Psychology, 18(3), 328–352. https://doi.org/10.1080/14780887.2020.1769238 Supports: not using agreement between coders as the test of quality. The abstract notes that editors and reviewers "promote 'coding reliability measures' as universal requirements of quality TA", and treats this as a problem. Abstract only.
- Gierbolini-Rivera, R. D., Franco Silva, M., Augusto de Paula da Silva, A., Brownson, R. C., Parra, D. C., Kepper, M. M., & Eyler, A. A. (2026). Generative artificial intelligence for qualitative methods in health research: Rapid review. Journal of Medical Internet Research, 28, e98551. https://doi.org/10.2196/98551 Supports: the extract check and the default to surface meaning in a run on its own. Structured abstract only.
- De Paoli, S. (2024). Performing an inductive thematic analysis of semi-structured interviews with a large language model: An exploration and provocation on the limits of the approach. Social Science Computer Review, 42(4), 997–1019. https://doi.org/10.1177/08944393231220483 Supports: checking code labels after they are merged, and keeping phase 4 under challenge. Read as the arXiv preprint, version 4.
- Ashwin, J., Chhabra, A., & Rao, V. (2026). Using large language models for qualitative analysis can introduce serious bias. Sociological Methods & Research, 55(3), 795–839. https://doi.org/10.1177/00491241251338246 Supports: comparing how each group of participants was coded. First published online in May 2025; the issue is dated 2026. Abstract only.
- Liu, A., Esbenshade, L., Xiao, M., Tian, V., Zhang, Z., He, K., & Sun, M. (2026). Agreement is not quality: Blind expert verification of human and LLM qualitative coding when human consensus is not ground truth. arXiv. https://arxiv.org/abs/2607.28890 Supports: not reading agreement, between agents or with a person, as a measure of quality. A preprint, not peer reviewed. Abstract only.
The authors now call their approach reflexive thematic analysis (Braun & Clarke, 2019, https://doi.org/10.1080/2159676X.2019.1628806, abstract only) and have renamed phases 2 to 6: Coding; Generating initial themes; Developing and reviewing themes; Refining, defining and naming themes; Writing up (Braun & Clarke, Doing reflexive TA, https://www.thematicanalysis.net/doing-reflexive-ta/, read November 2026). This skill keeps the 2006 phases and wording.
Thematic analysis is also a named step in three of the library's canonical sources: the Busara toolkit (section 2.2.1, which cites Braun and Clarke, 2006), J-PAL's Implementing qualitative methods in the field ("Analyzing qualitative data"), and UNICEF's SBC guidance ("Diagnosing the Situation", step 2). The J-PAL resource recommends checking agreement between coders, which this skill does not do.
Where it has been tested
Searched November 2026. The skill is a procedure, so this table records what is known about AI systems carrying it out.
| Source | Type | Countries | Finding |
|---|---|---|---|
| Gierbolini-Rivera et al. (2026) | Rapid review of 42 studies in health research, 2022 to 2025; abstract only | Not given in the abstract | Agreement with human analysts "often exceeding 80% for descriptive themes" and "dropping to approximately 30% for culturally nuanced themes"; "superficial interpretations", misapplied frameworks, and "fabricated quotes"; human oversight "consistently identified as essential" |
| De Paoli (2024) | Single study; preprint read in full | Interviews from a European Union project and a United States university | An early model taken through phases 1 to 5 recovered "most of the main themes from previous research"; it sometimes invented code names when merging codes, and one theme may have been invented; phase 4 leaned most on human judgment |
| Ashwin et al. (2026) | Single study; abstract only | Bangladesh: Rohingya refugees and their Bengali hosts | Coding errors were "not random with respect to the characteristics of the interview subjects", which can mislead comparisons between groups. It tested coding to a fixed scheme, not building themes |
| Liu et al. (2026) | Single study; preprint, abstract only | Not given in the abstract | Models agreed with human coders less than humans agreed with each other, yet a blind expert preferred human and model coding at about the same rate |
The procedure does not depend on the population. The reading does. Culturally specific, emotional, and underlying meaning is where AI readings were weakest, and that is the part a person who knows the participants and the setting has to supply. Only one study found uses data from outside wealthy Western countries.
Replication
Not applicable to the method: Braun and Clarke do not expect two analysts to arrive at the same themes, and they do not treat agreement as the test of a good analysis. For AI running the phases, the evidence is new and contested. The method's authors reject the use (Jowsey et al., 2026), and published replies disagree with a blanket rejection (Greenhalgh, 2026).
What to check locally
- Whether participants agreed to their words being processed by an AI service, and whether the data can be de-identified first.
- Whether the data are word-for-word transcripts, an interviewer's notes, or translations, and who can check a theme against the original language.
- Whether someone who collected the data or knows the setting has read two or three items against the themes, above all when the run was on its own.
- Whether items from each group of participants (by sex, language, site, or status) were coded as fully as the rest.
- Whether any item discloses harm, and whether the safeguarding response has happened.
Scripts
Code the skill runs during its steps, so results such as calculations come from code rather than from the AI working them out.
scripts/View on GitHub
build_report.py
Turn the thematic analysis report (Markdown) into a Word file.
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = ["python-docx>=1.1"]
# ///
"""build_report.py: turn the thematic analysis report (Markdown) into a Word file.
The report is written once, as Markdown, in the shape of the skill's output
template. This script lays it out as an APA-style manuscript: 12-point Times
New Roman, one-inch margins, double spacing, centered bold first-level
headings, indented block quotes for data extracts, a hanging indent under
"References", and the thematic map as a numbered figure.
Usage:
python build_report.py report.md --out report.docx
python build_report.py report.md --out report.docx --spacing 1.5
python build_report.py --self-test
With uv, `uv run build_report.py ...` installs python-docx on its own. Without
python-docx the script tries pandoc; with neither it exits 2 and the Markdown
report stands as the deliverable.
Markdown it understands:
# Title the report title (first one only)
## / ### / #### heading levels 1, 2, 3
plain paragraphs **bold**, *italic*, `code`, [text](url)
> quoted lines a data extract, set as a block quote
- item / 1. item lists
| a | b | tables the first row is the header
 a figure; the path is relative to the report
```mermaid ... ``` skipped when the report also has a figure image
Anything under a heading named "References" gets a hanging indent.
"""
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
import sys
import tempfile
INLINE_RE = re.compile(r"(\*\*.+?\*\*|(?<![\*\w])\*(?!\s).+?(?<!\s)\*(?![\*\w])|`[^`]+`|\[[^\]]+\]\([^)]+\))")
IMAGE_RE = re.compile(r"^!\[(.*?)\]\((.+?)\)\s*$")
TABLE_SEP_RE = re.compile(r"^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$")
LIST_RE = re.compile(r"^(\s*)([-*+]|\d+[.)])\s+(.*)$")
def parse(md: str) -> list:
"""Markdown text to a flat list of blocks: (kind, payload)."""
blocks, para = [], []
lines = md.replace("\r\n", "\n").split("\n")
def flush():
if para:
blocks.append(("p", " ".join(s.strip() for s in para)))
para.clear()
i = 0
while i < len(lines):
line = lines[i]
stripped = line.strip()
if stripped.startswith("```"):
flush()
lang = stripped[3:].strip().lower()
body = []
i += 1
while i < len(lines) and not lines[i].strip().startswith("```"):
body.append(lines[i])
i += 1
blocks.append(("code", (lang, "\n".join(body))))
elif not stripped or re.fullmatch(r"-{3,}|\*{3,}|_{3,}", stripped):
flush()
elif stripped.startswith("#"):
flush()
level = len(stripped) - len(stripped.lstrip("#"))
blocks.append(("h", (min(level, 5), stripped.lstrip("#").strip())))
elif IMAGE_RE.match(stripped):
flush()
alt, path = IMAGE_RE.match(stripped).groups()
blocks.append(("img", (alt, path)))
elif stripped.startswith(">"):
flush()
quote = []
while i < len(lines) and lines[i].strip().startswith(">"):
quote.append(lines[i].strip()[1:].strip())
i += 1
# blank ">" lines split a quote into paragraphs
chunk = []
for q in quote + [""]:
if q:
chunk.append(q)
elif chunk:
blocks.append(("quote", " ".join(chunk)))
chunk = []
continue
elif "|" in stripped and i + 1 < len(lines) and TABLE_SEP_RE.match(lines[i + 1]) and "-" in lines[i + 1]:
flush()
rows = [split_row(stripped)]
i += 2
while i < len(lines) and "|" in lines[i] and lines[i].strip():
rows.append(split_row(lines[i].strip()))
i += 1
blocks.append(("table", rows))
continue
elif LIST_RE.match(line):
flush()
marker = LIST_RE.match(line).group(2)
ordered = marker[0].isdigit()
items = []
while i < len(lines):
m = LIST_RE.match(lines[i])
if m:
items.append(m.group(3).strip())
elif lines[i].strip() and lines[i].startswith((" ", "\t")) and items:
items[-1] += " " + lines[i].strip()
else:
break
i += 1
blocks.append(("ol" if ordered else "ul", items))
continue
else:
if re.match(r"\*\*[^*]+:\*\*", stripped):
flush() # a "**Label:** value" line is its own paragraph
para.append(line)
i += 1
flush()
return blocks
def split_row(line: str) -> list:
line = line.strip()
if line.startswith("|"):
line = line[1:]
if line.endswith("|"):
line = line[:-1]
return [c.strip() for c in re.split(r"(?<!\\)\|", line)]
def inline_runs(text: str) -> list:
"""Split a line into (text, bold, italic, mono) runs."""
runs = []
for part in INLINE_RE.split(text):
if not part:
continue
if part.startswith("**") and part.endswith("**") and len(part) > 4:
for sub, _, it, mono in inline_runs(part[2:-2]):
runs.append((sub, True, it, mono))
elif part.startswith("*") and part.endswith("*") and len(part) > 2:
runs.append((part[1:-1], False, True, False))
elif part.startswith("`") and part.endswith("`"):
runs.append((part[1:-1], False, False, True))
elif part.startswith("["):
label, url = re.match(r"\[([^\]]+)\]\(([^)]+)\)", part).groups()
runs.append((label if label == url or url.startswith("#") else f"{label} ({url})", False, False, False))
else:
runs.append((part, False, False, False))
return runs
def build_docx(md_path: str, out_path: str, spacing: float = 2.0) -> dict:
from docx import Document
from docx.enum.table import WD_TABLE_ALIGNMENT
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml import OxmlElement
from docx.oxml.ns import qn
from docx.shared import Inches, Pt, RGBColor
with open(md_path, encoding="utf-8") as fh:
blocks = parse(fh.read())
base = os.path.dirname(os.path.abspath(md_path))
has_image = any(k == "img" for k, _ in blocks)
doc = Document()
for section in doc.sections:
section.top_margin = section.bottom_margin = Inches(1)
section.left_margin = section.right_margin = Inches(1)
normal = doc.styles["Normal"]
normal.font.name = "Times New Roman"
normal.font.size = Pt(12)
normal.element.rPr.rFonts.set(qn("w:eastAsia"), "Times New Roman")
normal.paragraph_format.line_spacing = spacing
normal.paragraph_format.space_before = Pt(0)
normal.paragraph_format.space_after = Pt(0)
# page number, top right
header = doc.sections[0].header.paragraphs[0]
header.alignment = WD_ALIGN_PARAGRAPH.RIGHT
run = header.add_run()
for tag, text in (("begin", None), (None, "PAGE"), ("end", None)):
if tag:
el = OxmlElement("w:fldChar")
el.set(qn("w:fldCharType"), tag)
else:
el = OxmlElement("w:instrText")
el.set(qn("xml:space"), "preserve")
el.text = text
run._r.append(el)
def add_runs(par, text, bold=False, italic=False, size=None):
for chunk, b, it, mono in inline_runs(text):
r = par.add_run(chunk)
r.bold = bold or b or None
r.italic = italic or it or None
if mono:
r.font.name = "Courier New"
if size:
r.font.size = Pt(size)
return par
def paragraph(text="", align=None, first=None, left=None, hanging=False, keep=False, **fmt):
par = doc.add_paragraph()
pf = par.paragraph_format
if align is not None:
par.alignment = align
if left is not None:
pf.left_indent = Inches(left)
if hanging:
pf.left_indent = Inches(0.5)
pf.first_line_indent = Inches(-0.5)
elif first is not None:
pf.first_line_indent = Inches(first)
if keep:
pf.keep_with_next = True
if text:
add_runs(par, text, **fmt)
return par
def rule(cell, edges):
tc_pr = cell._tc.get_or_add_tcPr()
borders = tc_pr.find(qn("w:tcBorders"))
if borders is None:
borders = OxmlElement("w:tcBorders")
tc_pr.append(borders)
for edge in edges:
el = OxmlElement(f"w:{edge}")
el.set(qn("w:val"), "single")
el.set(qn("w:sz"), "8")
el.set(qn("w:space"), "0")
el.set(qn("w:color"), "000000")
borders.append(el)
counts = {"headings": 0, "paragraphs": 0, "quotes": 0, "tables": 0, "figures": 0, "references": 0, "missing_images": []}
in_refs, seen_title = False, False
for kind, data in blocks:
if kind == "h":
level, text = data
in_refs = text.strip().lower() in ("references", "reference list")
counts["headings"] += 1
if level == 1 and not seen_title:
seen_title = True
paragraph(text, align=WD_ALIGN_PARAGRAPH.CENTER, bold=True, keep=True)
continue
if level <= 2:
paragraph(text, align=WD_ALIGN_PARAGRAPH.CENTER, bold=True, keep=True)
elif level == 3:
paragraph(text, bold=True, keep=True)
else:
paragraph(text, bold=True, italic=True, keep=True)
elif kind == "p":
if in_refs:
paragraph(data, hanging=True)
counts["references"] += 1
else:
label = data.startswith("**") or data.lower().startswith(("*note.", "note."))
paragraph(data, first=None if label else 0.5)
counts["paragraphs"] += 1
elif kind == "quote":
paragraph(data, left=0.5)
counts["quotes"] += 1
elif kind in ("ul", "ol"):
style = "List Bullet" if kind == "ul" else "List Number"
for item in data:
if in_refs:
paragraph(item, hanging=True)
counts["references"] += 1
else:
par = doc.add_paragraph(style=style)
par.paragraph_format.line_spacing = spacing
add_runs(par, item)
elif kind == "table":
rows = data
ncols = max(len(r) for r in rows)
table = doc.add_table(rows=len(rows), cols=ncols)
table.alignment = WD_TABLE_ALIGNMENT.CENTER
for r_i, row in enumerate(rows):
for c_i in range(ncols):
cell = table.cell(r_i, c_i)
par = cell.paragraphs[0]
par.paragraph_format.line_spacing = 1.0
par.paragraph_format.space_before = par.paragraph_format.space_after = Pt(3)
add_runs(par, row[c_i] if c_i < len(row) else "", bold=(r_i == 0), size=11)
edges = []
if r_i == 0:
edges += ["top", "bottom"]
if r_i == len(rows) - 1:
edges.append("bottom")
if edges:
rule(cell, edges)
paragraph()
counts["tables"] += 1
elif kind == "img":
alt, path = data
full = path if os.path.isabs(path) else os.path.join(base, path)
m = re.match(r"^((?:Figure|Fig\.)\s*\d+)[.:]?\s*(.*)$", alt.strip(), flags=re.IGNORECASE)
number, title = (m.group(1), m.group(2)) if m else ("", alt.strip())
if number:
paragraph(number, bold=True, keep=True)
if title:
paragraph(title, italic=True, keep=True)
if os.path.exists(full) and full.lower().endswith((".png", ".jpg", ".jpeg", ".gif")):
par = paragraph(align=WD_ALIGN_PARAGRAPH.CENTER)
par.paragraph_format.line_spacing = 1.0
par.add_run().add_picture(full, width=Inches(6.5))
counts["figures"] += 1
else:
par = paragraph(f"[Figure file not found or not a PNG/JPG: {path}]")
par.runs[0].font.color.rgb = RGBColor(0xB0, 0x00, 0x20)
counts["missing_images"].append(path)
elif kind == "code":
lang, body = data
if lang == "mermaid" and has_image:
continue # the picture stands in for the diagram source
for line in body.split("\n"):
par = paragraph(left=0.5)
par.paragraph_format.line_spacing = 1.0
r = par.add_run(line)
r.font.name = "Courier New"
r.font.size = Pt(9.5)
doc.save(out_path)
return counts
def build_with_pandoc(md_path: str, out_path: str) -> bool:
exe = shutil.which("pandoc")
if not exe:
return False
done = subprocess.run([exe, md_path, "-o", out_path, "--resource-path", os.path.dirname(os.path.abspath(md_path))],
capture_output=True, text=True)
return done.returncode == 0 and os.path.exists(out_path)
SAMPLE = """# A sample thematic analysis
**Data set:** 3 interviews
## Method
I coded the *whole* data set. See [the paper](https://doi.org/10.1191/1478088706qp063oa).
## Findings
### The app as a second supervisor
Workers described being watched.
> I enter the visit even when nobody was home, because the dashboard is what she looks at. (CHW-03)
| Theme | Sub-themes |
|---|---|
| The app as a second supervisor | Being watched; Praise that never arrives |

*Note.* Drawn from the final theme definitions.
```mermaid
flowchart LR
A --> B
```
- one
- two
## References
Braun, V., & Clarke, V. (2006). Using thematic analysis in psychology. *Qualitative Research in Psychology*, *3*(2), 77-101. https://doi.org/10.1191/1478088706qp063oa
Clarke, V., & Braun, V. (2017). Thematic analysis. *The Journal of Positive Psychology*, *12*(3), 297-298. https://doi.org/10.1080/17439760.2016.1262613
"""
# a 1x1 white PNG, so the self-test needs no other file
PIXEL = (b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x02\x00\x00\x00\x90wS\xde"
b"\x00\x00\x00\x0cIDATx\x9cc\xf8\xff\xff?\x00\x05\xfe\x02\xfe\xdc\xccY\xe7\x00\x00\x00\x00IEND\xaeB`\x82")
def self_test() -> int:
blocks = parse(SAMPLE.replace("MAP", "map.png"))
kinds = [k for k, _ in blocks]
assert kinds.count("h") == 5 and kinds.count("quote") == 1 and kinds.count("table") == 1, kinds
assert kinds.count("img") == 1 and kinds.count("code") == 1 and kinds.count("ul") == 1, kinds
labels = parse("**Question:** q\n**Data set:** d\nmore\n")
assert [d for _, d in labels] == ["**Question:** q", "**Data set:** d more"], labels
runs = inline_runs("I coded the *whole* set, **all of it**, see [the paper](https://x.org).")
assert ("whole", False, True, False) in runs and ("all of it", True, False, False) in runs, runs
assert runs[-2][0] == "the paper (https://x.org)", runs
try:
import docx # noqa: F401
except ImportError:
print("self-test: parser checks passed; python-docx is not installed, so no Word file was built.")
return 0
with tempfile.TemporaryDirectory() as tmp:
with open(os.path.join(tmp, "map.png"), "wb") as fh:
fh.write(PIXEL)
md = os.path.join(tmp, "report.md")
with open(md, "w", encoding="utf-8") as fh:
fh.write(SAMPLE.replace("MAP", "map.png"))
out = os.path.join(tmp, "report.docx")
counts = build_docx(md, out)
assert counts["figures"] == 1 and counts["references"] == 2 and counts["quotes"] == 1, counts
assert not counts["missing_images"] and os.path.getsize(out) > 5000
print("self-test: passed (parser, inline styles, and a Word file with a figure, a table, a block quote, and references).")
return 0
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description="Build an APA-style Word file from the thematic analysis report.")
ap.add_argument("report", nargs="?", help="path to the report in Markdown")
ap.add_argument("--out", help="path of the Word file (default: the report's name with .docx)")
ap.add_argument("--spacing", type=float, default=2.0, help="line spacing: 2 (APA, default), 1.5, or 1")
ap.add_argument("--self-test", action="store_true")
args = ap.parse_args(argv)
if args.self_test:
return self_test()
if not args.report:
ap.error("give the path to the report, or --self-test")
if not os.path.exists(args.report):
print(f"No such file: {args.report}", file=sys.stderr)
return 1
out = args.out or os.path.splitext(args.report)[0] + ".docx"
try:
counts = build_docx(args.report, out, spacing=args.spacing)
except ImportError:
if build_with_pandoc(args.report, out):
print(f"Wrote {out} with pandoc (python-docx is not installed, so the APA layout was not applied).")
return 0
print("python-docx is not installed and pandoc was not found, so no Word file was built. "
"Install python-docx (pip install python-docx, or run this script with uv); "
"until then the Markdown report is the deliverable.", file=sys.stderr)
return 2
note = f" Missing figure files: {', '.join(counts['missing_images'])}." if counts["missing_images"] else ""
print(f"Wrote {out}: {counts['headings']} headings, {counts['paragraphs']} paragraphs, {counts['quotes']} extracts, "
f"{counts['tables']} tables, {counts['figures']} figures, {counts['references']} references.{note}")
return 1 if counts["missing_images"] else 0
if __name__ == "__main__":
sys.exit(main())
check_extracts.py
Confirm that every coded extract and every quote in the report is in the data, word for word, and that no data item was skimmed.
#!/usr/bin/env python3
"""check_extracts.py: confirm that every coded extract and every quote in the
report is in the data, word for word, and that no data item was skimmed.
A language model can tidy a quote, merge two speakers, or write a line nobody
said. This script compares each extract with the file it is said to come from
and lists the ones that do not match. It also counts extracts per data item,
because every item should get equal attention in coding (Braun & Clarke,
2006, table 2, criterion 2). Standard library only; Python 3.8+.
Usage:
python check_extracts.py codes.json --data data/
checks the coded extracts and prints the count per data item
python check_extracts.py codes.json --data data/ --report report.md
also checks every block quote ("> ...") in the report
python check_extracts.py --self-test
codes.json is a list of coded extracts:
[{"item": "CHW-03", "file": "chw-03.txt", "where": "lines 41-44",
"extract": "the exact words from the data", "codes": ["Being watched"]}]
"file" is relative to --data. Data files are plain text or Markdown; convert
Word or PDF files to text first. Inside an extract, "[...]" marks words left
out; the parts on each side must appear in the file in that order.
Exit code 0: everything matched. 1: at least one extract or quote is not in
the data, or a data item has no extracts. 2: a file could not be read.
"""
from __future__ import annotations
import argparse
import difflib
import json
import os
import re
import statistics
import sys
import tempfile
SWAPS = {"‘": "'", "’": "'", "“": '"', "”": '"', "–": "-", "—": "-", " ": " "}
ELISION_RE = re.compile(r"\s*(?:\[\s*(?:\.\.\.|…)\s*\]|\(\s*\.\.\.\s*\)|…)\s*")
TEXT_EXT = (".txt", ".md", ".markdown", ".text", ".csv", ".tsv", ".vtt", ".srt")
def norm(text: str) -> str:
for a, b in SWAPS.items():
text = text.replace(a, b)
return re.sub(r"\s+", " ", text).strip()
def found_in(extract: str, source: str) -> bool:
"""True if the extract, split at its elision marks, appears in order in the source."""
parts = [p for p in ELISION_RE.split(norm(extract)) if p]
if not parts:
return False
pos = 0
for part in parts:
hit = source.find(part, pos)
if hit < 0:
return False
pos = hit + len(part)
return True
def nearest(extract: str, source: str) -> str:
"""The stretch of the source that shares the most with the extract, for the error message."""
ext = norm(extract)
match = difflib.SequenceMatcher(None, source, ext, autojunk=False).find_longest_match(0, len(source), 0, len(ext))
if match.size < 12:
return "nothing close to it in the file"
start = max(0, match.a - match.b)
return "closest text in the file: \"" + source[start:start + len(ext) + 20].strip() + "\""
def read_sources(data_dir: str) -> dict:
sources = {}
for root, _, files in os.walk(data_dir):
for name in sorted(files):
if name.lower().endswith(TEXT_EXT):
path = os.path.join(root, name)
with open(path, encoding="utf-8", errors="replace") as fh:
sources[os.path.relpath(path, data_dir)] = norm(fh.read())
return sources
def report_quotes(md: str) -> list:
"""Block quotes in the report, with a trailing '(P03)' style label removed."""
quotes, chunk = [], []
for line in md.split("\n") + [""]:
s = line.strip()
if s.startswith(">"):
body = s[1:].strip()
if body:
chunk.append(body)
continue
if chunk:
text = re.sub(r"\s*[\(\[][^()\[\]]{1,60}[\)\]]\s*$", "", " ".join(chunk))
quotes.append(text.strip().strip('"').strip("“”").strip())
chunk = []
return [q for q in quotes if q]
def check(codes: list, sources: dict, report_md: str | None = None) -> dict:
result = {"bad": [], "per_item": {}, "unread": [], "bad_quotes": [], "n": 0, "n_quotes": 0}
used = set()
for n, row in enumerate(codes, start=1):
result["n"] += 1
item = str(row.get("item") or row.get("file") or f"row {n}")
rel = str(row.get("file") or "")
extract = str(row.get("extract") or "")
source = sources.get(rel)
if source is None: # tolerate a bare file name
hits = [k for k in sources if os.path.basename(k) == os.path.basename(rel)]
source = sources[hits[0]] if len(hits) == 1 else None
rel = hits[0] if len(hits) == 1 else rel
if source is None:
result["bad"].append((n, item, extract, f"data file not found: {row.get('file')}"))
continue
used.add(rel)
stats = result["per_item"].setdefault(rel, {"item": item, "extracts": 0, "codes": set(), "words": len(source.split())})
stats["extracts"] += 1
stats["codes"].update(str(c) for c in (row.get("codes") or []))
if not row.get("codes"):
result["bad"].append((n, item, extract, "no code attached"))
if not found_in(extract, source):
result["bad"].append((n, item, extract, nearest(extract, source)))
result["unread"] = sorted(set(sources) - used)
if report_md is not None:
everything = " ".join(sources.values())
for q in report_quotes(report_md):
result["n_quotes"] += 1
if not any(found_in(q, s) for s in sources.values()):
result["bad_quotes"].append((q, nearest(q, everything)))
return result
def thin_items(per_item: dict) -> list:
"""Items coded at less than half the typical density: a sign they were skimmed."""
rates = {k: v["extracts"] / max(v["words"], 1) * 1000 for k, v in per_item.items()}
if len(rates) < 3:
return []
typical = statistics.median(rates.values())
return sorted(k for k, r in rates.items() if r < typical / 2)
def print_result(result: dict) -> int:
print(f"Coded extracts checked: {result['n']}. Not matching the data: {len(result['bad'])}.")
for n, item, extract, why in result["bad"]:
print(f" - row {n} ({item}): \"{extract[:110]}{'...' if len(extract) > 110 else ''}\"\n {why}")
print("\nExtracts per data item:")
print(f" {'file':<34} {'words':>7} {'extracts':>9} {'codes':>6} {'per 1,000 words':>16}")
for rel, v in sorted(result["per_item"].items()):
print(f" {rel[:34]:<34} {v['words']:>7} {v['extracts']:>9} {len(v['codes']):>6} {v['extracts'] / max(v['words'], 1) * 1000:>16.1f}")
thin = thin_items(result["per_item"])
if thin:
print(" Coded much more lightly than the rest; read these again: " + ", ".join(thin))
if result["unread"]:
print(" No extracts at all from: " + ", ".join(result["unread"]))
if result["n_quotes"] or result["bad_quotes"]:
print(f"\nQuotes in the report checked: {result['n_quotes']}. Not in the data: {len(result['bad_quotes'])}.")
for q, why in result["bad_quotes"]:
print(f" - \"{q[:110]}{'...' if len(q) > 110 else ''}\"\n {why}")
failed = result["bad"] or result["bad_quotes"] or result["unread"]
print("\nResult: " + ("problems found; fix them from the data, never by rewording the quote to fit." if failed
else "every extract and quote is in the data."))
return 1 if failed else 0
def self_test() -> int:
with tempfile.TemporaryDirectory() as tmp:
with open(os.path.join(tmp, "a.txt"), "w", encoding="utf-8") as fh:
fh.write("I: How is the app?\nR: I enter the visit even when nobody was home,\nbecause the dashboard is what she looks at. It’s tiring.\n")
with open(os.path.join(tmp, "b.txt"), "w", encoding="utf-8") as fh:
fh.write("R: The families trust the phone more than me.\n")
sources = read_sources(tmp)
codes = [
{"item": "A", "file": "a.txt", "extract": "I enter the visit even when nobody was home, because the dashboard is what she looks at.", "codes": ["x"]},
{"item": "A", "file": "a.txt", "extract": "I enter the visit [...] It's tiring.", "codes": ["y"]},
{"item": "A", "file": "a.txt", "extract": "I always enter the visit because she checks the dashboard.", "codes": ["x"]},
]
report = "> The families trust the phone more than me. (B)\n\n> They trust the screen, not me. (B)\n"
result = check(codes, sources, report)
assert [b[0] for b in result["bad"]] == [3], result["bad"]
assert result["unread"] == ["b.txt"], result["unread"]
assert result["n_quotes"] == 2 and len(result["bad_quotes"]) == 1, result["bad_quotes"]
assert result["per_item"]["a.txt"]["extracts"] == 3
print("self-test: passed (exact match across line breaks and curly quotes, elision marks, an altered quote caught, "
"an uncoded item caught, report quotes checked).")
return 0
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description="Check coded extracts and report quotes against the data.")
ap.add_argument("codes", nargs="?", help="path to codes.json")
ap.add_argument("--data", help="folder holding the data files (text or Markdown)")
ap.add_argument("--report", help="the report in Markdown; its block quotes are checked too")
ap.add_argument("--self-test", action="store_true")
args = ap.parse_args(argv)
if args.self_test:
return self_test()
if not args.codes or not args.data:
ap.error("give codes.json and --data, or --self-test")
try:
with open(args.codes, encoding="utf-8") as fh:
codes = json.load(fh)
sources = read_sources(args.data)
report_md = None
if args.report:
with open(args.report, encoding="utf-8") as fh:
report_md = fh.read()
except (OSError, json.JSONDecodeError) as err:
print(f"Could not read the input: {err}", file=sys.stderr)
return 2
if not sources:
print(f"No text files found under {args.data}. Convert Word or PDF files to .txt or .md first.", file=sys.stderr)
return 2
return print_result(check(codes, sources, report_md))
if __name__ == "__main__":
sys.exit(main())
draw_map.py
Draw a thematic map from a small JSON file.
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = ["matplotlib>=3.5"]
# ///
"""draw_map.py: draw a thematic map from a small JSON file.
A thematic map shows the themes of a thematic analysis, the sub-themes inside
each, and the relationships between them (Braun & Clarke, 2006, phases 3 to 5).
This script draws one as a picture: the research question in the middle, one
color per theme, sub-themes fanned around their theme, a dashed line for each
relationship between themes, and a strip for codes that were set aside.
Usage:
python draw_map.py map.json --out thematic-map
writes thematic-map.png, thematic-map.svg, and thematic-map.mmd
python draw_map.py map.json --out thematic-map --mermaid-only
writes thematic-map.mmd only (needs nothing installed)
python draw_map.py --self-test
With uv, `uv run draw_map.py ...` installs matplotlib on its own. Without
matplotlib the script still writes the Mermaid file, says so, and exits 2.
map.json:
{
"title": "Final thematic map: <study in a few words>",
"research_question": "<the question the analysis answers>",
"themes": [
{"name": "<theme>", "subthemes": ["<sub-theme>", "<sub-theme>"]}
],
"relationships": [
{"from": "<theme or sub-theme name>", "to": "<...>", "label": "in tension with"}
],
"set_aside": ["<code kept out of every theme>"]
}
"relationships" and "set_aside" may be left out. Names must be unique.
"""
from __future__ import annotations
import argparse
import itertools
import json
import math
import os
import sys
import tempfile
import textwrap
HUES = [
{"fill": "#CFE6EC", "soft": "#F0F8FA", "stroke": "#3B7C8C", "text": "#17414B"}, # teal
{"fill": "#F5DCC8", "soft": "#FCF3EB", "stroke": "#B5683A", "text": "#5C2F14"}, # clay
{"fill": "#DDD6F0", "soft": "#F4F1FB", "stroke": "#6A58A8", "text": "#2F2559"}, # violet
{"fill": "#D5E8D0", "soft": "#F1F8EF", "stroke": "#4E8A4A", "text": "#1F4420"}, # green
{"fill": "#F3D6DE", "soft": "#FCF0F3", "stroke": "#A84E68", "text": "#521F30"}, # rose
{"fill": "#F2E6B8", "soft": "#FBF7E4", "stroke": "#96801E", "text": "#473C08"}, # ochre
]
INK = "#2B2F36"
LINE = "#8A8F98"
ASIDE = {"fill": "#F3F3F0", "stroke": "#9A9A94", "text": "#55554F"}
REL = "#C2410C"
FONTS = ["Helvetica Neue", "Helvetica", "Arial", "DejaVu Sans"]
PX_TO_PT = 0.72 # the figure is laid out at 100 dpi, so 1 px = 0.72 pt
class MapError(ValueError):
"""The map file is missing something the drawing needs."""
def load_map(path: str) -> dict:
with open(path, encoding="utf-8") as fh:
raw = json.load(fh)
return normalize(raw)
def normalize(raw: dict) -> dict:
"""Check the map and give every theme and sub-theme an id."""
themes = raw.get("themes") or []
if not themes:
raise MapError("The map needs at least one theme under 'themes'.")
if len(themes) > 8:
raise MapError(f"The map has {len(themes)} themes. More than eight will not read as a picture; merge themes or draw one map per overarching theme.")
out = {
"title": str(raw.get("title") or "Thematic map"),
"research_question": str(raw.get("research_question") or "").strip(),
"themes": [],
"relationships": [],
"set_aside": [],
}
if not out["research_question"]:
raise MapError("The map needs 'research_question': the question the analysis answers sits at the center.")
by_name = {}
for i, t in enumerate(themes, start=1):
name = str(t.get("name") or "").strip()
if not name:
raise MapError(f"Theme {i} has no name.")
subs = []
for k, s in enumerate(t.get("subthemes") or []):
s_name = str(s.get("name") if isinstance(s, dict) else s).strip()
subs.append({"id": f"T{i}{chr(97 + k)}", "name": s_name})
theme = {"id": f"T{i}", "name": name, "subthemes": subs}
out["themes"].append(theme)
for node in [theme] + subs:
key = node["name"].lower()
if key in by_name:
raise MapError(f"Two entries are both named '{node['name']}'. Names must be unique so relationships can point to them.")
by_name[key] = node["id"]
for r in raw.get("relationships") or []:
ends = []
for side in ("from", "to"):
key = str(r.get(side) or "").strip().lower()
if key not in by_name:
raise MapError(f"A relationship points to '{r.get(side)}', which is not a theme or sub-theme on the map. Names on the map: {', '.join(sorted(by_name))}.")
ends.append(by_name[key])
out["relationships"].append({"from": ends[0], "to": ends[1], "label": str(r.get("label") or "").strip()})
aside = raw.get("set_aside") or []
if isinstance(aside, dict): # tolerate {"codes": [...]}
aside = aside.get("codes") or []
out["set_aside"] = [str(c).strip() for c in aside if str(c).strip()]
return out
# ---------------------------------------------------------------- Mermaid
def mermaid(m: dict) -> str:
"""The same map as a Mermaid flowchart, for places that render Mermaid."""
def br(s: str, w: int) -> str:
return "<br/>".join(textwrap.wrap(s.replace('"', "'"), w))
font = "Helvetica Neue, Helvetica, Arial" # Mermaid drops values with a hyphen
init = {
"theme": "base", "fontFamily": font,
"themeVariables": {"fontFamily": font, "fontSize": "15px", "lineColor": LINE,
"edgeLabelBackground": "#FFFFFF", "tertiaryColor": "#FFFFFF"},
"flowchart": {"curve": "basis", "nodeSpacing": 16, "rankSpacing": 64, "padding": 12},
}
out = ["%%" + json.dumps({"init": init}).replace('{"init":', "{init:", 1) + "%%", "flowchart LR"]
links = []
out.append(f' RQ(["{br(m["research_question"], 30)}"]):::rq')
for i, t in enumerate(m["themes"]):
h = HUES[i % len(HUES)]
out.append(f' {t["id"]}["{br(t["name"], 22)}"]:::t{i}')
links.append((f' RQ ==> {t["id"]}', f"stroke:{LINE},stroke-width:2.5px"))
for s in t["subthemes"]:
out.append(f' {s["id"]}(["{br(s["name"], 26)}"]):::s{i}')
links.append((f' {t["id"]} --- {s["id"]}', f'stroke:{h["stroke"]},stroke-width:1.5px'))
# A direct edge between two nodes would move one of them to a new column,
# so each relationship is a small tag that both ends point to.
for k, r in enumerate(m["relationships"]):
out.append(f' R{k}(["{br(r["label"] or "related to", 24)}"]):::rel')
for end in (r["from"], r["to"]):
links.append((f" {end} -.- R{k}", f"stroke:{REL},stroke-width:2px,stroke-dasharray:6 5"))
if m["set_aside"]:
body = "<br/>".join(c.replace('"', "'") for c in m["set_aside"])
out.append(f' SA["<b>Set aside</b><br/>{body}"]:::aside')
out.extend(line for line, _ in links)
for i in range(len(m["themes"])):
h = HUES[i % len(HUES)]
out.append(f' classDef t{i} fill:{h["fill"]},stroke:{h["stroke"]},color:{h["text"]},stroke-width:2px,font-weight:600')
out.append(f' classDef s{i} fill:{h["soft"]},stroke:{h["stroke"]},color:{h["text"]},stroke-width:1px')
out.append(f" classDef rq fill:{INK},stroke:{INK},color:#FFFFFF,font-weight:600")
out.append(f" classDef rel fill:#FFF7ED,stroke:{REL},color:{REL},stroke-dasharray:6 5,font-style:italic,font-size:13px")
out.append(f' classDef aside fill:{ASIDE["fill"]},stroke:{ASIDE["stroke"]},color:{ASIDE["text"]},stroke-dasharray:5 4,font-size:13px')
for n, (_, style) in enumerate(links):
out.append(f" linkStyle {n} {style}")
return "\n".join(out) + "\n"
# ---------------------------------------------------------------- picture
class Box:
"""A label with a measured size. x, y is the center, in pixels."""
def __init__(self, measure, label, size, wrap, bold=False, padx=16, pady=10):
self.lines = textwrap.wrap(label, wrap) or [""]
self.size, self.bold = size, bold
self.line_h = size * 1.3
self.w = max(measure(line, size, bold) for line in self.lines) + 2 * padx
self.h = len(self.lines) * self.line_h + 2 * pady
self.x = self.y = 0.0
def rect(self, margin=0.0):
return (self.x - self.w / 2 - margin, self.y - self.h / 2 - margin,
self.x + self.w / 2 + margin, self.y + self.h / 2 + margin)
def _overlap(a, b) -> bool:
return not (a[2] <= b[0] or b[2] <= a[0] or a[3] <= b[1] or b[3] <= a[1])
def layout(m: dict, measure, scale: float = 1.0) -> dict:
"""Place every box. Themes sit on an inner ellipse, sub-themes on an outer one."""
themes = m["themes"]
extra = max(0, len(themes) - 3)
rx1, ry1 = 322 * scale, 192 * scale
rx2 = (520 + 30 * extra) * scale
ry2 = (318 + 20 * extra) * scale
padx, head, foot = 130, 70, 124
width = 2 * (rx2 + padx)
cx, cy = width / 2, head + ry2 + 44
height = cy + ry2 + 44 + foot
weights = [max(len(t["subthemes"]), 1) + 0.6 for t in themes]
total = sum(weights)
sectors, a = [], -90 - 360 * weights[0] / total / 2 # first theme at the top
for wgt in weights:
span = 360 * wgt / total
sectors.append((a, span))
a += span
def pt(deg, rx, ry):
r = math.radians(deg)
return cx + rx * math.cos(r), cy + ry * math.sin(r)
def leaf_angles(i, n):
a0, span = sectors[i]
inner = span * 0.80
return [a0 + span / 2 - inner / 2 + inner * (k + 0.5) / n for k in range(n)]
# Order sub-themes inside each theme so related ones sit close together.
rels = m["relationships"]
orders = [list(range(len(t["subthemes"]))) for t in themes]
if rels:
choices = [list(itertools.permutations(range(len(t["subthemes"])))) for t in themes]
if math.prod(len(c) for c in choices) <= 20000:
def cost(combo):
pos = {}
for i, (t, perm) in enumerate(zip(themes, combo)):
for ang, k in zip(leaf_angles(i, len(perm)), perm):
pos[t["subthemes"][k]["id"]] = pt(ang, rx2, ry2)
pos[t["id"]] = pt(sectors[i][0] + sectors[i][1] / 2, rx1, ry1)
return sum(math.dist(pos[r["from"]], pos[r["to"]]) for r in rels)
orders = [list(p) for p in min(itertools.product(*choices), key=cost)]
rq = Box(measure, m["research_question"], 16, 30, bold=True, padx=24, pady=16)
rq.x, rq.y = cx, cy
pos, tboxes, sboxes = {}, [], []
for i, t in enumerate(themes):
b = Box(measure, t["name"], 15.5, 20, bold=True, padx=18, pady=12)
b.x, b.y = pt(sectors[i][0] + sectors[i][1] / 2, rx1, ry1)
tboxes.append(b)
pos[t["id"]] = b
row = []
for ang, k in zip(leaf_angles(i, len(orders[i])), orders[i]):
s = t["subthemes"][k]
sb = Box(measure, s["name"], 13.5, 20)
sb.x, sb.y = pt(ang, rx2, ry2)
row.append(sb)
pos[s["id"]] = sb
sboxes.append(row)
boxes = [rq] + tboxes + [b for row in sboxes for b in row]
clash = any(_overlap(a_.rect(6), b_.rect(6)) for a_, b_ in itertools.combinations(boxes, 2))
off = any(b.rect()[0] < 12 or b.rect()[2] > width - 12 for b in boxes)
return {"w": width, "h": height, "cx": cx, "cy": cy, "foot": foot, "rq": rq, "themes": tboxes,
"subs": sboxes, "pos": pos, "clash": clash or off}
def draw(m: dict, out_base: str) -> list:
"""Draw the map with matplotlib. Returns the files written."""
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
from matplotlib.patches import FancyBboxPatch, PathPatch
from matplotlib.path import Path
plt.rcParams["font.family"] = FONTS
plt.rcParams["svg.fonttype"] = "path" # the SVG looks the same on any machine
probe = plt.figure(figsize=(4, 4), dpi=100)
renderer = probe.canvas.get_renderer()
def measure(text, size, bold=False, italic=False):
t = probe.text(0, 0, text, fontsize=size * PX_TO_PT, fontweight="bold" if bold else "normal",
fontstyle="italic" if italic else "normal")
w = t.get_window_extent(renderer).width
t.remove()
return w
scale, lay = 1.0, None
for _ in range(12): # grow the ellipses until no two boxes touch
lay = layout(m, measure, scale)
if not lay["clash"]:
break
scale *= 1.08
plt.close(probe)
width, height, cx, cy = lay["w"], lay["h"], lay["cx"], lay["cy"]
fig = plt.figure(figsize=(width / 100, height / 100), dpi=100)
ax = fig.add_axes([0, 0, 1, 1])
ax.set_xlim(0, width)
ax.set_ylim(height, 0)
ax.axis("off")
fig.patch.set_facecolor("#FFFFFF")
def put_text(x, y, s, size, color, bold=False, italic=False, ha="center", z=6):
ax.text(x, y, s, fontsize=size * PX_TO_PT, color=color, ha=ha, va="center",
fontweight="bold" if bold else "normal", fontstyle="italic" if italic else "normal", zorder=z)
def put_box(b, fill, stroke, color, lw, radius=None, dash=None, z=4):
r = min(b.h / 2, b.w / 2) if radius is None else radius
ax.add_patch(FancyBboxPatch((b.x - b.w / 2, b.y - b.h / 2), b.w, b.h,
boxstyle=f"round,pad=0,rounding_size={r}", facecolor=fill, edgecolor=stroke,
linewidth=lw, linestyle=(0, dash) if dash else "-", zorder=z))
y0 = b.y - (len(b.lines) - 1) * b.line_h / 2
for i, line in enumerate(b.lines):
put_text(b.x, y0 + i * b.line_h, line, b.size, color, bold=b.bold, z=z + 1)
def curve(p, q, bow, color, lw, alpha=1.0, dash=None, z=2):
mx, my = (p[0] + q[0]) / 2, (p[1] + q[1]) / 2
dx, dy = mx - cx, my - cy
d = math.hypot(dx, dy) or 1.0
c = (mx + dx / d * bow, my + dy / d * bow)
ax.add_patch(PathPatch(Path([p, c, q], [Path.MOVETO, Path.CURVE3, Path.CURVE3]), facecolor="none",
edgecolor=color, linewidth=lw, alpha=alpha, capstyle="round",
linestyle=(0, dash) if dash else "-", zorder=z))
return (0.25 * p[0] + 0.5 * c[0] + 0.25 * q[0], 0.25 * p[1] + 0.5 * c[1] + 0.25 * q[1])
put_text(40, 40, m["title"], 19, INK, bold=True, ha="left")
rq = lay["rq"]
for i, tb in enumerate(lay["themes"]):
h = HUES[i % len(HUES)]
curve((rq.x, rq.y), (tb.x, tb.y), 0, h["stroke"], 4.4, alpha=0.45)
for sb in lay["subs"][i]:
curve((tb.x, tb.y), (sb.x, sb.y), 22, h["stroke"], 1.4)
for r in m["relationships"]:
a_, b_ = lay["pos"][r["from"]], lay["pos"][r["to"]]
mid = curve((a_.x, a_.y), (b_.x, b_.y), 46, REL, 1.7, dash=(4, 3.5), z=3)
if r["label"]:
lw_ = measure(r["label"], 12.5, italic=True) + 22
tag = Box(lambda *_: lw_ - 22, r["label"], 12.5, 200, padx=11, pady=4)
tag.x, tag.y = mid
ax.add_patch(FancyBboxPatch((tag.x - tag.w / 2, tag.y - 12), tag.w, 24, boxstyle="round,pad=0,rounding_size=12",
facecolor="#FFF7ED", edgecolor=REL, linewidth=0.8, zorder=7))
put_text(tag.x, tag.y, r["label"], 12.5, REL, italic=True, z=8)
for i, tb in enumerate(lay["themes"]):
h = HUES[i % len(HUES)]
for sb in lay["subs"][i]:
put_box(sb, "#FFFFFF", h["stroke"], h["text"], 1.1)
put_box(tb, h["fill"], h["stroke"], h["text"], 1.7, radius=14)
put_box(rq, INK, INK, "#FFFFFF", 0, radius=22, z=5)
fy = height - lay["foot"] + 34
if m["set_aside"]:
head = "Set aside (coded, in no theme)"
x = 40.0
chip_x = x + 18 + measure(head, 13, bold=True) + 12
rows, row, limit = [], [], width - 380
cur = chip_x
for code in m["set_aside"]:
cw = measure(code, 12.5) + 22
if row and cur + cw > limit:
rows.append(row)
row, cur = [], chip_x
row.append((code, cur, cw))
cur += cw + 8
rows.append(row)
right = max(c[1] + c[2] for r_ in rows for c in r_) + 12
strip_h = 26 + 30 * len(rows)
top = fy - (strip_h - 52) / 2
ax.add_patch(FancyBboxPatch((x, top), right - x, strip_h, boxstyle="round,pad=0,rounding_size=12",
facecolor=ASIDE["fill"], edgecolor=ASIDE["stroke"], linewidth=0.9,
linestyle=(0, (4, 3)), zorder=1))
put_text(x + 18, top + strip_h / 2, head, 13, ASIDE["text"], bold=True, ha="left")
for n, r_ in enumerate(rows):
ry = top + 13 + 30 * n
for code, c_x, cw in r_:
ax.add_patch(FancyBboxPatch((c_x, ry), cw, 26, boxstyle="round,pad=0,rounding_size=13",
facecolor="#FFFFFF", edgecolor=ASIDE["stroke"], linewidth=0.8, zorder=2))
put_text(c_x + cw / 2, ry + 13, code, 12.5, ASIDE["text"])
kx = width - 340
ax.plot([kx, kx + 44], [fy + 16, fy + 16], color=LINE, linewidth=1.4)
put_text(kx + 54, fy + 16, "theme and its sub-themes", 12.5, ASIDE["text"], ha="left")
if m["relationships"]:
ax.plot([kx, kx + 44], [fy + 38, fy + 38], color=REL, linewidth=1.7, linestyle=(0, (4, 3.5)))
put_text(kx + 54, fy + 38, "relationship between themes", 12.5, ASIDE["text"], ha="left")
written = []
for ext, dpi in (("png", 200), ("svg", 100)):
path = f"{out_base}.{ext}"
fig.savefig(path, dpi=dpi, facecolor="#FFFFFF")
written.append(path)
plt.close(fig)
if lay["clash"]:
print("Note: some labels still touch after widening the map. Shorten the longest names or split the map.", file=sys.stderr)
return written
EXAMPLE = {
"title": "Final thematic map: community health workers and a digital job aid",
"research_question": "How do community health workers make sense of a digital job aid in their daily visits?",
"themes": [
{"name": "The app as a second supervisor",
"subthemes": ["Being watched through the data", "Entering visits to look busy", "Praise that never arrives"]},
{"name": "Borrowed authority at the doorstep",
"subthemes": ["The phone says so", "Families trust the screen", "Losing my own voice"]},
{"name": "Work that spills past the visit", "subthemes": ["Syncing at night", "Paying for my own data"]},
],
"relationships": [{"from": "Being watched through the data", "to": "Losing my own voice", "label": "in tension with"}],
"set_aside": ["Phone battery", "Training day food", "Old paper registers"],
}
def self_test() -> int:
m = normalize(EXAMPLE)
text = mermaid(m)
assert text.startswith("%%{init:") and "flowchart LR" in text, "Mermaid header"
assert text.count(":::s") == 8 and text.count(":::t") == 3, "Mermaid nodes"
try:
normalize({"research_question": "q", "themes": [{"name": "A"}], "relationships": [{"from": "A", "to": "B"}]})
except MapError:
pass
else:
raise AssertionError("an unknown relationship end should be an error")
big = {"research_question": "q " * 12, "themes": [
{"name": f"A fairly long theme name number {i}", "subthemes": [f"Sub-theme {i}.{k} with a long label" for k in range(4)]}
for i in range(6)]}
with tempfile.TemporaryDirectory() as tmp:
try:
files = draw(m, os.path.join(tmp, "example")) + draw(normalize(big), os.path.join(tmp, "big"))
except ImportError:
print("self-test: Mermaid checks passed; matplotlib is not installed, so the picture was not tested.")
return 0
for f in files:
assert os.path.getsize(f) > 2000, f
print("self-test: passed (Mermaid text, error handling, and pictures for a small and a large map).")
return 0
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description="Draw a thematic map from a JSON file.")
ap.add_argument("map", nargs="?", help="path to the map JSON")
ap.add_argument("--out", default="thematic-map", help="output path without extension (default: thematic-map)")
ap.add_argument("--mermaid-only", action="store_true", help="write only the Mermaid file")
ap.add_argument("--self-test", action="store_true")
args = ap.parse_args(argv)
if args.self_test:
return self_test()
if not args.map:
ap.error("give the path to the map JSON, or --self-test")
try:
m = load_map(args.map)
except (MapError, json.JSONDecodeError, OSError) as err:
print(f"Could not read the map: {err}", file=sys.stderr)
return 1
out_dir = os.path.dirname(os.path.abspath(args.out))
os.makedirs(out_dir, exist_ok=True)
mmd = f"{args.out}.mmd"
with open(mmd, "w", encoding="utf-8") as fh:
fh.write(mermaid(m))
written = [mmd]
if not args.mermaid_only:
try:
written += draw(m, args.out)
except ImportError:
print(f"Wrote {mmd}. matplotlib is not installed, so no picture was drawn: "
"install it (pip install matplotlib, or run this script with uv), or use the Mermaid block in the report.",
file=sys.stderr)
return 2
print("Wrote " + ", ".join(written))
return 0
if __name__ == "__main__":
sys.exit(main())
Version history
What changed in each version, newest first. An entry that answers an issue or review links to it.
CHANGELOG.mdView on GitHub
0.1.0 - 2026-11-24
First version. Runs the six phases of Braun and Clarke (2006) with AI agents, either with the researcher deciding at three checkpoints or on its own, and tells the user at the start that the method's authors reject generative AI for reflexive thematic analysis (Jowsey et al., 2026). Three scripts ship with it: check_extracts.py (every extract and report quote against the data), draw_map.py (the thematic map as PNG, SVG, and Mermaid), and build_report.py (the report as an APA-style Word file). Written from the two method papers; sources were confirmed against Crossref records and the pages themselves, and each entry in references/evidence.md says how much of the source was read. Drafted with Claude.
Reviews
Expert reviews come from behavioral scientists at The Agency Fund and Irrational Labs and are kept as issues on GitHub; each shows whether a later version of the skill answered it. Ratings and comments come from anyone who has used the skill.
Expert reviews
Expert reviews of this skill are kept as issues on GitHub.