Skip to content

Conversation

@edenreich
Copy link
Contributor

Summary

  • Add support for injecting specific configuration subsections into skills using dotted notation (e.g., config.email, config.database)
  • Enable type-safe, scoped access to configuration following principle of least privilege
  • Add schema validation to ensure injected config sections are defined in spec.config
  • Update Go templates to generate correct constructor parameters and imports for config subsections
  • Add comprehensive documentation with examples and benefits

Changes

Schema & Validation (internal/schema/validator.go)

  • Add config as a built-in injectable service alongside logger
  • Validate that config subsections (e.g., config.email) reference existing sections in spec.config
  • Update JSON schema pattern to allow dotted notation in inject arrays

Template Updates

  • skill.go.tmpl: Generate struct fields and constructor parameters for config subsections with proper types (e.g., *config.EmailConfig)
  • main.go.tmpl: Pass config subsections to skill constructors (e.g., &cfg.Email)

Documentation (README.md)

  • Add new "Config Subsection Injection" section with complete examples
  • Document injection patterns for logger, config, config.subsection, and services
  • List benefits: scoped access, type safety, clear dependencies, easier testing, better separation

Example Usage

spec:
  config:
    email:
      apiKey: ""
      fromAddress: "[email protected]"
  skills:
    - name: send_notification
      inject:
        - logger
        - config.email  # Inject only email config subsection

Test plan

  • Validate ADL files with config subsection injection
  • Generate projects and verify correct code generation
  • Test that skills receive proper config subsection types
  • Verify validation catches invalid config section references
  • Build generated projects successfully

🤖 Generated with Claude Code

Enable skills to inject specific configuration subsections using dotted notation (e.g., config.email, config.database) instead of requiring the entire config object. This provides better scoped access, type safety, and separation of concerns by allowing skills to declare explicit dependencies on only the configuration they need.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@edenreich edenreich merged commit 6e8ff1a into main Nov 16, 2025
1 check passed
@edenreich edenreich deleted the feature/add-config-injection branch November 16, 2025 08:04
ig-semantic-release-bot bot added a commit that referenced this pull request Nov 16, 2025
## [0.25.0](v0.24.4...v0.25.0) (2025-11-16)

### ✨ Features

* **config:** Add support for config subsection injection in skills ([#92](#92)) ([6e8ff1a](6e8ff1a))
@ig-semantic-release-bot
Copy link
Contributor

🎉 This PR is included in version 0.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants