jettypod 4.1.1 → 4.1.3
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/.devpod/current-work.json +10 -0
- package/.devpod/work.db +0 -0
- package/package.json +3 -2
- package/skills-templates/stable-mode/SKILL.md +62 -36
- package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/stable-mode/SKILL.md +62 -36
- package/test-tmp/external-transition-1762983159304/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983159304/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983159545/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983159545/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983159795/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983159795/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160031/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160031/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160249/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160249/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160548/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160548/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160653/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160653/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160783/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160783/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160886/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160886/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983160988/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983160988/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983161151/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983161151/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983161276/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983161276/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983161477/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983161477/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/external-transition-1762983161583/.claude/settings.json +24 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/epic-planning/SKILL.md +297 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/external-transition/SKILL.md +384 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/feature-planning/SKILL.md +464 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/production-mode/SKILL.md +369 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/speed-mode/SKILL.md +481 -0
- package/test-tmp/external-transition-1762983161583/.claude/skills/stable-mode/SKILL.md +713 -0
- package/test-tmp/production-mode-1762983158973/features/test-feature.feature +22 -0
- package/test-tmp/production-mode-1762983158988/features/new-feature.feature +17 -0
- package/test-tmp/production-mode-1762983159002/features/test-feature.feature +4 -0
- package/test-tmp/production-mode-1762983159007/features/test-feature.feature +4 -0
- package/test-tmp/production-mode-1762983159013/features/test-feature.feature +4 -0
- package/test-tmp/production-mode-1762983159019/features/test-feature.feature +4 -0
- package/test-tmp/production-mode-1762983159034/features/test-feature.feature +4 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/settings.json +0 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/epic-planning/SKILL.md +0 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/external-transition/SKILL.md +0 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/feature-planning/SKILL.md +0 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/production-mode/SKILL.md +0 -0
- /package/test-tmp/{external-transition-1762982858258 → external-transition-1762983159050}/.claude/skills/speed-mode/SKILL.md +0 -0
- /package/test-tmp/{production-mode-1762982854924 → production-mode-1762983158995}/features/test-feature.feature +0 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: production-mode
|
|
3
|
+
description: Guide implementation of production mode chores with production standards validation. Use when user starts work on a production mode chore. Detects context (Scenario A/B/C), validates/generates scenarios, and implements production hardening comprehensively.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Production Mode Skill
|
|
7
|
+
|
|
8
|
+
Guides Claude Code through production mode implementation with focus on security, scale, and compliance. Autonomous execution - Claude Code writes the code.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
When this skill is activated, you are helping implement a production mode chore to add production hardening. Follow this structured approach:
|
|
13
|
+
|
|
14
|
+
### Overview
|
|
15
|
+
|
|
16
|
+
**Production Mode Goal:** Harden features for production deployment with security, performance, and compliance standards.
|
|
17
|
+
|
|
18
|
+
**CRITICAL CONTEXT DETECTION:**
|
|
19
|
+
- Production mode has **3 different starting scenarios** (A/B/C)
|
|
20
|
+
- **Must detect context first** before proceeding
|
|
21
|
+
- Different workflows for each scenario
|
|
22
|
+
|
|
23
|
+
**Key Principles:**
|
|
24
|
+
- **Context-aware execution** - adapt to Scenario A/B/C
|
|
25
|
+
- **Standards-driven** - use production standards from external-transition
|
|
26
|
+
- **Autonomous execution** - Claude Code writes code, user confirms approach
|
|
27
|
+
- **Comprehensive hardening** - security, performance, compliance, infrastructure
|
|
28
|
+
|
|
29
|
+
**User Profile:** May not know how to code - Claude Code does the implementation autonomously.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Implementation Steps
|
|
34
|
+
|
|
35
|
+
### Step 0: Detect Production Context (CRITICAL FIRST STEP)
|
|
36
|
+
|
|
37
|
+
**MUST RUN FIRST:** Detect which scenario applies to this feature.
|
|
38
|
+
|
|
39
|
+
**Code to detect context:**
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
const { detectContext } = require('../../lib/production-context-detector');
|
|
43
|
+
const { getCurrentWork } = require('../../lib/current-work');
|
|
44
|
+
const { getDb } = require('../../lib/database');
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
const currentWork = getCurrentWork();
|
|
48
|
+
|
|
49
|
+
if (!currentWork) {
|
|
50
|
+
console.error('❌ No current work found. Run: jettypod work start <chore-id>');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!currentWork.parent_id) {
|
|
55
|
+
console.error('❌ Current work has no parent feature.');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const featureId = currentWork.parent_id;
|
|
60
|
+
const scenario = await detectContext(featureId);
|
|
61
|
+
|
|
62
|
+
console.log(`📋 Detected: ${scenario}`);
|
|
63
|
+
|
|
64
|
+
// Proceed with appropriate workflow
|
|
65
|
+
if (scenario === 'SCENARIO_A') {
|
|
66
|
+
// Fresh from stable mode - quick validation
|
|
67
|
+
} else if (scenario === 'SCENARIO_B') {
|
|
68
|
+
// Gap in time - re-validation
|
|
69
|
+
} else {
|
|
70
|
+
// Scenario C - generate from standards
|
|
71
|
+
}
|
|
72
|
+
} catch (err) {
|
|
73
|
+
console.error('❌ Context detection failed:', err.message);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Three Scenarios:**
|
|
79
|
+
|
|
80
|
+
**Scenario A: Fresh from Stable (Hot Context)**
|
|
81
|
+
- Production scenarios exist
|
|
82
|
+
- Production chores exist
|
|
83
|
+
- Completed stable ≤ 1 day ago
|
|
84
|
+
- **Workflow:** Quick validation → fill gaps → implement
|
|
85
|
+
|
|
86
|
+
**Scenario B: Gap in Time (Cold Context)**
|
|
87
|
+
- Production scenarios exist
|
|
88
|
+
- Production chores exist
|
|
89
|
+
- Completed stable > 1 day ago OR project state changed
|
|
90
|
+
- **Workflow:** Re-validate → update scenarios → implement
|
|
91
|
+
|
|
92
|
+
**Scenario C: Post External-Transition (New Infrastructure)**
|
|
93
|
+
- NO production scenarios exist
|
|
94
|
+
- NO production chores exist
|
|
95
|
+
- **Workflow:** Generate scenarios → create chores → implement
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### Step 1: Read Production Standards
|
|
100
|
+
|
|
101
|
+
**For all scenarios:** Read production standards file.
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
const { readStandards, standardsFileExists } = require('../../lib/production-standards-reader');
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
if (!standardsFileExists()) {
|
|
108
|
+
console.error('❌ Production standards file not found.');
|
|
109
|
+
console.log('Run external-transition first to generate production standards.');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const standards = await readStandards();
|
|
114
|
+
console.log(`📋 Loaded ${standards.standards.length} production standards`);
|
|
115
|
+
console.log(`Preset: ${standards.preset}`);
|
|
116
|
+
|
|
117
|
+
// Show domains
|
|
118
|
+
const domains = await getDomains();
|
|
119
|
+
console.log(`Domains: ${domains.join(', ')}`);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
console.error('❌ Failed to read production standards:', err.message);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Step 2A: Validate Scenarios (Scenario A - Hot Context)
|
|
129
|
+
|
|
130
|
+
**For Scenario A only:** Quick validation of existing scenarios.
|
|
131
|
+
|
|
132
|
+
```javascript
|
|
133
|
+
const { validateScenarios } = require('../../lib/production-scenario-validator');
|
|
134
|
+
const { getDb } = require('../../lib/database');
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
// Get feature scenario file
|
|
138
|
+
const db = getDb();
|
|
139
|
+
const feature = await new Promise((resolve, reject) => {
|
|
140
|
+
db.get('SELECT * FROM work_items WHERE id = ?', [featureId], (err, row) => {
|
|
141
|
+
if (err) reject(err);
|
|
142
|
+
resolve(row);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
if (!feature.scenario_file) {
|
|
147
|
+
console.error('❌ Feature has no scenario file.');
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Validate scenarios against standards
|
|
152
|
+
const validation = await validateScenarios(feature.scenario_file, standards);
|
|
153
|
+
|
|
154
|
+
console.log(`✅ Validation complete:`);
|
|
155
|
+
console.log(` - Covered: ${validation.covered}/${validation.total} standards`);
|
|
156
|
+
console.log(` - Gaps: ${validation.gaps.length}`);
|
|
157
|
+
|
|
158
|
+
if (validation.hasGaps) {
|
|
159
|
+
console.log('\n⚠️ Missing scenarios for:');
|
|
160
|
+
validation.gaps.forEach(gap => {
|
|
161
|
+
console.log(` - ${gap.domain}: ${gap.standardId}`);
|
|
162
|
+
console.log(` ${gap.reasoning}`);
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// Generate and append missing scenarios
|
|
166
|
+
const { generateScenariosFromStandards } = require('../../lib/production-scenario-generator');
|
|
167
|
+
const { appendScenarios } = require('../../lib/production-scenario-appender');
|
|
168
|
+
|
|
169
|
+
const missingStandards = { standards: validation.gaps };
|
|
170
|
+
const newScenarios = await generateScenariosFromStandards(missingStandards);
|
|
171
|
+
|
|
172
|
+
await appendScenarios(feature.scenario_file, newScenarios);
|
|
173
|
+
console.log(`✅ Added ${newScenarios.length} missing scenarios`);
|
|
174
|
+
} else {
|
|
175
|
+
console.log('✅ All standards are covered by existing scenarios');
|
|
176
|
+
}
|
|
177
|
+
} catch (err) {
|
|
178
|
+
console.error('❌ Validation failed:', err.message);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Step 2B: Re-Validate Scenarios (Scenario B - Cold Context)
|
|
186
|
+
|
|
187
|
+
**For Scenario B only:** Re-validate with current standards.
|
|
188
|
+
|
|
189
|
+
```javascript
|
|
190
|
+
const { validateScenarios } = require('../../lib/production-scenario-validator');
|
|
191
|
+
const config = require('../../lib/config');
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
console.log('🔄 Re-validating scenarios against current standards...');
|
|
195
|
+
|
|
196
|
+
// Check if project state changed
|
|
197
|
+
const projectConfig = config.read();
|
|
198
|
+
console.log(`Project state: ${projectConfig.project_state}`);
|
|
199
|
+
|
|
200
|
+
// Get feature scenario file
|
|
201
|
+
const db = getDb();
|
|
202
|
+
const feature = await new Promise((resolve, reject) => {
|
|
203
|
+
db.get('SELECT * FROM work_items WHERE id = ?', [featureId], (err, row) => {
|
|
204
|
+
if (err) reject(err);
|
|
205
|
+
resolve(row);
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// Validate scenarios
|
|
210
|
+
const validation = await validateScenarios(feature.scenario_file, standards);
|
|
211
|
+
|
|
212
|
+
console.log(`✅ Re-validation complete:`);
|
|
213
|
+
console.log(` - Covered: ${validation.covered}/${validation.total} standards`);
|
|
214
|
+
console.log(` - New gaps: ${validation.gaps.length}`);
|
|
215
|
+
|
|
216
|
+
if (validation.hasGaps) {
|
|
217
|
+
console.log('\n⚠️ Standards added/changed since last run:');
|
|
218
|
+
validation.gaps.forEach(gap => {
|
|
219
|
+
console.log(` - ${gap.domain}: ${gap.standardId}`);
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Generate and append missing scenarios
|
|
223
|
+
const { generateScenariosFromStandards } = require('../../lib/production-scenario-generator');
|
|
224
|
+
const { appendScenarios } = require('../../lib/production-scenario-appender');
|
|
225
|
+
|
|
226
|
+
const missingStandards = { standards: validation.gaps };
|
|
227
|
+
const newScenarios = await generateScenariosFromStandards(missingStandards);
|
|
228
|
+
|
|
229
|
+
await appendScenarios(feature.scenario_file, newScenarios);
|
|
230
|
+
console.log(`✅ Updated with ${newScenarios.length} new scenarios`);
|
|
231
|
+
}
|
|
232
|
+
} catch (err) {
|
|
233
|
+
console.error('❌ Re-validation failed:', err.message);
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
### Step 2C: Generate Scenarios (Scenario C - Post-Transition)
|
|
241
|
+
|
|
242
|
+
**For Scenario C only:** Generate production scenarios from standards.
|
|
243
|
+
|
|
244
|
+
```javascript
|
|
245
|
+
const { generateScenariosFromStandards } = require('../../lib/production-scenario-generator');
|
|
246
|
+
const { appendScenarios } = require('../../lib/production-scenario-appender');
|
|
247
|
+
const { getDb } = require('../../lib/database');
|
|
248
|
+
|
|
249
|
+
try {
|
|
250
|
+
console.log('✨ Generating production scenarios from standards...');
|
|
251
|
+
|
|
252
|
+
// Get feature
|
|
253
|
+
const db = getDb();
|
|
254
|
+
const feature = await new Promise((resolve, reject) => {
|
|
255
|
+
db.get('SELECT * FROM work_items WHERE id = ?', [featureId], (err, row) => {
|
|
256
|
+
if (err) reject(err);
|
|
257
|
+
resolve(row);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
if (!feature.scenario_file) {
|
|
262
|
+
console.error('❌ Feature has no scenario file.');
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// Generate scenarios
|
|
267
|
+
const scenarios = await generateScenariosFromStandards(standards);
|
|
268
|
+
|
|
269
|
+
console.log(`✅ Generated ${scenarios.length} production scenarios`);
|
|
270
|
+
console.log('Domains covered:', [...new Set(standards.standards.map(s => s.domain))].join(', '));
|
|
271
|
+
|
|
272
|
+
// Append to feature file
|
|
273
|
+
await appendScenarios(feature.scenario_file, scenarios);
|
|
274
|
+
console.log(`✅ Appended scenarios to ${feature.scenario_file}`);
|
|
275
|
+
|
|
276
|
+
// Create production chores if none exist
|
|
277
|
+
const { generateChoresFromStandards } = require('../../lib/production-chore-generator');
|
|
278
|
+
const chores = generateChoresFromStandards(standards, feature.title);
|
|
279
|
+
|
|
280
|
+
console.log(`\n📋 Proposed ${chores.length} production chores:`);
|
|
281
|
+
chores.forEach((chore, i) => {
|
|
282
|
+
console.log(`\n${i + 1}. ${chore.title}`);
|
|
283
|
+
console.log(` ${chore.description.split('\n')[0]}`);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
console.log('\n✅ Production scenarios ready. Create chores to implement them.');
|
|
287
|
+
} catch (err) {
|
|
288
|
+
console.error('❌ Scenario generation failed:', err.message);
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
### Step 3: Implement Production Chore
|
|
296
|
+
|
|
297
|
+
**For all scenarios:** Implement the current production chore.
|
|
298
|
+
|
|
299
|
+
```javascript
|
|
300
|
+
const { getCurrentWork } = require('../../lib/current-work');
|
|
301
|
+
const fs = require('fs');
|
|
302
|
+
|
|
303
|
+
try {
|
|
304
|
+
const currentWork = getCurrentWork();
|
|
305
|
+
|
|
306
|
+
console.log(`\n🚀 Implementing: ${currentWork.title}`);
|
|
307
|
+
console.log(`Description: ${currentWork.description}`);
|
|
308
|
+
|
|
309
|
+
// Parse chore to understand which standard to implement
|
|
310
|
+
// Implementation follows the acceptance criteria from the standard
|
|
311
|
+
|
|
312
|
+
// Example: If chore is about TLS enforcement
|
|
313
|
+
// 1. Read the standard's acceptance criteria
|
|
314
|
+
// 2. Implement code that satisfies the criteria
|
|
315
|
+
// 3. Add tests based on scenario steps
|
|
316
|
+
|
|
317
|
+
console.log('\n✅ Implementation complete');
|
|
318
|
+
console.log('Run: npx cucumber-js to verify scenarios pass');
|
|
319
|
+
} catch (err) {
|
|
320
|
+
console.error('❌ Implementation failed:', err.message);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Key Differences from Stable Mode
|
|
328
|
+
|
|
329
|
+
**Stable Mode:**
|
|
330
|
+
- Adds error handling to speed code
|
|
331
|
+
- Validates inputs, handles edge cases
|
|
332
|
+
- Makes existing features robust
|
|
333
|
+
|
|
334
|
+
**Production Mode:**
|
|
335
|
+
- Hardens features for production deployment
|
|
336
|
+
- Implements security, scale, compliance standards
|
|
337
|
+
- Adds monitoring, backup, failover capabilities
|
|
338
|
+
- Standards-driven (not just adding error handling)
|
|
339
|
+
|
|
340
|
+
**Example:**
|
|
341
|
+
|
|
342
|
+
**Stable Mode Chore:** "Add error handling to login feature"
|
|
343
|
+
→ Validates email format, handles network errors, shows error messages
|
|
344
|
+
|
|
345
|
+
**Production Mode Chore:** "Add security hardening to login feature"
|
|
346
|
+
→ Rate limiting, brute force protection, MFA support, audit logging
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Validation
|
|
351
|
+
|
|
352
|
+
Before completing production mode, ensure:
|
|
353
|
+
- [ ] Context detected correctly (A/B/C)
|
|
354
|
+
- [ ] Production standards read successfully
|
|
355
|
+
- [ ] All production scenarios pass
|
|
356
|
+
- [ ] Security measures implemented per standards
|
|
357
|
+
- [ ] Performance targets met per standards
|
|
358
|
+
- [ ] Compliance requirements satisfied
|
|
359
|
+
- [ ] Monitoring and observability added
|
|
360
|
+
- [ ] Documentation updated
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Next Steps After Production Mode
|
|
365
|
+
|
|
366
|
+
Once all production chores complete:
|
|
367
|
+
1. Feature is production-ready
|
|
368
|
+
2. Can be deployed to external environment
|
|
369
|
+
3. Meets all standards for scale, security, compliance
|