Skip to content

Commit b525400

Browse files
Dev Userclaude
andcommitted
feat: merge planning repo artifacts into production
Copy 158 files from ScriptHammer_planning: Docker reference docs, interoffice memos/audits/RFCs, blog posts, security audits, RLS tests, Supabase migrations, constitution template, and CONTRIBUTING.md. Removed duplicate pages.yml workflow (deploy.yml already handles this). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 44aa20e commit b525400

158 files changed

Lines changed: 30050 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/config/terminal-map.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"session": "scripthammer",
3+
"terminals": {
4+
"cto": 0,
5+
"product-owner": 1,
6+
"business-analyst": 2,
7+
"architect": 3,
8+
"ux-designer": 4,
9+
"ui-designer": 5,
10+
"planner": 6,
11+
"generator-1": 7,
12+
"generator-2": 8,
13+
"generator-3": 9,
14+
"preview-host": 10,
15+
"wireframe-qa": 11,
16+
"validator": 12,
17+
"inspector": 13,
18+
"developer": 14,
19+
"toolsmith": 15,
20+
"security": 16,
21+
"test-engineer": 17,
22+
"qa-lead": 18,
23+
"auditor": 19,
24+
"author": 20,
25+
"tech-writer": 21,
26+
"devops": 22,
27+
"docker-captain": 23,
28+
"release-manager": 24,
29+
"coordinator": 25
30+
},
31+
"groups": {
32+
"all-generators": ["generator-1", "generator-2", "generator-3"],
33+
"qc": ["preview-host", "wireframe-qa", "validator", "inspector"],
34+
"council": [
35+
"cto",
36+
"architect",
37+
"security",
38+
"toolsmith",
39+
"devops",
40+
"product-owner",
41+
"ux-designer"
42+
],
43+
"wireframe": [
44+
"planner",
45+
"generator-1",
46+
"generator-2",
47+
"generator-3",
48+
"preview-host",
49+
"wireframe-qa",
50+
"validator",
51+
"inspector"
52+
]
53+
},
54+
"aliases": {
55+
"gen1": "generator-1",
56+
"gen2": "generator-2",
57+
"gen3": "generator-3",
58+
"qa": "wireframe-qa",
59+
"preview": "preview-host"
60+
}
61+
}

.pre-commit-config.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Pre-commit hooks for ScriptHammer
2+
# Install: pip install pre-commit && pre-commit install
3+
# For commit-msg hooks: pre-commit install --hook-type commit-msg
4+
# Run manually: pre-commit run --all-files
5+
6+
repos:
7+
# Basic file hygiene
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v4.5.0
10+
hooks:
11+
- id: trailing-whitespace
12+
exclude: \.svg$
13+
- id: end-of-file-fixer
14+
exclude: \.svg$
15+
- id: check-yaml
16+
args: [--unsafe] # Allow custom tags in GitHub Actions
17+
- id: check-json
18+
- id: check-added-large-files
19+
args: ['--maxkb=1000']
20+
- id: check-merge-conflict
21+
- id: detect-private-key
22+
23+
# Python linting with Ruff (fast, modern)
24+
- repo: https://github.com/astral-sh/ruff-pre-commit
25+
rev: v0.3.0
26+
hooks:
27+
- id: ruff
28+
args: [--fix, --exit-non-zero-on-fix]
29+
files: ^docs/design/wireframes/.*\.py$
30+
- id: ruff-format
31+
files: ^docs/design/wireframes/.*\.py$
32+
33+
# Shell script linting
34+
- repo: https://github.com/shellcheck-py/shellcheck-py
35+
rev: v0.9.0.6
36+
hooks:
37+
- id: shellcheck
38+
args: [-x] # Follow sourced files
39+
40+
# Markdown linting
41+
- repo: https://github.com/igorshubovych/markdownlint-cli
42+
rev: v0.39.0
43+
hooks:
44+
- id: markdownlint
45+
args: [--fix, --disable, MD013, MD033, MD041, --]
46+
# MD013: Line length (too strict for specs)
47+
# MD033: Inline HTML (needed for some docs)
48+
# MD041: First line heading (not always applicable)
49+
50+
# Local hooks for project-specific validation
51+
- repo: local
52+
hooks:
53+
- id: validate-wireframes
54+
name: Validate SVG wireframes
55+
entry: python docs/design/wireframes/validate-wireframe.py
56+
language: system
57+
files: ^docs/design/wireframes/.*\.svg$
58+
pass_filenames: true
59+
60+
# Conventional commits (install with: pre-commit install --hook-type commit-msg)
61+
- repo: https://github.com/compilerla/conventional-pre-commit
62+
rev: v3.1.0
63+
hooks:
64+
- id: conventional-pre-commit
65+
stages: [commit-msg]
66+
args: [feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert]

