🚀 Welcome to Fluora! We appreciate your interest in contributing. Whether you're fixing a bug, improving documentation, or adding a new feature, your help is valuable. Please follow the guidelines below to ensure smooth collaboration.
-
Fork the repository on GitHub.
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/fluora.git cd fluora
-
Create a new branch for your changes:
git checkout -b feature/your-feature
Fluora allows developers to create structured AI instructions dynamically. You can contribute by adding a new instruction.
-
Navigate to the
instructions/
directory. -
Create a new
instruction_name.yml
file insideinstructions/{instruction_name}
. -
Use the following template:
instruction_info: title: "Your Instruction Title" info: "Short description of the instruction." version: "v1.0.0" config: route: "/your-endpoint" models: gemini: - "gemini-2.0-flash" - "gemini-1.5-pro" temperature: 0.7 top_p: 0.9 max_output_tokens: 256 description: | Explain how the instruction works and its purpose. tasks: - Define what this instruction does. rules: - List rules that should be followed. input_format: | { "sentence": "Input example here.", "tone": "formal | informal | neutral" } output_format: | { "original_sentence": "Original input sentence.", "rewritten_sentence": "Updated sentence.", "suggestions": ["Alternative 1", "Alternative 2"] } additional_notes: - Any other important details.
- Run the generator:
make gen_instructions
- This will generate the instruction service inside
internal/instructions/textcraft/
.
Once the instruction is generated, you must register it in the TextCraft service and controller.
Open internal/service/textcraft.go
and add your new instruction:
services := map[string]types.Instructor{
"rewrite": textcraft.NewRewriteInstruction(),
"casualize": textcraft.NewCasualizeInstruction(),
"expand": textcraft.NewExpandInstruction(),
"your_instruction": textcraft.NewYourInstruction(),
}
Modify internal/controller/textcraft.go
and add:
r.Post(t.svc.Service("your_instruction").Route(), t.YourInstructionHandler)
Inside internal/controller/textcraft.go
:
func (t *TextCraftController) YourInstructionHandler(ctx *fiber.Ctx) error {
r := new(dto.YourInstructionReq)
if err := ctx.BodyParser(r); err != nil {
return errors.New(fiber.StatusBadRequest, "Invalid request body", map[string]string{"error": err.Error()})
}
if err := r.Validate(); err != nil {
return err
}
resp, err := t.svc.YourInstruction(ctx.Context(), r.Provider, r.Model, &dto.YourInstructionParam{
BaseTextParam: dto.BaseTextParam{Sentence: r.Sentence, Language: r.Language},
})
if err != nil {
return err
}
return ctx.JSON(resp)
}
- Check the GitHub Issues for bugs or feature requests.
- If the issue is not listed, create a new issue and describe the bug or enhancement.
- Create a branch for your fix:
git checkout -b fix/issue-name
- Make the necessary changes.
- Run unit tests:
go test ./...
- Check for errors and lint issues:
make lint
- Commit your changes:
git add . git commit -m "feat: Added YourInstruction functionality"
- Push your branch:
git push origin feature/your-feature
- Create a Pull Request (PR):
- Go to Fluora GitHub Repository.
- Click New Pull Request.
- Provide a description of the change.
- Wait for review and approval.
✅ Follow the coding style used in Fluora.
✅ Keep PRs small and focused (one feature or fix per PR).
✅ Add comments and documentation where necessary.
✅ Ensure all tests pass before submitting a PR.
If you have any questions, open a GitHub Discussion or contact @Ja7ad.
Happy Coding! 🚀🎉