Skip to content

Commit a11b3f1

Browse files
committed
Merge pull request #120 from brainstormforce/claude-docs-setup
2 parents 67b2757 + 329906f commit a11b3f1

9 files changed

Lines changed: 271 additions & 59 deletions

File tree

.claude/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(npx grunt:*)",
5+
"Bash(npm install)",
6+
"Bash(composer install)",
7+
"Bash(./vendor/bin/phpcs:*)",
8+
"Bash(git status)",
9+
"Bash(git diff:*)",
10+
"Bash(git log:*)",
11+
"Bash(git branch:*)",
12+
"Bash(git checkout:*)",
13+
"Bash(git add:*)",
14+
"Bash(git commit:*)",
15+
"Bash(git push:*)",
16+
"Bash(git remote:*)",
17+
"Bash(ls:*)",
18+
"Bash(find:*)",
19+
"Bash(cat:*)",
20+
"Bash(wc:*)"
21+
],
22+
"deny": [
23+
"Bash(rm -rf:*)",
24+
"Bash(git push --force:*)",
25+
"Bash(git reset --hard:*)"
26+
]
27+
}
28+
}

.distignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ node_modules
3232
package-lock.json
3333
.github
3434
.wordpress-org
35+
36+
.claude
37+
CLAUDE.md
38+
internal-docs

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
.DS_Store
2-
Thumbs.db
3-
wp-cli.local.yml
4-
node_modules/
5-
*.zip
6-
*.tar.gz
1+
.DS_Store
2+
Thumbs.db
3+
wp-cli.local.yml
4+
node_modules/
5+
*.zip
6+
*.tar.gz
7+
8+
.claude/settings.local.json
9+
config.bat

CLAUDE.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Fullwidth Page Templates
2+
3+
## Project Overview
4+
5+
Fullwidth Page Templates is a WordPress plugin by Brainstorm Force. Create full-width landing pages with any theme using page builder templates.
6+
7+
- **Version:** 1.2.0
8+
- **Text Domain:** fullwidth-templates
9+
- **Main File:** fullwidth-page-template.php
10+
- **Requires:** WordPress, PHP 5.6+
11+
12+
## Tech Stack
13+
14+
- **Language:** PHP
15+
- **Platform:** WordPress
16+
- **Build:** Grunt (i18n, readme conversion)
17+
- **Coding Standards:** PHPCS with WordPress standards
18+
19+
## Commands
20+
21+
```bash
22+
# Install dependencies
23+
npm install
24+
composer install
25+
26+
# Build (i18n + readme)
27+
npx grunt
28+
29+
# Generate translations
30+
npx grunt i18n
31+
32+
# Convert readme.txt to README.md
33+
npx grunt readme
34+
35+
# Run PHPCS
36+
./vendor/bin/phpcs .
37+
```
38+
39+
## Architecture
40+
41+
This is a WordPress plugin following standard WordPress patterns:
42+
- Entry point: `fullwidth-page-template.php`
43+
- Constants defined for version, file path, base, dir, and URI
44+
- Classes loaded via `after_setup_theme` or `plugins_loaded` hook
45+
- Follows WordPress Coding Standards (WPCS)
46+
47+
## Conventions
48+
49+
- Use WordPress hooks (`add_action`, `add_filter`) for extensibility
50+
- Prefix all functions and classes to avoid conflicts
51+
- Use `fullwidth-templates` text domain for all translatable strings
52+
- Escape all output (`esc_html`, `esc_attr`, `esc_url`, `wp_kses`)
53+
- Sanitize all input (`sanitize_text_field`, `absint`, etc.)
54+
- Use nonces for form submissions and AJAX requests
55+
- Follow WordPress PHP coding standards

Gruntfile.js

Lines changed: 54 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal-docs/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Fullwidth Page Templates — Internal Documentation
2+
3+
> Auto-generated documentation for developer onboarding and AI agent understanding.
4+
5+
## Quick Facts
6+
7+
| Key | Value |
8+
|-----|-------|
9+
| **Plugin Name** | Fullwidth Page Templates |
10+
| **Version** | 1.2.0 |
11+
| **Text Domain** | fullwidth-templates |
12+
| **Main File** | `fullwidth-page-template.php` |
13+
| **PHP Files** | 13 |
14+
| **Build Tool** | Grunt |
15+
| **Stack** | WordPress Plugin (PHP) |
16+
17+
## Description
18+
19+
Create full-width landing pages with any theme using page builder templates.
20+
21+
## Index
22+
23+
- [Architecture](architecture.md) — High-level architecture and data flow
24+
- [Codebase Map](codebase-map.md) — Directory structure and key files
25+
- [AI Agent Guide](ai-agent-guide.md) — Key patterns and locations for AI-assisted development

