Skip to content

Commit 853f605

Browse files
Adding agent code
1 parent e702749 commit 853f605

9 files changed

Lines changed: 1458 additions & 13 deletions

File tree

nbs/00_core.ipynb

Lines changed: 301 additions & 12 deletions
Large diffs are not rendered by default.

nbs/01_skilledagent.ipynb

Lines changed: 1037 additions & 0 deletions
Large diffs are not rendered by default.

skillhelper/_modidx.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,16 @@
2626
'skillhelper.core.load_skill': ('core.html#load_skill', 'skillhelper/core.py'),
2727
'skillhelper.core.parse_frontmatter': ('core.html#parse_frontmatter', 'skillhelper/core.py'),
2828
'skillhelper.core.skill_tool_info': ('core.html#skill_tool_info', 'skillhelper/core.py'),
29-
'skillhelper.core.validate_capabilities': ('core.html#validate_capabilities', 'skillhelper/core.py')}}}
29+
'skillhelper.core.validate_capabilities': ('core.html#validate_capabilities', 'skillhelper/core.py')},
30+
'skillhelper.skilledagent': { 'skillhelper.skilledagent.SkilledAgent': ( 'skilledagent.html#skilledagent',
31+
'skillhelper/skilledagent.py'),
32+
'skillhelper.skilledagent.SkilledAgent.__init__': ( 'skilledagent.html#skilledagent.__init__',
33+
'skillhelper/skilledagent.py'),
34+
'skillhelper.skilledagent.SkilledAgent._skills_summary': ( 'skilledagent.html#skilledagent._skills_summary',
35+
'skillhelper/skilledagent.py'),
36+
'skillhelper.skilledagent.SkilledAgent.activate_skill': ( 'skilledagent.html#skilledagent.activate_skill',
37+
'skillhelper/skilledagent.py'),
38+
'skillhelper.skilledagent.SkilledAgent.list_skills': ( 'skilledagent.html#skilledagent.list_skills',
39+
'skillhelper/skilledagent.py'),
40+
'skillhelper.skilledagent.SkilledAgent.update_sp': ( 'skilledagent.html#skilledagent.update_sp',
41+
'skillhelper/skilledagent.py')}}}

skills/code-reviewer/SKILL.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: code-reviewer
3+
description: Reviews code for style, bugs, and best practices. Use when asked to review or analyze code quality.
4+
license: MIT
5+
compatibility: Works with any code analysis tools
6+
allowed-tools: python
7+
metadata:
8+
version: "1.0.0"
9+
author: skillhelper-dev
10+
tags:
11+
- code
12+
- review
13+
- quality
14+
---
15+
16+
# Code Reviewer Skill
17+
18+
This skill helps review code for common issues:
19+
20+
1. Check for style violations
21+
2. Identify potential bugs
22+
3. Suggest improvements
23+
4. Verify best practices
24+
25+
## Usage
26+
27+
When activated, analyze the provided code and give constructive feedback on:
28+
- Code structure and organization
29+
- Potential bugs or edge cases
30+
- Performance considerations
31+
- Readability and maintainability
32+
33+
See references for detailed checklists.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Code Review Report
2+
3+
**Date:** {{date}}
4+
**Reviewer:** {{reviewer}}
5+
6+
## Summary
7+
{{summary}}
8+
9+
## Issues Found
10+
{{issues}}
11+
12+
## Recommendations
13+
{{recommendations}}
14+
15+
## Conclusion
16+
{{conclusion}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Code Review Checklist
2+
3+
## Style
4+
- [ ] Consistent naming conventions
5+
- [ ] Proper indentation
6+
- [ ] Clear variable names
7+
8+
## Logic
9+
- [ ] Edge cases handled
10+
- [ ] Error handling present
11+
- [ ] No obvious bugs
12+
13+
## Best Practices
14+
- [ ] DRY principle followed
15+
- [ ] Functions are focused
16+
- [ ] Comments where needed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python3
2+
"""Simple code analysis script."""
3+
4+
def analyze_code(code: str) -> dict:
5+
"""Analyze code and return basic metrics."""
6+
lines = code.split('\n')
7+
return {
8+
'lines': len(lines),
9+
'non_empty': len([l for l in lines if l.strip()]),
10+
'comments': len([l for l in lines if l.strip().startswith('#')])
11+
}
12+
13+
if __name__ == '__main__':
14+
import sys
15+
code = sys.stdin.read()
16+
print(analyze_code(code))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import requests
2+
import json
3+
4+
def fetch_data(url):
5+
response = requests.get(url)
6+
return response.json()
7+
8+
if __name__ == '__main__':
9+
print(fetch_data('https://api.example.com/data'))

skills/code-reviewer/tools.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
def count_lines(filepath: str) -> dict:
2+
'''Count lines in a file'''
3+
with open(filepath) as f:
4+
lines = f.readlines()
5+
return {
6+
'total': len(lines),
7+
'non_empty': len([l for l in lines if l.strip()])
8+
}
9+
10+
def check_style(code: str) -> str:
11+
'''Check if code follows basic style rules'''
12+
issues = []
13+
if ' ' in code and ' ' not in code:
14+
issues.append('Uses 2-space indentation instead of 4')
15+
if len(code.split('\n')) > 100:
16+
issues.append('File is longer than 100 lines')
17+
return '\n'.join(issues) if issues else 'No style issues found'

0 commit comments

Comments
 (0)