This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Credentials Repository — Central repository for verifiable credential schemas and artifacts for the ENVITED-X Ecosystem. Contains LinkML schema definitions, generated OWL/SHACL/JSON-LD artifacts, and example credentials.
Key submodules:
submodules/harbour-credentials— Cryptographic signing/verification library (Python + TypeScript)submodules/harbour-credentials/submodules/ontology-management-base— Ontology validation pipeline (nested)submodules/harbour-credentials/submodules/w3id.org— W3ID redirect rules (nested)submodules/harbour-credentials/submodules/ontology-management-base/submodules/service-characteristics— Gaia-X service characteristics schemas (deeply nested)
Always use make targets — never call generators, linters, or test runners
directly (e.g. gen-owl, gen-shacl, python -m). Each repository in the
submodule chain has its own Makefile with a consistent command surface. Run
make help to discover available targets.
# Install dev dependencies
make setup
make install dev
# Generate artifacts from LinkML schemas
make generate # all domains
make generate DOMAIN=<name> # single domain (OMB)
make generate gx # Gaia-X from service-characteristics (OMB)
# Run validation pipeline
make validate
# Lint and format
make lint
make format
# Run tests
make test
# Run tests with coverage
pytest tests/ --cov=src --cov-report=htmlThe make targets handle virtualenv activation, correct flags, line-ending
normalisation, and cross-platform path issues. Bypassing them risks producing
artifacts with wrong line endings, missing flags, or inconsistent output.
credentials/
├── linkml/ # LinkML schema definitions (.yaml)
├── artifacts/ # Generated OWL, SHACL, JSON-LD context files
├── examples/ # Example credential instances
├── src/ # Python source code
├── tests/ # Pytest tests
├── docs/ # MkDocs documentation
├── manifests/ # Wallet rendering manifests
└── submodules/
└── harbour-credentials/ # Signing library
├── submodules/ontology-management-base/ # Validation pipeline (nested)
│ └── submodules/service-characteristics/ # Gaia-X schemas (nested)
└── submodules/w3id.org/ # W3ID redirect rules (nested)
- Define credential types in
linkml/*.yaml - Run
make generateto produce:artifacts/{domain}/{type}.owl.ttl— OWL ontologyartifacts/{domain}/{type}.shacl.ttl— SHACL shapesartifacts/{domain}/{type}.context.jsonld— JSON-LD context
- Create example instances in
examples/ - Validate with
make validate
# From harbour-credentials (after pip install -e submodules/harbour-credentials)
from harbour.keys import generate_p256_keypair, p256_public_key_to_did_key
from harbour.signer import sign_vc_jose
from harbour.verifier import verify_vc_jose
from harbour.sd_jwt import issue_sd_jwt_vc, verify_sd_jwt_vc
# From credentials modules
from src.generate_artifacts import main as generate_artifacts- Python 3.12+ with type hints on public APIs
- pathlib.Path (never
os.path) - 4-space indentation
- Conventional commits —
feat:,fix:,docs:,chore:,refactor:,test:
STRICT REQUIREMENTS:
- ✅ Always sign commits with
-s -Sflags (Signed-off-by + GPG signature) - ❌ Never include AI attribution — no
Co-Authored-By,Generated-By, or similar headers mentioning AI assistants (Claude, Copilot, ChatGPT, etc.) - ❌ Never mention AI tools in commit messages — do not reference that code was AI-generated or AI-assisted
- ✅ Author must be the human developer with official email address
# Correct commit command
git commit -s -S -m "feat: add new credential type"When making changes to the codebase, create/update these files in .playground/ (gitignored):
| File | Purpose |
|---|---|
.playground/commit-message.md |
Conventional commit message, ready for git commit -s -S |
.playground/pr-description.md |
PR description following any existing PR template |
When instructed to prepare a commit or PR, default to updating these files first. After explicit human confirmation in the current session, the agent may use them to create the signed commit, push the branch, and open the PR directly. Otherwise, create these files for human review. The operator will either:
- Use them to manually commit/push and create a PR,
- Ask the agent to perform the signed commit/push/PR flow directly after explicit confirmation, or
- Use automated tooling with signed commits (
git commit -s -S)
Read these before making changes:
| Topic | File |
|---|---|
| Agent instructions | AGENTS.md |
| Documentation | docs/index.md |
- ❌ Modifying generated files in
artifacts/directly (regenerate withmake generate) - ❌ Calling generators directly (
gen-owl,gen-shacl,python -m) — always usemaketargets - ❌ Forgetting to update examples when changing schemas
- ❌ Using
os.pathinstead ofpathlib.Path - ❌ Committing without signing (
-s -S) - ❌ Pushing without running
make test/make validatelocally first - ❌ Cascading submodule pins before the inner layer's CI is green
- ❌ Accepting a solution as "done" without observing CI results
- ❌ Using
range: Anyin LinkML — always choose a spec-aligned range (uri, named class, etc.) - ❌ Adding types, ranges, or properties without cross-referencing the spec in
docs/
STRICT REQUIREMENT — never push without local verification.
Before pushing any branch or accepting a solution as complete, the agent must:
-
Run tests locally (
make test) in the affected repository and confirm they pass -
Run validation locally (
make validate) when schemas or artifacts changed -
Run lint locally (
make lint) to catch formatting issues -
Regenerate artifacts (
make generate) when LinkML schemas changed, and verify the generated output is as expected -
Run GitLab CI locally when changing
.gitlab-ci.ymlor CI-related files inservice-characteristics:# Requires: npm install -g gitlab-ci-local # Requires: rsync (via msys2: pacman -S rsync, or apt: apt install rsync) # Requires: Docker/Podman for container-based jobs gitlab-ci-local # run all jobs gitlab-ci-local --job test-shacl # run a single job gitlab-ci-local --list # list available jobs
Note: On corporate networks, Docker image pulls may require proxy configuration. If
gitlab-ci-localcannot pull images, verify the CI changes are correct by inspection and note the limitation in the PR. -
Check submodule CI — after pushing a submodule branch, observe the CI pipeline (GitHub Actions / GitLab CI) and wait for it to go green before cascading pins to the next layer. Do not assume CI will pass; check it.
For the multi-layer submodule chain (service-characteristics → OMB → harbour-credentials → credentials), this means:
- Fix and test at the innermost affected layer first
- Push that layer, observe its CI, confirm green
- Only then update the submodule pin in the next layer up
- Repeat until all layers are green
Never skip local testing with the assumption that CI will catch issues. CI is a safety net, not a substitute for local verification.