@nlaprell/shipit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cursor/commands/create_intent_from_issue.md +28 -0
- package/.cursor/commands/create_pr.md +28 -0
- package/.cursor/commands/dashboard.md +39 -0
- package/.cursor/commands/deploy.md +152 -0
- package/.cursor/commands/drift_check.md +36 -0
- package/.cursor/commands/fix.md +39 -0
- package/.cursor/commands/generate_release_plan.md +31 -0
- package/.cursor/commands/generate_roadmap.md +38 -0
- package/.cursor/commands/help.md +37 -0
- package/.cursor/commands/init_project.md +26 -0
- package/.cursor/commands/kill.md +72 -0
- package/.cursor/commands/new_intent.md +68 -0
- package/.cursor/commands/pr.md +77 -0
- package/.cursor/commands/revert-plan.md +58 -0
- package/.cursor/commands/risk.md +64 -0
- package/.cursor/commands/rollback.md +43 -0
- package/.cursor/commands/scope_project.md +53 -0
- package/.cursor/commands/ship.md +345 -0
- package/.cursor/commands/status.md +71 -0
- package/.cursor/commands/suggest.md +44 -0
- package/.cursor/commands/test_shipit.md +197 -0
- package/.cursor/commands/verify.md +50 -0
- package/.cursor/rules/architect.mdc +84 -0
- package/.cursor/rules/assumption-extractor.mdc +95 -0
- package/.cursor/rules/docs.mdc +66 -0
- package/.cursor/rules/implementer.mdc +112 -0
- package/.cursor/rules/pm.mdc +136 -0
- package/.cursor/rules/qa.mdc +97 -0
- package/.cursor/rules/security.mdc +90 -0
- package/.cursor/rules/steward.mdc +99 -0
- package/.cursor/rules/test-runner.mdc +196 -0
- package/AGENTS.md +121 -0
- package/README.md +264 -0
- package/_system/architecture/CANON.md +159 -0
- package/_system/architecture/invariants.yml +87 -0
- package/_system/architecture/project-schema.json +98 -0
- package/_system/architecture/workflow-state-layout.md +68 -0
- package/_system/artifacts/SYSTEM_STATE.md +43 -0
- package/_system/artifacts/confidence-calibration.json +16 -0
- package/_system/artifacts/dependencies.md +46 -0
- package/_system/artifacts/framework-files-manifest.json +179 -0
- package/_system/artifacts/usage.json +1 -0
- package/_system/behaviors/DO_RELEASE.md +371 -0
- package/_system/behaviors/DO_RELEASE_AI.md +329 -0
- package/_system/behaviors/PREPARE_RELEASE.md +373 -0
- package/_system/behaviors/PREPARE_RELEASE_AI.md +234 -0
- package/_system/behaviors/WORK_ROOT_PLATFORM_ISSUES.md +140 -0
- package/_system/behaviors/WORK_TEST_PLAN_ISSUES.md +380 -0
- package/_system/do-not-repeat/abandoned-designs.md +18 -0
- package/_system/do-not-repeat/bad-patterns.md +19 -0
- package/_system/do-not-repeat/failed-experiments.md +18 -0
- package/_system/do-not-repeat/rejected-libraries.md +19 -0
- package/_system/drift/baselines.md +49 -0
- package/_system/drift/metrics.md +33 -0
- package/_system/golden-data/.gitkeep +0 -0
- package/_system/golden-data/README.md +47 -0
- package/_system/reports/mutation/mutation.html +492 -0
- package/_system/security/audit-allowlist.json +4 -0
- package/bin/create-shipit-app +29 -0
- package/bin/shipit +183 -0
- package/cli/src/commands/check.js +82 -0
- package/cli/src/commands/create.js +195 -0
- package/cli/src/commands/init.js +267 -0
- package/cli/src/commands/upgrade.js +196 -0
- package/cli/src/utils/config.js +27 -0
- package/cli/src/utils/file-copy.js +144 -0
- package/cli/src/utils/gitignore-merge.js +44 -0
- package/cli/src/utils/manifest.js +105 -0
- package/cli/src/utils/package-json-merge.js +163 -0
- package/cli/src/utils/project-json-merge.js +57 -0
- package/cli/src/utils/prompts.js +30 -0
- package/cli/src/utils/stack-detection.js +56 -0
- package/cli/src/utils/stack-files.js +364 -0
- package/cli/src/utils/upgrade-backup.js +159 -0
- package/cli/src/utils/version.js +64 -0
- package/dashboard-app/README.md +73 -0
- package/dashboard-app/eslint.config.js +23 -0
- package/dashboard-app/index.html +13 -0
- package/dashboard-app/package.json +30 -0
- package/dashboard-app/pnpm-lock.yaml +2721 -0
- package/dashboard-app/public/dashboard.json +66 -0
- package/dashboard-app/public/vite.svg +1 -0
- package/dashboard-app/src/App.css +141 -0
- package/dashboard-app/src/App.tsx +155 -0
- package/dashboard-app/src/assets/react.svg +1 -0
- package/dashboard-app/src/index.css +68 -0
- package/dashboard-app/src/main.tsx +10 -0
- package/dashboard-app/tsconfig.app.json +28 -0
- package/dashboard-app/tsconfig.json +4 -0
- package/dashboard-app/tsconfig.node.json +26 -0
- package/dashboard-app/vite.config.ts +7 -0
- package/package.json +116 -0
- package/scripts/README.md +70 -0
- package/scripts/audit-check.sh +125 -0
- package/scripts/calibration-report.sh +198 -0
- package/scripts/check-readiness.sh +155 -0
- package/scripts/collect-metrics.sh +116 -0
- package/scripts/command-manifest.yml +131 -0
- package/scripts/create-test-plan-issue.sh +110 -0
- package/scripts/dashboard-start.sh +16 -0
- package/scripts/deploy.sh +170 -0
- package/scripts/drift-check.sh +93 -0
- package/scripts/execute-rollback.sh +177 -0
- package/scripts/export-dashboard-json.js +208 -0
- package/scripts/fix-intents.sh +239 -0
- package/scripts/generate-dashboard.sh +136 -0
- package/scripts/generate-docs.sh +279 -0
- package/scripts/generate-project-context.sh +142 -0
- package/scripts/generate-release-plan.sh +443 -0
- package/scripts/generate-roadmap.sh +189 -0
- package/scripts/generate-system-state.sh +95 -0
- package/scripts/gh/create-intent-from-issue.sh +82 -0
- package/scripts/gh/create-issue-from-intent.sh +59 -0
- package/scripts/gh/create-pr.sh +41 -0
- package/scripts/gh/link-issue.sh +44 -0
- package/scripts/gh/on-ship-update-issue.sh +42 -0
- package/scripts/headless/README.md +8 -0
- package/scripts/headless/call-llm.js +109 -0
- package/scripts/headless/run-phase.sh +99 -0
- package/scripts/help.sh +271 -0
- package/scripts/init-project.sh +976 -0
- package/scripts/kill-intent.sh +125 -0
- package/scripts/lib/common.sh +29 -0
- package/scripts/lib/intent.sh +61 -0
- package/scripts/lib/progress.sh +57 -0
- package/scripts/lib/suggest-next.sh +131 -0
- package/scripts/lib/validate-intents.sh +240 -0
- package/scripts/lib/verify-outputs.sh +55 -0
- package/scripts/lib/workflow_state.sh +201 -0
- package/scripts/new-intent.sh +271 -0
- package/scripts/publish-npm.sh +28 -0
- package/scripts/scope-project.sh +380 -0
- package/scripts/setup-worktrees.sh +125 -0
- package/scripts/status.sh +278 -0
- package/scripts/suggest.sh +173 -0
- package/scripts/test-headless.sh +47 -0
- package/scripts/test-shipit.sh +52 -0
- package/scripts/test-workflow-state.sh +49 -0
- package/scripts/usage-report.sh +47 -0
- package/scripts/usage.sh +58 -0
- package/scripts/validate-cursor.sh +151 -0
- package/scripts/validate-project.sh +71 -0
- package/scripts/validate-vscode.sh +146 -0
- package/scripts/verify.sh +153 -0
- package/scripts/workflow-orchestrator.sh +97 -0
- package/scripts/workflow-templates/01_analysis.md.tpl +25 -0
- package/scripts/workflow-templates/02_plan.md.tpl +30 -0
- package/scripts/workflow-templates/03_implementation.md.tpl +25 -0
- package/scripts/workflow-templates/04_verification.md.tpl +29 -0
- package/scripts/workflow-templates/05_release_notes.md.tpl +16 -0
- package/scripts/workflow-templates/05_verification_legacy.md.tpl +6 -0
- package/scripts/workflow-templates/active.md.tpl +18 -0
- package/scripts/workflow-templates/phases.yml +39 -0
- package/stryker.conf.json +8 -0
- package/work/intent/templates/api-endpoint.md +124 -0
- package/work/intent/templates/bugfix.md +116 -0
- package/work/intent/templates/frontend-feature.md +115 -0
- package/work/intent/templates/generic.md +122 -0
- package/work/intent/templates/infra-change.md +121 -0
- package/work/intent/templates/refactor.md +116 -0
|
@@ -0,0 +1,976 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Test Project Initialization Script
|
|
4
|
+
# INTERNAL USE ONLY: Creates test project for ShipIt end-to-end validation
|
|
5
|
+
# For user projects, use 'shipit init' or 'create-shipit-app' instead
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
# Error handling
|
|
10
|
+
error_exit() {
|
|
11
|
+
echo "ERROR: $1" >&2
|
|
12
|
+
exit "${2:-1}"
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
# Colors
|
|
16
|
+
RED='\033[0;31m'
|
|
17
|
+
GREEN='\033[0;32m'
|
|
18
|
+
YELLOW='\033[1;33m'
|
|
19
|
+
BLUE='\033[0;34m'
|
|
20
|
+
NC='\033[0m' # No Color
|
|
21
|
+
|
|
22
|
+
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
23
|
+
|
|
24
|
+
# Framework repo detection
|
|
25
|
+
# Check if running from ShipIt framework repo root
|
|
26
|
+
if [ ! -f "$ROOT_DIR/package.json" ] || ! grep -q '"name":\s*"shipit"' "$ROOT_DIR/package.json" 2>/dev/null; then
|
|
27
|
+
error_exit "This script is for internal ShipIt testing only. Use 'shipit init' or 'create-shipit-app' for user projects." 1
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
if [ ! -f "$ROOT_DIR/_system/architecture/CANON.md" ]; then
|
|
31
|
+
error_exit "This script is for internal ShipIt testing only. Use 'shipit init' or 'create-shipit-app' for user projects." 1
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Read test fixtures
|
|
35
|
+
FIXTURES_FILE="$ROOT_DIR/tests/fixtures.json"
|
|
36
|
+
if [ ! -f "$FIXTURES_FILE" ]; then
|
|
37
|
+
error_exit "Test fixtures file not found: $FIXTURES_FILE" 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# Extract values from fixtures.json using jq (or fallback to defaults)
|
|
41
|
+
if command -v jq >/dev/null 2>&1; then
|
|
42
|
+
PROJECT_NAME=$(jq -r '.projectName // "shipit-test"' "$FIXTURES_FILE")
|
|
43
|
+
TECH_STACK_INPUT=$(jq -r '.inputs["step_1-2"].techStack // "1"' "$FIXTURES_FILE")
|
|
44
|
+
PROJECT_DESC=$(jq -r '.inputs["step_1-2"].description // "Test project for ShipIt end-to-end validation"' "$FIXTURES_FILE")
|
|
45
|
+
HIGH_RISK=$(jq -r '.inputs["step_1-2"].highRiskDomains // "none"' "$FIXTURES_FILE")
|
|
46
|
+
else
|
|
47
|
+
# Fallback if jq not available (use defaults)
|
|
48
|
+
PROJECT_NAME="shipit-test"
|
|
49
|
+
TECH_STACK_INPUT="1"
|
|
50
|
+
PROJECT_DESC="Test project for ShipIt end-to-end validation"
|
|
51
|
+
HIGH_RISK="none"
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
# Validate project name (alphanumeric, hyphens, underscores)
|
|
55
|
+
if ! [[ "$PROJECT_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then
|
|
56
|
+
error_exit "Project name must be alphanumeric with hyphens/underscores only" 1
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Always create in tests/test-project regardless of project name argument
|
|
60
|
+
TARGET_DIR="$ROOT_DIR/tests/test-project"
|
|
61
|
+
|
|
62
|
+
echo -e "${BLUE}Initializing test project: $PROJECT_NAME${NC}"
|
|
63
|
+
echo -e "${YELLOW}Note: This script is for internal ShipIt testing only.${NC}"
|
|
64
|
+
echo ""
|
|
65
|
+
|
|
66
|
+
# Ensure tests directory exists
|
|
67
|
+
mkdir -p "$ROOT_DIR/tests" || error_exit "Failed to create tests directory"
|
|
68
|
+
|
|
69
|
+
# Remove existing test project if it exists
|
|
70
|
+
if [ -d "$TARGET_DIR" ]; then
|
|
71
|
+
echo -e "${YELLOW}Removing existing test project...${NC}"
|
|
72
|
+
rm -rf "$TARGET_DIR"
|
|
73
|
+
fi
|
|
74
|
+
|
|
75
|
+
mkdir -p "$TARGET_DIR" || error_exit "Failed to create test project directory"
|
|
76
|
+
|
|
77
|
+
cd "$TARGET_DIR" || error_exit "Failed to enter test project directory"
|
|
78
|
+
|
|
79
|
+
# Tech stack selection from fixtures
|
|
80
|
+
case "$TECH_STACK_INPUT" in
|
|
81
|
+
1) TECH_STACK="typescript-nodejs"; STACK_NAME="TypeScript/Node.js" ;;
|
|
82
|
+
2) TECH_STACK="python"; STACK_NAME="Python" ;;
|
|
83
|
+
3) TECH_STACK="other"; STACK_NAME="Other" ;;
|
|
84
|
+
*) TECH_STACK="typescript-nodejs"; STACK_NAME="TypeScript/Node.js" ;;
|
|
85
|
+
esac
|
|
86
|
+
|
|
87
|
+
echo -e "${GREEN}Using test fixtures:${NC}"
|
|
88
|
+
echo -e " Tech stack: $STACK_NAME"
|
|
89
|
+
echo -e " Description: $PROJECT_DESC"
|
|
90
|
+
echo -e " High-risk domains: $HIGH_RISK"
|
|
91
|
+
echo ""
|
|
92
|
+
|
|
93
|
+
# Create project structure
|
|
94
|
+
echo -e "${BLUE}Creating project structure...${NC}"
|
|
95
|
+
|
|
96
|
+
# Core directories (work/ = current work; _system/ = framework and generated)
|
|
97
|
+
mkdir -p work/intent/features work/intent/bugs work/intent/tech-debt work/workflow-state work/roadmap work/release _system/architecture _system/do-not-repeat _system/drift _system/behaviors _system/security _system/artifacts _system/golden-data _system/reports scripts src tests docs .cursor/rules .cursor/commands .github/workflows
|
|
98
|
+
|
|
99
|
+
# Copy framework commands, rules, and core scripts into the new project
|
|
100
|
+
if [ -d "$ROOT_DIR/.cursor/commands" ]; then
|
|
101
|
+
cp -R "$ROOT_DIR/.cursor/commands/." ".cursor/commands/"
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
if [ -d "$ROOT_DIR/.cursor/rules" ]; then
|
|
105
|
+
cp -R "$ROOT_DIR/.cursor/rules/." ".cursor/rules/"
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Copy ShipIt test fixtures and documentation into the new project
|
|
109
|
+
# Exclude test-project directory to avoid recursion
|
|
110
|
+
if [ -d "$ROOT_DIR/tests" ]; then
|
|
111
|
+
mkdir -p tests
|
|
112
|
+
# Copy all files/directories except test-project
|
|
113
|
+
for item in "$ROOT_DIR/tests"/*; do
|
|
114
|
+
item_name=$(basename "$item")
|
|
115
|
+
if [ "$item_name" != "test-project" ]; then
|
|
116
|
+
cp -R "$item" "tests/"
|
|
117
|
+
fi
|
|
118
|
+
done
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
# Copy mutation testing config if present
|
|
122
|
+
if [ -f "$ROOT_DIR/stryker.conf.json" ]; then
|
|
123
|
+
cp "$ROOT_DIR/stryker.conf.json" "stryker.conf.json"
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
for script in new-intent.sh scope-project.sh generate-roadmap.sh generate-release-plan.sh drift-check.sh generate-system-state.sh deploy.sh check-readiness.sh workflow-orchestrator.sh kill-intent.sh verify.sh help.sh status.sh suggest.sh fix-intents.sh dashboard-start.sh execute-rollback.sh; do
|
|
127
|
+
if [ -f "$ROOT_DIR/scripts/$script" ]; then
|
|
128
|
+
cp "$ROOT_DIR/scripts/$script" "scripts/$script"
|
|
129
|
+
chmod +x "scripts/$script"
|
|
130
|
+
fi
|
|
131
|
+
done
|
|
132
|
+
|
|
133
|
+
# Copy scripts/lib (common.sh, intent.sh, etc.) so workflow-orchestrator, kill-intent, and others work.
|
|
134
|
+
if [ -d "$ROOT_DIR/scripts/lib" ]; then
|
|
135
|
+
mkdir -p scripts/lib
|
|
136
|
+
cp -R "$ROOT_DIR/scripts/lib/." "scripts/lib/"
|
|
137
|
+
chmod +x scripts/lib/*.sh 2>/dev/null || true
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
# Copy workflow-templates (phases.yml + .tpl) so workflow-orchestrator can generate phase files.
|
|
141
|
+
if [ -d "$ROOT_DIR/scripts/workflow-templates" ]; then
|
|
142
|
+
mkdir -p scripts/workflow-templates
|
|
143
|
+
cp -R "$ROOT_DIR/scripts/workflow-templates/." "scripts/workflow-templates/"
|
|
144
|
+
fi
|
|
145
|
+
|
|
146
|
+
# Copy command-manifest.yml so help.sh can build the command list.
|
|
147
|
+
if [ -f "$ROOT_DIR/scripts/command-manifest.yml" ]; then
|
|
148
|
+
cp "$ROOT_DIR/scripts/command-manifest.yml" "scripts/command-manifest.yml"
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
# Copy dashboard and rollback scripts.
|
|
152
|
+
if [ -f "$ROOT_DIR/scripts/export-dashboard-json.js" ]; then
|
|
153
|
+
cp "$ROOT_DIR/scripts/export-dashboard-json.js" "scripts/export-dashboard-json.js"
|
|
154
|
+
fi
|
|
155
|
+
if [ -d "$ROOT_DIR/dashboard-app" ]; then
|
|
156
|
+
cp -R "$ROOT_DIR/dashboard-app" "dashboard-app/"
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# Copy scripts/gh/ (GitHub integration: create issue, link issue, create PR, on-ship update, create intent from issue).
|
|
160
|
+
if [ -d "$ROOT_DIR/scripts/gh" ]; then
|
|
161
|
+
mkdir -p scripts/gh
|
|
162
|
+
cp -R "$ROOT_DIR/scripts/gh/." "scripts/gh/"
|
|
163
|
+
chmod +x scripts/gh/*.sh 2>/dev/null || true
|
|
164
|
+
fi
|
|
165
|
+
|
|
166
|
+
# Copy test-plan issue helper into the new project (used by test runner rules).
|
|
167
|
+
if [ -f "$ROOT_DIR/scripts/create-test-plan-issue.sh" ]; then
|
|
168
|
+
cp "$ROOT_DIR/scripts/create-test-plan-issue.sh" "scripts/create-test-plan-issue.sh"
|
|
169
|
+
chmod +x "scripts/create-test-plan-issue.sh"
|
|
170
|
+
fi
|
|
171
|
+
|
|
172
|
+
# Copy test-plan issue tracking runbook into the new project (referenced by tests + Cursor rules).
|
|
173
|
+
if [ -f "$ROOT_DIR/_system/behaviors/WORK_TEST_PLAN_ISSUES.md" ]; then
|
|
174
|
+
cp "$ROOT_DIR/_system/behaviors/WORK_TEST_PLAN_ISSUES.md" "_system/behaviors/WORK_TEST_PLAN_ISSUES.md"
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
# Create project.json
|
|
178
|
+
cat > project.json << EOF || error_exit "Failed to create project.json"
|
|
179
|
+
{
|
|
180
|
+
"name": "$PROJECT_NAME",
|
|
181
|
+
"description": "$PROJECT_DESC",
|
|
182
|
+
"version": "0.1.0",
|
|
183
|
+
"techStack": "$TECH_STACK",
|
|
184
|
+
"created": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")",
|
|
185
|
+
"highRiskDomains": $(echo "$HIGH_RISK" | awk -F',' '{
|
|
186
|
+
if ($1 == "none") print "[]";
|
|
187
|
+
else {
|
|
188
|
+
printf "[";
|
|
189
|
+
for (i=1; i<=NF; i++) {
|
|
190
|
+
gsub(/^[ \t]+|[ \t]+$/, "", $i);
|
|
191
|
+
if (i>1) printf ",";
|
|
192
|
+
printf "\"%s\"", $i;
|
|
193
|
+
}
|
|
194
|
+
printf "]";
|
|
195
|
+
}
|
|
196
|
+
}'),
|
|
197
|
+
"settings": {
|
|
198
|
+
"humanResponseTime": "minutes",
|
|
199
|
+
"confidenceThreshold": 0.7,
|
|
200
|
+
"testCoverageMinimum": 80
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
EOF
|
|
204
|
+
|
|
205
|
+
echo -e "${GREEN}✓ Created project.json${NC}"
|
|
206
|
+
|
|
207
|
+
# Create initial README.md
|
|
208
|
+
cat > README.md << EOF || error_exit "Failed to create README.md"
|
|
209
|
+
# $PROJECT_NAME
|
|
210
|
+
|
|
211
|
+
$PROJECT_DESC
|
|
212
|
+
|
|
213
|
+
## Quick Start
|
|
214
|
+
|
|
215
|
+
\`\`\`bash
|
|
216
|
+
# Install dependencies
|
|
217
|
+
pnpm install # or npm install, pip install, etc.
|
|
218
|
+
|
|
219
|
+
# Run tests
|
|
220
|
+
pnpm test
|
|
221
|
+
|
|
222
|
+
# Start development
|
|
223
|
+
pnpm dev
|
|
224
|
+
\`\`\`
|
|
225
|
+
|
|
226
|
+
## Project Structure
|
|
227
|
+
|
|
228
|
+
- \`work/intent/\` - Planned work (features, bugs, tech-debt)
|
|
229
|
+
- \`work/workflow-state/\` - Current execution state
|
|
230
|
+
- \`_system/architecture/\` - System boundaries and constraints
|
|
231
|
+
- \`/src/\` - Source code
|
|
232
|
+
- \`/tests/\` - Test files
|
|
233
|
+
|
|
234
|
+
## Development
|
|
235
|
+
|
|
236
|
+
This project uses the ShipIt framework. See [AGENTS.md](./AGENTS.md) for workflow details.
|
|
237
|
+
|
|
238
|
+
## License
|
|
239
|
+
|
|
240
|
+
MIT
|
|
241
|
+
EOF
|
|
242
|
+
|
|
243
|
+
echo -e "${GREEN}✓ Created README.md${NC}"
|
|
244
|
+
|
|
245
|
+
# Create _system/architecture/CANON.md
|
|
246
|
+
mkdir -p _system/architecture
|
|
247
|
+
cat > _system/architecture/CANON.md << EOF || error_exit "Failed to create CANON.md"
|
|
248
|
+
# Architecture Canon
|
|
249
|
+
|
|
250
|
+
> **This document is the authoritative source for system architecture.**
|
|
251
|
+
> Code that violates this canon is illegal. Update this document before implementing violations.
|
|
252
|
+
|
|
253
|
+
## System Overview
|
|
254
|
+
|
|
255
|
+
[Describe your system architecture here]
|
|
256
|
+
|
|
257
|
+
## Boundaries
|
|
258
|
+
|
|
259
|
+
### Layer Responsibilities
|
|
260
|
+
|
|
261
|
+
| Layer | Responsibility | Cannot Do |
|
|
262
|
+
|-------|----------------|-----------|
|
|
263
|
+
| **Intent** | Define WHAT to build | Specify HOW to implement |
|
|
264
|
+
| **Architecture** | Define HOW systems connect | Write production code |
|
|
265
|
+
| **Implementation** | Write code that passes tests | Change architecture |
|
|
266
|
+
| **Verification** | Prove correctness | Weaken acceptance criteria |
|
|
267
|
+
|
|
268
|
+
## Allowed Dependencies
|
|
269
|
+
|
|
270
|
+
[Define your allowed dependencies here]
|
|
271
|
+
|
|
272
|
+
## Forbidden Patterns
|
|
273
|
+
|
|
274
|
+
[Define forbidden patterns here]
|
|
275
|
+
|
|
276
|
+
## Performance Budgets
|
|
277
|
+
|
|
278
|
+
| Metric | Budget | Measurement |
|
|
279
|
+
|--------|--------|-------------|
|
|
280
|
+
| p95 latency | < 200ms | API response time |
|
|
281
|
+
| p99 latency | < 500ms | API response time |
|
|
282
|
+
| Memory | < 512MB | Process RSS |
|
|
283
|
+
|
|
284
|
+
## Security Requirements
|
|
285
|
+
|
|
286
|
+
[Define security requirements here]
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
*Last updated: $(date -u +"%Y-%m-%d")*
|
|
291
|
+
EOF
|
|
292
|
+
|
|
293
|
+
echo -e "${GREEN}✓ Created _system/architecture/CANON.md${NC}"
|
|
294
|
+
|
|
295
|
+
# Create _system/architecture/invariants.yml
|
|
296
|
+
cat > _system/architecture/invariants.yml << EOF || error_exit "Failed to create invariants.yml"
|
|
297
|
+
# Invariants Configuration
|
|
298
|
+
version: 1
|
|
299
|
+
|
|
300
|
+
security:
|
|
301
|
+
- id: all_endpoints_authenticated
|
|
302
|
+
description: All endpoints require auth except health/metrics
|
|
303
|
+
exceptions:
|
|
304
|
+
- "/health"
|
|
305
|
+
- "/metrics"
|
|
306
|
+
enforcement: ci_test
|
|
307
|
+
|
|
308
|
+
code_quality:
|
|
309
|
+
- id: no_explicit_any
|
|
310
|
+
description: No 'any' type allowed
|
|
311
|
+
enforcement: "@typescript-eslint/no-explicit-any"
|
|
312
|
+
|
|
313
|
+
- id: no_eval
|
|
314
|
+
description: No eval() calls
|
|
315
|
+
enforcement: "no-eval"
|
|
316
|
+
|
|
317
|
+
performance:
|
|
318
|
+
p95_latency_ms: 200
|
|
319
|
+
p99_latency_ms: 500
|
|
320
|
+
max_memory_mb: 512
|
|
321
|
+
|
|
322
|
+
success_metrics:
|
|
323
|
+
test_pass_rate_minimum: 99.5
|
|
324
|
+
code_coverage_minimum: 80
|
|
325
|
+
EOF
|
|
326
|
+
|
|
327
|
+
echo -e "${GREEN}✓ Created _system/architecture/invariants.yml${NC}"
|
|
328
|
+
|
|
329
|
+
# Create intent template
|
|
330
|
+
mkdir -p work/intent/features work/intent/bugs work/intent/tech-debt
|
|
331
|
+
cat > work/intent/_TEMPLATE.md << 'EOFTEMPLATE' || error_exit "Failed to create intent template"
|
|
332
|
+
# F-###: Title
|
|
333
|
+
|
|
334
|
+
## Type
|
|
335
|
+
feature | bug | tech-debt
|
|
336
|
+
|
|
337
|
+
## Status
|
|
338
|
+
planned | active | blocked | validating | shipped | killed
|
|
339
|
+
|
|
340
|
+
## Priority
|
|
341
|
+
p0 | p1 | p2 | p3
|
|
342
|
+
|
|
343
|
+
## Effort
|
|
344
|
+
s | m | l
|
|
345
|
+
|
|
346
|
+
## Release Target
|
|
347
|
+
R1 | R2 | R3 | R4
|
|
348
|
+
|
|
349
|
+
## Motivation
|
|
350
|
+
(Why it exists, 1–3 bullets)
|
|
351
|
+
|
|
352
|
+
## Confidence
|
|
353
|
+
Requirements: 0.0–1.0
|
|
354
|
+
Domain assumptions: 0.0–1.0
|
|
355
|
+
|
|
356
|
+
## Invariants (Hard Constraints)
|
|
357
|
+
Human-readable:
|
|
358
|
+
- [Constraint 1]
|
|
359
|
+
- [Constraint 2]
|
|
360
|
+
|
|
361
|
+
Executable (add to _system/architecture/invariants.yml):
|
|
362
|
+
```yaml
|
|
363
|
+
invariants:
|
|
364
|
+
- [invariant_id]
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## Acceptance (Executable)
|
|
368
|
+
- [ ] Tests: `<test_name>` added; fails before fix, passes after
|
|
369
|
+
- [ ] CLI: `pnpm test` green
|
|
370
|
+
- [ ] CLI: `pnpm lint && pnpm typecheck` green
|
|
371
|
+
|
|
372
|
+
## Assumptions (MUST BE EXPLICIT)
|
|
373
|
+
- [Assumption 1]
|
|
374
|
+
- [Assumption 2]
|
|
375
|
+
|
|
376
|
+
## Risk Level
|
|
377
|
+
low | medium | high
|
|
378
|
+
|
|
379
|
+
## Kill Criteria
|
|
380
|
+
- [Criterion 1]
|
|
381
|
+
- [Criterion 2]
|
|
382
|
+
|
|
383
|
+
## Rollback Plan
|
|
384
|
+
- Feature flag: `FEATURE_X_ENABLED=false`
|
|
385
|
+
- Revert commit: `git revert <sha>`
|
|
386
|
+
|
|
387
|
+
## Dependencies
|
|
388
|
+
- [Other intent IDs or external systems]
|
|
389
|
+
|
|
390
|
+
## Do Not Repeat Check
|
|
391
|
+
- [ ] Checked _system/do-not-repeat/abandoned-designs.md
|
|
392
|
+
- [ ] Checked _system/do-not-repeat/failed-experiments.md
|
|
393
|
+
EOFTEMPLATE
|
|
394
|
+
|
|
395
|
+
echo -e "${GREEN}✓ Created work/intent/_TEMPLATE.md${NC}"
|
|
396
|
+
|
|
397
|
+
# Copy intent templates by kind (if present in repo) so new-intent can offer API, frontend, infra, bugfix, refactor
|
|
398
|
+
if [ -d "$ROOT_DIR/work/intent/templates" ]; then
|
|
399
|
+
mkdir -p work/intent/templates
|
|
400
|
+
for f in "$ROOT_DIR/work/intent/templates/"*.md; do
|
|
401
|
+
[ -f "$f" ] && cp "$f" work/intent/templates/ || true
|
|
402
|
+
done
|
|
403
|
+
echo -e "${GREEN}✓ Created work/intent/templates/${NC}"
|
|
404
|
+
fi
|
|
405
|
+
|
|
406
|
+
# Create do-not-repeat files
|
|
407
|
+
mkdir -p _system/do-not-repeat
|
|
408
|
+
cat > _system/do-not-repeat/abandoned-designs.md << EOF || error_exit "Failed to create abandoned-designs.md"
|
|
409
|
+
# Abandoned Designs
|
|
410
|
+
|
|
411
|
+
This ledger records design approaches that were considered but rejected.
|
|
412
|
+
|
|
413
|
+
## Entries
|
|
414
|
+
|
|
415
|
+
(No entries yet. Add entries as designs are abandoned.)
|
|
416
|
+
EOF
|
|
417
|
+
|
|
418
|
+
cat > _system/do-not-repeat/failed-experiments.md << EOF || error_exit "Failed to create failed-experiments.md"
|
|
419
|
+
# Failed Experiments
|
|
420
|
+
|
|
421
|
+
This ledger records experiments that were tried but failed.
|
|
422
|
+
|
|
423
|
+
## Entries
|
|
424
|
+
|
|
425
|
+
(No entries yet. Add entries as experiments fail.)
|
|
426
|
+
EOF
|
|
427
|
+
|
|
428
|
+
cat > _system/do-not-repeat/bad-patterns.md << EOF || error_exit "Failed to create bad-patterns.md"
|
|
429
|
+
# Bad Patterns
|
|
430
|
+
|
|
431
|
+
This ledger records code patterns, architectural approaches, or practices that have been identified as problematic. **Do not repeat these patterns.**
|
|
432
|
+
|
|
433
|
+
## Format
|
|
434
|
+
|
|
435
|
+
Each entry should include:
|
|
436
|
+
- **Pattern:** Brief description of the pattern
|
|
437
|
+
- **Why it's bad:** Problems it causes
|
|
438
|
+
- **Date:** When it was identified
|
|
439
|
+
- **Intent ID:** Related intent (if any)
|
|
440
|
+
- **Alternative:** Better approach (if known)
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Entries
|
|
445
|
+
|
|
446
|
+
(No entries yet. Add entries as bad patterns are identified.)
|
|
447
|
+
EOF
|
|
448
|
+
|
|
449
|
+
cat > _system/do-not-repeat/rejected-libraries.md << EOF || error_exit "Failed to create rejected-libraries.md"
|
|
450
|
+
# Rejected Libraries
|
|
451
|
+
|
|
452
|
+
This ledger records libraries, frameworks, or tools that were evaluated but rejected. **Do not reconsider these without new information.**
|
|
453
|
+
|
|
454
|
+
## Format
|
|
455
|
+
|
|
456
|
+
Each entry should include:
|
|
457
|
+
- **Library:** Name and version (if applicable)
|
|
458
|
+
- **Why rejected:** Reason for rejection (performance, licensing, maintenance, etc.)
|
|
459
|
+
- **Date:** When it was rejected
|
|
460
|
+
- **Intent ID:** Related intent (if any)
|
|
461
|
+
- **Alternatives:** Better options (if known)
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
## Entries
|
|
466
|
+
|
|
467
|
+
(No entries yet. Add entries as libraries are rejected.)
|
|
468
|
+
EOF
|
|
469
|
+
|
|
470
|
+
echo -e "${GREEN}✓ Created do-not-repeat ledger files${NC}"
|
|
471
|
+
|
|
472
|
+
# Create roadmap files
|
|
473
|
+
mkdir -p work/roadmap
|
|
474
|
+
for file in now.md next.md later.md; do
|
|
475
|
+
cat > "work/roadmap/$file" << EOF || error_exit "Failed to create work/roadmap/$file"
|
|
476
|
+
# ${file%.md}
|
|
477
|
+
|
|
478
|
+
(No items yet. Add items as they're planned.)
|
|
479
|
+
EOF
|
|
480
|
+
done
|
|
481
|
+
|
|
482
|
+
echo -e "${GREEN}✓ Created roadmap files${NC}"
|
|
483
|
+
|
|
484
|
+
# Create workflow-state
|
|
485
|
+
mkdir -p work/workflow-state
|
|
486
|
+
cat > work/workflow-state/active.md << EOF || error_exit "Failed to create work/workflow-state/active.md"
|
|
487
|
+
# Active Intent
|
|
488
|
+
|
|
489
|
+
**Intent ID:** none
|
|
490
|
+
**Status:** idle
|
|
491
|
+
**Current Phase:** none
|
|
492
|
+
**Started:** -
|
|
493
|
+
|
|
494
|
+
## Progress
|
|
495
|
+
|
|
496
|
+
- [ ] Phase 1: Analysis
|
|
497
|
+
- [ ] Phase 2: Planning
|
|
498
|
+
- [ ] Phase 3: Implementation
|
|
499
|
+
- [ ] Phase 4: Verification
|
|
500
|
+
- [ ] Phase 5: Release Notes
|
|
501
|
+
EOF
|
|
502
|
+
|
|
503
|
+
cat > work/workflow-state/blocked.md << EOF || error_exit "Failed to create work/workflow-state/blocked.md"
|
|
504
|
+
# Blocked Intents
|
|
505
|
+
|
|
506
|
+
(No blocked intents yet.)
|
|
507
|
+
EOF
|
|
508
|
+
|
|
509
|
+
cat > work/workflow-state/validating.md << EOF || error_exit "Failed to create work/workflow-state/validating.md"
|
|
510
|
+
# Validating Intents
|
|
511
|
+
|
|
512
|
+
(No validating intents yet.)
|
|
513
|
+
EOF
|
|
514
|
+
|
|
515
|
+
cat > work/workflow-state/shipped.md << EOF || error_exit "Failed to create work/workflow-state/shipped.md"
|
|
516
|
+
# Shipped Intents
|
|
517
|
+
|
|
518
|
+
(No shipped intents yet.)
|
|
519
|
+
EOF
|
|
520
|
+
|
|
521
|
+
cat > work/workflow-state/disagreements.md << EOF || error_exit "Failed to create work/workflow-state/disagreements.md"
|
|
522
|
+
# Disagreements Log
|
|
523
|
+
|
|
524
|
+
(No disagreements yet.)
|
|
525
|
+
EOF
|
|
526
|
+
|
|
527
|
+
cat > work/workflow-state/assumptions.md << EOF || error_exit "Failed to create work/workflow-state/assumptions.md"
|
|
528
|
+
# Assumptions Log
|
|
529
|
+
|
|
530
|
+
This file tracks implicit assumptions that have been identified during development. Assumptions are where most outages hide—making them explicit and testable prevents surprises.
|
|
531
|
+
|
|
532
|
+
## Format
|
|
533
|
+
|
|
534
|
+
Each entry should include:
|
|
535
|
+
- **Assumption:** Clear statement of what is assumed
|
|
536
|
+
- **Context:** Where/when this assumption applies
|
|
537
|
+
- **Risk:** What breaks if assumption is wrong
|
|
538
|
+
- **Validation:** How to test/verify the assumption
|
|
539
|
+
- **Date:** When assumption was identified
|
|
540
|
+
- **Intent ID:** Related intent (if any)
|
|
541
|
+
- **Category:** Domain | Technical | Security
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## Entries
|
|
546
|
+
|
|
547
|
+
(No assumptions logged yet. Assumptions will be added as they are identified during development.)
|
|
548
|
+
EOF
|
|
549
|
+
|
|
550
|
+
cat > work/workflow-state/01_analysis.md << EOF || error_exit "Failed to create work/workflow-state/01_analysis.md"
|
|
551
|
+
# Analysis
|
|
552
|
+
|
|
553
|
+
(Waiting for PM output.)
|
|
554
|
+
EOF
|
|
555
|
+
|
|
556
|
+
cat > work/workflow-state/02_plan.md << EOF || error_exit "Failed to create work/workflow-state/02_plan.md"
|
|
557
|
+
# Plan
|
|
558
|
+
|
|
559
|
+
(Waiting for Architect output.)
|
|
560
|
+
EOF
|
|
561
|
+
|
|
562
|
+
cat > work/workflow-state/03_implementation.md << EOF || error_exit "Failed to create work/workflow-state/03_implementation.md"
|
|
563
|
+
# Implementation
|
|
564
|
+
|
|
565
|
+
(Waiting for Implementer output.)
|
|
566
|
+
EOF
|
|
567
|
+
|
|
568
|
+
cat > work/workflow-state/04_verification.md << EOF || error_exit "Failed to create work/workflow-state/04_verification.md"
|
|
569
|
+
# Verification
|
|
570
|
+
|
|
571
|
+
(Waiting for QA/Security output.)
|
|
572
|
+
EOF
|
|
573
|
+
|
|
574
|
+
cat > work/workflow-state/05_release_notes.md << EOF || error_exit "Failed to create work/workflow-state/05_release_notes.md"
|
|
575
|
+
# Release Notes
|
|
576
|
+
|
|
577
|
+
(Waiting for Docs/Steward output.)
|
|
578
|
+
EOF
|
|
579
|
+
|
|
580
|
+
echo -e "${GREEN}✓ Created work/workflow-state files${NC}"
|
|
581
|
+
|
|
582
|
+
# Create golden-data directory with .gitkeep (directory already created on line 89)
|
|
583
|
+
touch _system/golden-data/.gitkeep
|
|
584
|
+
cat > _system/golden-data/README.md << EOF || error_exit "Failed to create _system/golden-data/README.md"
|
|
585
|
+
# Golden Data
|
|
586
|
+
|
|
587
|
+
This directory stores replay validation test data for regression testing.
|
|
588
|
+
|
|
589
|
+
## Purpose
|
|
590
|
+
|
|
591
|
+
Golden data captures known-good inputs and expected outputs that can be replayed through code changes to verify behavior hasn't regressed.
|
|
592
|
+
|
|
593
|
+
## Format
|
|
594
|
+
|
|
595
|
+
Golden data files are typically JSON files containing test cases:
|
|
596
|
+
|
|
597
|
+
\`\`\`json
|
|
598
|
+
[
|
|
599
|
+
{
|
|
600
|
+
"input": { /* input data */ },
|
|
601
|
+
"expectedOutput": { /* expected result */ },
|
|
602
|
+
"description": "Brief description of test case"
|
|
603
|
+
}
|
|
604
|
+
]
|
|
605
|
+
\`\`\`
|
|
606
|
+
|
|
607
|
+
## Usage
|
|
608
|
+
|
|
609
|
+
1. **Capture golden data** from production or hand-crafted test cases
|
|
610
|
+
2. **Replay through code** during testing
|
|
611
|
+
3. **Compare outputs** to detect regressions
|
|
612
|
+
|
|
613
|
+
## Example
|
|
614
|
+
|
|
615
|
+
See \`docs/PLAN.md\` Research Q11 for implementation patterns and examples of replay-based validation.
|
|
616
|
+
|
|
617
|
+
## Non-Deterministic Data
|
|
618
|
+
|
|
619
|
+
For outputs with timestamps, UUIDs, or other non-deterministic values, normalize them before comparison:
|
|
620
|
+
|
|
621
|
+
\`\`\`typescript
|
|
622
|
+
const normalize = (output) => ({
|
|
623
|
+
...output,
|
|
624
|
+
timestamp: 'NORMALIZED',
|
|
625
|
+
id: 'NORMALIZED',
|
|
626
|
+
});
|
|
627
|
+
\`\`\`
|
|
628
|
+
EOF
|
|
629
|
+
|
|
630
|
+
echo -e "${GREEN}✓ Created _system/golden-data directory${NC}"
|
|
631
|
+
|
|
632
|
+
# Generate initial SYSTEM_STATE.md (best-effort)
|
|
633
|
+
if [ -x "scripts/generate-system-state.sh" ]; then
|
|
634
|
+
./scripts/generate-system-state.sh >/dev/null 2>&1 || echo "WARNING: system state generation failed"
|
|
635
|
+
fi
|
|
636
|
+
|
|
637
|
+
# Create drift baselines
|
|
638
|
+
mkdir -p _system/drift
|
|
639
|
+
cat > _system/drift/baselines.md << EOF || error_exit "Failed to create _system/drift baselines"
|
|
640
|
+
# Drift Baselines
|
|
641
|
+
|
|
642
|
+
Initial thresholds for drift detection.
|
|
643
|
+
|
|
644
|
+
## Baseline Metrics
|
|
645
|
+
|
|
646
|
+
| Metric | Baseline | Threshold |
|
|
647
|
+
|--------|----------|-----------|
|
|
648
|
+
| Avg PR size | < 10 files | > 15 files |
|
|
649
|
+
| Test-to-code ratio | > 0.5 | < 0.3 |
|
|
650
|
+
| Dependency count | < 50 deps | > 100 deps |
|
|
651
|
+
|
|
652
|
+
---
|
|
653
|
+
|
|
654
|
+
*Last updated: $(date -u +"%Y-%m-%d")*
|
|
655
|
+
EOF
|
|
656
|
+
|
|
657
|
+
echo -e "${GREEN}✓ Created drift baselines${NC}"
|
|
658
|
+
|
|
659
|
+
# Create .gitignore
|
|
660
|
+
cat > .gitignore << EOF || error_exit "Failed to create .gitignore"
|
|
661
|
+
node_modules/
|
|
662
|
+
dist/
|
|
663
|
+
*.log
|
|
664
|
+
.DS_Store
|
|
665
|
+
.env
|
|
666
|
+
.env.local
|
|
667
|
+
coverage/
|
|
668
|
+
.nyc_output/
|
|
669
|
+
*.tsbuildinfo
|
|
670
|
+
worktrees.json
|
|
671
|
+
.agent-id
|
|
672
|
+
__pycache__/
|
|
673
|
+
*.pyc
|
|
674
|
+
*.pyo
|
|
675
|
+
.pytest_cache/
|
|
676
|
+
EOF
|
|
677
|
+
|
|
678
|
+
echo -e "${GREEN}✓ Created .gitignore${NC}"
|
|
679
|
+
|
|
680
|
+
# Create .npmrc to align audit behavior with test expectations
|
|
681
|
+
cat > .npmrc << EOF || error_exit "Failed to create .npmrc"
|
|
682
|
+
audit-level=high
|
|
683
|
+
EOF
|
|
684
|
+
|
|
685
|
+
echo -e "${GREEN}✓ Created .npmrc${NC}"
|
|
686
|
+
|
|
687
|
+
# Tech stack specific setup
|
|
688
|
+
if [ "$TECH_STACK" = "typescript-nodejs" ]; then
|
|
689
|
+
echo -e "${BLUE}Setting up TypeScript/Node.js...${NC}"
|
|
690
|
+
|
|
691
|
+
# Create package.json
|
|
692
|
+
cat > package.json << EOF || error_exit "Failed to create package.json"
|
|
693
|
+
{
|
|
694
|
+
"name": "$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')",
|
|
695
|
+
"version": "0.1.0",
|
|
696
|
+
"description": "$PROJECT_DESC",
|
|
697
|
+
"type": "module",
|
|
698
|
+
"scripts": {
|
|
699
|
+
"test": "vitest run",
|
|
700
|
+
"test:watch": "vitest",
|
|
701
|
+
"test:coverage": "vitest run --coverage",
|
|
702
|
+
"test:mutate": "stryker run",
|
|
703
|
+
"lint": "eslint . --ext .ts",
|
|
704
|
+
"typecheck": "tsc --noEmit",
|
|
705
|
+
"build": "tsc",
|
|
706
|
+
"dev": "tsx watch src/index.ts",
|
|
707
|
+
"new-intent": "./scripts/new-intent.sh",
|
|
708
|
+
"scope-project": "./scripts/scope-project.sh",
|
|
709
|
+
"generate-roadmap": "./scripts/generate-roadmap.sh",
|
|
710
|
+
"generate-release-plan": "./scripts/generate-release-plan.sh",
|
|
711
|
+
"drift-check": "./scripts/drift-check.sh",
|
|
712
|
+
"deploy": "./scripts/deploy.sh",
|
|
713
|
+
"check-readiness": "./scripts/check-readiness.sh",
|
|
714
|
+
"workflow-orchestrator": "./scripts/workflow-orchestrator.sh",
|
|
715
|
+
"kill-intent": "./scripts/kill-intent.sh",
|
|
716
|
+
"verify": "./scripts/verify.sh",
|
|
717
|
+
"fix": "./scripts/fix-intents.sh",
|
|
718
|
+
"gh-create-issue": "./scripts/gh/create-issue-from-intent.sh",
|
|
719
|
+
"gh-link-issue": "./scripts/gh/link-issue.sh",
|
|
720
|
+
"gh-create-pr": "./scripts/gh/create-pr.sh",
|
|
721
|
+
"on-ship-update-issue": "./scripts/gh/on-ship-update-issue.sh",
|
|
722
|
+
"create-intent-from-issue": "./scripts/gh/create-intent-from-issue.sh",
|
|
723
|
+
"help": "./scripts/help.sh",
|
|
724
|
+
"status": "./scripts/status.sh",
|
|
725
|
+
"suggest": "./scripts/suggest.sh",
|
|
726
|
+
"dashboard": "./scripts/dashboard-start.sh",
|
|
727
|
+
"execute-rollback": "./scripts/execute-rollback.sh",
|
|
728
|
+
"export-dashboard-json": "node scripts/export-dashboard-json.js"
|
|
729
|
+
},
|
|
730
|
+
"keywords": [],
|
|
731
|
+
"author": "",
|
|
732
|
+
"license": "MIT",
|
|
733
|
+
"devDependencies": {
|
|
734
|
+
"@types/node": "^20.10.0",
|
|
735
|
+
"@typescript-eslint/eslint-plugin": "^6.15.0",
|
|
736
|
+
"@typescript-eslint/parser": "^6.15.0",
|
|
737
|
+
"@stryker-mutator/core": "^8.0.0",
|
|
738
|
+
"@stryker-mutator/vitest-runner": "^8.0.0",
|
|
739
|
+
"@vitest/coverage-v8": "^1.0.4",
|
|
740
|
+
"eslint": "^8.56.0",
|
|
741
|
+
"prettier": "^3.1.1",
|
|
742
|
+
"tsx": "^4.7.0",
|
|
743
|
+
"typescript": "^5.3.3",
|
|
744
|
+
"vitest": "^1.0.4"
|
|
745
|
+
},
|
|
746
|
+
"dependencies": {}
|
|
747
|
+
}
|
|
748
|
+
EOF
|
|
749
|
+
|
|
750
|
+
# Create tsconfig.json
|
|
751
|
+
cat > tsconfig.json << EOF || error_exit "Failed to create tsconfig.json"
|
|
752
|
+
{
|
|
753
|
+
"compilerOptions": {
|
|
754
|
+
"target": "ES2022",
|
|
755
|
+
"module": "ESNext",
|
|
756
|
+
"lib": ["ES2022"],
|
|
757
|
+
"moduleResolution": "node",
|
|
758
|
+
"strict": true,
|
|
759
|
+
"esModuleInterop": true,
|
|
760
|
+
"skipLibCheck": true,
|
|
761
|
+
"forceConsistentCasingInFileNames": true,
|
|
762
|
+
"resolveJsonModule": true,
|
|
763
|
+
"outDir": "./dist",
|
|
764
|
+
"rootDir": "./src",
|
|
765
|
+
"declaration": true,
|
|
766
|
+
"declarationMap": true,
|
|
767
|
+
"sourceMap": true,
|
|
768
|
+
"noUnusedLocals": true,
|
|
769
|
+
"noUnusedParameters": true,
|
|
770
|
+
"noImplicitReturns": true,
|
|
771
|
+
"noFallthroughCasesInSwitch": true
|
|
772
|
+
},
|
|
773
|
+
"include": ["src/**/*"],
|
|
774
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"]
|
|
775
|
+
}
|
|
776
|
+
EOF
|
|
777
|
+
|
|
778
|
+
# Create .eslintrc.json
|
|
779
|
+
cat > .eslintrc.json << EOF || error_exit "Failed to create .eslintrc.json"
|
|
780
|
+
{
|
|
781
|
+
"root": true,
|
|
782
|
+
"parser": "@typescript-eslint/parser",
|
|
783
|
+
"parserOptions": {
|
|
784
|
+
"ecmaVersion": 2022,
|
|
785
|
+
"sourceType": "module",
|
|
786
|
+
"project": ["./tsconfig.eslint.json"],
|
|
787
|
+
"tsconfigRootDir": "."
|
|
788
|
+
},
|
|
789
|
+
"extends": [
|
|
790
|
+
"eslint:recommended",
|
|
791
|
+
"plugin:@typescript-eslint/recommended",
|
|
792
|
+
"plugin:@typescript-eslint/strict-type-checked"
|
|
793
|
+
],
|
|
794
|
+
"plugins": ["@typescript-eslint"],
|
|
795
|
+
"rules": {
|
|
796
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
797
|
+
"@typescript-eslint/ban-types": "error",
|
|
798
|
+
"no-eval": "error",
|
|
799
|
+
"no-console": ["error", { "allow": ["warn", "error"] }]
|
|
800
|
+
},
|
|
801
|
+
"overrides": [
|
|
802
|
+
{
|
|
803
|
+
"files": ["scripts/**/*.ts", "tests/**/*.ts", "**/*.config.ts"],
|
|
804
|
+
"rules": {
|
|
805
|
+
"no-console": "off",
|
|
806
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
807
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
808
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
809
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
810
|
+
"@typescript-eslint/no-unsafe-argument": "off"
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
],
|
|
814
|
+
"ignorePatterns": ["dist", "node_modules", "*.config.js"]
|
|
815
|
+
}
|
|
816
|
+
EOF
|
|
817
|
+
|
|
818
|
+
# Create tsconfig.eslint.json
|
|
819
|
+
cat > tsconfig.eslint.json << EOF || error_exit "Failed to create tsconfig.eslint.json"
|
|
820
|
+
{
|
|
821
|
+
"extends": "./tsconfig.json",
|
|
822
|
+
"include": [
|
|
823
|
+
"src/**/*.ts",
|
|
824
|
+
"tests/**/*.ts",
|
|
825
|
+
"scripts/**/*.ts",
|
|
826
|
+
"*.config.ts"
|
|
827
|
+
],
|
|
828
|
+
"exclude": ["node_modules", "dist"]
|
|
829
|
+
}
|
|
830
|
+
EOF
|
|
831
|
+
|
|
832
|
+
# Create vitest.config.ts
|
|
833
|
+
cat > vitest.config.ts << EOF || error_exit "Failed to create vitest.config.ts"
|
|
834
|
+
import { defineConfig } from 'vitest/config';
|
|
835
|
+
|
|
836
|
+
export default defineConfig({
|
|
837
|
+
test: {
|
|
838
|
+
globals: true,
|
|
839
|
+
environment: 'node',
|
|
840
|
+
include: ['tests/**/*.test.ts'],
|
|
841
|
+
coverage: {
|
|
842
|
+
provider: 'v8',
|
|
843
|
+
reporter: ['text', 'json', 'html', 'lcov'],
|
|
844
|
+
exclude: [
|
|
845
|
+
'node_modules/',
|
|
846
|
+
'dist/',
|
|
847
|
+
'tests/',
|
|
848
|
+
'**/*.test.ts',
|
|
849
|
+
'**/*.spec.ts',
|
|
850
|
+
'**/*.config.ts',
|
|
851
|
+
],
|
|
852
|
+
},
|
|
853
|
+
},
|
|
854
|
+
});
|
|
855
|
+
EOF
|
|
856
|
+
|
|
857
|
+
# Create basic src structure
|
|
858
|
+
mkdir -p src
|
|
859
|
+
cat > src/index.ts << EOF || error_exit "Failed to create src/index.ts"
|
|
860
|
+
// $PROJECT_NAME
|
|
861
|
+
// $PROJECT_DESC
|
|
862
|
+
|
|
863
|
+
export const projectName = '$PROJECT_NAME';
|
|
864
|
+
export const projectDescription = '$PROJECT_DESC';
|
|
865
|
+
EOF
|
|
866
|
+
|
|
867
|
+
echo -e "${GREEN}✓ Created TypeScript/Node.js configuration${NC}"
|
|
868
|
+
fi
|
|
869
|
+
|
|
870
|
+
# Create CI/CD
|
|
871
|
+
mkdir -p .github/workflows
|
|
872
|
+
cat > .github/workflows/ci.yml << EOF || error_exit "Failed to create CI workflow"
|
|
873
|
+
name: CI
|
|
874
|
+
|
|
875
|
+
on:
|
|
876
|
+
push:
|
|
877
|
+
branches: [main, develop]
|
|
878
|
+
pull_request:
|
|
879
|
+
branches: [main, develop]
|
|
880
|
+
|
|
881
|
+
jobs:
|
|
882
|
+
lint:
|
|
883
|
+
name: Lint & Type Check
|
|
884
|
+
runs-on: ubuntu-latest
|
|
885
|
+
steps:
|
|
886
|
+
- uses: actions/checkout@v4
|
|
887
|
+
- uses: pnpm/action-setup@v2
|
|
888
|
+
with:
|
|
889
|
+
version: 8
|
|
890
|
+
- uses: actions/setup-node@v4
|
|
891
|
+
with:
|
|
892
|
+
node-version: '20'
|
|
893
|
+
cache: 'pnpm'
|
|
894
|
+
- run: pnpm install --frozen-lockfile
|
|
895
|
+
- run: pnpm lint
|
|
896
|
+
- run: pnpm typecheck
|
|
897
|
+
|
|
898
|
+
test:
|
|
899
|
+
name: Test Suite
|
|
900
|
+
runs-on: ubuntu-latest
|
|
901
|
+
steps:
|
|
902
|
+
- uses: actions/checkout@v4
|
|
903
|
+
- uses: pnpm/action-setup@v2
|
|
904
|
+
with:
|
|
905
|
+
version: 8
|
|
906
|
+
- uses: actions/setup-node@v4
|
|
907
|
+
with:
|
|
908
|
+
node-version: '20'
|
|
909
|
+
cache: 'pnpm'
|
|
910
|
+
- run: pnpm install --frozen-lockfile
|
|
911
|
+
- run: pnpm test:coverage
|
|
912
|
+
EOF
|
|
913
|
+
|
|
914
|
+
echo -e "${GREEN}✓ Created CI/CD configuration${NC}"
|
|
915
|
+
|
|
916
|
+
# Initialize git if not exists
|
|
917
|
+
if [ ! -d ".git" ]; then
|
|
918
|
+
echo -e "${BLUE}Initializing git repository...${NC}"
|
|
919
|
+
git init || error_exit "Failed to initialize git"
|
|
920
|
+
git add . || error_exit "Failed to stage files"
|
|
921
|
+
git commit -m "Initial commit: $PROJECT_NAME" || error_exit "Failed to create initial commit"
|
|
922
|
+
echo -e "${GREEN}✓ Initialized git repository${NC}"
|
|
923
|
+
else
|
|
924
|
+
echo -e "${YELLOW}Git repository already exists, skipping initialization${NC}"
|
|
925
|
+
fi
|
|
926
|
+
|
|
927
|
+
# Create AGENTS.md reference
|
|
928
|
+
cat > AGENTS.md << EOF || error_exit "Failed to create AGENTS.md"
|
|
929
|
+
# AGENTS.md
|
|
930
|
+
|
|
931
|
+
This project uses the ShipIt framework.
|
|
932
|
+
|
|
933
|
+
For agent roles, conventions, and workflows, see the framework documentation.
|
|
934
|
+
|
|
935
|
+
## Quick Reference
|
|
936
|
+
|
|
937
|
+
- **Create Intent:** Use \`/new_intent\` or \`pnpm new-intent\`
|
|
938
|
+
- **Ship Feature:** Use \`/ship <intent-id>\`
|
|
939
|
+
- **Verify:** Use \`/verify <intent-id>\`
|
|
940
|
+
- **Kill Intent:** Use \`/kill <intent-id>\`
|
|
941
|
+
|
|
942
|
+
## Project-Specific Settings
|
|
943
|
+
|
|
944
|
+
- **High-Risk Domains:** $(echo "$HIGH_RISK" | sed 's/,/, /g')
|
|
945
|
+
- **Tech Stack:** $STACK_NAME
|
|
946
|
+
- **Confidence Threshold:** 0.7
|
|
947
|
+
|
|
948
|
+
See \`project.json\` for full project metadata.
|
|
949
|
+
EOF
|
|
950
|
+
|
|
951
|
+
echo -e "${GREEN}✓ Created AGENTS.md${NC}"
|
|
952
|
+
|
|
953
|
+
# Create confidence-calibration.json
|
|
954
|
+
mkdir -p _system/artifacts
|
|
955
|
+
cat > _system/artifacts/confidence-calibration.json << EOF || error_exit "Failed to create _system/artifacts/confidence-calibration.json"
|
|
956
|
+
{
|
|
957
|
+
"decisions": []
|
|
958
|
+
}
|
|
959
|
+
EOF
|
|
960
|
+
|
|
961
|
+
echo -e "${GREEN}✓ Created _system/artifacts/confidence-calibration.json${NC}"
|
|
962
|
+
|
|
963
|
+
# Usage (token/cost) artifact for visibility
|
|
964
|
+
cat > _system/artifacts/usage.json << 'USAGE_EOF' || error_exit "Failed to create _system/artifacts/usage.json"
|
|
965
|
+
{"entries":[]}
|
|
966
|
+
USAGE_EOF
|
|
967
|
+
echo -e "${GREEN}✓ Created _system/artifacts/usage.json${NC}"
|
|
968
|
+
|
|
969
|
+
echo ""
|
|
970
|
+
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
971
|
+
echo -e "${GREEN}✓ Test project '$PROJECT_NAME' initialized!${NC}"
|
|
972
|
+
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
973
|
+
echo ""
|
|
974
|
+
echo -e "${YELLOW}Test project location: $TARGET_DIR${NC}"
|
|
975
|
+
echo -e "${YELLOW}Note: This is for internal ShipIt testing only.${NC}"
|
|
976
|
+
echo ""
|