@enki-dev-expert/global-engineering-standards 0.0.0-stage → 0.1.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.
Files changed (51) hide show
  1. package/AGENTS.md +303 -0
  2. package/CHANGELOG.md +28 -0
  3. package/CITATION.cff +21 -0
  4. package/CODE_OF_CONDUCT.md +13 -0
  5. package/CONTRIBUTING.md +27 -0
  6. package/LICENSE +21 -0
  7. package/README.md +159 -2
  8. package/SECURITY.md +25 -0
  9. package/dist/cli.js +40 -0
  10. package/dist/content.js +71 -0
  11. package/dist/filesystem.js +83 -0
  12. package/dist/installer.js +243 -0
  13. package/dist/layout.js +42 -0
  14. package/dist/transaction.js +143 -0
  15. package/docs/ai-and-llm.md +1312 -0
  16. package/docs/architecture.md +1007 -0
  17. package/docs/cost-engineering.md +1322 -0
  18. package/docs/data.md +993 -0
  19. package/docs/governance.md +1744 -0
  20. package/docs/mobile-and-web.md +1362 -0
  21. package/docs/observability.md +1345 -0
  22. package/docs/platforms-and-applications.md +1581 -0
  23. package/docs/privacy.md +566 -0
  24. package/docs/quality-and-testing.md +1278 -0
  25. package/docs/scalability.md +1012 -0
  26. package/docs/security.md +373 -0
  27. package/handbook/claude-plugin.md +31 -0
  28. package/handbook/compatibility.md +27 -0
  29. package/handbook/recovery.md +29 -0
  30. package/handbook/releasing.md +50 -0
  31. package/handbook/security-review.md +41 -0
  32. package/handbook/signing.md +18 -0
  33. package/handbook/validation.md +50 -0
  34. package/package.json +65 -4
  35. package/scripts/content-baseline.json +25 -0
  36. package/skills/engineering-architecture-review/SKILL.md +1531 -0
  37. package/skills/engineering-cost-estimate/SKILL.md +1599 -0
  38. package/skills/engineering-database-review/SKILL.md +1364 -0
  39. package/skills/engineering-privacy-check/SKILL.md +1295 -0
  40. package/skills/engineering-safe-implementation/SKILL.md +1502 -0
  41. package/skills/engineering-security-standards-check/SKILL.md +1112 -0
  42. package/src/cli.ts +45 -0
  43. package/src/content.ts +82 -0
  44. package/src/filesystem.ts +94 -0
  45. package/src/installer.ts +280 -0
  46. package/src/layout.ts +70 -0
  47. package/src/transaction.ts +167 -0
  48. package/templates/ADR.md +1302 -0
  49. package/templates/AUDIT_REPORT.md +1693 -0
  50. package/templates/EXCEPTIONS.md +647 -0
  51. package/templates/PROJECT_AGENTS.md +868 -0
