@chc880/everything-antigravity 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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +54 -0
  3. package/assets/rules/common/coding-style.md +53 -0
  4. package/assets/rules/common/git-workflow.md +47 -0
  5. package/assets/rules/common/patterns.md +36 -0
  6. package/assets/rules/common/performance.md +21 -0
  7. package/assets/rules/common/security.md +34 -0
  8. package/assets/rules/common/testing.md +29 -0
  9. package/assets/rules/golang/coding-style.md +40 -0
  10. package/assets/rules/golang/patterns.md +44 -0
  11. package/assets/rules/golang/security.md +33 -0
  12. package/assets/rules/golang/testing.md +30 -0
  13. package/assets/rules/python/coding-style.md +52 -0
  14. package/assets/rules/python/patterns.md +39 -0
  15. package/assets/rules/python/security.md +30 -0
  16. package/assets/rules/python/testing.md +38 -0
  17. package/assets/rules/typescript/coding-style.md +44 -0
  18. package/assets/rules/typescript/patterns.md +50 -0
  19. package/assets/rules/typescript/security.md +27 -0
  20. package/assets/rules/typescript/testing.md +24 -0
  21. package/assets/skills/agent-guides/SKILL.md +40 -0
  22. package/assets/skills/agent-guides/references/architect.md +209 -0
  23. package/assets/skills/agent-guides/references/build-error-resolver.md +530 -0
  24. package/assets/skills/agent-guides/references/code-reviewer.md +102 -0
  25. package/assets/skills/agent-guides/references/database-reviewer.md +652 -0
  26. package/assets/skills/agent-guides/references/doc-updater.md +450 -0
  27. package/assets/skills/agent-guides/references/e2e-runner.md +795 -0
  28. package/assets/skills/agent-guides/references/go-build-resolver.md +366 -0
  29. package/assets/skills/agent-guides/references/go-reviewer.md +265 -0
  30. package/assets/skills/agent-guides/references/planner.md +117 -0
  31. package/assets/skills/agent-guides/references/python-reviewer.md +467 -0
  32. package/assets/skills/agent-guides/references/refactor-cleaner.md +304 -0
  33. package/assets/skills/agent-guides/references/security-reviewer.md +543 -0
  34. package/assets/skills/agent-guides/references/tdd-guide.md +278 -0
  35. package/assets/skills/backend-patterns/SKILL.md +587 -0
  36. package/assets/skills/clickhouse-io/SKILL.md +429 -0
  37. package/assets/skills/coding-standards/SKILL.md +520 -0
  38. package/assets/skills/cpp-testing/SKILL.md +322 -0
  39. package/assets/skills/django-patterns/SKILL.md +733 -0
  40. package/assets/skills/django-security/SKILL.md +592 -0
  41. package/assets/skills/django-tdd/SKILL.md +728 -0
  42. package/assets/skills/django-verification/SKILL.md +460 -0
  43. package/assets/skills/frontend-patterns/SKILL.md +631 -0
  44. package/assets/skills/golang-patterns/SKILL.md +673 -0
  45. package/assets/skills/golang-testing/SKILL.md +719 -0
  46. package/assets/skills/java-coding-standards/SKILL.md +138 -0
  47. package/assets/skills/jpa-patterns/SKILL.md +141 -0
  48. package/assets/skills/knowledge-management/SKILL.md +77 -0
  49. package/assets/skills/nutrient-document-processing/SKILL.md +165 -0
  50. package/assets/skills/postgres-patterns/SKILL.md +146 -0
  51. package/assets/skills/python-patterns/SKILL.md +749 -0
  52. package/assets/skills/python-testing/SKILL.md +815 -0
  53. package/assets/skills/security-hardening/SKILL.md +76 -0
  54. package/assets/skills/security-review/SKILL.md +494 -0
  55. package/assets/skills/security-review/cloud-infrastructure-security.md +361 -0
  56. package/assets/skills/springboot-patterns/SKILL.md +304 -0
  57. package/assets/skills/springboot-security/SKILL.md +119 -0
  58. package/assets/skills/springboot-tdd/SKILL.md +157 -0
  59. package/assets/skills/springboot-verification/SKILL.md +100 -0
  60. package/assets/skills/tdd-workflow/SKILL.md +409 -0
  61. package/assets/workflows/build-fix.md +50 -0
  62. package/assets/workflows/code-review.md +61 -0
  63. package/assets/workflows/e2e.md +65 -0
  64. package/assets/workflows/go-build.md +39 -0
  65. package/assets/workflows/go-review.md +44 -0
  66. package/assets/workflows/go-test.md +61 -0
  67. package/assets/workflows/plan.md +93 -0
  68. package/assets/workflows/python-review.md +95 -0
  69. package/assets/workflows/setup-pm.md +36 -0
  70. package/assets/workflows/tdd.md +75 -0
  71. package/assets/workflows/verify.md +81 -0
  72. package/bin/cli.js +69 -0
  73. package/lib/installer.js +301 -0
  74. package/package.json +34 -0
