The agentic layer — how the project is built under governance

Context, rules, skills, independent checks and hard guards around a one-way data chain

Methodology
Agentic layer
Objavljeno

August 11, 2026

Language: English · ← Hrvatska verzija

Beside its data and analytical layers, DigiKat has a third and less visible layer, the agentic one. Part of the development work (writing code, quality checks, preparing pages) is done with the help of AI agents, but not free-hand. This page breaks down what that layer is made of and how it is bound together. A brief summary lives in the project’s executive overview (in Croatian).

Life cycle of every change

contextplanworkcheckguardlearning

Context loaded in every session

CLAUDE.md
Project constitution: 8 principles, one-way data flow, terminology and directory rules. Applies to all.
CLAUDE.local.md
Truth about the machine: is R available, where the corpus is, which paths. So the same agent behaves correctly on different computers.
MEMORY.md
Shared log of lessons learned ([LEARN]). Records incidents and fixes; shared by the whole team.

Loaded automatically, before every task — the agent knows the project, the machine, and past lessons.

The agentic layer watches every transition in the one-way chain

Agentic layer · watches every transition RulesSkillsChecksGuards
  1. Collectionvendor xlsx → accumulator
  2. Filtering119 terms + model ≥0.70
  3. Official corpus413,985 × 54gitignored · derived
  4. AggregatesR/03_aggregate.Rpublic · CC BY 4.0
  5. Pagespages/**.qmd → docs live site

The loop closes: lessons return to MEMORY.md — rules improve over time. Numbers in the text must be computed from aggregates, never typed by hand.

Four organs of the layer — rules, skills, checks, guards

Rules

standing orders
6 rules · self-loading
  • plan-first alwaysA plan before every non-trivial change; a hard gate on corpus operations.
  • data-pipeline R · data/Protects the accumulator, the two-stage inclusion rule and the derived corpus; backup and delta report.
  • quarto-verification .qmdRender before "done"; a render must not change data.
  • voice-and-style pages/House voice, terminology, number formatting.
  • croatian-encoding textUTF-8 discipline; č ć ž š đ through the whole chain.
  • exploration-protocol explorations/Sandbox rules; never writes into data/, pages/, docs/.

Passive knowledge: some rules always apply, others activate by which files you touch.

Skills

skills
14 skills · user-invoked
  • Publishing & data 4/deploy · /render-page · /refresh-data · /commit
  • Analysis 3/data-analysis · /check-lexicon · /disclosure-check
  • Review 2/review-page · /review-paper
  • Research 3/new-study · /lit-review · /research-ideation
  • Maintenance 2/capture-environment · /context-status

Codified procedures for recurring operations — they orchestrate rules and agents for one task.

Checks

review agents
5 agents · read-only
  • verifier haikuDid the render/script actually succeed; did a render touch data.
  • numeric-claim sonnetRe-derives every published number from the public aggregates.
  • r-reviewer sonnetR code: paths, seed, silent row loss, speed on 413,985 posts.
  • croatian-nlp opusEncoding, morphology, lexicon joins, sampling.
  • religion-media opusConstructs, claim↔data, typology, adversarial referee.

The agent that did the work is not the one that checks it — every check starts from fresh context.

Guards

hard guards
hook · deny-list · plan-gate
  • git_data_guard.py pretooluseIntercepts every command; blocks deleting the corpus or backups.
  • docs-wipe guardStops a commit that would delete ≥3 pages of the live site.
  • git add — no "-A"No uncontrolled staging; explicit paths only.
  • deny-listforce-push · reset --hard · clean -f · rm -rf — hard-forbidden.
  • defaultMode: planEvery session starts in plan mode, not in edit mode.

Deterministic — plain Python, not a model. The agent cannot talk its way past them.

Hard gate — human in the loop

The riskiest, irreversible operations the agent does not perform alone: the project lead approves them personally — overwriting the corpus · running R/03_aggregate.R · a full render over docs/ · rewriting git history. The agentic layer speeds up the work; responsibility and interpretation stay human.

The rules are public· CLAUDE.md in the repository· .claude/ (rules · agents · skills · hooks)· DigiKat· CC BY 4.0

How to read the diagram

The diagram follows a single change through its life cycle. First the context loads, three project files that tell the agent what the project is, which machine it is running on, and what the team has learned so far. Then a one-way chain carries the data from raw exports to published pages. The arrows point in one direction only, and a downstream artifact is never hand-edited. Above the chain sits the agentic layer, which watches every transition between stages. Finally the loop closes. Whatever is learned during the work returns to a shared log, so the rules improve over time.

The five parts of the layer

Context is three files loaded in every session. CLAUDE.md is the project constitution, holding the principles, data flow and terminology that apply to everyone. CLAUDE.local.md describes the individual machine (is R available, where the corpus lives), so the same agent behaves correctly even on a computer without the data. MEMORY.md is the shared log of lessons learned.

Rules are standing orders that shape every change. There are six. Some always apply (a plan before non-trivial work), while others activate according to which files are touched, among them the data-pipeline protocol for R/ and data/, render verification for .qmd, house voice and style for pages, and Croatian-encoding discipline for every text.

Skills are codified procedures, fourteen of them, that the user invokes with a command for operations that recur. They group into five families, namely publishing and data (/deploy, /render-page, /refresh-data, /commit), analysis (/data-analysis, /check-lexicon, /disclosure-check), review (/review-page, /review-paper), research (/new-study, /lit-review, /research-ideation) and maintenance (/capture-environment, /context-status). Each skill wires the right rules to the right agents for one task, for example safely appending new data, or publishing a page with all the checks switched on.

Checks are performed by five independent, read-only agents. These are a mechanical check that a render or script truly succeeded, a re-derivation of every published number from the public aggregates, an R-code review, and two domain reviews covering computational linguistics and the sociology of religion and media. The key principle is that the agent which did the work is never the one that checks it.

Guards are hard limits enforced not by a model but by a plain script. Before every command a hook intercepts the work and blocks deletion of the corpus or its backups, uncontrolled staging into git, and any commit that would delete published pages. A deny-list disables the most dangerous commands, and every session starts in plan mode.

How it all binds together

The layer can be read in three ways, all three true at once.

Separation of powers. Context and rules are the law. The main agent is the executive that acts, the reviewing agents are an independent judiciary that does not edit but only judges, and the hooks and deny-list are constitutional limits that cannot be lifted at run time. The project lead is the final authority, so irreversible operations require personal approval.

Defense in depth. Around the irreplaceable core, the corpus and the live site, stand four concentric rings. These are soft guidance (rules), codified procedure (skills), independent review (checks) and a deterministic block (guards). A change must pass through all of them. The outer ring is not a model, so it cannot be talked around.

A governed loop. The agentic layer mirrors the one-way data flow, but for oversight. It guards every transition and closes the circle by returning lessons to MEMORY.md. In this way the constitution itself improves over time.

What the agentic layer does not do

The layer safeguards the process, not the truth. It guarantees that numbers are computed rather than typed by hand, that a render is verified, and that the corpus has a backup, but the labels, the interpretations and the final decisions remain human. It is disciplining scaffolding, not an autonomous researcher. That is why the most sensitive steps (changing the inclusion rule, overwriting the corpus, publishing the whole site) are exempt from automation and tied to the project lead’s explicit approval.

Everything is public

The entire layer is part of the open repository. Rules, agents, skills and guards live in the .claude/ directory, and the project constitution in CLAUDE.md. This page, too, was built within that layer, with a plan stored in the repository and under automatic checks.