Skip to content

Bundle agent skills into generated templates - #242

Merged
RyanTheRobothead merged 5 commits into
unstablefrom
agent_skills
Mar 27, 2026
Merged

Bundle agent skills into generated templates#242
RyanTheRobothead merged 5 commits into
unstablefrom
agent_skills

Conversation

@RyanTheRobothead

@RyanTheRobothead RyanTheRobothead commented Mar 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Generated projects now automatically include relevant agent skills (.agents/skills/) so coding agents have MADSci domain knowledge from day one
  • Added skills field to TemplateManifest and skills_included to GeneratedProject; TemplateEngine.render() copies SKILL.md files from a shared _skills/ directory in bundled_templates/
  • All 26 template manifests declare category-appropriate skills: module/node/interface/comm get madsci-nodes, experiment gets madsci-experiments, workflow/workcell get madsci-managers + madsci-cli, lab gets all 4

Changes

Core:

  • template_types.py: New skills and skills_included fields
  • engine.py: _resolve_skills_dir() + skill-copy logic in render() (dry-run aware)
  • bundled_templates/_skills/: Canonical location for 4 SKILL.md files
  • .agents/skills/madsci-*: Replaced directories with symlinks to bundled copies

Templates: All 26 template.yaml files updated with skills: field

CLI: madsci init now prints skill count after rendering; refactored into helper functions

Docs: Updated template_catalog.md (bundled skills table) and agent_skills.md (generated project section)

Tests: New TestSkillsCopying class with 8 tests (copy, dry-run, result tracking, all-templates-declare, bundled-matches-repo) + updated file-count assertions

Test plan

  • pytest src/madsci_common/tests/test_templates/ — 183 tests pass
  • pytest full suite — 2929 tests pass
  • just all pipeline passes (checks, tests, build, docs)
  • Symlinks resolve correctly in .agents/skills/ and .claude/skills/
  • Manual: madsci init --no-interactive in temp dir, verify .agents/skills/ in output

🤖 Generated with Claude Code

Templates now automatically include relevant agent skills in generated
projects so coding agents have MADSci domain knowledge from day one.

- Add `skills` field to TemplateManifest and `skills_included` to GeneratedProject
- Add skill-copy logic in TemplateEngine.render() with _resolve_skills_dir()
- Create canonical _skills/ directory in bundled_templates with 4 SKILL.md files
- Replace .agents/skills/madsci-* dirs with symlinks to bundled copies
- Update all 26 template.yaml manifests with category-appropriate skills
- Add TestSkillsCopying test class (8 tests) and update file-count assertions
- Update template_catalog.md, agent_skills.md docs, and init CLI output

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RyanTheRobothead RyanTheRobothead self-assigned this Mar 24, 2026
@github-actions

github-actions Bot commented Mar 24, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/madsci_client/madsci/client/cli/commands
  init.py 15-16, 182-183
  src/madsci_common/madsci/common/templates
  engine.py 205-208, 232-233, 238-239
  src/madsci_common/madsci/common/types
  template_types.py
Project Total  

This report was generated by python-coverage-comment-action

RyanTheRobothead and others added 2 commits March 24, 2026 14:42
…dd madsci-cli skill

- Refactor init command by extracting _collect_parameters() and _display_results()
  helpers to remove noqa: PLR0915 suppression
- Fix _resolve_skills_dir() walk-up to check current directory before walking up
  to parent, so _skills/ sibling of template_dir itself is found
- Add madsci-cli skill to workcell/basic, workflow/basic, and workflow/multi_step
  template manifests alongside madsci-managers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Change .gitignore to only ignore .claude/settings.local.json instead
  of the entire .claude/ directory, so skills symlink and agent configs
  are version-controlled
- Extract inline skills-copying block from render() into _copy_skills()
  helper method, removing PLR0915 suppression
- Add comment explaining walk-up depth limit in _resolve_skills_dir()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RyanTheRobothead
RyanTheRobothead marked this pull request as ready for review March 24, 2026 21:26
RyanTheRobothead and others added 2 commits March 24, 2026 17:36
Provides a structured framework (inspired by Brooker's "Better Mousetraps")
that nudges agents to research existing libraries before writing functionality
from scratch. Includes evaluation criteria, research guidance, and a quick
reference of commonly solved domains.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…st robustness, improve types

- Add madsci-nodes skill to workflow and workcell templates so operators
  have node context available
- Replace fragile parents[4] repo root lookup with .git walk-up in
  test_bundled_skills_match_repo_skills
- Add test_resolve_skills_dir_importlib_fallback to cover the importlib
  fallback path in _resolve_skills_dir
- Replace Any type hints in _display_results with Console and
  GeneratedProject using TYPE_CHECKING guard
- Update docs (agent_skills.md, template_catalog.md) to reflect new
  workflow/workcell skill set

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RyanTheRobothead RyanTheRobothead added the enhancement New feature or request label Mar 27, 2026
@RyanTheRobothead
RyanTheRobothead merged commit 2cda563 into unstable Mar 27, 2026
4 checks passed
RyanTheRobothead added a commit that referenced this pull request Mar 31, 2026
- Complete CHANGELOG for v0.8.0 with all 9 merged PRs (#228, #235, #242,
  #255#260), properly categorized under Added/Changed/Fixed
- Fix broken ActionHandler import in module/basic and node/basic templates
  (replaced with @action decorator pattern)
- Fix self.node_definition → self.node_info in 5 module templates (device,
  instrument, camera, liquid_handler, robot_arm) and their READMEs
- Modernize self.logger.log() → self.event_client.info() in same 5 templates
- Fix stale infrastructure references in example lab README (MongoDB→FerretDB,
  MinIO→SeaweedFS, wrong ports, deprecated /definition endpoint)
- Update node module README to remove deprecated --node_definition reference

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@RyanTheRobothead
RyanTheRobothead deleted the agent_skills branch April 9, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant