Skip to content

Commit c9eade8

Browse files
committed
Add the typical open source project docs
1 parent 251f4c4 commit c9eade8

6 files changed

Lines changed: 276 additions & 321 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Report something that isn't working correctly
4+
title: ''
5+
labels: bug
6+
---
7+
8+
## What happened?
9+
10+
<!-- Describe the bug. -->
11+
12+
## What did you expect?
13+
14+
<!-- What should have happened instead? -->
15+
16+
## How to reproduce
17+
18+
<!-- Command you ran, input you used, and any relevant flags. -->
19+
20+
```bash
21+
22+
```
23+
24+
## Environment
25+
26+
- afdocs version:
27+
- Node.js version:
28+
- OS:
29+
30+
## Additional context
31+
32+
<!-- Logs, screenshots, or anything else that helps. -->
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature request
3+
about: Suggest a new feature or improvement
4+
title: ''
5+
labels: enhancement
6+
---
7+
8+
## What problem does this solve?
9+
10+
<!-- Describe the use case or pain point. -->
11+
12+
## What would you like to see?
13+
14+
<!-- Describe the feature or behavior you'd like. -->
15+
16+
## Alternatives considered
17+
18+
<!-- Have you tried any workarounds or considered other approaches? -->

CODE_OF_CONDUCT.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
- Demonstrating empathy and kindness toward other people
14+
- Being respectful of differing opinions, viewpoints, and experiences
15+
- Giving and gracefully accepting constructive feedback
16+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
- Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
- Trolling, insulting or derogatory comments, and personal or political attacks
23+
- Public or private harassment
24+
- Publishing others' private information, such as a physical or email address, without their explicit permission
25+
- Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement via the [contact form](https://dacharycarey.com/contact/). All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78+
79+
[homepage]: https://www.contributor-covenant.org
80+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81+
[Mozilla CoC]: https://github.com/mozilla/diversity
82+
[FAQ]: https://www.contributor-covenant.org/faq
83+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to afdocs. This guide covers
4+
how to set up your development environment, run checks, and submit changes.
5+
6+
## Getting started
7+
8+
### Prerequisites
9+
10+
- Node.js >= 22 (CI tests against 22 and 24)
11+
- npm
12+
13+
### Setup
14+
15+
1. Fork and clone the repository.
16+
2. Install dependencies:
17+
18+
```bash
19+
npm install
20+
```
21+
22+
Husky installs automatically via the `prepare` script and will run
23+
lint-staged on pre-commit (Prettier + ESLint on staged files).
24+
25+
3. Verify everything works:
26+
27+
```bash
28+
npm test
29+
npm run build
30+
```
31+
32+
## Development workflow
33+
34+
### Commands
35+
36+
| Command | Description |
37+
| ----------------------- | ---------------------------------------- |
38+
| `npm test` | Run all tests once |
39+
| `npm run test:watch` | Run tests in watch mode |
40+
| `npm run test:coverage` | Run tests with coverage report |
41+
| `npm run build` | Compile TypeScript to `dist/` |
42+
| `npm run lint` | ESLint + `tsc --noEmit` type checking |
43+
| `npm run format` | Format all files with Prettier |
44+
| `npm run format:check` | Check formatting without writing changes |
45+
46+
### Building and running locally
47+
48+
Build the TypeScript source to `dist/`:
49+
50+
```bash
51+
npm run build
52+
```
53+
54+
Then run the CLI from the repo:
55+
56+
```bash
57+
node bin/afdocs.mjs check https://docs.example.com
58+
```
59+
60+
Or link it globally so you can use `afdocs` as a command:
61+
62+
```bash
63+
npm link
64+
afdocs check https://docs.example.com
65+
```
66+
67+
The build step is required after any source change. The CLI entry point
68+
(`bin/afdocs.mjs`) imports from `dist/`, not `src/`, so stale builds will
69+
give you stale behavior.
70+
71+
A typical edit-test cycle looks like:
72+
73+
```bash
74+
# Edit source files in src/
75+
npm run build && node bin/afdocs.mjs check https://docs.example.com
76+
```
77+
78+
For running specific checks or changing output format, see the CLI options
79+
in the README.
80+
81+
### Code style
82+
83+
- Prettier handles formatting (config in `.prettierrc.json`): single quotes,
84+
trailing commas, 100-char line width
85+
- ESLint with typescript-eslint for linting (flat config in `eslint.config.js`)
86+
- Unused variables prefixed with `_` are allowed
87+
- Pre-commit hooks enforce formatting and linting automatically
88+
89+
## Making changes
90+
91+
### Bug fixes
92+
93+
If you've found a bug, check [existing issues](https://github.com/agent-ecosystem/afdocs/issues)
94+
first. If it hasn't been reported, open an issue describing the bug, then submit
95+
a PR with the fix. Include a test that reproduces the bug where practical.
96+
97+
### New features
98+
99+
For anything beyond a small fix, open an issue first to discuss the approach.
100+
This saves you from investing time in a direction that might not fit the project's
101+
goals. Things worth discussing up front:
102+
103+
- New checks or check categories
104+
- Changes to existing check behavior
105+
- New output formats or integrations
106+
- New CLI commands or flags
107+
- Changes to the programmatic API
108+
109+
## Submitting a pull request
110+
111+
1. Create a branch from `main`.
112+
2. Make your changes, ensuring tests pass and lint is clean.
113+
3. Push your branch and open a PR against `main`.
114+
4. A clear description of what changed and why helps reviewers give useful
115+
feedback faster.
116+
117+
## Testing
118+
119+
Tests use [Vitest](https://vitest.dev/) with [MSW](https://mswjs.io/) (Mock
120+
Service Worker) for HTTP mocking. Run the full suite before submitting:
121+
122+
```bash
123+
npm test
124+
```
125+
126+
CI runs lint, format check, tests, and build on every pull request. Your PR
127+
needs to pass all of them.
128+
129+
## AI usage
130+
131+
We expect contributors to use AI tools. If you use AI to help write code, review
132+
the output before submitting. Make sure tests pass, the code handles edge cases
133+
you care about, and you understand what it does. The bar is the same whether you
134+
wrote it by hand or not.
135+
136+
## Code of Conduct
137+
138+
This project follows the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
139+
By participating, you agree to uphold it.

0 commit comments

Comments
 (0)