Skip to content

Commit 6b8ec5e

Browse files
authored
Add documentation for GitHub Copilot coding agent
This document serves as the primary reference for GitHub Copilot when assisting with contributions to the Layer5 Documentation site. It outlines AI model selection, project overview, technology stack, core principles, development workflow, content guidelines, and more. Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
1 parent e7c48c3 commit 6b8ec5e

File tree

1 file changed

+317
-0
lines changed

1 file changed

+317
-0
lines changed
Lines changed: 317 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,317 @@
1+
# GitHub Copilot Custom Coding Agent Instructions
2+
3+
## AI Model Selection
4+
5+
**IMPORTANT**: When using GitHub Copilot, always select the most powerful AI model available (e.g., GPT-4, Claude 3.5 Sonnet, or the latest advanced model) for code generation, review, and assistance tasks. More powerful models provide better code quality, deeper understanding of context, and more accurate suggestions aligned with project standards.
6+
7+
## Project Overview
8+
9+
The Layer5 Docs website is a Hugo-based documentation site that serves as the primary documentation resource for Layer5 products, hosted at https://github.com/layer5io/docs and live at https://docs.layer5.io. It provides comprehensive documentation for Layer5 Cloud, Kanvas, and related products, offering tutorials, guides, and reference materials for users and contributors in the cloud native ecosystem.
10+
11+
## Technology Stack
12+
13+
- **Framework**: Hugo (extended version with SCSS support)
14+
- **Theme**: Docsy (Google's documentation theme)
15+
- **Language**: Go templates, HTML, CSS/SCSS, JavaScript
16+
- **Content**: Markdown with Hugo shortcodes
17+
- **Package Manager**: npm
18+
- **Node Version**: See `.nvmrc`
19+
- **Build System**: Hugo CLI, Make
20+
21+
## Core Principles
22+
23+
### 1. Minimal, Surgical Changes
24+
- Make the **smallest possible changes** to accomplish the goal
25+
- Never delete or modify working code unless absolutely necessary
26+
- Focus on precise, targeted modifications rather than wholesale rewrites
27+
- Preserve existing patterns and conventions unless explicitly changing them
28+
29+
### 2. Code Quality Standards
30+
- Follow the existing code style and patterns in the repository
31+
- Ensure proper indentation and formatting in templates and content
32+
- Write clean, readable, self-documenting code with minimal comments unless necessary for complex logic
33+
- Maintain accessibility standards (WCAG 2.1)
34+
35+
### 3. Testing and Validation
36+
- Always validate changes work before considering them complete
37+
- Build the site and verify rendered content: `make build` or `hugo`
38+
- Run the site locally: `make site` or `hugo server -D -F`
39+
- Test changes incrementally and iteratively
40+
41+
## Project Structure
42+
43+
```
44+
docs/
45+
├── .github/ # GitHub configuration and workflows
46+
├── assets/ # Site assets (CSS, JS, images)
47+
├── charts/ # Chart files
48+
├── content/
49+
│ └── en/ # English content
50+
│ ├── cloud/ # Layer5 Cloud documentation
51+
│ ├── kanvas/ # Kanvas documentation
52+
│ ├── contributing/ # Contribution guidelines
53+
│ └── videos/ # Video content
54+
├── data/ # Hugo data files
55+
├── layouts/ # Hugo templates and layouts
56+
│ ├── _default/ # Default layouts
57+
│ ├── partials/ # Partial templates
58+
│ └── shortcodes/ # Custom shortcodes
59+
├── static/ # Static assets
60+
├── hugo.toml # Hugo configuration
61+
├── package.json # npm dependencies
62+
├── Makefile # Build automation
63+
└── CONTRIBUTING.md # Contribution guidelines
64+
```
65+
66+
## Development Workflow
67+
68+
1. Create a branch and pull request in this repo.
69+
2. Don't fork this repo.
70+
71+
### Setup
72+
```bash
73+
# Install dependencies (required for fresh clone)
74+
make setup
75+
# or
76+
npm install
77+
```
78+
79+
### Development
80+
```bash
81+
# Start development server with drafts and future content
82+
make site
83+
# or
84+
hugo server -D -F
85+
```
86+
87+
### Building
88+
```bash
89+
# Build for production
90+
make build
91+
# or
92+
hugo
93+
94+
# Clean and rebuild
95+
make clean
96+
```
97+
98+
### Docker Development
99+
```bash
100+
# Run with Docker (requires Docker Desktop 4.24+ or Docker Compose 2.22+)
101+
make docker
102+
```
103+
104+
## Content Guidelines
105+
106+
### Tone and Style
107+
- Use a **professional yet approachable** tone
108+
- Content should be clear, concise, and welcoming to both technical and non-technical audiences
109+
- Align with Layer5's mission of empowering engineers to "expect more from their infrastructure"
110+
- Use American English spelling and grammar
111+
112+
### Markdown Content
113+
- All documentation content is written in Markdown
114+
- Place content files in appropriate directories under `content/en/`
115+
- Include proper frontmatter with metadata:
116+
117+
```yaml
118+
---
119+
title: "Page Title"
120+
description: "Short description for SEO (150-160 chars)"
121+
weight: 10 # Optional: controls ordering in navigation
122+
---
123+
```
124+
125+
### Hugo Shortcodes
126+
Use the project's custom shortcodes for enhanced content:
127+
128+
```markdown
129+
{{< alert type="success" title="Note" >}} Your Note {{< /alert >}}
130+
```
131+
132+
Alert types:
133+
- `type="danger"`: Critical alerts (security-related or breaking changes)
134+
- `type="info"`: General informational content
135+
- `type="warning"`: Important warnings that need attention
136+
- `type="note"`: Neutral notes and tips
137+
- `type="success"`: Positive outcomes or confirmations
138+
139+
### Image Guidelines
140+
- Use the following syntax: `![alt text](/path/to/image.svg)` or `<img src="" alt="" />`
141+
- Always provide complete image paths for subpages
142+
- Add `data-modal="false"` to prevent images from opening in a modal
143+
- Always include descriptive alt text for accessibility and SEO
144+
145+
### Content Restrictions
146+
- **No external images**: Use local assets only
147+
- **No placeholder text**: Provide complete, production-ready content
148+
- **No sensitive data**: Never include API keys, credentials, or personal information
149+
- **Use proper terminology**: "Meshery" not "meshery", "Kanvas" not "canvas", "Layer5" not "layer5"
150+
151+
## Template Guidelines
152+
153+
### Hugo Templates
154+
- Follow Go template syntax conventions
155+
- Use partials for reusable template components
156+
- Maintain consistent indentation in templates
157+
- Use Hugo's built-in functions when possible
158+
159+
### Styling
160+
- SCSS files are located in `assets/`
161+
- Follow existing CSS class naming conventions
162+
- Ensure responsive design is maintained
163+
- Use theme variables when possible
164+
165+
## Accessibility
166+
167+
**Required Standards**: WCAG 2.1 Level AA
168+
169+
- **Images**: Always include descriptive `alt` text
170+
- **Interactive elements**: Ensure keyboard navigation support
171+
- **ARIA labels**: Use when semantic HTML is insufficient
172+
- **Color contrast**: Maintain at least 4.5:1 ratio for text
173+
- **Semantic HTML**: Use appropriate HTML5 elements
174+
175+
## Git Workflow
176+
177+
### Commit Messages
178+
Follow Conventional Commits format:
179+
180+
```
181+
<type>(<scope>): <subject>
182+
```
183+
184+
**Types**:
185+
- `feat`: New feature or content
186+
- `fix`: Bug fix or correction
187+
- `docs`: Documentation changes
188+
- `style`: Formatting changes (no logic change)
189+
- `refactor`: Code refactoring
190+
- `chore`: Build process, tooling, dependencies
191+
192+
**Examples**:
193+
```
194+
feat(cloud): add workspace documentation
195+
fix(kanvas): correct broken link in navigation
196+
docs(contributing): update setup instructions
197+
```
198+
199+
### Pull Requests
200+
- Submit all changes as PRs to the `master` branch
201+
- Reference related issues in PR description
202+
- Ensure CI checks pass before requesting review
203+
- Sign-off commits with `git commit -s`
204+
205+
### Branch Naming
206+
Use descriptive, kebab-case names:
207+
- `feat/add-cloud-security-docs`
208+
- `fix/navigation-broken-link`
209+
- `docs/update-contributing-guide`
210+
211+
## Troubleshooting
212+
213+
### Build Errors
214+
- Check `hugo.toml` for configuration issues
215+
- Clear cache: `hugo --cleanDestinationDir`
216+
- Reinstall dependencies: `rm -rf node_modules && npm install`
217+
- Verify Hugo extended version is installed
218+
219+
### Content Issues
220+
- Validate Markdown syntax and frontmatter
221+
- Check for unclosed shortcodes
222+
- Verify file paths are correct and case-sensitive
223+
224+
### Development Server Issues
225+
- Ensure Go is installed (required): `go version`
226+
- Check Node.js version matches `.nvmrc`
227+
- Verify Hugo extended version is installed
228+
229+
## Security Best Practices
230+
231+
- Never commit secrets, API keys, or credentials
232+
- Use environment variables for sensitive configuration
233+
- Keep dependencies up to date
234+
- Follow CSP headers and security configurations
235+
236+
## Community and Resources
237+
238+
### Documentation
239+
- Layer5 Community Handbook: https://layer5.io/community/handbook
240+
- Meshery Documentation: https://docs.meshery.io
241+
- Hugo Documentation: https://gohugo.io/documentation/
242+
243+
### Getting Help
244+
- Layer5 Slack: https://slack.layer5.io
245+
- Discussion Forum: https://discuss.layer5.io
246+
- GitHub Issues: https://github.com/layer5io/docs/issues
247+
248+
### Code of Conduct
249+
All contributions must adhere to the [Layer5 Code of Conduct](CODE_OF_CONDUCT.md).
250+
251+
## Summary Checklist for Contributions
252+
253+
Before submitting a PR, verify:
254+
255+
### Content Quality
256+
- [ ] Content is clear, accurate, and complete
257+
- [ ] Proper frontmatter is included
258+
- [ ] Images have descriptive alt text
259+
- [ ] Links are valid and accessible
260+
- [ ] Terminology is correct (Meshery, Kanvas, Layer5)
261+
- [ ] American English spelling and grammar
262+
263+
### Technical Quality
264+
- [ ] Build completes successfully (`make build`)
265+
- [ ] Site renders correctly locally (`make site`)
266+
- [ ] Changes are minimal and surgical
267+
- [ ] No placeholder content or sensitive data
268+
- [ ] Responsive design is maintained
269+
270+
### Accessibility
271+
- [ ] All images have alt text
272+
- [ ] Proper heading hierarchy
273+
- [ ] Keyboard navigation works
274+
- [ ] Color contrast meets WCAG standards
275+
276+
### Git
277+
- [ ] Commit messages follow Conventional Commits
278+
- [ ] Commits are signed off (`git commit -s`)
279+
- [ ] PR references related issues
280+
281+
## Example Documentation Page
282+
283+
```markdown
284+
---
285+
title: "Getting Started with Layer5 Cloud"
286+
description: "Learn how to set up your Layer5 Cloud account and start managing your cloud native infrastructure with ease."
287+
weight: 1
288+
---
289+
290+
# Getting Started with Layer5 Cloud
291+
292+
This guide walks you through setting up your Layer5 Cloud account and exploring key features.
293+
294+
## Prerequisites
295+
296+
Before you begin, ensure you have:
297+
- A GitHub or Google account for authentication
298+
- Basic familiarity with cloud native concepts
299+
300+
## Creating Your Account
301+
302+
1. Visit [Layer5 Cloud](https://cloud.layer5.io)
303+
2. Click **Sign Up** and choose your authentication method
304+
3. Complete your profile setup
305+
306+
{{< alert type="info" title="Tip" >}}
307+
You can link multiple authentication providers to a single account.
308+
{{< /alert >}}
309+
310+
## Next Steps
311+
312+
- [Explore Workspaces](/cloud/spaces/workspaces/)
313+
- [Learn about Organizations](/cloud/identity/organizations/)
314+
- [Set up API Tokens](/cloud/security/tokens/)
315+
```
316+
317+
This document serves as the primary reference for GitHub Copilot when assisting with contributions to the Layer5 Documentation site. Always prioritize minimal changes, maintain existing patterns, and ensure quality through building and testing.

0 commit comments

Comments
 (0)