> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/wazuh/wazuh-dashboard-plugins/llms.txt
> Use this file to discover all available pages before exploring further.

# Contributing Guidelines

> Guidelines for contributing to Wazuh Dashboard Plugins

Thank you for your interest in contributing to Wazuh Dashboard Plugins. This guide provides information on how to contribute effectively to the project.

## Getting Started

Before contributing:

1. Review the [documentation](https://documentation.wazuh.com)
2. Search [existing issues](https://github.com/wazuh/wazuh-dashboard-plugins/issues) for similar problems or suggestions
3. Set up your [development environment](https://mintlify.com/wazuh/wazuh-dashboard-plugins/development/setup.md)
4. Familiarize yourself with the [codebase structure](https://mintlify.com/wazuh/wazuh-dashboard-plugins/development/building.md)

## Ways to Contribute

Contributions are valued in many forms:

* **Bug reports** - Report issues you encounter
* **Feature suggestions** - Propose new functionality
* **Code contributions** - Submit bug fixes or new features
* **Documentation** - Improve guides and references
* **Testing** - Validate releases and report results
* **Community support** - Help other users

## Legal Notice

> [!WARNING]
>
> When contributing to this project, you must agree that you have authored 100% of the content, have the necessary rights to the content, and that the content you contribute may be provided under the project license.

## Reporting Bugs

### Before Submitting a Bug Report

Complete these steps before reporting a bug:

1. **Use the latest version** - Verify the bug exists in the most recent release
2. **Check documentation** - Ensure it's not a configuration issue
3. **Search existing issues** - Check if the bug is already reported in the [issue tracker](https://github.com/wazuh/wazuh-dashboard-plugins/issues?q=label%3Abug)
4. **Collect information**:
   * Stack trace or error messages
   * Operating system and version
   * Node.js, npm, and yarn versions
   * Plugin version and OpenSearch Dashboards version
   * Steps to reproduce
   * Expected vs actual behavior

### Submitting a Bug Report

> [!NOTE]
>
> Never report security vulnerabilities publicly. Send security-related bugs via email to the security team. See [SECURITY.md](https://github.com/wazuh/wazuh-dashboard-plugins/blob/main/SECURITY.md).

Create a [new issue](https://github.com/wazuh/wazuh-dashboard-plugins/issues/new) with:

* **Clear title** - Briefly describe the issue
* **Reproduction steps** - Detailed steps to reproduce the bug
* **Expected behavior** - What should happen
* **Actual behavior** - What actually happens
* **Environment details** - OS, versions, configuration
* **Additional context** - Screenshots, logs, code samples

### After Submission

The project team will:

1. Label the issue appropriately
2. Attempt to reproduce the issue
3. Request additional information if needed (labeled `needs-repro`)
4. Mark as `needs-fix` if reproducible
5. Assign to a milestone for implementation

## Suggesting Enhancements

### Before Submitting an Enhancement

1. **Use the latest version** - Feature may already exist
2. **Read documentation** - Functionality might be available through configuration
3. **Search existing issues** - Enhancement may already be suggested
4. **Consider scope** - Ensure feature benefits majority of users

### Submitting an Enhancement Suggestion

Create a [new issue](https://github.com/wazuh/wazuh-dashboard-plugins/issues/new) with:

* **Clear title** - Describe the enhancement concisely
* **Detailed description** - Step-by-step explanation of the proposed feature
* **Current behavior** - What exists today
* **Proposed behavior** - What should exist and why
* **Use cases** - Real-world scenarios where this helps
* **Alternatives considered** - Other approaches you evaluated
* **Additional context** - Mockups, diagrams, examples from other projects

## Code Contributions

### Development Workflow

1. **Fork the repository** on GitHub
2. **Clone your fork** locally:

```bash theme={null}
git clone https://github.com/YOUR-USERNAME/wazuh-dashboard-plugins.git
cd wazuh-dashboard-plugins
```

3. **Create a feature branch**:

```bash theme={null}
git checkout -b feature/my-enhancement
```

4. **Set up development environment** (see [Setup Guide](https://mintlify.com/wazuh/wazuh-dashboard-plugins/development/setup.md))

5. **Make your changes**:
   * Write code following the [Style Guide](#style-guide)
   * Add tests for new functionality
   * Update documentation as needed

6. **Test your changes**:

```bash theme={null}
cd plugins/main
yarn test:jest
yarn lint
```

7. **Commit your changes** (see [Commit Guidelines](#commit-messages))

8. **Push to your fork**:

```bash theme={null}
git push origin feature/my-enhancement
```

9. **Open a pull request** on GitHub

### Docker Development Environments

The project provides Docker-based development environments in the `docker/` directory. These environments include:

* OpenSearch indexer
* Wazuh manager
* OpenSearch Dashboards development environment
* Optional Wazuh agents
* Supporting services (Imposter mock server, metrics exporters)

See the [Building Guide](https://mintlify.com/wazuh/wazuh-dashboard-plugins/development/building.md#running-from-sources) for details on using Docker environments.

## Style Guide

Follow the JavaScript style guide defined in [STYLEGUIDE.md](https://github.com/wazuh/wazuh-dashboard-plugins/blob/main/STYLEGUIDE.md).

### Key Style Rules

#### Code Formatting

* **Indentation**: 2 spaces (never tabs)
* **Line length**: 100 characters maximum
* **Newlines**: UNIX-style (`\n`)
* **Semicolons**: Always use semicolons
* **Quotes**: Single quotes for strings (unless interpolating)
* **Template literals**: Use for string interpolation and multi-line strings

#### Variables

```javascript theme={null}
// Good
const maxWidth = 300;
const userName = 'admin';

// Bad
var maxWidth = 300;
let userName = "admin";
```

* Use `const` by default
* Use `let` only when reassignment is necessary
* Never use `var`

#### Functions

```javascript theme={null}
// Good - function declaration
function getUserName(user) {
  return user.name;
}

// Good - arrow function for callbacks
users.map(user => user.name);

// Bad - function expression
const getUserName = function(user) {
  return user.name;
};
```

#### Naming Conventions

* **Variables/functions**: `lowerCamelCase`
* **Classes**: `UpperCamelCase`
* **Constants**: `lowerCamelCase` (not UPPER\_CASE)
* **Private methods**: Prefix with underscore `_privateMethod`

#### Destructuring

```javascript theme={null}
// Good
const { firstName, lastName } = user;

// Bad
const firstName = user.firstName;
const lastName = user.lastName;
```

#### Modern JavaScript

* Use ES2015+ features (arrow functions, destructuring, spread operator)
* Avoid `for` loops - use `.map()`, `.filter()`, `.reduce()`
* Use async/await over Promise chains
* Use object/array spread over `Object.assign()` or `.slice()`

### Code Quality Tools

The project uses:

* **ESLint** - JavaScript/TypeScript linting
* **Prettier** - Code formatting
* **TypeScript** - Type checking

Run before committing:

```bash theme={null}
yarn lint          # Check for linting errors
yarn lint:fix      # Auto-fix linting errors
yarn format        # Format code with Prettier
```

## Commit Messages

Follow these commit message guidelines:

### Format

```
<Type>: <Subject>

<Body>

<Footer>
```

### Rules

1. **Separate subject from body** with a blank line
2. **Limit subject line** to 50 characters
3. **Capitalize** the subject line
4. **No period** at end of subject line
5. **Use imperative mood** - "Add feature" not "Added feature"
6. **Wrap body** at 72 characters
7. **Sign commits** when possible

### Examples

```
Add user authentication module

Implement JWT-based authentication for API endpoints.
Includes login, logout, and token refresh functionality.

Resolves: #123
```

```
Fix memory leak in dashboard component

Remove event listeners in componentWillUnmount to prevent
memory leaks when components are destroyed.

Fixes: #456
```

### Commit Types

* **Add**: New feature or functionality
* **Update**: Enhancement to existing feature
* **Fix**: Bug fix
* **Refactor**: Code restructuring without behavior change
* **Test**: Adding or updating tests
* **Docs**: Documentation changes
* **Style**: Code style changes (formatting, etc.)
* **Chore**: Maintenance tasks (dependencies, build, etc.)

## Pull Request Process

### Before Opening a Pull Request

* [ ] Code follows the [style guide](#style-guide)
* [ ] Tests pass: `yarn test:jest`
* [ ] Linting passes: `yarn lint`
* [ ] Commits follow [commit guidelines](#commit-messages)
* [ ] Branch is up to date with base branch
* [ ] Documentation is updated if needed

### Pull Request Template

Provide this information in your PR:

```markdown theme={null}
## Description
Brief description of changes

## Related Issue
Fixes #123

## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Enhancement
- [ ] Documentation update

## Testing
Describe testing performed

## Screenshots (if applicable)
Add screenshots for UI changes

## Checklist
- [ ] Tests pass
- [ ] Linting passes
- [ ] Documentation updated
```

### Review Process

After submission:

1. **Automated checks** run (CI/CD pipeline)
2. **Code review** by maintainers
3. **Feedback** provided through PR comments
4. **Revisions** made based on feedback
5. **Approval** by required reviewers
6. **Merge** by maintainers

## Testing Contributions

Ensure contributions include appropriate tests:

* **Unit tests** for new functions and components
* **Integration tests** for component interactions
* **Snapshot updates** for UI changes

See the [Testing Guide](https://mintlify.com/wazuh/wazuh-dashboard-plugins/development/testing.md) for details.

## Documentation Contributions

Documentation improvements are highly valued:

* Fix typos and grammatical errors
* Clarify confusing sections
* Add examples and use cases
* Improve code comments
* Update outdated information

Documentation files:

* `README.md` - Project overview
* `CONTRIBUTING.md` - This guide
* `STYLEGUIDE.md` - Code style reference
* `docs/` - Detailed documentation

## Community Guidelines

### Be Respectful

* Use welcoming and inclusive language
* Respect differing viewpoints and experiences
* Accept constructive criticism gracefully
* Focus on what's best for the community

### Get Help

If you need assistance:

* Join the [Slack community](https://wazuh.com/community/join-us-on-slack/)
* Ask questions in [GitHub Discussions](https://groups.google.com/forum/#!forum/wazuh)
* Review existing [documentation](https://documentation.wazuh.com)

## Recognition

Contributors are recognized:

* Listed in release notes for their contributions
* Mentioned in the project's contributor list
* Acknowledged in relevant issue/PR discussions

## Additional Resources

* [Project Website](https://wazuh.com)
* [Documentation](https://documentation.wazuh.com)
* [Installation Guide](https://documentation.wazuh.com/current/installation-guide/index.html)
* [Branches and Tags](https://github.com/wazuh/wazuh-dashboard-plugins/wiki/About-our-branches-and-tags)
* [Security Policy](https://github.com/wazuh/wazuh-dashboard-plugins/blob/main/SECURITY.md)

## License

By contributing, you agree that your contributions will be licensed under the [GNU General Public License v2.0](https://github.com/wazuh/wazuh-dashboard-plugins/blob/main/LICENSE).

***

Thank you for contributing to Wazuh Dashboard Plugins!


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.