Skill: Create Juju integration interface implementation README
When to use
- The user asks to create or draft a README for an interface library package.
- The user asks to document a Juju integration interface implementation.
- The user points to a package directory containing provider/requirer classes and asks for documentation.
Workflow
Identify the interface package. Locate the package directory. It will typically contain a src/ directory with an __init__.py (or similar module) that defines the provider and requirer classes, data models (often pydantic), and custom events.
Read the source code. Read the main module file(s) to extract:
- The package name and import path.
- Provider and Requirer class names.
- Custom events emitted by each side.
- Data models (pydantic
BaseModel subclasses or similar) that define the schema of relation data exchanged.
- Any constants, enums, or type aliases relevant to the interface contract.
- How secrets or sensitive data are handled (for example, Juju Secrets).
Determine data flow direction. Identify which fields flow from Requirer to Provider, and which flow from Provider to Requirer. This determines the arrows and labels in the mermaid diagram.
Generate the README following the output format below.
Verify accuracy. Cross-reference the generated README against the source code to ensure all documented fields, events, and behaviors are accurate.
Output format
The generated README MUST follow this structure exactly:
# `<package_name>`
## Usage
<One or two paragraphs describing what this interface does and when a charm would use it.>
To install, add `<pip-package-name>` to your Python dependencies. Then in your Python code, import as:
\```python
from <import_path> import <key_classes>
\```
## Direction
The `<interface_name>` interface implements a provider/requirer pattern.
The Provider is <description of provider role>.
The Requirer is <description of requirer role>.
\```mermaid
flowchart TD
Requirer -- <fields sent by requirer> --> Provider
Provider -- <fields sent by provider> --> Requirer
\```
## Behavior
<Brief prose describing the overall interaction between Provider and Requirer.>
### Provider
- Is expected to <behavior 1>.
- Is expected to <behavior 2>.
- ...
### Requirer
- Is expected to <behavior 1>.
- Is expected to <behavior 2>.
- ...
## Integration data
<Description of what data is exchanged and how it is structured. Mention whether data is passed via the relation databag, Juju Secrets, or both.>
[\[Pydantic Schema\]](<relative path to schema file, if available>)
### Example
\```yaml
provider:
app: {<fields>}
unit: {<fields>}
requirer:
app: {<fields>}
unit: {<fields>}
\```
## Examples
### Requirer charm
\```python
<Complete, minimal example of a charm using the Requirer side of the interface.
Include imports, class definition, __init__ with handler registration, and event callbacks.>
\```
### Provider charm
\```python
<Complete, minimal example of a charm using the Provider side of the interface.
Include imports, class definition, __init__ with handler registration, and event callbacks.>
\```
Notes
- If the package only exposes one side (for example, only a Requirer library for external charms to consume), include only that side in the Examples section but still document both sides in the Behavior section.
- The mermaid diagram arrows should be labeled with the key data field names exchanged in each direction. Use comma-separated field names on the arrow labels.
- The Integration data YAML example should show realistic but non-sensitive placeholder values.
- If the source code references a separate
schema.py file, link to it in the Integration data section.
- The Examples section should show how the library is actually used inside a charm's
src/charm.py, including event observation and handler methods.
Reference examples
The following upstream READMEs demonstrate the expected style and level of detail:
canonical/charmlibs — interfaces/filesystem_info/interface/v0/README.md
canonical/charmlibs — interfaces/etcd_client/interface/v0/README.md
canonical/data-platform-charmlibs — interfaces/README.md (for code example style in the Examples section)
Use the GitHub MCP server to query these examples if the server is available in the current harness environment
Constraints
- DO NOT USE Latin terms or abbreviations such as e.g. or i.e.
- DO USE English equivalents to Latin terms or abbreviations such as 'for example' (instead of e.g.) and 'that is' (instead of i.e.).
- DO NOT invent or assume data fields, events, or behaviors that are not present in the source code. If something is unclear, ask the user.
- DO keep prose concise and factual.
- DO use bullet lists for Provider and Requirer behavior expectations.
- DO use fenced code blocks with language identifiers (
python, yaml, mermaid).
1---2name: create-juju-integration-interface-readme3description: Create README files for standalone Juju integration interface implementation packages and libraries. Use when writing, reviewing, or generating a README for an interface library package that implements a provider/requirer pattern for Juju charm relations.4---56# Skill: Create Juju integration interface implementation README78When to use910- The user asks to create or draft a README for an interface library package.11- The user asks to document a Juju integration interface implementation.12- The user points to a package directory containing provider/requirer classes and asks for documentation.1314## Workflow15161. **Identify the interface package.** Locate the package directory. It will typically contain a `src/` directory with an `__init__.py` (or similar module) that defines the provider and requirer classes, data models (often pydantic), and custom events.17182. **Read the source code.** Read the main module file(s) to extract:19 - The package name and import path.20 - Provider and Requirer class names.21 - Custom events emitted by each side.22 - Data models (pydantic `BaseModel` subclasses or similar) that define the schema of relation data exchanged.23 - Any constants, enums, or type aliases relevant to the interface contract.24 - How secrets or sensitive data are handled (for example, Juju Secrets).25263. **Determine data flow direction.** Identify which fields flow from Requirer to Provider, and which flow from Provider to Requirer. This determines the arrows and labels in the mermaid diagram.27284. **Generate the README** following the output format below.29305. **Verify accuracy.** Cross-reference the generated README against the source code to ensure all documented fields, events, and behaviors are accurate.3132## Output format3334The generated README MUST follow this structure exactly:3536```markdown37# `<package_name>`3839## Usage4041<One or two paragraphs describing what this interface does and when a charm would use it.>4243To install, add `<pip-package-name>` to your Python dependencies. Then in your Python code, import as:4445\```python46from <import_path> import <key_classes>47\```4849## Direction5051The `<interface_name>` interface implements a provider/requirer pattern.52The Provider is <description of provider role>.53The Requirer is <description of requirer role>.5455\```mermaid56flowchart TD57 Requirer -- <fields sent by requirer> --> Provider58 Provider -- <fields sent by provider> --> Requirer59\```6061## Behavior6263<Brief prose describing the overall interaction between Provider and Requirer.>6465### Provider6667- Is expected to <behavior 1>.68- Is expected to <behavior 2>.69- ...7071### Requirer7273- Is expected to <behavior 1>.74- Is expected to <behavior 2>.75- ...7677## Integration data7879<Description of what data is exchanged and how it is structured. Mention whether data is passed via the relation databag, Juju Secrets, or both.>8081[\[Pydantic Schema\]](<relative path to schema file, if available>)8283### Example8485\```yaml86provider:87 app: {<fields>}88 unit: {<fields>}89requirer:90 app: {<fields>}91 unit: {<fields>}92\```9394## Examples9596### Requirer charm9798\```python99<Complete, minimal example of a charm using the Requirer side of the interface.100Include imports, class definition, __init__ with handler registration, and event callbacks.>101\```102103### Provider charm104105\```python106<Complete, minimal example of a charm using the Provider side of the interface.107Include imports, class definition, __init__ with handler registration, and event callbacks.>108\```109```110111## Notes112113- If the package only exposes one side (for example, only a Requirer library for external charms to consume), include only that side in the Examples section but still document both sides in the Behavior section.114- The mermaid diagram arrows should be labeled with the key data field names exchanged in each direction. Use comma-separated field names on the arrow labels.115- The Integration data YAML example should show realistic but non-sensitive placeholder values.116- If the source code references a separate `schema.py` file, link to it in the Integration data section.117- The Examples section should show how the library is actually used inside a charm's `src/charm.py`, including event observation and handler methods.118119## Reference examples120121The following upstream READMEs demonstrate the expected style and level of detail:122123- `canonical/charmlibs` — `interfaces/filesystem_info/interface/v0/README.md`124- `canonical/charmlibs` — `interfaces/etcd_client/interface/v0/README.md`125- `canonical/data-platform-charmlibs` — `interfaces/README.md` (for code example style in the Examples section)126127Use the GitHub MCP server to query these examples if the server is available in the current harness environment128129## Constraints130131- DO NOT USE Latin terms or abbreviations such as e.g. or i.e.132- DO USE English equivalents to Latin terms or abbreviations such as 'for example' (instead of e.g.) and 'that is' (instead of i.e.).133- DO NOT invent or assume data fields, events, or behaviors that are not present in the source code. If something is unclear, ask the user.134- DO keep prose concise and factual.135- DO use bullet lists for Provider and Requirer behavior expectations.136- DO use fenced code blocks with language identifiers (`python`, `yaml`, `mermaid`).