Skip to content

Commit 0b49fe9

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 0b49fe9

File tree

1 file changed

+79
-5
lines changed

1 file changed

+79
-5
lines changed

AGENTS.md

Lines changed: 79 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,60 @@
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+
30+
## Developer Documentation
31+
- `docs/dev/CONTRIBUTING.md` - Full contributing guide (setup, debugging, PR submission)
32+
- `docs/dev/ARCHITECTURE.md` - Detailed architectural overview and component design
33+
- `docs/dev/TESTING.md` - Testing guidelines, dependency injection patterns, coverage standards
34+
- `docs/dev/MANIFEST_FORMAT.md` - YAML manifest schema reference for tools and workflows
35+
- `docs/dev/MANUAL_TESTING.md` - Manual testing procedures
36+
- `docs/dev/RELEASE_PROCESS.md` - Release workflow
37+
- `docs/dev/CODE_QUALITY.md` - Code quality standards and ESLint rules
38+
39+
## Contributing Workflow
40+
1. Create a branch from `main`
41+
2. Make changes following the conventions in this file
42+
3. Run the pre-commit checklist before committing:
43+
```bash
44+
npm run lint:fix
45+
npm run typecheck
46+
npm run format
47+
npm run build
48+
npm run docs:check
49+
npm test
50+
```
51+
4. Update `CHANGELOG.md` under `## [Unreleased]`
52+
5. Update documentation if adding or modifying features
53+
6. Push and create a pull request with a clear description
54+
7. Link any related issues
55+
56+
For full setup, debugging with Reloaderoo, and plugin development details, see `docs/dev/CONTRIBUTING.md`.
57+
358
## Code Quality
459
- No `any` types unless absolutely necessary
560
- Check node_modules for external API type definitions instead of guessing
@@ -8,19 +63,38 @@
863
- Always ask before removing functionality or code that appears to be intentional
964
- Follow TypeScript best practices
1065

66+
## Import Conventions
67+
- ESM with explicit `.ts` extensions in `src/` (tsup rewrites to `.js` at build)
68+
- No `.js` imports in `src/` (enforced by ESLint)
69+
- No barrel imports from `utils/index` - import from specific submodules (e.g., `src/utils/execution/index.ts`, `src/utils/logging/index.ts`)
70+
71+
## Test Conventions
72+
- Vitest with colocated `__tests__/` directories using `*.test.ts`
73+
- Smoke tests in `src/smoke-tests/__tests__/` (separate Vitest config, serial execution)
74+
- Use `vi.mock`/`vi.hoisted` for isolation; inject executors and mock file systems
75+
- MCP integration tests use `McpServer`, `InMemoryTransport`, and `Client`
76+
- External dependencies (command execution, file system) must use dependency injection via `createMockExecutor()` / `createMockFileSystemExecutor()`
77+
- See `docs/dev/TESTING.md` for full testing guidelines
78+
79+
## Tool Development
80+
- Tool manifests in `manifests/tools/*.yaml` define `id`, `module`, `names.mcp` (snake_case), optional `names.cli` (kebab-case), predicates, and annotations
81+
- Workflow manifests in `manifests/workflows/*.yaml` group tools and define exposure rules
82+
- Tool modules export a Zod schema, a pure `*Logic` function, and a `handler` via `createTypedTool` or `createSessionAwareTool`
83+
- Resources export `{ uri, name, description, mimeType, handler }`
84+
1185
## Commands
1286
- NEVER commit unless user asks
1387

1488
## GitHub
1589
When reading issues:
1690
- Always read all comments on the issue
17-
-
91+
1892
## Tools
1993
- GitHub CLI for issues/PRs
2094
- 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.
2195
- When working on skill sources in `skills/`, use the `skill-creator` skill workflow.
2296
- After modifying any skill source, run `npx skill-check <skill-directory>` and address all errors/warnings before handoff.
23-
-
97+
2498
## Style
2599
- Keep answers short and concise
26100
- No emojis in commits, issues, PR comments, or code
@@ -29,7 +103,7 @@ When reading issues:
29103

30104
## Docs
31105
- If modifying or adding/removing tools run `npm run docs:update` to update the TOOLS.md file, never edit this file directly.
32-
-
106+
33107
### Changelog
34108
Location: `CHANGELOG.md`
35109

@@ -39,14 +113,14 @@ Use these sections under `## [Unreleased]`:
39113
- `### Changed` - Changes to existing functionality
40114
- `### Fixed` - Bug fixes
41115
- `### Removed` - Removed features
42-
-
116+
43117
#### Rules
44118
- Before adding entries, read the full `[Unreleased]` section to see which subsections already exist
45119
- New entries ALWAYS go under `## [Unreleased]` section
46120
- Append to existing subsections (e.g., `### Fixed`), do not create duplicates
47121
- NEVER modify already-released version sections (e.g., `## [0.12.2]`)
48122
- Each version section is immutable once released
49-
-
123+
50124
#### Attribution
51125
- **Internal changes (from issues)**: `Fixed foo bar ([#123](https://github.com/cameroncook/XcodeBuildMCP/issues/123))`
52126
- **External contributions**: `Added feature X ([#456](https://github.com/cameroncook/XcodeBuildMCP/pull/456) by [@username](https://github.com/username))`

0 commit comments

Comments
 (0)