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:

TEXT
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:

BASH
git clone https://github.com/Cortlet-Org/intentcss.git

Enter the project:

BASH
cd intentcss

Install dependencies:

BASH
npm install

Start development:

BASH
npm run dev

Run tests:

BASH
npm test

Build the project:

BASH
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:

TEXT
src/intents/

Example:

TEXT
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:

TS
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:

TS
export const intents = [
    ButtonIntent,
    CardIntent,
    AlertIntent
];

Adding Tests

All new functionality should include tests.

Tests live in:

TEXT
tests/

Examples:

TEXT
tests/button.test.ts
tests/engine.test.ts
tests/typo.test.ts

Example test:

TS
it("generates a red button", () => {
    expect(
        ButtonIntent.generate({
            prompt: "red button",
            target: "tailwind"
        })
    ).toContain("bg-red-600");
});

Run tests:

BASH
npm test

Documentation

Documentation lives in:

TEXT
content/intentcss-docs/

Examples:

TEXT
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:

BASH
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:

TS
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.