@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,279 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Automated Documentation Generation Script
|
|
4
|
+
# Generates README, architecture docs, and API docs from project structure
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
error_exit() {
|
|
9
|
+
echo "ERROR: $1" >&2
|
|
10
|
+
exit "${2:-1}"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Colors
|
|
14
|
+
GREEN='\033[0;32m'
|
|
15
|
+
YELLOW='\033[1;33m'
|
|
16
|
+
BLUE='\033[0;34m'
|
|
17
|
+
NC='\033[0m'
|
|
18
|
+
|
|
19
|
+
echo -e "${BLUE}Generating project documentation...${NC}"
|
|
20
|
+
echo ""
|
|
21
|
+
|
|
22
|
+
# Check prerequisites
|
|
23
|
+
if [ ! -f "project.json" ]; then
|
|
24
|
+
error_exit "project.json not found. Run /init-project first." 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
PROJECT_NAME=$(jq -r '.name' project.json 2>/dev/null || echo "project")
|
|
28
|
+
PROJECT_DESC=$(jq -r '.description' project.json 2>/dev/null || echo "Project description")
|
|
29
|
+
TECH_STACK=$(jq -r '.techStack' project.json 2>/dev/null || echo "typescript-nodejs")
|
|
30
|
+
|
|
31
|
+
# Generate README.md
|
|
32
|
+
echo -e "${YELLOW}Generating README.md...${NC}"
|
|
33
|
+
cat > README.md << EOF || error_exit "Failed to generate README.md"
|
|
34
|
+
# $PROJECT_NAME
|
|
35
|
+
|
|
36
|
+
$PROJECT_DESC
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
\`\`\`bash
|
|
41
|
+
# Install dependencies
|
|
42
|
+
$(case $TECH_STACK in
|
|
43
|
+
"typescript-nodejs") echo "pnpm install" ;;
|
|
44
|
+
"python") echo "pip install -r requirements.txt" ;;
|
|
45
|
+
*) echo "# Install dependencies for your tech stack" ;;
|
|
46
|
+
esac)
|
|
47
|
+
|
|
48
|
+
# Run tests
|
|
49
|
+
$(case $TECH_STACK in
|
|
50
|
+
"typescript-nodejs") echo "pnpm test" ;;
|
|
51
|
+
"python") echo "pytest" ;;
|
|
52
|
+
*) echo "# Run tests" ;;
|
|
53
|
+
esac)
|
|
54
|
+
|
|
55
|
+
# Start development
|
|
56
|
+
$(case $TECH_STACK in
|
|
57
|
+
"typescript-nodejs") echo "pnpm dev" ;;
|
|
58
|
+
"python") echo "python -m src" ;;
|
|
59
|
+
*) echo "# Start development server" ;;
|
|
60
|
+
esac)
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
## Project Structure
|
|
64
|
+
|
|
65
|
+
\`\`\`
|
|
66
|
+
.
|
|
67
|
+
├── work/intent/ # Planned work (features, bugs, tech-debt)
|
|
68
|
+
├── work/workflow-state/ # Current execution state
|
|
69
|
+
├── _system/architecture/ # System boundaries and constraints
|
|
70
|
+
├── src/ # Source code
|
|
71
|
+
├── tests/ # Test files
|
|
72
|
+
├── _system/do-not-repeat/ # Failed approaches ledger
|
|
73
|
+
├── generated/
|
|
74
|
+
│ ├── artifacts/ # Generated artifacts (SYSTEM_STATE, dependencies, etc.)
|
|
75
|
+
│ ├── drift/ # Entropy monitoring
|
|
76
|
+
│ ├── release/ # Release plan
|
|
77
|
+
│ ├── roadmap/ # Planning views (now, next, later)
|
|
78
|
+
│ └── reports/ # Mutation and other reports
|
|
79
|
+
\`\`\`
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
|
|
83
|
+
This project uses the ShipIt framework.
|
|
84
|
+
|
|
85
|
+
### Key Commands
|
|
86
|
+
|
|
87
|
+
- \`/init-project\` - Initialize a new project
|
|
88
|
+
- \`/scope-project\` - AI-assisted project scoping
|
|
89
|
+
- \`/new_intent\` - Create a new intent
|
|
90
|
+
- \`/ship <intent-id>\` - Ship a feature through the SDLC
|
|
91
|
+
- \`/deploy\` - Deploy to production
|
|
92
|
+
- \`/verify <intent-id>\` - Run verification phase
|
|
93
|
+
- \`/kill <intent-id>\` - Kill an intent
|
|
94
|
+
|
|
95
|
+
### Workflow
|
|
96
|
+
|
|
97
|
+
1. **Create Intent:** Define what to build
|
|
98
|
+
2. **Scope:** Break down into features
|
|
99
|
+
3. **Plan:** Architect the solution
|
|
100
|
+
4. **Test:** Write tests first
|
|
101
|
+
5. **Implement:** Write code
|
|
102
|
+
6. **Verify:** Run all checks
|
|
103
|
+
7. **Deploy:** Ship to production
|
|
104
|
+
|
|
105
|
+
## Architecture
|
|
106
|
+
|
|
107
|
+
See \`_system/architecture/CANON.md\` for system boundaries and constraints.
|
|
108
|
+
|
|
109
|
+
## Testing
|
|
110
|
+
|
|
111
|
+
\`\`\`bash
|
|
112
|
+
# Run tests
|
|
113
|
+
$(case $TECH_STACK in
|
|
114
|
+
"typescript-nodejs") echo "pnpm test" ;;
|
|
115
|
+
"python") echo "pytest" ;;
|
|
116
|
+
*) echo "# Run tests" ;;
|
|
117
|
+
esac)
|
|
118
|
+
|
|
119
|
+
# Run with coverage
|
|
120
|
+
$(case $TECH_STACK in
|
|
121
|
+
"typescript-nodejs") echo "pnpm test:coverage" ;;
|
|
122
|
+
"python") echo "pytest --cov" ;;
|
|
123
|
+
*) echo "# Run with coverage" ;;
|
|
124
|
+
esac)
|
|
125
|
+
\`\`\`
|
|
126
|
+
|
|
127
|
+
## Deployment
|
|
128
|
+
|
|
129
|
+
\`\`\`bash
|
|
130
|
+
# Check readiness
|
|
131
|
+
pnpm check-readiness
|
|
132
|
+
|
|
133
|
+
# Deploy
|
|
134
|
+
pnpm deploy [environment]
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
|
140
|
+
EOF
|
|
141
|
+
|
|
142
|
+
echo -e "${GREEN}✓ Generated README.md${NC}"
|
|
143
|
+
|
|
144
|
+
# Generate architecture docs if src exists
|
|
145
|
+
if [ -d "src" ]; then
|
|
146
|
+
echo -e "${YELLOW}Generating architecture documentation...${NC}"
|
|
147
|
+
|
|
148
|
+
ARCH_DOC="_system/architecture/DOCUMENTATION.md"
|
|
149
|
+
cat > "$ARCH_DOC" << EOF || error_exit "Failed to generate architecture docs"
|
|
150
|
+
# Architecture Documentation
|
|
151
|
+
|
|
152
|
+
**Generated:** $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
153
|
+
|
|
154
|
+
## System Overview
|
|
155
|
+
|
|
156
|
+
[Auto-generated from code structure]
|
|
157
|
+
|
|
158
|
+
## Components
|
|
159
|
+
|
|
160
|
+
EOF
|
|
161
|
+
|
|
162
|
+
# List source files
|
|
163
|
+
find src -type f -name "*.ts" -o -name "*.js" -o -name "*.py" 2>/dev/null | while read -r file; do
|
|
164
|
+
REL_PATH=$(echo "$file" | sed "s|^src/||")
|
|
165
|
+
echo "- \`$REL_PATH\`" >> "$ARCH_DOC"
|
|
166
|
+
done
|
|
167
|
+
|
|
168
|
+
cat >> "$ARCH_DOC" << EOF
|
|
169
|
+
|
|
170
|
+
## Dependencies
|
|
171
|
+
|
|
172
|
+
[Auto-generated from package.json or requirements.txt]
|
|
173
|
+
|
|
174
|
+
## API Endpoints
|
|
175
|
+
|
|
176
|
+
[Auto-generated from route files]
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
*This file is auto-generated. Update source code to change documentation.*
|
|
181
|
+
EOF
|
|
182
|
+
|
|
183
|
+
echo -e "${GREEN}✓ Generated architecture documentation${NC}"
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
# Generate API docs if routes exist
|
|
187
|
+
if [ -d "src/routes" ] || [ -d "src/api" ]; then
|
|
188
|
+
echo -e "${YELLOW}Generating API documentation...${NC}"
|
|
189
|
+
|
|
190
|
+
API_DOC="API.md"
|
|
191
|
+
cat > "$API_DOC" << EOF || error_exit "Failed to generate API docs"
|
|
192
|
+
# API Documentation
|
|
193
|
+
|
|
194
|
+
**Generated:** $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
195
|
+
|
|
196
|
+
## Endpoints
|
|
197
|
+
|
|
198
|
+
EOF
|
|
199
|
+
|
|
200
|
+
# Find route files
|
|
201
|
+
find src -type f \( -name "*route*.ts" -o -name "*route*.js" -o -name "*api*.py" \) 2>/dev/null | while read -r file; do
|
|
202
|
+
REL_PATH=$(echo "$file" | sed "s|^src/||")
|
|
203
|
+
echo "### \`$REL_PATH\`" >> "$API_DOC"
|
|
204
|
+
echo "" >> "$API_DOC"
|
|
205
|
+
echo "[Endpoint documentation]" >> "$API_DOC"
|
|
206
|
+
echo "" >> "$API_DOC"
|
|
207
|
+
done
|
|
208
|
+
|
|
209
|
+
echo -e "${GREEN}✓ Generated API documentation${NC}"
|
|
210
|
+
fi
|
|
211
|
+
|
|
212
|
+
# Generate deployment guide
|
|
213
|
+
echo -e "${YELLOW}Generating deployment guide...${NC}"
|
|
214
|
+
DEPLOY_GUIDE="DEPLOYMENT.md"
|
|
215
|
+
cat > "$DEPLOY_GUIDE" << EOF || error_exit "Failed to generate deployment guide"
|
|
216
|
+
# Deployment Guide
|
|
217
|
+
|
|
218
|
+
**Project:** $PROJECT_NAME
|
|
219
|
+
|
|
220
|
+
## Prerequisites
|
|
221
|
+
|
|
222
|
+
- All tests passing
|
|
223
|
+
- Coverage thresholds met
|
|
224
|
+
- Security audit clean
|
|
225
|
+
- Documentation complete
|
|
226
|
+
|
|
227
|
+
## Deployment Steps
|
|
228
|
+
|
|
229
|
+
1. **Check Readiness:**
|
|
230
|
+
\`\`\`bash
|
|
231
|
+
pnpm check-readiness
|
|
232
|
+
\`\`\`
|
|
233
|
+
|
|
234
|
+
2. **Deploy:**
|
|
235
|
+
\`\`\`bash
|
|
236
|
+
pnpm deploy [environment]
|
|
237
|
+
\`\`\`
|
|
238
|
+
|
|
239
|
+
## Supported Platforms
|
|
240
|
+
|
|
241
|
+
- Vercel
|
|
242
|
+
- Netlify
|
|
243
|
+
- Docker
|
|
244
|
+
- AWS CDK
|
|
245
|
+
- Manual
|
|
246
|
+
|
|
247
|
+
## Environment Configuration
|
|
248
|
+
|
|
249
|
+
[Add environment-specific configuration here]
|
|
250
|
+
|
|
251
|
+
## Rollback
|
|
252
|
+
|
|
253
|
+
If deployment fails:
|
|
254
|
+
1. Run rollback script
|
|
255
|
+
2. Restore previous version
|
|
256
|
+
3. Verify system stability
|
|
257
|
+
|
|
258
|
+
## Monitoring
|
|
259
|
+
|
|
260
|
+
[Add monitoring setup instructions here]
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
*Last updated: $(date -u +"%Y-%m-%d")*
|
|
265
|
+
EOF
|
|
266
|
+
|
|
267
|
+
echo -e "${GREEN}✓ Generated deployment guide${NC}"
|
|
268
|
+
|
|
269
|
+
echo ""
|
|
270
|
+
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
271
|
+
echo -e "${GREEN}✓ Documentation generation complete${NC}"
|
|
272
|
+
echo -e "${GREEN}════════════════════════════════════════${NC}"
|
|
273
|
+
echo ""
|
|
274
|
+
echo -e "${YELLOW}Generated files:${NC}"
|
|
275
|
+
echo " - README.md"
|
|
276
|
+
[ -f "_system/architecture/DOCUMENTATION.md" ] && echo " - _system/architecture/DOCUMENTATION.md"
|
|
277
|
+
[ -f "API.md" ] && echo " - API.md"
|
|
278
|
+
echo " - DEPLOYMENT.md"
|
|
279
|
+
echo ""
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Generate Project Context Script
|
|
4
|
+
# Creates PROJECT_CONTEXT.md with project state summary
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
error_exit() {
|
|
9
|
+
echo "ERROR: $1" >&2
|
|
10
|
+
exit "${2:-1}"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
# Colors
|
|
14
|
+
GREEN='\033[0;32m'
|
|
15
|
+
YELLOW='\033[1;33m'
|
|
16
|
+
BLUE='\033[0;34m'
|
|
17
|
+
NC='\033[0m'
|
|
18
|
+
|
|
19
|
+
CONTEXT_FILE="PROJECT_CONTEXT.md"
|
|
20
|
+
|
|
21
|
+
echo -e "${BLUE}Generating project context...${NC}"
|
|
22
|
+
|
|
23
|
+
# Check prerequisites
|
|
24
|
+
if [ ! -f "project.json" ]; then
|
|
25
|
+
error_exit "project.json not found. Run /init-project first." 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
PROJECT_NAME=$(jq -r '.name' project.json 2>/dev/null || echo "project")
|
|
29
|
+
PROJECT_DESC=$(jq -r '.description' project.json 2>/dev/null || echo "Project description")
|
|
30
|
+
TECH_STACK=$(jq -r '.techStack' project.json 2>/dev/null || echo "unknown")
|
|
31
|
+
|
|
32
|
+
# Count intents
|
|
33
|
+
intent_files=()
|
|
34
|
+
while IFS= read -r file; do
|
|
35
|
+
intent_files+=("$file")
|
|
36
|
+
done < <(find intent -type f -name "*.md" ! -name "_TEMPLATE.md" 2>/dev/null)
|
|
37
|
+
|
|
38
|
+
INTENT_COUNT=${#intent_files[@]}
|
|
39
|
+
|
|
40
|
+
# Count active intents
|
|
41
|
+
if [ "$INTENT_COUNT" -gt 0 ]; then
|
|
42
|
+
ACTIVE_COUNT=$(grep -l "Status.*active" "${intent_files[@]}" 2>/dev/null | wc -l | tr -d ' ')
|
|
43
|
+
COMPLETED_COUNT=$(grep -l "Status.*shipped" "${intent_files[@]}" 2>/dev/null | wc -l | tr -d ' ')
|
|
44
|
+
else
|
|
45
|
+
ACTIVE_COUNT=0
|
|
46
|
+
COMPLETED_COUNT=0
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
# Get active intent
|
|
50
|
+
ACTIVE_INTENT=$(grep -h "^## Status" work/workflow-state/active.md 2>/dev/null | grep -o "F-[0-9]*\|B-[0-9]*\|T-[0-9]*" | head -1 || echo "none")
|
|
51
|
+
|
|
52
|
+
# Generate context file
|
|
53
|
+
cat > "$CONTEXT_FILE" << EOF || error_exit "Failed to generate PROJECT_CONTEXT.md"
|
|
54
|
+
# Project Context: $PROJECT_NAME
|
|
55
|
+
|
|
56
|
+
**Generated:** $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
57
|
+
**Last Updated:** $(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
58
|
+
|
|
59
|
+
## Project Overview
|
|
60
|
+
|
|
61
|
+
- **Name:** $PROJECT_NAME
|
|
62
|
+
- **Description:** $PROJECT_DESC
|
|
63
|
+
- **Tech Stack:** $TECH_STACK
|
|
64
|
+
- **Status:** Active
|
|
65
|
+
|
|
66
|
+
## Intent Summary
|
|
67
|
+
|
|
68
|
+
- **Total Intents:** $INTENT_COUNT
|
|
69
|
+
- **Active:** $ACTIVE_COUNT
|
|
70
|
+
- **Completed:** $COMPLETED_COUNT
|
|
71
|
+
- **Pending:** $((INTENT_COUNT - ACTIVE_COUNT - COMPLETED_COUNT))
|
|
72
|
+
|
|
73
|
+
## Current Work
|
|
74
|
+
|
|
75
|
+
- **Active Intent:** $ACTIVE_INTENT
|
|
76
|
+
|
|
77
|
+
## Project Structure
|
|
78
|
+
|
|
79
|
+
\`\`\`
|
|
80
|
+
.
|
|
81
|
+
├── work/intent/ # $INTENT_COUNT intents
|
|
82
|
+
│ ├── features/ # Feature intents (F-###.md)
|
|
83
|
+
│ ├── bugs/ # Bug intents (B-###.md)
|
|
84
|
+
│ └── tech-debt/ # Tech-debt intents (T-###.md)
|
|
85
|
+
├── work/workflow-state/ # Current execution state
|
|
86
|
+
├── _system/architecture/ # System boundaries
|
|
87
|
+
├── src/ # Source code
|
|
88
|
+
├── tests/ # Test files
|
|
89
|
+
└── ...
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
## Recent Activity
|
|
93
|
+
|
|
94
|
+
[Auto-generated from git history]
|
|
95
|
+
|
|
96
|
+
## Key Decisions
|
|
97
|
+
|
|
98
|
+
[Architectural decisions and ADRs]
|
|
99
|
+
|
|
100
|
+
## Risks & Blockers
|
|
101
|
+
|
|
102
|
+
[Current risks and blockers]
|
|
103
|
+
|
|
104
|
+
## Next Steps
|
|
105
|
+
|
|
106
|
+
[Planned next steps]
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
*This file is auto-generated. Update source files to change content.*
|
|
111
|
+
EOF
|
|
112
|
+
|
|
113
|
+
echo -e "${GREEN}✓ Generated $CONTEXT_FILE${NC}"
|
|
114
|
+
|
|
115
|
+
# Update project history if git is available
|
|
116
|
+
if git rev-parse --git-dir > /dev/null 2>&1; then
|
|
117
|
+
HISTORY_FILE="project-history.md"
|
|
118
|
+
if [ ! -f "$HISTORY_FILE" ]; then
|
|
119
|
+
cat > "$HISTORY_FILE" << EOF || error_exit "Failed to create project history"
|
|
120
|
+
# Project History
|
|
121
|
+
|
|
122
|
+
## Timeline
|
|
123
|
+
|
|
124
|
+
EOF
|
|
125
|
+
fi
|
|
126
|
+
|
|
127
|
+
# Add recent commits
|
|
128
|
+
RECENT_COMMITS=$(git log --oneline -10 --format="%h - %s (%ar)" 2>/dev/null || echo "No git history")
|
|
129
|
+
|
|
130
|
+
cat >> "$HISTORY_FILE" << EOF || true
|
|
131
|
+
|
|
132
|
+
### $(date -u +"%Y-%m-%d")
|
|
133
|
+
|
|
134
|
+
Recent commits:
|
|
135
|
+
$RECENT_COMMITS
|
|
136
|
+
EOF
|
|
137
|
+
|
|
138
|
+
echo -e "${GREEN}✓ Updated project history${NC}"
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
echo ""
|
|
142
|
+
echo -e "${GREEN}Project context generated successfully${NC}"
|