@@ -0,0 +1,460 @@
1
+ ---
2
+ name: django-verification
3
+ description: Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.
4
+ ---
5
+
6
+ # Django Verification Loop
7
+
8
+ Run before PRs, after major changes, and pre-deploy to ensure Django application quality and security.
9
+
10
+ ## Phase 1: Environment Check
11
+
12
+ ```bash
13
+ # Verify Python version
14
+ python --version # Should match project requirements
15
+
16
+ # Check virtual environment
17
+ which python
18
+ pip list --outdated
19
+
20
+ # Verify environment variables
21
+ python -c "import os; import environ; print('DJANGO_SECRET_KEY set' if os.environ.get('DJANGO_SECRET_KEY') else 'MISSING: DJANGO_SECRET_KEY')"
22
+ ```
23
+
24
+ If environment is misconfigured, stop and fix.
25
+
26
+ ## Phase 2: Code Quality & Formatting
27
+
28
+ ```bash
29
+ # Type checking
30
+ mypy . --config-file pyproject.toml
31
+
32
+ # Linting with ruff
33
+ ruff check . --fix
34
+
35
+ # Formatting with black
36
+ black . --check
37
+ black . # Auto-fix
38
+
39
+ # Import sorting
40
+ isort . --check-only
41
+ isort . # Auto-fix
42
+
43
+ # Django-specific checks
44
+ python manage.py check --deploy
45
+ ```
46
+
47
+ Common issues:
48
+ - Missing type hints on public functions
49
+ - PEP 8 formatting violations
50
+ - Unsorted imports
51
+ - Debug settings left in production configuration
52
+
53
+ ## Phase 3: Migrations
54
+
55
+ ```bash
56
+ # Check for unapplied migrations
57
+ python manage.py showmigrations
58
+
59
+ # Create missing migrations
60
+ python manage.py makemigrations --check
61
+
62
+ # Dry-run migration application
63
+ python manage.py migrate --plan
64
+
65
+ # Apply migrations (test environment)
66
+ python manage.py migrate
67
+
68
+ # Check for migration conflicts
69
+ python manage.py makemigrations --merge # Only if conflicts exist
70
+ ```
71
+
72
+ Report:
73
+ - Number of pending migrations
74
+ - Any migration conflicts
75
+ - Model changes without migrations
76
+
77
+ ## Phase 4: Tests + Coverage
78
+
79
+ ```bash
80
+ # Run all tests with pytest
81
+ pytest --cov=apps --cov-report=html --cov-report=term-missing --reuse-db
82
+
83
+ # Run specific app tests
84
+ pytest apps/users/tests/
85
+
86
+ # Run with markers
87
+ pytest -m "not slow" # Skip slow tests
88
+ pytest -m integration # Only integration tests
89
+
90
+ # Coverage report
91
+ open htmlcov/index.html
92
+ ```
93
+
94
+ Report:
95
+ - Total tests: X passed, Y failed, Z skipped
96
+ - Overall coverage: XX%
97
+ - Per-app coverage breakdown
98
+
99
+ Coverage targets:
100
+
101
+ | Component | Target |
102
+ |-----------|--------|
103
+ | Models | 90%+ |
104
+ | Serializers | 85%+ |
105
+ | Views | 80%+ |
106
+ | Services | 90%+ |
107
+ | Overall | 80%+ |
108
+
109
+ ## Phase 5: Security Scan
110
+
111
+ ```bash
112
+ # Dependency vulnerabilities
113
+ pip-audit
114
+ safety check --full-report
115
+
116
+ # Django security checks
117
+ python manage.py check --deploy
118
+
119
+ # Bandit security linter
120
+ bandit -r . -f json -o bandit-report.json
121
+
122
+ # Secret scanning (if gitleaks is installed)
123
+ gitleaks detect --source . --verbose
124
+
125
+ # Environment variable check
126
+ python -c "from django.core.exceptions import ImproperlyConfigured; from django.conf import settings; settings.DEBUG"
127
+ ```
128
+
129
+ Report:
130
+ - Vulnerable dependencies found
131
+ - Security configuration issues
132
+ - Hardcoded secrets detected
133
+ - DEBUG mode status (should be False in production)
134
+
135
+ ## Phase 6: Django Management Commands
136
+
137
+ ```bash
138
+ # Check for model issues
139
+ python manage.py check
140
+
141
+ # Collect static files
142
+ python manage.py collectstatic --noinput --clear
143
+
144
+ # Create superuser (if needed for tests)
145
+ echo "from apps.users.models import User; User.objects.create_superuser('admin@example.com', 'admin')" | python manage.py shell
146
+
147
+ # Database integrity
148
+ python manage.py check --database default
149
+
150
+ # Cache verification (if using Redis)
151
+ python -c "from django.core.cache import cache; cache.set('test', 'value', 10); print(cache.get('test'))"
152
+ ```
153
+
154
+ ## Phase 7: Performance Checks
155
+
156
+ ```bash
157
+ # Django Debug Toolbar output (check for N+1 queries)
158
+ # Run in dev mode with DEBUG=True and access a page
159
+ # Look for duplicate queries in SQL panel
160
+
161
+ # Query count analysis
162
+ django-admin debugsqlshell # If django-debug-sqlshell installed
163
+
164
+ # Check for missing indexes
165
+ python manage.py shell << EOF
166
+ from django.db import connection
167
+ with connection.cursor() as cursor:
168
+ cursor.execute("SELECT table_name, index_name FROM information_schema.statistics WHERE table_schema = 'public'")
169
+ print(cursor.fetchall())
170
+ EOF
171
+ ```
172
+
173
+ Report:
174
+ - Number of queries per page (should be < 50 for typical pages)
175
+ - Missing database indexes
176
+ - Duplicate queries detected
177
+
178
+ ## Phase 8: Static Assets
179
+
180
+ ```bash
181
+ # Check for npm dependencies (if using npm)
182
+ npm audit
183
+ npm audit fix
184
+
185
+ # Build static files (if using webpack/vite)
186
+ npm run build
187
+
188
+ # Verify static files
189
+ ls -la staticfiles/
190
+ python manage.py findstatic css/style.css
191
+ ```
192
+
193
+ ## Phase 9: Configuration Review
194
+
195
+ ```python
196
+ # Run in Python shell to verify settings
197
+ python manage.py shell << EOF
198
+ from django.conf import settings
199
+ import os
200
+
201
+ # Critical checks
202
+ checks = {
203
+ 'DEBUG is False': not settings.DEBUG,
204
+ 'SECRET_KEY set': bool(settings.SECRET_KEY and len(settings.SECRET_KEY) > 30),
205
+ 'ALLOWED_HOSTS set': len(settings.ALLOWED_HOSTS) > 0,
206
+ 'HTTPS enabled': getattr(settings, 'SECURE_SSL_REDIRECT', False),
207
+ 'HSTS enabled': getattr(settings, 'SECURE_HSTS_SECONDS', 0) > 0,
208
+ 'Database configured': settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3',
209
+ }
210
+
211
+ for check, result in checks.items():
212
+ status = '✓' if result else '✗'
213
+ print(f"{status} {check}")
214
+ EOF
215
+ ```
216
+
217
+ ## Phase 10: Logging Configuration
218
+
219
+ ```bash
220
+ # Test logging output
221
+ python manage.py shell << EOF
222
+ import logging
223
+ logger = logging.getLogger('django')
224
+ logger.warning('Test warning message')
225
+ logger.error('Test error message')
226
+ EOF
227
+
228
+ # Check log files (if configured)
229
+ tail -f /var/log/django/django.log
230
+ ```
231
+
232
+ ## Phase 11: API Documentation (if DRF)
233
+
234
+ ```bash
235
+ # Generate schema
236
+ python manage.py generateschema --format openapi-json > schema.json
237
+
238
+ # Validate schema
239
+ # Check if schema.json is valid JSON
240
+ python -c "import json; json.load(open('schema.json'))"
241
+
242
+ # Access Swagger UI (if using drf-yasg)
243
+ # Visit http://localhost:8000/swagger/ in browser
244
+ ```
245
+
246
+ ## Phase 12: Diff Review
247
+
248
+ ```bash
249
+ # Show diff statistics
250
+ git diff --stat
251
+
252
+ # Show actual changes
253
+ git diff
254
+
255
+ # Show changed files
256
+ git diff --name-only
257
+
258
+ # Check for common issues
259
+ git diff | grep -i "todo\|fixme\|hack\|xxx"
260
+ git diff | grep "print(" # Debug statements
261
+ git diff | grep "DEBUG = True" # Debug mode
262
+ git diff | grep "import pdb" # Debugger
263
+ ```
264
+
265
+ Checklist:
266
+ - No debugging statements (print, pdb, breakpoint())
267
+ - No TODO/FIXME comments in critical code
268
+ - No hardcoded secrets or credentials
269
+ - Database migrations included for model changes
270
+ - Configuration changes documented
271
+ - Error handling present for external calls
272
+ - Transaction management where needed
273
+
274
+ ## Output Template
275
+
276
+ ```
277
+ DJANGO VERIFICATION REPORT
278
+ ==========================
279
+
280
+ Phase 1: Environment Check
281
+ ✓ Python 3.11.5
282
+ ✓ Virtual environment active
283
+ ✓ All environment variables set
284
+
285
+ Phase 2: Code Quality
286
+ ✓ mypy: No type errors
287
+ ✗ ruff: 3 issues found (auto-fixed)
288
+ ✓ black: No formatting issues
289
+ ✓ isort: Imports properly sorted
290
+ ✓ manage.py check: No issues
291
+
292
+ Phase 3: Migrations
293
+ ✓ No unapplied migrations
294
+ ✓ No migration conflicts
295
+ ✓ All models have migrations
296
+
297
+ Phase 4: Tests + Coverage
298
+ Tests: 247 passed, 0 failed, 5 skipped
299
+ Coverage:
300
+ Overall: 87%
301
+ users: 92%
302
+ products: 89%
303
+ orders: 85%
304
+ payments: 91%
305
+
306
+ Phase 5: Security Scan
307
+ ✗ pip-audit: 2 vulnerabilities found (fix required)
308
+ ✓ safety check: No issues
309
+ ✓ bandit: No security issues
310
+ ✓ No secrets detected
311
+ ✓ DEBUG = False
312
+
313
+ Phase 6: Django Commands
314
+ ✓ collectstatic completed
315
+ ✓ Database integrity OK
316
+ ✓ Cache backend reachable
317
+
318
+ Phase 7: Performance
319
+ ✓ No N+1 queries detected
320
+ ✓ Database indexes configured
321
+ ✓ Query count acceptable
322
+
323
+ Phase 8: Static Assets
324
+ ✓ npm audit: No vulnerabilities
325
+ ✓ Assets built successfully
326
+ ✓ Static files collected
327
+
328
+ Phase 9: Configuration
329
+ ✓ DEBUG = False
330
+ ✓ SECRET_KEY configured
331
+ ✓ ALLOWED_HOSTS set
332
+ ✓ HTTPS enabled
333
+ ✓ HSTS enabled
334
+ ✓ Database configured
335
+
336
+ Phase 10: Logging
337
+ ✓ Logging configured
338
+ ✓ Log files writable
339
+
340
+ Phase 11: API Documentation
341
+ ✓ Schema generated
342
+ ✓ Swagger UI accessible
343
+
344
+ Phase 12: Diff Review
345
+ Files changed: 12
346
+ +450, -120 lines
347
+ ✓ No debug statements
348
+ ✓ No hardcoded secrets
349
+ ✓ Migrations included
350
+
351
+ RECOMMENDATION: ⚠️ Fix pip-audit vulnerabilities before deploying
352
+
353
+ NEXT STEPS:
354
+ 1. Update vulnerable dependencies
355
+ 2. Re-run security scan
356
+ 3. Deploy to staging for final testing
357
+ ```
358
+
359
+ ## Pre-Deployment Checklist
360
+
361
+ - [ ] All tests passing
362
+ - [ ] Coverage ≥ 80%
363
+ - [ ] No security vulnerabilities
364
+ - [ ] No unapplied migrations
365
+ - [ ] DEBUG = False in production settings
366
+ - [ ] SECRET_KEY properly configured
367
+ - [ ] ALLOWED_HOSTS set correctly
368
+ - [ ] Database backups enabled
369
+ - [ ] Static files collected and served
370
+ - [ ] Logging configured and working
371
+ - [ ] Error monitoring (Sentry, etc.) configured
372
+ - [ ] CDN configured (if applicable)
373
+ - [ ] Redis/cache backend configured
374
+ - [ ] Celery workers running (if applicable)
375
+ - [ ] HTTPS/SSL configured
376
+ - [ ] Environment variables documented
377
+
378
+ ## Continuous Integration
379
+
380
+ ### GitHub Actions Example
381
+
382
+ ```yaml
383
+ # .github/workflows/django-verification.yml
384
+ name: Django Verification
385
+
386
+ on: [push, pull_request]
387
+
388
+ jobs:
389
+ verify:
390
+ runs-on: ubuntu-latest
391
+ services:
392
+ postgres:
393
+ image: postgres:14
394
+ env:
395
+ POSTGRES_PASSWORD: postgres
396
+ options: >-
397
+ --health-cmd pg_isready
398
+ --health-interval 10s
399
+ --health-timeout 5s
400
+ --health-retries 5
401
+
402
+ steps:
403
+ - uses: actions/checkout@v3
404
+
405
+ - name: Set up Python
406
+ uses: actions/setup-python@v4
407
+ with:
408
+ python-version: '3.11'
409
+
410
+ - name: Cache pip
411
+ uses: actions/cache@v3
412
+ with:
413
+ path: ~/.cache/pip
414
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
415
+
416
+ - name: Install dependencies
417
+ run: |
418
+ pip install -r requirements.txt
419
+ pip install ruff black mypy pytest pytest-django pytest-cov bandit safety pip-audit
420
+
421
+ - name: Code quality checks
422
+ run: |
423
+ ruff check .
424
+ black . --check
425
+ isort . --check-only
426
+ mypy .
427
+
428
+ - name: Security scan
429
+ run: |
430
+ bandit -r . -f json -o bandit-report.json
431
+ safety check --full-report
432
+ pip-audit
433
+
434
+ - name: Run tests
435
+ env:
436
+ DATABASE_URL: postgres://postgres:postgres@localhost:5432/test
437
+ DJANGO_SECRET_KEY: test-secret-key
438
+ run: |
439
+ pytest --cov=apps --cov-report=xml --cov-report=term-missing
440
+
441
+ - name: Upload coverage
442
+ uses: codecov/codecov-action@v3
443
+ ```
444
+
445
+ ## Quick Reference
446
+
447
+ | Check | Command |
448
+ |-------|---------|
449
+ | Environment | `python --version` |
450
+ | Type checking | `mypy .` |
451
+ | Linting | `ruff check .` |
452
+ | Formatting | `black . --check` |
453
+ | Migrations | `python manage.py makemigrations --check` |
454
+ | Tests | `pytest --cov=apps` |
455
+ | Security | `pip-audit && bandit -r .` |
456
+ | Django check | `python manage.py check --deploy` |
457
+ | Collectstatic | `python manage.py collectstatic --noinput` |
458
+ | Diff stats | `git diff --stat` |
459
+
460
+ Remember: Automated verification catches common issues but doesn't replace manual code review and testing in staging environment.