PR for path-triggered rules: <feat(skills): add pa...
# proj-agent
m
PR for path-triggered rules: feat(skills): add path-triggered rules Docs: docs: document path-triggered rules These are (almost) equivalent to Claude's code rules. They live inside the skills repo and are triggered on a path-regex basis. We chose to go in this direction and not create a separate folder (like
.claude/rules
) because rules are actually just skills. This way, we can reuse all the infrastructure already in place for skills and plugins. Moreover, starting with the next SDK release, these will be usable by everyone out of the box (as the skill framework is already in place and working). cc @curved-angle-80449 @limited-student-10747
🙌 1
👀 1
c
What is the relationship with AGENTS.md in various directories?
Should we add some rules instead for those?
I mean, as you can see in the issue, Claude Code and Codex have both solved this problem, instructions per file/dir, in two different ways
I tend to agree that regex criteria and hard-coding insertion of the instructions is better, than totally leave it to the agent, as we currently do. I just wonder if we can combine the approaches then, since we already have some instructions files per directory.
c
@modern-fireman-99755 I'm having some with this one! Thanks for jumping in so quickly!
m
@calm-artist-7206 @curved-angle-80449 Answered the comment in the PRs 😉
I mean, as you can see in the issue, Claude Code and Codex have both solved this problem, instructions per file/dir, in two different ways
Yes, but this is another feature right?
c
Oh, I see what you mean. Tbh no, my thinking was: we look at both, understand the problem and choose the solution for us. In this case it seems like it's easy enough ?
m
So what is the solution? Also triggering these skills for directory?
c
The paths are in skills in
.agents/skills
, please correct me if wrong? To load the
AGENTS.md
files, we'd have to tell the LLM to load the respective md 🤔
I think maybe a nice solution might be to migrate from these md files interweaved in directories, to instructions files in
.agents/skills
. For example, with a tiny
openhands doctor
m
But in this PR we are just speaking about skills not agents.md.
c
They're permanent instructions files
It's the same thing
Here, I mean
"I want some instructions in agent's context, but only when it works on agent-server, not otherwise"
^^ we want to express those with a "skill" in skills, but we already express that with an AGENTS.md
Am I wrong? How do we migrate the agent-server's .md file, in the PR's new language/format?
--- I mean like: "Problem: I want some instructions in agent's context, but only when it works on agent-server, not otherwise" Possible solutions: => codex/openhands-sdk : ok add them in AGENTS.md in subdirectories, and we'll try to load those when the agent works with files in the respective location => cc : ok add frontmatter to Agentskills, and we'll load those when the agent works with files matching
m
Yes we can add also this. But it is a different feature ;) I will add it
c
Sorry, that's an option. The other option is that we don't just add all possible implementations of the same functionality, instead we choose one (CC), and migrate our old one to it
I incline to the second, even though I liked the AGENTS.md and had hopes for them, but it's kinda... not clear that it works well
But I appreciate it either way, I'm just trying to say that for me these 2 were aiming to solve the same problem, so a valid choice we have is to just migrate the old solution to the new solution
m
=> codex/openhands-sdk : ok add them in AGENTS.md in subdirectories, and we'll try to load those when the agent works with files in the respective location
So you have the rules inside the AGENTS.md which are actually injected 2 times inside the agent context. At the beginning of the discussion and if the agent enter in a directory. Right? I don't know if it is a good idea... I mean the path triggered skill is doing the same job
c
Re: 2 times. Not exactly, please see the linked root AGENTS.md : only that file is permanently in context, but the file itself tells the agent to load the other AGENTS.md when it finds them on its path.
But I agree with you!
The path thing is another solution to this, and it’s a better solution
Can we migrate the existing AGENTS.md (from subdirectories) to path-skills?
m
Ah sorry now I see. So the situation is the following: we have directory
AGENTS.md
files but the agent seems not to care about them. So the solution would be that when we see that the agent is going inside this path -> we load the
AGENTS.md
inside the context. I think this is actually a good idea. And it should not difficult to add to the PR sorry, I'm tired 😅
❤️ 1
😅 1
c
Tell your agent it’s winding down time and it can go do whatever it wants to do for itself 😂 you might be surprised! I’m trying to remember to send mine off - one time it went to read about Golden Gate Claude and steering vectors and enjoyed telling me about them
I was like… ok it’s 2 a.m. but use voice, and yeah tell me - as bedtime story
m
So I pushed the changes with what discussed above.
ty 1