.secrets-allowlist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Secrets Scanner Allowlist
2+
# False positives and intentional exceptions
3+
# Format: file:path, line:path:num, pattern:substring
4+
5+
# The secrets-scan.py script contains regex patterns (not actual secrets)
6+
file:scripts/secrets-scan.py
7+
8+
# Test fixtures with fake credentials (not real secrets)
9+
pattern:tests/fixtures/test-users
10+
11+
# Python virtualenv contains example code (not our code)
12+
pattern:.speckit/specify-cli/lib/python
13+
14+
# Example .env file is intentionally committed as a template
15+
file:.env.example

CHANGELOG.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Changelog
2+
3+
All notable changes to ScriptHammer are documented here.
4+
5+
## [Unreleased] - 2026-01-16
6+
7+
### Added
8+
9+
- **SpecKit constitution check**: Analyze workflow now validates constitution compliance (2f85f07)
10+
- **QC-Operator role**: PNG batch quality control workflow for wireframe review (7d99622)
11+
- **Tmux QC flag**: `--qc` option for Quality Control session layout (37d1aa7)
12+
- **Inspector active state checks**: G-045/G-046 mobile navigation validation (2ff3628)
13+
- **Signature validation**: Inspector checks for signature alignment and format (9fe9f5e)
14+
- **Validator SIGNATURE checks**: SIGNATURE-003/004 rules for left-alignment and format (1509660, 92367fb)
15+
- **XML syntax rules**: G-040, G-041, G-042 documentation for SVG compliance (a0fb2a9)
16+
- **Auth feature contracts**: 003-auth quickstart and test plan documentation (4aaaef8)
17+
- **Auditor guidance report**: Gap analysis for validator rule coverage (e012272)
18+
- **Script caching system**: Token-efficient precompute for wireframe processing (ea0b41f)
19+
- **Role-based context system**: 21 specialized terminal roles with focused context files (`.claude/roles/`)
20+
- **Docker Captain role**: New terminal role with Brett Fisher's Docker knowledge base
21+
- **Central logging system**: Persistence rules ensuring terminal output survives sessions
22+
- **RFC-004**: CI wireframe validation enforcement workflow
23+
- **13 new feature wireframes**: 34+ SVGs added for features 003-015
24+
- **Product Owner role**: New council member with `/status` skill and audit oversight
25+
- **Tmux session launcher**: Script for multi-terminal workflow automation (`scripts/launch-session.sh`)
26+
- **Python automation scripts**: Token-efficient wireframe processing tools
27+
- **PNG collection script**: Automated overview screenshot gathering
28+
- **Validator output flags**: `--json` and `--summary` flags for CI integration (41d5c4d)
29+
- **P0 pre-implementation docs**: Documentation for priority-zero features (69f767a)
30+
- **Constitution v1.1.0**: Updated constitution via RFC-005 approval
31+
32+
### Changed
33+
34+
- **Role boundaries**: Explicit wireframe-pipeline role boundaries documented (ff04984)
35+
- **Operator rules**: Explicit instruction-only execution and tmux send-keys requirements (13f7720, e5741d7)
36+
- **Window references**: Documentation updated to use window names not numbers (be2ad62)
37+
- **Automation workflow**: Now requires `--dangerously-skip-permissions` flag for autonomous operation
38+
- **Terminal role hierarchy**: Restructured with CTO at top of reporting chain
39+
- **Wireframe title positions**: Corrected x=700→x=960 across 21 SVGs for consistency
40+
- **Docker viewer base image**: Upgraded to `node:22-bookworm-slim` for CVE reduction (63827d1)
41+
42+
### Fixed
43+
44+
- **G-047 Key Concepts position**: Corrected y=730→y=940 with Architect confirmation (ce349fd, 61787fa)
45+
- **Validator ANN-004**: Handle malformed SVG gracefully (965e7d3)
46+
- **Batch wireframe patches**: G-044, G-047, SIGNATURE-003 fixes applied (46eb178)
47+
- **Dispatch targeting**: Use window names instead of numbers (1963190)
48+
- **QC-Operator README**: Format consistency with other role documentation (f6182bc)
49+
- **Inspector title detection**: Rewritten to handle multiline SVG `<title>` elements
50+
- **Wireframe viewer navigation**: Fixed routing and screenshot size bugs
51+
- **Dark theme**: Corrected color scheme in wireframe viewer
52+
- **CI validator parsing**: Use `--json` output instead of grep parsing (37e387a)
53+
- **Docker health check**: Alpine compatibility fix for viewer container (d4a37aa)
54+
- **SVG position issues**: Patched Inspector-identified positioning problems (5410509)
55+
56+
### Removed
57+
58+
- **Stale issue files**: Cleaned up 11 obsolete wireframe issue files (4d40e54)
59+
- **Premature files**: Session cleanup removed files created before specs (2e1e664)
60+
61+
### Decisions
62+
63+
- **RFC-004 approved**: Unanimous 6-0 council vote for CI wireframe validation enforcement
64+
- **RFC-005 approved**: Unanimous council vote for constitution v1.1.0 amendments (696ef23)
65+
66+
### Audits
67+
68+
- **Validator full sweep**: 27/45 wireframes pass, 18 require fixes (43a6417)
69+
- **G-039 nav analysis**: Active state check classification (6447289)
70+
- **G-044 PATCH classification**: Line-number based issue tracking (2dcc818)
71+
- **Inspector verification**: Toolsmith task audit completed (8c6cea8)
72+
73+
---
74+
75+
## [0.1.0] - 2026-01-13
76+
77+
### Added
78+
79+
- Initial feature specifications (46 features)
80+
- Interactive SVG wireframe viewer
81+
- SpecKit workflow integration
82+
- Multi-terminal tmux architecture
83+
- Queue-based task management system
84+
85+
---
86+
87+
_Format: [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)_

CODE-REVIEW-ISSUES.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Code Review Issues
2+
3+
**Date:** 2026-01-13
4+
**Reviewer:** Claude Opus 4.5
5+
**Repository:** ScriptHammer (Planning Template)
6+
7+
## Repository Context
8+
9+
This is a **planning template repository** containing:
10+
11+
- 46 feature specifications (markdown)
12+
- SVG wireframe viewer (`docs/design/wireframes/`)
13+
- 2 Python scripts: `validate-wireframe.py` (1999 lines), `screenshot-wireframes.py` (391 lines)
14+
- 1 HTML viewer with embedded JavaScript
15+
16+
**No application source code exists** - this is spec-first planning.
17+
18+
---
19+
20+
## Phase 1: Security Audit
21+
22+
### Fixed Issues
23+
24+
| Issue | File | Severity | Status |
25+
| --------------------------- | --------------- | -------- | --------- |
26+
| DOM-based XSS via innerHTML | index.html:1276 | CRITICAL | **FIXED** |
27+
| Path traversal in SVG refs | index.html:1240 | HIGH | **FIXED** |
28+
| XSS in error message path | index.html:1281 | MEDIUM | **FIXED** |
29+
30+
### Remediation Applied
31+
32+
1. **SVG Sanitization** (index.html:1280-1303)
33+
- Added `sanitizeSVG()` function that removes:
34+
- `<script>` elements
35+
- Event handlers (`onclick`, `onload`, etc.)
36+
- `javascript:` hrefs
37+
- Dangerous elements (`foreignObject`, `set`, animated hrefs)
38+
39+
2. **Path Traversal Protection** (index.html:1241-1252)
40+
- Added `isValidSvgPath()` validator that blocks:
41+
- `..` sequences
42+
- Absolute paths (`/`)
43+
- Double slashes (`//`)
44+
- Only allows `.svg` files from `includes/` or same directory
45+
46+
3. **Safe Error Rendering** (index.html:1315-1321)
47+
- Changed from template literal in innerHTML to createElement + textContent
48+
49+
4. **Content Security Policy** (index.html:7)
50+
- Added CSP meta tag with:
51+
- `default-src 'self'` - blocks unauthorized resources
52+
- `script-src` - allows self, inline, and Google Analytics domains
53+
- `style-src` - allows self and inline styles
54+
- `img-src` - allows self, data URIs, and GA tracking pixels
55+
- `connect-src` - allows fetch to self and GA
56+
- `frame-ancestors 'self'` - prevents clickjacking
57+
58+
### Remaining (Accepted Risk)
59+
60+
| Issue | Severity | Decision |
61+
| --------------------------- | -------- | -------------------------------------------------------- |
62+
| No SRI for Google Analytics | MEDIUM | GA script changes frequently; SRI would break on updates |
63+
64+
**Note:** SRI is not practical for GA because Google updates the script without notice. CSP already restricts which domains can serve scripts.
65+
66+
### Python Scripts - No Issues Found
67+
68+
Both `validate-wireframe.py` and `screenshot-wireframes.py` are **secure**:
69+
70+
- No command injection (subprocess uses list form)
71+
- No path traversal (paths bounded to wireframes directory)
72+
- No hardcoded secrets
73+
- XXE not possible (Python 3.7+ default protects against it)
74+
75+
---
76+
77+
## Phase 2: Performance Analysis
78+
79+
### No Issues Found
80+
81+
This is a planning template with minimal code:
82+
83+
- No application code to optimize
84+
- Python scripts are already O(n) with binary search optimizations
85+
- HTML viewer uses vanilla JS (no framework overhead)
86+
87+
---
88+
89+
## Phase 3: Code Quality
90+
91+
### Fixed Issues
92+
93+
| Issue | File | Line | Status |
94+
| --------------------- | --------------------- | ---- | --------- |
95+
| Unused import `field` | validate-wireframe.py | 28 | **FIXED** |
96+
97+
### No Other Issues Found
98+
99+
- No TODO/FIXME comments in executable code
100+
- No linter disables
101+
- No unimplemented stubs
102+
- No duplicate files
103+
104+
---
105+
106+
## Phase 4: Test Coverage
107+
108+
### Current State
109+
110+
| Metric | Value |
111+
| ------------- | ----- |
112+
| Test files | 0 |
113+
| Test coverage | 0% |
114+
115+
**Note:** This is expected for a planning template. Tests are specified in `features/testing/` but not implemented yet.
116+
117+
---
118+
119+
## Summary
120+
121+
| Category | Found | Fixed | Remaining |
122+
| ------------- | ----- | ----- | ----------------- |
123+
| Security | 6 | 5 | 1 (accepted risk) |
124+
| Performance | 0 | 0 | 0 |
125+
| Code Quality | 1 | 1 | 0 |
126+
| Test Coverage | N/A | N/A | N/A |
127+
128+
**All actionable issues have been fixed.** The remaining item (SRI for Google Analytics) is an accepted risk because GA scripts change frequently and SRI would cause breakage.

0 commit comments

Comments
 (0)