diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..80c2435 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[Bug] " +labels: bug +assignees: '' +--- + +### Describe the bug + +A clear and concise description of what the bug is. + +### To Reproduce + +Steps to reproduce the behavior: + +1. Command(s) run +2. Output + +### Expected behavior + +What you expected to happen. + +### Environment + +- OS: +- Go version: +- GoLearn version: + +### Additional context + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..cc6459a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Feature] " +labels: enhancement +assignees: '' +--- + +### Problem + +What problem does this feature solve? + +### Proposal + +Describe the solution you'd like. + +### Alternatives + +Describe alternatives you've considered. + +### Additional context + +Add any other context or screenshots. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fc89ebb --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,17 @@ +## Summary + +Describe the change and its motivation. + +## Checklist + +- [ ] Tests pass: `make verify` or `golearn verify ` +- [ ] Docs updated (README/CONTRIBUTING) if needed +- [ ] No large new dependencies + +## Screenshots / Output (if CLI UX) + +Paste before/after where helpful. + +## Related issues + +Fixes # diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..23db016 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,27 @@ +# Code of Conduct + +This project follows the Contributor Covenant Code of Conduct. + +- For maintainers and contributors: please act with empathy and respect. +- Harassment and discrimination are not tolerated. + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. + +## Our Standards + +- Use welcoming and inclusive language +- Be respectful of differing viewpoints and experiences +- Gracefully accept constructive criticism +- Focus on what is best for the community + +## Enforcement + +Report unacceptable behavior to the maintainers at: . + +Project maintainers are responsible for clarifying and enforcing standards of acceptable behavior and will take appropriate and fair corrective action. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8261aba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,80 @@ +# Contributing to GoLearn + +Thanks for your interest in contributing! This project aims to be a friendly, welcoming place to learn and teach Go. + +## Ways to contribute + +- Report bugs and propose enhancements +- Improve exercises, hints, and documentation +- Add new exercises or solutions (see below) +- Improve the CLI UX and accessibility + +## Development setup + +```bash +# Clone your fork +git clone https://github.com//golearn +cd golearn + +# Build the CLI +make build # or: go build ./cmd/golearn + +# Run locally +./bin/golearn help + +# Initialize embedded exercises into a workspace +mkdir -p /tmp/golearn-ws && cd /tmp/golearn-ws +/path/to/bin/golearn init +``` + +## Running tests + +This repository embeds template tests. To run tests for an exercise from the CLI repo: + +```bash +# From repo root +make verify NAME=01_hello # or: go run ./cmd/golearn verify 01_hello +``` + +## Code style + +- Go 1.22+ +- Match existing formatting; run `gofmt` and `go vet` +- Prefer clear, readable code; add concise comments for non-obvious logic +- Avoid adding heavy deps; keep the binary small and portable + +## Git workflow + +1. Create a feature branch +2. Make focused commits with descriptive messages +3. Ensure `make build` and `make verify` pass +4. Open a PR with a clear title and description (screenshots welcome) + +## Adding or updating exercises + +- Edit templates under `internal/exercises/templates/` +- Keep tests self-contained in the exercise folder +- Provide hints in `internal/exercises/catalog.yaml` +- Do not add solution code into templates; see solutions below + +## Adding solutions + +- Place solutions in `internal/exercises/solutions/` +- Only include implementation files; do not include tests +- Validate locally: + +```bash +# Validate embedded solution against embedded tests +./bin/golearn verify --solution +``` + +## Docs and UX + +- Update `README.md` if you add a new command or flag +- Keep output accessible; follow `internal/cli/theme` guidance + +## License + +- Code is MIT. Non-code lesson content and artwork are under CC BY 3.0 (see CONTENT_LICENSE). + +Please also read the Code of Conduct. diff --git a/README.md b/README.md index 158aa79..f50ec18 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,11 @@ golearn progress # Rich TUI with ASCII progress bar and checklist golearn watch # Watches ./exercises and re-runs tests per edited exercise ``` +### Contributing +- See [CONTRIBUTING.md](./CONTRIBUTING.md) +- Please follow our [Code of Conduct](./CODE_OF_CONDUCT.md) +- Security issues: see [SECURITY.md](./SECURITY.md) + Need commands? ```bash diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..c20b998 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,13 @@ +# Security Policy + +We take security seriously. Please report vulnerabilities responsibly. + +## Supported versions +We generally support the latest minor release of the CLI. + +## Reporting a vulnerability +- Email: security@example.com +- Please include steps to reproduce and any PoC code if available +- Do not open public issues for security problems + +We will acknowledge your report within 72 hours and keep you updated.