Contributing
IntentCSS is an open source project and contributions of all sizes are welcome.
Before You Start
Before contributing, please review:
- Code of Conduct
- Security Policy
- Existing Issues
- Existing Pull Requests
Useful links:
https://github.com/Cortlet-Org/intentcss
https://github.com/Cortlet-Org/intentcss/blob/main/CODE_OF_CONDUCT.md
https://github.com/Cortlet-Org/intentcss/blob/main/.github/SECURITY.md
https://github.com/Cortlet-Org/intentcss
https://github.com/Cortlet-Org/intentcss/blob/main/CODE_OF_CONDUCT.md
https://github.com/Cortlet-Org/intentcss/blob/main/.github/SECURITY.md
Development Setup
Clone the repository:
git clone https://github.com/Cortlet-Org/intentcss.git
git clone https://github.com/Cortlet-Org/intentcss.git
Enter the project:
cd intentcss
cd intentcss
Install dependencies:
npm install
npm install
Start development:
npm run dev
npm run dev
Run tests:
npm test
npm test
Build the project:
npm run build
npm run build
Ways To Contribute
You can contribute by:
- Fixing bugs
- Improving documentation
- Adding tests
- Improving CLI behavior
- Adding new intents
- Adding new modifiers
- Improving typo correction
- Improving confidence scoring
- Refactoring existing code
Adding A New Intent
Intents live in:
src/intents/
src/intents/
Example:
src/intents/button.ts
src/intents/card.ts
src/intents/modal.ts
src/intents/button.ts
src/intents/card.ts
src/intents/modal.ts
A new intent should:
- Export an
IntentDefinition - Define aliases
- Define keywords
- Implement a generator
Example:
export const AlertIntent: IntentDefinition = {
name: "alert",
aliases: [
"alert",
"notification"
],
keywords: [
"alert",
"warning",
"error"
],
generate(options) {
return "rounded-lg bg-yellow-100 p-4";
}
};
export const AlertIntent: IntentDefinition = {
name: "alert",
aliases: [
"alert",
"notification"
],
keywords: [
"alert",
"warning",
"error"
],
generate(options) {
return "rounded-lg bg-yellow-100 p-4";
}
};
Register it:
export const intents = [
ButtonIntent,
CardIntent,
AlertIntent
];
export const intents = [
ButtonIntent,
CardIntent,
AlertIntent
];
Adding Tests
All new functionality should include tests.
Tests live in:
tests/
tests/
Examples:
tests/button.test.ts
tests/engine.test.ts
tests/typo.test.ts
tests/button.test.ts
tests/engine.test.ts
tests/typo.test.ts
Example test:
it("generates a red button", () => {
expect(
ButtonIntent.generate({
prompt: "red button",
target: "tailwind"
})
).toContain("bg-red-600");
});
it("generates a red button", () => {
expect(
ButtonIntent.generate({
prompt: "red button",
target: "tailwind"
})
).toContain("bg-red-600");
});
Run tests:
npm test
npm test
Documentation
Documentation lives in:
content/intentcss-docs/
content/intentcss-docs/
Examples:
intentcss.mdx
getting-started.mdx
installation.mdx
supported-intents.mdx
intentcss.mdx
getting-started.mdx
installation.mdx
supported-intents.mdx
Documentation contributions are encouraged and do not require code changes.
Pull Requests
Before opening a pull request:
- Ensure tests pass
- Ensure the project builds
- Update documentation if needed
- Keep changes focused
Run:
npm test
npm run build
npm test
npm run build
before submitting.
Coding Style
General guidelines:
- Use TypeScript
- Prefer small functions
- Keep intent files focused
- Write readable code
- Avoid unnecessary dependencies
Example:
function isGlass(prompt: string): boolean {
return prompt.includes("glass");
}
function isGlass(prompt: string): boolean {
return prompt.includes("glass");
}
Reporting Bugs
Use the GitHub Bug Report template.
Include:
- IntentCSS version
- Operating system
- Reproduction steps
- Expected behavior
- Actual behavior
Requesting Features
Use the GitHub Feature Request template.
Good feature requests include:
- Problem description
- Proposed solution
- Example prompts
- Example output
Community
Please follow the project's Code of Conduct when participating in:
- Issues
- Pull Requests
- Discussions
- Community spaces
We aim to keep IntentCSS welcoming, respectful, and developer-friendly.
License
By contributing to IntentCSS, you agree that your contributions will be licensed under the Apache License 2.0.
Thank You
Every contribution helps improve IntentCSS.
Whether you fix a typo, improve documentation, add tests, or build a new intent, your contribution is appreciated.