Skip to content

Commit dc1b828

Browse files
sebastianthulinSebastian Thulin
and
Sebastian Thulin
authored
feat: add llm instruction base. Test llm instructions on two features. (#1315)
Co-authored-by: Sebastian Thulin <sebastian.thulin@helsingborg.se>
1 parent 253a696 commit dc1b828

File tree

3 files changed

+161
-0
lines changed

3 files changed

+161
-0
lines changed

docs/utils/llm-prompt.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Promt for Automated LLM Documentation
2+
This is a "how-to" in order to generate automatic documentation in a LLM. Some features may be to large to input in a all LLM's. Small features will be possible to generate in OpenAI, and larger features has been successfully entered to Gemeni.
3+
4+
---
5+
6+
## How to Retrieve the Feature Code
7+
To fetch the feature's code, run the following command in the feature directory:
8+
```bash
9+
find . -type f -not -path '*/\.*' | while read -r file; do echo -e "\n=== File: $file ===\n"; cat "$file"; done | pbcopy
10+
```
11+
12+
---
13+
14+
# [Feature Name]
15+
16+
### Description
17+
Provide a **brief overview** of the feature and its functionality. Explain what it does and where it is used in the system.
18+
19+
## How to Utilize
20+
21+
### For Administrators / Editors
22+
- Explain how **administrators** can use the feature, including step-by-step instructions.
23+
- Mention any **capabilities/permissions** required (e.g., `edit_posts`, `manage_options`).
24+
- Detail where to find the settings (e.g., in the WordPress admin panel).
25+
26+
### For Users
27+
- Describe how users will see or experience the feature on the frontend.
28+
29+
---
30+
31+
## Purpose
32+
33+
### Why This Feature Exists
34+
- Describe **what problem this feature solves** and why it was implemented.
35+
- Explain how it benefits different user groups (administrators, editors, and end users).
36+
37+
### Key Benefits
38+
✅ Centralizes functionality or information.
39+
✅ Improves the user experience by [explain benefit].
40+
✅ Reduces manual work for [specific user roles].
41+
42+
---
43+
44+
## Meta
45+
46+
- **Author:** [Name or Team]
47+
- **Initial Release Date:** [Month, Year]

library/GlobalNotices/readme.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Global Notices Feature
2+
3+
## Feature Name
4+
5+
### Description
6+
The **Global Notices** feature allows administrators to create and manage **site-wide notifications** that appear in different locations on the website. These notices can be displayed as:
7+
8+
- **Banners** (full-width messages at the top of the page)
9+
- **Toasts** (small pop-up notifications)
10+
- **Content Notices** (embedded within page content)
11+
12+
Each notice can include an **icon**, an **action button/link**, and be **dismissable** for a set period. Notices are managed from the WordPress admin panel and can be configured based on user roles, login status, and page type.
13+
14+
---
15+
16+
## How to Utilize
17+
18+
### For Administrators
19+
**Accessing the Feature:**
20+
- Navigate to **Global Notices** in the WordPress admin menu.
21+
- Requires the **edit_posts** capability to manage notices.
22+
23+
**Creating a Notice:**
24+
1. Click **"Add New Notice"** and configure:
25+
- **Message:** The main content of the notice.
26+
- **Type:** Info, warning, error, or success.
27+
- **Icon:** Optional visual indicator.
28+
- **Action:** A button or link (optional).
29+
- **Dismissable:** Set whether users can close the notice and how long it remains hidden.
30+
- **Location:** Choose from **Toast, Banner, or Content**.
31+
- **Constraints:** Restrict visibility based on:
32+
- **User Role & Login Status** (logged-in users vs. guests).
33+
- **Page Type** (frontpage vs. subpages).
34+
2. Click **Save & Publish** to make the notice live.
35+
36+
### For Editors & Users
37+
- **Editors** (if they have the required permissions) can also create and manage notices.
38+
- **Users** will see notices based on the defined settings.
39+
- Dismissable notices remain hidden for the specified duration once closed.
40+
- Notices with **actions** (e.g., links/buttons) provide easy access to relevant information.
41+
42+
---
43+
44+
## Purpose
45+
46+
### Why This Feature Exists
47+
The **Global Notices** feature is designed to:
48+
✅ Provide a **centralized** way to display important messages across the website.
49+
✅ Allow **targeted messaging** based on user role, login status, and page type.
50+
✅ Improve **communication** between administrators and website visitors.
51+
52+
### Who Benefits?
53+
- **Site Administrators**: Easily manage and schedule notices without modifying templates.
54+
- **Editors**: Display important updates without relying on developers.
55+
- **End Users**: Get relevant information at the right place and time, improving user experience.
56+
57+
This feature eliminates the need for manually inserting notices on multiple pages and ensures consistency in messaging.
58+
59+
---
60+
61+
## Meta
62+
63+
- **Author:** Helsingborg Stad
64+
- **Initial Release Date:** February 2025

library/UserGroup/readme.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# User Group Management and Content Restriction
2+
3+
### Description
4+
5+
This feature enhances user management and content control by introducing user groups and the ability to restrict access to content based on these groups. It allows administrators to categorize users into groups (e.g., "Subscribers," "Members," "Employees") and then control which groups can view specific posts or attachments. This provides granular control over content visibility, enabling personalized experiences and secure information sharing. The functionality integrates with Single Sign-On (SSO) for streamlined user login and redirection.
6+
7+
## How to Utilize
8+
9+
### For Administrators / Editors
10+
11+
1. **Access User Groups:** Navigate to "Users" -> "User Groups" in the WordPress admin menu. This will take you to the taxonomy management screen where you can create, edit, and delete user groups. *Requires the `manage_options` capability.*
12+
13+
2. **Assign Users to Groups:** On a user's profile page (Users -> All Users -> Edit User), a new "User Group" field will be present. Use this field to assign the user to a user group.
14+
15+
3. **Restrict Content Visibility:** When editing a post or attachment, a "User group visibility" meta box will appear in the "Publish" section of the editor (it may be hidden initially, check "Screen Options" at the top right). Select the user groups that should have access to this content. If no groups are selected, the content will be visible to all logged-in users. *Requires the `edit_posts` capability (or `edit_attachments` for attachments).*
16+
17+
4. **SSO Redirection:** After a user logs in via SSO, they will be automatically redirected to a URL specific to their assigned user group, if configured. T
18+
19+
5. **Automatic mapping of User Groups** Usergroups will automaticly be mapped to the user, based on the "companyname" field in most sso-services.
20+
21+
### For Users
22+
23+
- **Frontend Experience:** Users will only see posts and attachments that are visible to their assigned user group(s). If a user is not logged in, or is logged in but does not belong to a group with access, they will not see the restricted content.
24+
- **SSO Login:** Users can log in via SSO. If a redirect URL is set for their group, they will be redirected accordingly.
25+
26+
---
27+
28+
## Purpose
29+
30+
### Why This Feature Exists
31+
32+
This feature addresses the need for controlled content access based on user roles or affiliations. It solves the problem of:
33+
34+
- **Creating internal knowledge bases:** Sharing information only with specific departments or teams.
35+
- **Personalizing user experiences:** Showing content relevant to a user's interests.
36+
- **Simplifying SSO redirection:** Streamlining the post-login experience for users based on their group.
37+
38+
### Key Benefits
39+
40+
**Centralizes functionality:** Manages user groups and content restrictions within WordPress.
41+
**Improves the user experience:** Provides personalized content access and a streamlined SSO login flow.
42+
**Reduces manual work:** Automates content visibility based on user group assignments, eliminating the need for manual checks or workarounds.
43+
**Enhances security:** Protects sensitive information by restricting access to authorized user groups.
44+
45+
---
46+
47+
## Meta
48+
49+
- **Author:** Helsingborg Stad
50+
- **Initial Release Date:** October, 2023

0 commit comments

Comments
 (0)