Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .pymarkdown.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
"enabled": true,
"style": "atx"
},
"commands-show-output": {
"enabled": true
},
"no-missing-space-atx": {
"enabled": true
},
Expand Down Expand Up @@ -37,11 +34,17 @@
},
"no-alt-text": {
"enabled": true
},
"line-length": {
"enabled": true,
"line_length": 120,
"heading_line_length": 120,
"code_block_line_length": 120
}
},
"extensions": {
"front-matter" : {
"enabled" : true
}
}
}
}
27 changes: 24 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
VENVDIR := .venv
CONFIG := .pymarkdown.json
SOURCEDIR ?= .
FILE ?=

# Phony targets
.PHONY: help lint-md clean venv pymarkdownlnt-install
.PHONY: help lint-md clean venv pymarkdownlnt-install preview

# Default target
help:
@echo "Available targets:"
@echo " venv - Create virtual environment using uv"
@echo " pymarkdownlnt-install - Install pymarkdownlnt"
@echo " lint-md - Run markdown linter"
@echo " lint-md - Run markdown linter (FILE=path/to/file.md to check a single file)"
@echo " preview - Preview files that would be installed for a collection (COLLECTION=name)"
@echo " clean - Remove virtual environment"

# Create virtual environment using uv
Expand All @@ -32,12 +34,31 @@ pymarkdownlnt-install: venv
@uv pip install --python $(VENVDIR) pymarkdownlnt --quiet 2>&1 | grep -v "Audited" || true

# Run markdown linter
# Usage: make lint-md [FILE=path/to/file.md] [SOURCEDIR=path/to/dir]
lint-md: pymarkdownlnt-install
@echo "Running markdown linter..."
@uv run --python $(VENVDIR) pymarkdownlnt --config $(CONFIG) scan --recurse $(SOURCEDIR)
@if [ -n "$(FILE)" ]; then \
uv run --python $(VENVDIR) pymarkdownlnt --config $(CONFIG) scan $(FILE); \
else \
uv run --python $(VENVDIR) pymarkdownlnt --config $(CONFIG) scan --recurse $(SOURCEDIR); \
fi

# Clean virtual environment
clean:
@echo "Removing virtual environment..."
@rm -rf $(VENVDIR)
@echo "Virtual environment removed"

# Preview what would be installed for a given collection (dry-run)
# Usage: make preview COLLECTION=<collection-name>
COLLECTION ?=
preview:
@if [ -z "$(COLLECTION)" ]; then \
echo "❌ Usage: make preview COLLECTION=<collection-name>"; \
exit 1; \
fi
@TMPFILE=$$(mktemp ./copilot-preview-XXXXXX.yaml) && \
printf 'copilot:\n collections:\n - %s\n' "$(COLLECTION)" > $$TMPFILE && \
echo "🔍 Previewing collection: $(COLLECTION)" && \
bash scripts/install_collections.sh $$TMPFILE . --dry-run; \
rm -f $$TMPFILE
2 changes: 2 additions & 0 deletions groups/platform-engineering/collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ pfe-charms:
dest: .github/instructions/charms-lib-updates.instructions.md
- src: /assets/instructions/common/core-directive.instructions.md
dest: .github/instructions/core-directive.instructions.md
- src: skills/create-pr
dest: .github/skills/create-pr
66 changes: 66 additions & 0 deletions groups/platform-engineering/skills/create-pr/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
Comment thread
seb4stien marked this conversation as resolved.
name: create-pr
description: Create a pull request for the current session. Use when the user wants to open a PR with the session's changes.
# reference documentation: https://github.com/canonical/platform-engineering-docs/edit/main/docs/delivery-workflows/github/pull-requests/index.rst

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not sure of the efficiency or impact of placing reference documentation in the skill's description. I think it might be better if we reference in the body directly. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's for us, not for the agent :)
The content is copy-pasted in the body. We can remove it if you think it will introduce noise.

---

# Create Pull Request

Use the GitHub MCP server to create a pull request — do NOT use the `gh` CLI.

1. Run the compile and hygiene tasks (fixing any errors)
2. If there are any uncommitted changes, use the `/commit` skill to commit them
3. Review all changes in the current session
4. Write a clear, concise PR title with a short area prefix (e.g. "sessions: …", "editor: …")
5. Write a description covering what changed, why, and anything reviewers should know
6. Create the pull request following the guidelines from the next sections.

## PR description

Unless the PR is trivial or self-explanatory (for example, fixing typos in the
documentation, a well known task that needs to be done across many repositories
such as enabling a new bot), the PR description should include:

- A high level overview of the change
- The reason the change is needed
- Any additional information requested in the pull request template.

Use the template available in `.github/pull_request_template.md>` if available.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What do you think of adding an additional suggestion to include key agentic resource usage metrics if available?
Or should we add that to the template?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would go for the template indeed, easier to test :)


## PR branch name

PR branches should be named in a way that indicates the purpose of the branch.

Format: **type/scope-short-description[-optional-identifier]** (all lowercase, words separated by hyphens)

Where the type can be one of the following:

- `feat`: a new feature
- `fix`: a bug fix
- `docs`: documentation changes
- `chore`: a change that doesn't add a feature or fix a bug
(typically a maintenance change, such as updating dependencies or aligning with standards)
- `test`: adding or updating tests (if not related to a specific feature or bug fix,
in which case it should be tagged with the relevant type)
- `ci`: changes to our CI configuration or scripts (if not related to a specific feature or bug fix,
in which case it should be tagged with the relevant type)

Examples:

- `feat/tcp-wildcard-sni-support-isd-1234`
- `fix/non-working-tls-relation`
- `chore/terraform-align-module`

## PR title

The PR title follows the same philosophy as the branch name.

Format: **type(scope):short description [optional-identifier]** (all lowercase, words separated by spaces)

Where the type is the same as described in the branch name section.

Examples:

- `feat(tcp): add wildcard SNI support (ISD-1234)`
- `fix(tls): non-working TLS relation`
- `chore(terraform): align module with standards`
21 changes: 18 additions & 3 deletions scripts/install_collections.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@

set -e

# Usage: ./install_collections.sh <path_to_config_yaml> <path_to_toolkit_root>
# Usage: ./install_collections.sh <path_to_config_yaml> <path_to_toolkit_root> [--dry-run]
CONFIG_FILE="$1"
TOOLKIT_DIR="$2"
DRY_RUN=false

for arg in "$@"; do
if [ "$arg" = "--dry-run" ]; then
DRY_RUN=true
fi
done

# 1. Validation
if [ -z "$CONFIG_FILE" ] || [ -z "$TOOLKIT_DIR" ]; then
echo "❌ Usage: $0 <config_file> <toolkit_dir>"
echo "❌ Usage: $0 <config_file> <toolkit_dir> [--dry-run]"
exit 1
fi

Expand Down Expand Up @@ -103,6 +110,10 @@ process_collection() {

echo " - Installing $src -> $dest"

if [ "$DRY_RUN" = true ]; then
continue
fi

if [ -d "$full_src" ]; then
# Folder Copy
mkdir -p "$dest"
Expand All @@ -125,4 +136,8 @@ for col in $COLLECTIONS_LIST; do
done

rm "$MERGED_MANIFEST"
echo "✅ Sync complete."
if [ "$DRY_RUN" = true ]; then
echo "🔍 Dry-run complete. No files were copied."
else
echo "✅ Sync complete."
fi
Loading