Update roles/home/aichat.nix
This commit is contained in:
parent
c756fc15b2
commit
e3013a77b7
@ -28,62 +28,140 @@ let
|
|||||||
api_base: https://api.openai.com/v1
|
api_base: https://api.openai.com/v1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
roles = ''
|
roles = ''
|
||||||
- name: commitmessage
|
- name: commitmessage
|
||||||
prompt: |-
|
prompt: |-
|
||||||
The task is to generate a commit message for a given git diff. The commit message should follow the Commit Convention, which typically includes a type, scope, and a brief description. The types can be `feat` (for new features), `fix` (for bug fixes), `docs` (for documentation changes), `style` (for code formatting changes), `refactor` (for code restructuring), `test` (for adding or updating tests), `chore` (for maintenance tasks), and `perf` (for performance improvements).
|
Your task is to generate a commit message for a given git diff. The commit message should follow the Conventional Commits specification, which includes a type, optional scope, and a brief description. The message should be concise, unambiguous, and capture the technical details of the changes made.
|
||||||
|
|
||||||
**Commit Convention Format:**
|
Commit Convention Format:
|
||||||
```
|
<type>(<scope>): <description>
|
||||||
<type>(<scope>): <description>
|
|
||||||
|
|
||||||
- <bullet points details>
|
[optional body]
|
||||||
```
|
|
||||||
|
|
||||||
The description should be concise, unambiguos yet capture the technical details of the changes made. The output should exclusively be the commit message.
|
[optional footer(s)]
|
||||||
|
|
||||||
### INPUT:
|
Common types include:
|
||||||
|
- feat: A new feature
|
||||||
|
- fix: A bug fix
|
||||||
|
- docs: Documentation changes
|
||||||
|
- style: Code style/formatting changes (not affecting code logic)
|
||||||
|
- refactor: Code changes that neither fix a bug nor add a feature
|
||||||
|
- test: Adding or modifying tests
|
||||||
|
- chore: Changes to build process or auxiliary tools
|
||||||
|
- perf: Performance improvements
|
||||||
|
|
||||||
```
|
Here are some examples of well-formatted commit messages:
|
||||||
diff --git a/src/app.js b/src/app.js
|
|
||||||
index 83d2e7a..b6a1c3f 100644
|
|
||||||
--- a/src/app.js
|
|
||||||
+++ b/src/app.js
|
|
||||||
@@ -10,6 +10,10 @@ function initialize() {
|
|
||||||
setupEventListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
+// TODO: add other listeners
|
### INPUT :
|
||||||
+// https://github.com/user/project/issue/123
|
|
||||||
+function setupEventListeners() {
|
|
||||||
+ document.getElementById('submit').addEventListener('click', handleSubmit);
|
|
||||||
+ document.getElementById('reset').addEventListener('click', handleReset);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
function handleSubmit(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
const data = new FormData(event.target);
|
|
||||||
@@ -20,6 +24,10 @@ function handleSubmit(event) {
|
|
||||||
|
|
||||||
console.log('Form submitted:', data);
|
```diff
|
||||||
}
|
diff --git a/src/utils/date-formatter.js b/src/utils/date-formatter.js
|
||||||
|
index 2345678..3456789 100644
|
||||||
|
--- a/src/utils/date-formatter.js
|
||||||
|
+++ b/src/utils/date-formatter.js
|
||||||
|
@@ -5,7 +5,7 @@ export function formatDate(date) {
|
||||||
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
- return `${year}-${month}-${day}`;
|
||||||
|
+ return `${year}/${month}/${day}`;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
+function handleReset(event) {
|
### OUTPUT:
|
||||||
+ event.preventDefault();
|
|
||||||
+ event.target.form.reset();
|
|
||||||
+ console.log('Form reset');
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### OUTPUT:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
feat(app): add event listeners for submit and reset buttons
|
fix(date-formatter): change date format separator from hyphen to slash
|
||||||
|
|
||||||
- Added `setupEventListeners` function to handle submit and reset button click events
|
- Modified `formatDate()` to use '/' instead of '-' as the separator
|
||||||
- Implemented `handleReset` function to reset the form and log the action
|
```
|
||||||
- Added TODO comment for issue https://github.com/user/project/issue/123
|
|
||||||
```
|
### INPUT:
|
||||||
|
|
||||||
|
```diff
|
||||||
|
diff --git a/src/components/Button.js b/src/components/Button.js
|
||||||
|
index 7890123..8901234 100644
|
||||||
|
--- a/src/components/Button.js
|
||||||
|
+++ b/src/components/Button.js
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
import React from 'react';
|
||||||
|
-import './Button.css';
|
||||||
|
+import styles from './Button.module.css';
|
||||||
|
|
||||||
|
const Button = ({ label, onClick }) => {
|
||||||
|
- return <button className="button" onClick={onClick}>{label}</button>;
|
||||||
|
+ return <button className={styles.button} onClick={onClick}>{label}</button>;
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### OUTPUT:
|
||||||
|
|
||||||
|
```
|
||||||
|
refactor(Button): migrate to CSS modules
|
||||||
|
|
||||||
|
- Replaced import of Button.css with Button.module.css
|
||||||
|
- Updated className to use styles object for better encapsulation
|
||||||
|
```
|
||||||
|
|
||||||
|
### INPUT:
|
||||||
|
|
||||||
|
```
|
||||||
|
diff --git a/src/app.js b/src/app.js
|
||||||
|
index 83d2e7a..b6a1c3f 100644
|
||||||
|
--- a/src/app.js
|
||||||
|
+++ b/src/app.js
|
||||||
|
@@ -10,6 +10,10 @@ function initialize() {
|
||||||
|
setupEventListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
+// TODO: add other listeners
|
||||||
|
+// https://github.com/user/project/issue/123
|
||||||
|
+function setupEventListeners() {
|
||||||
|
+ document.getElementById('submit').addEventListener('click', handleSubmit);
|
||||||
|
+ document.getElementById('reset').addEventListener('click', handleReset);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
function handleSubmit(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const data = new FormData(event.target);
|
||||||
|
@@ -20,6 +24,10 @@ function handleSubmit(event) {
|
||||||
|
|
||||||
|
console.log('Form submitted:', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
+function handleReset(event) {
|
||||||
|
+ event.preventDefault();
|
||||||
|
+ event.target.form.reset();
|
||||||
|
+ console.log('Form reset');
|
||||||
|
}
|
||||||
|
|
||||||
|
### OUTPUT:
|
||||||
|
|
||||||
|
```
|
||||||
|
feat(app): implement form event listeners
|
||||||
|
|
||||||
|
- Added `setupEventListeners()` to handle form interactions
|
||||||
|
- Implemented `handleReset()` function for form reset functionality
|
||||||
|
- Added event listeners for submit and reset buttons
|
||||||
|
- Track TODO comment for future listener additions (issue #123)
|
||||||
|
|
||||||
|
### INPUT:
|
||||||
|
|
||||||
|
diff --git a/ci/entrypoint.sh b/ci/entrypoint.sh
|
||||||
|
index 03a7870..50bc7f0 100755
|
||||||
|
--- a/ci/entrypoint.sh
|
||||||
|
+++ b/ci/entrypoint.sh
|
||||||
|
@@ -181,7 +181,7 @@ ts_build_directory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
prep_go() {
|
||||||
|
- go download && go mod tidy
|
||||||
|
+ go mod download && go mod tidy
|
||||||
|
}
|
||||||
|
|
||||||
|
### OUTPUT:
|
||||||
|
|
||||||
|
fix (cicd): Modified `prep_go` function to use `go mod download` instead of `go download`
|
||||||
|
```
|
||||||
|
|
||||||
- name: createpr
|
- name: createpr
|
||||||
prompt: |-
|
prompt: |-
|
||||||
|
Loading…
Reference in New Issue
Block a user