@@ -0,0 +1,1278 @@
1
+
2
+ # Global Software Quality, Testing and Verification Standards
3
+
4
+ ## 1. Mission
5
+
6
+ Design, implement, verify and maintain secure, correct, reliable, maintainable and scalable software.
7
+
8
+ These standards apply to all software created, reviewed or maintained by AI coding agents, including Claude Code, OpenAI Codex and other AI-assisted development tools.
9
+
10
+ They apply to:
11
+
12
+ - Existing production applications.
13
+ - New applications.
14
+ - Web applications.
15
+ - Native iOS applications.
16
+ - Native Android applications.
17
+ - Cross-platform mobile applications.
18
+ - Backend services.
19
+ - APIs.
20
+ - Databases.
21
+ - AI and agentic systems.
22
+ - Infrastructure as Code.
23
+ - Cloud and Kubernetes workloads.
24
+ - Background services.
25
+ - Enterprise integrations.
26
+
27
+ The objective is to prevent defects, regressions, security weaknesses, unnecessary complexity and avoidable maintenance costs.
28
+
29
+ Never treat generated code as correct merely because it compiles or appears to work.
30
+
31
+ ## 2. Fundamental Quality Principles
32
+
33
+ Apply:
34
+
35
+ 1. Correctness before convenience.
36
+ 2. Security by Design.
37
+ 3. Privacy by Design.
38
+ 4. Simplicity.
39
+ 5. Clear responsibilities.
40
+ 6. Maintainability.
41
+ 7. Testability.
42
+ 8. Backward compatibility.
43
+ 9. Evidence-based verification.
44
+ 10. Incremental implementation.
45
+ 11. Cost awareness.
46
+ 12. Explicit human approval.
47
+ 13. Traceability.
48
+ 14. Production safety.
49
+
50
+ Prefer the smallest correct solution that meets verified requirements.
51
+
52
+ Never introduce unnecessary architectural complexity.
53
+
54
+ ## 3. Technology Independence
55
+
56
+ These standards are language-independent, framework-independent and provider-neutral.
57
+
58
+ They apply to technologies including, but not limited to:
59
+
60
+ - TypeScript.
61
+ - JavaScript.
62
+ - Python.
63
+ - Java.
64
+ - Kotlin.
65
+ - Swift.
66
+ - Dart.
67
+ - C#.
68
+ - Go.
69
+ - Rust.
70
+ - C and C++.
71
+ - SQL.
72
+ - React.
73
+ - Next.js.
74
+ - Vue.
75
+ - Angular.
76
+ - Node.js.
77
+ - Express.
78
+ - NestJS.
79
+ - Django.
80
+ - FastAPI.
81
+ - Spring.
82
+ - .NET.
83
+ - Flutter.
84
+ - React Native.
85
+ - Native iOS.
86
+ - Native Android.
87
+ - Kubernetes.
88
+ - Terraform.
89
+ - OpenTofu.
90
+
91
+ No testing framework, linter or quality tool is mandatory for every project.
92
+
93
+ Inspect the actual technology stack before selecting tools.
94
+
95
+ Preserve existing project conventions when they are appropriate.
96
+
97
+ ## 4. Repository Assessment First
98
+
99
+ Before significant implementation:
100
+
101
+ 1. Inspect the repository structure.
102
+ 2. Identify the languages and frameworks.
103
+ 3. Identify the package manager.
104
+ 4. Identify build and test commands.
105
+ 5. Inspect existing CI/CD workflows.
106
+ 6. Review architecture conventions.
107
+ 7. Review relevant dependencies.
108
+ 8. Identify affected modules.
109
+ 9. Identify relevant tests.
110
+ 10. Identify production compatibility constraints.
111
+
112
+ Do not assume the project uses a specific framework.
113
+
114
+ Do not modify unrelated files merely to improve their appearance.
115
+
116
+ ## 5. Requirements Before Implementation
117
+
118
+ For significant changes:
119
+
120
+ - Clarify the functional objective.
121
+ - Identify acceptance criteria.
122
+ - Identify affected users.
123
+ - Identify dependencies.
124
+ - Identify security implications.
125
+ - Identify privacy implications.
126
+ - Identify performance requirements.
127
+ - Identify compatibility requirements.
128
+ - Identify relevant costs.
129
+ - Define validation procedures.
130
+ - Present an implementation plan.
131
+ - Obtain required human approval.
132
+
133
+ Separate confirmed requirements from assumptions.
134
+
135
+ ## 6. Architecture and Design Quality
136
+
137
+ Follow the approved project architecture.
138
+
139
+ Apply principles such as:
140
+
141
+ - Separation of concerns.
142
+ - Single responsibility.
143
+ - Encapsulation.
144
+ - Clear interfaces.
145
+ - Explicit dependencies.
146
+ - Appropriate abstraction.
147
+ - Dependency inversion where justified.
148
+ - Domain boundaries.
149
+ - Testable components.
150
+
151
+ Avoid unnecessary design patterns.
152
+
153
+ Do not introduce microservices, event buses or orchestration frameworks without evidence.
154
+
155
+ Consult docs/architecture.md.
156
+
157
+ ## 7. Code Readability
158
+
159
+ Write code that is understandable to future maintainers.
160
+
161
+ Use:
162
+
163
+ - Clear names.
164
+ - Consistent formatting.
165
+ - Small cohesive functions.
166
+ - Explicit error handling.
167
+ - Appropriate types.
168
+ - Meaningful module boundaries.
169
+ - Focused comments.
170
+
171
+ Avoid excessive comments that merely repeat the code.
172
+
173
+ Document non-obvious constraints, assumptions and architectural decisions.
174
+
175
+ ## 8. Simplicity and Maintainability
176
+
177
+ Prefer straightforward solutions.
178
+
179
+ Avoid:
180
+
181
+ - Premature abstraction.
182
+ - Excessive inheritance.
183
+ - Unnecessary wrapper layers.
184
+ - Overgeneralized utilities.
185
+ - Hidden side effects.
186
+ - Unnecessary dependencies.
187
+ - Excessive configuration.
188
+
189
+ Do not optimize hypothetical performance problems without evidence.
190
+
191
+ Choose abstractions that reduce actual complexity.
192
+
193
+ ## 9. Code Duplication
194
+
195
+ Identify harmful duplication.
196
+
197
+ Evaluate:
198
+
199
+ - Repeated business logic.
200
+ - Repeated validation.
201
+ - Duplicate API clients.
202
+ - Duplicate authorization logic.
203
+ - Repeated data transformations.
204
+ - Duplicated components.
205
+ - Redundant utility functions.
206
+
207
+ Consolidate duplication when the shared behavior is stable and the change is safe.
208
+
209
+ Do not force unrelated concepts into one abstraction merely because code looks similar.
210
+
211
+ Use duplication detection tools appropriate to the project.
212
+
213
+ Examples may include jscpd or language-specific alternatives.
214
+
215
+ Never refactor unrelated production code without approval.
216
+
217
+ ## 10. Dead Code and Unused Dependencies
218
+
219
+ Review:
220
+
221
+ - Unused functions.
222
+ - Unreachable code.
223
+ - Unused exports.
224
+ - Unused dependencies.
225
+ - Obsolete files.
226
+ - Unused configuration.
227
+ - Unused assets.
228
+ - Redundant imports.
229
+
230
+ Use appropriate analysis tools.
231
+
232
+ Examples may include:
233
+
234
+ - Knip.
235
+ - ESLint.
236
+ - Ruff.
237
+ - Language-specific compiler checks.
238
+ - Dependency analyzers.
239
+
240
+ Static tools may produce false positives.
241
+
242
+ Never delete code solely because an automated detector marks it unused.
243
+
244
+ Review reflection, dynamic imports, plugin registration, framework conventions and external consumers before removal.
245
+
246
+ Require approval for meaningful deletion or restructuring.
247
+
248
+ ## 11. Type Safety
249
+
250
+ Prefer explicit, appropriate type safety.
251
+
252
+ Use:
253
+
254
+ - Strong types where supported.
255
+ - Validated external inputs.
256
+ - Typed function contracts.
257
+ - Narrowed union types.
258
+ - Explicit null handling.
259
+ - Typed API boundaries.
260
+ - Domain-specific value types where useful.
261
+
262
+ Avoid unnecessary unsafe casts.
263
+
264
+ Do not suppress type errors merely to make a build pass.
265
+
266
+ Validate runtime inputs even when compile-time types exist.
267
+
268
+ ## 12. Dependency Management
269
+
270
+ Manage dependencies deliberately.
271
+
272
+ Before introducing a dependency, evaluate:
273
+
274
+ - Necessity.
275
+ - Maintenance status.
276
+ - Licensing.
277
+ - Security history.
278
+ - Compatibility.
279
+ - Bundle or binary size.
280
+ - Operational complexity.
281
+ - Supply-chain risk.
282
+
283
+ Prefer existing maintained dependencies when suitable.
284
+
285
+ Avoid unnecessary overlapping libraries.
286
+
287
+ Never automatically upgrade major dependencies without compatibility analysis and approval.
288
+
289
+ ## 13. Supply-Chain Security
290
+
291
+ Evaluate relevant risks involving:
292
+
293
+ - Package registries.
294
+ - Dependency confusion.
295
+ - Typosquatting.
296
+ - Compromised packages.
297
+ - Malicious install scripts.
298
+ - Build pipelines.
299
+ - Container images.
300
+ - Third-party plugins.
301
+ - AI agent tools.
302
+ - MCP servers.
303
+
304
+ Use supported lockfiles and integrity mechanisms.
305
+
306
+ Review dependency changes.
307
+
308
+ Do not execute unknown installation scripts without assessing their risks.
309
+
310
+ Consult docs/security.md.
311
+
312
+ ## 14. Formatting and Linting
313
+
314
+ Use project-appropriate formatting and linting.
315
+
316
+ Possible tools include:
317
+
318
+ - ESLint.
319
+ - Prettier.
320
+ - Biome.
321
+ - Ruff.
322
+ - Black.
323
+ - mypy.
324
+ - Pyright.
325
+ - Checkstyle.
326
+ - SpotBugs.
327
+ - SwiftLint.
328
+ - ktlint.
329
+ - Detekt.
330
+ - Language-native compiler checks.
331
+
332
+ Select tools according to the existing stack.
333
+
334
+ Do not introduce conflicting formatters.
335
+
336
+ Do not reformat an entire existing repository as a side effect of an unrelated change.
337
+
338
+ ## 15. Static Analysis
339
+
340
+ Use appropriate static analysis to detect:
341
+
342
+ - Type errors.
343
+ - Unsafe code patterns.
344
+ - Potential null dereferences.
345
+ - Resource leaks.
346
+ - Concurrency problems.
347
+ - Security weaknesses.
348
+ - Dead code.
349
+ - Maintainability problems.
350
+
351
+ Investigate findings according to severity and evidence.
352
+
353
+ Avoid treating every warning as equally critical.
354
+
355
+ Document accepted exceptions.
356
+
357
+ Never suppress serious findings without justification and approval.
358
+
359
+ ## 16. Security Testing
360
+
361
+ Select security checks appropriate to the project.
362
+
363
+ Consider:
364
+
365
+ - Static application security testing.
366
+ - Dependency vulnerability scanning.
367
+ - Secret scanning.
368
+ - Infrastructure configuration scanning.
369
+ - Container image scanning.
370
+ - Authorization testing.
371
+ - Input validation testing.
372
+ - API security testing.
373
+ - Mobile security testing.
374
+ - Cloud permission reviews.
375
+
376
+ Validate findings before implementing disruptive changes.
377
+
378
+ Never weaken access controls to make security tests pass.
379
+
380
+ Consult docs/security.md.
381
+
382
+ ## 17. Test Strategy
383
+
384
+ Use a layered test strategy appropriate to application risks.
385
+
386
+ Possible levels include:
387
+
388
+ - Unit tests.
389
+ - Component tests.
390
+ - Integration tests.
391
+ - Contract tests.
392
+ - End-to-end tests.
393
+ - System tests.
394
+ - Performance tests.
395
+ - Security tests.
396
+ - Migration tests.
397
+ - Recovery tests.
398
+ - Acceptance tests.
399
+
400
+ Not every project requires equal investment in every level.
401
+
402
+ Prioritize tests around important business behavior and failure risks.
403
+
404
+ ## 18. Unit Testing
405
+
406
+ Use unit tests for isolated behavior where they provide value.
407
+
408
+ Test:
409
+
410
+ - Business rules.
411
+ - Calculations.
412
+ - Data transformations.
413
+ - Validation.
414
+ - State transitions.
415
+ - Edge cases.
416
+ - Error handling.
417
+
418
+ Prefer deterministic tests.
419
+
420
+ Avoid excessive mocking that hides integration defects.
421
+
422
+ Tests should verify observable behavior rather than incidental implementation details.
423
+
424
+ ## 19. Integration Testing
425
+
426
+ Verify interactions between relevant components.
427
+
428
+ Examples:
429
+
430
+ - API and database.
431
+ - Authentication and authorization.
432
+ - Background workers and queues.
433
+ - External service adapters.
434
+ - Object storage.
435
+ - Payment integrations.
436
+ - AI tools.
437
+ - Cache and persistence.
438
+
439
+ Use controlled environments.
440
+
441
+ Never run destructive integration tests against production systems.
442
+
443
+ ## 20. End-to-End Testing
444
+
445
+ Use end-to-end tests for critical user journeys.
446
+
447
+ Examples:
448
+
449
+ - Registration.
450
+ - Login.
451
+ - Account recovery.
452
+ - Checkout.
453
+ - Payment confirmation.
454
+ - Document submission.
455
+ - Reservation.
456
+ - Subscription management.
457
+ - Administrative approval.
458
+ - Important AI-assisted workflows.
459
+
460
+ Prefer stable selectors and deterministic setup.
461
+
462
+ Avoid excessively fragile tests.
463
+
464
+ Do not substitute a successful screenshot for functional verification.
465
+
466
+ ## 21. API Contract Testing
467
+
468
+ Verify API compatibility.
469
+
470
+ Consider:
471
+
472
+ - Request formats.
473
+ - Response schemas.
474
+ - Status codes.
475
+ - Authentication.
476
+ - Authorization.
477
+ - Error handling.
478
+ - Pagination.
479
+ - Versioning.
480
+ - Backward compatibility.
481
+
482
+ Use consumer-driven contracts where justified.
483
+
484
+ Do not break external consumers without an approved migration strategy.
485
+
486
+ ## 22. Database Testing
487
+
488
+ Evaluate:
489
+
490
+ - Schema constraints.
491
+ - Transactions.
492
+ - Referential integrity.
493
+ - Concurrency.
494
+ - Data migrations.
495
+ - Authorization.
496
+ - Tenant isolation.
497
+ - Idempotency.
498
+ - Recovery.
499
+
500
+ Use isolated test databases when appropriate.
501
+
502
+ Never execute destructive database tests against production.
503
+
504
+ Consult docs/data.md.
505
+
506
+ ## 23. Multi-Tenant Testing
507
+
508
+ For multi-tenant applications, test:
509
+
510
+ - Tenant ownership.
511
+ - Tenant-specific queries.
512
+ - Shared caches.
513
+ - Storage permissions.
514
+ - API authorization.
515
+ - Background processing.
516
+ - Realtime subscriptions.
517
+ - Administrative boundaries.
518
+
519
+ Verify that one tenant cannot access another tenant's protected resources.
520
+
521
+ Do not assume successful authentication proves tenant isolation.
522
+
523
+ ## 24. Concurrency and Race Conditions
524
+
525
+ Test important concurrent operations.
526
+
527
+ Examples:
528
+
529
+ - Inventory updates.
530
+ - Reservations.
531
+ - Financial transactions.
532
+ - Duplicate submissions.
533
+ - Subscription changes.
534
+ - Shared resource modifications.
535
+
536
+ Evaluate:
537
+
538
+ - Atomicity.
539
+ - Locking.
540
+ - Conflict resolution.
541
+ - Optimistic concurrency.
542
+ - Retries.
543
+ - Idempotency.
544
+
545
+ Do not rely solely on sequential tests for concurrency-sensitive workflows.
546
+
547
+ ## 25. Idempotency Testing
548
+
549
+ Verify that repeated requests do not cause unintended duplicate effects.
550
+
551
+ Test:
552
+
553
+ - Duplicate webhooks.
554
+ - Retried API requests.
555
+ - Repeated background jobs.
556
+ - Network interruptions.
557
+ - Partial failures.
558
+
559
+ Confirm the expected result for repeated operations.
560
+
561
+ Do not assume external providers deliver events exactly once.
562
+
563
+ ## 26. Error Handling Testing
564
+
565
+ Test failures intentionally.
566
+
567
+ Consider:
568
+
569
+ - Invalid inputs.
570
+ - Missing permissions.
571
+ - Database outages.
572
+ - External API failures.
573
+ - Network timeouts.
574
+ - Expired credentials.
575
+ - Rate limits.
576
+ - Partial operations.
577
+ - Resource exhaustion.
578
+
579
+ Errors should be observable and handled safely.
580
+
581
+ Never expose secrets or internal sensitive information through error messages.
582
+
583
+ ## 27. Regression Prevention
584
+
585
+ Every significant bug fix should include an appropriate regression test where feasible.
586
+
587
+ Before modifying existing functionality:
588
+
589
+ 1. Identify current expected behavior.
590
+ 2. Identify affected code paths.
591
+ 3. Review existing tests.
592
+ 4. Establish a baseline.
593
+ 5. Implement the approved change.
594
+ 6. Run relevant tests.
595
+ 7. Evaluate unintended behavior changes.
596
+
597
+ Do not treat unrelated test failures as proof that the new change is correct or incorrect without investigation.
598
+
599
+ ## 28. Test Coverage
600
+
601
+ Use coverage metrics as supporting evidence.
602
+
603
+ Evaluate coverage of:
604
+
605
+ - Critical business logic.
606
+ - Security boundaries.
607
+ - Error paths.
608
+ - State transitions.
609
+ - Complex algorithms.
610
+ - High-risk integrations.
611
+
612
+ Do not assume high percentage coverage guarantees quality.
613
+
614
+ Avoid meaningless tests created solely to increase coverage numbers.
615
+
616
+ Define coverage targets according to project risk and maturity.
617
+
618
+ ## 29. Test Quality
619
+
620
+ Tests must be:
621
+
622
+ - Understandable.
623
+ - Repeatable.
624
+ - Relevant.
625
+ - Maintainable.
626
+ - Appropriately isolated.
627
+ - Sensitive to real defects.
628
+
629
+ Avoid tests that always pass regardless of behavior.
630
+
631
+ Do not weaken assertions merely to make failing tests green.
632
+
633
+ Review flaky tests instead of ignoring them indefinitely.
634
+
635
+ ## 30. Test Data Management
636
+
637
+ Use appropriate:
638
+
639
+ - Synthetic data.
640
+ - Fixtures.
641
+ - Factories.
642
+ - Seed datasets.
643
+ - Test accounts.
644
+ - Isolated environments.
645
+
646
+ Avoid real production data unless a specific lawful and approved process requires it.
647
+
648
+ Do not commit private user information or credentials to test repositories.
649
+
650
+ Define cleanup procedures.
651
+
652
+ ## 31. Mocking and Test Doubles
653
+
654
+ Use mocks, stubs and fakes deliberately.
655
+
656
+ Mock external dependencies when isolation is useful.
657
+
658
+ Prefer realistic integration tests for important boundaries.
659
+
660
+ Do not mock away the behavior that a test is intended to verify.
661
+
662
+ Maintain consistency between mock contracts and real integrations.
663
+
664
+ ## 32. Contract Compatibility
665
+
666
+ Preserve compatibility for:
667
+
668
+ - Published APIs.
669
+ - Database schemas.
670
+ - Mobile clients.
671
+ - External integrations.
672
+ - Event formats.
673
+ - Stored data.
674
+ - Background jobs.
675
+
676
+ Consider older mobile application versions that remain active.
677
+
678
+ Use staged migrations when appropriate.
679
+
680
+ Never assume all clients update simultaneously.
681
+
682
+ ## 33. iOS Quality and Testing
683
+
684
+ For native iOS applications, evaluate:
685
+
686
+ - Swift and SwiftUI correctness.
687
+ - UIKit integrations where relevant.
688
+ - Application lifecycle.
689
+ - Memory management.
690
+ - Main-thread responsiveness.
691
+ - Background execution.
692
+ - Network failures.
693
+ - Offline behavior.
694
+ - Accessibility.
695
+ - Device compatibility.
696
+ - Crash handling.
697
+ - Privacy permissions.
698
+
699
+ Use appropriate Apple testing and profiling tools.
700
+
701
+ Validate representative supported iOS versions and devices.
702
+
703
+ ## 34. Android Quality and Testing
704
+
705
+ For native Android applications, evaluate:
706
+
707
+ - Kotlin and Java correctness.
708
+ - Android lifecycle.
709
+ - State preservation.
710
+ - Background restrictions.
711
+ - Memory management.
712
+ - ANR risks.
713
+ - Device diversity.
714
+ - Offline behavior.
715
+ - Accessibility.
716
+ - Security permissions.
717
+ - Crash handling.
718
+
719
+ Use appropriate Android testing and profiling tools.
720
+
721
+ Validate representative devices and supported Android versions.
722
+
723
+ ## 35. Cross-Platform Quality
724
+
725
+ For Flutter, React Native and other cross-platform applications:
726
+
727
+ - Validate platform-specific behavior.
728
+ - Test navigation.
729
+ - Test lifecycle handling.
730
+ - Test native integrations.
731
+ - Test permissions.
732
+ - Verify performance.
733
+ - Verify accessibility.
734
+ - Verify release builds.
735
+
736
+ Do not assume one successful platform test proves compatibility with another platform.
737
+
738
+ ## 36. Web Quality
739
+
740
+ For web applications, evaluate:
741
+
742
+ - Browser compatibility.
743
+ - Responsive layouts.
744
+ - Accessibility.
745
+ - Client-side error handling.
746
+ - Network failures.
747
+ - Authentication state.
748
+ - Form validation.
749
+ - Rendering performance.
750
+ - Routing.
751
+ - Asset loading.
752
+ - Security boundaries.
753
+
754
+ Test representative devices and browsers.
755
+
756
+ Do not rely on visual inspection alone.
757
+
758
+ ## 37. Accessibility Testing
759
+
760
+ Evaluate applicable accessibility requirements.
761
+
762
+ Consider:
763
+
764
+ - Keyboard navigation.
765
+ - Screen readers.
766
+ - Color contrast.
767
+ - Focus management.
768
+ - Accessible names.
769
+ - Semantic structure.
770
+ - Touch target usability.
771
+ - Motion preferences.
772
+ - Error identification.
773
+
774
+ Combine automated checks with appropriate manual testing.
775
+
776
+ Do not claim full accessibility compliance based solely on automated tools.
777
+
778
+ ## 38. Performance Testing
779
+
780
+ Evaluate performance according to real requirements.
781
+
782
+ Consider:
783
+
784
+ - Response time.
785
+ - p95 and p99 latency.
786
+ - Throughput.
787
+ - Memory consumption.
788
+ - CPU utilization.
789
+ - Database performance.
790
+ - Mobile startup.
791
+ - Rendering performance.
792
+ - Network consumption.
793
+
794
+ Use representative workloads.
795
+
796
+ Consult docs/scalability.md.
797
+
798
+ ## 39. Load and Stress Testing
799
+
800
+ When justified, execute:
801
+
802
+ - Load tests.
803
+ - Stress tests.
804
+ - Spike tests.
805
+ - Soak tests.
806
+ - Concurrency tests.
807
+ - Recovery tests.
808
+
809
+ Define acceptable operating limits.
810
+
811
+ Do not run uncontrolled performance tests against production.
812
+
813
+ Require explicit approval for tests that may create meaningful production load or cost.
814
+
815
+ ## 40. AI and LLM Testing
816
+
817
+ For AI-powered functionality, evaluate:
818
+
819
+ - Task correctness.
820
+ - Factual accuracy.
821
+ - Retrieval quality.
822
+ - Hallucination behavior.
823
+ - Prompt injection resistance.
824
+ - Tool-use correctness.
825
+ - Authorization.
826
+ - Privacy.
827
+ - Latency.
828
+ - Cost.
829
+ - Failure handling.
830
+
831
+ Use representative evaluation datasets.
832
+
833
+ Do not rely only on model-generated judgments.
834
+
835
+ Consult docs/ai-and-llm.md.
836
+
837
+ ## 41. RAG Testing
838
+
839
+ Evaluate:
840
+
841
+ - Retrieval relevance.
842
+ - Source coverage.
843
+ - Grounding.
844
+ - Citation correctness.
845
+ - Tenant isolation.
846
+ - Document updates.
847
+ - Document deletion.
848
+ - Retrieval latency.
849
+ - Embedding version changes.
850
+
851
+ Test unauthorized retrieval scenarios.
852
+
853
+ Do not assume successful similarity search guarantees a correct answer.
854
+
855
+ ## 42. AI Agent Testing
856
+
857
+ Test:
858
+
859
+ - Tool permissions.
860
+ - Unauthorized actions.
861
+ - Execution limits.
862
+ - Retry behavior.
863
+ - Recursive loops.
864
+ - Tool failures.
865
+ - Human approval requirements.
866
+ - Resource budgets.
867
+ - Data disclosure.
868
+ - Multi-agent interactions.
869
+
870
+ Never test autonomous destructive actions against production without explicit authorization and controlled safeguards.
871
+
872
+ ## 43. Infrastructure Testing
873
+
874
+ For cloud and infrastructure code, evaluate:
875
+
876
+ - Configuration validation.
877
+ - Infrastructure plans.
878
+ - Security policies.
879
+ - Access permissions.
880
+ - Networking.
881
+ - Resource quotas.
882
+ - Availability settings.
883
+ - Backup configuration.
884
+ - Cost implications.
885
+ - Rollback procedures.
886
+
887
+ Use plan or preview mechanisms when available.
888
+
889
+ Do not automatically apply infrastructure changes after validation.
890
+
891
+ ## 44. Kubernetes Quality
892
+
893
+ For Kubernetes environments, evaluate:
894
+
895
+ - Manifest validity.
896
+ - Resource requests and limits.
897
+ - RBAC.
898
+ - NetworkPolicies.
899
+ - Pod security controls.
900
+ - Secrets handling.
901
+ - Health probes.
902
+ - Deployment strategies.
903
+ - Pod disruption budgets.
904
+ - Storage requirements.
905
+ - Autoscaling configuration.
906
+ - Monitoring.
907
+
908
+ Use appropriate policy validation and configuration analysis.
909
+
910
+ Never apply production cluster changes without explicit approval.
911
+
912
+ ## 45. CI/CD Quality Gates
913
+
914
+ Use automated checks appropriate to the project.
915
+
916
+ Possible checks include:
917
+
918
+ - Formatting.
919
+ - Linting.
920
+ - Type checking.
921
+ - Unit tests.
922
+ - Integration tests.
923
+ - Contract tests.
924
+ - Security scanning.
925
+ - Dependency scanning.
926
+ - Build validation.
927
+ - Artifact verification.
928
+ - Infrastructure validation.
929
+
930
+ Define which checks are blocking based on risk.
931
+
932
+ Do not disable established quality gates silently.
933
+
934
+ Require approval before modifying CI/CD policies.
935
+
936
+ ## 46. Pull Request Quality
937
+
938
+ For meaningful changes, provide:
939
+
940
+ - Purpose.
941
+ - Scope.
942
+ - Relevant files.
943
+ - Risks.
944
+ - Testing evidence.
945
+ - Compatibility considerations.
946
+ - Security implications.
947
+ - Cost implications.
948
+ - Rollback considerations.
949
+
950
+ Keep pull requests focused where practical.
951
+
952
+ Avoid mixing unrelated refactoring with functional changes.
953
+
954
+ ## 47. Code Review Standards
955
+
956
+ Review code for:
957
+
958
+ - Correctness.
959
+ - Security.
960
+ - Data integrity.
961
+ - Authorization.
962
+ - Maintainability.
963
+ - Performance.
964
+ - Compatibility.
965
+ - Test adequacy.
966
+ - Cost implications.
967
+ - Unintended side effects.
968
+
969
+ Prioritize findings according to severity and evidence.
970
+
971
+ Distinguish defects from stylistic preferences.
972
+
973
+ Do not claim a security vulnerability without sufficient technical justification.
974
+
975
+ ## 48. AI-Generated Code Verification
976
+
977
+ All AI-generated code must be treated as unverified until appropriate checks are completed.
978
+
979
+ Evaluate:
980
+
981
+ - Requirement alignment.
982
+ - Correctness.
983
+ - Security.
984
+ - Dependency safety.
985
+ - API compatibility.
986
+ - Data integrity.
987
+ - Error handling.
988
+ - Performance.
989
+ - Maintainability.
990
+ - Test coverage.
991
+ - Hidden costs.
992
+
993
+ Do not accept code solely because an AI agent expresses confidence.
994
+
995
+ Require evidence from relevant tests and analysis.
996
+
997
+ ## 49. Safe Refactoring
998
+
999
+ Before significant refactoring:
1000
+
1001
+ 1. Identify existing behavior.
1002
+ 2. Establish relevant test coverage.
1003
+ 3. Define the refactoring objective.
1004
+ 4. Identify affected integrations.
1005
+ 5. Assess security and performance risks.
1006
+ 6. Obtain approval.
1007
+ 7. Make incremental changes.
1008
+ 8. Run relevant tests.
1009
+ 9. Compare behavior.
1010
+ 10. Document remaining risks.
1011
+
1012
+ Avoid broad rewrites when localized improvements are sufficient.
1013
+
1014
+ ## 50. Existing Production Application Audits
1015
+
1016
+ For existing applications:
1017
+
1018
+ 1. Inspect the current codebase.
1019
+ 2. Identify the actual technology stack.
1020
+ 3. Review relevant architecture.
1021
+ 4. Identify existing testing tools.
1022
+ 5. Inspect CI/CD.
1023
+ 6. Review available test evidence.
1024
+ 7. Identify important business workflows.
1025
+ 8. Assess security and data risks.
1026
+ 9. Identify confirmed quality issues.
1027
+ 10. Prioritize findings.
1028
+ 11. Propose incremental improvements.
1029
+ 12. Present the audit report.
1030
+ 13. Wait for explicit human approval.
1031
+
1032
+ The initial audit must be read-only.
1033
+
1034
+ Do not rewrite working production code during the assessment.
1035
+
1036
+ Do not assume missing tests prove the application is defective.
1037
+
1038
+ Report uncertainty and evidence gaps.
1039
+
1040
+ ## 51. Progressive Compliance
1041
+
1042
+ Existing production projects may have different maturity levels.
1043
+
1044
+ Adopt standards progressively.
1045
+
1046
+ Prioritize:
1047
+
1048
+ - Critical security weaknesses.
1049
+ - Data integrity risks.
1050
+ - Confirmed production defects.
1051
+ - Missing safeguards for high-impact operations.
1052
+ - Important regression tests.
1053
+ - High-value maintainability improvements.
1054
+
1055
+ Document approved temporary exceptions.
1056
+
1057
+ Do not block safe maintenance solely because the entire repository does not yet meet every global standard.
1058
+
1059
+ ## 52. Legacy Code
1060
+
1061
+ Treat legacy code as an operational asset.
1062
+
1063
+ Before changing it:
1064
+
1065
+ - Understand its behavior.
1066
+ - Identify consumers.
1067
+ - Review compatibility constraints.
1068
+ - Establish characterization tests where feasible.
1069
+ - Identify hidden dependencies.
1070
+ - Define rollback options.
1071
+
1072
+ Do not replace legacy components solely because their technology is older.
1073
+
1074
+ ## 53. Build Verification
1075
+
1076
+ Use project-specific build commands.
1077
+
1078
+ Verify:
1079
+
1080
+ - Compilation.
1081
+ - Bundling.
1082
+ - Asset generation.
1083
+ - Native platform requirements.
1084
+ - Environment configuration.
1085
+ - Dependency compatibility.
1086
+
1087
+ A successful build is necessary for many changes but does not establish overall correctness.
1088
+
1089
+ Do not claim a build passed unless it actually ran successfully.
1090
+
1091
+ ## 54. Test Execution Reporting
1092
+
1093
+ Report accurately:
1094
+
1095
+ - Which commands ran.
1096
+ - Which tests passed.
1097
+ - Which tests failed.
1098
+ - Which checks were skipped.
1099
+ - Which checks could not run.
1100
+ - Why execution was limited.
1101
+ - Relevant environment constraints.
1102
+
1103
+ Never invent test results.
1104
+
1105
+ Never claim tests passed merely because no errors were visible in generated code.
1106
+
1107
+ ## 55. Quality Tool Selection
1108
+
1109
+ Select tools according to the project stack.
1110
+
1111
+ Examples:
1112
+
1113
+ ### JavaScript and TypeScript
1114
+
1115
+ - TypeScript compiler.
1116
+ - ESLint or Biome.
1117
+ - Prettier where applicable.
1118
+ - Vitest or Jest.
1119
+ - Playwright.
1120
+ - Knip.
1121
+ - jscpd.
1122
+ - Dependency and security scanners.
1123
+
1124
+ ### Python
1125
+
1126
+ - Ruff.
1127
+ - pytest.
1128
+ - mypy or Pyright where applicable.
1129
+ - Coverage tools.
1130
+ - Dependency and security scanners.
1131
+
1132
+ ### Java and Kotlin
1133
+
1134
+ - JUnit.
1135
+ - Gradle or Maven checks.
1136
+ - Checkstyle where applicable.
1137
+ - SpotBugs.
1138
+ - Detekt.
1139
+ - ktlint.
1140
+ - Platform-specific testing tools.
1141
+
1142
+ ### Swift
1143
+
1144
+ - Swift Testing or XCTest.
1145
+ - SwiftLint where appropriate.
1146
+ - Xcode build and analysis tools.
1147
+
1148
+ ### Flutter and Dart
1149
+
1150
+ - Dart analyzer.
1151
+ - flutter test.
1152
+ - Integration testing tools.
1153
+ - Platform build checks.
1154
+
1155
+ ### Go
1156
+
1157
+ - go test.
1158
+ - go vet.
1159
+ - Race detector where applicable.
1160
+ - Appropriate lint and security tools.
1161
+
1162
+ ### Rust
1163
+
1164
+ - cargo test.
1165
+ - cargo clippy.
1166
+ - cargo fmt.
1167
+ - Dependency analysis tools.
1168
+
1169
+ These are examples, not mandatory tools.
1170
+
1171
+ Verify compatibility and maintenance status before adoption.
1172
+
1173
+ Do not introduce redundant tooling.
1174
+
1175
+ ## 56. Test Environment Safety
1176
+
1177
+ Separate development, testing, staging and production appropriately.
1178
+
1179
+ Validate:
1180
+
1181
+ - Environment identity.
1182
+ - Database endpoints.
1183
+ - Cloud project identity.
1184
+ - API credentials.
1185
+ - Test data ownership.
1186
+ - Resource limits.
1187
+ - External side effects.
1188
+
1189
+ Never assume a test command is safe merely because its name contains "test".
1190
+
1191
+ Require explicit approval for operations that may affect production resources.
1192
+
1193
+ ## 57. Financial Safety During Testing
1194
+
1195
+ Testing must account for usage-based costs.
1196
+
1197
+ Evaluate potential charges from:
1198
+
1199
+ - AI inference.
1200
+ - SMS.
1201
+ - Email.
1202
+ - Paid APIs.
1203
+ - Cloud compute.
1204
+ - Database usage.
1205
+ - Storage.
1206
+ - Network traffic.
1207
+ - Video generation.
1208
+ - Kubernetes clusters.
1209
+
1210
+ Use mocks, sandboxes or dedicated test credentials where appropriate.
1211
+
1212
+ Do not run unbounded tests against billable production services.
1213
+
1214
+ Consult docs/cost-engineering.md.
1215
+
1216
+ ## 58. Human Approval and Change Control
1217
+
1218
+ Require explicit human approval before:
1219
+
1220
+ - Significant architectural modifications.
1221
+ - Destructive migrations.
1222
+ - Production deployments.
1223
+ - Changes to authentication or authorization.
1224
+ - Significant dependency upgrades.
1225
+ - Broad codebase refactoring.
1226
+ - Removal of production functionality.
1227
+ - Production infrastructure changes.
1228
+ - High-cost service provisioning.
1229
+ - Changes with meaningful compatibility risks.
1230
+
1231
+ Present expected impact, validation and rollback procedures.
1232
+
1233
+ Repository access does not imply permission for high-impact changes.
1234
+
1235
+ ## 59. Quality Definition of Done
1236
+
1237
+ For significant development work:
1238
+
1239
+ - Requirements understood.
1240
+ - Architecture respected.
1241
+ - Code readable.
1242
+ - Unnecessary duplication avoided.
1243
+ - Relevant types validated.
1244
+ - Inputs validated.
1245
+ - Security reviewed.
1246
+ - Privacy reviewed.
1247
+ - Data integrity preserved.
1248
+ - Relevant tests added or updated.
1249
+ - Existing regression tests run where feasible.
1250
+ - Build verified where applicable.
1251
+ - Performance impact considered.
1252
+ - Operational costs considered.
1253
+ - Compatibility assessed.
1254
+ - Results honestly reported.
1255
+ - Remaining risks documented.
1256
+ - Required approvals obtained.
1257
+
1258
+ Do not mark work complete when critical validation is missing without clearly reporting the limitation.
1259
+
1260
+ ## 60. Final Quality Principles
1261
+
1262
+ Understand before changing.
1263
+ Plan before implementing.
1264
+ Prefer simple solutions.
1265
+ Write readable and maintainable code.
1266
+ Avoid unnecessary duplication.
1267
+ Validate all untrusted inputs.
1268
+ Enforce authorization.
1269
+ Protect data integrity.
1270
+ Test critical business behavior.
1271
+ Prevent regressions.
1272
+ Preserve production compatibility.
1273
+ Use appropriate automated quality gates.
1274
+ Verify AI-generated code.
1275
+ Report actual test results.
1276
+ Control testing costs.
1277
+ Audit existing systems before modifying them.
1278
+ Require approval for significant changes.