skillstore-cli 1.0.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/README.md +95 -0
- package/data/bundles/devflow-complete.json +19 -0
- package/data/free-skills/devflow-agile/manifest.json +19 -0
- package/data/free-skills/devflow-agile/plugin/commands/agile/retro.md +23 -0
- package/data/free-skills/devflow-agile/plugin/commands/agile/review.md +21 -0
- package/data/free-skills/devflow-agile/plugin/commands/agile/sprint.md +30 -0
- package/data/free-skills/devflow-agile/plugin/commands/agile/standup.md +20 -0
- package/data/free-skills/devflow-agile/plugin/commands/agile.md +35 -0
- package/data/free-skills/devflow-agile/plugin/commands/devflow.md +42 -0
- package/data/free-skills/devflow-agile/plugin/skills/developer/SKILL.md +93 -0
- package/data/free-skills/devflow-agile/plugin/skills/developer/assets/sample-output.md +182 -0
- package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-architecture.md +361 -0
- package/data/free-skills/devflow-agile/plugin/skills/developer/references/clean-code-guide.md +207 -0
- package/data/free-skills/devflow-agile/plugin/skills/developer/references/debugging-methodology.md +191 -0
- package/data/free-skills/devflow-agile/template/agents/agile-coach.md +76 -0
- package/data/free-skills/devflow-agile/template/workflows/agile-sprint-workflow.md +81 -0
- package/data/free-skills/devflow-bootstrap/manifest.json +8 -0
- package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap/auto.md +31 -0
- package/data/free-skills/devflow-bootstrap/plugin/commands/bootstrap.md +38 -0
- package/data/free-skills/devflow-bootstrap/plugin/commands/devflow.md +20 -0
- package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/SKILL.md +56 -0
- package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/assets/sample-output.md +216 -0
- package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/architecture-decisions.md +254 -0
- package/data/free-skills/devflow-bootstrap/plugin/skills/project-scaffold/references/stack-templates.md +400 -0
- package/data/free-skills/devflow-bootstrap/template/agents/bootstrap-specialist.md +56 -0
- package/data/free-skills/devflow-bootstrap/template/workflows/bootstrap-workflow.md +70 -0
- package/data/free-skills/devflow-docs/manifest.json +8 -0
- package/data/free-skills/devflow-docs/plugin/commands/devflow.md +20 -0
- package/data/free-skills/devflow-docs/plugin/commands/docs/generate.md +17 -0
- package/data/free-skills/devflow-docs/plugin/commands/docs/parse.md +19 -0
- package/data/free-skills/devflow-docs/plugin/commands/docs.md +26 -0
- package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/SKILL.md +59 -0
- package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/assets/sample-output.md +114 -0
- package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/extraction-techniques.md +115 -0
- package/data/free-skills/devflow-docs/plugin/skills/pdf-processor/references/ocr-strategies.md +167 -0
- package/data/free-skills/devflow-docs/template/agents/docs-specialist.md +35 -0
- package/data/free-skills/devflow-docs/template/workflows/docs-workflow.md +70 -0
- package/data/free-skills/devflow-postproject/manifest.json +13 -0
- package/data/free-skills/devflow-postproject/plugin/commands/devflow.md +34 -0
- package/data/free-skills/devflow-postproject/plugin/commands/postproject/handover.md +21 -0
- package/data/free-skills/devflow-postproject/plugin/commands/postproject/retro.md +21 -0
- package/data/free-skills/devflow-postproject/plugin/commands/postproject/support.md +21 -0
- package/data/free-skills/devflow-postproject/plugin/commands/postproject.md +32 -0
- package/data/free-skills/devflow-postproject/plugin/skills/retrospective/SKILL.md +70 -0
- package/data/free-skills/devflow-postproject/plugin/skills/retrospective/assets/sample-output.md +79 -0
- package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/facilitation-techniques.md +178 -0
- package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/lessons-learned-template.md +118 -0
- package/data/free-skills/devflow-postproject/plugin/skills/retrospective/references/retro-techniques.md +100 -0
- package/data/free-skills/devflow-postproject/template/agents/transition-manager.md +71 -0
- package/data/free-skills/devflow-postproject/template/workflows/transition-workflow.md +72 -0
- package/data/free-skills/devflow-presale/manifest.json +15 -0
- package/data/free-skills/devflow-presale/plugin/commands/devflow.md +47 -0
- package/data/free-skills/devflow-presale/plugin/commands/presale/analyze.md +30 -0
- package/data/free-skills/devflow-presale/plugin/commands/presale/estimate.md +30 -0
- package/data/free-skills/devflow-presale/plugin/commands/presale/price.md +30 -0
- package/data/free-skills/devflow-presale/plugin/commands/presale/propose.md +30 -0
- package/data/free-skills/devflow-presale/plugin/commands/presale.md +42 -0
- package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/SKILL.md +63 -0
- package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/assets/sample-output.md +129 -0
- package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/extraction-framework.md +140 -0
- package/data/free-skills/devflow-presale/plugin/skills/requirement-analysis/references/output-template.md +132 -0
- package/data/free-skills/devflow-presale/template/agents/presale-lead.md +83 -0
- package/data/free-skills/devflow-presale/template/agents/proposal-reviewer.md +63 -0
- package/data/free-skills/devflow-presale/template/workflows/presale-workflow.md +70 -0
- package/data/registry/categories.json +7 -0
- package/data/registry/packages.json +184 -0
- package/data/shared/framework/agents/brainstormer.md +74 -0
- package/data/shared/framework/agents/code-reviewer.md +87 -0
- package/data/shared/framework/agents/debugger.md +84 -0
- package/data/shared/framework/agents/docs-manager.md +55 -0
- package/data/shared/framework/agents/git-manager.md +59 -0
- package/data/shared/framework/agents/planner.md +68 -0
- package/data/shared/framework/agents/researcher.md +66 -0
- package/data/shared/framework/agents/tester.md +65 -0
- package/data/shared/framework/commands/cook/auto.md +27 -0
- package/data/shared/framework/commands/cook.md +45 -0
- package/data/shared/framework/commands/fix/ci.md +21 -0
- package/data/shared/framework/commands/fix/test.md +26 -0
- package/data/shared/framework/commands/fix/types.md +29 -0
- package/data/shared/framework/commands/fix.md +26 -0
- package/data/shared/framework/commands/git/cm.md +37 -0
- package/data/shared/framework/commands/git/pr.md +40 -0
- package/data/shared/framework/config/CLAUDE.md.template +26 -0
- package/data/shared/framework/config/settings.json +41 -0
- package/data/shared/framework/config/skillstore.config.json +29 -0
- package/data/shared/framework/hooks/discord-notify.sh +85 -0
- package/data/shared/framework/hooks/docs-sync.sh +53 -0
- package/data/shared/framework/hooks/modularization-hook.js +103 -0
- package/data/shared/framework/hooks/notification.js +94 -0
- package/data/shared/framework/hooks/quality-gate.js +109 -0
- package/data/shared/framework/hooks/scout-block.js +77 -0
- package/data/shared/framework/hooks/telegram-notify.sh +77 -0
- package/data/shared/framework/protocols/error-recovery.md +80 -0
- package/data/shared/framework/protocols/orchestration-protocol.md +112 -0
- package/data/shared/framework/quality/review-protocol.md +76 -0
- package/data/shared/framework/quality/verification-protocol.md +66 -0
- package/data/shared/framework/rules/development-rules.md +75 -0
- package/data/shared/framework/skills/backend-development/SKILL.md +77 -0
- package/data/shared/framework/skills/backend-development/assets/sample-output.md +175 -0
- package/data/shared/framework/skills/backend-development/references/advanced-patterns.md +180 -0
- package/data/shared/framework/skills/backend-development/references/api-design-guide.md +160 -0
- package/data/shared/framework/skills/backend-development/references/architecture-patterns.md +183 -0
- package/data/shared/framework/skills/backend-development/references/observability-resilience.md +155 -0
- package/data/shared/framework/skills/backend-development/references/troubleshooting.md +199 -0
- package/data/shared/framework/skills/codebase-analysis/SKILL.md +72 -0
- package/data/shared/framework/skills/codebase-analysis/assets/sample-output.md +263 -0
- package/data/shared/framework/skills/codebase-analysis/references/analysis-techniques.md +241 -0
- package/data/shared/framework/skills/codebase-analysis/references/dependency-mapping.md +280 -0
- package/data/shared/framework/skills/codebase-analysis/references/tech-debt-assessment.md +208 -0
- package/data/shared/framework/skills/databases/SKILL.md +72 -0
- package/data/shared/framework/skills/databases/assets/sample-output.md +212 -0
- package/data/shared/framework/skills/databases/references/advanced-data-patterns.md +259 -0
- package/data/shared/framework/skills/databases/references/query-optimization.md +214 -0
- package/data/shared/framework/skills/databases/references/schema-design.md +159 -0
- package/data/shared/framework/skills/databases/references/troubleshooting.md +214 -0
- package/data/shared/framework/skills/debugging-investigation/SKILL.md +84 -0
- package/data/shared/framework/skills/debugging-investigation/assets/sample-output.md +314 -0
- package/data/shared/framework/skills/debugging-investigation/references/systematic-debugging.md +197 -0
- package/data/shared/framework/skills/debugging-investigation/references/tool-specific-guides.md +202 -0
- package/data/shared/framework/skills/debugging-investigation/references/troubleshooting-patterns.md +196 -0
- package/data/shared/framework/skills/frontend-development/SKILL.md +67 -0
- package/data/shared/framework/skills/frontend-development/assets/sample-output.md +110 -0
- package/data/shared/framework/skills/frontend-development/references/component-patterns.md +112 -0
- package/data/shared/framework/skills/frontend-development/references/performance-guide.md +169 -0
- package/data/shared/framework/skills/frontend-development/references/routing-forms-realtime.md +374 -0
- package/data/shared/framework/skills/frontend-development/references/ssr-rsc-patterns.md +284 -0
- package/data/shared/framework/skills/frontend-development/references/troubleshooting.md +154 -0
- package/data/shared/framework/skills/mobile-development/SKILL.md +67 -0
- package/data/shared/framework/skills/mobile-development/assets/sample-output.md +382 -0
- package/data/shared/framework/skills/mobile-development/references/mobile-patterns.md +681 -0
- package/data/shared/framework/skills/mobile-development/references/mobile-performance.md +524 -0
- package/data/shared/framework/skills/mobile-development/references/troubleshooting.md +158 -0
- package/data/shared/framework/skills/security-audit/SKILL.md +83 -0
- package/data/shared/framework/skills/security-audit/assets/sample-output.md +451 -0
- package/data/shared/framework/skills/security-audit/references/owasp-checklist.md +580 -0
- package/data/shared/framework/skills/security-audit/references/secure-coding-patterns.md +433 -0
- package/data/shared/framework/skills/security-audit/references/vulnerability-remediation.md +331 -0
- package/data/shared/framework/skills/ui-generation/SKILL.md +70 -0
- package/data/shared/framework/skills/ui-generation/assets/sample-output.md +139 -0
- package/data/shared/framework/skills/ui-generation/references/accessibility-responsive.md +127 -0
- package/data/shared/framework/skills/ui-generation/references/compound-components.md +252 -0
- package/data/shared/framework/skills/ui-generation/references/generation-patterns.md +110 -0
- package/data/shared/framework/skills/ui-generation/references/storybook-design-system.md +278 -0
- package/data/shared/framework/skills/ui-generation/references/troubleshooting.md +198 -0
- package/data/shared/framework/workflows/documentation-management.md +58 -0
- package/data/shared/framework/workflows/primary-workflow.md +88 -0
- package/dist/commands/activate.d.ts +3 -0
- package/dist/commands/activate.d.ts.map +1 -0
- package/dist/commands/activate.js +34 -0
- package/dist/commands/activate.js.map +1 -0
- package/dist/commands/bundle.d.ts +3 -0
- package/dist/commands/bundle.d.ts.map +1 -0
- package/dist/commands/bundle.js +64 -0
- package/dist/commands/bundle.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +99 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +37 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +30 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +35 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +68 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/download/cache.d.ts +3 -0
- package/dist/download/cache.d.ts.map +1 -0
- package/dist/download/cache.js +18 -0
- package/dist/download/cache.js.map +1 -0
- package/dist/download/client.d.ts +2 -0
- package/dist/download/client.d.ts.map +1 -0
- package/dist/download/client.js +58 -0
- package/dist/download/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/installer/file-copier.d.ts +6 -0
- package/dist/installer/file-copier.d.ts.map +1 -0
- package/dist/installer/file-copier.js +32 -0
- package/dist/installer/file-copier.js.map +1 -0
- package/dist/installer/plugin-installer.d.ts +12 -0
- package/dist/installer/plugin-installer.d.ts.map +1 -0
- package/dist/installer/plugin-installer.js +33 -0
- package/dist/installer/plugin-installer.js.map +1 -0
- package/dist/installer/template-installer.d.ts +12 -0
- package/dist/installer/template-installer.d.ts.map +1 -0
- package/dist/installer/template-installer.js +45 -0
- package/dist/installer/template-installer.js.map +1 -0
- package/dist/license/crypto.d.ts +16 -0
- package/dist/license/crypto.d.ts.map +1 -0
- package/dist/license/crypto.js +50 -0
- package/dist/license/crypto.js.map +1 -0
- package/dist/license/license-store.d.ts +19 -0
- package/dist/license/license-store.d.ts.map +1 -0
- package/dist/license/license-store.js +99 -0
- package/dist/license/license-store.js.map +1 -0
- package/dist/license/validator.d.ts +32 -0
- package/dist/license/validator.d.ts.map +1 -0
- package/dist/license/validator.js +81 -0
- package/dist/license/validator.js.map +1 -0
- package/dist/registry/loader.d.ts +30 -0
- package/dist/registry/loader.d.ts.map +1 -0
- package/dist/registry/loader.js +22 -0
- package/dist/registry/loader.js.map +1 -0
- package/dist/registry/search-engine.d.ts +9 -0
- package/dist/registry/search-engine.d.ts.map +1 -0
- package/dist/registry/search-engine.js +30 -0
- package/dist/registry/search-engine.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +28 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/logger.d.ts +9 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +22 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/paths.d.ts +20 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +79 -0
- package/dist/utils/paths.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
# Vulnerability Remediation
|
|
2
|
+
|
|
3
|
+
Tools, processes, and standards for identifying, prioritizing, and remediating security vulnerabilities across the development lifecycle.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Dependency Scanning Pipeline
|
|
8
|
+
|
|
9
|
+
### npm audit (Node.js)
|
|
10
|
+
```bash
|
|
11
|
+
# Check for known vulnerabilities
|
|
12
|
+
npm audit
|
|
13
|
+
|
|
14
|
+
# Only fail on high/critical (CI-friendly)
|
|
15
|
+
npm audit --audit-level=high
|
|
16
|
+
|
|
17
|
+
# Auto-fix where possible
|
|
18
|
+
npm audit fix
|
|
19
|
+
|
|
20
|
+
# Force major version updates (review carefully)
|
|
21
|
+
npm audit fix --force
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Snyk
|
|
25
|
+
```bash
|
|
26
|
+
# Test project dependencies
|
|
27
|
+
snyk test --severity-threshold=high
|
|
28
|
+
|
|
29
|
+
# Monitor for new vulnerabilities (ongoing)
|
|
30
|
+
snyk monitor
|
|
31
|
+
|
|
32
|
+
# Test container image
|
|
33
|
+
snyk container test node:20-alpine
|
|
34
|
+
|
|
35
|
+
# Generate SBOM
|
|
36
|
+
snyk sbom --format=cyclonedx1.4+json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Trivy (Container Images & Filesystem)
|
|
40
|
+
```bash
|
|
41
|
+
# Scan container image
|
|
42
|
+
trivy image --severity HIGH,CRITICAL myapp:latest
|
|
43
|
+
|
|
44
|
+
# Scan project filesystem
|
|
45
|
+
trivy fs --severity HIGH,CRITICAL .
|
|
46
|
+
|
|
47
|
+
# Scan IaC (Terraform, CloudFormation)
|
|
48
|
+
trivy config --severity HIGH,CRITICAL ./infrastructure/
|
|
49
|
+
|
|
50
|
+
# Output as JSON for CI integration
|
|
51
|
+
trivy image --format json --output results.json myapp:latest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### OWASP Dependency-Check
|
|
55
|
+
```bash
|
|
56
|
+
# Scan project (Java, .NET, Node.js, Python, Ruby)
|
|
57
|
+
dependency-check --project "MyApp" --scan ./src --format JSON --out ./reports
|
|
58
|
+
|
|
59
|
+
# Fail build on CVSS >= 7
|
|
60
|
+
dependency-check --project "MyApp" --scan ./src --failOnCVSS 7
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Static Application Security Testing (SAST)
|
|
66
|
+
|
|
67
|
+
### Semgrep
|
|
68
|
+
```bash
|
|
69
|
+
# Run default security rules
|
|
70
|
+
semgrep --config=auto .
|
|
71
|
+
|
|
72
|
+
# Run OWASP Top 10 ruleset
|
|
73
|
+
semgrep --config=p/owasp-top-ten .
|
|
74
|
+
|
|
75
|
+
# CI mode — output SARIF for GitHub Security tab
|
|
76
|
+
semgrep --config=auto --sarif --output=semgrep.sarif .
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Custom Semgrep Rule Example
|
|
80
|
+
```yaml
|
|
81
|
+
# .semgrep/custom-rules.yml
|
|
82
|
+
rules:
|
|
83
|
+
- id: no-hardcoded-secrets
|
|
84
|
+
patterns:
|
|
85
|
+
- pattern-either:
|
|
86
|
+
- pattern: |
|
|
87
|
+
const $KEY = "sk_live_..."
|
|
88
|
+
- pattern: |
|
|
89
|
+
const $KEY = "AKIA..."
|
|
90
|
+
- pattern: |
|
|
91
|
+
password = "..."
|
|
92
|
+
message: "Hardcoded secret detected. Use environment variables or a secrets manager."
|
|
93
|
+
severity: ERROR
|
|
94
|
+
languages: [javascript, typescript, python]
|
|
95
|
+
|
|
96
|
+
- id: no-sql-string-concat
|
|
97
|
+
patterns:
|
|
98
|
+
- pattern: |
|
|
99
|
+
$DB.query(`... ${$USER_INPUT} ...`)
|
|
100
|
+
- pattern: |
|
|
101
|
+
$DB.query("..." + $USER_INPUT + "...")
|
|
102
|
+
message: "SQL query with string concatenation. Use parameterized queries."
|
|
103
|
+
severity: ERROR
|
|
104
|
+
languages: [javascript, typescript]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### CodeQL
|
|
108
|
+
```yaml
|
|
109
|
+
# .github/workflows/codeql.yml
|
|
110
|
+
name: CodeQL Analysis
|
|
111
|
+
on:
|
|
112
|
+
push:
|
|
113
|
+
branches: [main]
|
|
114
|
+
pull_request:
|
|
115
|
+
branches: [main]
|
|
116
|
+
|
|
117
|
+
jobs:
|
|
118
|
+
analyze:
|
|
119
|
+
runs-on: ubuntu-latest
|
|
120
|
+
permissions:
|
|
121
|
+
security-events: write
|
|
122
|
+
steps:
|
|
123
|
+
- uses: actions/checkout@v4
|
|
124
|
+
- uses: github/codeql-action/init@v3
|
|
125
|
+
with:
|
|
126
|
+
languages: javascript
|
|
127
|
+
queries: security-extended
|
|
128
|
+
- uses: github/codeql-action/analyze@v3
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### SonarQube
|
|
132
|
+
- Integrates SAST + code quality in one platform
|
|
133
|
+
- Security hotspots require manual triage (potential issues that need human review)
|
|
134
|
+
- Quality gates: block merge if new security hotspots or vulnerabilities introduced
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Dynamic Application Security Testing (DAST)
|
|
139
|
+
|
|
140
|
+
### OWASP ZAP (Automated)
|
|
141
|
+
```bash
|
|
142
|
+
# Quick baseline scan
|
|
143
|
+
docker run --rm owasp/zap2docker-stable zap-baseline.py -t https://staging.example.com
|
|
144
|
+
|
|
145
|
+
# Full active scan (aggressive — only run against test environments)
|
|
146
|
+
docker run --rm owasp/zap2docker-stable zap-full-scan.py -t https://staging.example.com
|
|
147
|
+
|
|
148
|
+
# API scan with OpenAPI spec
|
|
149
|
+
docker run --rm -v $(pwd):/zap/wrk owasp/zap2docker-stable zap-api-scan.py \
|
|
150
|
+
-t https://staging.example.com/api/openapi.json -f openapi
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Burp Suite (Manual Penetration Testing)
|
|
154
|
+
- Use for pre-pentest preparation: identify attack surface, test complex auth flows
|
|
155
|
+
- Key features: Repeater (manual request crafting), Intruder (fuzzing), Scanner (automated)
|
|
156
|
+
- Export findings in HTML/XML format for inclusion in audit reports
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## CVSS v3.1 Scoring
|
|
161
|
+
|
|
162
|
+
### How to Read CVSS Scores
|
|
163
|
+
|
|
164
|
+
| Severity | Score Range | Example |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| **Critical** | 9.0 – 10.0 | Remote code execution, unauthenticated SQL injection |
|
|
167
|
+
| **High** | 7.0 – 8.9 | XSS with session hijack, IDOR on sensitive data |
|
|
168
|
+
| **Medium** | 4.0 – 6.9 | CSRF on non-critical action, verbose error messages |
|
|
169
|
+
| **Low** | 0.1 – 3.9 | Missing security headers, information disclosure (non-sensitive) |
|
|
170
|
+
| **None** | 0.0 | Informational finding, best practice suggestion |
|
|
171
|
+
|
|
172
|
+
### CVSS Vector Breakdown
|
|
173
|
+
```
|
|
174
|
+
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H = 9.8 (Critical)
|
|
175
|
+
|
|
176
|
+
AV (Attack Vector): N=Network, A=Adjacent, L=Local, P=Physical
|
|
177
|
+
AC (Attack Complexity): L=Low, H=High
|
|
178
|
+
PR (Privileges Required): N=None, L=Low, H=High
|
|
179
|
+
UI (User Interaction): N=None, R=Required
|
|
180
|
+
S (Scope): U=Unchanged, C=Changed
|
|
181
|
+
C (Confidentiality): N=None, L=Low, H=High
|
|
182
|
+
I (Integrity): N=None, L=Low, H=High
|
|
183
|
+
A (Availability): N=None, L=Low, H=High
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Prioritization Strategy
|
|
187
|
+
1. **CVSS score** determines severity band
|
|
188
|
+
2. **Exploitability** determines urgency within band (is there a known exploit? is it actively exploited?)
|
|
189
|
+
3. **Business context** adjusts priority (customer-facing vs internal, PII involved, compliance scope)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Remediation SLA by Severity
|
|
194
|
+
|
|
195
|
+
| Severity | SLA | Escalation |
|
|
196
|
+
|---|---|---|
|
|
197
|
+
| **Critical** (9.0-10.0) | Fix within 24 hours | Immediate page to on-call; hotfix deployment |
|
|
198
|
+
| **High** (7.0-8.9) | Fix within 7 days | Engineering lead notified; scheduled in current sprint |
|
|
199
|
+
| **Medium** (4.0-6.9) | Fix within 30 days | Added to backlog; prioritized in upcoming sprint |
|
|
200
|
+
| **Low** (0.1-3.9) | Fix within 90 days | Added to backlog; addressed opportunistically |
|
|
201
|
+
|
|
202
|
+
### SLA Exceptions
|
|
203
|
+
- If a Critical/High cannot be fixed within SLA, a documented risk acceptance must be approved by security lead and engineering director
|
|
204
|
+
- Compensating controls (WAF rules, network restrictions) can extend SLA but not replace the fix
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Vulnerability Disclosure Process
|
|
209
|
+
|
|
210
|
+
1. **Internal Triage** (Day 0): Security team validates finding, assigns CVSS score, determines affected versions
|
|
211
|
+
2. **Fix Development** (Day 1-7): Patch developed, reviewed, and tested in isolation
|
|
212
|
+
3. **CVE Assignment**: Request CVE ID from CNA (MITRE or relevant authority) if applicable
|
|
213
|
+
4. **Coordinated Disclosure**: Notify affected parties 30 days before public disclosure (if external dependency)
|
|
214
|
+
5. **Patch Release**: Deploy fix, publish security advisory, notify users
|
|
215
|
+
6. **Post-Disclosure**: Monitor for exploitation, update detection rules
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Security Incident Response Checklist
|
|
220
|
+
|
|
221
|
+
### Phase 1: Contain
|
|
222
|
+
- [ ] Isolate affected systems (network segmentation, disable compromised credentials)
|
|
223
|
+
- [ ] Preserve evidence (logs, memory dumps, disk images) before remediation
|
|
224
|
+
- [ ] Activate incident response team; assign incident commander
|
|
225
|
+
|
|
226
|
+
### Phase 2: Investigate
|
|
227
|
+
- [ ] Determine attack vector and scope of compromise
|
|
228
|
+
- [ ] Identify affected data and users
|
|
229
|
+
- [ ] Timeline reconstruction from logs
|
|
230
|
+
- [ ] Determine if attacker still has access
|
|
231
|
+
|
|
232
|
+
### Phase 3: Remediate
|
|
233
|
+
- [ ] Patch vulnerability that was exploited
|
|
234
|
+
- [ ] Rotate all potentially compromised credentials
|
|
235
|
+
- [ ] Review and harden related systems
|
|
236
|
+
- [ ] Verify remediation through re-testing
|
|
237
|
+
|
|
238
|
+
### Phase 4: Communicate
|
|
239
|
+
- [ ] Notify affected users per regulatory requirements (GDPR: 72h, HIPAA: 60 days)
|
|
240
|
+
- [ ] File regulatory notifications if required
|
|
241
|
+
- [ ] Update status page and customer communications
|
|
242
|
+
|
|
243
|
+
### Phase 5: Postmortem
|
|
244
|
+
- [ ] Blameless incident review within 5 business days
|
|
245
|
+
- [ ] Document root cause, timeline, and remediation steps
|
|
246
|
+
- [ ] Identify systemic improvements (detection, prevention, response)
|
|
247
|
+
- [ ] Track action items to completion
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Security Testing in CI/CD
|
|
252
|
+
|
|
253
|
+
### Pipeline Integration Points
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
┌─────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
257
|
+
│ Pre-Commit │ → │ PR Check │ → │ Build/Test │ → │ Deploy Gate │
|
|
258
|
+
│ │ │ │ │ │ │ │
|
|
259
|
+
│ detect-secrets│ │ Semgrep SAST │ │ npm audit │ │ Trivy image │
|
|
260
|
+
│ gitleaks │ │ CodeQL │ │ Unit tests │ │ DAST (staging)│
|
|
261
|
+
│ eslint-security│ │ License check │ │ Snyk test │ │ Smoke tests │
|
|
262
|
+
└─────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Pre-Commit Hooks
|
|
266
|
+
```yaml
|
|
267
|
+
# .pre-commit-config.yaml
|
|
268
|
+
repos:
|
|
269
|
+
- repo: https://github.com/Yelp/detect-secrets
|
|
270
|
+
rev: v1.4.0
|
|
271
|
+
hooks:
|
|
272
|
+
- id: detect-secrets
|
|
273
|
+
args: ['--baseline', '.secrets.baseline']
|
|
274
|
+
|
|
275
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
276
|
+
rev: v8.18.0
|
|
277
|
+
hooks:
|
|
278
|
+
- id: gitleaks
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Deploy Gate Example
|
|
282
|
+
```yaml
|
|
283
|
+
# Block deployment if critical vulnerabilities found in container image
|
|
284
|
+
- name: Trivy Container Scan
|
|
285
|
+
uses: aquasecurity/trivy-action@master
|
|
286
|
+
with:
|
|
287
|
+
image-ref: '${{ env.IMAGE_TAG }}'
|
|
288
|
+
severity: 'CRITICAL'
|
|
289
|
+
exit-code: '1'
|
|
290
|
+
format: 'sarif'
|
|
291
|
+
output: 'trivy-results.sarif'
|
|
292
|
+
|
|
293
|
+
- name: Upload Trivy results
|
|
294
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
295
|
+
with:
|
|
296
|
+
sarif_file: 'trivy-results.sarif'
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Compliance Mapping
|
|
302
|
+
|
|
303
|
+
### SOC 2 Trust Service Criteria → Code Practices
|
|
304
|
+
|
|
305
|
+
| Control | Code Practice |
|
|
306
|
+
|---|---|
|
|
307
|
+
| CC6.1 — Logical access security | RBAC middleware, authentication on all endpoints |
|
|
308
|
+
| CC6.3 — Role-based access | Authorization checks, principle of least privilege |
|
|
309
|
+
| CC6.6 — Security for external threats | WAF, rate limiting, input validation |
|
|
310
|
+
| CC7.2 — Monitoring | Security event logging, anomaly alerting |
|
|
311
|
+
| CC8.1 — Change management | PR reviews, CI/CD gates, deployment approvals |
|
|
312
|
+
|
|
313
|
+
### HIPAA Technical Safeguards → Code Practices
|
|
314
|
+
|
|
315
|
+
| Safeguard | Code Practice |
|
|
316
|
+
|---|---|
|
|
317
|
+
| Access Control (§164.312(a)) | Role-based access, session management, automatic logout |
|
|
318
|
+
| Audit Controls (§164.312(b)) | Comprehensive audit logging, tamper-evident log storage |
|
|
319
|
+
| Integrity Controls (§164.312(c)) | Input validation, checksums, digital signatures |
|
|
320
|
+
| Transmission Security (§164.312(e)) | TLS 1.2+, certificate pinning, encrypted API communication |
|
|
321
|
+
|
|
322
|
+
### PCI-DSS v4.0 Requirements → Code Practices
|
|
323
|
+
|
|
324
|
+
| Requirement | Code Practice |
|
|
325
|
+
|---|---|
|
|
326
|
+
| Req 2 — Secure configurations | Security hardening checklist, no default credentials |
|
|
327
|
+
| Req 3 — Protect stored data | Encryption at rest (AES-256), tokenization for card data |
|
|
328
|
+
| Req 6 — Secure development | SAST in CI, code review, security training |
|
|
329
|
+
| Req 8 — Strong authentication | MFA, strong passwords, session timeout |
|
|
330
|
+
| Req 10 — Logging and monitoring | Audit trail for all access to cardholder data |
|
|
331
|
+
| Req 11 — Security testing | Quarterly vulnerability scans, annual penetration test |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ui-generation
|
|
3
|
+
description: Generate production-quality UI components from descriptions, wireframes, or screenshots — React, Vue, HTML/CSS with accessibility and responsive design
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# UI Generation
|
|
7
|
+
|
|
8
|
+
## Triggers
|
|
9
|
+
|
|
10
|
+
Activate this skill when:
|
|
11
|
+
- Creating UI components from text descriptions or mockups
|
|
12
|
+
- Converting wireframes or screenshots into code
|
|
13
|
+
- Building responsive layouts from design specs
|
|
14
|
+
- Generating accessible, design-system-aligned components
|
|
15
|
+
- Prototyping UI quickly for stakeholder review
|
|
16
|
+
- Building compound components (Tabs, Accordion, Select) with shared state
|
|
17
|
+
- Setting up or extending a design system with tokens and theming
|
|
18
|
+
- Configuring Storybook for component documentation or visual testing
|
|
19
|
+
- Creating component variant matrices or interaction tests
|
|
20
|
+
|
|
21
|
+
## Process
|
|
22
|
+
|
|
23
|
+
### 1. Input Analysis
|
|
24
|
+
- Parse description for component type (form, card, table, dashboard, nav, modal)
|
|
25
|
+
- Identify framework target: React (JSX + Tailwind), Vue (SFC), or HTML/CSS
|
|
26
|
+
- Extract design constraints: colors, spacing, typography, breakpoints
|
|
27
|
+
- Detect design system tokens if project has one (check for tailwind.config, theme files)
|
|
28
|
+
|
|
29
|
+
### 2. Component Architecture
|
|
30
|
+
Load: `references/generation-patterns.md`
|
|
31
|
+
|
|
32
|
+
- Determine component granularity (single component vs. composition)
|
|
33
|
+
- Define props/slots interface for reusability
|
|
34
|
+
- Plan state requirements (controlled vs uncontrolled, form state)
|
|
35
|
+
- Identify shared subcomponents (Button, Input, Badge, etc.)
|
|
36
|
+
|
|
37
|
+
### 3. Generation
|
|
38
|
+
- Generate semantic HTML structure first
|
|
39
|
+
- Apply styling with project's approach (Tailwind, CSS Modules, styled-components)
|
|
40
|
+
- Add responsive breakpoints (mobile-first: 640px, 768px, 1024px, 1280px)
|
|
41
|
+
- Wire up interactions (hover, focus, active states)
|
|
42
|
+
- Include loading, empty, and error states
|
|
43
|
+
|
|
44
|
+
### 4. Accessibility & Responsiveness
|
|
45
|
+
Load: `references/accessibility-responsive.md`
|
|
46
|
+
|
|
47
|
+
- Enforce WCAG 2.1 AA compliance
|
|
48
|
+
- Add semantic landmarks and ARIA attributes
|
|
49
|
+
- Ensure keyboard navigation (Tab, Enter, Escape, Arrow keys)
|
|
50
|
+
- Verify color contrast ratios (4.5:1 text, 3:1 large text/UI)
|
|
51
|
+
- Set touch targets minimum 44×44px
|
|
52
|
+
- Test layout at all breakpoints
|
|
53
|
+
|
|
54
|
+
### 5. Output & Verification
|
|
55
|
+
- Present generated code with inline comments for key decisions
|
|
56
|
+
- List accessibility features included
|
|
57
|
+
- Note any assumptions made about design intent
|
|
58
|
+
- Suggest variants or improvements if applicable
|
|
59
|
+
|
|
60
|
+
## References
|
|
61
|
+
|
|
62
|
+
- [Generation Patterns](references/generation-patterns.md) — description parsing, component mapping, design tokens, state design
|
|
63
|
+
- [Accessibility & Responsive](references/accessibility-responsive.md) — WCAG 2.1 AA, ARIA patterns, keyboard nav, responsive strategies
|
|
64
|
+
- [Compound Components](references/compound-components.md) — compound pattern, headless UI libs, slot composition, design tokens
|
|
65
|
+
- [Storybook & Design System](references/storybook-design-system.md) — CSF3, Chromatic visual testing, play functions, a11y addon
|
|
66
|
+
- [Troubleshooting](references/troubleshooting.md) — design mismatch, WCAG failures, responsive issues, dark mode, cross-browser, z-index
|
|
67
|
+
|
|
68
|
+
## Assets
|
|
69
|
+
|
|
70
|
+
- [Sample Output](assets/sample-output.md) — dashboard card component in React + Tailwind
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Sample Output: Dashboard Stats Card — React + Tailwind
|
|
2
|
+
|
|
3
|
+
## Input Description
|
|
4
|
+
"Create a stats card component showing a metric with label, value, trend indicator (up/down), and sparkline chart area. Should work in a dashboard grid."
|
|
5
|
+
|
|
6
|
+
## Generated Component
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
interface StatsCardProps {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string | number;
|
|
12
|
+
trend: {
|
|
13
|
+
direction: 'up' | 'down' | 'neutral';
|
|
14
|
+
percentage: number;
|
|
15
|
+
};
|
|
16
|
+
sparklineData?: number[];
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function StatsCard({ label, value, trend, sparklineData, loading = false }: StatsCardProps) {
|
|
21
|
+
if (loading) {
|
|
22
|
+
return (
|
|
23
|
+
<div className="rounded-xl border border-gray-200 bg-white p-6 animate-pulse dark:border-gray-700 dark:bg-gray-800">
|
|
24
|
+
<div className="h-4 w-24 rounded bg-gray-200 dark:bg-gray-700" />
|
|
25
|
+
<div className="mt-3 h-8 w-32 rounded bg-gray-200 dark:bg-gray-700" />
|
|
26
|
+
<div className="mt-4 h-12 w-full rounded bg-gray-200 dark:bg-gray-700" />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const trendColor = {
|
|
32
|
+
up: 'text-emerald-600 dark:text-emerald-400',
|
|
33
|
+
down: 'text-red-600 dark:text-red-400',
|
|
34
|
+
neutral: 'text-gray-500 dark:text-gray-400',
|
|
35
|
+
}[trend.direction];
|
|
36
|
+
|
|
37
|
+
const trendIcon = {
|
|
38
|
+
up: '↑',
|
|
39
|
+
down: '↓',
|
|
40
|
+
neutral: '→',
|
|
41
|
+
}[trend.direction];
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<article
|
|
45
|
+
className="rounded-xl border border-gray-200 bg-white p-6 transition-shadow hover:shadow-md dark:border-gray-700 dark:bg-gray-800"
|
|
46
|
+
aria-label={`${label}: ${value}`}
|
|
47
|
+
>
|
|
48
|
+
{/* Label */}
|
|
49
|
+
<p className="text-sm font-medium text-gray-500 dark:text-gray-400">
|
|
50
|
+
{label}
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
{/* Value + Trend */}
|
|
54
|
+
<div className="mt-2 flex items-baseline gap-3">
|
|
55
|
+
<span className="text-3xl font-bold text-gray-900 dark:text-white">
|
|
56
|
+
{value}
|
|
57
|
+
</span>
|
|
58
|
+
<span className={`inline-flex items-center gap-1 text-sm font-medium ${trendColor}`}>
|
|
59
|
+
<span aria-hidden="true">{trendIcon}</span>
|
|
60
|
+
<span>{trend.percentage}%</span>
|
|
61
|
+
<span className="sr-only">
|
|
62
|
+
{trend.direction === 'up' ? 'increase' : trend.direction === 'down' ? 'decrease' : 'no change'}
|
|
63
|
+
</span>
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{/* Sparkline area */}
|
|
68
|
+
{sparklineData && sparklineData.length > 0 && (
|
|
69
|
+
<div className="mt-4 h-12" role="img" aria-label={`Trend chart for ${label}`}>
|
|
70
|
+
<svg viewBox={`0 0 ${sparklineData.length * 10} 48`} className="h-full w-full" preserveAspectRatio="none">
|
|
71
|
+
<polyline
|
|
72
|
+
fill="none"
|
|
73
|
+
stroke="currentColor"
|
|
74
|
+
strokeWidth="2"
|
|
75
|
+
className="text-blue-500 dark:text-blue-400"
|
|
76
|
+
points={sparklineData.map((v, i) => {
|
|
77
|
+
const max = Math.max(...sparklineData);
|
|
78
|
+
const min = Math.min(...sparklineData);
|
|
79
|
+
const range = max - min || 1;
|
|
80
|
+
const x = i * 10;
|
|
81
|
+
const y = 48 - ((v - min) / range) * 44 - 2;
|
|
82
|
+
return `${x},${y}`;
|
|
83
|
+
}).join(' ')}
|
|
84
|
+
/>
|
|
85
|
+
</svg>
|
|
86
|
+
</div>
|
|
87
|
+
)}
|
|
88
|
+
</article>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
|
97
|
+
<StatsCard
|
|
98
|
+
label="Total Revenue"
|
|
99
|
+
value="$45,231"
|
|
100
|
+
trend={{ direction: 'up', percentage: 12.5 }}
|
|
101
|
+
sparklineData={[20, 25, 30, 28, 35, 42, 45]}
|
|
102
|
+
/>
|
|
103
|
+
<StatsCard
|
|
104
|
+
label="Active Users"
|
|
105
|
+
value="2,341"
|
|
106
|
+
trend={{ direction: 'up', percentage: 8.2 }}
|
|
107
|
+
sparklineData={[180, 200, 195, 210, 230, 225, 234]}
|
|
108
|
+
/>
|
|
109
|
+
<StatsCard
|
|
110
|
+
label="Bounce Rate"
|
|
111
|
+
value="24.3%"
|
|
112
|
+
trend={{ direction: 'down', percentage: 3.1 }}
|
|
113
|
+
sparklineData={[30, 28, 27, 25, 26, 24, 24]}
|
|
114
|
+
/>
|
|
115
|
+
<StatsCard
|
|
116
|
+
label="Avg. Session"
|
|
117
|
+
value="4m 32s"
|
|
118
|
+
trend={{ direction: 'neutral', percentage: 0.5 }}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Accessibility Features
|
|
124
|
+
|
|
125
|
+
- `<article>` with `aria-label` for screen reader context
|
|
126
|
+
- Screen-reader-only text for trend direction interpretation
|
|
127
|
+
- `aria-hidden` on decorative trend icons
|
|
128
|
+
- `role="img"` with `aria-label` on sparkline SVG
|
|
129
|
+
- Skeleton loading state with `animate-pulse`
|
|
130
|
+
- Dark mode support throughout
|
|
131
|
+
- Focus-visible compatible (no custom focus overrides)
|
|
132
|
+
|
|
133
|
+
## Responsive Behavior
|
|
134
|
+
|
|
135
|
+
| Breakpoint | Layout |
|
|
136
|
+
|------------|--------|
|
|
137
|
+
| Mobile (< 640px) | Single column stack |
|
|
138
|
+
| Tablet (≥ 640px) | 2-column grid |
|
|
139
|
+
| Desktop (≥ 1024px) | 4-column grid |
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Accessibility & Responsive Design
|
|
2
|
+
|
|
3
|
+
## WCAG 2.1 AA Compliance
|
|
4
|
+
|
|
5
|
+
### Semantic HTML First
|
|
6
|
+
- Use `<main>`, `<nav>`, `<header>`, `<footer>`, `<aside>`, `<section>`, `<article>` for landmarks
|
|
7
|
+
- Use heading hierarchy (`h1` → `h6`) without skipping levels
|
|
8
|
+
- Use `<button>` for actions, `<a>` for navigation — never reverse
|
|
9
|
+
- Use `<ul>`/`<ol>` for lists, `<table>` for tabular data
|
|
10
|
+
- Use `<label>` with `for` attribute for every form input
|
|
11
|
+
|
|
12
|
+
### ARIA Patterns
|
|
13
|
+
|
|
14
|
+
#### Dialog / Modal
|
|
15
|
+
```html
|
|
16
|
+
<div role="dialog" aria-modal="true" aria-labelledby="dialog-title">
|
|
17
|
+
<h2 id="dialog-title">Title</h2>
|
|
18
|
+
<!-- content -->
|
|
19
|
+
<button>Close</button>
|
|
20
|
+
</div>
|
|
21
|
+
```
|
|
22
|
+
- Trap focus inside dialog
|
|
23
|
+
- Return focus to trigger on close
|
|
24
|
+
- Close on Escape key
|
|
25
|
+
|
|
26
|
+
#### Tabs
|
|
27
|
+
```html
|
|
28
|
+
<div role="tablist" aria-label="Section tabs">
|
|
29
|
+
<button role="tab" aria-selected="true" aria-controls="panel-1">Tab 1</button>
|
|
30
|
+
<button role="tab" aria-selected="false" aria-controls="panel-2">Tab 2</button>
|
|
31
|
+
</div>
|
|
32
|
+
<div role="tabpanel" id="panel-1">Content 1</div>
|
|
33
|
+
<div role="tabpanel" id="panel-2" hidden>Content 2</div>
|
|
34
|
+
```
|
|
35
|
+
- Arrow keys navigate between tabs
|
|
36
|
+
- Tab key moves to panel content
|
|
37
|
+
|
|
38
|
+
#### Accordion
|
|
39
|
+
```html
|
|
40
|
+
<h3>
|
|
41
|
+
<button aria-expanded="true" aria-controls="section-1">Section Title</button>
|
|
42
|
+
</h3>
|
|
43
|
+
<div id="section-1" role="region" aria-labelledby="...">Content</div>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### Combobox / Autocomplete
|
|
47
|
+
```html
|
|
48
|
+
<input role="combobox" aria-expanded="false" aria-autocomplete="list"
|
|
49
|
+
aria-controls="listbox-1" aria-activedescendant="">
|
|
50
|
+
<ul role="listbox" id="listbox-1">
|
|
51
|
+
<li role="option" id="opt-1">Option 1</li>
|
|
52
|
+
</ul>
|
|
53
|
+
```
|
|
54
|
+
- Arrow keys navigate options
|
|
55
|
+
- Enter selects, Escape closes
|
|
56
|
+
|
|
57
|
+
### Keyboard Navigation
|
|
58
|
+
- All interactive elements must be focusable (native elements or `tabindex="0"`)
|
|
59
|
+
- Focus order follows visual layout (no `tabindex` > 0)
|
|
60
|
+
- Custom components implement expected key patterns:
|
|
61
|
+
- `Enter`/`Space`: activate buttons and links
|
|
62
|
+
- `Escape`: close overlays, cancel actions
|
|
63
|
+
- `Arrow keys`: navigate within composite widgets (tabs, menus, grids)
|
|
64
|
+
- `Home`/`End`: jump to first/last item in lists
|
|
65
|
+
|
|
66
|
+
### Color & Contrast
|
|
67
|
+
- Text on background: minimum 4.5:1 contrast ratio
|
|
68
|
+
- Large text (18px+ or 14px+ bold): minimum 3:1
|
|
69
|
+
- UI components and graphical objects: minimum 3:1
|
|
70
|
+
- Never convey information by color alone — add icons, patterns, or text labels
|
|
71
|
+
- Test with: WebAIM Contrast Checker, axe DevTools
|
|
72
|
+
|
|
73
|
+
### Focus Indicators
|
|
74
|
+
- Visible focus ring on all interactive elements (minimum 2px)
|
|
75
|
+
- Focus ring color must have 3:1 contrast against adjacent colors
|
|
76
|
+
- Never remove outline without providing alternative indicator
|
|
77
|
+
|
|
78
|
+
## Responsive Strategy
|
|
79
|
+
|
|
80
|
+
### Mobile-First Breakpoints
|
|
81
|
+
|
|
82
|
+
| Name | Width | Target |
|
|
83
|
+
|------|-------|--------|
|
|
84
|
+
| `sm` | 640px | Large phones (landscape) |
|
|
85
|
+
| `md` | 768px | Tablets |
|
|
86
|
+
| `lg` | 1024px | Small laptops |
|
|
87
|
+
| `xl` | 1280px | Desktops |
|
|
88
|
+
| `2xl` | 1536px | Large screens |
|
|
89
|
+
|
|
90
|
+
### Layout Patterns
|
|
91
|
+
|
|
92
|
+
#### Stack → Grid
|
|
93
|
+
```css
|
|
94
|
+
/* Mobile: stack vertically */
|
|
95
|
+
.container { display: flex; flex-direction: column; gap: 1rem; }
|
|
96
|
+
|
|
97
|
+
/* Tablet+: switch to grid */
|
|
98
|
+
@media (min-width: 768px) {
|
|
99
|
+
.container { display: grid; grid-template-columns: repeat(2, 1fr); }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Desktop+: 3 columns */
|
|
103
|
+
@media (min-width: 1024px) {
|
|
104
|
+
.container { grid-template-columns: repeat(3, 1fr); }
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Sidebar Collapse
|
|
109
|
+
- Desktop: sidebar visible, content fills remaining space
|
|
110
|
+
- Tablet: sidebar as overlay with toggle button
|
|
111
|
+
- Mobile: sidebar hidden, accessible via hamburger menu
|
|
112
|
+
|
|
113
|
+
#### Table → Cards
|
|
114
|
+
- Desktop: full table with all columns
|
|
115
|
+
- Tablet: hide non-essential columns, add horizontal scroll
|
|
116
|
+
- Mobile: transform rows into stacked cards
|
|
117
|
+
|
|
118
|
+
### Touch Targets
|
|
119
|
+
- Minimum touch target size: 44×44px (WCAG) / 48×48px (Material)
|
|
120
|
+
- Minimum spacing between targets: 8px
|
|
121
|
+
- Use `padding` to increase touch area without growing visual size
|
|
122
|
+
|
|
123
|
+
### Typography Scaling
|
|
124
|
+
- Base font size: 16px (never below on mobile)
|
|
125
|
+
- Use `rem` for font sizes, `em` for component-relative spacing
|
|
126
|
+
- Line length: 45–75 characters for readability
|
|
127
|
+
- Line height: 1.5 for body text, 1.2–1.3 for headings
|