Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ mini-agent follows the [Agent Skills](https://agentskills.io/specification) stan
## Locations

- `~/.agents/skills/<name>/SKILL.md`
- `~/.mini-agent/skills/<name>/SKILL.md`
- `.agents/skills/<name>/SKILL.md`
- `.mini-agent/skills/<name>/SKILL.md`

Directories are scanned recursively.
Directories are scanned recursively. If the same skill name exists in both `.agents/skills` and `.mini-agent/skills`, the `.mini-agent/skills` version takes precedence within the same scope.

## Variables

Expand Down
9 changes: 8 additions & 1 deletion src/mini_agent/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@

WORKDIR = Path.cwd()
HOME_SKILLS_DIR = Path.home() / ".agents" / "skills"
HOME_MINI_AGENT_SKILLS_DIR = Path.home() / ".mini-agent" / "skills"
PROJECT_SKILLS_DIR = WORKDIR / ".agents" / "skills"
SKILLS_DIRS = [HOME_SKILLS_DIR, PROJECT_SKILLS_DIR]
PROJECT_MINI_AGENT_SKILLS_DIR = WORKDIR / ".mini-agent" / "skills"
SKILLS_DIRS = [
HOME_SKILLS_DIR,
HOME_MINI_AGENT_SKILLS_DIR,
PROJECT_SKILLS_DIR,
PROJECT_MINI_AGENT_SKILLS_DIR,
]
Comment on lines +34 to +39

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When the current working directory (WORKDIR) is the user's home directory, HOME_SKILLS_DIR and PROJECT_SKILLS_DIR (as well as HOME_MINI_AGENT_SKILLS_DIR and PROJECT_MINI_AGENT_SKILLS_DIR) will point to the exact same paths. This results in duplicate paths in SKILLS_DIRS, causing the skill loader to scan the same directories and parse the same files twice.

Deduplicating the paths while preserving their order avoids this redundant work.

Suggested change
SKILLS_DIRS = [
HOME_SKILLS_DIR,
HOME_MINI_AGENT_SKILLS_DIR,
PROJECT_SKILLS_DIR,
PROJECT_MINI_AGENT_SKILLS_DIR,
]
SKILLS_DIRS: list[Path] = []
for d in [
HOME_SKILLS_DIR,
HOME_MINI_AGENT_SKILLS_DIR,
PROJECT_SKILLS_DIR,
PROJECT_MINI_AGENT_SKILLS_DIR,
]:
if d not in SKILLS_DIRS:
SKILLS_DIRS.append(d)


load_dotenv(CONFIG_DIR / ".env")

Expand Down