Skip to content

feat(plugins): add built-in code-puppy-agent architecture skill#488

Merged
mpfaffenberger merged 2 commits into
mpfaffenberger:mainfrom
thomwebb:feat/code-puppy-agent-skill
Jun 18, 2026
Merged

feat(plugins): add built-in code-puppy-agent architecture skill#488
mpfaffenberger merged 2 commits into
mpfaffenberger:mainfrom
thomwebb:feat/code-puppy-agent-skill

Conversation

@thomwebb

Copy link
Copy Markdown
Contributor

What

Adds a new built-in plugin, code_puppy_agent, that ships a SKILL.md — a self-awareness document teaching the LLM Code Puppy's internal architecture (agents, tools, plugins, models, MCP, sessions, skills) so it can navigate the codebase and extend the product without guessing. This mirrors the pattern used by Hermes's hermes-agent skill.

Why

When the LLM needs to add a plugin, debug MCP, or understand tool registration, it currently has to re-derive the architecture by reading source. A skill that documents the actual internals — hook names, discovery precedence, prompt layering — turns guessing into lookup.

What changed

File Change
code_puppy/plugins/code_puppy_agent/__init__.py NEW — package init
code_puppy/plugins/code_puppy_agent/register_callbacks.py NEW — registers the skill via register_skills callback (skill_md_path)
code_puppy/plugins/code_puppy_agent/SKILL.md NEW — 14-section architecture reference (~19 KB)
tests/plugins/conftest.py MODIFIED — marker-based _isolate_plugin_skills fixture so the built-in skill doesn't leak into filesystem-only discovery tests
tests/plugins/test_agent_skills.py MODIFIED — 2 plugin-skill tests opt in via @pytest.mark.plugin_skills

Design notes

  • skill_md_path over inline — the SKILL.md is ~19 KB; inlining via skill_md would bloat register_callbacks.py. Reading the file via path is cleanest and preserves hand-authored frontmatter.
  • Test isolation — the autouse fixture checks request.node.get_closest_marker("plugin_skills") and skips the monkeypatch when present, so plugin-skill tests declare their intent at the decorator instead of undoing a fixture yield.
  • Name consistency — the entry "name" matches the SKILL.md frontmatter name:; a comment documents why (dedup + disable-set vs. display/activation) and the breakage symptom if they drift.

Verification

  • uv run pytest tests/plugins/ tests/test_callbacks_extended.py -q2411 passed, 5 skipped
  • ruff check + ruff format --check clean on all touched files
  • Every load-bearing claim in the SKILL.md (agent discovery precedence, tool registration flow, model selection order, system-prompt layering, skill discovery order) was spot-checked against source.

thomwebb added 2 commits June 18, 2026 11:07
- Ship a SKILL.md providing deep reference on Code Puppy internals
- Register the skill via register_skills callback in plugins/agent_skills
- Include minimal __init__.py with plugin documentation
- Enables the LLM to understand project structure, plugins, tools, and
  agent system for better navigation and extension
- Add `_isolate_plugin_skills` fixture that mocks _collect_plugin_skills
  to return empty lists by default, preventing built-in skills from
  leaking into tests that assert exact filesystem-only counts
- Introduce `plugin_skills` pytest marker so tests that need the real
  plugin-skill collector can opt out of the isolation
- Decorate relevant tests with @pytest.mark.plugin_skills to opt in
@mpfaffenberger mpfaffenberger merged commit 80e3538 into mpfaffenberger:main Jun 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants