-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup-project.sh
More file actions
executable file
·162 lines (123 loc) · 4.4 KB
/
setup-project.sh
File metadata and controls
executable file
·162 lines (123 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
# Project Setup Script - Integrates standards into new projects
PROJECT_DIR=${1:-"."}
STANDARDS_REPO="https://github.com/williamzujkowski/standards.git"
echo "🚀 Setting up project with development standards..."
# Create project structure
mkdir -p "$PROJECT_DIR"/{.github/workflows,docs,scripts,tests}
# Clone standards temporarily
TEMP_DIR=$(mktemp -d)
git clone --depth 1 "$STANDARDS_REPO" "$TEMP_DIR/standards"
# Copy essential files
cp "$TEMP_DIR/standards/docs/core/CLAUDE.md" "$PROJECT_DIR/docs/"
cp "$TEMP_DIR/standards/docs/guides/KICKSTART_PROMPT.md" "$PROJECT_DIR/docs/"
cp "$TEMP_DIR/standards/docs/guides/KICKSTART_ADVANCED.md" "$PROJECT_DIR/docs/"
# Create project-specific standards reference
cat > "$PROJECT_DIR/docs/PROJECT_STANDARDS.md" << 'EOF'
# Project Standards Reference
This project follows the comprehensive standards defined at:
https://github.com/williamzujkowski/standards
## Quick Links
- [Coding Standards](https://github.com/williamzujkowski/standards/blob/master/docs/standards/CODING_STANDARDS.md)
- [Testing Standards](https://github.com/williamzujkowski/standards/blob/master/docs/standards/TESTING_STANDARDS.md)
- [Security Standards](https://github.com/williamzujkowski/standards/blob/master/docs/standards/MODERN_SECURITY_STANDARDS.md)
## Local Standards Loading (via CLAUDE.md)
For AI-assisted development, use the loading patterns in `docs/CLAUDE.md`:
```
@load [CS:style,architecture + TS:core + SEC:auth]
```
## Project-Specific Overrides
Document any project-specific deviations here:
1. **Language**: [Your language]
2. **Framework**: [Your framework]
3. **Special Requirements**: [Any deviations from standards]
EOF
# Create configuration files based on standards
cat > "$PROJECT_DIR/.editorconfig" << 'EOF'
# EditorConfig helps maintain consistent coding styles
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[*.go]
indent_style = tab
[*.md]
trim_trailing_whitespace = false
EOF
# Create pre-commit config
cat > "$PROJECT_DIR/.pre-commit-config.yaml" << 'EOF'
# Pre-commit hooks based on standards
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: check-merge-conflict
# Add language-specific hooks here
EOF
# Create GitHub Actions workflow for standards compliance
cat > "$PROJECT_DIR/.github/workflows/standards-check.yml" << 'EOF'
name: Standards Compliance Check
on:
pull_request:
branches: [ main, master ]
push:
branches: [ main, master ]
jobs:
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Standards Checks
run: |
echo "Running standards compliance checks..."
# Add your language-specific linters and checks here
- name: Check Test Coverage
run: |
echo "Checking test coverage meets 85% requirement..."
# Add coverage check commands
EOF
# Create Makefile with standards-based targets
cat > "$PROJECT_DIR/Makefile" << 'EOF'
# Standards-compliant Makefile
.PHONY: help install test lint format security-check
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies
@echo "Installing dependencies..."
# Add language-specific install commands
test: ## Run tests with coverage
@echo "Running tests (target: 85% coverage)..."
# Add test commands
lint: ## Run linting checks
@echo "Running linters..."
# Add linting commands
format: ## Format code according to standards
@echo "Formatting code..."
# Add formatting commands
security-check: ## Run security scanning
@echo "Running security checks..."
# Add security scanning commands
ci: lint test security-check ## Run all CI checks
EOF
# Cleanup
rm -rf "$TEMP_DIR"
echo "✅ Project setup complete!"
echo ""
echo "Next steps:"
echo "1. Review docs/PROJECT_STANDARDS.md and customize for your project"
echo "2. Install pre-commit hooks: pre-commit install"
echo "3. Configure language-specific tools in Makefile"
echo "4. Set up CI/CD based on .github/workflows/standards-check.yml"
echo ""
echo "For LLM-assisted development, use docs/CLAUDE.md patterns"