# Github preset

GitHub's repository objects, as entity kinds. Pass to EntityKindsProvider: `<EntityKindsProvider kinds={githubKinds}>`. The nouns are GitHub's own: a repository holds a project's files and history, an issue is a suggested improvement, task or question, a pull request is a proposed change, a commit is one change to a set of files, a branch is a parallel version of a repository, a workflow run is one execution of a GitHub Actions workflow, and a release packages software for its users.

- Registry name: `github-preset` (`@candor/github-preset`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/github-preset

## Install

```bash
npx candor-ui add github-preset
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/github-preset`.
It brings in: entity-chip, fill-strings, tokens.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { EntityChip, EntityKindsProvider } from "@/components/candor/entity-chip"
import { githubKinds } from "@/components/candor/github-preset"

export default function Example() {
  return (
    <EntityKindsProvider kinds={githubKinds}>
      <p className="flex max-w-lg flex-wrap items-center gap-2 text-sm">
        <EntityChip entity={{ kind: "repository", name: "candor-ui" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "issue", name: "#212 Chip truncates" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "pullRequest", name: "#219 Fix truncation" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "commit", name: "3ae25b6" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "branch", name: "release/2.0" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "workflowRun", name: "CI #1432" }} onOpen={() => {}} />
        <EntityChip entity={{ kind: "release", name: "v2.0.0" }} onOpen={() => {}} />
      </p>
    </EntityKindsProvider>
  )
}
```

## Values

### githubKinds

```ts
const githubKinds: Record<string, EntityKindInfo>
```

### githubNouns

GitHub's nouns for LocaleProvider's `nouns`: agents act in a repository, which an organization owns.

```ts
const githubNouns: Partial<NounTable>
```

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider`: its fixed strings in `strings`, its nouns in `nouns`; entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
