Skip to content

Commit 07f53cb

Browse files
lrgirdwolgirdwood
authored andcommitted
agent: add basic workflows for agents
Add some initial and basic rules for agents to use when performing work on the codebase. These can be expanded and improved as agents improve. This includes a --help needed in sdk-config for agent use. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 73f5c31 commit 07f53cb

5 files changed

Lines changed: 90 additions & 2 deletions

File tree

.agent/rules/commit_style.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
trigger: always_on
3+
---
4+
5+
# Agent Commit Rules
6+
7+
The user requires all commit messages generated by the agent to follow a specific style and include a proper sign-off.
8+
9+
## Commit Message Style
10+
11+
Commit messages must be formatted with a subject line and a body, following this format:
12+
```
13+
<feature/subsystem>: <one line description>
14+
15+
<body>
16+
```
17+
18+
* **`<feature/subsystem>`**: A short name or tag representing the feature or component being modified.
19+
* **`<one line description>`**: A succinct one-line description of the change.
20+
* **`<body>`**: A detailed description of the changes made in the commit. The body must be at least one sentence describing the changes.
21+
22+
## Sign-off
23+
24+
Every commit message must end with a `Signed-off-by:` line using the patch author's name and email (from the local git config):
25+
26+
```
27+
Signed-off-by: <author name> <author email>
28+
```

.agent/rules/documentation.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Documentation Rules
2+
3+
The user expects all new features and in-code documentation to adhere to Doxygen standards.
4+
5+
## Doxygen Requirements
6+
7+
1. **Mandatory Documentation:** All new features, functions, and structures must include Doxygen comments describing their purpose, parameters, and return values.
8+
2. **Clean Build:** Any in-code documentation added or modified must build with Doxygen without producing any new errors or warnings.
9+
3. **Format:** Use standard Doxygen formatting tags (e.g., `@brief`, `@param`, `@return` or `\brief`, `\param`, `\return`). Ensure the styling matches the existing codebase conventions.
10+
11+
## Directory Documentation
12+
13+
When creating a new file or modifying an existing one, check if there is an `architecture.md` or `readme.md` (or `README.md`) file in the same directory. If present, evaluate whether the code changes require an update to these documentation files and make the necessary updates to keep them synchronized with the code.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: Build and validate new C code features
3+
---
4+
5+
This workflow describes the process for building and validating any new C code features in the SOF repository.
6+
7+
**Note:** The QEMU build targets must be used for both building and testing. The user requires the build must be error and warning free and the ztests must all pass.
8+
9+
// turbo-all
10+
1. Build the new C code feature using the `xtensa-build-zephyr.py` script.
11+
```bash
12+
source ../.venv/bin/activate
13+
./scripts/xtensa-build-zephyr.py qemu_xtensa
14+
```
15+
16+
2. Validate the feature with a ztest run using the `sof-qemu-run.sh` script.
17+
```bash
18+
source ../.venv/bin/activate
19+
./scripts/sof-qemu-run.sh build-qemu_xtensa
20+
```
21+
22+
3. Ensure that all new features and functions have appropriate Doxygen comments and that the Doxygen documentation builds without errors or warnings.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
description: Develop and validate new audio processing modules
3+
---
4+
5+
This workflow describes the expected steps to create and validate a new audio processing module within the SOF repository.
6+
7+
// turbo-all
8+
1. **(Optional)** Generate the module skeleton using the `sdk-create-module.py` script.
9+
```bash
10+
# Run the script with relevant arguments to create a new module template
11+
./scripts/sdk-create-module.py --name <module_name> --version <version>
12+
```
13+
14+
2. Develop the module logic within the generated skeleton.
15+
16+
3. Validate the module by executing the module within the host testbench. This ensures that the module functions as expected outside of full system simulations.
17+
```bash
18+
# Configure and run the testbench against the developed module
19+
./scripts/host-testbench.sh -l <path_to_module_library>
20+
```
21+
22+
4. Document the new module using Doxygen comments. Validate that the Doxygen build completes without errors or warnings. Add a README.md for the module.

scripts/sdk-create-module.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,12 @@ def main():
362362
print("--- SOF SDK New Module Creator ---")
363363

364364
# Argument Validation ---
365-
if len(sys.argv) != 2:
365+
if len(sys.argv) == 2 and sys.argv[1] in ['-h', '--help']:
366+
print("Usage: sdk-create-module.py <new_module_name>")
367+
sys.exit(0)
368+
elif len(sys.argv) != 2:
366369
print("\n[ERROR] Invalid number of arguments.")
367-
print("Usage: sdk_create_module.py <new_module_name>")
370+
print("Usage: sdk-create-module.py <new_module_name>")
368371
sys.exit(1)
369372

370373
# Configuration --- paths are with respect to script dir

0 commit comments

Comments
 (0)