From scopy_dev_plugin
Delivers Scopy plugin patterns: C++ class structure, lifecycle (compatible/onConnect), ToolTemplate+refresh buttons, package layout, advanced QStackedWidget tools, and architecture trees. For plugin scaffolding.
npx claudepluginhub analogdevicesinc/scopy --plugin scopy_dev_pluginThis skill uses the workspace's default tool permissions.
```cpp
Defines C++ patterns for Scopy plugin API classes: ApiObject inheritance, Q_INVOKABLE tool/widget methods, friend access to IIOWidgetGroup, and plugin lifecycle integration. For API and test automation development.
Builds plugins/adapters for CLI tools using abstract base class pattern: defines contracts (static fields/methods), installation strategies (symlink/copy/append-to-file), detection, idempotent install/uninstall, listing, auditing, registration. For new framework support or plugin systems.
Documents Claude Code plugin structure including directory layout, plugin.json manifest, commands/agents/skills/hooks organization, naming conventions, and auto-discovery.
Share bugs, ideas, or general feedback.
class MyPlugin : public QObject, PluginBase {
SCOPY_PLUGIN
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.adi.Scopy.PluginBase")
Q_INTERFACES(scopy::PluginBase)
public:
bool compatible(QString m_param, QString category) override;
void loadToolList() override;
bool loadIcon() override;
void initMetadata() override;
bool onConnect() override;
bool onDisconnect() override;
private:
IIOWidgetGroup *m_widgetGroup = nullptr;
};
compatible(): Device detection using iio_context_find_device(conn->context(), "name")onConnect(): Create IIOWidgetGroup, create tools, set tool on m_toolListonDisconnect(): Delete tools, delete widget group, ConnectionProvider::close(m_param)initMetadata(): JSON with priority, category, excludeexplicit MyTool(iio_context *ctx, IIOWidgetGroup *group, QWidget *parent = nullptr);
m_tool = new ToolTemplate(this);
m_refreshButton = new AnimatedRefreshBtn(false, this);
m_tool->addWidgetToTopContainerHelper(m_refreshButton, TTA_RIGHT);
Refresh button triggers readRequested() via QtConcurrent::run.
scopy/packages/<name>/
├── manifest.json.cmakein
├── CMakeLists.txt
├── emu-xml/
└── plugins/<name>/
├── src/ # Implementation files
├── include/<name>/ # Header files
├── test/ # Unit tests
└── CMakeLists.txt
| iio-oscilloscope | Scopy | Purpose |
|---|---|---|
identify() | compatible() | Device detection |
init() | onConnect() | Create tools on connection |
destroy() | onDisconnect() | Cleanup on disconnect |
iio_widget helpers | IIOWidget / IIOWidgetBuilder | Attribute binding |
| Glade XML | Programmatic Qt code | UI definition |
adi,* debug attributes)MenuSectionCollapseWidget for collapsible sections in sub-tabsHas debug/advanced attributes (adi,*)?
├── YES → Basic tool + Advanced tool (QStackedWidget + sub-tabs)
└── NO → Single tool only
Shares devices with another plugin?
├── YES → Multiple tool variants (detect in onConnect)
└── NO → Single tool (most common)
QWidget *section = new QWidget(parent);
Style::setBackgroundColor(section, json::theme::background_primary);
Style::setStyle(section, style::properties::widget::border_interactive);
QLabel *title = new QLabel("Section Title", section);
Style::setStyle(title, style::properties::label::menuBig);
// Header
Q_DECLARE_LOGGING_CATEGORY(CAT_MYPLUGIN)
// Source
Q_LOGGING_CATEGORY(CAT_MYPLUGIN, "MyPlugin")
// Usage
qDebug(CAT_MYPLUGIN) << "Message";
See reference.md in this directory for complete lifecycle code templates.