Skip to content

Commit d94f9f8

Browse files
gjtorikianclaude
andcommitted
docs: add agent context for oagen-generated code
Adds .claude/CLAUDE.md (with an AGENTS.md symlink) explaining that most of this SDK is generated by the oagen pipeline from workos/openapi-spec, how to tell generated files from hand-maintained ones, and that fixes to generated code belong upstream in oagen/oagen-emitters/openapi-spec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4567490 commit d94f9f8

3 files changed

Lines changed: 39 additions & 130 deletions

File tree

.claude/CLAUDE.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# WorkOS Python SDK — Agent Context
2+
3+
Most code in this repository is **auto-generated**. It is emitted by the
4+
oagen pipeline from the WorkOS OpenAPI spec. It is not hand-written here,
5+
and most bugs in it cannot be fixed here.
6+
7+
## The generation pipeline
8+
9+
| Repo | Role |
10+
| --- | --- |
11+
| [workos/openapi-spec](https://github.com/workos/openapi-spec) | Source of truth for the API surface (the OpenAPI spec, exported by the WorkOS API) and the orchestration entrypoint for all SDK generation |
12+
| [workos/oagen](https://github.com/workos/oagen) | The generator engine (spec → IR → code) |
13+
| [workos/oagen-emitters](https://github.com/workos/oagen-emitters) | The per-language emitters, including the Python emitter that produces this repo's code |
14+
15+
Regeneration runs from a checkout of `openapi-spec`, never from this repo:
16+
17+
```bash
18+
npm run sdk:generate -- --lang python --output workos-python
19+
```
20+
21+
## Generated vs. hand-maintained code
22+
23+
- Generated files begin with the header `# This file is auto-generated by oagen. Do not edit.` — treat them as build artifacts.
24+
- Hand-maintained code is fenced with `@oagen-ignore-start` / `@oagen-ignore-end` markers, or lives in files marked `@oagen-ignore-file`. Only this code is editable in this repo.
25+
26+
## Where to fix an issue
27+
28+
| Symptom | Fix it in |
29+
| --- | --- |
30+
| Wrong or missing endpoint, field, type, or enum value | [workos/openapi-spec](https://github.com/workos/openapi-spec) (or the WorkOS API that exports the spec) |
31+
| Generated Python code is broken or un-idiomatic | [workos/oagen-emitters](https://github.com/workos/oagen-emitters) |
32+
| Generator behavior: naming, IR, pagination, compat checks | [workos/oagen](https://github.com/workos/oagen) |
33+
| Code inside `@oagen-ignore` fences or ignore-marked files | This repo — edit normally |
34+
35+
Don't hand-edit a file that has the generated header — the next
36+
`sdk:generate` run silently overwrites it. Instead, fix the emitter or the
37+
spec upstream and regenerate. If a requested fix lands in a generated file,
38+
say so and point at the upstream repo rather than patching it here.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.claude/CLAUDE.md

CLAUDE.md

Lines changed: 0 additions & 130 deletions
This file was deleted.

0 commit comments

Comments
 (0)