Skip to content

Commit 6e1f57c

Browse files
committed
docs: add build, architecture, and convention sections to AGENTS.md
Add sections that were already present in CLAUDE.md but missing from AGENTS.md, bringing the two files into sync: - Build & Test: all npm scripts agents need to run - Architecture: component map of src/ layers - Import Conventions: ESM, .ts extensions, no barrel imports - Test Conventions: Vitest patterns, colocated tests, smoke tests - Tool Development: manifest-driven tool registration pattern Also clean up stray trailing hyphens on blank lines.
1 parent b6f49dd commit 6e1f57c

1 file changed

Lines changed: 49 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Development Rules
22

3+
## Build & Test
4+
- `npm run build` - Build (tsup, ESM)
5+
- `npm run test` - Unit/integration tests (Vitest)
6+
- `npm run test:smoke` - Smoke tests (builds first, serial execution)
7+
- `npm run lint` / `npm run lint:fix` - ESLint
8+
- `npm run format` - Prettier
9+
- `npm run typecheck` - TypeScript type checking (`tsc --noEmit`)
10+
- `npm run docs:update` - Regenerate `docs/TOOLS.md` from manifests
11+
- `npm run docs:check` - Validate docs match CLI surface
12+
13+
## Architecture
14+
ESM TypeScript project (`type: module`). Key layers:
15+
16+
- `src/cli/` - CLI entrypoint, yargs wiring, daemon routing
17+
- `src/server/` - MCP stdio server, lifecycle, workflow/resource registration
18+
- `src/runtime/` - Config bootstrap, session state, tool catalog assembly
19+
- `src/core/manifest/` - YAML manifest loading, validation, tool module imports
20+
- `src/mcp/tools/` - Tool implementations grouped by workflow (mirrors `manifests/workflows/`)
21+
- `src/mcp/resources/` - MCP resource implementations
22+
- `src/integrations/` - External integrations (Xcode mcpbridge proxy)
23+
- `src/utils/` - Shared helpers (execution, logging, validation, responses)
24+
- `src/visibility/` - Tool/workflow exposure predicates
25+
- `src/daemon/` - Background daemon for persistent sessions
26+
- `src/types/` - Shared type definitions
27+
28+
See `docs/` for detailed documentation (architecture, configuration, tools, troubleshooting).
29+
330
## Code Quality
431
- No `any` types unless absolutely necessary
532
- Check node_modules for external API type definitions instead of guessing
@@ -8,19 +35,36 @@
835
- Always ask before removing functionality or code that appears to be intentional
936
- Follow TypeScript best practices
1037

38+
## Import Conventions
39+
- ESM with explicit `.ts` extensions in `src/` (tsup rewrites to `.js` at build)
40+
- No `.js` imports in `src/` (enforced by ESLint)
41+
- No barrel imports from `utils/index` - import from specific submodules (e.g., `src/utils/execution/index.ts`, `src/utils/logging/index.ts`)
42+
43+
## Test Conventions
44+
- Vitest with colocated `__tests__/` directories using `*.test.ts`
45+
- Smoke tests in `src/smoke-tests/__tests__/` (separate Vitest config, serial execution)
46+
- Use `vi.mock`/`vi.hoisted` for isolation; inject executors and mock file systems
47+
- MCP integration tests use `McpServer`, `InMemoryTransport`, and `Client`
48+
49+
## Tool Development
50+
- Tool manifests in `manifests/tools/*.yaml` define `id`, `module`, `names.mcp` (snake_case), optional `names.cli` (kebab-case), predicates, and annotations
51+
- Workflow manifests in `manifests/workflows/*.yaml` group tools and define exposure rules
52+
- Tool modules export a Zod schema, a pure `*Logic` function, and a `handler` via `createTypedTool` or `createSessionAwareTool`
53+
- Resources export `{ uri, name, description, mimeType, handler }`
54+
1155
## Commands
1256
- NEVER commit unless user asks
1357

1458
## GitHub
1559
When reading issues:
1660
- Always read all comments on the issue
17-
-
61+
1862
## Tools
1963
- GitHub CLI for issues/PRs
2064
- CLI design note: do not rely on CLI session-default writes. CLI is intentionally deterministic for CI/scripting and should use explicit command arguments as the primary input surface.
2165
- When working on skill sources in `skills/`, use the `skill-creator` skill workflow.
2266
- After modifying any skill source, run `npx skill-check <skill-directory>` and address all errors/warnings before handoff.
23-
-
67+
2468
## Style
2569
- Keep answers short and concise
2670
- No emojis in commits, issues, PR comments, or code
@@ -29,7 +73,7 @@ When reading issues:
2973

3074
## Docs
3175
- If modifying or adding/removing tools run `npm run docs:update` to update the TOOLS.md file, never edit this file directly.
32-
-
76+
3377
### Changelog
3478
Location: `CHANGELOG.md`
3579

@@ -39,14 +83,14 @@ Use these sections under `## [Unreleased]`:
3983
- `### Changed` - Changes to existing functionality
4084
- `### Fixed` - Bug fixes
4185
- `### Removed` - Removed features
42-
-
86+
4387
#### Rules
4488
- Before adding entries, read the full `[Unreleased]` section to see which subsections already exist
4589
- New entries ALWAYS go under `## [Unreleased]` section
4690
- Append to existing subsections (e.g., `### Fixed`), do not create duplicates
4791
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
4892
- Each version section is immutable once released
49-
-
93+
5094
#### Attribution
5195
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/cameroncook/XcodeBuildMCP/issues/123))`
5296
- **External contributions**: `Added feature X ([#456](https://github.com/cameroncook/XcodeBuildMCP/pull/456) by [@username](https://github.com/username))`

0 commit comments

Comments
 (0)