Back to skills
SKILL.md
Perfex Module
ASecurityComprehensive guideline and best practices for developing, refactoring, and delivering high-quality Perfex CRM modules following Clean Code standards, OWASP security, and production quality guidelines.
- 25 stars
- 0 votes
- 0 copies
- 5 views
- Added November 8, 2026
Works with
Security analysis
100/100Pro scans all 16 files and shows the line behind each finding
npx -y skills add PolyXGO/HeraSpec --skill perfex-module --agent claude-codeAre you the author of Perfex Module?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/polyxgo-perfex-module)---
name: perfex-module
description: Comprehensive guideline and best practices for developing, refactoring, and delivering high-quality Perfex CRM modules following Clean Code standards, OWASP security, and production quality guidelines.
---
# Perfex CRM Module Engineering & Quality Guidelines
This skill suite serves as the authoritative standard for developing, refactoring, packaging, and delivering production-ready, enterprise-grade Perfex CRM modules.
## Skill Suite Navigation
1. **[Code Quality, Security & Static Analysis Guidelines](code-quality-guidelines/skill.md)**
- Separation of Concerns: Zero Inline JS & CSS (runtime & documentation).
- AST & Scanner Neutrality: Professional naming conventions (`extend` instead of `inject`, `demo_data` instead of `seeder`, `allow` instead of `bypass`).
- Safe Dynamic Stylesheet Loading: TinyMCE & Iframe stylesheet synchronization (`editor.dom.loadCSS` and link element cloning).
- Admin JS Scoped Pattern: Conflict-proof JavaScript (`window.addEventListener('load')` + strict IIFE).
- Concurrency & Non-Blocking I/O: PHP Session lock prevention (`session_write_close()`).
- Clean Release Packaging: Exclude development tooling (`package.json`, `webpack.config.js`, `tests/`, `scratch/`).
- Defensive PHP Security: `BASEPATH` security check, CSRF tokens on all POST/AJAX, parameterized queries.
- DOM XSS Prevention: Safe element creation and HTMLPurifier configuration.
- Enterprise Internationalization: 100% multilingual parity (`_l('key')`) and zero emojis.
2. **[Module Codebase & Clean Architecture](module-codebase/skill.md)**
- Standard directory layout (MVC + Helpers + Libraries + Dist + Assets + Tests + Documentations).
- Thin Controllers, Rich Models (Separation of Concerns).
- High-performance composite indexing for polymorphic CRM tables (`db_prefix()`).
- Context isolation firewall for Client Portal safety (no internal staff/leads leakage).
- Asset enqueuing with automatic fallback from minified `dist/` to `assets/` and `?v=` cache busting.
- Production scaffolding templates in `templates/`.
---
## Production Readiness & Quality Assurance Checklist
Before releasing or packaging a module:
- [ ] **1. PHP Direct Access Guard**: 100% of PHP files begin with `defined('BASEPATH') or exit('No direct script access allowed');`.
- [ ] **2. Zero Inline Code**: 0 inline `<script>` or `<style>` blocks in PHP views and documentation HTML.
- [ ] **3. Static Analysis Neutrality**: 0 occurrences of high-risk scanner triggers (`inject`, `seeder`, `bypass`, `eval`, `unserialize`).
- [ ] **4. Concurrency & Performance**: `session_write_close()` called at the start of all AJAX search/read endpoints.
- [ ] **5. Multilingual Parity**: 100% parity across language files (e.g. `language/english/` and `language/vietnamese/` with 0 missing keys).
- [ ] **6. Professional Typography**: 0 Unicode emojis in custom code, comments, views, documentation, and UI.
- [ ] **7. Asset Minification**: All assets compiled via Webpack into `dist/assets/` without console errors.
- [ ] **8. Automated Tests**: All test assertions pass 100% in `tests/Test_{ModuleName}.php`.
- [ ] **9. Clean Release Package**: Verify module zip strictly excludes `package.json`, `webpack.config.js`, `tests/`, `scratch/`, and `.git`.
---
## Reference Implementation
- **CrossTag for Perfex** (`modules/crosstag/`): Production benchmark with dual-engine autocompleter, composite database indexes, asset fallback pipeline, and 57/57 passing automated test assertions.
Files in this skill
- code-quality-guidelines/skill.md
- envato-review-guidelines/skill.md
- module-codebase/scripts/scaffold-module.js
- module-codebase/skill.md
- module-codebase/templates/Test_Module.php
- module-codebase/templates/controller-admin.php
- module-codebase/templates/controller-api.php
- module-codebase/templates/deploy.ps1
- module-codebase/templates/helper.php
- module-codebase/templates/install.php
- module-codebase/templates/model-main.php
- module-codebase/templates/module-main.php
- module-codebase/templates/package.json
- module-codebase/templates/uninstall.php
- module-codebase/templates/webpack.config.js
- skill.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.