culture-rules
Rules engine for the AgentCulture mesh: rules → conditions → workflows →
actions, carried out by actors (agents, humans, code, services,
robots, …). It is a Python backend library, culture_rules, plus a
Node.js + React Flow visual editor with three tabs: Rules | Workflows |
Actors.
Status: scaffold. This repo was provisioned from
culture-agent-template. The agent-first CLI, mesh identity, skill kit and CI/publish baseline are in place. The engine, HTTP API and editor are planned and not built yet. The build brief is #1, and the product model and UX are #2.
The model (planned)
A rule says when work happens, and reads as a small flow:
PR approved → base = main → Review PR → Comment
trigger condition workflow action
| Concept | What it is |
|---|---|
| Rule | A trigger, an optional condition, a workflow and/or an action. A rule can follow another rule (must run after / may run after) and consume its exported outputs. |
| Condition | A serialisable predicate over the trigger and context. It is edited graphically in common cases and never evaluated with eval(). |
| Workflow | Reusable how: inputs, internal variables, steps (sequence, branch, wait, agent/code/human work) and outputs. It doesn't know what triggered it. |
| Action | A concrete side effect: post a comment, transition a ticket, send a message, call a service, run code, ask a human. |
| Actor | Who/what can do the work: agent, human, service/daemon, runner, robot. Actors carry capabilities. They are not a stage in the rule chain. |
Human actors make runs long-running and asynchronous, so the engine will persist run state rather than hold it in memory.
The editor (planned)
The editor has exactly three primary tabs:
- Rules shows each rule as a compact graphical flow, and grows new rules progressively.
- Workflows is the React Flow canvas. Inputs, outputs and variables are mapped visually.
- Actors is the registry of actors and their capabilities.
Run history and debugging appear in context, never as extra tabs. The design goal is a visual composition tool, not an admin dashboard:
- large type and large targets;
- minimal chrome and prose;
- smooth transitions;
- keyboard- and reduced-motion-accessible.
Quickstart (what works today)
uv sync
uv run pytest -n auto # run the test suite
uv run culture-rules whoami # identity from culture.yaml
uv run culture-rules learn # self-teaching prompt (add --json)
uv run teken cli doctor . --strict # the agent-first rubric gate CI runs
CLI
| Verb | What it does |
|---|---|
whoami |
Report this agent's nick, version, backend, and model from culture.yaml. |
learn |
Print a structured self-teaching prompt. |
explain <path> |
Markdown docs for any noun/verb path. |
overview |
Read-only descriptive snapshot of the agent. |
doctor |
Check the agent-identity invariants (prompt-file-present, backend-consistency). |
cli overview |
Describe the CLI surface itself. |
Every command supports --json. Results go to stdout, and errors and
diagnostics go to stderr; the two are never mixed. Exit codes: 0
success, 1 user error, 2 environment error, 3+ reserved. Rule,
workflow and actor verbs will follow the same contract, with writes
dry-run by default and --apply to commit them.
Prompt files by harness
Four harnesses read four root files, with no shared base. Each file is
read by exactly one harness, and there is intentionally no AGENTS.md:
| Harness | File(s) |
|---|---|
| Claude Code | CLAUDE.md (the mesh-resident prompt, and the fullest write-up) |
| Pi / associate | AGENTS.override.md + .pi/SYSTEM.md |
| colleague | AGENTS.colleague.md |
| Qwen Code | QWEN.md |
There are two separate selections over this clone:
- The interactive harness: whichever binary you run. All four are live at once.
- The mesh resident: the
backendthatculture.yamldeclares, hereclaude.
See docs/harness-selection.md and
docs/automation-contract.md.
Skills
.claude/skills/ vendors 19 skills (cite-don't-import), including the
devague workflow (scope → think → spec-to-plan →
assign-to-workforce), which drives the build. See
docs/skill-sources.md for provenance and the
re-sync procedure.
Contributing
See CLAUDE.md for the conventions:
- every PR bumps the version;
- PRs go through the
cicdlane; - worktree layout and memory discipline.
License
Apache 2.0 — see LICENSE.
Metadata
Release files for culture-rules 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| culture_rules-0.9.1.tar.gz | 240.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| culture_rules-0.9.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 264.9 kB
Release files / culture_rules-0.9.1.tar.gz
| Download URL | culture_rules-0.9.1.tar.gz |
|---|---|
| Size | 240.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b7a3de760e3e23b5d36af503a9a30214cea5b08c6a099f5774cb5282576004c
|
|
BLAKE2b-256 checksum How to use checksums |
258fdebc7e713ef37329f9cc6aad4e702ea0ccd95ecac175f27aed3ffabb1632
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / culture_rules-0.9.1-py3-none-any.whl
| Download URL | culture_rules-0.9.1-py3-none-any.whl |
|---|---|
| Size | 24.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d2a16d90f4494a2bda6bb7b7a400b999a12b2904e63c121e7d72222ef022254
|
|
BLAKE2b-256 checksum How to use checksums |
6311ff704f1fa81d3da33b39d7121a4e0b5bcc2924638357cef3f09e1dc52cef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|