Skip to content
safran

Type to search. Enter opens the first result.

    Profile reference

    Every key a profile can have, in the order they usually appear. For a complete example and how the file is found and validated, read The profile first.

    Top-level keys

    The top level is strict: a key that is not in this table is an error.

    KeyTypeRequiredDefaultWhat it is
    versionthe number 1yes—Schema version of the file.
    companyslugyes—A short name for the company.
    languagesobjectno{ tickets: en, code: en }Language of tickets and of code.
    trackerslist of entriesno[]Where tickets are read from.
    codeobjectno{ hosts: [], groups: {} }Code hosts and repository groups.
    docslist of entriesno[]Doc sources tickets link to.
    teamslistno[]Who owns which projects and repositories.
    glossarylistno[]Ticket words and their code-side words.
    conventionslist of stringsno[]Rules the skills quote to the agent.
    embeddingsone entryno{ type: ollama, model: bge-m3 }The embedder for code search.
    pluginslist of stringsno[]Extra plugin modules to load.

    A slug matches ^[a-z0-9][a-z0-9-]*$: lowercase letters, digits and dashes, not starting with a dash.

    version

    Always 1. Any other value fails with version: Invalid input: expected 1.

    company

    A slug. It is shown by safran status and safran profile check, returned by the get_company_profile tool, and handed to every plugin as context.

    company: acme

    languages

    FieldTypeWhat it is
    tickets2-character stringISO 639-1 code of the language tickets are written in. Skills write their output in it.
    code2-character stringISO 639-1 code of the language of identifiers and comments.

    The schema checks the length only. When you write languages, write both fields: the default applies to the whole object, not to each field.

    languages:
      tickets: tr
      code: en

    trackers

    A list of tracker entries. Every entry has these fields; the rest depend on type.

    FieldTypeRequiredDefaultWhat it is
    idslugyes—Your name for this tracker. Unique among trackers. Shown in output and used to say which tracker a reference belongs to.
    typestringyes—The plugin that handles the entry: jira, azure-boards, linear, github-issues, or a type of your own plugin.
    projectslist of stringsno[]Project or team keys this tracker owns.

    projects does three jobs. It routes a ticket key to its tracker (PAY-1423 goes to the tracker that lists PAY), it is the set of keys recognised in pull request titles, branch names and descriptions when work history is built, and it is what teams[].projects is checked against. Keys are compared without regard to case.

    id: jira
    type: jira
    url: https://acme.atlassian.net
    email_env: JIRA_EMAIL
    token_env: JIRA_TOKEN
    projects: [PAY, MOB, WEB]

    Type-specific fields: Jira, Azure Boards, Linear, GitHub Issues.

    code.hosts

    A list of code host entries. code itself is strict and has exactly two keys, hosts and groups.

    FieldTypeRequiredDefaultWhat it is
    idslugyes—Your name for this host. Unique among code hosts. Also the directory name of its clones under the data directory.
    typestringyes—azure-repos, github, gitlab, local, or a type of your own plugin.
    includelist of globsno[]Keep only repositories whose name matches one of these. Empty means all.
    excludelist of globsno[]Drop repositories whose name matches one of these. Wins over include.
    id: azure
    type: azure-repos
    organization: acme
    project: Platform
    token_env: AZURE_DEVOPS_PAT
    include: ["payments-*", "ledger", "web-app"]
    exclude: ["*-archive"]

    How include and exclude match

    • * stands for any run of characters (including none), ? for exactly one character. Everything else is literal. There are no character classes, no **, no negation.
    • A pattern must cover the whole name: payments does not match payments-api; payments* does.
    • Matching ignores case.
    • Each pattern is tried against the repository's short name (payments-api) and against its host-qualified name (for example acme/Platform/payments-api); matching either is enough.
    • exclude is applied first. A repository that matches an exclude pattern is dropped even if an include pattern names it.

    The filter is applied by Safran after the host lists its repositories, so it works the same for every code host type, including your own plugins. safran repos shows what is left.

    When two hosts list a repository with the same short name, the host that comes first in the profile keeps the short name and the later one is named <hostId>/<name>.

    Type-specific fields: Azure Repos, GitHub, GitLab, Local directories.

    code.groups

    A map from a group name to a list of repository names. A repository may sit in several groups. Group names are free text; repository names are the short names safran repos prints.

    code:
      groups:
        backend: [payments-api, ledger]
        mobile: [acme-ios, acme-android]
        frontend: [web-app, admin-panel]

    Groups scope a search: safran search "kısmi iade" --group backend, groups in the SDK, the groups parameter of search_code. Several groups widen the scope; a group together with an explicit repository list narrows it to the repositories in both. Naming a group the profile does not define is an INVALID_INPUT error that lists the known groups.

    The profile schema does not check that a repository named in a group exists on a code host: the hosts are not called during validation. A misspelled name simply never matches.

    docs

    A list of doc source entries: places tickets link to. Pages are fetched only when a ticket references them.

    FieldTypeRequiredWhat it is
    idslugyesYour name for this source. Unique among doc sources.
    typestringyesconfluence, or a type of your own plugin.
    id: wiki
    type: confluence
    url: https://acme.atlassian.net
    email_env: JIRA_EMAIL
    token_env: CONFLUENCE_TOKEN
    spaces: [PAY]

    Type-specific fields: Confluence.

    teams

    A list of teams. Entries are strict: only the fields below.

    FieldTypeRequiredDefaultWhat it is
    namestringyes—The team's name. Unique among teams.
    projectslist of stringsno[]Tracker project keys the team owns.
    reposlist of stringsno[]Repository names the team owns.
    confidencelow, medium or highno—Set by discovery when the mapping was inferred. low must be confirmed by a person.
    sourcestringno—Where the mapping came from, for example 9 ticket-PR links.
    teams:
      - name: Payments
        projects: [PAY]
        repos: [payments-api, ledger]
      - name: Mobile
        projects: [MOB]
        repos: [acme-ios, acme-android]
        confidence: low
        source: 9 ticket-PR links

    confidence and source are written by safran discover. safran profile check and safran owns flag every team with confidence: low until you check the entry and delete the line. How teams answer ownership questions is on Glossary, teams and conventions.

    glossary

    A list of entries. Entries are strict.

    FieldTypeRequiredWhat it is
    termstringyesThe word as people write it in tickets.
    codelist of strings, at least oneyesIdentifiers and words the code uses for it.
    notestringnoA remark for people and for the agent.
    glossary:
      - term: İade
        code: [refund, chargeback]
        note: Partial refunds are "kısmi iade".

    Two terms that are equal after case folding (İade and IADE) count as the same term and are rejected as a duplicate. Matching and expansion are described on Glossary, teams and conventions.

    conventions

    A list of non-empty strings. Safran does not interpret them: the get_company_profile tool returns them, and the skills apply them to what they write.

    conventions:
      - Task titles are written in English.
      - Branch names follow feature/<TICKET-KEY>-short-description.

    embeddings

    One entry (not a list) with a type; the other fields depend on the type.

    type: ollama
    model: bge-m3

    When the key is missing, this exact entry is used. Type-specific fields: Ollama, OpenAI-compatible.

    plugins

    A list of module specifiers: package names, or paths relative to the profile file. Each module is imported, and every export that is a Safran plugin (or an exported list of them) is registered next to the built-in ones. A module that exports no plugin, or a type that is already registered, is an error.

    plugins:
      - ./plugins/acme-tracker.ts

    Importing a module runs its code. The CLI therefore loads plugins: only from a profile you named (--profile, SAFRAN_PROFILE) or when you pass --allow-plugins; see Validation errors. Writing plugins shows how to write one.

    Rules that span entries

    These are checked by the profile schema after the individual fields. The messages are the real ones.

    RuleMessage
    Tracker ids are uniquetrackers: duplicate tracker id "jira"
    Code host ids are uniquecode.hosts: duplicate code host id "azure"
    Doc source ids are uniquedocs: duplicate doc source id "wiki"
    Team names are uniqueteams: duplicate team name "Payments"
    Glossary terms are unique after case foldingglossary: duplicate glossary term "IADE"
    A project key is listed under one tracker only (case ignored)trackers.1.projects: project "pay" is also listed under tracker "jira"; a ticket key must map to one tracker
    A team's project is listed under some trackerteams.0.projects: project "WEB" is not listed under any tracker

    The last rule is only applied when at least one tracker lists a project. A profile with teams and no tracker projects yet is accepted.

    Ids are unique per kind, not across kinds: a tracker and a doc source may both be called atlassian.

    The schema as written

    This is the schema from the source. TrackerEntry, CodeHostEntry, DocSourceEntry, Team and GlossaryEntry in @safran/profile are the types of its parts; Profile is its output and ProfileInput what you may write.

    export const profileSchema; // defined in packages/profile/src/schema.ts
    
    export const DEFAULT_EMBEDDINGS = { type: "ollama", model: "bge-m3" } as const;

    defined in packages/profile/src/schema.ts

    /** A validated profile: defaults applied, connector entries still carrying their type-specific fields. */
    export type Profile = z.output<typeof profileSchema>;
    
    /** What a user may write: every defaulted field optional. */
    export type ProfileInput = z.input<typeof profileSchema>;

    defined in packages/profile/src/schema.ts

    Common mistakes

    • Writing project: on a tracker. Trackers take projects, a list. (The azure-repos code host accepts project as shorthand for a single entry of its own projects; that is a field of that connector, not of the profile.)
    • Listing only one of languages.tickets and languages.code. Both are required once the key is present.
    • Expecting include: [payments] to match payments-api. Patterns cover the whole name.
    • Putting a token in the file. _env fields hold a variable name; see Secrets.