domain-feature
Skill2 starsChanged 4 months agoApache-2.0View on GitHub
Add or change a deterministic AI Governance Control Plane domain entity, value object, lifecycle transition, validation rule, domain error, or domain-level invariant. Use when work belongs in src/ai_governance/domain or a domain-focused package and must remain independent of transport, persistence, workers, and provider SDKs.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- console/AGENTS.mdAGENTS.md
- keycloak-postgres/AGENTS.mdAGENTS.md
- api-changeSkill
- governance-policySkill
- keycloak-service-identitySkill
- model-runtime-capability-profileSkill
- tenant-isolationSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Read root AGENTS.md and src/ai_governance/domain/AGENTS.md.
- Distinctive: line 16
Prefer named types over an unstructured dictionary for stored or public contracts.
- Distinctive: line 20
Keep the model deterministic and free of I/O.
- Distinctive: line 23
Add a focused unit test for every new invariant and transition.
- Distinctive: line 30
Place the rule beside the data it protects.
- Distinctive: line 52
Keep lifecycle methods narrow: validate the current state, construct the next valid state, and return or persist it through the owning …
- Distinctive: line 57
Every new invariant has an isolated test.
- Distinctive: line 65
Use the nearest unit test.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Domain Feature
Model the business rule before choosing a route, database schema, worker, or provider integration.
Workflow
- Read root
AGENTS.mdandsrc/ai_governance/domain/AGENTS.md. Read the scoped instruction file for any other layer that will consume the model. - Identify the durable concepts, their valid states, and invalid transitions. Prefer named types over an unstructured dictionary for stored or public contracts.
- Implement validation in the value object or entity constructor and make invalid transitions fail explicitly.
- Keep the model deterministic and free of I/O. Do not import FastAPI, database drivers, HTTP clients, worker code, environment configuration, concrete repositories, or provider SDKs.
- Add a focused unit test for every new invariant and transition. Use a service test only when the rule requires application orchestration.
- Adapt the new type at the service and transport boundaries rather than leaking persistence representation into the domain.
Invariant pattern
Place the rule beside the data it protects. The existing dataset test shows the desired shape: construct the named model and assert the invariant directly.
def test_dataset_requires_non_negative_record_count() -> None:
with pytest.raises(ValueError):
Dataset(
dataset_id="dataset-1",
name="support-faq",
version="2026-06-26",
description="Evaluation baseline",
storage_uri="s3://datasets/support-faq/2026-06-26.parquet",
storage_type="S3",
schema_version="v1",
record_count=-1,
checksum="sha256:abc123",
creator="dataset-owner",
created_at=datetime(2026, 6, 26, tzinfo=UTC),
status=DatasetStatus.DRAFT,
)Keep lifecycle methods narrow: validate the current state, construct the next valid state, and return or persist it through the owning application service.
Done when
- Every new invariant has an isolated test.
- The domain package has no infrastructure imports.
- A transition cannot silently enter an invalid state.
- The model does not expose a database row, API payload, or provider object as its public representation.
Verify
Use the nearest unit test. The following current command validates a domain invariant end to end:
uv run ruff check src/ai_governance/domain
uv run pytest tests/unit/test_dataset_domain.pyAlso run the focused service test whenever the new domain rule changes a use-case outcome.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

