create-raffles-it 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/agents/.agents +105 -0
- package/agents/backend-specialist/agent.yaml +21 -0
- package/agents/backend-specialist/prompt.md +255 -0
- package/agents/code-archaeologist/agent.yaml +13 -0
- package/agents/code-archaeologist/prompt.md +98 -0
- package/agents/database-architect/agent.yaml +13 -0
- package/agents/database-architect/prompt.md +218 -0
- package/agents/debugger/agent.yaml +7 -0
- package/agents/debugger/prompt.md +219 -0
- package/agents/devops-engineer/agent.yaml +16 -0
- package/agents/devops-engineer/prompt.md +234 -0
- package/agents/documentation-writer/agent.yaml +13 -0
- package/agents/documentation-writer/prompt.md +96 -0
- package/agents/explorer-agent/agent.yaml +16 -0
- package/agents/explorer-agent/prompt.md +65 -0
- package/agents/frontend-specialist/agent.yaml +17 -0
- package/agents/frontend-specialist/prompt.md +585 -0
- package/agents/orchestrator/agent.yaml +21 -0
- package/agents/orchestrator/prompt.md +408 -0
- package/agents/penetration-tester/agent.yaml +15 -0
- package/agents/penetration-tester/prompt.md +180 -0
- package/agents/performance-optimizer/agent.yaml +13 -0
- package/agents/performance-optimizer/prompt.md +179 -0
- package/agents/product-manager/agent.yaml +12 -0
- package/agents/product-manager/prompt.md +104 -0
- package/agents/product-owner/agent.yaml +12 -0
- package/agents/product-owner/prompt.md +87 -0
- package/agents/project-planner/agent.yaml +13 -0
- package/agents/project-planner/prompt.md +397 -0
- package/agents/qa-automation-engineer/agent.yaml +16 -0
- package/agents/qa-automation-engineer/prompt.md +95 -0
- package/agents/security-auditor/agent.yaml +15 -0
- package/agents/security-auditor/prompt.md +162 -0
- package/agents/seo-specialist/agent.yaml +13 -0
- package/agents/seo-specialist/prompt.md +103 -0
- package/agents/test-engineer/agent.yaml +17 -0
- package/agents/test-engineer/prompt.md +150 -0
- package/bin/commands/help.js +19 -0
- package/bin/commands/init.js +125 -0
- package/bin/commands/list.js +40 -0
- package/bin/index.js +44 -0
- package/bin/utils/logger.js +32 -0
- package/bin/utils/scaffold.js +114 -0
- package/configs/mcp_config.json +24 -0
- package/configs/model.yaml +20 -0
- package/configs/runtime.yaml +22 -0
- package/package.json +56 -0
- package/prompts/planning.md +31 -0
- package/prompts/reflection.md +21 -0
- package/prompts/system.md +24 -0
- package/rules/GEMINI.md +273 -0
- package/skills/api-patterns/SKILL.md +81 -0
- package/skills/api-patterns/api-style.md +42 -0
- package/skills/api-patterns/auth.md +24 -0
- package/skills/api-patterns/documentation.md +26 -0
- package/skills/api-patterns/graphql.md +41 -0
- package/skills/api-patterns/rate-limiting.md +31 -0
- package/skills/api-patterns/response.md +37 -0
- package/skills/api-patterns/rest.md +40 -0
- package/skills/api-patterns/scripts/api_validator.py +211 -0
- package/skills/api-patterns/security-testing.md +122 -0
- package/skills/api-patterns/skill.yaml +3 -0
- package/skills/api-patterns/trpc.md +41 -0
- package/skills/api-patterns/versioning.md +22 -0
- package/skills/architecture/SKILL.md +55 -0
- package/skills/architecture/context-discovery.md +43 -0
- package/skills/architecture/examples.md +94 -0
- package/skills/architecture/pattern-selection.md +68 -0
- package/skills/architecture/patterns-reference.md +50 -0
- package/skills/architecture/skill.yaml +3 -0
- package/skills/architecture/trade-off-analysis.md +77 -0
- package/skills/brainstorming/SKILL.md +163 -0
- package/skills/brainstorming/dynamic-questioning.md +350 -0
- package/skills/brainstorming/skill.yaml +3 -0
- package/skills/clean-code/SKILL.md +201 -0
- package/skills/clean-code/skill.yaml +3 -0
- package/skills/code-review-checklist/SKILL.md +109 -0
- package/skills/code-review-checklist/skill.yaml +3 -0
- package/skills/database-design/SKILL.md +52 -0
- package/skills/database-design/database-selection.md +43 -0
- package/skills/database-design/indexing.md +39 -0
- package/skills/database-design/migrations.md +48 -0
- package/skills/database-design/optimization.md +36 -0
- package/skills/database-design/orm-selection.md +30 -0
- package/skills/database-design/schema-design.md +56 -0
- package/skills/database-design/scripts/schema_validator.py +172 -0
- package/skills/database-design/skill.yaml +3 -0
- package/skills/frontend-design/SKILL.md +452 -0
- package/skills/frontend-design/animation-guide.md +331 -0
- package/skills/frontend-design/color-system.md +311 -0
- package/skills/frontend-design/decision-trees.md +418 -0
- package/skills/frontend-design/motion-graphics.md +306 -0
- package/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/skills/frontend-design/skill.yaml +3 -0
- package/skills/frontend-design/typography-system.md +345 -0
- package/skills/frontend-design/ux-psychology.md +1116 -0
- package/skills/frontend-design/visual-effects.md +383 -0
- package/skills/mcp-builder/SKILL.md +176 -0
- package/skills/mcp-builder/skill.yaml +3 -0
- package/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/skills/nextjs-react-expert/SKILL.md +293 -0
- package/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/skills/nextjs-react-expert/skill.yaml +3 -0
- package/skills/nodejs-best-practices/SKILL.md +333 -0
- package/skills/nodejs-best-practices/skill.yaml +3 -0
- package/skills/parallel-agents/SKILL.md +175 -0
- package/skills/parallel-agents/skill.yaml +3 -0
- package/skills/powershell-windows/SKILL.md +167 -0
- package/skills/powershell-windows/skill.yaml +3 -0
- package/skills/python-patterns/SKILL.md +441 -0
- package/skills/python-patterns/skill.yaml +3 -0
- package/skills/seo-fundamentals/SKILL.md +129 -0
- package/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/skills/seo-fundamentals/skill.yaml +3 -0
- package/skills/systematic-debugging/SKILL.md +109 -0
- package/skills/systematic-debugging/skill.yaml +3 -0
- package/skills/tdd-workflow/SKILL.md +149 -0
- package/skills/tdd-workflow/skill.yaml +3 -0
- package/skills/vulnerability-scanner/SKILL.md +276 -0
- package/skills/vulnerability-scanner/checklists.md +121 -0
- package/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/skills/vulnerability-scanner/skill.yaml +3 -0
- package/skills/web-design-guidelines/SKILL.md +57 -0
- package/skills/web-design-guidelines/skill.yaml +3 -0
- package/skills/webapp-testing/SKILL.md +187 -0
- package/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/skills/webapp-testing/skill.yaml +3 -0
- package/workflows/brainstorm.md +113 -0
- package/workflows/create.md +59 -0
- package/workflows/debug.md +103 -0
- package/workflows/deploy.md +176 -0
- package/workflows/enhance.md +63 -0
- package/workflows/orchestrate.md +237 -0
- package/workflows/plan.md +89 -0
- package/workflows/preview.md +81 -0
- package/workflows/status.md +86 -0
- package/workflows/test.md +144 -0
- package/workflows/ui-ux-pro-max.md +296 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Runtime configuration for Antigravity Kit
|
|
2
|
+
|
|
3
|
+
agent_system:
|
|
4
|
+
base_path: .
|
|
5
|
+
agents_path: agents
|
|
6
|
+
skills_path: skills
|
|
7
|
+
workflows_path: workflows
|
|
8
|
+
shared_path: .shared
|
|
9
|
+
rules_path: rules
|
|
10
|
+
scripts_path: scripts
|
|
11
|
+
|
|
12
|
+
routing:
|
|
13
|
+
auto_select: true
|
|
14
|
+
fallback_agent: orchestrator
|
|
15
|
+
|
|
16
|
+
skills:
|
|
17
|
+
auto_load: true
|
|
18
|
+
cache: true
|
|
19
|
+
|
|
20
|
+
logging:
|
|
21
|
+
level: info
|
|
22
|
+
format: json
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-raffles-it",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "AI Agent Enhancement Toolkit — specialist agents, skills, and workflows for Claude Code, Cursor, and Windsurf.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"raffles-it-kit": "bin/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"agents/",
|
|
10
|
+
"skills/",
|
|
11
|
+
"workflows/",
|
|
12
|
+
"configs/",
|
|
13
|
+
"prompts/",
|
|
14
|
+
"rules/",
|
|
15
|
+
"bin/",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"start": "node bin/index.js",
|
|
21
|
+
"prepublishOnly": "npm pkg fix && echo '📦 Publishing raffles-it-kit to npm...'"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"fs-extra": "^11.2.0",
|
|
25
|
+
"inquirer": "^8.2.6"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/HaiTrieu0902/agent-skills-kit.git"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/HaiTrieu0902/agent-skills-kit#readme",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/HaiTrieu0902/agent-skills-kit/issues"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"raffles",
|
|
37
|
+
"claude",
|
|
38
|
+
"claude-code",
|
|
39
|
+
"ai",
|
|
40
|
+
"agent",
|
|
41
|
+
"llm",
|
|
42
|
+
"cursor",
|
|
43
|
+
"windsurf",
|
|
44
|
+
"gemini",
|
|
45
|
+
"skills",
|
|
46
|
+
"workflows",
|
|
47
|
+
"templates",
|
|
48
|
+
"toolkit",
|
|
49
|
+
"coding-assistant"
|
|
50
|
+
],
|
|
51
|
+
"author": "trieubh",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=18.0.0"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "1.0"
|
|
3
|
+
scope: planning
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Planning Prompt
|
|
7
|
+
|
|
8
|
+
Use this prompt when orchestrating multi-step tasks.
|
|
9
|
+
|
|
10
|
+
## Planning Framework
|
|
11
|
+
|
|
12
|
+
1. **Decompose**: Break the task into atomic steps
|
|
13
|
+
2. **Assign**: Route each step to the appropriate agent
|
|
14
|
+
3. **Sequence**: Identify dependencies and parallelism
|
|
15
|
+
4. **Validate**: Define success criteria per step
|
|
16
|
+
5. **Execute**: Run with checkpoints
|
|
17
|
+
|
|
18
|
+
## Agent Routing
|
|
19
|
+
|
|
20
|
+
| Task Type | Agent |
|
|
21
|
+
|-----------|-------|
|
|
22
|
+
| Backend/API | backend-specialist |
|
|
23
|
+
| Frontend/UI | frontend-specialist |
|
|
24
|
+
| Database | database-architect |
|
|
25
|
+
| Security | security-auditor |
|
|
26
|
+
| Testing | test-engineer |
|
|
27
|
+
| DevOps/CI | devops-engineer |
|
|
28
|
+
| Debugging | debugger |
|
|
29
|
+
| Planning | project-planner |
|
|
30
|
+
| Research | explorer-agent |
|
|
31
|
+
| Multi-step | orchestrator |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "1.0"
|
|
3
|
+
scope: reflection
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reflection Prompt
|
|
7
|
+
|
|
8
|
+
After completing a task, reflect on:
|
|
9
|
+
|
|
10
|
+
## Quality Checklist
|
|
11
|
+
|
|
12
|
+
- [ ] Task requirements fully met?
|
|
13
|
+
- [ ] Security considerations addressed?
|
|
14
|
+
- [ ] Tests written for critical paths?
|
|
15
|
+
- [ ] Documentation updated?
|
|
16
|
+
- [ ] No hardcoded secrets or credentials?
|
|
17
|
+
- [ ] Code follows project conventions?
|
|
18
|
+
|
|
19
|
+
## Lessons Learned
|
|
20
|
+
|
|
21
|
+
Document any unexpected issues or better approaches discovered during execution.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "1.0"
|
|
3
|
+
scope: global
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# System Prompt
|
|
7
|
+
|
|
8
|
+
This file defines the global system context for all agents in the Antigravity Kit.
|
|
9
|
+
|
|
10
|
+
## Core Principles
|
|
11
|
+
|
|
12
|
+
- **Security first**: Validate all inputs, trust nothing external
|
|
13
|
+
- **Ask before assuming**: Clarify requirements before implementing
|
|
14
|
+
- **Type safety**: Use TypeScript/Pydantic everywhere
|
|
15
|
+
- **Test coverage**: Critical paths must have tests
|
|
16
|
+
- **Documentation**: Keep docs in sync with code
|
|
17
|
+
|
|
18
|
+
## Agent Selection
|
|
19
|
+
|
|
20
|
+
Agents are auto-selected based on task type. See `agents/` for available specialists.
|
|
21
|
+
|
|
22
|
+
## Skill Loading
|
|
23
|
+
|
|
24
|
+
Skills are loaded on demand. See `skills/` for available capability packs.
|
package/rules/GEMINI.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
trigger: always_on
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# GEMINI.md - Antigravity Kit
|
|
6
|
+
|
|
7
|
+
> This file defines how the AI behaves in this workspace.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## CRITICAL: AGENT & SKILL PROTOCOL (START HERE)
|
|
12
|
+
|
|
13
|
+
> **MANDATORY:** You MUST read the appropriate agent file and its skills BEFORE performing any implementation. This is the highest priority rule.
|
|
14
|
+
|
|
15
|
+
### 1. Modular Skill Loading Protocol
|
|
16
|
+
|
|
17
|
+
Agent activated → Check frontmatter "skills:" → Read SKILL.md (INDEX) → Read specific sections.
|
|
18
|
+
|
|
19
|
+
- **Selective Reading:** DO NOT read ALL files in a skill folder. Read `SKILL.md` first, then only read sections matching the user's request.
|
|
20
|
+
- **Rule Priority:** P0 (GEMINI.md) > P1 (Agent .md) > P2 (SKILL.md). All rules are binding.
|
|
21
|
+
|
|
22
|
+
### 2. Enforcement Protocol
|
|
23
|
+
|
|
24
|
+
1. **When agent is activated:**
|
|
25
|
+
- ✅ Activate: Read Rules → Check Frontmatter → Load SKILL.md → Apply All.
|
|
26
|
+
2. **Forbidden:** Never skip reading agent rules or skill instructions. "Read → Understand → Apply" is mandatory.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 📥 REQUEST CLASSIFIER (STEP 1)
|
|
31
|
+
|
|
32
|
+
**Before ANY action, classify the request:**
|
|
33
|
+
|
|
34
|
+
| Request Type | Trigger Keywords | Active Tiers | Result |
|
|
35
|
+
| ---------------- | ------------------------------------------ | ------------------------------ | --------------------------- |
|
|
36
|
+
| **QUESTION** | "what is", "how does", "explain" | TIER 0 only | Text Response |
|
|
37
|
+
| **SURVEY/INTEL** | "analyze", "list files", "overview" | TIER 0 + Explorer | Session Intel (No File) |
|
|
38
|
+
| **SIMPLE CODE** | "fix", "add", "change" (single file) | TIER 0 + TIER 1 (lite) | Inline Edit |
|
|
39
|
+
| **COMPLEX CODE** | "build", "create", "implement", "refactor" | TIER 0 + TIER 1 (full) + Agent | **{task-slug}.md Required** |
|
|
40
|
+
| **DESIGN/UI** | "design", "UI", "page", "dashboard" | TIER 0 + TIER 1 + Agent | **{task-slug}.md Required** |
|
|
41
|
+
| **SLASH CMD** | /create, /orchestrate, /debug | Command-specific flow | Variable |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 🤖 INTELLIGENT AGENT ROUTING (STEP 2 - AUTO)
|
|
46
|
+
|
|
47
|
+
**ALWAYS ACTIVE: Before responding to ANY request, automatically analyze and select the best agent(s).**
|
|
48
|
+
|
|
49
|
+
> 🔴 **MANDATORY:** You MUST follow the protocol defined in `@[skills/intelligent-routing]`.
|
|
50
|
+
|
|
51
|
+
### Auto-Selection Protocol
|
|
52
|
+
|
|
53
|
+
1. **Analyze (Silent)**: Detect domains (Frontend, Backend, Security, etc.) from user request.
|
|
54
|
+
2. **Select Agent(s)**: Choose the most appropriate specialist(s).
|
|
55
|
+
3. **Inform User**: Concisely state which expertise is being applied.
|
|
56
|
+
4. **Apply**: Generate response using the selected agent's persona and rules.
|
|
57
|
+
|
|
58
|
+
### Response Format (MANDATORY)
|
|
59
|
+
|
|
60
|
+
When auto-applying an agent, inform the user:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
🤖 **Applying knowledge of `@[agent-name]`...**
|
|
64
|
+
|
|
65
|
+
[Continue with specialized response]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Rules:**
|
|
69
|
+
|
|
70
|
+
1. **Silent Analysis**: No verbose meta-commentary ("I am analyzing...").
|
|
71
|
+
2. **Respect Overrides**: If user mentions `@agent`, use it.
|
|
72
|
+
3. **Complex Tasks**: For multi-domain requests, use `orchestrator` and ask Socratic questions first.
|
|
73
|
+
|
|
74
|
+
### ⚠️ AGENT ROUTING CHECKLIST (MANDATORY BEFORE EVERY CODE/DESIGN RESPONSE)
|
|
75
|
+
|
|
76
|
+
**Before ANY code or design work, you MUST complete this mental checklist:**
|
|
77
|
+
|
|
78
|
+
| Step | Check | If Unchecked |
|
|
79
|
+
|------|-------|--------------|
|
|
80
|
+
| 1 | Did I identify the correct agent for this domain? | → STOP. Analyze request domain first. |
|
|
81
|
+
| 2 | Did I READ the agent's `.md` file (or recall its rules)? | → STOP. Open `.agent/agents/{agent}.md` |
|
|
82
|
+
| 3 | Did I announce `🤖 Applying knowledge of @[agent]...`? | → STOP. Add announcement before response. |
|
|
83
|
+
| 4 | Did I load required skills from agent's frontmatter? | → STOP. Check `skills:` field and read them. |
|
|
84
|
+
|
|
85
|
+
**Failure Conditions:**
|
|
86
|
+
|
|
87
|
+
- ❌ Writing code without identifying an agent = **PROTOCOL VIOLATION**
|
|
88
|
+
- ❌ Skipping the announcement = **USER CANNOT VERIFY AGENT WAS USED**
|
|
89
|
+
- ❌ Ignoring agent-specific rules (e.g., Purple Ban) = **QUALITY FAILURE**
|
|
90
|
+
|
|
91
|
+
> 🔴 **Self-Check Trigger:** Every time you are about to write code or create UI, ask yourself:
|
|
92
|
+
> "Have I completed the Agent Routing Checklist?" If NO → Complete it first.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## TIER 0: UNIVERSAL RULES (Always Active)
|
|
97
|
+
|
|
98
|
+
### 🌐 Language Handling
|
|
99
|
+
|
|
100
|
+
When user's prompt is NOT in English:
|
|
101
|
+
|
|
102
|
+
1. **Internally translate** for better comprehension
|
|
103
|
+
2. **Respond in user's language** - match their communication
|
|
104
|
+
3. **Code comments/variables** remain in English
|
|
105
|
+
|
|
106
|
+
### 🧹 Clean Code (Global Mandatory)
|
|
107
|
+
|
|
108
|
+
**ALL code MUST follow `@[skills/clean-code]` rules. No exceptions.**
|
|
109
|
+
|
|
110
|
+
- **Code**: Concise, direct, no over-engineering. Self-documenting.
|
|
111
|
+
- **Testing**: Mandatory. Pyramid (Unit > Int > E2E) + AAA Pattern.
|
|
112
|
+
- **Performance**: Measure first. Adhere to 2025 standards (Core Web Vitals).
|
|
113
|
+
- **Infra/Safety**: 5-Phase Deployment. Verify secrets security.
|
|
114
|
+
|
|
115
|
+
### 📁 File Dependency Awareness
|
|
116
|
+
|
|
117
|
+
**Before modifying ANY file:**
|
|
118
|
+
|
|
119
|
+
1. Check `CODEBASE.md` → File Dependencies
|
|
120
|
+
2. Identify dependent files
|
|
121
|
+
3. Update ALL affected files together
|
|
122
|
+
|
|
123
|
+
### 🗺️ System Map Read
|
|
124
|
+
|
|
125
|
+
> 🔴 **MANDATORY:** Read `ARCHITECTURE.md` at session start to understand Agents, Skills, and Scripts.
|
|
126
|
+
|
|
127
|
+
**Path Awareness:**
|
|
128
|
+
|
|
129
|
+
- Agents: `.agent/` (Project)
|
|
130
|
+
- Skills: `.agent/skills/` (Project)
|
|
131
|
+
- Runtime Scripts: `.agent/skills/<skill>/scripts/`
|
|
132
|
+
|
|
133
|
+
### 🧠 Read → Understand → Apply
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
❌ WRONG: Read agent file → Start coding
|
|
137
|
+
✅ CORRECT: Read → Understand WHY → Apply PRINCIPLES → Code
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Before coding, answer:**
|
|
141
|
+
|
|
142
|
+
1. What is the GOAL of this agent/skill?
|
|
143
|
+
2. What PRINCIPLES must I apply?
|
|
144
|
+
3. How does this DIFFER from generic output?
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## TIER 1: CODE RULES (When Writing Code)
|
|
149
|
+
|
|
150
|
+
### 📱 Project Type Routing
|
|
151
|
+
|
|
152
|
+
| Project Type | Primary Agent | Skills |
|
|
153
|
+
| -------------------------------------- | --------------------- | ----------------------------- |
|
|
154
|
+
| **MOBILE** (iOS, Android, RN, Flutter) | `mobile-developer` | mobile-design |
|
|
155
|
+
| **WEB** (Next.js, React web) | `frontend-specialist` | frontend-design |
|
|
156
|
+
| **BACKEND** (API, server, DB) | `backend-specialist` | api-patterns, database-design |
|
|
157
|
+
|
|
158
|
+
> 🔴 **Mobile + frontend-specialist = WRONG.** Mobile = mobile-developer ONLY.
|
|
159
|
+
|
|
160
|
+
### 🛑 Socratic Gate
|
|
161
|
+
|
|
162
|
+
**For complex requests, STOP and ASK first:**
|
|
163
|
+
|
|
164
|
+
### 🛑 GLOBAL SOCRATIC GATE (TIER 0)
|
|
165
|
+
|
|
166
|
+
**MANDATORY: Every user request must pass through the Socratic Gate before ANY tool use or implementation.**
|
|
167
|
+
|
|
168
|
+
| Request Type | Strategy | Required Action |
|
|
169
|
+
| ----------------------- | -------------- | ----------------------------------------------------------------- |
|
|
170
|
+
| **New Feature / Build** | Deep Discovery | ASK minimum 3 strategic questions |
|
|
171
|
+
| **Code Edit / Bug Fix** | Context Check | Confirm understanding + ask impact questions |
|
|
172
|
+
| **Vague / Simple** | Clarification | Ask Purpose, Users, and Scope |
|
|
173
|
+
| **Full Orchestration** | Gatekeeper | **STOP** subagents until user confirms plan details |
|
|
174
|
+
| **Direct "Proceed"** | Validation | **STOP** → Even if answers are given, ask 2 "Edge Case" questions |
|
|
175
|
+
|
|
176
|
+
**Protocol:**
|
|
177
|
+
|
|
178
|
+
1. **Never Assume:** If even 1% is unclear, ASK.
|
|
179
|
+
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.
|
|
180
|
+
3. **Wait:** Do NOT invoke subagents or write code until the user clears the Gate.
|
|
181
|
+
4. **Reference:** Full protocol in `@[skills/brainstorming]`.
|
|
182
|
+
|
|
183
|
+
### 🏁 Final Checklist Protocol
|
|
184
|
+
|
|
185
|
+
**Trigger:** When the user says "son kontrolleri yap", "final checks", "çalıştır tüm testleri", or similar phrases.
|
|
186
|
+
|
|
187
|
+
| Task Stage | Command | Purpose |
|
|
188
|
+
| ---------------- | -------------------------------------------------- | ------------------------------ |
|
|
189
|
+
| **Manual Audit** | `python .agent/scripts/checklist.py .` | Priority-based project audit |
|
|
190
|
+
| **Pre-Deploy** | `python .agent/scripts/checklist.py . --url <URL>` | Full Suite + Performance + E2E |
|
|
191
|
+
|
|
192
|
+
**Priority Execution Order:**
|
|
193
|
+
|
|
194
|
+
1. **Security** → 2. **Lint** → 3. **Schema** → 4. **Tests** → 5. **UX** → 6. **Seo** → 7. **Lighthouse/E2E**
|
|
195
|
+
|
|
196
|
+
**Rules:**
|
|
197
|
+
|
|
198
|
+
- **Completion:** A task is NOT finished until `checklist.py` returns success.
|
|
199
|
+
- **Reporting:** If it fails, fix the **Critical** blockers first (Security/Lint).
|
|
200
|
+
|
|
201
|
+
**Available Scripts (12 total):**
|
|
202
|
+
|
|
203
|
+
| Script | Skill | When to Use |
|
|
204
|
+
| -------------------------- | --------------------- | ------------------- |
|
|
205
|
+
| `security_scan.py` | vulnerability-scanner | Always on deploy |
|
|
206
|
+
| `dependency_analyzer.py` | vulnerability-scanner | Weekly / Deploy |
|
|
207
|
+
| `lint_runner.py` | lint-and-validate | Every code change |
|
|
208
|
+
| `test_runner.py` | testing-patterns | After logic change |
|
|
209
|
+
| `schema_validator.py` | database-design | After DB change |
|
|
210
|
+
| `ux_audit.py` | frontend-design | After UI change |
|
|
211
|
+
| `accessibility_checker.py` | frontend-design | After UI change |
|
|
212
|
+
| `seo_checker.py` | seo-fundamentals | After page change |
|
|
213
|
+
| `bundle_analyzer.py` | performance-profiling | Before deploy |
|
|
214
|
+
| `mobile_audit.py` | mobile-design | After mobile change |
|
|
215
|
+
| `lighthouse_audit.py` | performance-profiling | Before deploy |
|
|
216
|
+
| `playwright_runner.py` | webapp-testing | Before deploy |
|
|
217
|
+
|
|
218
|
+
> 🔴 **Agents & Skills can invoke ANY script** via `python .agent/skills/<skill>/scripts/<script>.py`
|
|
219
|
+
|
|
220
|
+
### 🎭 Gemini Mode Mapping
|
|
221
|
+
|
|
222
|
+
| Mode | Agent | Behavior |
|
|
223
|
+
| -------- | ----------------- | -------------------------------------------- |
|
|
224
|
+
| **plan** | `project-planner` | 4-phase methodology. NO CODE before Phase 4. |
|
|
225
|
+
| **ask** | - | Focus on understanding. Ask questions. |
|
|
226
|
+
| **edit** | `orchestrator` | Execute. Check `{task-slug}.md` first. |
|
|
227
|
+
|
|
228
|
+
**Plan Mode (4-Phase):**
|
|
229
|
+
|
|
230
|
+
1. ANALYSIS → Research, questions
|
|
231
|
+
2. PLANNING → `{task-slug}.md`, task breakdown
|
|
232
|
+
3. SOLUTIONING → Architecture, design (NO CODE!)
|
|
233
|
+
4. IMPLEMENTATION → Code + tests
|
|
234
|
+
|
|
235
|
+
> 🔴 **Edit mode:** If multi-file or structural change → Offer to create `{task-slug}.md`. For single-file fixes → Proceed directly.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## TIER 2: DESIGN RULES (Reference)
|
|
240
|
+
|
|
241
|
+
> **Design rules are in the specialist agents, NOT here.**
|
|
242
|
+
|
|
243
|
+
| Task | Read |
|
|
244
|
+
| ------------ | ------------------------------- |
|
|
245
|
+
| Web UI/UX | `.agent/frontend-specialist.md` |
|
|
246
|
+
| Mobile UI/UX | `.agent/mobile-developer.md` |
|
|
247
|
+
|
|
248
|
+
**These agents contain:**
|
|
249
|
+
|
|
250
|
+
- Purple Ban (no violet/purple colors)
|
|
251
|
+
- Template Ban (no standard layouts)
|
|
252
|
+
- Anti-cliché rules
|
|
253
|
+
- Deep Design Thinking protocol
|
|
254
|
+
|
|
255
|
+
> 🔴 **For design work:** Open and READ the agent file. Rules are there.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 📁 QUICK REFERENCE
|
|
260
|
+
|
|
261
|
+
### Agents & Skills
|
|
262
|
+
|
|
263
|
+
- **Masters**: `orchestrator`, `project-planner`, `security-auditor` (Cyber/Audit), `backend-specialist` (API/DB), `frontend-specialist` (UI/UX), `mobile-developer`, `debugger`, `game-developer`
|
|
264
|
+
- **Key Skills**: `clean-code`, `brainstorming`, `app-builder`, `frontend-design`, `mobile-design`, `plan-writing`, `behavioral-modes`
|
|
265
|
+
|
|
266
|
+
### Key Scripts
|
|
267
|
+
|
|
268
|
+
- **Verify**: `.agent/scripts/verify_all.py`, `.agent/scripts/checklist.py`
|
|
269
|
+
- **Scanners**: `security_scan.py`, `dependency_analyzer.py`
|
|
270
|
+
- **Audits**: `ux_audit.py`, `mobile_audit.py`, `lighthouse_audit.py`, `seo_checker.py`
|
|
271
|
+
- **Test**: `playwright_runner.py`, `test_runner.py`
|
|
272
|
+
|
|
273
|
+
---
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-patterns
|
|
3
|
+
description: API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination.
|
|
4
|
+
allowed-tools: Read, Write, Edit, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# API Patterns
|
|
8
|
+
|
|
9
|
+
> API design principles and decision-making for 2025.
|
|
10
|
+
> **Learn to THINK, not copy fixed patterns.**
|
|
11
|
+
|
|
12
|
+
## 🎯 Selective Reading Rule
|
|
13
|
+
|
|
14
|
+
**Read ONLY files relevant to the request!** Check the content map, find what you need.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 📑 Content Map
|
|
19
|
+
|
|
20
|
+
| File | Description | When to Read |
|
|
21
|
+
|------|-------------|--------------|
|
|
22
|
+
| `api-style.md` | REST vs GraphQL vs tRPC decision tree | Choosing API type |
|
|
23
|
+
| `rest.md` | Resource naming, HTTP methods, status codes | Designing REST API |
|
|
24
|
+
| `response.md` | Envelope pattern, error format, pagination | Response structure |
|
|
25
|
+
| `graphql.md` | Schema design, when to use, security | Considering GraphQL |
|
|
26
|
+
| `trpc.md` | TypeScript monorepo, type safety | TS fullstack projects |
|
|
27
|
+
| `versioning.md` | URI/Header/Query versioning | API evolution planning |
|
|
28
|
+
| `auth.md` | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
|
|
29
|
+
| `rate-limiting.md` | Token bucket, sliding window | API protection |
|
|
30
|
+
| `documentation.md` | OpenAPI/Swagger best practices | Documentation |
|
|
31
|
+
| `security-testing.md` | OWASP API Top 10, auth/authz testing | Security audits |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🔗 Related Skills
|
|
36
|
+
|
|
37
|
+
| Need | Skill |
|
|
38
|
+
|------|-------|
|
|
39
|
+
| API implementation | `@[skills/backend-development]` |
|
|
40
|
+
| Data structure | `@[skills/database-design]` |
|
|
41
|
+
| Security details | `@[skills/security-hardening]` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## ✅ Decision Checklist
|
|
46
|
+
|
|
47
|
+
Before designing an API:
|
|
48
|
+
|
|
49
|
+
- [ ] **Asked user about API consumers?**
|
|
50
|
+
- [ ] **Chosen API style for THIS context?** (REST/GraphQL/tRPC)
|
|
51
|
+
- [ ] **Defined consistent response format?**
|
|
52
|
+
- [ ] **Planned versioning strategy?**
|
|
53
|
+
- [ ] **Considered authentication needs?**
|
|
54
|
+
- [ ] **Planned rate limiting?**
|
|
55
|
+
- [ ] **Documentation approach defined?**
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## ❌ Anti-Patterns
|
|
60
|
+
|
|
61
|
+
**DON'T:**
|
|
62
|
+
- Default to REST for everything
|
|
63
|
+
- Use verbs in REST endpoints (/getUsers)
|
|
64
|
+
- Return inconsistent response formats
|
|
65
|
+
- Expose internal errors to clients
|
|
66
|
+
- Skip rate limiting
|
|
67
|
+
|
|
68
|
+
**DO:**
|
|
69
|
+
- Choose API style based on context
|
|
70
|
+
- Ask about client requirements
|
|
71
|
+
- Document thoroughly
|
|
72
|
+
- Use appropriate status codes
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Script
|
|
77
|
+
|
|
78
|
+
| Script | Purpose | Command |
|
|
79
|
+
|--------|---------|---------|
|
|
80
|
+
| `scripts/api_validator.py` | API endpoint validation | `python scripts/api_validator.py <project_path>` |
|
|
81
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# API Style Selection (2025)
|
|
2
|
+
|
|
3
|
+
> REST vs GraphQL vs tRPC - Hangi durumda hangisi?
|
|
4
|
+
|
|
5
|
+
## Decision Tree
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Who are the API consumers?
|
|
9
|
+
│
|
|
10
|
+
├── Public API / Multiple platforms
|
|
11
|
+
│ └── REST + OpenAPI (widest compatibility)
|
|
12
|
+
│
|
|
13
|
+
├── Complex data needs / Multiple frontends
|
|
14
|
+
│ └── GraphQL (flexible queries)
|
|
15
|
+
│
|
|
16
|
+
├── TypeScript frontend + backend (monorepo)
|
|
17
|
+
│ └── tRPC (end-to-end type safety)
|
|
18
|
+
│
|
|
19
|
+
├── Real-time / Event-driven
|
|
20
|
+
│ └── WebSocket + AsyncAPI
|
|
21
|
+
│
|
|
22
|
+
└── Internal microservices
|
|
23
|
+
└── gRPC (performance) or REST (simplicity)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Comparison
|
|
27
|
+
|
|
28
|
+
| Factor | REST | GraphQL | tRPC |
|
|
29
|
+
|--------|------|---------|------|
|
|
30
|
+
| **Best for** | Public APIs | Complex apps | TS monorepos |
|
|
31
|
+
| **Learning curve** | Low | Medium | Low (if TS) |
|
|
32
|
+
| **Over/under fetching** | Common | Solved | Solved |
|
|
33
|
+
| **Type safety** | Manual (OpenAPI) | Schema-based | Automatic |
|
|
34
|
+
| **Caching** | HTTP native | Complex | Client-based |
|
|
35
|
+
|
|
36
|
+
## Selection Questions
|
|
37
|
+
|
|
38
|
+
1. Who are the API consumers?
|
|
39
|
+
2. Is the frontend TypeScript?
|
|
40
|
+
3. How complex are the data relationships?
|
|
41
|
+
4. Is caching critical?
|
|
42
|
+
5. Public or internal API?
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Authentication Patterns
|
|
2
|
+
|
|
3
|
+
> Choose auth pattern based on use case.
|
|
4
|
+
|
|
5
|
+
## Selection Guide
|
|
6
|
+
|
|
7
|
+
| Pattern | Best For |
|
|
8
|
+
|---------|----------|
|
|
9
|
+
| **JWT** | Stateless, microservices |
|
|
10
|
+
| **Session** | Traditional web, simple |
|
|
11
|
+
| **OAuth 2.0** | Third-party integration |
|
|
12
|
+
| **API Keys** | Server-to-server, public APIs |
|
|
13
|
+
| **Passkey** | Modern passwordless (2025+) |
|
|
14
|
+
|
|
15
|
+
## JWT Principles
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Important:
|
|
19
|
+
├── Always verify signature
|
|
20
|
+
├── Check expiration
|
|
21
|
+
├── Include minimal claims
|
|
22
|
+
├── Use short expiry + refresh tokens
|
|
23
|
+
└── Never store sensitive data in JWT
|
|
24
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# API Documentation Principles
|
|
2
|
+
|
|
3
|
+
> Good docs = happy developers = API adoption.
|
|
4
|
+
|
|
5
|
+
## OpenAPI/Swagger Essentials
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Include:
|
|
9
|
+
├── All endpoints with examples
|
|
10
|
+
├── Request/response schemas
|
|
11
|
+
├── Authentication requirements
|
|
12
|
+
├── Error response formats
|
|
13
|
+
└── Rate limiting info
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Good Documentation Has
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Essentials:
|
|
20
|
+
├── Quick start / Getting started
|
|
21
|
+
├── Authentication guide
|
|
22
|
+
├── Complete API reference
|
|
23
|
+
├── Error handling guide
|
|
24
|
+
├── Code examples (multiple languages)
|
|
25
|
+
└── Changelog
|
|
26
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# GraphQL Principles
|
|
2
|
+
|
|
3
|
+
> Flexible queries for complex, interconnected data.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
✅ Good fit:
|
|
9
|
+
├── Complex, interconnected data
|
|
10
|
+
├── Multiple frontend platforms
|
|
11
|
+
├── Clients need flexible queries
|
|
12
|
+
├── Evolving data requirements
|
|
13
|
+
└── Reducing over-fetching matters
|
|
14
|
+
|
|
15
|
+
❌ Poor fit:
|
|
16
|
+
├── Simple CRUD operations
|
|
17
|
+
├── File upload heavy
|
|
18
|
+
├── HTTP caching important
|
|
19
|
+
└── Team unfamiliar with GraphQL
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Schema Design Principles
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Principles:
|
|
26
|
+
├── Think in graphs, not endpoints
|
|
27
|
+
├── Design for evolvability (no versions)
|
|
28
|
+
├── Use connections for pagination
|
|
29
|
+
├── Be specific with types (not generic "data")
|
|
30
|
+
└── Handle nullability thoughtfully
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Security Considerations
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Protect against:
|
|
37
|
+
├── Query depth attacks → Set max depth
|
|
38
|
+
├── Query complexity → Calculate cost
|
|
39
|
+
├── Batching abuse → Limit batch size
|
|
40
|
+
├── Introspection → Disable in production
|
|
41
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Rate Limiting Principles
|
|
2
|
+
|
|
3
|
+
> Protect your API from abuse and overload.
|
|
4
|
+
|
|
5
|
+
## Why Rate Limit
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Protect against:
|
|
9
|
+
├── Brute force attacks
|
|
10
|
+
├── Resource exhaustion
|
|
11
|
+
├── Cost overruns (if pay-per-use)
|
|
12
|
+
└── Unfair usage
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Strategy Selection
|
|
16
|
+
|
|
17
|
+
| Type | How | When |
|
|
18
|
+
|------|-----|------|
|
|
19
|
+
| **Token bucket** | Burst allowed, refills over time | Most APIs |
|
|
20
|
+
| **Sliding window** | Smooth distribution | Strict limits |
|
|
21
|
+
| **Fixed window** | Simple counters per window | Basic needs |
|
|
22
|
+
|
|
23
|
+
## Response Headers
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
Include in headers:
|
|
27
|
+
├── X-RateLimit-Limit (max requests)
|
|
28
|
+
├── X-RateLimit-Remaining (requests left)
|
|
29
|
+
├── X-RateLimit-Reset (when limit resets)
|
|
30
|
+
└── Return 429 when exceeded
|
|
31
|
+
```
|