### Docker Compose with Direct Configuration
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
A simplified docker-compose.yml example where configuration values like ports and environment variables are hardcoded directly into the file. This is suitable for basic setups but less flexible.
```yaml
services:
nginx:
ports:
- "8080:80"
db:
environment:
MYSQL_DATABASE: app
MYSQL_PASSWORD: secret
```
--------------------------------
### Custom React Hook Example
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/react-frontend.md
Demonstrates the structure and best practices for creating custom React hooks. Hooks should start with 'use', be pure functions, and handle their own cleanup.
```typescript
// Custom hooks should:
// 1. Start with 'use'
// 2. Be pure functions
// 3. Handle their own cleanup
function useUser(id: string) {
const { data, isLoading, error } = useQuery({
queryKey: ['user', id],
queryFn: () => fetchUser(id)
});
return { user: data, isLoading, error };
}
```
--------------------------------
### Docker Compose with Environment Variable Substitution
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
A docker-compose.yml example demonstrating the use of environment variables defined in a .env file. It shows how to dynamically set port mappings and service environment variables.
```yaml
services:
nginx:
ports:
- "${APP_PORT:-8080}:80"
db:
environment:
MYSQL_DATABASE: ${DB_DATABASE:-app}
MYSQL_PASSWORD: ${DB_PASSWORD:-secret}
```
--------------------------------
### WordPress Plugin Installation using WP-CLI
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
Commands to install and activate essential debugging plugins for WordPress development using WP-CLI. These include Query Monitor for database and hook inspection, Debug Bar for admin bar information, and Log Deprecated Notices for tracking deprecated function usage.
```bash
wp plugin install query-monitor --activate
wp plugin install debug-bar --activate
wp plugin install log-deprecated-notices --activate
```
--------------------------------
### WP-CLI Commands in Docker
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
This section provides examples of using WP-CLI commands within a Docker environment to manage WordPress installations. It covers common operations such as listing plugins, updating WordPress core, flushing the cache, and importing a database dump file using the `wp db import` command.
```bash
# Run WP-CLI commands
docker compose exec app wp plugin list
docker compose exec app wp core update
docker compose exec app wp cache flush
# Import database
docker compose exec app wp db import dump.sql
```
--------------------------------
### Start Development Server Command
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/react-frontend.md
Starts the local development server for real-time updates and testing during development.
```bash
{{DEV_COMMAND}}
```
--------------------------------
### MySQL 8.x Development Settings (my.cnf)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Provides example MySQL configuration settings for development environments. It includes optimizations for InnoDB buffer pool size and log file size, along with a SQL mode that is more development-friendly. Optional logging configurations are also commented out for debugging purposes.
```ini
[mysqld]
# Performance
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
# Development friendly
sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO"
# Logging (optional for debugging)
# general_log = 1
# general_log_file = /var/log/mysql/query.log
```
--------------------------------
### Frontend Development Server Start
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/laravel-fullstack.md
Command to start the frontend development server. Allows for real-time preview and hot-reloading during development.
```bash
{{NPM_DEV_COMMAND}}
```
--------------------------------
### Local Domain Setup in /etc/hosts
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
Adds entries to the /etc/hosts file to map local domain names (e.g., myapp.local) to the localhost IP address (127.0.0.1). This is useful for testing local development environments.
```text
127.0.0.1 myapp.local
127.0.0.1 api.local
127.0.0.1 admin.local
```
--------------------------------
### Drupal Development Setup Options
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
Outlines development setup options for Drupal projects. It includes suggestions for installing Drush, enabling verbose error reporting and Twig debugging, and disabling caching during development.
```text
Drupal Development Options:
1. Install Drush globally in container?
2. Enable development services (verbose errors, twig debug)?
3. Disable caching for development?
```
--------------------------------
### Install Dependencies Command
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/react-frontend.md
Installs project dependencies. This command is crucial for setting up the development environment.
```bash
{{INSTALL_COMMAND}}
```
--------------------------------
### Configure Docker Bind Mount Volume (YAML)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Example of a Docker bind mount volume configuration. This strategy directly maps a directory from the host machine to a container path, enabling instant file synchronization, which is ideal for development.
```yaml
volumes:
- ./:/var/www
```
--------------------------------
### WordPress Dockerfile for PHP Environment
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
A Dockerfile to set up a PHP 8.2 FPM environment for WordPress. It installs necessary PHP extensions like GD, MySQLi, Redis, and Imagick, along with WP-CLI for command-line management. This Dockerfile ensures all required dependencies are met for a robust WordPress setup.
```dockerfile
FROM php:8.2-fpm
# Install WordPress required extensions
RUN apt-get update && apt-get install -y \
libpng-dev libjpeg-dev libfreetype6-dev \
libzip-dev libicu-dev libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd mysqli pdo_mysql zip intl xml exif
# Install ImageMagick (optional but recommended)
RUN apt-get install -y libmagickwand-dev \
&& pecl install imagick \
&& docker-php-ext-enable imagick
# Install Redis extension
RUN pecl install redis && docker-php-ext-enable redis
# Opcache for development
RUN docker-php-ext-install opcache
COPY docker/php/opcache-dev.ini /usr/local/etc/php/conf.d/opcache.ini
# Install WP-CLI
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
WORKDIR /var/www/html
```
--------------------------------
### Install Skills via Claude Code Plugin Marketplace
Source: https://context7.com/thienanblog/awesome-ai-agent-skills/llms.txt
Instructions for adding the Awesome AI Agent Skills marketplace and installing skills using Claude Code. This involves adding the marketplace and then installing specific plugin groups.
```bash
# Step 1: Add the marketplace
/plugin marketplace add thienanblog/awesome-ai-agent-skills
# Step 2: Install plugins by domain
/plugin install documentation-skills@awesome-ai-agent-skills
/plugin install laravel-app-skills@awesome-ai-agent-skills
/plugin install devops-skills@awesome-ai-agent-skills
/plugin install workflow-skills@awesome-ai-agent-skills
# Update marketplace to get latest skills
/plugin marketplace update
```
--------------------------------
### Plugin Groups Configuration JSON
Source: https://context7.com/thienanblog/awesome-ai-agent-skills/llms.txt
Example JSON structure for `plugin-groups.json`, which organizes skills into installable bundles for AI agent plugin marketplaces. It defines plugin names, descriptions, and associated skills.
```json
{
"plugins": [
{
"name": "documentation-skills",
"description": "Skills for authoring AI agent instructions, backend documentation, and design systems.",
"skills": [
"agents-md-generator",
"documentation-guidelines",
"design-system-generator"
]
},
{
"name": "laravel-app-skills",
"description": "Guidelines for building Laravel 11/12 apps across common stacks and tooling.",
"skills": [
"laravel-11-12-app-guidelines"
]
},
{
"name": "devops-skills",
"description": "Skills for Docker, CI/CD, and local development environment configuration.",
"skills": [
"docker-local-dev"
]
},
{
"name": "workflow-skills",
"description": "Skills for AI agent workflow and requirements clarification processes.",
"skills": [
"ask-questions-if-underspecified"
]
}
]
}
```
--------------------------------
### Example: Auto-Detection Results Confirmation Prompt
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
This is an example of the prompt displayed to the user after the auto-detection script runs. It presents the detected tech stack and asks for confirmation or allows the user to indicate that further AI analysis is needed.
```text
I detected: Laravel 11 + PHP 8.3 + MySQL + Redis
Is this correct?
- Yes â proceed with detected settings
- No â I'll analyze further using AI
```
--------------------------------
### Frontend Dependency Installation
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/laravel-fullstack.md
Command to install project dependencies for a frontend application using npm. Essential before running or building the frontend.
```bash
{{NPM_INSTALL_COMMAND}}
```
--------------------------------
### Manual Installation and Validation of AI Agent Skills
Source: https://context7.com/thienanblog/awesome-ai-agent-skills/llms.txt
Steps for manually cloning the repository and installing dependencies to validate the skill structure using npm. This is useful for local development or integration with any AI coding tool.
```bash
# Clone the repository
git clone https://github.com/thienanblog/awesome-ai-agent-skills.git
cd awesome-ai-agent-skills
# Install dependencies for validation scripts
npm install
# Validate skill structure
npm run validate
# Expected output:
# ð Validating AI Agent Skills Repository
# =========================================
# Found 6 skill(s) in skills/
# ð Validating skills...
# ðŠ Validating marketplace.json...
# =========================================
# â
All validations passed! (6 valid skills)
```
--------------------------------
### HTML Button Component Example
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/design-system-generator/TEMPLATE_DESIGN_SYSTEM.md
Provides an example of a basic HTML button component using CSS classes for styling. This illustrates how components are structured and styled using the defined design system.
```html
```
--------------------------------
### API Blueprint File Example (BP)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/references/tech-stack-detection.md
This example shows a basic structure of an API Blueprint file, denoted by the '.apib' extension. API Blueprint is a markdown-based format for describing APIs.
```markdown
# My API
## Group: Users
### GET /users
+ Response 200 (application/json)
{"message": "Users list"}
```
--------------------------------
### Install Claude Code Skills
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/README.md
Commands to install specific skill bundles from the 'awesome-ai-agent-skills' marketplace into Claude Code. These commands allow for modular installation of related skills.
```bash
# Install a plugin (can bundle multiple skills)
/plugin install documentation-skills@awesome-ai-agent-skills
# Install Laravel guidelines
/plugin install laravel-app-skills@awesome-ai-agent-skills
# Install Docker local development skill
/plugin install devops-skills@awesome-ai-agent-skills
# Install workflow/clarification skill
/plugin install workflow-skills@awesome-ai-agent-skills
```
--------------------------------
### Detect Network Configuration with detect-network.sh
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
Executes a script to detect the current network setup, specifically identifying running reverse proxy containers (like Nginx Proxy Manager, Traefik, Caddy), available Docker networks, and suggesting a network for new services to join. This aids in deciding the appropriate port exposure strategy.
```bash
./scripts/detect-network.sh
```
--------------------------------
### Start and Check Docker Compose Services
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/merge-backup-strategy.md
Starts all services defined in the docker-compose.yml file in detached mode and then lists the running services. This is useful for testing if containers start correctly and are operational.
```bash
docker compose up -d
docker compose ps
```
--------------------------------
### CSS Design Tokens Example
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/design-system-generator/TEMPLATE_DESIGN_SYSTEM.md
Demonstrates the usage of CSS variables for design tokens, including colors, radius, and spacing. These tokens serve as the source of truth for styling and ensure consistency across the application.
```css
:root {
--color-bg: #ffffff;
--color-fg: #0b0f17;
--radius-md: 12px;
--space-4: 16px;
}
```
--------------------------------
### Unit and Integration Testing in TypeScript
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/node-backend.md
Illustrates unit and integration testing patterns in TypeScript using Jest and Supertest. The unit test example focuses on testing a `UserService` by mocking its dependencies. The integration test example demonstrates testing an API endpoint for user creation.
```typescript
// Unit test example
describe('UserService', () => {
let service: UserService;
let mockRepository: jest.Mocked;
beforeEach(() => {
mockRepository = createMockRepository();
service = new UserService(mockRepository);
});
it('should find user by id', async () => {
mockRepository.findById.mockResolvedValue(mockUser);
const result = await service.findById('1');
expect(result).toEqual(mockUser);
});
});
// Integration test example
describe('POST /users', () => {
it('should create a user', async () => {
const response = await request(app)
.post('/users')
.send({ name: 'Test', email: 'test@example.com' });
expect(response.status).toBe(201);
expect(response.body.data.name).toBe('Test');
});
});
```
--------------------------------
### Wildcard DNS Setup with dnsmasq on macOS
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
Installs and configures dnsmasq on macOS to handle wildcard DNS resolution for local domains. It directs all '.local' domain requests to 127.0.0.1, simplifying local development.
```bash
# macOS with Homebrew
brew install dnsmasq
echo 'address=/.local/127.0.0.1' >> /usr/local/etc/dnsmasq.conf
sudo brew services start dnsmasq
```
--------------------------------
### Example: Tech Stack Confirmation Prompt (Auto-Detection Success)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
If auto-detection is successful, this prompt displays the inferred configuration details (framework, versions, services) and asks the user to confirm or adjust them.
```text
Detected configuration:
- Framework: Laravel 11
- PHP Version: 8.3
- Database: MySQL (from .env DB_CONNECTION)
- Redis: Yes (from .env REDIS_HOST)
- Queue: Yes (jobs table detected)
Please confirm or adjust these settings.
```
--------------------------------
### Change Docker Service Port Mapping
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
An example of how to change the port mapping for a Docker service in docker-compose.yml to resolve port conflicts. This example changes the host port from 8080 to 8081.
```yaml
ports:
- "8081:80" # Instead of 8080
```
--------------------------------
### Example: Prompt for Handling Existing Docker Files
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
When existing Docker files (`docker-compose.yml`, `Dockerfile`) are detected, this prompt asks the user how the skill should proceed. Options include merging, replacing with backups, or canceling the operation.
```text
I found existing Docker files:
- docker-compose.yml (modified 2 days ago)
- Dockerfile
How should I proceed?
1. Merge (preserve your custom settings, add new services)
2. Replace (backup existing, generate fresh)
3. Cancel (let me review first)
```
--------------------------------
### Drupal Dockerfile for PHP 8.2 FPM
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
A Dockerfile to build a PHP 8.2 FPM image for Drupal. It installs necessary PHP extensions for Drupal (GD, MySQLi, Zip, Intl, XML, OPCache) and globally installs Drush using aphar.
```dockerfile
FROM php:8.2-fpm
# Install Drupal required extensions
RUN apt-get update && apt-get install -y \
libpng-dev libjpeg-dev libfreetype6-dev \
libzip-dev libicu-dev libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd pdo_mysql zip intl xml opcache
# Install Drush globally
RUN curl -OL https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar \
&& chmod +x drush.phar \
&& mv drush.phar /usr/local/bin/drush
WORKDIR /var/www/html
```
--------------------------------
### Example: Tech Stack Selection Prompt (Auto-Detection Failure)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
When auto-detection fails or the stack is unclear, this prompt presents a list of supported tech stacks for the user to select from, or an option for generic configuration.
```text
What is your primary tech stack?
1. PHP/Laravel
2. WordPress
3. Drupal
4. Joomla
5. Node.js (Express/NestJS/Next.js)
6. Python (Django/FastAPI/Flask)
7. Other (I'll try generic configuration)
```
--------------------------------
### Configure Docker Hybrid Volume Approach (YAML)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Presents a hybrid Docker volume strategy combining bind mounts for source code with named volumes for dependencies like `vendor` and `node_modules`. This balances development flexibility with performance for cached assets.
```yaml
volumes:
- ./:/var/www # Source code (bind mount)
- vendor_cache:/var/www/vendor # Dependencies (named volume)
- node_modules_cache:/var/www/node_modules
volumes:
vendor_cache:
node_modules_cache:
```
--------------------------------
### Configure Supervisor for Celery Worker (INI)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Defines a Supervisor configuration for a Python Celery worker. This includes the command to start the worker, the working directory, user, logging paths, and restart policies.
```ini
[program:celery]
command=celery -A myapp worker --loglevel=info
directory=/var/www
user=www-data
numprocs=1
autostart=true
autorestart=true
startsecs=10
stopwaitsecs=600
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker-error.log
```
--------------------------------
### Drush Commands for Drupal Management
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
Common Drush commands used for managing a Drupal site. These include clearing the cache, running database updates, installing modules, and generating one-time login links.
```bash
# Clear cache
drush cr
# Run database updates
drush updb
# Install a module
drush en module_name
# Generate one-time login link
drush uli
```
--------------------------------
### Marketplace JSON Structure Example (JSON)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/AGENTS.md
Illustrates the structure of the marketplace.json file, which organizes AI agent skills into plugins. It includes metadata about the repository owner and a list of plugins, each with a name, description, source, and an array of skill paths.
```json
{
"name": "awesome-ai-agent-skills",
"owner": {
"name": "Ãn VÅ©",
"email": "8651688+thienanblog@users.noreply.github.com"
},
"metadata": {
"description": "Community-shared skills for AI coding agents",
"version": "1.0.0"
},
"plugins": [
{
"name": "documentation-skills",
"description": "Skills for authoring AI agent instructions and backend documentation.",
"source": "./",
"strict": false,
"skills": [
"./skills/agents-md-generator",
"./skills/documentation-guidelines"
]
},
{
"name": "laravel-app-skills",
"description": "Guidelines for building Laravel 11/12 apps across common stacks and tooling.",
"source": "./",
"strict": false,
"skills": [
"./skills/laravel-11-12-app-guidelines"
]
}
]
}
```
--------------------------------
### Example: Handling Unsupported Stack Detection
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
This message is displayed when the auto-detection script identifies a tech stack that is not officially supported by the skill. It informs the user about potential suboptimal configurations and encourages contributions to improve support.
```text
I detected [stack] but this is not in our supported list.
The Docker setup may not be optimal.
Proceeding with generic configuration...
If this works for you, please consider contributing to improve support!
See: CONTRIBUTING.md
```
--------------------------------
### Environment Variables for Docker Compose (.env.docker)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
An example .env.docker file defining environment variables for ports, database credentials, and the Docker Compose project name. These variables can be used to configure services in docker-compose.yml.
```env
# Ports
APP_PORT=8080
DB_PORT=3306
REDIS_PORT=6379
MAIL_PORT=1025
MAIL_UI_PORT=8025
# Database
DB_DATABASE=app
DB_USERNAME=app
DB_PASSWORD=secret
# Compose project name (for network naming)
COMPOSE_PROJECT_NAME=myapp
```
--------------------------------
### Stop Local Database Service
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
Bash commands to stop common local database services like MySQL. This is a strategy to resolve port conflicts when a Dockerized service needs a port already in use by a local installation.
```bash
# Stop local MySQL
brew services stop mysql
# or
sudo systemctl stop mysql
```
--------------------------------
### Run Project Tests
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/laravel-backend.md
This command executes the project's test suite, which includes feature and unit tests. Writing tests for all new features and using factories for test data are mandatory.
```bash
{{TEST_COMMAND}}
```
--------------------------------
### Configure Supervisor for Laravel Queue Worker (INI)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Defines a Supervisor configuration for running Laravel queue workers. This setup specifies the command to execute, auto-start and restart policies, user, number of processes, and log file locations.
```ini
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work redis --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/worker.log
stopwaitsecs=3600
```
--------------------------------
### OpenAPI/Swagger Documentation Files (YAML/JSON)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/references/tech-stack-detection.md
This example shows common file names and extensions used for OpenAPI and Swagger API documentation. These files can be in YAML or JSON format and are crucial for defining API contracts.
```yaml
openapi: 3.0.0
info:
title: Sample API
version: 1.0.0
```
```json
{
"openapi": "3.0.0",
"info": {
"title": "Sample API",
"version": "1.0.0"
}
}
```
--------------------------------
### Joomla Dockerfile for PHP 8.2 FPM
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
A Dockerfile to build a PHP 8.2 FPM image for Joomla. It installs necessary PHP extensions for Joomla (GD, MySQLi, Zip, Intl, XML, OPCache) and sets the working directory.
```dockerfile
FROM php:8.2-fpm
# Install Joomla required extensions
RUN apt-get update && apt-get install -y \
libpng-dev libjpeg-dev libfreetype6-dev \
libzip-dev libicu-dev libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) \
gd mysqli pdo_mysql zip intl xml opcache
WORKDIR /var/www/html
```
--------------------------------
### Joomla Docker Compose Service Configuration
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
Defines the Docker Compose service for a Joomla application. It mirrors the Drupal setup with build context, Dockerfile, volume mounts, database dependency, and environment variables for Joomla's database connection.
```yaml
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ./:/var/www/html
depends_on:
- db
environment:
JOOMLA_DB_HOST: db
JOOMLA_DB_NAME: ${DB_DATABASE:-joomla}
JOOMLA_DB_USER: ${DB_USERNAME:-joomla}
JOOMLA_DB_PASSWORD: ${DB_PASSWORD:-joomla}
```
--------------------------------
### Configure PHP Opcache for Production (INI Hints)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Offers hints for optimizing PHP Opcache settings in a production environment. It suggests disabling timestamp validation or setting a revalidation frequency to improve performance by reducing file system checks.
```ini
; For production, consider:
; opcache.validate_timestamps=0 ; Don't check for file changes
; opcache.revalidate_freq=60 ; Or check less frequently
```
--------------------------------
### Nginx Proxy Manager Docker Compose Setup
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
Sets up Nginx Proxy Manager as a service in Docker Compose, exposing ports for HTTP, HTTPS, and the admin UI. It also defines necessary volumes for data persistence and a network for proxying.
```yaml
services:
npm:
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "81:81" # Admin UI
volumes:
- npm_data:/data
- npm_letsencrypt:/etc/letsencrypt
networks:
- proxy
networks:
proxy:
external: true
name: proxy_network
volumes:
npm_data:
npm_letsencrypt:
```
--------------------------------
### Example: Backup Strategy Notification
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/SKILL.md
This note explains the backup strategy employed by the skill when modifying or replacing existing Docker files. It emphasizes the use of timestamped backups to prevent data loss.
```text
Backup strategy:
- Timestamped backups: docker-compose.yml.backup.2024-01-15-143022
- Never overwrite without backup
```
--------------------------------
### Docker Compose: Multiple Networks for Service Segmentation
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
An example of a Docker Compose file that defines and utilizes multiple networks to segment services. This configuration allows for fine-grained control over network access, such as separating frontend and backend services, enhancing security and network organization.
```yaml
networks:
frontend:
driver: bridge
backend:
driver: bridge
services:
nginx:
networks:
- frontend
app:
networks:
- frontend
- backend
db:
networks:
- backend
```
--------------------------------
### FastAPI: Example API Router for User Creation
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/python-backend.md
Illustrates how to define an API endpoint using FastAPI for creating a user. It utilizes `APIRouter`, `Depends` for dependency injection of a `UserService`, and Pydantic models for request and response validation. The endpoint is POST `/users/` and returns a `UserResponse` with a 201 status code on success.
```python
from fastapi import APIRouter, Depends, HTTPException
from app.schemas import UserCreate, UserResponse
from app.services import UserService
router = APIRouter(prefix="/users", tags=["users"])
@router.post("/", response_model=UserResponse, status_code=201)
async def create_user(
user_data: UserCreate,
service: UserService = Depends(get_user_service)
):
return await service.create(user_data)
```
--------------------------------
### Django Tests: Basic API Test Case
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/python-backend.md
Provides an example of using Django's `APITestCase` for testing API endpoints. It sets up a test user and then makes a GET request to the user list endpoint, asserting that the response status code is 200 OK.
```python
from django.test import TestCase
from rest_framework.test import APITestCase
class UserAPITestCase(APITestCase):
def setUp(self):
self.user = User.objects.create_user(
username='testuser',
email='test@example.com'
)
def test_list_users(self):
response = self.client.get('/api/users/')
self.assertEqual(response.status_code, 200)
```
--------------------------------
### Configure Docker Bind Mount with Performance Options (YAML)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Demonstrates Docker bind mount configurations optimized for performance, particularly on macOS. Options like `:cached` and `:delegated` adjust file system consistency settings to mitigate performance issues.
```yaml
volumes:
- ./:/var/www:cached # Relaxed consistency
# or
- ./:/var/www:delegated # Container-authoritative
```
--------------------------------
### Nginx Configuration for WordPress
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/cms-configuration-guide.md
Nginx server block configuration optimized for WordPress. It handles listening on port 80, setting the document root, configuring PHP FastCGI processing, denying access to sensitive files, and implementing static file caching for improved performance. This setup is suitable for a Dockerized WordPress environment.
```nginx
server {
listen 80;
server_name localhost;
root /var/www/html;
index index.php;
client_max_body_size 100M;
# WordPress permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}
# PHP handling
location ~ \.php$ {
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
# Deny access to sensitive files
location ~ /\.ht {
deny all;
}
location = /wp-config.php {
deny all;
}
# Static file caching
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 30d;
add_header Cache-Control "public, no-transform";
}
}
```
--------------------------------
### Docker Compose: Internal Only Port Exposure (Reverse Proxy)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
A Docker Compose configuration example for services when a reverse proxy is in use. It demonstrates how to avoid exposing most service ports directly to the host, instead relying on the reverse proxy for routing and access. Database ports can optionally be exposed for direct tool access.
```yaml
services:
nginx:
# No ports exposed - proxy handles routing
networks:
- default
- proxy_network # Shared with reverse proxy
db:
# Optionally expose for SQL tools
ports:
- "${DB_PORT:-3306}:3306"
app:
# No ports exposed
redis:
# No ports exposed
mailpit:
# No ports exposed - access via proxy or internal network
```
--------------------------------
### Configure Docker Compose Service Health Checks
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/health-check-patterns.md
Demonstrates how to define health checks for services within a `docker-compose.yml` file. It shows examples for MySQL and Redis, specifying test commands, intervals, timeouts, retries, and start periods. It also illustrates how to make services depend on the healthy status of others, ensuring proper startup order.
```yaml
services:
db:
image: mysql:8.0
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
redis:
image: redis:alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
app:
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
```
--------------------------------
### Configure Service Ports Using Environment Variables (YAML)
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/service-configuration-guide.md
Demonstrates how to use environment variables defined in a `.env` file to configure service ports within a `docker-compose.yml` file. This allows for flexible port mapping, such as for the Nginx service.
```yaml
services:
nginx:
ports:
- "${APP_PORT:-8080}:80"
```
--------------------------------
### Docker Compose: Full Port Exposure
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/docker-local-dev/references/networking-ports-guide.md
A Docker Compose configuration example demonstrating full port exposure for all services. This approach is typically used for debugging or when external tools require direct access to each service's port. It includes exposing ports for web servers, databases, caches, mail services, and application backends.
```yaml
services:
nginx:
ports:
- "${APP_PORT:-8080}:80"
db:
ports:
- "${DB_PORT:-3306}:3306"
redis:
ports:
- "${REDIS_PORT:-6379}:6379"
mailpit:
ports:
- "${MAIL_PORT:-1025}:1025" # SMTP
- "${MAIL_UI_PORT:-8025}:8025" # Web UI
app:
ports:
- "${PHP_FPM_PORT:-9000}:9000" # Usually not needed
```
--------------------------------
### Production Build Command
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/react-frontend.md
Builds the project for production deployment, optimizing assets and code for performance and size.
```bash
{{BUILD_COMMAND}}
```
--------------------------------
### Python Type Hinting for Function Signatures
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/python-backend.md
Demonstrates the use of Python type hints for function signatures, improving code readability and enabling static analysis. This includes specifying return types and argument types, with support for optional and list types.
```python
from typing import Optional, List
def get_user(user_id: int) -> Optional[User]:
"""Retrieve a user by ID."""
return User.query.get(user_id)
def list_users(active: bool = True) -> List[User]:
"""List all users, optionally filtered by status."""
query = User.query
if active:
query = query.filter(User.is_active == True)
return query.all()
```
--------------------------------
### SQLAlchemy: Optimize Queries with Eager Loading
Source: https://github.com/thienanblog/awesome-ai-agent-skills/blob/main/skills/agents-md-generator/assets/templates/python-backend.md
Demonstrates eager loading techniques in SQLAlchemy to optimize database queries. `joinedload` performs an SQL JOIN to fetch related data, while `selectinload` uses separate queries to fetch related data, both aiming to prevent N+1 query issues.
```python
# Use eager loading
users = session.query(User).options(
joinedload(User.profile),
selectinload(User.orders)
).all()
```