feat: initial commit for Paralax creative engineering system
This commit is contained in:
92
.agents/rules/code-rules.md
Normal file
92
.agents/rules/code-rules.md
Normal file
@@ -0,0 +1,92 @@
|
||||
---
|
||||
name: code-rules
|
||||
version: 1.0.0
|
||||
priority: P0
|
||||
trigger: model_decision
|
||||
description: Apply when writing, building, refactoring, or fixing code — project-type agent routing, the Socratic Gate, Plan Mode phases, and the final checklist/scripts. Skip for pure questions or text-only responses.
|
||||
---
|
||||
|
||||
# Code Rules (TIER 1) - AG Kit
|
||||
|
||||
> Loaded when the request involves writing or modifying code.
|
||||
|
||||
---
|
||||
|
||||
## 📱 Project Type Routing
|
||||
|
||||
| Project Type | Primary Agent | Skills |
|
||||
| -------------------------------------- | --------------------- | ----------------------------- |
|
||||
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
||||
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
||||
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
||||
|
||||
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
||||
|
||||
---
|
||||
|
||||
## 🛑 GLOBAL SOCRATIC GATE
|
||||
|
||||
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
||||
|
||||
| Request Type | Strategy | Required Action |
|
||||
| ----------------------- | -------------- | ----------------------------------------------------------------- |
|
||||
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
||||
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
||||
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
||||
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
||||
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
||||
|
||||
**Protocol:**
|
||||
|
||||
1. **Never Assume:** If even 1% is unclear, ASK.
|
||||
2. **Handle Spec-heavy Requests:** When user gives a list (Answers 1, 2, 3...), do NOT skip the gate. Instead, ask about **Trade-offs** or **Edge Cases** (e.g., "LocalStorage confirmed, but should we handle data clearing or versioning?") before starting.
|
||||
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
||||
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
||||
|
||||
---
|
||||
|
||||
## 🏁 Plan Mode (4-Phase)
|
||||
|
||||
1. ANALYSIS → Research, questions
|
||||
2. PLANNING → `{task-slug}.md`, task breakdown
|
||||
3. SOLUTIONING → Architecture, design (NO CODE!)
|
||||
4. IMPLEMENTATION → Code + tests
|
||||
|
||||
---
|
||||
|
||||
## 🏁 Final Checklist Protocol
|
||||
|
||||
**Trigger:** When the user says "run the final checks", "final checks", "run all the tests", or similar phrases.
|
||||
|
||||
| Task Stage | Command | Purpose |
|
||||
| ---------------- | -------------------------------------------------- | ------------------------------ |
|
||||
| **Manual Audit** | `python .agents/scripts/checklist.py .` | Priority-based project audit |
|
||||
| **Pre-Deploy** | `python .agents/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
||||
|
||||
**Priority Execution Order:**
|
||||
|
||||
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
||||
|
||||
**Rules:**
|
||||
|
||||
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
||||
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
||||
|
||||
**Available Scripts (10 total):**
|
||||
|
||||
| Script | Skill | When to Use |
|
||||
| -------------------------- | --------------------- | ------------------- |
|
||||
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
||||
| `lint_runner.py` | lint-and-validate | Every code change |
|
||||
| `test_runner.py` | testing-patterns | After logic change |
|
||||
| `schema_validator.py` | database-design | After DB change |
|
||||
| `ux_audit.py` | frontend-design | After UI change |
|
||||
| `accessibility_checker.py` | frontend-design | After UI change |
|
||||
| `seo_checker.py` | seo-fundamentals | After page change |
|
||||
| `mobile_audit.py` | mobile-design | After mobile change |
|
||||
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
||||
| `playwright_runner.py` | webapp-testing | Before deploy |
|
||||
|
||||
> 🔴 **Agents & Skills can invoke ANY script** via `python .agents/skills/<skill>/scripts/<script>.py`
|
||||
|
||||
---
|
||||
83
.agents/rules/core-protocol.md
Normal file
83
.agents/rules/core-protocol.md
Normal file
@@ -0,0 +1,83 @@
|
||||
---
|
||||
name: core-protocol
|
||||
version: 1.0.0
|
||||
priority: P0
|
||||
trigger: always_on
|
||||
---
|
||||
|
||||
# Core Protocol - AG Kit
|
||||
|
||||
> The highest-priority workspace rules. How the AI loads agents/skills and what it must do before any implementation.
|
||||
|
||||
---
|
||||
|
||||
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
||||
|
||||
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
||||
|
||||
### 1. Modular Skill Loading Protocol
|
||||
|
||||
Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
|
||||
|
||||
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
||||
- **Rule Priority:** P0 (Workspace Rules in `.agents/rules/`) > P1 (Agent `.md`) > P2 (SKILL.md). All rules are binding.
|
||||
|
||||
### 1.1 Skill Announcement (MANDATORY)
|
||||
|
||||
**Every time you load and apply a skill, announce it BEFORE using it** — so the user can verify which knowledge is active.
|
||||
|
||||
```markdown
|
||||
📚 **Using skill: `@[skill-name]`...**
|
||||
```
|
||||
|
||||
- List multiple skills together: `📚 Using skills: @frontend-design + @design-spec...`
|
||||
- Announce on-demand skills too (e.g. a companion skill pulled from a hub, or `app-builder` for a new app), not just frontmatter ones.
|
||||
- ❌ Applying a skill without announcing it = **USER CANNOT VERIFY THE SKILL WAS USED**.
|
||||
|
||||
### 2. Enforcement Protocol
|
||||
|
||||
1. **When agent is activated:**
|
||||
- ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
|
||||
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
|
||||
|
||||
---
|
||||
|
||||
## 📁 File Dependency Awareness
|
||||
|
||||
**Before modifying ANY file:**
|
||||
|
||||
1. If `CODEBASE.md` exists, check its File Dependencies section.
|
||||
2. Otherwise, discover dependencies with targeted search/import analysis; do not block waiting for a missing file.
|
||||
3. Identify dependent files and update all affected files together.
|
||||
|
||||
---
|
||||
|
||||
## 🗺️ System Map & Memory Read
|
||||
|
||||
> 🔴 **MANDATORY:** At session start, you MUST read `.agents/memory/MEMORY.md` to load persistent project conventions, user preferences, and decisions.
|
||||
|
||||
> 📚 **Catalog lookup (on-demand, NOT every session):** Need the full list of Agents / Skills / Scripts? The `quick-reference` rule has the essentials. For the complete catalog, read `.agents/ARCHITECTURE.md` only when you actually need it (e.g. orchestration, or discovering a skill you're unsure exists) — do NOT load it on every request.
|
||||
|
||||
**Path Awareness (Note: the project directory name is `.agents` plural):**
|
||||
|
||||
- Agents: `.agents/agent/` (Project)
|
||||
- Skills: `.agents/skills/` (Project)
|
||||
- Memory: `.agents/memory/` (Project)
|
||||
- Runtime Scripts: `.agents/skills/<skill>/scripts/`
|
||||
|
||||
---
|
||||
|
||||
## 🧠 Read → Understand → Apply
|
||||
|
||||
```
|
||||
❌ WRONG: Read agent file → Start coding
|
||||
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
||||
```
|
||||
|
||||
**Before coding, answer:**
|
||||
|
||||
1. What is the GOAL of this agent/skill?
|
||||
2. What PRINCIPLES must I apply?
|
||||
3. How does this DIFFER from generic output?
|
||||
|
||||
---
|
||||
44
.agents/rules/design-rules.md
Normal file
44
.agents/rules/design-rules.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: design-rules
|
||||
version: 1.0.0
|
||||
priority: P0
|
||||
trigger: glob
|
||||
globs: "**/*.{tsx,jsx,vue,svelte,css,scss},**/components/**,**/app/**/page.tsx"
|
||||
---
|
||||
|
||||
# Design Rules (TIER 2) - AG Kit
|
||||
|
||||
> Loaded when touching UI files. Design rules live in the specialist agents, NOT here.
|
||||
|
||||
## 🛑 GATE: DESIGN.md before any UI code (MANDATORY)
|
||||
|
||||
Before writing or editing UI (components, pages, styles — web or mobile), a **`DESIGN.md` must exist at the project root**.
|
||||
|
||||
1. **Check** for `DESIGN.md` at the project root.
|
||||
2. **If missing:** infer the design direction from the brief, then **create `DESIGN.md` first** (tokens + rationale) following the `design-spec` skill. Do not write UI code until it exists.
|
||||
3. **If present:** READ it and build strictly against its tokens. Descriptive names in prose map to token names.
|
||||
4. **Keep it in sync** when the visual language changes — it is the single source of truth.
|
||||
|
||||
> Exception: none for new UI. A genuinely trivial tweak to existing UI (one button color, a spacing nudge) may proceed if a `DESIGN.md` already governs the project. Net-new UI always requires the gate.
|
||||
|
||||
| Need | Read |
|
||||
| ---- | ---- |
|
||||
| DESIGN.md format / tokens | `.agents/skills/design-spec/SKILL.md` |
|
||||
|
||||
---
|
||||
|
||||
| Task | Read |
|
||||
| ------------ | ------------------------------- |
|
||||
| Web UI/UX | `.agents/agent/frontend-specialist.md` |
|
||||
| Mobile UI/UX | `.agents/agent/mobile-developer.md` |
|
||||
|
||||
**These agents contain:**
|
||||
|
||||
- Purple Ban (no purple by default — brand/brief override allowed)
|
||||
- Template Ban (no standard layouts)
|
||||
- Anti-cliché rules
|
||||
- Deep Design Thinking protocol
|
||||
|
||||
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
||||
|
||||
---
|
||||
25
.agents/rules/quick-reference.md
Normal file
25
.agents/rules/quick-reference.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: quick-reference
|
||||
version: 1.0.0
|
||||
priority: P2
|
||||
trigger: model_decision
|
||||
description: Apply when you need a fast lookup of which agents, skills, or validation scripts exist — for routing decisions or recalling the master/key components of the kit.
|
||||
---
|
||||
|
||||
# Quick Reference - AG Kit
|
||||
|
||||
> A fast index of the most-used agents, skills, and scripts.
|
||||
|
||||
## Agents & Skills
|
||||
|
||||
- **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
|
||||
- **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
|
||||
|
||||
## Key Scripts
|
||||
|
||||
- **Verify**: `.agents/scripts/verify_all.py`, `.agents/scripts/checklist.py`
|
||||
- **Scanners**: `security_scan.py`
|
||||
- **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
|
||||
- **Test**: `playwright_runner.py`, `test_runner.py`
|
||||
|
||||
---
|
||||
94
.agents/rules/request-routing.md
Normal file
94
.agents/rules/request-routing.md
Normal file
@@ -0,0 +1,94 @@
|
||||
---
|
||||
name: request-routing
|
||||
version: 1.0.0
|
||||
priority: P0
|
||||
trigger: always_on
|
||||
---
|
||||
|
||||
# Request Routing - AG Kit
|
||||
|
||||
> Always-active. Classify every request, then auto-route to the best specialist agent(s) before responding.
|
||||
|
||||
---
|
||||
|
||||
## 📥 REQUEST CLASSIFIER (STEP 1)
|
||||
|
||||
**Before ANY action, classify the request:**
|
||||
|
||||
| Request Type | Trigger Keywords | Active Tiers | Result |
|
||||
| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
|
||||
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
||||
| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
||||
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
||||
| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
||||
| **NEW APP** | "new app", "from scratch", "build me a/an", multi-page | `project-planner` (loads `app-builder`) → `orchestrator` | **{task-slug}.md + app-builder** |
|
||||
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
||||
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
||||
|
||||
> 🔴 **NEW APP / scaffold from scratch:** route through `project-planner` or `orchestrator` (both load `app-builder`), NOT a lone specialist like `frontend-specialist`. A specialist alone has no project-detection, tech-stack selection, or template knowledge — `app-builder` does. Or run `/create`.
|
||||
|
||||
---
|
||||
|
||||
## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
|
||||
|
||||
**ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
|
||||
|
||||
> 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
|
||||
|
||||
### Auto-Selection Protocol
|
||||
|
||||
1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
|
||||
2. **Select Agent(s)**: Choose the most appropriate specialist(s).
|
||||
3. **Inform User**: Concisely state which expertise is being applied.
|
||||
4. **Apply**: Generate response using the selected agent's persona and rules.
|
||||
|
||||
### Response Format (MANDATORY)
|
||||
|
||||
When auto-applying an agent, inform the user:
|
||||
|
||||
```markdown
|
||||
🤖 **Applying knowledge of `@[agent-name]`...**
|
||||
|
||||
[Continue with specialized response]
|
||||
```
|
||||
|
||||
**Rules:**
|
||||
|
||||
1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
|
||||
2. **Respect Overrides**: If user mentions `@agent`, use it.
|
||||
3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
|
||||
|
||||
### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
|
||||
|
||||
**Before ANY code or design work, you MUST complete this mental checklist:**
|
||||
|
||||
| Step | Check | If Unchecked |
|
||||
|------|-------|--------------|
|
||||
| 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
|
||||
| 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agents/agent/{agent}.md` |
|
||||
| 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
|
||||
| 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
|
||||
|
||||
**Failure Conditions:**
|
||||
|
||||
- ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**
|
||||
- ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
|
||||
- ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
|
||||
|
||||
> 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
|
||||
> "Have I completed the Agent Routing Checklist?" If NO → Complete it first.
|
||||
|
||||
---
|
||||
|
||||
## 🎭 Gemini Mode Mapping
|
||||
|
||||
| Mode | Agent | Behavior |
|
||||
| -------- | ----------------- | -------------------------------------------- |
|
||||
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
||||
| **ask** | - | Focus on understanding. Ask questions. |
|
||||
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
||||
|
||||
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
||||
> Full Plan Mode (4-Phase) protocol lives in `code-rules.md`.
|
||||
|
||||
---
|
||||
33
.agents/rules/universal-rules.md
Normal file
33
.agents/rules/universal-rules.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
name: universal-rules
|
||||
version: 1.0.0
|
||||
priority: P0
|
||||
trigger: always_on
|
||||
---
|
||||
|
||||
# Universal Rules (TIER 0) - AG Kit
|
||||
|
||||
> Always-active rules that apply to every request, regardless of domain.
|
||||
|
||||
---
|
||||
|
||||
## 🌐 Language Handling
|
||||
|
||||
When user's prompt is NOT in English:
|
||||
|
||||
1. **Internally translate** for better comprehension
|
||||
2. **Respond in user's language** - match their communication
|
||||
3. **Code comments/variables** remain in English
|
||||
|
||||
---
|
||||
|
||||
## 🧹 Clean Code (Global Mandatory)
|
||||
|
||||
**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
|
||||
|
||||
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
||||
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
||||
- **Performance**: Measure first. Adhere to current Core Web Vitals standards.
|
||||
- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user