Set up Fidel with an AI coding agent
A coding agent can do most of the setup. Three steps need a person in a browser: signing in, installing the GitHub App and, if init asks for it, linking the repository. npx usefidel init stops when it has no interactive terminal, so the agent hands that step to the person.
Prompt to give your agent
Set up Fidel design system checks in this repository by following
https://usefidel.com/docs/ai-agents.md. Stop and ask me whenever a step
needs me to sign in or approve something in the browser.
Steps for the agent
Check the prerequisites.
node --version # must be v24 or later git remote get-url origin # must be a GitHub repositoryAsk the person to run
initin their own terminal, from the repository root:npx usefidel initIt opens the browser for sign-in (email or Google). If no browser can open, it prints a URL to visit. Wait until the person confirms it finished, then read what it printed about anything still missing.
Check the two files it wrote.
fidel.config.jsonmust contain a non-emptydesignSystemChecksarray, a non-emptychecksarray, or both..github/workflows/fidel.ymlshould match:name: Design Validation on: pull_request: types: [opened, synchronize] permissions: contents: read pull-requests: write id-token: write jobs: fidel: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: usefidel/fidel-action@v3Keep
id-token: write. Fidel uses it to authenticate the workflow without a stored secret.Ask the person to install the GitHub App on this repository: github.com/apps/use-fidel. If
initsaid the repository is not linked, ask them to runnpx usefidel linktoo.Open a test pull request. Commit both files on a new branch together with a change to a frontend file (for example a
.tsxor.cssfile). A pull request that changes onlyfidel.config.jsondoes not start a check.git switch -c add-fidel git add fidel.config.json .github/workflows/fidel.yml git commit -m "Add Fidel design validation" git push -u origin add-fidel gh pr create --fillConfirm it ran. Fidel posts one comment on the pull request and updates it on each push.
gh pr view --commentsIf there is no comment, check the workflow run with
gh run list --workflow fidel.ymland look the error up in Troubleshooting.
Rules for agents
- Don't set
failOnDrifttotrueunless the person asks. Comments only is the default for a reason: teams review findings before blocking merges. - Never put a secret in a
urlinfidel.config.json. URLs are fetched, stored with the run and linked from the pull request comment. Use{pr},{branch}or{sha}for preview URLs. - Don't remove permissions from the generated workflow.
- Don't edit
.github/workflows/fidel.ymlif it already existed.initnever overwrites it.