Skip to content

Commit 62efec3

Browse files
Copilothortison
andcommitted
Create agents.md documentation for GitHub Copilot
Co-authored-by: hortison <[email protected]>
1 parent 8ae152b commit 62efec3

File tree

1 file changed

+178
-0
lines changed

1 file changed

+178
-0
lines changed

agents.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# GitHub Copilot Agents for Academy Theme
2+
3+
This document provides guidance for GitHub Copilot agents working on the
4+
Layer5 Academy Theme repository.
5+
6+
## Repository Overview
7+
8+
This repository contains a reusable Hugo theme module that powers Layer5
9+
Academy. It provides layouts, shortcodes, and partials to build educational
10+
content sites using the Hugo static site generator.
11+
12+
**Technology Stack:**
13+
14+
- Hugo (extended version 0.146.0+)
15+
- Node.js & npm
16+
- Go modules
17+
- PostCSS & Autoprefixer
18+
- Docsy theme as a base
19+
20+
## Development Environment
21+
22+
### Prerequisites
23+
24+
- Go (latest version)
25+
- Node.js and npm
26+
- Hugo Extended (0.146.0 or later)
27+
28+
### Setup Commands
29+
30+
```bash
31+
# Install dependencies
32+
npm install
33+
34+
# Run the development server
35+
make site
36+
37+
# Build the site
38+
make build
39+
40+
# Clean cache and restart
41+
make clean
42+
```
43+
44+
## Project Structure
45+
46+
- `/layouts/` - Hugo layout templates
47+
- `/assets/` - CSS, JavaScript, and other static assets
48+
- `/archetypes/` - Content templates for different types of educational content
49+
(courses, modules, labs, tests, certifications)
50+
- `/static/` - Static files
51+
- `/i18n/` - Internationalization files
52+
- `hugo.yaml` - Main Hugo configuration
53+
- `package.json` - Node.js dependencies and build scripts
54+
55+
## Key Features
56+
57+
This theme supports several educational content types through archetypes:
58+
59+
- **Courses** - Top-level course containers
60+
- **Learning Paths** - Structured learning sequences
61+
- **Modules** - Course sections
62+
- **Labs** - Hands-on practice exercises
63+
- **Tests & Challenges** - Assessment components
64+
- **Certifications** - Credential tracking
65+
66+
## Development Guidelines
67+
68+
### Making Changes
69+
70+
1. **Local Development**: When developing this theme locally, link it to a Hugo
71+
site (like [academy-example](https://github.com/layer5io/academy-example))
72+
using a `replace` directive in the site's `go.mod` file:
73+
74+
```go
75+
replace github.com/layer5io/academy-theme => ../academy-theme
76+
```
77+
78+
2. **Testing**: Always test changes with an actual Academy site to ensure
79+
layouts and components work correctly.
80+
81+
3. **Code Style**:
82+
- Follow existing code patterns and conventions
83+
- Use meaningful commit messages
84+
- Keep changes minimal and focused
85+
86+
### Linting
87+
88+
To fix Markdown linting issues:
89+
90+
```bash
91+
make lint-fix
92+
```
93+
94+
This requires `markdownlint-cli2` (will be auto-installed if using npm).
95+
96+
## Common Tasks for Agents
97+
98+
### Adding New Layouts
99+
100+
- Review existing layouts in `/layouts/` for patterns
101+
- Ensure consistency with the Docsy base theme
102+
- Test with multiple content types
103+
104+
### Modifying Styles
105+
106+
- CSS/SCSS files are in `/assets/`
107+
- PostCSS is configured via `postcss.config.js`
108+
- Changes should be compatible with the theme's responsive design
109+
110+
### Creating New Archetypes
111+
112+
- Add new content type templates in `/archetypes/`
113+
- Follow the naming convention: `{type}.md`
114+
- Include appropriate front matter defaults
115+
116+
### Updating Dependencies
117+
118+
- Hugo modules: Update `hugo.yaml` and run `hugo mod get -u`
119+
- Node packages: Update `package.json` and run `npm install`
120+
- Always test after dependency updates
121+
122+
## Important Notes
123+
124+
### What NOT to Change
125+
126+
- Do not modify core Hugo/Docsy functionality unless absolutely necessary
127+
- Avoid breaking changes that would affect existing Academy sites using this
128+
theme
129+
- Do not commit `node_modules/`, `public/`, or `resources/` directories
130+
131+
### Security Considerations
132+
133+
- Report security vulnerabilities to <[email protected]>
134+
- Never commit secrets or credentials
135+
- Review the [SECURITY.md](./SECURITY.md) file for full security policy
136+
137+
### Git Workflow
138+
139+
- Follow the git flow described in [CONTRIBUTING-gitflow.md](./CONTRIBUTING-gitflow.md)
140+
- Create descriptive pull request titles
141+
- Reference related issues in commits and PRs
142+
143+
## Testing Your Changes
144+
145+
Since this is a theme module, testing requires:
146+
147+
1. **Link to a test site**: Use the academy-example repository or create a test site
148+
2. **Verify layouts render correctly**: Check all content types (courses,
149+
modules, labs, etc.)
150+
3. **Test responsive design**: Ensure mobile and desktop views work
151+
4. **Validate navigation**: Menu, breadcrumbs, and links should function properly
152+
5. **Check build output**: Run `make build` to ensure no errors
153+
154+
## Resources
155+
156+
- **Main Documentation**: [Layer5 Academy Docs](https://docs.layer5.io/cloud/academy/)
157+
- **Starter Template**: [academy-example](https://github.com/layer5io/academy-example)
158+
- **Hugo Documentation**: [gohugo.io](https://gohugo.io/)
159+
- **Docsy Theme**: [docsy.dev](https://www.docsy.dev/)
160+
- **Contributing Guide**: [CONTRIBUTING.md](./CONTRIBUTING.md)
161+
162+
## Getting Help
163+
164+
- Check existing issues: [GitHub Issues](https://github.com/layer5io/academy-theme/issues)
165+
- Review pull requests for examples
166+
- Consult the Layer5 community on Slack
167+
- Read the Hugo and Docsy documentation for theme development patterns
168+
169+
## Workflow Integration
170+
171+
This repository uses GitHub Actions for:
172+
173+
- Version bumping (`bump-academy-version.yml`)
174+
- Labeling and PR management
175+
- Slack notifications
176+
- Release drafting
177+
178+
Ensure your changes don't break CI/CD workflows.

0 commit comments

Comments
 (0)