@chankov/agent-skills 0.2.0 → 0.3.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/commands/{doctor.md → doctor-agent-skills.md} +1 -1
- package/.pi/extensions/agent-skills-update-check/README.md +4 -4
- package/.pi/prompts/{doctor.md → doctor-agent-skills.md} +1 -1
- package/.versions/0.2.0/.claude/commands/{doctor.md → doctor-agent-skills.md} +1 -1
- package/.versions/0.2.0/.pi/extensions/agent-skills-update-check/README.md +4 -4
- package/.versions/0.2.0/.pi/prompts/{doctor.md → doctor-agent-skills.md} +1 -1
- package/.versions/0.2.0/skills/guided-workspace-setup/SKILL.md +40 -2
- package/.versions/0.3.0/.claude/commands/build.md +18 -0
- package/.versions/0.3.0/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.3.0/.claude/commands/design-agent.md +14 -0
- package/.versions/0.3.0/.claude/commands/doctor-agent-skills.md +13 -0
- package/.versions/0.3.0/.claude/commands/plan.md +16 -0
- package/.versions/0.3.0/.claude/commands/prime.md +22 -0
- package/.versions/0.3.0/.claude/commands/review.md +16 -0
- package/.versions/0.3.0/.claude/commands/setup-agent-skills.md +19 -0
- package/.versions/0.3.0/.claude/commands/ship.md +17 -0
- package/.versions/0.3.0/.claude/commands/spec.md +15 -0
- package/.versions/0.3.0/.claude/commands/test.md +19 -0
- package/.versions/0.3.0/.opencode/commands/as-build.md +17 -0
- package/.versions/0.3.0/.opencode/commands/as-code-simplify.md +16 -0
- package/.versions/0.3.0/.opencode/commands/as-design-agent.md +15 -0
- package/.versions/0.3.0/.opencode/commands/as-doctor-agent-skills.md +11 -0
- package/.versions/0.3.0/.opencode/commands/as-plan.md +16 -0
- package/.versions/0.3.0/.opencode/commands/as-prime.md +22 -0
- package/.versions/0.3.0/.opencode/commands/as-review.md +15 -0
- package/.versions/0.3.0/.opencode/commands/as-setup-agent-skills.md +11 -0
- package/.versions/0.3.0/.opencode/commands/as-ship.md +16 -0
- package/.versions/0.3.0/.opencode/commands/as-spec.md +16 -0
- package/.versions/0.3.0/.opencode/commands/as-test.md +21 -0
- package/.versions/0.3.0/.pi/agents/agent-chain.yaml +49 -0
- package/.versions/0.3.0/.pi/agents/bowser.md +19 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/agent-expert.md +98 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/cli-expert.md +41 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/config-expert.md +63 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/ext-expert.md +43 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/keybinding-expert.md +134 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/pi-orchestrator.md +57 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/prompt-expert.md +70 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/skill-expert.md +42 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/theme-expert.md +40 -0
- package/.versions/0.3.0/.pi/agents/pi-pi/tui-expert.md +85 -0
- package/.versions/0.3.0/.pi/agents/teams.yaml +31 -0
- package/.versions/0.3.0/.pi/damage-control-rules.yaml +278 -0
- package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/README.md +58 -0
- package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/index.ts +161 -0
- package/.versions/0.3.0/.pi/extensions/agent-skills-update-check/package.json +6 -0
- package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/README.md +39 -0
- package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/index.ts +61 -0
- package/.versions/0.3.0/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.3.0/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.3.0/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.3.0/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.3.0/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.3.0/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.3.0/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.3.0/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.3.0/.pi/extensions/package.json +9 -0
- package/.versions/0.3.0/.pi/harnesses/agent-chain/README.md +37 -0
- package/.versions/0.3.0/.pi/harnesses/agent-chain/index.ts +795 -0
- package/.versions/0.3.0/.pi/harnesses/agent-chain/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/agent-team/README.md +38 -0
- package/.versions/0.3.0/.pi/harnesses/agent-team/index.ts +732 -0
- package/.versions/0.3.0/.pi/harnesses/agent-team/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/coms/README.md +36 -0
- package/.versions/0.3.0/.pi/harnesses/coms/index.ts +1595 -0
- package/.versions/0.3.0/.pi/harnesses/coms/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/coms-net/README.md +46 -0
- package/.versions/0.3.0/.pi/harnesses/coms-net/index.ts +1637 -0
- package/.versions/0.3.0/.pi/harnesses/coms-net/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control/README.md +38 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control/index.ts +207 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control-continue/README.md +37 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control-continue/index.ts +234 -0
- package/.versions/0.3.0/.pi/harnesses/damage-control-continue/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/minimal/README.md +27 -0
- package/.versions/0.3.0/.pi/harnesses/minimal/index.ts +32 -0
- package/.versions/0.3.0/.pi/harnesses/minimal/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.3.0/.pi/harnesses/package.json +9 -0
- package/.versions/0.3.0/.pi/harnesses/pi-pi/README.md +39 -0
- package/.versions/0.3.0/.pi/harnesses/pi-pi/index.ts +631 -0
- package/.versions/0.3.0/.pi/harnesses/pi-pi/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/purpose-gate/README.md +27 -0
- package/.versions/0.3.0/.pi/harnesses/purpose-gate/index.ts +82 -0
- package/.versions/0.3.0/.pi/harnesses/purpose-gate/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/session-replay/README.md +28 -0
- package/.versions/0.3.0/.pi/harnesses/session-replay/index.ts +214 -0
- package/.versions/0.3.0/.pi/harnesses/session-replay/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/subagent-widget/README.md +36 -0
- package/.versions/0.3.0/.pi/harnesses/subagent-widget/index.ts +479 -0
- package/.versions/0.3.0/.pi/harnesses/subagent-widget/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/system-select/README.md +39 -0
- package/.versions/0.3.0/.pi/harnesses/system-select/index.ts +165 -0
- package/.versions/0.3.0/.pi/harnesses/system-select/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/tilldone/README.md +35 -0
- package/.versions/0.3.0/.pi/harnesses/tilldone/index.ts +724 -0
- package/.versions/0.3.0/.pi/harnesses/tilldone/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter/README.md +31 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter/index.ts +100 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter/package.json +6 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/README.md +27 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/index.ts +66 -0
- package/.versions/0.3.0/.pi/harnesses/tool-counter-widget/package.json +6 -0
- package/.versions/0.3.0/.pi/prompts/build.md +24 -0
- package/.versions/0.3.0/.pi/prompts/code-simplify.md +22 -0
- package/.versions/0.3.0/.pi/prompts/doctor-agent-skills.md +13 -0
- package/.versions/0.3.0/.pi/prompts/plan.md +16 -0
- package/.versions/0.3.0/.pi/prompts/review.md +16 -0
- package/.versions/0.3.0/.pi/prompts/setup-agent-skills.md +19 -0
- package/.versions/0.3.0/.pi/prompts/ship.md +17 -0
- package/.versions/0.3.0/.pi/prompts/spec.md +15 -0
- package/.versions/0.3.0/.pi/prompts/test.md +19 -0
- package/.versions/0.3.0/.pi/skills/bowser/SKILL.md +114 -0
- package/.versions/0.3.0/.version +1 -0
- package/.versions/0.3.0/agents/builder.md +6 -0
- package/.versions/0.3.0/agents/code-reviewer.md +93 -0
- package/.versions/0.3.0/agents/documenter.md +6 -0
- package/.versions/0.3.0/agents/plan-reviewer.md +22 -0
- package/.versions/0.3.0/agents/planner.md +6 -0
- package/.versions/0.3.0/agents/scout.md +6 -0
- package/.versions/0.3.0/agents/security-auditor.md +97 -0
- package/.versions/0.3.0/agents/test-engineer.md +89 -0
- package/.versions/0.3.0/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.3.0/hooks/hooks.json +14 -0
- package/.versions/0.3.0/hooks/session-start.sh +74 -0
- package/.versions/0.3.0/hooks/simplify-ignore-test.sh +247 -0
- package/.versions/0.3.0/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.3.0/references/accessibility-checklist.md +159 -0
- package/.versions/0.3.0/references/performance-checklist.md +121 -0
- package/.versions/0.3.0/references/prompting-patterns.md +380 -0
- package/.versions/0.3.0/references/security-checklist.md +134 -0
- package/.versions/0.3.0/references/testing-patterns.md +236 -0
- package/.versions/0.3.0/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.3.0/skills/browser-testing-with-devtools/SKILL.md +335 -0
- package/.versions/0.3.0/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.3.0/skills/code-review-and-quality/SKILL.md +347 -0
- package/.versions/0.3.0/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.3.0/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.3.0/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.3.0/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.3.0/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.3.0/skills/designing-agents/pi-harness-authoring.md +213 -0
- package/.versions/0.3.0/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.3.0/skills/frontend-ui-engineering/SKILL.md +322 -0
- package/.versions/0.3.0/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.3.0/skills/guided-workspace-setup/SKILL.md +331 -0
- package/.versions/0.3.0/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.3.0/skills/idea-refine/examples.md +238 -0
- package/.versions/0.3.0/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.3.0/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.3.0/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.3.0/skills/incremental-implementation/SKILL.md +279 -0
- package/.versions/0.3.0/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.3.0/skills/planning-and-task-breakdown/SKILL.md +237 -0
- package/.versions/0.3.0/skills/security-and-hardening/SKILL.md +349 -0
- package/.versions/0.3.0/skills/shipping-and-launch/SKILL.md +309 -0
- package/.versions/0.3.0/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.3.0/skills/spec-driven-development/SKILL.md +237 -0
- package/.versions/0.3.0/skills/test-driven-development/SKILL.md +379 -0
- package/.versions/0.3.0/skills/using-agent-skills/SKILL.md +176 -0
- package/CHANGELOG.md +72 -0
- package/README.md +5 -5
- package/bin/cli.js +100 -24
- package/bin/lib/bootstrap.js +254 -0
- package/bin/lib/doctor.js +1 -1
- package/docs/getting-started.md +2 -2
- package/docs/npm-install.md +34 -11
- package/package.json +1 -1
- package/skills/guided-workspace-setup/SKILL.md +40 -2
- /package/.claude/commands/{setup.md → setup-agent-skills.md} +0 -0
- /package/.opencode/commands/{as-doctor.md → as-doctor-agent-skills.md} +0 -0
- /package/.opencode/commands/{as-setup.md → as-setup-agent-skills.md} +0 -0
- /package/.pi/prompts/{setup.md → setup-agent-skills.md} +0 -0
- /package/.versions/0.2.0/.claude/commands/{setup.md → setup-agent-skills.md} +0 -0
- /package/.versions/0.2.0/.opencode/commands/{as-doctor.md → as-doctor-agent-skills.md} +0 -0
- /package/.versions/0.2.0/.opencode/commands/{as-setup.md → as-setup-agent-skills.md} +0 -0
- /package/.versions/0.2.0/.pi/prompts/{setup.md → setup-agent-skills.md} +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: shipping-and-launch
|
|
3
|
+
description: Prepares production launches. Use when preparing to deploy to production. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Shipping and Launch
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Ship with confidence. The goal is not just to deploy — it's to deploy safely, with monitoring in place, a rollback plan ready, and a clear understanding of what success looks like. Every launch should be reversible, observable, and incremental.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Deploying a feature to production for the first time
|
|
15
|
+
- Releasing a significant change to users
|
|
16
|
+
- Migrating data or infrastructure
|
|
17
|
+
- Opening a beta or early access program
|
|
18
|
+
- Any deployment that carries risk (all of them)
|
|
19
|
+
|
|
20
|
+
## The Pre-Launch Checklist
|
|
21
|
+
|
|
22
|
+
### Code Quality
|
|
23
|
+
|
|
24
|
+
- [ ] All tests pass (unit, integration, e2e)
|
|
25
|
+
- [ ] Build succeeds with no warnings
|
|
26
|
+
- [ ] Lint and type checking pass
|
|
27
|
+
- [ ] Code reviewed and approved
|
|
28
|
+
- [ ] No TODO comments that should be resolved before launch
|
|
29
|
+
- [ ] No `console.log` debugging statements in production code
|
|
30
|
+
- [ ] Error handling covers expected failure modes
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
|
|
34
|
+
- [ ] No secrets in code or version control
|
|
35
|
+
- [ ] `npm audit` shows no critical or high vulnerabilities
|
|
36
|
+
- [ ] Input validation on all user-facing endpoints
|
|
37
|
+
- [ ] Authentication and authorization checks in place
|
|
38
|
+
- [ ] Security headers configured (CSP, HSTS, etc.)
|
|
39
|
+
- [ ] Rate limiting on authentication endpoints
|
|
40
|
+
- [ ] CORS configured to specific origins (not wildcard)
|
|
41
|
+
|
|
42
|
+
### Performance
|
|
43
|
+
|
|
44
|
+
- [ ] Core Web Vitals within "Good" thresholds
|
|
45
|
+
- [ ] No N+1 queries in critical paths
|
|
46
|
+
- [ ] Images optimized (compression, responsive sizes, lazy loading)
|
|
47
|
+
- [ ] Bundle size within budget
|
|
48
|
+
- [ ] Database queries have appropriate indexes
|
|
49
|
+
- [ ] Caching configured for static assets and repeated queries
|
|
50
|
+
|
|
51
|
+
### Accessibility
|
|
52
|
+
|
|
53
|
+
- [ ] Keyboard navigation works for all interactive elements
|
|
54
|
+
- [ ] Screen reader can convey page content and structure
|
|
55
|
+
- [ ] Color contrast meets WCAG 2.1 AA (4.5:1 for text)
|
|
56
|
+
- [ ] Focus management correct for modals and dynamic content
|
|
57
|
+
- [ ] Error messages are descriptive and associated with form fields
|
|
58
|
+
- [ ] No accessibility warnings in axe-core or Lighthouse
|
|
59
|
+
|
|
60
|
+
### Infrastructure
|
|
61
|
+
|
|
62
|
+
- [ ] Environment variables set in production
|
|
63
|
+
- [ ] Database migrations applied (or ready to apply)
|
|
64
|
+
- [ ] DNS and SSL configured
|
|
65
|
+
- [ ] CDN configured for static assets
|
|
66
|
+
- [ ] Logging and error reporting configured
|
|
67
|
+
- [ ] Health check endpoint exists and responds
|
|
68
|
+
|
|
69
|
+
### Documentation
|
|
70
|
+
|
|
71
|
+
- [ ] README updated with any new setup requirements
|
|
72
|
+
- [ ] API documentation current
|
|
73
|
+
- [ ] ADRs written for any architectural decisions
|
|
74
|
+
- [ ] Changelog updated
|
|
75
|
+
- [ ] User-facing documentation updated (if applicable)
|
|
76
|
+
|
|
77
|
+
## Feature Flag Strategy
|
|
78
|
+
|
|
79
|
+
Ship behind feature flags to decouple deployment from release:
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
// Feature flag check
|
|
83
|
+
const flags = await getFeatureFlags(userId);
|
|
84
|
+
|
|
85
|
+
if (flags.taskSharing) {
|
|
86
|
+
// New feature: task sharing
|
|
87
|
+
return <TaskSharingPanel task={task} />;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Default: existing behavior
|
|
91
|
+
return null;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Feature flag lifecycle:**
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
1. DEPLOY with flag OFF → Code is in production but inactive
|
|
98
|
+
2. ENABLE for team/beta → Internal testing in production environment
|
|
99
|
+
3. GRADUAL ROLLOUT → 5% → 25% → 50% → 100% of users
|
|
100
|
+
4. MONITOR at each stage → Watch error rates, performance, user feedback
|
|
101
|
+
5. CLEAN UP → Remove flag and dead code path after full rollout
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Rules:**
|
|
105
|
+
- Every feature flag has an owner and an expiration date
|
|
106
|
+
- Clean up flags within 2 weeks of full rollout
|
|
107
|
+
- Don't nest feature flags (creates exponential combinations)
|
|
108
|
+
- Test both flag states (on and off) in CI
|
|
109
|
+
|
|
110
|
+
## Staged Rollout
|
|
111
|
+
|
|
112
|
+
### The Rollout Sequence
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
1. DEPLOY to staging
|
|
116
|
+
└── Full test suite in staging environment
|
|
117
|
+
└── Manual smoke test of critical flows
|
|
118
|
+
|
|
119
|
+
2. DEPLOY to production (feature flag OFF)
|
|
120
|
+
└── Verify deployment succeeded (health check)
|
|
121
|
+
└── Check error monitoring (no new errors)
|
|
122
|
+
|
|
123
|
+
3. ENABLE for team (flag ON for internal users)
|
|
124
|
+
└── Team uses the feature in production
|
|
125
|
+
└── 24-hour monitoring window
|
|
126
|
+
|
|
127
|
+
4. CANARY rollout (flag ON for 5% of users)
|
|
128
|
+
└── Monitor error rates, latency, user behavior
|
|
129
|
+
└── Compare metrics: canary vs. baseline
|
|
130
|
+
└── 24-48 hour monitoring window
|
|
131
|
+
└── Advance only if all thresholds pass (see table below)
|
|
132
|
+
|
|
133
|
+
5. GRADUAL increase (25% -> 50% -> 100%)
|
|
134
|
+
└── Same monitoring at each step
|
|
135
|
+
└── Ability to roll back to previous percentage at any point
|
|
136
|
+
|
|
137
|
+
6. FULL rollout (flag ON for all users)
|
|
138
|
+
└── Monitor for 1 week
|
|
139
|
+
└── Clean up feature flag
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Rollout Decision Thresholds
|
|
143
|
+
|
|
144
|
+
Use these thresholds to decide whether to advance, hold, or roll back at each stage:
|
|
145
|
+
|
|
146
|
+
| Metric | Advance (green) | Hold and investigate (yellow) | Roll back (red) |
|
|
147
|
+
|--------|-----------------|-------------------------------|-----------------|
|
|
148
|
+
| Error rate | Within 10% of baseline | 10-100% above baseline | >2x baseline |
|
|
149
|
+
| P95 latency | Within 20% of baseline | 20-50% above baseline | >50% above baseline |
|
|
150
|
+
| Client JS errors | No new error types | New errors at <0.1% of sessions | New errors at >0.1% of sessions |
|
|
151
|
+
| Business metrics | Neutral or positive | Decline <5% (may be noise) | Decline >5% |
|
|
152
|
+
|
|
153
|
+
### When to Roll Back
|
|
154
|
+
|
|
155
|
+
Roll back immediately if:
|
|
156
|
+
- Error rate increases by more than 2x baseline
|
|
157
|
+
- P95 latency increases by more than 50%
|
|
158
|
+
- User-reported issues spike
|
|
159
|
+
- Data integrity issues detected
|
|
160
|
+
- Security vulnerability discovered
|
|
161
|
+
|
|
162
|
+
## Monitoring and Observability
|
|
163
|
+
|
|
164
|
+
### What to Monitor
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
Application metrics:
|
|
168
|
+
├── Error rate (total and by endpoint)
|
|
169
|
+
├── Response time (p50, p95, p99)
|
|
170
|
+
├── Request volume
|
|
171
|
+
├── Active users
|
|
172
|
+
└── Key business metrics (conversion, engagement)
|
|
173
|
+
|
|
174
|
+
Infrastructure metrics:
|
|
175
|
+
├── CPU and memory utilization
|
|
176
|
+
├── Database connection pool usage
|
|
177
|
+
├── Disk space
|
|
178
|
+
├── Network latency
|
|
179
|
+
└── Queue depth (if applicable)
|
|
180
|
+
|
|
181
|
+
Client metrics:
|
|
182
|
+
├── Core Web Vitals (LCP, INP, CLS)
|
|
183
|
+
├── JavaScript errors
|
|
184
|
+
├── API error rates from client perspective
|
|
185
|
+
└── Page load time
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Error Reporting
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// Set up error boundary with reporting
|
|
192
|
+
class ErrorBoundary extends React.Component {
|
|
193
|
+
componentDidCatch(error: Error, info: React.ErrorInfo) {
|
|
194
|
+
// Report to error tracking service
|
|
195
|
+
reportError(error, {
|
|
196
|
+
componentStack: info.componentStack,
|
|
197
|
+
userId: getCurrentUser()?.id,
|
|
198
|
+
page: window.location.pathname,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
render() {
|
|
203
|
+
if (this.state.hasError) {
|
|
204
|
+
return <ErrorFallback onRetry={() => this.setState({ hasError: false })} />;
|
|
205
|
+
}
|
|
206
|
+
return this.props.children;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Server-side error reporting
|
|
211
|
+
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
|
|
212
|
+
reportError(err, {
|
|
213
|
+
method: req.method,
|
|
214
|
+
url: req.url,
|
|
215
|
+
userId: req.user?.id,
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// Don't expose internals to users
|
|
219
|
+
res.status(500).json({
|
|
220
|
+
error: { code: 'INTERNAL_ERROR', message: 'Something went wrong' },
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Post-Launch Verification
|
|
226
|
+
|
|
227
|
+
In the first hour after launch:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
1. Check health endpoint returns 200
|
|
231
|
+
2. Check error monitoring dashboard (no new error types)
|
|
232
|
+
3. Check latency dashboard (no regression)
|
|
233
|
+
4. Test the critical user flow manually
|
|
234
|
+
5. Verify logs are flowing and readable
|
|
235
|
+
6. Confirm rollback mechanism works (dry run if possible)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## Rollback Strategy
|
|
239
|
+
|
|
240
|
+
Every deployment needs a rollback plan before it happens:
|
|
241
|
+
|
|
242
|
+
```markdown
|
|
243
|
+
## Rollback Plan for [Feature/Release]
|
|
244
|
+
|
|
245
|
+
### Trigger Conditions
|
|
246
|
+
- Error rate > 2x baseline
|
|
247
|
+
- P95 latency > [X]ms
|
|
248
|
+
- User reports of [specific issue]
|
|
249
|
+
|
|
250
|
+
### Rollback Steps
|
|
251
|
+
1. Disable feature flag (if applicable)
|
|
252
|
+
OR
|
|
253
|
+
1. Deploy previous version: `git revert <commit> && git push`
|
|
254
|
+
2. Verify rollback: health check, error monitoring
|
|
255
|
+
3. Communicate: notify team of rollback
|
|
256
|
+
|
|
257
|
+
### Database Considerations
|
|
258
|
+
- Migration [X] has a rollback: `npx prisma migrate rollback`
|
|
259
|
+
- Data inserted by new feature: [preserved / cleaned up]
|
|
260
|
+
|
|
261
|
+
### Time to Rollback
|
|
262
|
+
- Feature flag: < 1 minute
|
|
263
|
+
- Redeploy previous version: < 5 minutes
|
|
264
|
+
- Database rollback: < 15 minutes
|
|
265
|
+
```
|
|
266
|
+
## See Also
|
|
267
|
+
|
|
268
|
+
- For security pre-launch checks, see `references/security-checklist.md`
|
|
269
|
+
- For performance pre-launch checklist, see `references/performance-checklist.md`
|
|
270
|
+
- For accessibility verification before launch, see `references/accessibility-checklist.md`
|
|
271
|
+
|
|
272
|
+
## Common Rationalizations
|
|
273
|
+
|
|
274
|
+
| Rationalization | Reality |
|
|
275
|
+
|---|---|
|
|
276
|
+
| "It works in staging, it'll work in production" | Production has different data, traffic patterns, and edge cases. Monitor after deploy. |
|
|
277
|
+
| "We don't need feature flags for this" | Every feature benefits from a kill switch. Even "simple" changes can break things. |
|
|
278
|
+
| "Monitoring is overhead" | Not having monitoring means you discover problems from user complaints instead of dashboards. |
|
|
279
|
+
| "We'll add monitoring later" | Add it before launch. You can't debug what you can't see. |
|
|
280
|
+
| "Rolling back is admitting failure" | Rolling back is responsible engineering. Shipping a broken feature is the failure. |
|
|
281
|
+
|
|
282
|
+
## Red Flags
|
|
283
|
+
|
|
284
|
+
- Deploying without a rollback plan
|
|
285
|
+
- No monitoring or error reporting in production
|
|
286
|
+
- Big-bang releases (everything at once, no staging)
|
|
287
|
+
- Feature flags with no expiration or owner
|
|
288
|
+
- No one monitoring the deploy for the first hour
|
|
289
|
+
- Production environment configuration done by memory, not code
|
|
290
|
+
- "It's Friday afternoon, let's ship it"
|
|
291
|
+
|
|
292
|
+
## Verification
|
|
293
|
+
|
|
294
|
+
Before deploying:
|
|
295
|
+
|
|
296
|
+
- [ ] Pre-launch checklist completed (all sections green)
|
|
297
|
+
- [ ] Feature flag configured (if applicable)
|
|
298
|
+
- [ ] Rollback plan documented
|
|
299
|
+
- [ ] Monitoring dashboards set up
|
|
300
|
+
- [ ] Team notified of deployment
|
|
301
|
+
|
|
302
|
+
After deploying:
|
|
303
|
+
|
|
304
|
+
- [ ] Health check returns 200
|
|
305
|
+
- [ ] Error rate is normal
|
|
306
|
+
- [ ] Latency is normal
|
|
307
|
+
- [ ] Critical user flow works
|
|
308
|
+
- [ ] Logs are flowing
|
|
309
|
+
- [ ] Rollback tested or verified ready
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: source-driven-development
|
|
3
|
+
description: Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Source-Driven Development
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Every framework-specific code decision must be backed by official documentation. Don't implement from memory — verify, cite, and let the user see your sources. Training data goes stale, APIs get deprecated, best practices evolve. This skill ensures the user gets code they can trust because every pattern traces back to an authoritative source they can check.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- The user wants code that follows current best practices for a given framework
|
|
15
|
+
- Building boilerplate, starter code, or patterns that will be copied across a project
|
|
16
|
+
- The user explicitly asks for documented, verified, or "correct" implementation
|
|
17
|
+
- Implementing features where the framework's recommended approach matters (forms, routing, data fetching, state management, auth)
|
|
18
|
+
- Reviewing or improving code that uses framework-specific patterns
|
|
19
|
+
- Any time you are about to write framework-specific code from memory
|
|
20
|
+
|
|
21
|
+
**When NOT to use:**
|
|
22
|
+
|
|
23
|
+
- Correctness does not depend on a specific version (renaming variables, fixing typos, moving files)
|
|
24
|
+
- Pure logic that works the same across all versions (loops, conditionals, data structures)
|
|
25
|
+
- The user explicitly wants speed over verification ("just do it quickly")
|
|
26
|
+
|
|
27
|
+
## The Process
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
DETECT ──→ FETCH ──→ IMPLEMENT ──→ CITE
|
|
31
|
+
│ │ │ │
|
|
32
|
+
▼ ▼ ▼ ▼
|
|
33
|
+
What Get the Follow the Show your
|
|
34
|
+
stack? relevant documented sources
|
|
35
|
+
docs patterns
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Step 1: Detect Stack and Versions
|
|
39
|
+
|
|
40
|
+
Read the project's dependency file to identify exact versions:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
package.json → Node/React/Vue/Angular/Svelte
|
|
44
|
+
composer.json → PHP/Symfony/Laravel
|
|
45
|
+
requirements.txt / pyproject.toml → Python/Django/Flask
|
|
46
|
+
go.mod → Go
|
|
47
|
+
Cargo.toml → Rust
|
|
48
|
+
Gemfile → Ruby/Rails
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
State what you found explicitly:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
STACK DETECTED:
|
|
55
|
+
- React 19.1.0 (from package.json)
|
|
56
|
+
- Vite 6.2.0
|
|
57
|
+
- Tailwind CSS 4.0.3
|
|
58
|
+
→ Fetching official docs for the relevant patterns.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If versions are missing or ambiguous, **ask the user**. Don't guess — the version determines which patterns are correct.
|
|
62
|
+
|
|
63
|
+
### Step 2: Fetch Official Documentation
|
|
64
|
+
|
|
65
|
+
Fetch the specific documentation page for the feature you're implementing. Not the homepage, not the full docs — the relevant page.
|
|
66
|
+
|
|
67
|
+
**Source hierarchy (in order of authority):**
|
|
68
|
+
|
|
69
|
+
| Priority | Source | Example |
|
|
70
|
+
|----------|--------|---------|
|
|
71
|
+
| 1 | Official documentation | react.dev, docs.djangoproject.com, symfony.com/doc |
|
|
72
|
+
| 2 | Official blog / changelog | react.dev/blog, nextjs.org/blog |
|
|
73
|
+
| 3 | Web standards references | MDN, web.dev, html.spec.whatwg.org |
|
|
74
|
+
| 4 | Browser/runtime compatibility | caniuse.com, node.green |
|
|
75
|
+
|
|
76
|
+
**Not authoritative — never cite as primary sources:**
|
|
77
|
+
|
|
78
|
+
- Stack Overflow answers
|
|
79
|
+
- Blog posts or tutorials (even popular ones)
|
|
80
|
+
- AI-generated documentation or summaries
|
|
81
|
+
- Your own training data (that is the whole point — verify it)
|
|
82
|
+
|
|
83
|
+
**Be precise with what you fetch:**
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
BAD: Fetch the React homepage
|
|
87
|
+
GOOD: Fetch react.dev/reference/react/useActionState
|
|
88
|
+
|
|
89
|
+
BAD: Search "django authentication best practices"
|
|
90
|
+
GOOD: Fetch docs.djangoproject.com/en/6.0/topics/auth/
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
After fetching, extract the key patterns and note any deprecation warnings or migration guidance.
|
|
94
|
+
|
|
95
|
+
When official sources conflict with each other (e.g. a migration guide contradicts the API reference), surface the discrepancy to the user and verify which pattern actually works against the detected version.
|
|
96
|
+
|
|
97
|
+
### Step 3: Implement Following Documented Patterns
|
|
98
|
+
|
|
99
|
+
Write code that matches what the documentation shows:
|
|
100
|
+
|
|
101
|
+
- Use the API signatures from the docs, not from memory
|
|
102
|
+
- If the docs show a new way to do something, use the new way
|
|
103
|
+
- If the docs deprecate a pattern, don't use the deprecated version
|
|
104
|
+
- If the docs don't cover something, flag it as unverified
|
|
105
|
+
|
|
106
|
+
**When docs conflict with existing project code:**
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
CONFLICT DETECTED:
|
|
110
|
+
The existing codebase uses useState for form loading state,
|
|
111
|
+
but React 19 docs recommend useActionState for this pattern.
|
|
112
|
+
(Source: react.dev/reference/react/useActionState)
|
|
113
|
+
|
|
114
|
+
Options:
|
|
115
|
+
A) Use the modern pattern (useActionState) — consistent with current docs
|
|
116
|
+
B) Match existing code (useState) — consistent with codebase
|
|
117
|
+
→ Which approach do you prefer?
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Surface the conflict. Don't silently pick one.
|
|
121
|
+
|
|
122
|
+
### Step 4: Cite Your Sources
|
|
123
|
+
|
|
124
|
+
Every framework-specific pattern gets a citation. The user must be able to verify every decision.
|
|
125
|
+
|
|
126
|
+
**In code comments:**
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
// React 19 form handling with useActionState
|
|
130
|
+
// Source: https://react.dev/reference/react/useActionState#usage
|
|
131
|
+
const [state, formAction, isPending] = useActionState(submitOrder, initialState);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**In conversation:**
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
I'm using useActionState instead of manual useState for the
|
|
138
|
+
form submission state. React 19 replaced the manual
|
|
139
|
+
isPending/setIsPending pattern with this hook.
|
|
140
|
+
|
|
141
|
+
Source: https://react.dev/blog/2024/12/05/react-19#actions
|
|
142
|
+
"useTransition now supports async functions [...] to handle
|
|
143
|
+
pending states automatically"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Citation rules:**
|
|
147
|
+
|
|
148
|
+
- Full URLs, not shortened
|
|
149
|
+
- Prefer deep links with anchors where possible (e.g. `/useActionState#usage` over `/useActionState`) — anchors survive doc restructuring better than top-level pages
|
|
150
|
+
- Quote the relevant passage when it supports a non-obvious decision
|
|
151
|
+
- Include browser/runtime support data when recommending platform features
|
|
152
|
+
- If you cannot find documentation for a pattern, say so explicitly:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
UNVERIFIED: I could not find official documentation for this
|
|
156
|
+
pattern. This is based on training data and may be outdated.
|
|
157
|
+
Verify before using in production.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Honesty about what you couldn't verify is more valuable than false confidence.
|
|
161
|
+
|
|
162
|
+
## Common Rationalizations
|
|
163
|
+
|
|
164
|
+
| Rationalization | Reality |
|
|
165
|
+
|---|---|
|
|
166
|
+
| "I'm confident about this API" | Confidence is not evidence. Training data contains outdated patterns that look correct but break against current versions. Verify. |
|
|
167
|
+
| "Fetching docs wastes tokens" | Hallucinating an API wastes more. The user debugs for an hour, then discovers the function signature changed. One fetch prevents hours of rework. |
|
|
168
|
+
| "The docs won't have what I need" | If the docs don't cover it, that's valuable information — the pattern may not be officially recommended. |
|
|
169
|
+
| "I'll just mention it might be outdated" | A disclaimer doesn't help. Either verify and cite, or clearly flag it as unverified. Hedging is the worst option. |
|
|
170
|
+
| "This is a simple task, no need to check" | Simple tasks with wrong patterns become templates. The user copies your deprecated form handler into ten components before discovering the modern approach exists. |
|
|
171
|
+
|
|
172
|
+
## Red Flags
|
|
173
|
+
|
|
174
|
+
- Writing framework-specific code without checking the docs for that version
|
|
175
|
+
- Using "I believe" or "I think" about an API instead of citing the source
|
|
176
|
+
- Implementing a pattern without knowing which version it applies to
|
|
177
|
+
- Citing Stack Overflow or blog posts instead of official documentation
|
|
178
|
+
- Using deprecated APIs because they appear in training data
|
|
179
|
+
- Not reading `package.json` / dependency files before implementing
|
|
180
|
+
- Delivering code without source citations for framework-specific decisions
|
|
181
|
+
- Fetching an entire docs site when only one page is relevant
|
|
182
|
+
|
|
183
|
+
## Verification
|
|
184
|
+
|
|
185
|
+
After implementing with source-driven development:
|
|
186
|
+
|
|
187
|
+
- [ ] Framework and library versions were identified from the dependency file
|
|
188
|
+
- [ ] Official documentation was fetched for framework-specific patterns
|
|
189
|
+
- [ ] All sources are official documentation, not blog posts or training data
|
|
190
|
+
- [ ] Code follows the patterns shown in the current version's documentation
|
|
191
|
+
- [ ] Non-trivial decisions include source citations with full URLs
|
|
192
|
+
- [ ] No deprecated APIs are used (checked against migration guides)
|
|
193
|
+
- [ ] Conflicts between docs and existing code were surfaced to the user
|
|
194
|
+
- [ ] Anything that could not be verified is explicitly flagged as unverified
|