Skip to content

Commit d98cc96

Browse files
matifaliclaude
andcommitted
feat: add AGENTS.md with AI coding assistant guidance
- Create comprehensive AGENTS.md with project structure and development commands - Add symlinks for CLAUDE.md and .github/copilot-instructions.md - Include testing requirements, architecture details, and workflow notes - Enable consistent AI assistance across Claude Code and GitHub Copilot 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 62951f1 commit d98cc96

File tree

3 files changed

+146
-0
lines changed

3 files changed

+146
-0
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../AGENTS.md

AGENTS.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# AGENTS.md
2+
3+
This file provides guidance to AI coding assistants when working with code in this repository.
4+
5+
## Project Overview
6+
7+
The Coder Registry is a community-driven repository for Terraform modules and templates that extend Coder workspaces. It's organized with:
8+
- **Modules**: Individual components and tools (IDEs, auth integrations, dev tools)
9+
- **Templates**: Complete workspace configurations for different platforms
10+
- **Namespaces**: Each contributor has their own namespace under `/registry/[namespace]/`
11+
12+
## Common Development Commands
13+
14+
### Formatting
15+
```bash
16+
bun run fmt # Format all code (Prettier + Terraform)
17+
bun run fmt:ci # Check formatting (CI mode)
18+
```
19+
20+
### Testing
21+
```bash
22+
# Test all modules with .tftest.hcl files
23+
./scripts/terraform_test_all.sh
24+
25+
# Test specific module (from module directory)
26+
terraform init -upgrade
27+
terraform test -verbose
28+
29+
# Validate Terraform syntax
30+
./scripts/terraform_validate.sh
31+
```
32+
33+
### Module Creation
34+
```bash
35+
# Generate new module scaffold
36+
./scripts/new_module.sh namespace/module-name
37+
```
38+
39+
### TypeScript Testing & Setup
40+
The repository uses Bun for TypeScript testing with utilities:
41+
- `test/test.ts` - Testing utilities for container management and Terraform operations
42+
- `setup.ts` - Test cleanup (removes .tfstate files and test containers)
43+
- Container-based testing with Docker for module validation
44+
45+
## Architecture & Organization
46+
47+
### Directory Structure
48+
```
49+
registry/[namespace]/
50+
├── README.md # Contributor info with frontmatter
51+
├── .images/ # Namespace avatar (avatar.png/svg)
52+
├── modules/ # Individual components
53+
│ └── [module]/ # Each module has main.tf, README.md, tests
54+
└── templates/ # Complete workspace configs
55+
└── [template]/ # Each template has main.tf, README.md
56+
```
57+
58+
### Key Components
59+
60+
**Module Structure**: Each module contains:
61+
- `main.tf` - Terraform implementation
62+
- `README.md` - Documentation with YAML frontmatter
63+
- `.tftest.hcl` - Terraform test files (required)
64+
- `run.sh` - Optional startup script
65+
66+
**Template Structure**: Each template contains:
67+
- `main.tf` - Complete Coder template configuration
68+
- `README.md` - Documentation with YAML frontmatter
69+
- Additional configs, scripts as needed
70+
71+
### README Frontmatter Requirements
72+
All modules/templates require YAML frontmatter:
73+
```yaml
74+
---
75+
display_name: "Module Name"
76+
description: "Brief description"
77+
icon: "../../../../.icons/tool.svg"
78+
verified: false
79+
tags: ["tag1", "tag2"]
80+
---
81+
```
82+
83+
## Testing Requirements
84+
85+
### Module Testing
86+
- Every module MUST have `.tftest.hcl` test files
87+
- Tests use Docker containers with `--network=host` flag
88+
- Linux required for testing (Docker Desktop on macOS/Windows won't work)
89+
- Use Colima or OrbStack on macOS instead of Docker Desktop
90+
91+
### Test Utilities
92+
The `test/test.ts` file provides:
93+
- `runTerraformApply()` - Execute Terraform with variables
94+
- `executeScriptInContainer()` - Run coder_script resources in containers
95+
- `testRequiredVariables()` - Validate required variables
96+
- Container management functions
97+
98+
## Validation & Quality
99+
100+
### Automated Validation
101+
The Go validation tool (`cmd/readmevalidation/`) checks:
102+
- Repository structure integrity
103+
- Contributor README files
104+
- Module and template documentation
105+
- Frontmatter format compliance
106+
107+
### Versioning
108+
Use semantic versioning for modules:
109+
- **Patch** (1.2.3 → 1.2.4): Bug fixes
110+
- **Minor** (1.2.3 → 1.3.0): New features, adding inputs
111+
- **Major** (1.2.3 → 2.0.0): Breaking changes
112+
113+
## Dependencies & Tools
114+
115+
### Required Tools
116+
- **Terraform** - Module development and testing
117+
- **Docker** - Container-based testing
118+
- **Bun** - JavaScript runtime for formatting/scripts
119+
- **Go 1.23+** - Validation tooling
120+
121+
### Development Dependencies
122+
- Prettier with Terraform and shell plugins
123+
- TypeScript for test utilities
124+
- Various npm packages for documentation processing
125+
126+
## Workflow Notes
127+
128+
### Contributing Process
129+
1. Create namespace (first-time contributors)
130+
2. Generate module/template files using scripts
131+
3. Implement functionality and tests
132+
4. Run formatting and validation
133+
5. Submit PR with appropriate template
134+
135+
### Testing Workflow
136+
- All modules must pass `terraform test`
137+
- Use `./scripts/terraform_test_all.sh` for comprehensive testing
138+
- Format code with `bun run fmt` before submission
139+
- Manual testing recommended for templates
140+
141+
### Namespace Management
142+
- Each contributor gets unique namespace
143+
- Namespace avatar required (avatar.png/svg in .images/)
144+
- Namespace README with contributor info and frontmatter

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)