# Adoption Guide This guide shows another repo how to adopt Railiance Fabric declarations without reading Railiance Fabric source code. ## 1. Add The Directory Layout Create the declaration directories in your repo: ```text fabric/ services/ capabilities/ interfaces/ dependencies/ bindings/ ``` Start with only the files you need. A repo can adopt Fabric with one service and one capability, or with one dependency on a capability provided elsewhere. ## 2. Declare A Service Create `fabric/services/-.yaml`: ```yaml apiVersion: railiance.fabric/v1alpha1 kind: ServiceDeclaration metadata: id: your-repo.your-service name: Your Service owner: your-repo repo: your-repo domain: railiance source_links: - label: Service README path: README.md spec: lifecycle: active environments: [dev, staging, prod] description: What this service does. service_type: app-service provides_capabilities: [] exposes_interfaces: [] ``` Use lower-case dotted IDs. Prefer IDs that begin with the owning repo slug. ## 3. Declare A Provided Capability Create `fabric/capabilities/-.yaml`: ```yaml apiVersion: railiance.fabric/v1alpha1 kind: CapabilityDeclaration metadata: id: your-repo.your-service.runtime-secrets name: Runtime secrets owner: your-repo repo: your-repo domain: railiance source_links: - label: Capability docs path: docs/runtime-secrets.md spec: lifecycle: active environments: [dev, staging, prod] description: What this capability provides. capability_type: runtime-secrets service_id: your-repo.your-service interface_ids: - your-repo.your-service.kv-v2 criticality: high data_classification: secret ``` Pick `capability_type` from `catalog/capability-types.yaml`. ## 4. Declare An Interface Create `fabric/interfaces/-.yaml`: ```yaml apiVersion: railiance.fabric/v1alpha1 kind: InterfaceDeclaration metadata: id: your-repo.your-service.http-api name: Your Service HTTP API owner: your-repo repo: your-repo domain: railiance source_links: - label: API docs path: docs/api.md spec: lifecycle: active environments: [dev, staging, prod] description: How consumers call this interface. interface_type: http-api version: v1 service_id: your-repo.your-service capability_ids: - your-repo.your-service.some-capability auth: method: oidc data_classification: internal ``` Pick `interface_type` from `catalog/interface-types.yaml`. ## 5. Declare A Dependency Create `fabric/dependencies/-.yaml`: ```yaml apiVersion: railiance.fabric/v1alpha1 kind: DependencyDeclaration metadata: id: your-repo.your-service.needs-runtime-secrets name: Runtime secrets dependency owner: your-repo repo: your-repo domain: railiance source_links: - label: Deployment values path: deploy/values.yaml spec: lifecycle: active environments: [dev, staging, prod] consumer_service_id: your-repo.your-service requires: capability_type: runtime-secrets interface: type: openbao-kv-v2-mount version_constraint: ">=v1