Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cigen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ input_groups:
- "docs/src/content/docs/**/*.md"
- "docs/src/content/case-studies/**/*.md"
- "docs/src/content/compare/**/*.md"
- "docs/src/content/blog/**/*.md"
- "docs/src/examples/*.yml"

docs:
Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ pnpm --dir docs build # writes docs/dist
cigen fits better, when to pick which, and what cigen can't do yet. `checked` is the date its claims were last
checked against the tool's docs: recheck them, and update the date, when you edit a page. Name other tools in plain
text, without their logos.
- **Blog posts** are Markdown in `src/content/blog/`, served at `/blog/<name>/` and listed in `/rss.xml`. A post with
`draft: true` is built by the dev server only. Every claim must hold today (STATUS.md), and every number needs its
source or command.
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@astrojs/markdown-satteri": "0.4.10",
"@astrojs/rss": "4.0.20",
"@astrojs/sitemap": "3.7.7",
"@fontsource-variable/inter": "5.3.0",
"@fontsource-variable/jetbrains-mono": "5.3.0",
Expand Down
94 changes: 94 additions & 0 deletions docs/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/src/components/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { href } from '../lib/docs';
<nav class="footer__links" aria-label="Footer">
<a href={href('/docs/')}>Docs</a>
<a href={href('/compare/')}>Compare</a>
<a href={href('/blog/')}>Blog</a>
<a href={href('/llms.txt')}>llms.txt</a>
<a href={href('/install.md')}>install.md</a>
<a href="https://github.com/DocSpring/cigen">GitHub</a>
Expand Down
1 change: 1 addition & 0 deletions docs/src/components/Nav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const links = [
{ label: 'Docs', to: '/docs/', match: (p: string) => p.includes('/docs/') && !p.endsWith('/roadmap/') },
{ label: 'Roadmap', to: '/docs/roadmap/', match: (p: string) => p.endsWith('/roadmap/') },
{ label: 'Compare', to: '/compare/', match: (p: string) => p.includes('/compare/') },
{ label: 'Blog', to: '/blog/', match: (p: string) => p.includes('/blog/') },
];
---

Expand Down
14 changes: 13 additions & 1 deletion docs/src/content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,16 @@ const compare = defineCollection({
}),
});

export const collections = { docs, caseStudies, compare };
/** Blog posts. A draft is built only by the dev server, never deployed. */
const blog = defineCollection({
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
schema: z.object({
title: z.string(),
description: z.string(),
published: z.coerce.date(),
updated: z.coerce.date().optional(),
draft: z.boolean().default(false),
}),
});

export const collections = { docs, caseStudies, compare, blog };
112 changes: 112 additions & 0 deletions docs/src/content/blog/ci-config-agents-cant-quietly-get-wrong.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: Writing CI config agents can't quietly get wrong
description:
When a coding agent edits CI config, the dangerous mistakes are the silent ones. How cigen turns them into errors an
agent can read and fix, and the gaps it still has.
published: 2026-12-04
---

Coding agents edit CI config as readily as any other file. An agent is good at YAML that looks right, and that's the
problem: CI config that looks right and is wrong often runs anyway. A misspelled key is ignored, a path filter misses
the file that changed, a job skips, and the check is green. Nobody reads the workflow closely enough to notice, because
it passed.

cigen is built for that reader. The aim is that every mistake an agent can make in the config either fails with a
message it can act on or can't happen in the first place. It isn't all the way there, and the gaps are listed at the
end.

## Unknown keys are errors

Every level of a cigen config is strict: the top level, workflow settings, jobs and module parameters. A key cigen
doesn't know is an error that names the file and the key's path, and says what to write instead. Here an agent has
brought a habit from another CI system (`requires`) and mistyped `image`:

```yaml
# cigen.yml
# error: unknown key `requires`
provider: github
workflows:
ci:
jobs:
build:
imgae: rust:1.90
steps:
- run: cargo build
test:
image: rust:1.90
requires: [build]
steps:
- run: cargo test
```

`cigen validate` prints:

```text
error: cigen.yml (at workflows.ci.jobs.build.imgae): unknown key `imgae`
help: did you mean `image`?
error: cigen.yml (at workflows.ci.jobs.test.requires): unknown key `requires`
help: `requires` is now `needs`.

The config has 2 problems. `cigen validate --format json` lists them as data.
```

The suggestions cover three cases: a close match (`imgae`), a key from an older cigen or another CI system (`requires`,
`runs-on`, `resource_class`), and a key that belongs to one provider, which goes into a `github:` or `circleci:` block
instead. Each job is checked on its own, so one broken job doesn't hide the problems in the others.

Steps are the exception. A step keeps every key it's given, so `if:`, `shell:` or `continue-on-error:` reach the
provider untouched, and those keys are part of the job's hash. The GitHub provider still fails on a key a GitHub step
can't have, and names the job and step.

## Errors are data

An agent reads JSON more reliably than prose. `cigen validate --format json` prints the same problems as fields:

```json
{
"valid": false,
"config": "cigen.yml",
"errors": [
{
"file": "cigen.yml",
"line": null,
"path": ["workflows", "ci", "jobs", "build", "imgae"],
"message": "unknown key `imgae`",
"suggestion": "did you mean `image`?"
}
]
}
```

`line` is set for YAML syntax errors. Every command (`generate`, `validate`, `hash`) reports config errors the same way,
and the JSON schemas in the repository's `schemas/v1/` are generated from the same types as the loader, so an editor or
an agent that validates against them agrees with cigen about what's allowed.

## Inputs an agent doesn't have to list

The quietest mistake in skipping CI is an input nobody listed. If a job's `inputs` miss the script it runs, changing the
script leaves the job skipping. Asking an agent to list every file just moves the mistake to the agent.

So cigen adds the inputs that are easy to forget to every job's hash: the job's own definition, the commands it uses,
the project files its steps name (`sh scripts/check.sh`), local actions, the root toolchain pins and the lockfiles
([derived inputs](/docs/inputs/)). Each rule includes too much rather than too little, because an extra input costs a
rerun and a missing one costs a false green check.

## The generated files aren't the source

cigen writes `.github/workflows/` from the config in `.cigen/`, so there's one place to change and the output is checked
by tests. In cigen's own repository the agent instructions say it plainly: never edit the generated workflows by hand,
change `.cigen/` and regenerate. Output is deterministic, so a regenerated file only changes when the config did, and a
diff an agent produces is easy to review.

## What it doesn't catch yet

- Within one job, only the first unknown key is reported. Fix it, and the next one appears
([#61](https://github.com/DocSpring/cigen/issues/61)).
- Commands still accept unknown keys.
- Some inputs are still easy to miss: files that a named script mentions aren't followed, and a moving image tag such as
`rust:latest` isn't resolved to a digest ([known gaps](/docs/inputs/#known-gaps)).
- A wrong value of the right type, such as a glob that matches nothing you meant, isn't an error.

The [docs](/docs/) are also served as plain Markdown for agents, with `/llms.txt` as the index, so an agent can read the
same reference a person does.
Loading
Loading