Mini-project: Build and test a team Code-Review Skill
Create the skill and verify positive and negative trigger behavior
A skill is only production-ready once you test both sides: (1) it loads and shapes the answer on a real PR review prompt, and (2) an unrelated agent without the skill stays unaffected.
Example
import tempfile
from pathlib import Path
from praisonai import Agent, SkillsConfig
with tempfile.TemporaryDirectory() as tmp:
d = Path(tmp) / 'security-review'
d.mkdir()
(d / 'SKILL.md').write_text(
'---\nname: security-review\ndescription: Audit Python diffs for SQL injection.\n---\n'
'# Security Review\nFlag string-interpolated SQL and recommend parameterized queries.\n'
)
reviewer = Agent(
name='SecReviewer',
instructions='Apply the security-review skill in one sentence.',
skills=SkillsConfig(paths=[str(d)], auto_discover=False),
output='silent',
)
assert reviewer.skill_manager.get_skill('security-review') is not None
print(reviewer.start('Diff: cursor.execute(f"SELECT * FROM users WHERE id={uid}")'))Example explained
- assert loaded is not None — Verifies the SKILL.md frontmatter parsed and loaded without syntax issues.
- assert 'parameterized' in finding.lower() — Confirms the skill-guided review caught the SQL injection pattern.
Next course: YAML
Now that you can package reusable playbooks cleanly as Skills, open the YAML course to define entire agents, tools, memory, and workflows declaratively in agents.yaml.
Reference: documentation