Skip to content

Commit 25ae949

Browse files
authored
docs: add AGENTS.md and update AI dev setup symlinks (#78)
Centralizes agent instructions in AGENTS.md and retargets symlink guidance in CONTRIBUTING for Claude/Gemini/Copilot. No code changes.
1 parent 6ba6c7f commit 25ae949

File tree

2 files changed

+46
-43
lines changed

2 files changed

+46
-43
lines changed

AGENTS.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
- `main.go`: CLI entry for the proxy.
6+
- `pkg/mcp-proxy`: Server wiring (routing, TLS, startup/shutdown).
7+
- `pkg/auth`: OAuth/OIDC/password providers and auth routes (`templates/`).
8+
- `pkg/backend`: Stdio→HTTP bridge and transparent HTTP/S backends.
9+
- `pkg/proxy`: Reverse proxy and header injection.
10+
- `pkg/repository`: Lightweight KVS persistence.
11+
- `pkg/utils`: Keys, randomness, logging helpers.
12+
- `docs/`: Docusaurus site for product docs.
13+
14+
## Build, Test, and Development Commands
15+
16+
- Build: `go build -o bin/mcp-auth-proxy .` — compile the binary.
17+
- Test: `go test ./...` — run unit tests.
18+
- Coverage: `go test ./... -coverprofile=coverage.out && go tool cover -html=coverage.out -o coverage.html`.
19+
20+
## Coding Style & Naming Conventions
21+
22+
- Language: Go 1.22+ modules (`go.mod`).
23+
- Formatting: `gofmt -s -w .` (CI checks formatting); `go fmt ./...` locally.
24+
- Packages: lower-case names; exported identifiers use PascalCase; files `*_test.go` for tests.
25+
- Imports: standard → third-party → local (`github.com/sigbit/mcp-auth-proxy/...`).
26+
27+
## Testing Guidelines
28+
29+
- Framework: Go `testing` package (`*_test.go`).
30+
- Scope: Test auth providers, proxy behavior, and backend adapters in `pkg/...`.
31+
- Naming: `TestXxx` with table-driven tests where useful.
32+
- Run all: `go test ./...`; target a package: `go test ./pkg/proxy -v`.
33+
34+
## Commit & Pull Request Guidelines
35+
36+
- Commits: Conventional Commits (feat, fix, docs, refactor, perf, test, build, ci, chore, revert). Example: `feat: add GitHub OAuth provider support`.
37+
- PRs: use `.github/pull_request_template.md` as the template; include a clear description, linked issues (`Fixes #123`), reproduction steps, and before/after notes. Include config snippets for new flags or env vars.
38+
- CI: ensure `gofmt` passes and tests are green.
39+
40+
## Security & Configuration Tips
41+
42+
- Set `EXTERNAL_URL` correctly; accept TLS TOS with `--tls-accept-tos` when auto-TLS is detected.
43+
- Avoid committing contents of `data/` (runtime-only).

CONTRIBUTING.md

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,18 @@
22

33
Thank you for your interest in contributing to MCP Auth Proxy! This document provides guidelines and information for developers.
44

5-
## Commit Message Guidelines
6-
7-
This project follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit messages. This helps with automated versioning, changelog generation, and makes the commit history more readable.
8-
9-
### Types
10-
11-
- **feat**: A new feature
12-
- **fix**: A bug fix
13-
- **docs**: Documentation only changes
14-
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
15-
- **refactor**: A code change that neither fixes a bug nor adds a feature
16-
- **perf**: A code change that improves performance
17-
- **test**: Adding missing tests or correcting existing tests
18-
- **build**: Changes that affect the build system or external dependencies
19-
- **ci**: Changes to our CI configuration files and scripts
20-
- **chore**: Other changes that don't modify src or test files
21-
- **revert**: Reverts a previous commit
22-
23-
### Examples
24-
25-
```
26-
feat: add GitHub OAuth provider support
27-
fix: resolve token expiration handling
28-
docs: update OAuth setup instructions
29-
refactor: simplify authentication middleware
30-
ci: add automated release workflow
31-
```
32-
33-
### Breaking Changes
34-
35-
Breaking changes should be indicated by a `!` after the type/scope:
36-
37-
```
38-
feat!: change authentication API to support multiple providers
39-
```
40-
41-
## Pull Request Template
42-
43-
This project uses a pull request template to ensure consistency and completeness. Please follow the guidelines in [./.github/pull_request_template.md](./.github/pull_request_template.md) when creating pull requests.
44-
455
## AI Development Environment Setup
466

477
You can link this file to your preferred AI development environment for better integration:
488

499
```bash
5010
# For Claude Code
51-
ln -s CONTRIBUTING.md CLAUDE.md
11+
ln -s AGENTS.md CLAUDE.md
5212

5313
# For Gemini
54-
ln -s CONTRIBUTING.md GEMINI.md
14+
ln -s AGENTS.md GEMINI.md
5515

5616
# For GitHub Copilot
5717
mkdir -p .github
58-
ln -s CONTRIBUTING.md .github/copilot-instructions.md
18+
ln -s AGENTS.md .github/copilot-instructions.md
5919
```

0 commit comments

Comments
 (0)