internal-docs/ai-agent-guide.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AI Agent Guide — Fullwidth Page Templates
2+
3+
## Quick Start for AI Agents
4+
5+
1. **Entry point:** Start at `fullwidth-page-template.php` to understand plugin initialization
6+
2. **Constants:** Look for `define()` calls in the main file for paths and versions
7+
3. **Hook registration:** Search for `add_action` and `add_filter` to find where functionality is attached
8+
4. **Text domain:** Use `fullwidth-templates` for all translatable strings
9+
10+
## Common Tasks
11+
12+
### Adding a new feature
13+
1. Create a new class file in the appropriate directory
14+
2. Register it via `require_once` in the loader or main class
15+
3. Use `add_action`/`add_filter` to hook into WordPress
16+
4. Follow existing class patterns for consistency
17+
18+
### Modifying existing behavior
19+
1. Find the relevant class by searching for the hook or function name
20+
2. Check for filters that allow modification without editing core files
21+
3. If editing, maintain the existing code style and patterns
22+
23+
### Adding translatable strings
24+
1. Wrap strings in `__( 'text', 'fullwidth-templates' )` or `esc_html__( 'text', 'fullwidth-templates' )`
25+
2. Run `npx grunt i18n` to update the POT file
26+
27+
## WordPress Checklist
28+
29+
- [ ] All output is escaped (`esc_html`, `esc_attr`, `esc_url`, `wp_kses`)
30+
- [ ] All input is sanitized (`sanitize_text_field`, `absint`, etc.)
31+
- [ ] Nonces used for forms and AJAX (`wp_nonce_field`, `check_ajax_referer`)
32+
- [ ] Capability checks before privileged operations (`current_user_can`)
33+
- [ ] Text domain `fullwidth-templates` used for all user-facing strings
34+
- [ ] No direct file access (files start with `defined( 'ABSPATH' )` check or silence)
35+
36+
## Pitfalls
37+
38+
- Plugin may depend on Astra theme being active — check for theme dependency logic
39+
- Constants are defined only once — don't redefine them
40+
- Follow WordPress coding standards (spaces not tabs for alignment, tabs for indentation)

internal-docs/architecture.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Architecture — Fullwidth Page Templates
2+
3+
## Overview
4+
5+
Fullwidth Page Templates is a WordPress plugin that follows standard WordPress plugin architecture patterns.
6+
7+
## Entry Point
8+
9+
The plugin entry point is `fullwidth-page-template.php`, which:
10+
1. Defines plugin constants (version, file path, base name, directory, URI)
11+
2. Loads the main plugin class via a WordPress hook (`after_setup_theme` or `plugins_loaded`)
12+
13+
## Request Lifecycle
14+
15+
1. WordPress loads the plugin via `fullwidth-page-template.php`
16+
2. Constants are defined for use throughout the plugin
17+
3. Main class is instantiated/loaded on the appropriate hook
18+
4. Classes register their own hooks and filters
19+
5. Frontend/admin output is rendered when WordPress fires the relevant hooks
20+
21+
## Key Patterns
22+
23+
- **Hook-based architecture:** All functionality is attached via `add_action()` and `add_filter()`
24+
- **Class autoloading:** Classes are loaded via `require_once` in the main plugin file or loader class
25+
- **Separation of concerns:** Admin and frontend code are separated into different classes/directories
26+
- **WordPress Customizer integration:** Settings are registered via the Customizer API where applicable
27+
28+
## Dependencies
29+
30+
- WordPress core (required)
31+
- Astra theme (recommended/required for full functionality)
32+
- No external PHP dependencies beyond WordPress

internal-docs/codebase-map.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Codebase Map — Fullwidth Page Templates
2+
3+
## Directory Structure
4+
5+
```
6+
fullwidth-templates/
7+
├── fullwidth-page-template.php # Plugin entry point
8+
├── admin/bsf-analytics/class-bsf-analytics-loader.php
9+
├── admin/bsf-analytics/class-bsf-analytics-stats.php
10+
├── admin/bsf-analytics/class-bsf-analytics.php
11+
├── admin/notices/class-astra-notices.php
12+
├── class-fullwidth-page-templates.php
13+
├── fullwidth-page-template.php
14+
├── templates/default/template-helpers.php
15+
├── templates/default/template-page-builder-no-header-footer.php
16+
├── templates/default/template-page-builder-no-sidebar.php
17+
├── templates/default/template-page-builder.php
18+
├── .distignore # WordPress.org distribution exclusions
19+
├── .gitignore # Git exclusions
20+
├── Gruntfile.js # Grunt build configuration
21+
├── package.json # Node.js dependencies
22+
├── CLAUDE.md # Claude Code project context
23+
└── .claude/settings.json # Claude Code tool permissions
24+
```

0 commit comments

Comments
 (0)