Skip to content

docs: add plugins documentation#573

Merged
Unshure merged 10 commits intomainfrom
agent-tasks/568
Mar 10, 2026
Merged

docs: add plugins documentation#573
Unshure merged 10 commits intomainfrom
agent-tasks/568

Conversation

@Unshure
Copy link
Copy Markdown
Member

@Unshure Unshure commented Feb 20, 2026

Summary

This PR adds comprehensive documentation for Plugins, a new composable mechanism for extending agent functionality in the Strands SDK.

Changes

New Documentation

  • docs/user-guide/concepts/plugins/index.md: Comprehensive plugin documentation covering:
    • Overview of plugins and their relationship to hooks
    • Basic usage with Agent(plugins=[...])
    • @hook decorator for declarative hook registration with event type inference
    • Union types for handling multiple event types with a single callback
    • Auto-discovery of @hook and @tool decorated methods
    • Creating custom plugins by extending the Plugin base class
    • Manual vs declarative hook registration patterns
    • Async plugin initialization
    • Advanced patterns (composition, conditional registration, error handling, multi-agent)
    • Best practices for naming, design, and hook registration
    • Reference to the existing Steering plugin as an example
    • Guidance on sharing plugins with the community

Navigation Updates

  • Added Plugins as a top-level section under Concepts in mkdocs.yml

Related Documentation Updates

  • docs/community/get-featured.md: Added Plugins as a new category type for community contributions
  • docs/user-guide/concepts/agents/hooks.md:
    • Added tip about considering Plugins for high-level behavior changes
    • Documented the simplified agent.add_hook() API with type hint inference
    • Added note comparing HookProvider vs Plugin patterns
  • docs/user-guide/safety-security/guardrails.md: Added tip about packaging guardrails as plugins
  • docs/user-guide/concepts/agents/retry-strategies.md: Added tip about packaging retry logic as plugins
  • AGENTS.md: Updated directory structure to include the new plugins directory

Technical Notes

  • Plugins are Python-only; TypeScript tabs use {{ ts_not_supported_code() }} macros
  • Documentation references the existing Steering plugin as an example of a working plugin
  • Page structure is designed to accommodate additional official plugins in the future
  • Documents the @hook decorator feature from [FEATURE] Create @hook decorator for Plugins sdk-python#1739

Resolves #568

- Add new docs/user-guide/concepts/plugins/index.md with comprehensive
  plugin documentation covering overview, basic usage, creating custom
  plugins, async initialization, advanced patterns, and best practices
- Update mkdocs.yml navigation to include Plugins under Concepts
- Update docs/community/get-featured.md to add Plugins category type
- Update docs/user-guide/concepts/agents/hooks.md with:
  - Plugin recommendation tip at the top
  - Simplified agent.add_hook() API with type inference documentation
  - HookProvider vs Plugin comparison note
- Add plugin recommendation tips to guardrails.md and retry-strategies.md
- Update AGENTS.md directory structure to include plugins directory

Resolves #568
Comment thread docs/user-guide/concepts/plugins/index.md Outdated
@github-actions
Copy link
Copy Markdown
Contributor

Assessment: Request Changes

This PR adds comprehensive documentation for the Plugins feature. The documentation is well-structured with good use of diagrams, code examples, and cross-references. However, there are two issues that need attention before merging.

Review Summary
  • Accidental File: build_output.log (264 lines of build logs) needs to be removed
  • Missing Import: The async plugin example references BeforeToolCallEvent without importing it

The overall documentation quality is excellent - the plugins concept is clearly explained with practical examples and good guidance on when to use plugins vs hooks. 👍

Comment thread build_output.log Outdated
@strands-agent
Copy link
Copy Markdown
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-573/

@Unshure Unshure self-assigned this Feb 26, 2026
@Unshure
Copy link
Copy Markdown
Member Author

Unshure commented Mar 2, 2026

/strands can you update the docs to include the changes in this pull request: strands-agents/sdk-python#1739

Update plugins documentation to include:
- @hook decorator for declarative hook registration
- Event type inference from type hints
- Union types for multiple event handlers
- Auto-discovery of @tool decorated methods in plugins
- Updated examples showing declarative approach
- Guidance on when to use @hook vs manual registration
- Multiple agents with same plugin instance pattern

References strands-agents/sdk-python#1739
@Unshure Unshure marked this pull request as ready for review March 4, 2026 15:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Assessment: Request Changes

