data/patterns/create_coding_feature/README.md
Generate code changes to an existing coding project using AI.
After installing the code2context binary:
go install github.com/danielmiessler/fabric/cmd/code2context@latest
The create_coding_feature allows you to apply AI-suggested code changes directly to your project files. Use it like this:
code2context [project_directory] "[instructions for code changes]" | fabric --pattern create_coding_feature
For example:
code2context . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
code2context scans your project directory and creates a JSON representation# Request AI to create a Hello World program
code2context . "Create a simple Hello World C program in file main.c" | fabric --pattern create_coding_feature
# Review the changes made to your project
git diff
# Run/test the code
make check
# If satisfied, commit the changes
git add <changed files>
git commit -s -m "Add Hello World program"
code2context . "Ensure that all user input is validated and sanitized before being used in the program." | fabric --pattern create_coding_feature
git diff
make check
git add <changed files>
git commit -s -m "Security fixes: Input validation"