trading_agent.skills.skill_curator
¶
Keeps a desk's own skills tidy, once a day when its session rolls over.
The curator has two halves:
- In code,
archive_unusedarchives the desk's skills that have not been used for a number of days (30 by default). A skill never used counts from the day its file was last changed. - For the model,
review_requestwrites the text of a review turn: each of the desk's skills with its use counts, and instructions to patch skills that keep running into trouble, merge duplicates, and turn any procedure worth repeating from the day into a new skill. The session keeper runs that turn right after the day's summary, while the whole day is still in the desk's context.
Installed skills are never touched; they belong to the user.
Typical usage example:
curator = SkillCurator(library, usage_reader, writer, 30) archived = curator.archive_unused(datetime.date(2026, 10, 19)) text = curator.review_request(datetime.date(2026, 10, 19))
SkillCurator
¶
Reviews one desk's own skills.
Creates the curator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
library
|
SkillLibrary
|
The desk's skills. |
required |
usage_reader
|
SkillUsageReader
|
The desk's usage statistics. |
required |
writer
|
SkillWriter
|
Archives skills. |
required |
archive_after_days
|
int
|
How many days without use before a skill is archived. |
required |
Source code in src/trading_agent/skills/skill_curator.py
archive_unused
¶
Archives the desk's skills unused for too long.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
today
|
date
|
Today's India date. |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
The names of the skills archived. |
Source code in src/trading_agent/skills/skill_curator.py
review_request
¶
Writes the text of the daily skill review turn.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trading_date
|
date
|
The day being closed. |
required |
archived
|
list[str]
|
Skills archived just before, so the desk knows. |
required |
Returns:
| Type | Description |
|---|---|
str
|
The request. |