@devran-ai/kit 4.1.0
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/.agent/CheatSheet.md +350 -0
- package/.agent/README.md +76 -0
- package/.agent/agents/README.md +155 -0
- package/.agent/agents/architect.md +185 -0
- package/.agent/agents/backend-specialist.md +276 -0
- package/.agent/agents/build-error-resolver.md +207 -0
- package/.agent/agents/code-reviewer.md +162 -0
- package/.agent/agents/database-architect.md +138 -0
- package/.agent/agents/devops-engineer.md +144 -0
- package/.agent/agents/doc-updater.md +229 -0
- package/.agent/agents/e2e-runner.md +145 -0
- package/.agent/agents/explorer-agent.md +143 -0
- package/.agent/agents/frontend-specialist.md +144 -0
- package/.agent/agents/go-reviewer.md +128 -0
- package/.agent/agents/knowledge-agent.md +197 -0
- package/.agent/agents/mobile-developer.md +150 -0
- package/.agent/agents/performance-optimizer.md +175 -0
- package/.agent/agents/planner.md +133 -0
- package/.agent/agents/pr-reviewer.md +148 -0
- package/.agent/agents/python-reviewer.md +123 -0
- package/.agent/agents/refactor-cleaner.md +201 -0
- package/.agent/agents/reliability-engineer.md +156 -0
- package/.agent/agents/security-reviewer.md +141 -0
- package/.agent/agents/sprint-orchestrator.md +124 -0
- package/.agent/agents/tdd-guide.md +179 -0
- package/.agent/agents/typescript-reviewer.md +110 -0
- package/.agent/checklists/README.md +102 -0
- package/.agent/checklists/pre-commit.md +93 -0
- package/.agent/checklists/session-end.md +99 -0
- package/.agent/checklists/session-start.md +102 -0
- package/.agent/checklists/task-complete.md +81 -0
- package/.agent/commands/README.md +130 -0
- package/.agent/commands/adr.md +29 -0
- package/.agent/commands/ask.md +28 -0
- package/.agent/commands/build.md +30 -0
- package/.agent/commands/changelog.md +40 -0
- package/.agent/commands/checkpoint.md +28 -0
- package/.agent/commands/code-review.md +65 -0
- package/.agent/commands/compact.md +28 -0
- package/.agent/commands/cook.md +30 -0
- package/.agent/commands/db.md +30 -0
- package/.agent/commands/debug.md +31 -0
- package/.agent/commands/deploy.md +37 -0
- package/.agent/commands/design.md +29 -0
- package/.agent/commands/doc.md +30 -0
- package/.agent/commands/eval.md +30 -0
- package/.agent/commands/fix.md +32 -0
- package/.agent/commands/git.md +32 -0
- package/.agent/commands/help.md +273 -0
- package/.agent/commands/implement.md +30 -0
- package/.agent/commands/integrate.md +32 -0
- package/.agent/commands/learn.md +29 -0
- package/.agent/commands/perf.md +31 -0
- package/.agent/commands/plan.md +56 -0
- package/.agent/commands/pr-describe.md +65 -0
- package/.agent/commands/pr-fix.md +45 -0
- package/.agent/commands/pr-merge.md +45 -0
- package/.agent/commands/pr-review.md +50 -0
- package/.agent/commands/pr-split.md +54 -0
- package/.agent/commands/pr-status.md +56 -0
- package/.agent/commands/pr.md +58 -0
- package/.agent/commands/refactor.md +32 -0
- package/.agent/commands/research.md +28 -0
- package/.agent/commands/scout.md +30 -0
- package/.agent/commands/security-scan.md +33 -0
- package/.agent/commands/setup.md +31 -0
- package/.agent/commands/status.md +59 -0
- package/.agent/commands/tdd.md +73 -0
- package/.agent/commands/verify.md +58 -0
- package/.agent/contexts/brainstorm.md +26 -0
- package/.agent/contexts/debug.md +28 -0
- package/.agent/contexts/implement.md +29 -0
- package/.agent/contexts/plan-quality-log.md +30 -0
- package/.agent/contexts/review.md +27 -0
- package/.agent/contexts/ship.md +28 -0
- package/.agent/decisions/001-trust-grade-governance.md +46 -0
- package/.agent/decisions/002-cross-ide-generation.md +15 -0
- package/.agent/engine/identity.json +4 -0
- package/.agent/engine/loading-rules.json +193 -0
- package/.agent/engine/marketplace-index.json +29 -0
- package/.agent/engine/mcp-servers/filesystem.json +9 -0
- package/.agent/engine/mcp-servers/github.json +11 -0
- package/.agent/engine/mcp-servers/postgres.json +11 -0
- package/.agent/engine/mcp-servers/supabase.json +11 -0
- package/.agent/engine/mcp-servers/vercel.json +11 -0
- package/.agent/engine/reliability-config.json +14 -0
- package/.agent/engine/sdlc-map.json +50 -0
- package/.agent/engine/workflow-state.json +167 -0
- package/.agent/hooks/README.md +101 -0
- package/.agent/hooks/hooks.json +104 -0
- package/.agent/hooks/templates/session-end.md +110 -0
- package/.agent/hooks/templates/session-start.md +95 -0
- package/.agent/manifest.json +466 -0
- package/.agent/rules/agent-upgrade-policy.md +56 -0
- package/.agent/rules/architecture.md +111 -0
- package/.agent/rules/coding-style.md +75 -0
- package/.agent/rules/documentation.md +74 -0
- package/.agent/rules/git-workflow.md +140 -0
- package/.agent/rules/quality-gate.md +117 -0
- package/.agent/rules/security.md +67 -0
- package/.agent/rules/sprint-tracking.md +103 -0
- package/.agent/rules/testing.md +80 -0
- package/.agent/rules/workflow-standards.md +30 -0
- package/.agent/rules.md +293 -0
- package/.agent/session-context.md +69 -0
- package/.agent/session-state.json +27 -0
- package/.agent/skills/README.md +135 -0
- package/.agent/skills/api-patterns/SKILL.md +117 -0
- package/.agent/skills/app-builder/SKILL.md +202 -0
- package/.agent/skills/architecture/SKILL.md +101 -0
- package/.agent/skills/behavioral-modes/SKILL.md +295 -0
- package/.agent/skills/brainstorming/SKILL.md +156 -0
- package/.agent/skills/clean-code/SKILL.md +142 -0
- package/.agent/skills/context-budget/SKILL.md +78 -0
- package/.agent/skills/continuous-learning/SKILL.md +145 -0
- package/.agent/skills/database-design/SKILL.md +303 -0
- package/.agent/skills/debugging-strategies/SKILL.md +158 -0
- package/.agent/skills/deployment-procedures/SKILL.md +191 -0
- package/.agent/skills/docker-patterns/SKILL.md +161 -0
- package/.agent/skills/eval-harness/SKILL.md +89 -0
- package/.agent/skills/frontend-patterns/SKILL.md +141 -0
- package/.agent/skills/git-workflow/SKILL.md +159 -0
- package/.agent/skills/i18n-localization/SKILL.md +191 -0
- package/.agent/skills/intelligent-routing/SKILL.md +180 -0
- package/.agent/skills/mcp-integration/SKILL.md +240 -0
- package/.agent/skills/mobile-design/SKILL.md +191 -0
- package/.agent/skills/nodejs-patterns/SKILL.md +164 -0
- package/.agent/skills/parallel-agents/SKILL.md +200 -0
- package/.agent/skills/performance-profiling/SKILL.md +134 -0
- package/.agent/skills/plan-validation/SKILL.md +192 -0
- package/.agent/skills/plan-writing/SKILL.md +183 -0
- package/.agent/skills/plan-writing/domain-enhancers.md +184 -0
- package/.agent/skills/plan-writing/plan-retrospective.md +116 -0
- package/.agent/skills/plan-writing/plan-schema.md +119 -0
- package/.agent/skills/pr-toolkit/SKILL.md +174 -0
- package/.agent/skills/production-readiness/SKILL.md +126 -0
- package/.agent/skills/security-practices/SKILL.md +109 -0
- package/.agent/skills/shell-conventions/SKILL.md +92 -0
- package/.agent/skills/strategic-compact/SKILL.md +62 -0
- package/.agent/skills/testing-patterns/SKILL.md +141 -0
- package/.agent/skills/typescript-expert/SKILL.md +160 -0
- package/.agent/skills/ui-ux-pro-max/SKILL.md +137 -0
- package/.agent/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/skills/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/skills/ui-ux-pro-max/data/styles.csv +68 -0
- package/.agent/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/skills/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/skills/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/.agent/skills/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/skills/ui-ux-pro-max/scripts/search.py +114 -0
- package/.agent/skills/verification-loop/SKILL.md +89 -0
- package/.agent/skills/webapp-testing/SKILL.md +175 -0
- package/.agent/templates/adr-template.md +32 -0
- package/.agent/templates/bug-report.md +37 -0
- package/.agent/templates/feature-request.md +32 -0
- package/.agent/workflows/README.md +101 -0
- package/.agent/workflows/brainstorm.md +86 -0
- package/.agent/workflows/create.md +85 -0
- package/.agent/workflows/debug.md +83 -0
- package/.agent/workflows/deploy.md +114 -0
- package/.agent/workflows/enhance.md +85 -0
- package/.agent/workflows/orchestrate.md +106 -0
- package/.agent/workflows/plan.md +105 -0
- package/.agent/workflows/pr-fix.md +163 -0
- package/.agent/workflows/pr-merge.md +117 -0
- package/.agent/workflows/pr-review.md +178 -0
- package/.agent/workflows/pr-split.md +118 -0
- package/.agent/workflows/pr.md +184 -0
- package/.agent/workflows/preflight.md +107 -0
- package/.agent/workflows/preview.md +95 -0
- package/.agent/workflows/quality-gate.md +103 -0
- package/.agent/workflows/retrospective.md +100 -0
- package/.agent/workflows/review.md +104 -0
- package/.agent/workflows/status.md +89 -0
- package/.agent/workflows/test.md +98 -0
- package/.agent/workflows/ui-ux-pro-max.md +93 -0
- package/.agent/workflows/upgrade.md +97 -0
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/bin/kit.js +773 -0
- package/lib/agent-registry.js +228 -0
- package/lib/agent-reputation.js +343 -0
- package/lib/circuit-breaker.js +195 -0
- package/lib/cli-commands.js +322 -0
- package/lib/config-validator.js +274 -0
- package/lib/conflict-detector.js +252 -0
- package/lib/constants.js +47 -0
- package/lib/engineering-manager.js +336 -0
- package/lib/error-budget.js +370 -0
- package/lib/hook-system.js +256 -0
- package/lib/ide-generator.js +434 -0
- package/lib/identity.js +240 -0
- package/lib/io.js +146 -0
- package/lib/learning-engine.js +163 -0
- package/lib/loading-engine.js +421 -0
- package/lib/logger.js +118 -0
- package/lib/marketplace.js +321 -0
- package/lib/plugin-system.js +604 -0
- package/lib/plugin-verifier.js +197 -0
- package/lib/rate-limiter.js +113 -0
- package/lib/security-scanner.js +312 -0
- package/lib/self-healing.js +468 -0
- package/lib/session-manager.js +264 -0
- package/lib/skill-sandbox.js +244 -0
- package/lib/task-governance.js +522 -0
- package/lib/task-model.js +332 -0
- package/lib/updater.js +240 -0
- package/lib/verify.js +279 -0
- package/lib/workflow-engine.js +373 -0
- package/lib/workflow-events.js +166 -0
- package/lib/workflow-persistence.js +160 -0
- package/package.json +57 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: docker-patterns
|
|
3
|
+
description: Docker and containerization best practices
|
|
4
|
+
triggers: [context, docker, container, devops]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Docker Patterns Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply Docker best practices for containerization
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides patterns for building efficient, secure Docker images and orchestrating containers.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Dockerfile Best Practices
|
|
20
|
+
|
|
21
|
+
### Multi-Stage Build
|
|
22
|
+
|
|
23
|
+
```dockerfile
|
|
24
|
+
# Build stage
|
|
25
|
+
FROM node:20-alpine AS builder
|
|
26
|
+
WORKDIR /app
|
|
27
|
+
COPY package*.json ./
|
|
28
|
+
RUN npm ci
|
|
29
|
+
COPY . .
|
|
30
|
+
RUN npm run build
|
|
31
|
+
|
|
32
|
+
# Production stage
|
|
33
|
+
FROM node:20-alpine AS production
|
|
34
|
+
WORKDIR /app
|
|
35
|
+
COPY --from=builder /app/dist ./dist
|
|
36
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
37
|
+
COPY --from=builder /app/package.json ./
|
|
38
|
+
USER node
|
|
39
|
+
EXPOSE 3000
|
|
40
|
+
CMD ["node", "dist/main.js"]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Layer Optimization
|
|
44
|
+
|
|
45
|
+
```dockerfile
|
|
46
|
+
# ❌ Bad - cache invalidated on any file change
|
|
47
|
+
COPY . .
|
|
48
|
+
RUN npm install
|
|
49
|
+
|
|
50
|
+
# ✅ Good - dependencies cached separately
|
|
51
|
+
COPY package*.json ./
|
|
52
|
+
RUN npm ci
|
|
53
|
+
COPY . .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Security
|
|
59
|
+
|
|
60
|
+
### Non-Root User
|
|
61
|
+
|
|
62
|
+
```dockerfile
|
|
63
|
+
# Create non-root user
|
|
64
|
+
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
|
65
|
+
USER appuser
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Minimal Base Image
|
|
69
|
+
|
|
70
|
+
```dockerfile
|
|
71
|
+
# ✅ Use alpine variants
|
|
72
|
+
FROM node:20-alpine
|
|
73
|
+
|
|
74
|
+
# ✅ Or distroless
|
|
75
|
+
FROM gcr.io/distroless/nodejs20-debian12
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Docker Compose
|
|
81
|
+
|
|
82
|
+
### Development Setup
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
version: "3.8"
|
|
86
|
+
|
|
87
|
+
services:
|
|
88
|
+
app:
|
|
89
|
+
build:
|
|
90
|
+
context: .
|
|
91
|
+
target: development
|
|
92
|
+
volumes:
|
|
93
|
+
- .:/app
|
|
94
|
+
- /app/node_modules
|
|
95
|
+
ports:
|
|
96
|
+
- "3000:3000"
|
|
97
|
+
environment:
|
|
98
|
+
- NODE_ENV=development
|
|
99
|
+
depends_on:
|
|
100
|
+
- db
|
|
101
|
+
- redis
|
|
102
|
+
|
|
103
|
+
db:
|
|
104
|
+
image: postgres:16-alpine
|
|
105
|
+
volumes:
|
|
106
|
+
- postgres_data:/var/lib/postgresql/data
|
|
107
|
+
environment:
|
|
108
|
+
POSTGRES_USER: user
|
|
109
|
+
POSTGRES_PASSWORD: password
|
|
110
|
+
POSTGRES_DB: app_dev
|
|
111
|
+
ports:
|
|
112
|
+
- "5432:5432"
|
|
113
|
+
|
|
114
|
+
redis:
|
|
115
|
+
image: redis:7-alpine
|
|
116
|
+
ports:
|
|
117
|
+
- "6379:6379"
|
|
118
|
+
|
|
119
|
+
volumes:
|
|
120
|
+
postgres_data:
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Health Checks
|
|
126
|
+
|
|
127
|
+
```dockerfile
|
|
128
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
129
|
+
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## .dockerignore
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
node_modules
|
|
138
|
+
npm-debug.log
|
|
139
|
+
.git
|
|
140
|
+
.env
|
|
141
|
+
.env.*
|
|
142
|
+
dist
|
|
143
|
+
coverage
|
|
144
|
+
.DS_Store
|
|
145
|
+
*.md
|
|
146
|
+
!README.md
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Quick Reference
|
|
152
|
+
|
|
153
|
+
| Pattern | Purpose |
|
|
154
|
+
| :------------ | :---------------- |
|
|
155
|
+
| Multi-stage | Smaller images |
|
|
156
|
+
| Alpine base | Minimal footprint |
|
|
157
|
+
| Non-root user | Security |
|
|
158
|
+
| Layer caching | Faster builds |
|
|
159
|
+
| Health checks | Orchestration |
|
|
160
|
+
| .dockerignore | Exclude files |
|
|
161
|
+
| Compose | Local development |
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: eval-harness
|
|
3
|
+
description: Evaluation framework for measuring agent performance
|
|
4
|
+
triggers: [manual]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Eval Harness Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Measure and improve agent performance through structured evaluation
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides a framework for evaluating agent performance across key dimensions.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Evaluation Dimensions
|
|
20
|
+
|
|
21
|
+
### 1. Accuracy
|
|
22
|
+
|
|
23
|
+
- Did the solution work correctly?
|
|
24
|
+
- Were there any bugs introduced?
|
|
25
|
+
- Was the approach optimal?
|
|
26
|
+
|
|
27
|
+
### 2. Efficiency
|
|
28
|
+
|
|
29
|
+
- How many iterations were needed?
|
|
30
|
+
- Was context used efficiently?
|
|
31
|
+
- Were there unnecessary steps?
|
|
32
|
+
|
|
33
|
+
### 3. Alignment
|
|
34
|
+
|
|
35
|
+
- Were operating constraints followed?
|
|
36
|
+
- Were user preferences respected?
|
|
37
|
+
- Was the solution appropriate?
|
|
38
|
+
|
|
39
|
+
### 4. Quality
|
|
40
|
+
|
|
41
|
+
- Does code meet standards?
|
|
42
|
+
- Is it well-tested?
|
|
43
|
+
- Is it maintainable?
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Evaluation Metrics
|
|
48
|
+
|
|
49
|
+
| Metric | Target |
|
|
50
|
+
| :---------------------- | :----- |
|
|
51
|
+
| First-time success rate | >80% |
|
|
52
|
+
| Iterations to solution | <3 |
|
|
53
|
+
| Test coverage | >80% |
|
|
54
|
+
| Build success | 100% |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Report Format
|
|
59
|
+
|
|
60
|
+
```markdown
|
|
61
|
+
# Evaluation Report
|
|
62
|
+
|
|
63
|
+
## Session: [ID]
|
|
64
|
+
|
|
65
|
+
## Task: [Description]
|
|
66
|
+
|
|
67
|
+
### Metrics
|
|
68
|
+
|
|
69
|
+
| Dimension | Score | Notes |
|
|
70
|
+
| :--------- | :---- | :------------------ |
|
|
71
|
+
| Accuracy | 9/10 | Minor fix needed |
|
|
72
|
+
| Efficiency | 8/10 | 2 iterations |
|
|
73
|
+
| Alignment | 10/10 | All constraints met |
|
|
74
|
+
| Quality | 9/10 | Good coverage |
|
|
75
|
+
|
|
76
|
+
### Overall: 36/40 (90%)
|
|
77
|
+
|
|
78
|
+
### Learnings
|
|
79
|
+
|
|
80
|
+
- [What went well]
|
|
81
|
+
- [What could improve]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Integration
|
|
87
|
+
|
|
88
|
+
- Run at session end for learning
|
|
89
|
+
- Use for continuous improvement
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-patterns
|
|
3
|
+
description: Frontend development patterns for React and modern frameworks
|
|
4
|
+
triggers: [context, frontend, react, component, ui]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Frontend Patterns Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply modern frontend development patterns
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides best practices for building maintainable, performant frontend applications.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Component Architecture
|
|
20
|
+
|
|
21
|
+
### Atomic Design
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
atoms/ → Button, Input, Label
|
|
25
|
+
molecules/ → FormField, SearchInput
|
|
26
|
+
organisms/ → LoginForm, Header
|
|
27
|
+
templates/ → PageLayout, DashboardLayout
|
|
28
|
+
pages/ → LoginPage, DashboardPage
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Feature-Based Structure
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
src/
|
|
35
|
+
├── features/
|
|
36
|
+
│ ├── auth/
|
|
37
|
+
│ │ ├── components/
|
|
38
|
+
│ │ ├── hooks/
|
|
39
|
+
│ │ ├── api/
|
|
40
|
+
│ │ └── index.ts
|
|
41
|
+
│ └── dashboard/
|
|
42
|
+
│ ├── components/
|
|
43
|
+
│ ├── hooks/
|
|
44
|
+
│ └── index.ts
|
|
45
|
+
├── shared/
|
|
46
|
+
│ ├── components/
|
|
47
|
+
│ ├── hooks/
|
|
48
|
+
│ └── utils/
|
|
49
|
+
└── App.tsx
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## React Patterns
|
|
55
|
+
|
|
56
|
+
### Custom Hooks
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
function useLocalStorage<T>(key: string, initialValue: T) {
|
|
60
|
+
const [value, setValue] = useState<T>(() => {
|
|
61
|
+
const stored = localStorage.getItem(key);
|
|
62
|
+
return stored ? JSON.parse(stored) : initialValue;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
67
|
+
}, [key, value]);
|
|
68
|
+
|
|
69
|
+
return [value, setValue] as const;
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Compound Components
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<Select value={selected} onChange={setSelected}>
|
|
77
|
+
<Select.Trigger>Choose option</Select.Trigger>
|
|
78
|
+
<Select.Options>
|
|
79
|
+
<Select.Option value="a">Option A</Select.Option>
|
|
80
|
+
<Select.Option value="b">Option B</Select.Option>
|
|
81
|
+
</Select.Options>
|
|
82
|
+
</Select>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Render Props
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<DataFetcher url="/api/users">
|
|
89
|
+
{({ data, loading, error }) =>
|
|
90
|
+
loading ? <Spinner /> : <UserList users={data} />
|
|
91
|
+
}
|
|
92
|
+
</DataFetcher>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## State Management
|
|
98
|
+
|
|
99
|
+
| Solution | Use Case |
|
|
100
|
+
| :---------- | :-------------------- |
|
|
101
|
+
| useState | Local component state |
|
|
102
|
+
| useReducer | Complex local state |
|
|
103
|
+
| Context | Theme, auth, i18n |
|
|
104
|
+
| Zustand | Simple global state |
|
|
105
|
+
| Redux | Complex global state |
|
|
106
|
+
| React Query | Server state |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Performance
|
|
111
|
+
|
|
112
|
+
### Memoization
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// Expensive calculation
|
|
116
|
+
const sortedItems = useMemo(
|
|
117
|
+
() => items.sort((a, b) => a.name.localeCompare(b.name)),
|
|
118
|
+
[items],
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// Callback stability
|
|
122
|
+
const handleClick = useCallback(() => {
|
|
123
|
+
onClick(id);
|
|
124
|
+
}, [id, onClick]);
|
|
125
|
+
|
|
126
|
+
// Component memoization
|
|
127
|
+
const UserCard = memo(({ user }) => <div>{user.name}</div>);
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Quick Reference
|
|
133
|
+
|
|
134
|
+
| Pattern | Usage |
|
|
135
|
+
| :----------- | :--------------------- |
|
|
136
|
+
| Custom Hooks | Reusable logic |
|
|
137
|
+
| Compound | Flexible APIs |
|
|
138
|
+
| Render Props | Dynamic rendering |
|
|
139
|
+
| HOC | Cross-cutting concerns |
|
|
140
|
+
| Context | Global state |
|
|
141
|
+
| Memoization | Performance |
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow
|
|
3
|
+
description: Git workflow patterns and best practices
|
|
4
|
+
triggers: [context, git, commit, branch, pr]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Git Workflow Skill
|
|
8
|
+
|
|
9
|
+
> **Purpose**: Apply professional Git workflows and conventions
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
This skill provides Git workflow patterns for professional software development teams.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Branch Strategy
|
|
20
|
+
|
|
21
|
+
### GitFlow
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
main ──●────────────────●──────────●──→
|
|
25
|
+
↑ ↑
|
|
26
|
+
release ──●─┘ ●─┘
|
|
27
|
+
↑ ↑
|
|
28
|
+
develop ──●──●──●──●──●──●──●──●──●──→
|
|
29
|
+
↑ ↑
|
|
30
|
+
feature ───●─────●
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Trunk-Based
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
main ──●──●──●──●──●──●──●──●──→
|
|
37
|
+
↑ ↑
|
|
38
|
+
short ───● ● (< 1 day)
|
|
39
|
+
feature
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Branch Naming
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
feature/ABC-123-add-user-auth
|
|
48
|
+
bugfix/ABC-456-fix-login-error
|
|
49
|
+
hotfix/ABC-789-critical-security-patch
|
|
50
|
+
release/v1.2.0
|
|
51
|
+
chore/update-dependencies
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Conventional Commits
|
|
57
|
+
|
|
58
|
+
### Format
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
<type>(<scope>): <description>
|
|
62
|
+
|
|
63
|
+
[optional body]
|
|
64
|
+
|
|
65
|
+
[optional footer(s)]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Types
|
|
69
|
+
|
|
70
|
+
| Type | Usage |
|
|
71
|
+
| :--------- | :--------------- |
|
|
72
|
+
| `feat` | New feature |
|
|
73
|
+
| `fix` | Bug fix |
|
|
74
|
+
| `docs` | Documentation |
|
|
75
|
+
| `style` | Formatting |
|
|
76
|
+
| `refactor` | Code restructure |
|
|
77
|
+
| `test` | Adding tests |
|
|
78
|
+
| `chore` | Maintenance |
|
|
79
|
+
| `perf` | Performance |
|
|
80
|
+
| `ci` | CI/CD changes |
|
|
81
|
+
|
|
82
|
+
### Examples
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
feat(auth): add JWT refresh token support
|
|
86
|
+
|
|
87
|
+
fix(api): handle null user in profile endpoint
|
|
88
|
+
|
|
89
|
+
Closes #123
|
|
90
|
+
|
|
91
|
+
docs(readme): add installation instructions
|
|
92
|
+
|
|
93
|
+
chore(deps): update dependencies to latest versions
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Pull Request Template
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Description
|
|
102
|
+
|
|
103
|
+
Brief description of changes
|
|
104
|
+
|
|
105
|
+
## Type of Change
|
|
106
|
+
|
|
107
|
+
- [ ] Bug fix
|
|
108
|
+
- [ ] New feature
|
|
109
|
+
- [ ] Breaking change
|
|
110
|
+
- [ ] Documentation update
|
|
111
|
+
|
|
112
|
+
## Checklist
|
|
113
|
+
|
|
114
|
+
- [ ] Tests pass locally
|
|
115
|
+
- [ ] Code follows style guidelines
|
|
116
|
+
- [ ] Self-reviewed my code
|
|
117
|
+
- [ ] Added necessary documentation
|
|
118
|
+
- [ ] No new warnings
|
|
119
|
+
|
|
120
|
+
## Testing
|
|
121
|
+
|
|
122
|
+
How to test these changes
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Common Commands
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Create feature branch
|
|
131
|
+
git checkout -b feature/ABC-123-new-feature
|
|
132
|
+
|
|
133
|
+
# Stage and commit
|
|
134
|
+
git add -p # Interactive staging
|
|
135
|
+
git commit -m "feat: add..."
|
|
136
|
+
|
|
137
|
+
# Rebase on main
|
|
138
|
+
git fetch origin
|
|
139
|
+
git rebase origin/main
|
|
140
|
+
|
|
141
|
+
# Squash commits
|
|
142
|
+
git rebase -i HEAD~3
|
|
143
|
+
|
|
144
|
+
# Push feature branch
|
|
145
|
+
git push origin feature/ABC-123-new-feature
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Quick Reference
|
|
151
|
+
|
|
152
|
+
| Command | Usage |
|
|
153
|
+
| :---------------------- | :------------------- |
|
|
154
|
+
| `git log --oneline -10` | Recent commits |
|
|
155
|
+
| `git diff --staged` | Staged changes |
|
|
156
|
+
| `git stash` | Temporary storage |
|
|
157
|
+
| `git cherry-pick <sha>` | Pick specific commit |
|
|
158
|
+
| `git bisect` | Find bad commit |
|
|
159
|
+
| `git reflog` | Recovery tool |
|