2.3 KiB
title, state
| title | state |
|---|---|
| Refactor update template command | completed |
Run 10
IMPORTANT: When working on this task, make sure to:
- Update the Worklog section as you progress through the task
- Fill in the Summary section once the task is completed
- Remove all
==markers when done
Context
Read the AGENTS.md and README.md to get understanding of the project.
Task
The task update-template commands does multiple things:
It reads the library.md and for every header it creates a header row in the help table section of task.template.
This content:
## Task
Becomes this in the task.template:
rows+=("===Task===| | ")
And for every command description:
### clone-taskfile
```bash
rows+=("clone-taskfile||Clone the taskfile.build repo.")
```
It creates this in the task.template:
rows+=("clone-taskfile||Clone the taskfile.build repo.")
And then it also updates the list of commands in the install script.
I want you to refactor the command. It should parse the library.md line by line. It the line starts with ## it creats a separator row. If the line starts with ### it greps the title and match should return the row content.
[main][~/taskfile.build]$ rg "clone-taskfile\|" library.md
53:rows+=("clone-taskfile||Clone the taskfile.build repo.")
Worklog
- Analyzed the current
update-templatecommand implementation intaskfile - Refactored the command to parse
library.mdline by line as requested - Implemented logic to create separator rows for lines starting with
## - Implemented logic to extract command rows for lines starting with
###usingrgto find matching content - Tested the refactored command successfully
- Verified the generated
task.templatecontains correct section headers and command rows - Confirmed help table displays properly
Summary
Successfully refactored the update-template command to parse library.md line by line. The command now creates separator rows for section headers (lines starting with ##) and extracts command rows by finding matching rows+=("...") content for each command header (lines starting with ###). The refactored implementation maintains all existing functionality while being more maintainable and following the requested approach.