Chapter 2 — Project templates

The Rules / Memory / Knowledge skeleton, ready to adapt

The Rules / Memory / Knowledge project skeleton from Chapter 2 as adaptable templates, with a screencast of the structure steering a real AI-assisted analysis.

An agent cannot use the right codebook or follow a recent decision if it cannot find them. Chapter 2 organizes a project into rules (how the agent works), memory (where the project stands), and knowledge (what the project knows). The templates below give those three dimensions a place in your project directory.

What you will produce. A project directory with instructions, current decisions, and reference materials that an agent can consult at the start of a session. You will add to it as you work through the book and check that the agent uses the right files.

Download

The complete directory structure with all templates in place. Unzip it, rename the folder, and start filling in memory/CURRENT.md.

Or take the files individually:

File Dimension What it does
AGENTS.md Rules Project-wide behavioral expectations: scope of agent authority, file conventions, verification requirements
analysis/AGENTS.md Rules Analysis-specific refinements: where scripts live, class-level metrics, seed discipline
writing/AGENTS.md Rules Manuscript-specific refinements: voice, citation integrity, file handling
memory/CURRENT.md Memory Current direction, priorities, active assumptions, next steps
memory/DECISIONS.md Memory Append-only decision log with rationale and rejected alternatives
memory/PROMPTLOG.md Memory Revision history of prompt-based instruments
kb/README.md Knowledge Map of the knowledge base so an agent knows which file is authoritative
kb/codebooks/abstract-coding-promptbook.md Knowledge The current prompt-based coding instrument, filled in for the worked example (v3)
README.md — Human-facing project overview

The structure at a glance

project/
├── AGENTS.md              # Rules: how the agent works
├── README.md
├── memory/                # Memory: where the project stands
│   ├── CURRENT.md
│   ├── DECISIONS.md
│   ├── PROMPTLOG.md
│   └── runs/              # dated notes for specific analyses
├── kb/                    # Knowledge: what the project knows
│   ├── README.md
│   ├── concepts/
│   ├── literature/{theory,methods,empirical}/
│   ├── data-docs/
│   └── codebooks/         # codebooks AND promptbooks
│       └── abstract-coding-promptbook.md
├── data/{raw,interim,processed,external}/
├── analysis/              # + its own AGENTS.md
│   ├── scripts/ notebooks/ validation/
├── writing/               # + its own AGENTS.md
└── outputs/{figures,tables,memos}/

The minimum viable version

For a new project, you can start with three files (Chapter 2, §2.6.1):

  1. AGENTS.md with your file conventions, basic verification expectations, and instructions for handling uncertainty.
  2. memory/CURRENT.md with your current research direction, one or two open questions, and immediate next tasks.
  3. kb/README.md with a brief map of what materials you have and where they are.

Those three help an agent answer the questions that orient a session: How should I work here? What is the project currently doing? What materials should I use?

What they look like filled in

Most downloads are templates to fill in; the promptbook includes a worked example. The sample entries below follow a study of equity and efficiency framing in research abstracts, using the corpus from Chapter 4 and coding from Chapter 6.

The rules file

AGENTS.md at the project root. Each section settles something the agent would otherwise decide for itself:

# Project Rules

## Scope of Agent Authority
- You may create and edit files in analysis/, writing/, and outputs/.
- You may read but not modify files in data/raw/.
- Ask before modifying files in kb/ or memory/.

## File and Folder Conventions
- Follow the existing directory structure.
- Name new scripts with a numeric prefix (e.g., 01_clean_data.py).
- Save intermediate outputs to data/interim/ with a date prefix.

## Verification Requirements
- Save interim outputs before finalizing any analysis.
- After coding or extraction tasks, inspect at least 20 randomly selected
  records (or all records if fewer are available). Add targeted error checks.
- For classification, report precision and recall for each class.
- Compare new results against prior versions when they exist.
- Flag ambiguity rather than forcing a conclusion.