The documentation has been significantly improved with the addition of @hook decorator documentation, union types, and auto-discovery features. The previous import issue has been resolved.

Remaining Issue
  • build_output.log: This accidentally committed file (264 lines of build logs) still needs to be removed before merging.

Once this file is removed, the PR should be ready to merge. The documentation is comprehensive and well-organized. 👍

@Unshure Unshure marked this pull request as draft March 4, 2026 17:38
@Unshure Unshure closed this Mar 4, 2026
@Unshure Unshure reopened this Mar 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Assessment: Request Changes (No changes since last review)

The build_output.log file (264 lines of build logs) still needs to be removed before this PR can be merged.

To remove it:

git rm build_output.log
git commit -m "chore: remove accidentally committed build output"
git push

The documentation content itself is ready to merge once this file is removed.

@strands-agent
Copy link
Copy Markdown
Contributor

Documentation Deployment Complete

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-573/

Comment thread build_output.log Outdated
Comment thread docs/user-guide/concepts/agents/hooks.md Outdated
Comment thread docs/user-guide/concepts/agents/hooks.md Outdated
Comment thread docs/user-guide/concepts/agents/retry-strategies.md Outdated
Comment thread docs/user-guide/safety-security/guardrails.md Outdated
Comment thread docs/user-guide/concepts/agents/hooks.md Outdated
Comment thread docs/user-guide/concepts/agents/hooks.md Outdated
Comment thread docs/user-guide/concepts/plugins/index.md Outdated
Comment thread docs/user-guide/concepts/plugins/index.md Outdated
Comment thread docs/user-guide/concepts/plugins/index.md Outdated
# Conflicts:
#	AGENTS.md
#	docs/user-guide/concepts/agents/hooks.md
#	mkdocs.yml
@strands-agents strands-agents deleted a comment from github-actions Bot Mar 9, 2026
@strands-agents strands-agents deleted a comment from github-actions Bot Mar 9, 2026
Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx Outdated
Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx Outdated
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: Comment (Minor Issues)

The PR has been successfully updated with the MDX conversion and new navigation format. The merge with main has been completed.

Changes Verified
  • ✅ Converted to MDX format with <Tabs> and <Tab> components
  • ✅ Navigation updated in src/config/navigation.yml
  • ✅ Plugins documentation preserved (270 lines)
  • ✅ hooks.mdx updated with "Using Plugins for Multiple Hooks" section
  • ✅ get-featured.mdx updated with Plugins category
Minor Issues
  • ⚠️ Some internal links still use .md extension (lines 5, 11, 189, 228, 268-269) while files are now .mdx
  • Verify if the docs system automatically resolves these or if they need updating

The content is solid - just need to confirm the link handling. Otherwise ready to merge! 🚀

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

Documentation Preview Ready

Your documentation preview has been successfully deployed!

Preview URL: https://d3ehv1nix5p99z.cloudfront.net/pr-cms-573/docs/user-guide/quickstart/overview/

Updated at: 2026-03-10T14:02:47.189Z

Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: Comment (One Minor Fix Remaining)

Most links have been fixed in commit 84c0362. Good progress!

Fixed Links
  • ✅ Line 189: [Agent State](../agents/state.mdx)
  • ✅ Line 268: [Hooks](../agents/hooks.mdx)
  • ✅ Line 269: [Steering](../experimental/steering.mdx)
Remaining Issue
  • ⚠️ Line 5: [steering](../experimental/steering.md) - still uses .md

Once this last link is fixed, the PR is ready to merge! 🚀

Comment thread src/content/docs/user-guide/concepts/agents/hooks.mdx
Comment thread src/content/docs/user-guide/concepts/agents/hooks.mdx
Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx Outdated
Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx Outdated
Comment thread src/content/docs/user-guide/concepts/plugins/index.mdx
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: Comment (One Minor Fix Still Remaining)

Commit c71a850 updated the content structure but the .md link on line 5 still needs to be fixed.

Link Status
Line Link Status
5 [steering](../experimental/steering.md) ⚠️ Still .md
9 [Steering](../experimental/steering) ✅ No extension
266 [Hooks](../agents/hooks.mdx) ✅ Fixed
267 [Steering](../experimental/steering.mdx) ✅ Fixed

Once line 5 is updated, the PR is ready to merge! 🚀

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.

[NEW CONTENT] Plugins

7 participants