Skip to content

Commit d0669b9

Browse files
committed
[#1639] Added AI agentic instructions selection to the installer.
1 parent c8f94bc commit d0669b9

24 files changed

Lines changed: 3245 additions & 613 deletions

File tree

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55

66
/.gitattributes export-ignore
77
/.github/FUNDING.yml export-ignore
8-
/.vortex export-ignore
8+
/.vortex export-ignore
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DrevOps\VortexInstaller\Prompts\Handlers;
6+
7+
class AiCodeInstructions extends AbstractHandler {
8+
9+
const NONE = 'none';
10+
11+
const CLAUDE = 'claude';
12+
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public function discover(): null|string|bool|array {
17+
if (!$this->isInstalled()) {
18+
return NULL;
19+
}
20+
21+
if (is_readable($this->dstDir . '/CLAUDE.md')) {
22+
return self::CLAUDE;
23+
}
24+
25+
return self::NONE;
26+
}
27+
28+
/**
29+
* {@inheritdoc}
30+
*/
31+
public function process(): void {
32+
$v = $this->getResponseAsString();
33+
$t = $this->tmpDir;
34+
35+
if ($v !== self::CLAUDE) {
36+
@unlink($t . '/CLAUDE.md');
37+
}
38+
}
39+
40+
}

.vortex/installer/src/Prompts/PromptManager.php

Lines changed: 102 additions & 45 deletions
Large diffs are not rendered by default.

.vortex/installer/tests/Fixtures/install/_baseline/CLAUDE.md renamed to .vortex/installer/tests/Fixtures/install/ai_instructions_claude/CLAUDE.md

Lines changed: 41 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Vortex Drupal Project - Development Guide
22

3-
> **🚀 PROJECT MODE**: This guide helps with **developing Drupal projects** created from the Vortex template.
4-
>
5-
> For **maintaining the Vortex template itself**, see the maintenance guide: `.vortex/CLAUDE.md`
6-
73
## Project Overview
84

95
This is a Drupal project built with **Vortex** - a comprehensive Drupal project template by DrevOps that provides production-ready development and deployment workflows.
@@ -21,42 +17,52 @@ ahoy up
2117
ahoy info
2218
```
2319

24-
## Development Workflows
20+
## Local Development Commands (Ahoy)
2521

26-
### Local Development Commands (Ahoy)
22+
### Environment management
2723

2824
```bash
29-
# Environment management
3025
ahoy up # Start Docker containers
3126
ahoy down # Stop Docker containers
3227
ahoy restart # Restart containers
3328
ahoy info # Show project information and URLs
29+
```
3430

35-
# Site building and provisioning
31+
### Site building and provisioning
32+
33+
```bash
3634
ahoy build # Build site from scratch
3735
ahoy provision # Provision site (install/import DB)
3836
ahoy reset # Reset to clean state
37+
```
38+
39+
### Database operations
3940

40-
# Database operations
41+
```bash
4142
ahoy download-db # Download fresh database
4243
ahoy export-db # Export current database
4344
ahoy import-db # Import database from file
45+
```
46+
47+
### Development tools
4448

45-
# Development tools
49+
```bash
4650
ahoy drush [command] # Run Drush commands
4751
ahoy composer [command] # Run Composer commands
4852
ahoy phpcs # Run code style checks
4953
ahoy phpcbf # Fix code style issues
5054
```
5155

52-
### Code Quality and Testing
56+
### Code Quality
5357

5458
```bash
55-
# Linting and code standards
5659
ahoy lint # Run all linting checks
5760
ahoy lint-fix # Fix automatically fixable issues
61+
```
5862

59-
# Testing
63+
### Testing
64+
65+
```bash
6066
ahoy test-unit # Run PHPUnit tests
6167
ahoy test-bdd # Run Behat (BDD) tests
6268
ahoy test # Run all tests
@@ -87,6 +93,7 @@ ahoy test # Run all tests
8793
## Configuration Management
8894

8995
### Exporting Configuration
96+
9097
```bash
9198
# Export all configuration changes
9299
ahoy drush config:export
@@ -96,6 +103,7 @@ ahoy drush config:export --diff
96103
```
97104

98105
### Importing Configuration
106+
99107
```bash
100108
# Import configuration (usually part of deployment)
101109
ahoy drush config:import
@@ -104,57 +112,34 @@ ahoy drush config:import
104112
ahoy drush config:import --source=../config/stage
105113
```
106114

107-
## Custom Development
108-
109-
### Creating Custom Modules
110-
```bash
111-
# Generate module scaffold
112-
ahoy drush generate:module [module_name]
113-
114-
# Enable custom module
115-
ahoy drush pm:install [module_name]
116-
```
117-
118115
### Theme Development
116+
119117
```bash
120118
# Navigate to custom theme
121-
cd web/themes/custom/[theme_name]
119+
cd web/themes/custom/star_wars
122120

123121
# Install theme dependencies (if using npm/yarn)
124-
npm install
122+
yarn install
125123

126124
# Build theme assets
127-
npm run build
125+
yarn run build
128126

129127
# Watch for changes during development
130-
npm run watch
128+
yarn run watch
131129
```
132130

133131
## Database and Content
134132

135-
### Database Operations
136-
```bash
137-
# Download latest database
138-
ahoy download-db
139-
140-
# Import database from file
141-
ahoy import-db path/to/database.sql
142-
143-
# Create database snapshot
144-
ahoy export-db-file
145-
146-
# Reset to fresh install
147-
ahoy provision --override-db
148-
```
149-
150133
### Content Management
134+
151135
- Use Configuration Management for structure (content types, fields, views)
152136
- Use database imports for content in non-production environments
153137
- Use migration modules for structured content imports in production
154138

155139
## Services Integration
156140

157141
### Solr Search
142+
158143
```bash
159144
# Check Solr status
160145
ahoy drush search-api:status
@@ -167,6 +152,7 @@ ahoy drush search-api:clear
167152
```
168153

169154
### Valkey (Redis-compatible caching)
155+
170156
```bash
171157
# Check cache status
172158
ahoy drush cache:rebuild
@@ -176,6 +162,7 @@ ahoy drush php-eval "\Drupal\redis\Client\ClientInterface::flushAll();"
176162
```
177163

178164
### ClamAV Virus Scanning
165+
179166
```bash
180167
# Test virus scanning functionality
181168
ahoy drush clamav:scan
@@ -184,29 +171,6 @@ ahoy drush clamav:scan
184171
ahoy drush clamav:status
185172
```
186173

187-
## Environment Configuration
188-
189-
### Environment Variables (.env)
190-
Key variables for local development:
191-
```bash
192-
# Project identification
193-
VORTEX_PROJECT=your_project_name
194-
195-
# Database configuration
196-
DRUPAL_DATABASE_NAME=drupal
197-
DRUPAL_DATABASE_USERNAME=drupal
198-
DRUPAL_DATABASE_PASSWORD=drupal
199-
200-
# Development settings
201-
VORTEX_DEV_MODE=1
202-
VORTEX_DEBUG=1
203-
```
204-
205-
### Environment-Specific Settings
206-
- **Development**: Full error reporting, development modules enabled
207-
- **Staging**: Production-like but with debug capabilities
208-
- **Production**: Error logging, caching enabled, development modules disabled
209-
210174
## Deployment
211175

212176
### CI/CD Pipeline
@@ -216,30 +180,26 @@ The project includes automated deployment via:
216180

217181
- **Container Registry** deployments for containerized environments
218182

219-
### Manual Deployment Steps
220-
```bash
221-
# Build deployment artifact
222-
./scripts/vortex/deploy.sh
223-
224-
# Deploy via webhook
225-
./scripts/vortex/deploy-webhook.sh
226-
```
227-
228183
## Common Tasks
229184

230185
### Adding Dependencies
186+
231187
```bash
232188
# Add Drupal modules
233189
ahoy composer require drupal/module_name
234190

235-
# Add development dependencies
191+
# Add development dependencies
236192
ahoy composer require --dev drupal/devel
193+
```
237194

238-
# Add theme build tools
239-
cd web/themes/custom/[theme] && npm install [package]
195+
### Add theme build tools
196+
197+
```bash
198+
cd web/themes/custom/star_wars && npm install [package]
240199
```
241200

242201
### Dependency Management
202+
243203
Dependencies are automatically updated via RenovateBot:
244204
- **Composer dependencies**: Updated automatically with compatibility checks
245205
- **Node.js dependencies**: Updated in theme directories
@@ -251,6 +211,7 @@ ahoy composer outdated
251211
```
252212

253213
### Debugging
214+
254215
```bash
255216
# Enable development modules
256217
ahoy drush pm:install devel webprofiler
@@ -263,6 +224,7 @@ ahoy drush cache:rebuild
263224
```
264225

265226
### Performance
227+
266228
```bash
267229
# Enable caching
268230
ahoy drush config:set system.performance css.preprocess 1
@@ -289,19 +251,6 @@ docker-compose ps
289251
ahoy reset # Rebuild if needed
290252
```
291253

292-
**Permission issues:**
293-
```bash
294-
# Fix file permissions
295-
ahoy fix-permissions
296-
```
297-
298-
**Memory issues:**
299-
```bash
300-
# Increase PHP memory limit in docker-compose.yml
301-
# Or use ahoy with more memory
302-
ahoy drush --memory-limit=512M [command]
303-
```
304-
305254
## Resources
306255

307256
- **Vortex Documentation**: https://vortex.drevops.com
@@ -318,4 +267,4 @@ ahoy drush --memory-limit=512M [command]
318267

319268
---
320269

321-
*This guide covers the essentials for working with your Vortex-powered Drupal project. As your project grows, consider expanding this guide with project-specific workflows and conventions.*
270+
*This guide covers the essentials for working with your Vortex-powered Drupal project. As your project grows, consider expanding this guide with project-specific workflows and conventions.*
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Default

0 commit comments

Comments
 (0)