Skip to content

Examples

llms.txt lists every page for an agent
Optional: hand this page to your coding agentThe steps work by hand too.
Show the whole prompt
Read https://intentius.io/chant/lexicons/github/examples/.
Write the workflow I describe in src/, starting from the closest example under lexicons/github/examples/ in https://github.com/INTENTIUS/chant.
Run `npx chant build src --lexicon github -o .github/workflows/ci.yml` and `npx chant lint src` until both pass, and open a pull request with the source and the workflow.
Never deploy to a real cloud account or shared environment (with `chant run`, `chant components` or a platform's own CLI), approve (a pull request review, `chant approve` or `chant run approve`), override a policy denial (`chant approve policy-override`), or merge; never cut or publish a release (`chant release cut --yes` or `chant release publish`), push or delete a `ci/*` tag (`chant ci tick` pushes them), or change the value of an existing flag; never touch `.chant/allowed_signers` or `chant/lifecycle`.

Runnable examples live in the lexicon’s examples/ directory. Clone the repo and try them:

Terminal window
cd examples/getting-started
npm install
chant build # produces .github/workflows/ci.yml
chant lint # runs lint rules
npx vitest run # run the tests

examples/getting-started/: a CI workflow with build and test steps for a Node.js project.

src/
└── ci.ts # Workflow + Job definitions
ci.ts
import { Workflow, Job, Step, Checkout, SetupNode } from "@intentius/chant-lexicon-github";
export const workflow = new Workflow({
name: "CI",
on: {
push: { branches: ["main"] },
pull_request: { branches: ["main"] },
},
permissions: { contents: "read" },
});
export const build = new Job({
"runs-on": "ubuntu-latest",
timeoutMinutes: 15,
steps: [
Checkout({}).step,
SetupNode({ nodeVersion: "22", cache: "npm" }).step,
new Step({ name: "Install", run: "npm ci" }),
new Step({ name: "Build", run: "npm run build" }),
new Step({ name: "Test", run: "npm test" }),
],
});

chant build produces .github/workflows/ci.yml:

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm test

Patterns demonstrated:

  1. Typed composites — Checkout({}) and SetupNode({...}) instead of raw uses: strings
  2. Permissions — explicit contents: read following least-privilege
  3. Timeout — timeoutMinutes: 15 prevents runaway jobs
  4. Trigger scoping — push and PR on main only

chant