## Documentation Requirements
- Update memory/CURRENT.md after any significant direction change.
- Log major decisions in memory/DECISIONS.md with date and rationale.
- Document new variables in the relevant codebook under kb/codebooks/.
- If LLMs are used for coding or extraction, store the current promptbook
  under kb/codebooks/ and log major prompt revisions in memory/PROMPTLOG.md.

## What to Do When Uncertain
- State the uncertainty explicitly.
- Propose two or three options with brief rationale.
- Do not proceed with a default assumption silently.

A rule needs to identify an action the agent can follow. “Do not modify files in data/raw/” names the protected files and the restriction. “Be careful with the data” leaves both for the agent to interpret.

Memory, on one particular day

memory/CURRENT.md while the coding dictionary is being revised for the third time:

# Current Project Direction

## Research Focus
Exploring how scientific abstracts frame research as equity-oriented
vs. efficiency-oriented, using the OpenAlex corpus compiled in the data
management chapter.

## Current Priorities
1. Finalize the deductive coding dictionary (v3 in progress).
2. Run a second BERTopic model with revised stop words.
3. Draft the triangulation comparison between dictionary and topic model
   outputs.

## Active Assumptions
- Allowing both framings in dictionary scores; assigning a primary
  framing in the LLM prompt using the study's stated purpose.
- Using abstracts only (not full text) as the unit of analysis.

## Known Risks
- The term "access" appears in both equity and efficiency contexts; the
  dictionary may need disambiguation rules.
- BERTopic results are sensitive to minimum topic size; need stability tests.

## Immediate Next Steps
- Audit 30 high-disagreement cases from the triangulation table.
- Update kb/codebooks/deductive-codebook.md with v3 revisions.

Keep CURRENT.md focused on what an agent needs at the start of a session. Put the dictionary’s revision history in memory/DECISIONS.md and the definition of equity in kb/concepts/.

One promptlog entry

memory/PROMPTLOG.md. The promptbook in kb/codebooks/ holds the prompt currently in force; this file records why it changed:

## 2026-03-03: Abstract coding prompt v2
- Task: Classify abstracts as equity-oriented, efficiency-oriented,
  or insufficient_evidence.
- Promptbook version: kb/codebooks/abstract-coding-promptbook.md (v2)
- Change: Added an instruction to quote textual evidence and return
  "insufficient_evidence" when the text cannot support a label.
- Why: The first audit showed unsupported inferences from background
  knowledge rather than evidence in the abstract.
- Evidence from audit: In a 20-case review, 6 disagreements involved labels
  that could not be justified from the source text alone.
- Implications: Re-run the affected batch and manually inspect all cases
  flagged as insufficient_evidence.

This illustrative entry connects an error pattern to a prompt revision and the outputs that need checking again. That reasoning will also help you write the methods section.

What working with an agent actually looks like

The recording below follows an AI-assisted study in VS Code, from an empty folder to a drafted report. It builds a coauthor network from OpenAlex inside this project structure. Watch how the researcher sets the question and constraints, then reviews the agent’s decisions and outputs.

How Researchers Can Use AI Without Losing Methodological Control, about 50 minutes. If the player does not load, watch it on YouTube.

For a shorter viewing, start with these moments:

Adapting the templates

  • Adapt the rules to your project. Name the files an agent may change, where outputs belong, and which checks the task requires. The sample size in the template is a starting point for inspection; choose a validation sample that can reveal the errors you care about.
  • Keep memory selective. It is not a transcript. Record decisions, direction changes, and dead ends, not every exchange.
  • Keep the three dimensions distinct. Separating instructions, notes, and source material helps an agent distinguish the rules it must follow, the project’s history, and the evidence it can use.
  • Promptbook vs. promptlog. Keep the current instrument in the promptbook (kb/codebooks/) and its history in the promptlog (memory/). Give each version an identifier so readers can connect an earlier output to the instructions that produced it.

Tool compatibility

These are plain Markdown files you can read in a text editor. Check how your chosen agent loads instructions, and confirm it has read the relevant files before starting work.

Where to go next