Skip to content

Commit 95b22c8

Browse files
committed
Add Kiro steering documents
1 parent 091f0b4 commit 95b22c8

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
!.envrc
44
!.github
55
!.gitignore
6+
!.kiro
67

78
/vendor/
89
/vendor_prefixed/

.kiro/steering/product.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Static Deploy Plugin Overview
2+
3+
Static Deploy is a WordPress plugin that generates static websites from WordPress sites and handles deployment to various hosting platforms.
4+
5+
## Core Functionality
6+
- **Static Site Generation**: Crawls WordPress sites and converts dynamic content to static HTML/CSS/JS files
7+
- **URL Detection**: Automatically discovers pages, posts, categories, authors, archives, and assets
8+
- **File Processing**: Processes and optimizes static files for deployment
9+
- **Deployment**: Supports multiple deployment targets and methods
10+
- **WordPress Integration**: Provides admin interface and WP-CLI commands
11+
12+
## Key Features
13+
- Multi-threaded crawling with configurable concurrency
14+
- Comprehensive URL discovery (posts, pages, categories, authors, pagination, sitemaps)
15+
- Asset detection (themes, plugins, WordPress core files)
16+
- Post-processing and URL rewriting for static hosting
17+
- Caching system for efficient re-crawls
18+
- Job queue system for background processing
19+
- Extensive logging and diagnostics
20+
21+
## Target Users
22+
WordPress site owners who want to convert their dynamic sites to static for improved security, performance, and hosting flexibility.

.kiro/steering/structure.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Project Structure & Organization
2+
3+
## Root Directory Layout
4+
```
5+
static-deploy/
6+
├── src/ # Main plugin source code (PSR-4: StaticDeploy\)
7+
├── views/ # WordPress admin interface templates
8+
├── tests/ # Test suites (unit, integration, phpstan)
9+
├── dev/ # Development environment (Nix-based)
10+
├── vendor/ # Composer dependencies
11+
├── bin/ # Executable scripts
12+
├── static-deploy.php # Main plugin file
13+
└── composer.json # Dependencies and scripts
14+
```
15+
16+
## Source Code Organization (`src/`)
17+
18+
### Core Components
19+
- **Controller.php**: Main plugin controller (singleton pattern)
20+
- **CLI.php**: WP-CLI command interface
21+
- **WordPressAdmin.php**: WordPress admin integration
22+
23+
### URL Detection & Processing
24+
- **URLDetector.php**: Main URL discovery orchestrator
25+
- **Detect*.php**: Specialized URL detectors (Pages, Posts, Categories, etc.)
26+
- **URLHelper.php**, **URLParser.php**: URL manipulation utilities
27+
- **SitemapParser.php**: XML sitemap processing
28+
29+
### Crawling & File Processing
30+
- **Crawler.php**: Multi-threaded site crawling engine
31+
- **FileProcessor.php**: Static file processing and optimization
32+
- **PostProcessor.php**: Content post-processing and URL rewriting
33+
- **SimpleRewriter.php**: URL rewriting for static hosting
34+
35+
### Data Management
36+
- **DetectedFiles.php**, **CrawledFiles.php**: File tracking
37+
- **DeployCache.php**: Deployment caching system
38+
- **JobQueue.php**: Background job management
39+
- **CoreOptions.php**: Plugin configuration management
40+
41+
### Utilities
42+
- **Utils.php**: General utility functions
43+
- **FilesHelper.php**: File system operations
44+
- **WsLog.php**: Logging system
45+
- **SiteInfo.php**: WordPress site information
46+
47+
## Views Directory (`views/`)
48+
WordPress admin interface templates:
49+
- **options-page.php**: Main settings interface
50+
- **run-page.php**: Crawling execution interface
51+
- **logs-page.php**: Log viewing interface
52+
- ***-page.php**: Various admin pages for different features
53+
54+
## Testing Structure (`tests/`)
55+
```
56+
tests/
57+
├── unit/ # Unit tests (PHPUnit)
58+
├── integration/ # End-to-end tests
59+
├── phpstan/ # PHPStan configuration
60+
└── bootstrap.php # Test bootstrap
61+
```
62+
63+
## Development Environment (`dev/`)
64+
- **flake.nix**: Nix development environment
65+
- **data/**: Development data (MySQL, WordPress, Nginx configs)
66+
67+
## Naming Conventions
68+
- **Classes**: PascalCase (e.g., `URLDetector`, `FileProcessor`)
69+
- **Files**: Match class names (e.g., `URLDetector.php`)
70+
- **Methods**: camelCase with descriptive names
71+
- **Constants**: UPPER_SNAKE_CASE (e.g., `STATIC_DEPLOY_VERSION`)
72+
- **Namespaces**: PSR-4 compliant (`StaticDeploy\`)

.kiro/steering/tech.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
inclusion: always
3+
---
4+
5+
# Technology Stack & Development Guidelines
6+
7+
## Required Code Standards
8+
- **PHP 8.1+** with `declare(strict_types=1)` in ALL files
9+
- **Namespace**: Use `StaticDeploy\` for all classes
10+
- **PHPStan Level Max**: Code must pass strict static analysis
11+
- **WordPress Coding Standards**: Follow PHPCS rules with zero violations
12+
13+
## Mandatory Dependencies
14+
- **guzzlehttp/guzzle**: Use for ALL HTTP requests (not native cURL/file_get_contents) and URL manipulation (not parse_url/http_build_query)
15+
- **masterminds/html5**: Use for HTML parsing (not DOMDocument)
16+
- **symfony/finder**: Use for file operations (not glob/scandir/DirectoryIterator)
17+
18+
## Critical Architecture Rules
19+
- **Controller Pattern**: Use singleton `Controller.php` for plugin lifecycle
20+
- **Exception Handling**: Throw `StaticDeployException` for all plugin errors
21+
- **Logging**: Use `WsLog::l()` with appropriate levels (never error_log/var_dump)
22+
- **Options**: Use `Options.php` class (never direct get_option/update_option)
23+
- **Input Sanitization**: Use WordPress sanitization functions for ALL user input
24+
25+
## File & Class Conventions
26+
- **Class Files**: PascalCase matching class name (e.g., `URLDetector.php`)
27+
- **Method Names**: camelCase with descriptive verbs (e.g., `detectPageURLs()`)
28+
- **Constants**: `STATIC_DEPLOY_` prefix with UPPER_SNAKE_CASE
29+
- **Traits**: Use for shared functionality (e.g., `DeployerTrait`, `OptionsControllerTrait`)
30+
31+
## Performance Requirements
32+
- **Memory**: Process large datasets in chunks to avoid memory limits
33+
- **Concurrency**: Use configurable threading for crawling operations
34+
- **Caching**: Use `DeployCache.php` for expensive operations
35+
- **Database**: Use WordPress WPDB abstraction (never raw SQL)
36+
37+
## Quality Assurance Commands
38+
```bash
39+
composer phpcs # Code style check (must pass)
40+
composer phpstan # Static analysis (must pass)
41+
composer test # Full test suite (must pass)
42+
```
43+
44+
## WordPress Integration Rules
45+
- Use WordPress hooks/filters for lifecycle events
46+
- Sanitize ALL user input with WordPress functions
47+
- Use WordPress database abstraction layer
48+
- Follow WordPress plugin architecture patterns
49+
- Store configuration via `Options.php` class

0 commit comments

Comments
 (0)