Skip to content

Conversation

@fengju0213
Copy link
Collaborator

Description

Describe your changes in detail (optional if the linked issue already contains a detailed description of the changes).

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have read the CONTRIBUTION guide (required)
  • I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • I have checked if any dependencies need to be added or updated in pyproject.toml and uv lock
  • I have updated the tests accordingly (required for a bug fix or a new feature)
  • I have updated the documentation if needed:
  • I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!

@github-actions github-actions bot added the Review Required PR need to be reviewed label Jan 21, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chatagent-skill

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fengju0213 fengju0213 changed the title feat: Chatagent skill feat: Chatagent skills Jan 21, 2026
@fengju0213 fengju0213 self-assigned this Jan 21, 2026
@fengju0213 fengju0213 marked this pull request as draft January 21, 2026 17:05
@fengju0213 fengju0213 linked an issue Jan 22, 2026 that may be closed by this pull request
2 tasks
@Wendong-Fan Wendong-Fan requested a review from zechengz January 23, 2026 01:08
@lightaime
Copy link
Member

Why don’t we implement skills as tools like I mentioned?

@fengju0213
Copy link
Collaborator Author

fengju0213 commented Jan 23, 2026

Why don’t we implement skills as tools like I mentioned?

I've surveyed several repos; some use tools, some don't. I think each approach likely has its advantages, and perhaps we can discuss it and decide which method to adopt.

@fengju0213 fengju0213 marked this pull request as ready for review January 26, 2026 10:29
@fengju0213 fengju0213 added this to the Sprint 47 milestone Jan 26, 2026
@waleedalzarooni waleedalzarooni self-requested a review January 27, 2026 13:38
Copy link
Collaborator

@waleedalzarooni waleedalzarooni left a comment

Choose a reason for hiding this comment

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

LGTM just one quick comment

)

def _get_skills(self) -> Dict[str, Dict[str, str]]:
self._skills_cache = self._scan_skills()
Copy link
Collaborator

Choose a reason for hiding this comment

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

There is no check whether self._skills_cache is not none, in cases where there are repeated skill related tool calls this could result in unnecessary scans within a given session. Consider adding if self._skills_cache is None: to prevent this.

Copy link
Member

Choose a reason for hiding this comment

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

For now using cache will prevent the case for example agent create new skill on the fly the reuse the skill right? Maybe we should remove it for now. WDYT?

Copy link
Member

@zechengz zechengz left a comment

Choose a reason for hiding this comment

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

Also add some unit tests

f"({skill['path']})\n"
)
lines.append("</available_skills>")
if not skills:
Copy link
Member

Choose a reason for hiding this comment

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

Move this below the skills = self._get_skills()

skills = self._get_skills()
skill = skills.get(name)
if not skill:
available = ", ".join(sorted(skills.keys())) or "none"
Copy link
Member

Choose a reason for hiding this comment

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

Should this also includes the description of path to each skills?

roots.append(("system", codex_home_path / "skills" / ".system"))
return roots

def _find_repo_root(self) -> Path:
Copy link
Member

Choose a reason for hiding this comment

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

IMO the assumption of .git is incorrect here
either we just use working directory or let user specify another directory for the repo / workspace scope skill


try:
contents = path.read_text(encoding="utf-8")
except OSError as exc:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can do this

define a general skill error class

class SkillError(Exception)

and we can have

SkillFrontmatterMissing

etc inherit SkillError

then at the place we call _parse_skill (just returns dict[str, str])

we have something like

try:
    skill = _parse_skill(path)
except SkillError as e:
    logger.warning("Skip %s: %s", path, e)
    continue

Copy link
Member

Choose a reason for hiding this comment

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

it might be over-engineering for this use case as _parse_skill is an internal method only called by _scan_skills, so detailed exception types aren't exposed to external callers

info = self._parse_skill(path)
if not info:
continue
name = info["name"]
Copy link
Member

Choose a reason for hiding this comment

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

Can we make the scope related overwriting more explicit here? and add some comments

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can have a folder in examples toolkits called skill_toolkit with a demo skill and a python script


import os
from pathlib import Path
from typing import Dict, List, Optional, Tuple
Copy link
Member

Choose a reason for hiding this comment

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

Let's use dict, list, tuple and

dict[str, str] | None

instead of import from typing

https://peps.python.org/pep-0585/

Copy link
Member

Choose a reason for hiding this comment

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

i think it's good for now, as camel repo uses typing a lot, let's unify the code style with typing

@fengju0213 fengju0213 modified the milestones: Sprint 47, Sprint 48 Feb 1, 2026
Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

1

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

Nice implementation! Found a couple small issues noted inline. Also +1 to adding unit tests as @zechengz mentioned.

)

def _get_skills(self) -> Dict[str, Dict[str, str]]:
self._skills_cache = self._scan_skills()
Copy link
Member

Choose a reason for hiding this comment

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

This overwrites the cache on every call, so it never actually uses the cached data. Should check if cache exists first:

if self._skills_cache is None:
    self._skills_cache = self._scan_skills()
return self._skills_cache

"- Safety and fallback: If a skill can't be applied cleanly "
"(missing files, unclear instructions), state the issue, pick the "
"next-best approach, and continue.\n"
"\n" + " ".join(lines)
Copy link
Member

Choose a reason for hiding this comment

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

Using space join here makes the output hard to read since all the XML content ends up on one line. Consider using "\n".join() instead for better readability.

Copy link
Member

@Wendong-Fan Wendong-Fan left a comment

Choose a reason for hiding this comment

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

added enhance pr #3778 to resolve comments by @zechengz , also did other enhancement and fix as mentioned in the pr description, feel free to check

@Wendong-Fan Wendong-Fan merged commit 813ed0b into master Feb 5, 2026
14 checks passed
@Wendong-Fan Wendong-Fan deleted the chatagent-skill branch February 5, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review Required PR need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Chatagent support Skill

5 participants