agentleFS
Bhanuj-AIBhanuj-AI/ai-governance-oss/skills/domain-feature/SKILL.md

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.

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
  1. Very specific:

    Read root AGENTS.md and src/ai_governance/domain/AGENTS.md.

    line 13
  2. Distinctive:

    Prefer named types over an unstructured dictionary for stored or public contracts.

    line 16
  3. Distinctive:

    Keep the model deterministic and free of I/O.

    line 20
  4. Distinctive:

    Add a focused unit test for every new invariant and transition.

    line 23
  5. Distinctive:

    Place the rule beside the data it protects.

    line 30
  6. Distinctive:

    Keep lifecycle methods narrow: validate the current state, construct the next valid state, and return or persist it through the owning …

    line 52
  7. Distinctive:

    Every new invariant has an isolated test.

    line 57
  8. Distinctive:

    Use the nearest unit test.

    line 65

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Domain Feature

Model the business rule before choosing a route, database schema, worker, or provider integration.

Workflow

  1. Read root AGENTS.md and src/ai_governance/domain/AGENTS.md. Read the scoped instruction file for any other layer that will consume the model.
  2. Identify the durable concepts, their valid states, and invalid transitions. Prefer named types over an unstructured dictionary for stored or public contracts.
  3. Implement validation in the value object or entity constructor and make invalid transitions fail explicitly.
  4. 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.
  5. Add a focused unit test for every new invariant and transition. Use a service test only when the rule requires application orchestration.
  6. 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.py

Also run the focused service test whenever the new domain rule changes a use-case outcome.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.