@tinkcarlos/skillora 0.2.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/.claude/skills/.temp-skill-index.md +245 -0
- package/.claude/skills/SKILL.md +264 -0
- package/.claude/skills/api-scaffolding/SKILL.md +431 -0
- package/.claude/skills/api-scaffolding/agents/backend-architect.md +282 -0
- package/.claude/skills/api-scaffolding/agents/django-pro.md +144 -0
- package/.claude/skills/api-scaffolding/agents/fastapi-pro.md +156 -0
- package/.claude/skills/api-scaffolding/agents/graphql-architect.md +146 -0
- package/.claude/skills/api-scaffolding/skills/fastapi-templates/SKILL.md +171 -0
- package/.claude/skills/api-testing-observability/SKILL.md +583 -0
- package/.claude/skills/api-testing-observability/agents/api-documenter.md +146 -0
- package/.claude/skills/api-testing-observability/commands/api-mock.md +1320 -0
- package/.claude/skills/brainstorming/SKILL.md +283 -0
- package/.claude/skills/bug-fixing/SKILL.md +382 -0
- package/.claude/skills/bug-fixing/references/backend-guide.md +132 -0
- package/.claude/skills/bug-fixing/references/bug-guide.md +354 -0
- package/.claude/skills/bug-fixing/references/bug-record-template.md +134 -0
- package/.claude/skills/bug-fixing/references/bug-records.md +88 -0
- package/.claude/skills/bug-fixing/references/code-review-gate.md +81 -0
- package/.claude/skills/bug-fixing/references/common-bugs.md +140 -0
- package/.claude/skills/bug-fixing/references/complete-workflow.md +361 -0
- package/.claude/skills/bug-fixing/references/config-driven-fixes.md +136 -0
- package/.claude/skills/bug-fixing/references/context-isolation-protocol.md +268 -0
- package/.claude/skills/bug-fixing/references/cross-surface-regression.md +120 -0
- package/.claude/skills/bug-fixing/references/database-investigation.md +129 -0
- package/.claude/skills/bug-fixing/references/dependency-and-integrity-protocol.md +369 -0
- package/.claude/skills/bug-fixing/references/fix-completeness-checklist.md +239 -0
- package/.claude/skills/bug-fixing/references/frontend-guide.md +219 -0
- package/.claude/skills/bug-fixing/references/fullstack-joint-guide.md +123 -0
- package/.claude/skills/bug-fixing/references/functional-breakage.md +117 -0
- package/.claude/skills/bug-fixing/references/ide-lint-errors-guide.md +176 -0
- package/.claude/skills/bug-fixing/references/impact-analysis.md +511 -0
- package/.claude/skills/bug-fixing/references/investigation-checklist.md +263 -0
- package/.claude/skills/bug-fixing/references/knowledge-extraction-guide.md +531 -0
- package/.claude/skills/bug-fixing/references/knowledge-workflow.md +212 -0
- package/.claude/skills/bug-fixing/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/bug-fixing/references/python-env-and-testing.md +126 -0
- package/.claude/skills/bug-fixing/references/rca-guide.md +428 -0
- package/.claude/skills/bug-fixing/references/similar-bug-patterns.md +113 -0
- package/.claude/skills/bug-fixing/references/skill-delegation-guide.md +350 -0
- package/.claude/skills/bug-fixing/references/skill-orchestration.md +155 -0
- package/.claude/skills/bug-fixing/references/testing-strategy.md +350 -0
- package/.claude/skills/bug-fixing/references/tooling-build-scripts.md +162 -0
- package/.claude/skills/bug-fixing/references/user-input-validation.md +77 -0
- package/.claude/skills/bug-fixing/references/ux-patterns.md +158 -0
- package/.claude/skills/bug-fixing/references/windows-terminal-hygiene.md +106 -0
- package/.claude/skills/bug-fixing/references/zero-regression-matrix.md +239 -0
- package/.claude/skills/bug-fixing/references/zero-risk-protocol.md +102 -0
- package/.claude/skills/bug-fixing/scripts/format_code.py +611 -0
- package/.claude/skills/bug-fixing/scripts/generate_report_template.py +74 -0
- package/.claude/skills/bug-fixing/scripts/lint_check.py +816 -0
- package/.claude/skills/bug-fixing/scripts/requirements.txt +36 -0
- package/.claude/skills/cicd-pipeline/SKILL.md +300 -0
- package/.claude/skills/code-review/SKILL.md +535 -0
- package/.claude/skills/code-review/references/anti-pattern-scan.md +102 -0
- package/.claude/skills/code-review/references/automated-analysis.md +456 -0
- package/.claude/skills/code-review/references/backend-common-issues.md +589 -0
- package/.claude/skills/code-review/references/backend-expert-guide.md +415 -0
- package/.claude/skills/code-review/references/backend-review.md +868 -0
- package/.claude/skills/code-review/references/batch-processing-strategy.md +198 -0
- package/.claude/skills/code-review/references/call-chain-analysis-protocol.md +166 -0
- package/.claude/skills/code-review/references/common-patterns.md +321 -0
- package/.claude/skills/code-review/references/configuration-review.md +425 -0
- package/.claude/skills/code-review/references/control-flow-completeness.md +114 -0
- package/.claude/skills/code-review/references/database-review.md +298 -0
- package/.claude/skills/code-review/references/dependency-and-integrity-protocol.md +313 -0
- package/.claude/skills/code-review/references/external-standards.md +51 -0
- package/.claude/skills/code-review/references/feature-review.md +329 -0
- package/.claude/skills/code-review/references/file-review-template.md +326 -0
- package/.claude/skills/code-review/references/frontend-advanced.md +654 -0
- package/.claude/skills/code-review/references/frontend-common-issues.md +482 -0
- package/.claude/skills/code-review/references/frontend-expert-guide.md +342 -0
- package/.claude/skills/code-review/references/frontend-review.md +783 -0
- package/.claude/skills/code-review/references/fullstack-consistency.md +418 -0
- package/.claude/skills/code-review/references/fullstack-review.md +477 -0
- package/.claude/skills/code-review/references/functional-completeness.md +386 -0
- package/.claude/skills/code-review/references/hidden-bugs-detection.md +473 -0
- package/.claude/skills/code-review/references/ide-lint-errors-guide.md +173 -0
- package/.claude/skills/code-review/references/infrastructure-review.md +453 -0
- package/.claude/skills/code-review/references/iteration-review.md +264 -0
- package/.claude/skills/code-review/references/job-review.md +335 -0
- package/.claude/skills/code-review/references/layered-checklist-protocol.md +157 -0
- package/.claude/skills/code-review/references/logic-completeness.md +535 -0
- package/.claude/skills/code-review/references/mandatory-checklist.md +288 -0
- package/.claude/skills/code-review/references/multi-language-guide.md +800 -0
- package/.claude/skills/code-review/references/new-project-review.md +226 -0
- package/.claude/skills/code-review/references/non-code-files-review.md +451 -0
- package/.claude/skills/code-review/references/overlooked-issues.md +657 -0
- package/.claude/skills/code-review/references/platform-specific-review.md +195 -0
- package/.claude/skills/code-review/references/precision-analysis-protocol.md +260 -0
- package/.claude/skills/code-review/references/python-patterns.md +494 -0
- package/.claude/skills/code-review/references/rca-techniques.md +362 -0
- package/.claude/skills/code-review/references/report-template.md +430 -0
- package/.claude/skills/code-review/references/resource-limits-and-degradation.md +137 -0
- package/.claude/skills/code-review/references/review-dimensions.md +311 -0
- package/.claude/skills/code-review/references/review-guide.md +202 -0
- package/.claude/skills/code-review/references/review-knowledge-workflow.md +257 -0
- package/.claude/skills/code-review/references/review-progress-tracker-protocol.md +172 -0
- package/.claude/skills/code-review/references/review-record-template.md +195 -0
- package/.claude/skills/code-review/references/skill-orchestration.md +143 -0
- package/.claude/skills/code-review/references/ui-ux-review.md +470 -0
- package/.claude/skills/containerization/SKILL.md +313 -0
- package/.claude/skills/database-migrations/agents/database-admin.md +142 -0
- package/.claude/skills/database-migrations/agents/database-optimizer.md +144 -0
- package/.claude/skills/database-migrations/commands/migration-observability.md +408 -0
- package/.claude/skills/database-migrations/commands/sql-migrations.md +492 -0
- package/.claude/skills/finishing-a-development-branch/SKILL.md +319 -0
- package/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/.claude/skills/frontend-design/SKILL.md +587 -0
- package/.claude/skills/frontend-design/references/color-consistency.md +487 -0
- package/.claude/skills/frontend-design/references/color-palettes-full.md +657 -0
- package/.claude/skills/frontend-design/references/design-system-generator.md +285 -0
- package/.claude/skills/frontend-design/references/font-pairings-full.md +705 -0
- package/.claude/skills/frontend-design/references/industry-anti-patterns.md +281 -0
- package/.claude/skills/frontend-design/references/layout-anti-patterns.md +582 -0
- package/.claude/skills/frontend-design/references/motion-patterns.md +659 -0
- package/.claude/skills/frontend-design/references/pre-delivery-checklist.md +153 -0
- package/.claude/skills/frontend-design/references/responsive-design.md +555 -0
- package/.claude/skills/frontend-design/references/style-modification-rules.md +335 -0
- package/.claude/skills/frontend-design/references/ui-styles-full.md +383 -0
- package/.claude/skills/frontend-design/references/ui-styles-rating.md +191 -0
- package/.claude/skills/frontend-design/references/ux-guidelines.md +640 -0
- package/.claude/skills/fullstack-developer/SKILL.md +512 -0
- package/.claude/skills/fullstack-developer/references/api-contract-guide.md +312 -0
- package/.claude/skills/fullstack-developer/references/api-response-patterns.md +223 -0
- package/.claude/skills/fullstack-developer/references/async-patterns.md +220 -0
- package/.claude/skills/fullstack-developer/references/bug-prevention.md +914 -0
- package/.claude/skills/fullstack-developer/references/code-quality-checklist.md +271 -0
- package/.claude/skills/fullstack-developer/references/complete-development-workflow.md +278 -0
- package/.claude/skills/fullstack-developer/references/context-isolation-protocol.md +256 -0
- package/.claude/skills/fullstack-developer/references/database-migration.md +331 -0
- package/.claude/skills/fullstack-developer/references/dependency-and-integrity-protocol.md +390 -0
- package/.claude/skills/fullstack-developer/references/development-phases.md +333 -0
- package/.claude/skills/fullstack-developer/references/expert-guide.md +214 -0
- package/.claude/skills/fullstack-developer/references/file-import-patterns.md +114 -0
- package/.claude/skills/fullstack-developer/references/graceful-degradation-patterns.md +78 -0
- package/.claude/skills/fullstack-developer/references/ide-lint-errors-guide.md +183 -0
- package/.claude/skills/fullstack-developer/references/integration-testing.md +301 -0
- package/.claude/skills/fullstack-developer/references/mock-api-patterns.md +307 -0
- package/.claude/skills/fullstack-developer/references/phase-gate-template.md +249 -0
- package/.claude/skills/fullstack-developer/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/fullstack-developer/references/python-engineering.md +79 -0
- package/.claude/skills/fullstack-developer/references/skill-orchestration.md +214 -0
- package/.claude/skills/fullstack-developer/references/skill-router-table.md +304 -0
- package/.claude/skills/fullstack-developer/references/state-sync.md +217 -0
- package/.claude/skills/fullstack-developer/references/ui-testing-checklist.md +292 -0
- package/.claude/skills/fullstack-developer/scripts/format_code.py +611 -0
- package/.claude/skills/fullstack-developer/scripts/lint_check.py +816 -0
- package/.claude/skills/fullstack-developer/scripts/requirements.txt +36 -0
- package/.claude/skills/performance-optimization/SKILL.md +250 -0
- package/.claude/skills/product-requirements/SKILL.md +357 -0
- package/.claude/skills/product-requirements/references/acceptance-criteria.md +335 -0
- package/.claude/skills/product-requirements/references/answer-first-questioning-protocol.md +299 -0
- package/.claude/skills/product-requirements/references/competitive-analysis-guide.md +183 -0
- package/.claude/skills/product-requirements/references/document-accuracy-protocol.md +253 -0
- package/.claude/skills/product-requirements/references/document-management-protocol.md +278 -0
- package/.claude/skills/product-requirements/references/external-standards.md +62 -0
- package/.claude/skills/product-requirements/references/feature-spec-template.md +359 -0
- package/.claude/skills/product-requirements/references/knowledge-acquisition-protocol.md +251 -0
- package/.claude/skills/product-requirements/references/plan-execution-protocol.md +334 -0
- package/.claude/skills/product-requirements/references/plan-generation-protocol.md +264 -0
- package/.claude/skills/product-requirements/references/prioritization-frameworks.md +80 -0
- package/.claude/skills/product-requirements/references/requirement-decomposition-protocol.md +291 -0
- package/.claude/skills/product-requirements/references/user-story-examples.md +297 -0
- package/.claude/skills/product-requirements/references/workflow-templates.md +266 -0
- package/.claude/skills/react-best-practices/SKILL.md +198 -0
- package/.claude/skills/react-best-practices/references/advanced-patterns.md +94 -0
- package/.claude/skills/react-best-practices/references/bundle-optimization.md +182 -0
- package/.claude/skills/react-best-practices/references/client-data-fetching.md +112 -0
- package/.claude/skills/react-best-practices/references/complete-guide.md +2249 -0
- package/.claude/skills/react-best-practices/references/eliminating-waterfalls.md +169 -0
- package/.claude/skills/react-best-practices/references/javascript-performance.md +256 -0
- package/.claude/skills/react-best-practices/references/rendering-performance.md +230 -0
- package/.claude/skills/react-best-practices/references/rerender-optimization.md +214 -0
- package/.claude/skills/react-best-practices/references/server-performance.md +182 -0
- package/.claude/skills/security-audit/SKILL.md +226 -0
- package/.claude/skills/shared-references/advanced-debugging-techniques.md +186 -0
- package/.claude/skills/shared-references/code-quality-checklist.md +218 -0
- package/.claude/skills/shared-references/code-review-efficiency-guide.md +125 -0
- package/.claude/skills/shared-references/mcp-dependency-compatibility-protocol.md +276 -0
- package/.claude/skills/shared-references/skill-call-graph.md +230 -0
- package/.claude/skills/shared-references/skill-orchestration-protocol.md +281 -0
- package/.claude/skills/shared-references/subagent-dispatch-templates.md +199 -0
- package/.claude/skills/skill-expert-skills/LICENSE.txt +204 -0
- package/.claude/skills/skill-expert-skills/QUICK_NAVIGATION.md +374 -0
- package/.claude/skills/skill-expert-skills/SKILL.md +247 -0
- package/.claude/skills/skill-expert-skills/docs/_index.md +91 -0
- package/.claude/skills/skill-expert-skills/references/deep-research-methodology.md +389 -0
- package/.claude/skills/skill-expert-skills/references/docs-generation-workflow.md +398 -0
- package/.claude/skills/skill-expert-skills/references/domain-expertise-protocol.md +343 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/_index.md +54 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/backend-expertise.md +517 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/bug-fixing-expertise.md +363 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/code-review-expertise.md +392 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/frontend-expertise.md +410 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge-template.md +503 -0
- package/.claude/skills/skill-expert-skills/references/examples.md +782 -0
- package/.claude/skills/skill-expert-skills/references/integration-examples.md +655 -0
- package/.claude/skills/skill-expert-skills/references/knowledge-validation-checklist.md +246 -0
- package/.claude/skills/skill-expert-skills/references/latest-knowledge-acquisition.md +461 -0
- package/.claude/skills/skill-expert-skills/references/mcp-tools-guide.md +439 -0
- package/.claude/skills/skill-expert-skills/references/official-best-practices.md +616 -0
- package/.claude/skills/skill-expert-skills/references/patterns.md +218 -0
- package/.claude/skills/skill-expert-skills/references/plugin-skills-guide.md +432 -0
- package/.claude/skills/skill-expert-skills/references/requirement-elicitation-protocol.md +290 -0
- package/.claude/skills/skill-expert-skills/references/skill-creator-SKILL.md +353 -0
- package/.claude/skills/skill-expert-skills/references/skill-templates.md +583 -0
- package/.claude/skills/skill-expert-skills/references/skills-knowledge-base.md +561 -0
- package/.claude/skills/skill-expert-skills/references/tools-guide.md +379 -0
- package/.claude/skills/skill-expert-skills/references/troubleshooting.md +378 -0
- package/.claude/skills/skill-expert-skills/references/universality-guide.md +205 -0
- package/.claude/skills/skill-expert-skills/references/writing-style-guide.md +466 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/universal_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/analyze_trigger.py +425 -0
- package/.claude/skills/skill-expert-skills/scripts/diff_with_official.py +188 -0
- package/.claude/skills/skill-expert-skills/scripts/init_skill.py +349 -0
- package/.claude/skills/skill-expert-skills/scripts/package_skill.py +156 -0
- package/.claude/skills/skill-expert-skills/scripts/quick_validate.py +493 -0
- package/.claude/skills/skill-expert-skills/scripts/requirements.txt +2 -0
- package/.claude/skills/skill-expert-skills/scripts/universal_validate.py +182 -0
- package/.claude/skills/skill-expert-skills/scripts/upgrade_skill.py +431 -0
- package/.claude/skills/subagent-driven-development/SKILL.md +268 -0
- package/.claude/skills/test-driven-development/SKILL.md +246 -0
- package/.claude/skills/test-driven-development/references/testing-anti-patterns.md +192 -0
- package/.claude/skills/using-git-worktrees/SKILL.md +266 -0
- package/.claude/skills/using-skillstack/SKILL.md +127 -0
- package/.claude/skills/vercel-deploy/SKILL.md +166 -0
- package/.claude/skills/vercel-deploy/scripts/deploy.sh +249 -0
- package/.claude/skills/verification-before-completion/SKILL.md +305 -0
- package/.claude/skills/writing-plans/SKILL.md +259 -0
- package/README.md +69 -0
- package/bin/cli.js +468 -0
- package/lib/init.js +333 -0
- package/package.json +29 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# UX-Aware Bug Fix Patterns
|
|
2
|
+
|
|
3
|
+
## Core Principle
|
|
4
|
+
|
|
5
|
+
When fixing bugs, consider not just "technical correctness" but also "user experience".
|
|
6
|
+
|
|
7
|
+
| Dimension | Question |
|
|
8
|
+
|-----------|----------|
|
|
9
|
+
| **Responsiveness** | Does UI remain smooth after fix? |
|
|
10
|
+
| **Consistency** | Are frontend and backend states in sync? |
|
|
11
|
+
| **Fault Tolerance** | How to degrade when network/DB fails? |
|
|
12
|
+
| **Interruptibility** | Can user cancel long-running operations? |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Pattern 1: Blocking → Async + Status Polling
|
|
17
|
+
|
|
18
|
+
### Symptoms
|
|
19
|
+
- UI freezes / becomes unresponsive
|
|
20
|
+
- User cannot switch pages
|
|
21
|
+
- Spinner never stops
|
|
22
|
+
|
|
23
|
+
### Root Cause
|
|
24
|
+
```
|
|
25
|
+
User Action → Wait for Backend → Then Continue
|
|
26
|
+
↑
|
|
27
|
+
Blocking here
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Solution
|
|
31
|
+
```
|
|
32
|
+
User Action → Immediate UI Update → Background Task
|
|
33
|
+
↓
|
|
34
|
+
Frontend Polls Status
|
|
35
|
+
↓
|
|
36
|
+
Refresh on Complete
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Implementation
|
|
40
|
+
|
|
41
|
+
**Backend: Task Manager**
|
|
42
|
+
```python
|
|
43
|
+
class BackgroundTaskManager:
|
|
44
|
+
def schedule(self, task_id, session_id, coro):
|
|
45
|
+
self._tasks[task_id] = Task(status="running")
|
|
46
|
+
asyncio.create_task(self._run(task_id, coro))
|
|
47
|
+
|
|
48
|
+
def has_pending(self, session_id):
|
|
49
|
+
return any(t.status == "running" for t in self._tasks.values())
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Backend: Status API**
|
|
53
|
+
```python
|
|
54
|
+
@router.get("/sessions/{id}/save-status")
|
|
55
|
+
def get_status(id):
|
|
56
|
+
return {"is_saving": task_manager.has_pending(id)}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Frontend: Polling**
|
|
60
|
+
```typescript
|
|
61
|
+
const waitForComplete = async (sessionId, pollMs = 300) => {
|
|
62
|
+
while (await checkSaveStatus(sessionId)) {
|
|
63
|
+
await new Promise(r => setTimeout(r, pollMs));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Frontend: Loading Indicator**
|
|
69
|
+
```tsx
|
|
70
|
+
{isSaving && <div>Syncing messages...</div>}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Pattern 2: Connection Lost → Independent Connection
|
|
76
|
+
|
|
77
|
+
### Symptoms
|
|
78
|
+
- `no active connection` error
|
|
79
|
+
- DB connection invalid in finally block
|
|
80
|
+
- Async task uses closed connection
|
|
81
|
+
|
|
82
|
+
### Root Cause
|
|
83
|
+
After request completes, original DB connection may be closed, but background task still uses it.
|
|
84
|
+
|
|
85
|
+
### Solution
|
|
86
|
+
Background tasks use independent database connections.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
# ❌ Reuse caller's connection
|
|
90
|
+
async def background_save(self):
|
|
91
|
+
await self.db.commit() # Connection may be closed
|
|
92
|
+
|
|
93
|
+
# ✅ Create new connection
|
|
94
|
+
async def background_save():
|
|
95
|
+
async with async_session_maker() as new_db:
|
|
96
|
+
new_db.add(message)
|
|
97
|
+
await new_db.commit()
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Pattern 3: State Loss → Local Cache + Sync
|
|
103
|
+
|
|
104
|
+
### Symptoms
|
|
105
|
+
- Data lost after user interrupts
|
|
106
|
+
- Unsaved content disappears on navigation
|
|
107
|
+
- State resets after page refresh
|
|
108
|
+
|
|
109
|
+
### Solution
|
|
110
|
+
```typescript
|
|
111
|
+
// Immediately: Save to localStorage
|
|
112
|
+
const handleInterrupt = () => {
|
|
113
|
+
localStorage.setItem('pending', JSON.stringify(messages));
|
|
114
|
+
stopGeneration();
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// On return: Merge local and server data
|
|
118
|
+
const loadSession = async (id) => {
|
|
119
|
+
const local = JSON.parse(localStorage.getItem('pending'));
|
|
120
|
+
const server = await fetchMessages(id);
|
|
121
|
+
|
|
122
|
+
// Choose more complete version
|
|
123
|
+
if (local?.content.length > server?.content.length) {
|
|
124
|
+
return local;
|
|
125
|
+
}
|
|
126
|
+
return server;
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Pattern 4: Sequential → Parallel Execution
|
|
133
|
+
|
|
134
|
+
### Symptoms
|
|
135
|
+
- Slow page load
|
|
136
|
+
- Multiple requests one after another
|
|
137
|
+
|
|
138
|
+
### Solution
|
|
139
|
+
```python
|
|
140
|
+
# ❌ Sequential
|
|
141
|
+
a = await fetch_a()
|
|
142
|
+
b = await fetch_b()
|
|
143
|
+
|
|
144
|
+
# ✅ Parallel
|
|
145
|
+
a, b = await asyncio.gather(fetch_a(), fetch_b())
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Checklist
|
|
151
|
+
|
|
152
|
+
Before considering a fix complete, ask yourself:
|
|
153
|
+
|
|
154
|
+
- [ ] Does UI remain smooth after fix?
|
|
155
|
+
- [ ] Can long-running operations be cancelled?
|
|
156
|
+
- [ ] How is network failure handled?
|
|
157
|
+
- [ ] Are frontend and backend states consistent?
|
|
158
|
+
- [ ] Will data be lost if user navigates away?
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Windows Terminal Hygiene (Command Discipline)
|
|
2
|
+
|
|
3
|
+
Terminal “hygiene” is about making reproductions and verification trustworthy. On Windows (CMD/PowerShell), small input mistakes (stray characters, chained commands, mixed shells) can make you think a fix worked when you actually ran something else.
|
|
4
|
+
|
|
5
|
+
This guide is cross-project and applies to any repo with CLI workflows.
|
|
6
|
+
|
|
7
|
+
## Defaults (best practices)
|
|
8
|
+
|
|
9
|
+
- Prefer **one command per prompt** (especially during bug reproduction/verification).
|
|
10
|
+
- Prefer **separate steps** for `cd` and execution.
|
|
11
|
+
- Ensure a **clean prompt** before typing the next command (no leftover characters from interrupts/exits).
|
|
12
|
+
- Avoid “clever” command chaining unless you explicitly annotate why it’s safe.
|
|
13
|
+
|
|
14
|
+
## 1) One command per prompt (default)
|
|
15
|
+
|
|
16
|
+
During investigation, clarity beats brevity.
|
|
17
|
+
|
|
18
|
+
### Good (separate steps)
|
|
19
|
+
|
|
20
|
+
```bat
|
|
21
|
+
cd path\to\project
|
|
22
|
+
python -m pytest -q tests\test_example.py
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Avoid by default (chained commands)
|
|
26
|
+
|
|
27
|
+
```bat
|
|
28
|
+
cd path\to\project && python -m pytest -q tests\test_example.py
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Why avoid chaining by default:
|
|
32
|
+
|
|
33
|
+
- It hides which step failed (directory change vs execution).
|
|
34
|
+
- Copy/paste artifacts can silently corrupt the command.
|
|
35
|
+
- Logs become harder to interpret and reproduce.
|
|
36
|
+
|
|
37
|
+
## 2) Keep the prompt “clean”
|
|
38
|
+
|
|
39
|
+
### After interrupts
|
|
40
|
+
|
|
41
|
+
If you press **Ctrl+C** to stop a process:
|
|
42
|
+
|
|
43
|
+
- Wait until the shell returns to a normal prompt.
|
|
44
|
+
- Then type the next command from a clean line.
|
|
45
|
+
|
|
46
|
+
### After interactive exits / stray keystrokes
|
|
47
|
+
|
|
48
|
+
Many tools use single-key commands to exit/quit (e.g., `q`). If you type `q` and then immediately type a command without a clean prompt, you can accidentally run something like `qpython ...`.
|
|
49
|
+
|
|
50
|
+
Default practice:
|
|
51
|
+
|
|
52
|
+
- If you suspect a stray character is present, **press Enter** to flush the line and get a new prompt.
|
|
53
|
+
- If you see the command line starts with an unexpected prefix (e.g., `qpython`), **stop** and retype.
|
|
54
|
+
|
|
55
|
+
Useful line-clearing shortcuts (varies by shell):
|
|
56
|
+
|
|
57
|
+
- CMD: `Esc` often clears the current line
|
|
58
|
+
- PowerShell (PSReadLine): `Ctrl+U` clears the line (if PSReadLine is enabled)
|
|
59
|
+
|
|
60
|
+
## 3) Avoid copy/paste artifacts
|
|
61
|
+
|
|
62
|
+
When copying commands from notes/chat:
|
|
63
|
+
|
|
64
|
+
- Check for leading characters (`>`, `$`, stray letters)
|
|
65
|
+
- Check quotes (smart quotes vs ASCII quotes)
|
|
66
|
+
- Prefer short commands; avoid multi-line unless necessary
|
|
67
|
+
|
|
68
|
+
## 4) Use explicit interpreters/tools when ambiguity exists
|
|
69
|
+
|
|
70
|
+
When multiple versions are installed, prefer explicit paths or the environment’s executable.
|
|
71
|
+
|
|
72
|
+
Examples:
|
|
73
|
+
|
|
74
|
+
- Print the active Python:
|
|
75
|
+
- `python -c "import sys; print(sys.executable)"`
|
|
76
|
+
- Find which Python is being resolved:
|
|
77
|
+
- `where python`
|
|
78
|
+
|
|
79
|
+
If you use a virtual environment, prefer calling its Python directly (no activation drift):
|
|
80
|
+
|
|
81
|
+
```bat
|
|
82
|
+
venv\Scripts\python -m pytest -q
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## 5) Record commands and outcomes (verification-grade logs)
|
|
86
|
+
|
|
87
|
+
For every verification step, capture:
|
|
88
|
+
|
|
89
|
+
- Command (exact)
|
|
90
|
+
- Working directory (if relevant)
|
|
91
|
+
- Exit code
|
|
92
|
+
- Key output lines
|
|
93
|
+
|
|
94
|
+
This makes later debugging and code review substantially faster.
|
|
95
|
+
|
|
96
|
+
## 6) Exceptions (when chaining is acceptable)
|
|
97
|
+
|
|
98
|
+
Chaining can be fine in stable automation scripts (CI) where:
|
|
99
|
+
|
|
100
|
+
- The environment is controlled
|
|
101
|
+
- Logs are captured per step
|
|
102
|
+
- Fail-fast semantics are desired
|
|
103
|
+
|
|
104
|
+
Even then, prefer readability and explicitness in investigation mode.
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Zero-Regression Verification Matrix
|
|
2
|
+
|
|
3
|
+
> The definitive checklist to ensure bug fixes don't break existing functionality or introduce new bugs.
|
|
4
|
+
|
|
5
|
+
## Why This Matrix Exists
|
|
6
|
+
|
|
7
|
+
| Problem | Impact | This Matrix Prevents |
|
|
8
|
+
|---------|--------|---------------------|
|
|
9
|
+
| Fix breaks other feature | User loses functionality | Regression verification |
|
|
10
|
+
| Fix introduces new bug | Two bugs instead of one | Systematic validation |
|
|
11
|
+
| Fix only addresses symptom | Bug returns later | Root cause verification |
|
|
12
|
+
| Fix scope creeps | Unnecessary changes | Minimal change enforcement |
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## The Complete Matrix
|
|
17
|
+
|
|
18
|
+
### Section A: Pre-Fix Baseline (BEFORE writing any fix code)
|
|
19
|
+
|
|
20
|
+
| # | Check | How | Evidence Required | Pass? |
|
|
21
|
+
|---|-------|-----|-------------------|-------|
|
|
22
|
+
| A1 | Bug reproduced | Follow exact repro steps | Screenshot/video/log | ☐ |
|
|
23
|
+
| A2 | Test baseline captured | Run full test suite | Test output saved | ☐ |
|
|
24
|
+
| A3 | Affected files identified | Impact analysis Layer 0-2 | File list (<5 ideal) | ☐ |
|
|
25
|
+
| A4 | Working features listed | Manual check near bug area | Feature checklist | ☐ |
|
|
26
|
+
| A5 | Root cause identified | 5 Whys / Data Flow / Timeline | One-sentence statement | ☐ |
|
|
27
|
+
|
|
28
|
+
**STOP if any A-check fails. You are not ready to fix.**
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
### Section B: Fix Quality (DURING fix implementation)
|
|
33
|
+
|
|
34
|
+
| # | Check | Criteria | Pass? |
|
|
35
|
+
|---|-------|----------|-------|
|
|
36
|
+
| B1 | Minimal LOC | ≤ 20 lines changed (ideal), ≤ 50 lines (max) | ☐ |
|
|
37
|
+
| B2 | Single concern | Only the bug fixed, no refactoring | ☐ |
|
|
38
|
+
| B3 | No new dependencies | No new packages added | ☐ |
|
|
39
|
+
| B4 | No API contract changes | Existing callers unchanged | ☐ |
|
|
40
|
+
| B5 | Config over hardcode | Used solution hierarchy correctly | ☐ |
|
|
41
|
+
| B6 | Old path preserved | For critical: feature flag exists | ☐ |
|
|
42
|
+
|
|
43
|
+
**If B4 fails (API change needed), document and get explicit approval.**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Section C: Correctness Verification (AFTER fix, BEFORE commit)
|
|
48
|
+
|
|
49
|
+
| # | Check | How | Expected | Pass? |
|
|
50
|
+
|---|-------|-----|----------|-------|
|
|
51
|
+
| C1 | Bug fixed | Reproduce original steps | Bug no longer occurs | ☐ |
|
|
52
|
+
| C2 | Root cause addressed | Code review against RCA | Fix targets root cause | ☐ |
|
|
53
|
+
| C3 | Null case | Test with null/undefined input | Handled gracefully | ☐ |
|
|
54
|
+
| C4 | Empty case | Test with empty string/array | Handled gracefully | ☐ |
|
|
55
|
+
| C5 | Boundary case | Test min/max/edge values | Handled gracefully | ☐ |
|
|
56
|
+
| C6 | Error case | Simulate network/DB failure | Fails gracefully | ☐ |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
### Section D: Regression Verification (CRITICAL — FROM IMPACT ANALYSIS)
|
|
61
|
+
|
|
62
|
+
| # | Check | How | Expected | Pass? |
|
|
63
|
+
|---|-------|-----|----------|-------|
|
|
64
|
+
| D1 | Layer 1 (Direct callers) | Test each function calling fixed code | All still work | ☐ |
|
|
65
|
+
| D2 | Layer 2 (Indirect callers) | Test callers of Layer 1 | All still work | ☐ |
|
|
66
|
+
| D3 | Layer 3 (Cross-module) | Verify other modules | No breakage | ☐ |
|
|
67
|
+
| D4 | Layer 4 (API surface) | Test API endpoints | Responses unchanged | ☐ |
|
|
68
|
+
| D5 | Layer 5 (Data flow) | Verify data integrity | No corruption | ☐ |
|
|
69
|
+
| D6 | UI Features | Manual test listed features | All still work | ☐ |
|
|
70
|
+
| D7 | Baseline comparison | Run full test suite again | Same or better than A2 | ☐ |
|
|
71
|
+
|
|
72
|
+
**D7 is the final gate. If tests regress, fix is not ready.**
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### Section E: Code Quality Verification
|
|
77
|
+
|
|
78
|
+
| # | Check | Command | Expected | Pass? |
|
|
79
|
+
|---|-------|---------|----------|-------|
|
|
80
|
+
| E1 | Linter clean | `read_lints` on modified files | Zero new errors | ☐ |
|
|
81
|
+
| E2 | Type check | Language-specific typecheck | Pass | ☐ |
|
|
82
|
+
| E3 | Build succeeds | Full build command | Success | ☐ |
|
|
83
|
+
| E4 | Unit tests | Run affected test files | All pass | ☐ |
|
|
84
|
+
| E5 | Integration tests | Run integration suite | All pass | ☐ |
|
|
85
|
+
| E6 | E2E tests (if applicable) | Run E2E suite | All pass | ☐ |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### Section F: Completeness Check
|
|
90
|
+
|
|
91
|
+
| # | Check | How | Pass? |
|
|
92
|
+
|---|-------|-----|-------|
|
|
93
|
+
| F1 | Similar bugs searched | IDE content search or `rg -n` for the same pattern | All found fixed | ☐ |
|
|
94
|
+
| F2 | Documentation updated | If behavior changed | Docs reflect change | ☐ |
|
|
95
|
+
| F3 | Test for bug added | New test prevents recurrence | Test exists | ☐ |
|
|
96
|
+
| F4 | Commit message clear | Includes bug ID and root cause | Message written | ☐ |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Quick Verification Commands by Stack
|
|
101
|
+
|
|
102
|
+
### Frontend (React/Vue/TypeScript)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# E1-E3: Code quality
|
|
106
|
+
npm run lint
|
|
107
|
+
npm run typecheck # or: npx tsc --noEmit
|
|
108
|
+
npm run build
|
|
109
|
+
|
|
110
|
+
# E4-E6: Tests
|
|
111
|
+
npm test -- --coverage
|
|
112
|
+
npm run test:e2e
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Backend (Python)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# E1-E3: Code quality
|
|
119
|
+
ruff check .
|
|
120
|
+
mypy .
|
|
121
|
+
pip install -e . # or poetry install
|
|
122
|
+
|
|
123
|
+
# E4-E6: Tests
|
|
124
|
+
pytest --cov=src
|
|
125
|
+
pytest tests/integration/
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Backend (Node.js)
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# E1-E3: Code quality
|
|
132
|
+
npm run lint
|
|
133
|
+
npm run build
|
|
134
|
+
|
|
135
|
+
# E4-E6: Tests
|
|
136
|
+
npm test
|
|
137
|
+
npm run test:integration
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Backend (Go)
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# E1-E3: Code quality
|
|
144
|
+
go vet ./...
|
|
145
|
+
golangci-lint run
|
|
146
|
+
go build ./...
|
|
147
|
+
|
|
148
|
+
# E4-E6: Tests
|
|
149
|
+
go test ./... -cover
|
|
150
|
+
go test ./... -tags=integration
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Backend (Java)
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# E1-E6: All in one
|
|
157
|
+
./gradlew check test integrationTest
|
|
158
|
+
# or
|
|
159
|
+
mvn verify
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Verification Report Template
|
|
165
|
+
|
|
166
|
+
Copy and fill after completing the matrix:
|
|
167
|
+
|
|
168
|
+
```markdown
|
|
169
|
+
## Bug Fix Verification Report
|
|
170
|
+
|
|
171
|
+
**Bug ID**: BUG-XXXX
|
|
172
|
+
**Date**: YYYY-MM-DD
|
|
173
|
+
**Fixed By**: [Name]
|
|
174
|
+
|
|
175
|
+
### Summary
|
|
176
|
+
- **Root Cause**: [One sentence]
|
|
177
|
+
- **Fix Approach**: [One sentence]
|
|
178
|
+
- **Files Changed**: [Count] files, [LOC] lines
|
|
179
|
+
|
|
180
|
+
### Matrix Results
|
|
181
|
+
|
|
182
|
+
| Section | Checks | Passed | Notes |
|
|
183
|
+
|---------|--------|--------|-------|
|
|
184
|
+
| A: Pre-Fix Baseline | 5 | 5/5 | |
|
|
185
|
+
| B: Fix Quality | 6 | 6/6 | |
|
|
186
|
+
| C: Correctness | 6 | 6/6 | |
|
|
187
|
+
| D: Regression | 7 | 7/7 | |
|
|
188
|
+
| E: Code Quality | 6 | 6/6 | |
|
|
189
|
+
| F: Completeness | 4 | 4/4 | |
|
|
190
|
+
| **TOTAL** | **34** | **34/34** | ✅ Ready to merge |
|
|
191
|
+
|
|
192
|
+
### Evidence
|
|
193
|
+
- [ ] Screenshot/log of bug fixed
|
|
194
|
+
- [ ] Test baseline before: [link/output]
|
|
195
|
+
- [ ] Test baseline after: [link/output]
|
|
196
|
+
- [ ] Similar bugs found and fixed: [count]
|
|
197
|
+
|
|
198
|
+
### Sign-off
|
|
199
|
+
- [ ] All matrix checks pass
|
|
200
|
+
- [ ] No new lint errors
|
|
201
|
+
- [ ] Test suite green
|
|
202
|
+
- [ ] Ready for review
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## When to Use Zero-Risk Protocol Instead
|
|
208
|
+
|
|
209
|
+
Escalate to `references/zero-risk-protocol.md` if ANY of these apply:
|
|
210
|
+
|
|
211
|
+
| Condition | Action |
|
|
212
|
+
|-----------|--------|
|
|
213
|
+
| Production incident | Zero-Risk Protocol |
|
|
214
|
+
| Payment/Auth/User data affected | Zero-Risk Protocol |
|
|
215
|
+
| Impact analysis reaches Layer 4-5 | Zero-Risk Protocol |
|
|
216
|
+
| Team lead requests "zero-risk" | Zero-Risk Protocol |
|
|
217
|
+
| >50 LOC change required | Zero-Risk Protocol |
|
|
218
|
+
| API contract must change | Zero-Risk Protocol |
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Common Failures and How to Recover
|
|
223
|
+
|
|
224
|
+
| Failure | Symptom | Recovery |
|
|
225
|
+
|---------|---------|----------|
|
|
226
|
+
| D7 fails (tests regress) | New test failures | Revert, investigate, re-fix |
|
|
227
|
+
| B1 fails (too many LOC) | Change >50 lines | Split into smaller changes |
|
|
228
|
+
| C1 fails (bug not fixed) | Bug still occurs | Review RCA, find actual root |
|
|
229
|
+
| F1 fails (similar bugs) | Pattern found elsewhere | Fix all before declaring done |
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## The Golden Rule
|
|
234
|
+
|
|
235
|
+
> **If you cannot pass Section D (Regression), the fix is NOT ready.**
|
|
236
|
+
>
|
|
237
|
+
> No exceptions. No "it should be fine". No "I'll fix it later".
|
|
238
|
+
>
|
|
239
|
+
> A broken fix is worse than no fix.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Zero-Risk Bug Fixing Protocol
|
|
2
|
+
|
|
3
|
+
> Mandatory protocol for critical, high-severity, or production-impacting bugs.
|
|
4
|
+
|
|
5
|
+
Used whenever any of the following applies:
|
|
6
|
+
- Production incident / customer-facing outage
|
|
7
|
+
- Critical or High severity bug
|
|
8
|
+
- Fix touches payment, auth, order, user data, finance, or any “no-downtime” system
|
|
9
|
+
- Impact analysis reaches Layer 4 or Layer 5
|
|
10
|
+
- Team lead / on-call explicitly requests “zero-risk”
|
|
11
|
+
|
|
12
|
+
If in doubt → use this protocol.
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
> “We would rather move slowly and safely than move fast and cause another incident.”
|
|
16
|
+
|
|
17
|
+
## The 7 Non-Negotiable Steps
|
|
18
|
+
|
|
19
|
+
### 1. Immediate Isolation & Safety Perimeter
|
|
20
|
+
- Create a dedicated branch: `hotfix/bug-XXXX-zero-risk`
|
|
21
|
+
- Open a temporary feature flag (even if it doesn’t exist yet):
|
|
22
|
+
```ts
|
|
23
|
+
// Example (LaunchDarkly / Unleash / ConfigCat / self-hosted)
|
|
24
|
+
const USE_ZERO_RISK_FIX = flags['zero-risk-fix-bug-XXXX'] ?? false;
|
|
25
|
+
```
|
|
26
|
+
- Default = `false` (old code path remains active)
|
|
27
|
+
|
|
28
|
+
### 2. Minimal Viable Surgical Fix
|
|
29
|
+
Rules:
|
|
30
|
+
- Change ≤ 15 lines whenever possible
|
|
31
|
+
- Never refactor, rename, or upgrade dependencies in the same PR
|
|
32
|
+
- Add defensive guards only around the exact failure point
|
|
33
|
+
- Keep the old code path intact and reachable when flag is off
|
|
34
|
+
|
|
35
|
+
```diff
|
|
36
|
+
- return user; // buggy
|
|
37
|
+
+ if (!USE_ZERO_RISK_FIX) return user; // old path preserved
|
|
38
|
+
+ if (!user) throw new NotFoundError('User not found');
|
|
39
|
+
+ return user; // new safe path
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. 100% Automated Safety Net (must all pass before any human review)
|
|
43
|
+
Run locally and in CI:
|
|
44
|
+
- Bug reproduction test → must fail on main, pass with flag ON
|
|
45
|
+
- Full unit test suite → unchanged
|
|
46
|
+
- Integration/E2E tests covering the affected user journey
|
|
47
|
+
- Load test (if performance-related)
|
|
48
|
+
- Coverage on changed files = 100%
|
|
49
|
+
|
|
50
|
+
### 4. Canary + Instant Rollback Plan
|
|
51
|
+
Deployment order:
|
|
52
|
+
1. Deploy to Staging → verify smoke tests
|
|
53
|
+
2. Deploy to 0.5–1% of production traffic (or dogfood/internal tenants)
|
|
54
|
+
3. Enable flag for canary traffic only
|
|
55
|
+
4. Monitoring dashboard with these alerts ready:
|
|
56
|
+
- Error rate increase > 0.1%
|
|
57
|
+
- 5xx spike
|
|
58
|
+
- Latency p95 > 2× baseline
|
|
59
|
+
- Specific exception name count > 0
|
|
60
|
+
|
|
61
|
+
Rollback actions (≤ 30 seconds):
|
|
62
|
+
- Turn flag OFF globally → instant
|
|
63
|
+
- Or emergency revert commit if flag cannot be toggled fast enough
|
|
64
|
+
|
|
65
|
+
### 5. Real-Time Observation Window
|
|
66
|
+
Minimum 15–30 minutes (longer for payment/auth paths) with:
|
|
67
|
+
- Engineer watching error dashboard live
|
|
68
|
+
- On-call notified and standing by
|
|
69
|
+
- Slack/Teams war room open
|
|
70
|
+
|
|
71
|
+
### 6. Gradual Rollout
|
|
72
|
+
Only after canary is green:
|
|
73
|
+
- 1% → 10% → 25% → 50% → 100% (each step waits 10–30 min)
|
|
74
|
+
- Keep flag in code until full confidence (usually 24–48h)
|
|
75
|
+
|
|
76
|
+
### 7. Post-Mortem & Hardening
|
|
77
|
+
Mandatory within 24h:
|
|
78
|
+
- Add the bug pattern to common-bugs.md
|
|
79
|
+
- Add automated test that would have caught it
|
|
80
|
+
- Add linter / pre-commit hook if pattern is repeatable
|
|
81
|
+
- Remove or clean up the feature flag (or leave it permanently if useful)
|
|
82
|
+
|
|
83
|
+
## Quick Checklist (copy-paste into PR description)
|
|
84
|
+
|
|
85
|
+
```markdown
|
|
86
|
+
### Zero-Risk Protocol Checklist
|
|
87
|
+
- [ ] Dedicated hotfix branch created
|
|
88
|
+
- [ ] Feature flag added, default OFF
|
|
89
|
+
- [ ] Old code path preserved
|
|
90
|
+
- [ ] Change ≤ 15 LOC
|
|
91
|
+
- [ ] Bug reproduction test fails on main, passes with flag ON
|
|
92
|
+
- [ ] Full test suite green
|
|
93
|
+
- [ ] Coverage 100% on changed files
|
|
94
|
+
- [ ] Canary rollout plan written
|
|
95
|
+
- [ ] Rollback procedure ≤ 30 s
|
|
96
|
+
- [ ] Monitoring alerts configured
|
|
97
|
+
- [ ] War room ready
|
|
98
|
+
- [ ] Post-mortem actions listed
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## One-Liner for PR Title
|
|
102
|
+
`fix(bug-XXXX): zero-risk fix behind feature flag (canary → gradual rollout)`
|