Skip to content

docs: add Cursor rules, syntax cheat sheet, and AI agent context#1606

Open
WolfieLeader wants to merge 10 commits intoarktypeio:mainfrom
WolfieLeader:docs/improve-llm-knowledge
Open

docs: add Cursor rules, syntax cheat sheet, and AI agent context#1606
WolfieLeader wants to merge 10 commits intoarktypeio:mainfrom
WolfieLeader:docs/improve-llm-knowledge

Conversation

@WolfieLeader
Copy link

Summary

Closes #1539, closes #1562

Adds three resources to improve AI/LLM integration with ArkType:

  1. .cursor/rules/arktype.mdc — Cursor rules file with common ArkType patterns and
    pitfalls, adapted from the battle-tested cheat sheet in improve llm knowledge #1539. Activates when working
    with ArkType code in Cursor.

  2. ark/docs/content/docs/cheat-sheet.mdx — Syntax cheat sheet covering operators,
    keywords mental model, syntax kinds, and common gotchas. Per maintainer request in Create syntax cheat sheet #1562:
    "markdown page with code and comments." Automatically included in llms.txt via the
    existing writeLlmsTxt() build step.

  3. CLAUDE.md + AGENTS.md (symlinked) — AI agent context file covering monorepo
    structure, code style, key patterns, and common gotchas. Read by Claude Code, Codex,
    and other agent systems.

The cheat sheet is placed after Intro in sidebar navigation — the natural place a new user
looks after the getting-started tutorial.

Follow-up items from #1539 (llms.txt optimization, node_modules packaging) tracked separately.

Test plan

  • pnpm buildDocs succeeds — all MDX code blocks compile cleanly
  • Cheat sheet appears in sidebar navigation after Intro
  • Cheat sheet content included in llms.txt
  • pnpm checkPrettier passes
  • pnpm checkEslint passes
  • Full test suite passes (1703 tests)

Single-page quick reference covering syntax kinds, keywords mental model,
operators, objects, arrays, composition, morphs, type inference, error
handling, and common gotchas. Placed after Intro in sidebar navigation.

Addresses arktypeio#1562 per maintainer request for "markdown page with code and
comments" covering common operators, keyword patterns, syntax kinds, and
common issues new users run into.
Adds .cursor/rules/arktype.mdc with common ArkType patterns and pitfalls
for AI coding assistants. Adapted from the battle-tested cheat sheet in
arktypeio#1539 that was shared across teams adopting ArkType with Cursor.

Addresses arktypeio#1539 follow-up item for improving LLM knowledge.
Provides ArkType-specific guidance for Claude Code, Codex, and other AI
agents that read CLAUDE.md/AGENTS.md. Covers monorepo structure, code
style, key patterns, syntax cheat sheet, and common gotchas.

AGENTS.md is symlinked to CLAUDE.md so both agent conventions are served
from a single source of truth.
@WolfieLeader
Copy link
Author

Follow-up ideas for AI/LLM adoption

Beyond the Cursor rules and cheat sheet in this PR, a couple more ideas that could significantly lower the adoption barrier:

1. ArkType skill/plugin for AI agents

A dedicated ArkType skill (e.g. for Claude Code, Cursor, Copilot) that provides context-aware guidance when working with ArkType code — auto-activated when arktype is imported. This would go beyond static rules files by understanding the user's code and suggesting idiomatic patterns in real-time.

2. Migration skills from other validation libraries

Purpose-built migration guides (or interactive AI skills) for teams moving from:

  • Zod → ArkType
  • Joi → ArkType
  • Yup → ArkType
  • class-validator → ArkType
  • Valibot → ArkType

Each would map the source library's API to ArkType equivalents — e.g. z.string().email()type("string.email"), Joi.object({}).required()type({}), @IsEmail()"string.email", etc. These could live as docs pages, Cursor rules, or packaged AI agent skills.

This would directly address the adoption friction mentioned in #1539 — teams are often not starting fresh but migrating existing codebases.

Happy to contribute either of these as follow-up PRs if there's interest.

Copy link
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is a solid contribution — the content is accurate and well-structured, and addressing #1539/#1562 in one PR makes sense. Three issues worth resolving before merge, one of which is a correctness problem.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow runpullfrog.com𝕏

- Remove auth-schema.ts gotcha (doesn't exist in arktype repo)
- Set cursor rules globs to "**/*.ts" so rule auto-activates
- Wrap default operator example in object context
- Add sync comment noting overlapping content locations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

Create syntax cheat sheet improve llm knowledge

1 participant