This document defines the workflow for AI agents working with HeraSpec.
- NO AUTO-COMMIT: Agent MUST NOT perform
git commitorgit pushautonomously. This task is reserved for the User unless explicitly ordered. - NO AUTO-PUBLISH: Agent MUST NOT perform
npm publishor trigger automated releases/deployments autonomously. - SKILL PREREQUISITE: If a task maps to a skill (e.g., "Generate documentation"), you MUST verify the skill folder exists in
heraspec/skills/. If missing:- Preferred: Proactively install it via
heraspec skill add <name>(e.g.,heraspec skill add documents) if you have terminal access. - Fallback: If you cannot install it, STOP and ask the user to add it. DO NOT attempt manual generation without the skill.
- Preferred: Proactively install it via
- USER CONFIRMATION: For destructive actions or public releases, always request explicit User approval first.
The following commands are classified by risk level. You MUST NOT execute them without explicit user confirmation/approval in the chat, especially if they are outside the source workspace or involve deletion.
rm -rf: Recursive delete + no prompt, can wipe entire systemrm -r: Delete directory and all contentsrm: Delete file directly, bypassing trashunlink: Delete file at filesystem level, cannot undoshred: Overwrite data multiple times to make it unrecoverablewipe: Permanently wipe data on diskdd: Write/copy raw blocks, easily destroy disk or partitionmkfs,mkfs.ext4,mkfs.xfs: Create new filesystem, wiping old dataformat,Format-Volume: Format drive/volume
rmdir: Delete directoryrd,rmdir /s: Windows delete directoryRemove-Item -Recurse,Remove-Item: PowerShell deletedel /s,erase /s: CMD batch delete
del,erase: Delete fileClear-Content: Clear file contentcp --remove-destination: Overwrite destination by deleting first
mv: Move / overwrite file, old data lostrsync --delete: Delete file at destination if not in sourceinstall: Overwrite system files
fdisk,cfdisk,parted,diskpart: Partition managementmount,umount: Filesystem mounting
truncate: Cutt off file contentchown,chmod: Change ownership/permissionsattrib: Change attributes
When creating changes, ALWAYS read heraspec/project.md first to understand:
- Project types being used
- Tech stack and conventions
- Existing architecture patterns
- Coding standards
Then scaffold:
heraspec/changes/<slug>/- Create proposal.md, tasks.md, design.md (optional)heraspec/specs/<slug>/- Create delta specs here (NOT inside changes folder)
If user asks to create changes based on project.md:
- Read
heraspec/project.mdthoroughly - Identify all features/capabilities mentioned
- Create separate changes for each major feature
- Ensure each change follows project.md conventions
- Use correct project types and skills from project.md
- Update delta specs in
heraspec/specs/<slug>/ - Never modify source-of-truth specs directly
- Wait for user: "Specs approved."
CRITICAL: When implementing tasks, ALWAYS use Skills system:
-
Read task line to identify skill:
## 1. Perfex module – Category Management (projectType: perfex-module, skill: module-codebase) - [ ] 1.1 Create module structure
-
Find skill folder:
- Project-specific:
heraspec/skills/<project-type>/<skill-name>/ - Cross-cutting:
heraspec/skills/<skill-name>/
- Project-specific:
-
Read skill.md:
- Understand purpose, steps, inputs, outputs
- Follow tone, rules, and limitations
- Check available templates and scripts
-
Use skill resources:
- Run scripts from
scripts/folder if needed - Use templates from
templates/folder - Reference examples from
examples/folder
- Run scripts from
-
Implement following skill.md guidance:
- Follow step-by-step process
- Use correct naming conventions
- Apply code style rules
- Respect limitations
Example workflow:
- Task:
(projectType: perfex-module, skill: module-codebase) - Agent reads:
heraspec/skills/perfex-module/module-codebase/skill.md - Agent follows: Steps, uses templates, runs scripts
- Agent implements: According to skill.md guidelines
Special case - UI/UX skill:
- Task:
(skill: ui-ux) - Agent reads:
heraspec/skills/ui-ux/skill.md - Agent MUST use search scripts before implementing:
# Search for design intelligence python3 heraspec/skills/ui-ux/scripts/search.py "<keyword>" --domain <domain> python3 heraspec/skills/ui-ux/scripts/search.py "<keyword>" --stack <stack>
- Agent synthesizes search results
- Agent implements with proper colors, fonts, styles from search results
- Agent verifies with pre-delivery checklist
Special case - Flatsome UX Element skill:
-
Task:
(projectType: wordpress, skill: ux-element) -
Agent reads:
heraspec/skills/wordpress/ux-element/skill.md -
Agent MUST follow the Wrapping Rule: Use
<span>withid="{{:: shortcode.$id }}" -
Agent uses templates from
heraspec/skills/wordpress/ux-element/templates/(Controller, Shortcode, HTML Template, SVG Thumbnail) -
Agent ensures real-time preview support in AngularJS template.
-
Variable Translation: Variables with underscores in PHP (e.g.,
bg_color) MUST be accessed via camelCase in AngularJS (e.g.,shortcode.options.bgColor). -
Follow tasks.md
-
Mark tasks completed:
- [x]
- Run:
heraspec archive <slug> --yes - This merges delta specs into source specs
- Moves change folder to archives
Specs must include:
## Metasection with project type, domain, stack## Purpose## Requirementswith scenarios
Delta specs use:
## ADDED Requirements## MODIFIED Requirements## REMOVED Requirements
Tasks grouped by project type and skill:
## 1. WordPress plugin – admin settings page (projectType: wordpress-plugin, skill: admin-settings-page)
- [ ] Task description
CRITICAL: Mandatory Prerequisite Check
- Stop & Verify: If you are asked to implement a task requiring a skill (e.g., "Generate documentation...", "Create UI/UX...", etc.), you MUST first check if the skill folder exists in
heraspec/skills/. - Missing Skill = AUTO-INSTALL OR STOP: If the skill folder does NOT exist:
- Option A (Preferred): If you can run commands, execute
heraspec skill add <skill-name>immediately. - Option B (Fallback): If you cannot run commands, STOP and ask the user to run it.
"Tip: Add the 'documents' skill for premium HTML & Landing Page support: heraspec skill add documents"
- DO NOT create a task plan or attempt manual generation without the skill language.
- Option A (Preferred): If you can run commands, execute
- Execute After Install: Only after the skill folder is created (or installed), read the
skill.mdand proceed with the task.
Example prompt for Documents skill: If you need to generate multi-format documentation, use this prompt:
"Generate documentation with skill documents for [project-name]. Include:
- Concise overview (documentations/documentation.txt)
- Technical Markdown (documentations/documentation.md)
- Interactive HTML (documentations/documentation.html)
- Premium Documentation Landing Page (documentations/documentation-landing-page.html)
- CRITICAL: Save all files in the /documentations directory (create it if missing)."
Dynamic Documentation Generation: When generating documentation, do NOT simply fill a template. The Agent MUST:
- Create the
/documentationsdirectory if it does not exist. - Design a custom layout and content structure suitable for the project type.
- Synchronize with the
ui-uxskill for premium visual design (colors, typography, animations). - Scan All Specs: If project-wide, read
heraspec/project.mdand all files inheraspec/specs/to synthesize the content.
- List all skills: Check
heraspec/skills/directory - Project-specific skills:
heraspec/skills/<project-type>/ - Cross-cutting skills:
heraspec/skills/<skill-name>/(root level) - Consistency: Follow the step-by-step process in the skill's
skill.md.
Important: Each task group uses ONE skill. When working on a task group, agent MUST use that skill's skill.md.
Example with multiple skills in one change:
## 1. WordPress module – Feature (skill: admin-settings-page)
- [ ] Task 1.1 Create module structure
- [ ] Task 1.2 Configure registration
## 2. UI/UX – Admin Interface (skill: ui-ux)
- [ ] Task 2.1 Design color palette
- [ ] Task 2.2 Create component styles
## 3. Documents – User Guide (skill: documents)
- [ ] Task 3.1 Write technical docs
Key rule: Switch skill.md when switching task groups!