Skip to content

Add AGENTS.md for AI coding agents#645

Closed
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/agents-draft
Closed

Add AGENTS.md for AI coding agents#645
krodak wants to merge 1 commit intoswiftwasm:mainfrom
PassiveLogic:kr/agents-draft

Conversation

@krodak
Copy link
Member

@krodak krodak commented Feb 17, 2026

Overview

As discussed, here is a starting point for an AGENTS.md file for the JavaScriptKit repo. The goal is to give AI coding agents enough context to contribute without needing to cross-reference CONTRIBUTING.md or reverse-engineer the codebase structure.

This is a draft - let's add what's missing and iterate on it here.

Notes

The file covers:

  • Project structure and source code layout - the dual-package architecture with symlinks between Sources/BridgeJSTool/ and Plugins/BridgeJS/Sources/, quick path reference table
  • BridgeJS codegen pipeline - all three stages (SwiftToSkeleton, ExportSwift/ImportTS, BridgeJSLink), the skeleton IR concept, JS conversion directions
  • Import and export sides - macro system (@JS for exports, @JSFunction/@JSGetter/@JSSetter/@JSClass for imports), CallJSEmission builder pattern
  • Wasm ABI - three ABI strategies (value return, stack, side channel), type mapping table, parameter passing conventions, error handling (both directions), closure lifecycle
  • Workflows - before-committing checklist (from CI config), per-area build/test commands, regeneration steps, adding intrinsics
  • Testing - snapshot test flow with correct paths (BridgeJSCodegenTests, Inputs/MacroSwift/), E2E test setup
  • Adding new types - 10-step checklist from skeleton to docs
  • Common pitfalls - toolchain, stack ordering, shared snapshots, tmpRetTag overwrite

@krodak krodak self-assigned this Feb 17, 2026
@krodak krodak changed the title Add AGENTS.md for AI coding agent contributors Add AGENTS.md for AI coding agents Feb 17, 2026
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

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

Just remembered that we had already created https://github.com/swiftwasm/JavaScriptKit-dev-skills 😅

Given that the AGENTS file tends to change quite frequently, it might make sense to incubate it in this separate repository? sorry for back and forth.

Feel free to push directly to the main branch.

@krodak
Copy link
Member Author

krodak commented Feb 18, 2026

Wasn't aware of that one! Makes sense, will push there instead.

Should we add AGENTS.md to .gitignore in the main repo? That way agents/contributors can fetch it from the skills repo and drop it into their worktree without it showing up as an uncommitted artifact, WDYT?

@krodak krodak closed this Feb 18, 2026
@kateinoigakukun
Copy link
Member

@krodak Sounds good to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants