@slamb2k/mad-skills 2.0.6

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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -0
  3. package/package.json +42 -0
  4. package/skills/brace/SKILL.md +51 -0
  5. package/skills/brace/assets/gitignore-template +28 -0
  6. package/skills/brace/assets/global-preferences-template.md +53 -0
  7. package/skills/brace/instructions.md +229 -0
  8. package/skills/brace/references/brace-workflow.md +109 -0
  9. package/skills/brace/references/claude-md-template.md +91 -0
  10. package/skills/brace/references/gotcha-principles.md +113 -0
  11. package/skills/brace/references/phase-prompts.md +228 -0
  12. package/skills/brace/references/report-template.md +38 -0
  13. package/skills/brace/references/scaffold-manifest.md +68 -0
  14. package/skills/brace/tests/evals.json +29 -0
  15. package/skills/build/SKILL.md +48 -0
  16. package/skills/build/instructions.md +293 -0
  17. package/skills/build/references/architecture-notes.md +34 -0
  18. package/skills/build/references/project-detection.md +45 -0
  19. package/skills/build/references/report-contracts.md +21 -0
  20. package/skills/build/references/stage-prompts.md +405 -0
  21. package/skills/build/tests/evals.json +28 -0
  22. package/skills/distil/SKILL.md +38 -0
  23. package/skills/distil/assets/DesignNav.tsx +54 -0
  24. package/skills/distil/instructions.md +255 -0
  25. package/skills/distil/references/design-guide.md +118 -0
  26. package/skills/distil/references/iteration-mode.md +186 -0
  27. package/skills/distil/references/project-setup.md +92 -0
  28. package/skills/distil/tests/evals.json +28 -0
  29. package/skills/manifest.json +76 -0
  30. package/skills/prime/SKILL.md +39 -0
  31. package/skills/prime/instructions.md +73 -0
  32. package/skills/prime/references/domains.md +38 -0
  33. package/skills/prime/tests/evals.json +28 -0
  34. package/skills/rig/SKILL.md +38 -0
  35. package/skills/rig/assets/azure-pipelines.yml +91 -0
  36. package/skills/rig/assets/ci.yml +104 -0
  37. package/skills/rig/assets/gitmessage +38 -0
  38. package/skills/rig/assets/lefthook.yml +29 -0
  39. package/skills/rig/assets/pull_request_template.md +24 -0
  40. package/skills/rig/instructions.md +162 -0
  41. package/skills/rig/references/configuration-steps.md +124 -0
  42. package/skills/rig/references/phase-prompts.md +180 -0
  43. package/skills/rig/references/report-template.md +28 -0
  44. package/skills/rig/tests/evals.json +29 -0
  45. package/skills/ship/SKILL.md +55 -0
  46. package/skills/ship/instructions.md +192 -0
  47. package/skills/ship/references/stage-prompts.md +322 -0
  48. package/skills/ship/tests/evals.json +30 -0
  49. package/skills/sync/SKILL.md +54 -0
  50. package/skills/sync/instructions.md +178 -0
  51. package/skills/sync/tests/evals.json +29 -0
  52. package/src/cli.js +419 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 MAD Skills Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # MAD Skills
2
+
3
+ ![Mad Skills](assets/mad-skills.png)
4
+
5
+ An npm-based skill framework for Claude Code. Ships 7 skills covering the full development lifecycle — from project initialization to shipping PRs.
6
+
7
+ ## Skills
8
+
9
+ | Skill | Command | Description |
10
+ |-------|---------|-------------|
11
+ | **build** | `/build` | Context-isolated feature development pipeline. Takes a design/plan and executes explore, question, architect, implement, review, ship inside subagents. |
12
+ | **brace** | `/brace` | Initialize projects with the GOTCHA/BRACE framework. Creates 6-layer structure, BRACE build methodology, and project CLAUDE.md. |
13
+ | **distil** | `/distil` | Generate multiple unique web design variations. Creates a Vite + React + TypeScript + Tailwind project with N designs at /1, /2, /3. |
14
+ | **prime** | `/prime` | Load project context before feature work. Supports domain-specific context (security, routing, dashboard, etc.). |
15
+ | **rig** | `/rig` | Bootstrap repos with lefthook hooks, commit templates, PR templates, and GitHub Actions workflows. Idempotent. |
16
+ | **ship** | `/ship` | Full PR lifecycle — sync with main, create branch, commit, push, create PR, wait for CI, fix issues, squash merge, cleanup. |
17
+ | **sync** | `/sync` | Sync local repo with origin/main. Stashes changes, pulls, restores stash, cleans up stale branches. |
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ # Install globally
23
+ npm install -g @slamb2k/mad-skills
24
+
25
+ # Or run directly with npx
26
+ npx @slamb2k/mad-skills --list # List available skills
27
+ npx @slamb2k/mad-skills # Install all skills
28
+ npx @slamb2k/mad-skills --skill ship,sync # Install specific skills
29
+ ```
30
+
31
+ Skills are installed as slash commands in your Claude Code environment. After installation, invoke them with `/<skill-name>` (e.g., `/ship`, `/sync`).
32
+
33
+ ## Repository Structure
34
+
35
+ ```
36
+ mad-skills/
37
+ ├── skills/ # Skill definitions (7 skills)
38
+ │ ├── build/
39
+ │ ├── brace/
40
+ │ ├── distil/
41
+ │ ├── prime/
42
+ │ ├── rig/
43
+ │ ├── ship/
44
+ │ └── sync/
45
+ ├── scripts/ # Build and CI tooling
46
+ │ ├── validate-skills.js # Structural validation
47
+ │ ├── lint-skills.js # SKILL.md linting
48
+ │ ├── run-evals.js # Eval runner (Anthropic/OpenRouter)
49
+ │ ├── build-manifests.js # Generate skills/manifest.json
50
+ │ └── package-skills.js # Package .skill archives
51
+ ├── src/
52
+ │ └── cli.js # npx installer CLI
53
+ ├── commands/ # Slash command stubs
54
+ ├── hooks/ # Session hooks (session-guard)
55
+ ├── agents/ # Agent definitions (ship-analyzer)
56
+ ├── tests/results/ # Eval output
57
+ ├── archive/ # Legacy skills (v1.x)
58
+ ├── .claude-plugin/ # Plugin metadata
59
+ │ ├── marketplace.json
60
+ │ └── plugin.json
61
+ └── .github/workflows/
62
+ ├── ci.yml # PR validation + evals
63
+ └── release.yml # Tagged release → npm + GitHub
64
+ ```
65
+
66
+ ### Skill Structure
67
+
68
+ Each skill in `skills/<name>/` follows a standard layout:
69
+
70
+ ```
71
+ skills/<name>/
72
+ ├── SKILL.md # Frontmatter (name, description) + banner
73
+ ├── instructions.md # Execution logic (max 500 lines)
74
+ ├── references/ # Extracted prompts, contracts, guides
75
+ ├── assets/ # Static files (templates, components)
76
+ └── tests/
77
+ └── evals.json # Eval cases for the skill
78
+ ```
79
+
80
+ ## Development
81
+
82
+ ```bash
83
+ # Validate all skill structures
84
+ npm run validate
85
+
86
+ # Lint SKILL.md files
87
+ npm run lint
88
+
89
+ # Run evals (requires ANTHROPIC_API_KEY or OPENROUTER_API_KEY)
90
+ npm run eval
91
+ npm run eval -- --verbose
92
+ npm run eval:update # Update eval snapshots
93
+
94
+ # Build
95
+ npm run build:manifests # Generate skills/manifest.json
96
+ npm run build:skills # Package .skill archives
97
+ npm run build # Both
98
+
99
+ # Full test suite
100
+ npm test # validate + lint + eval
101
+ ```
102
+
103
+ ## CI/CD
104
+
105
+ **PR pipeline** (`.github/workflows/ci.yml`):
106
+ - Triggers on all pull requests (required status check)
107
+ - Runs validate and lint
108
+ - Runs evals when API key is available (skipped for external PRs)
109
+ - Detects which skills changed and posts eval results as PR comments
110
+
111
+ **Release pipeline** (`.github/workflows/release.yml`):
112
+ - Triggers on push to main
113
+ - Validates, lints, runs evals, builds manifests
114
+ - Creates version tag from package.json, publishes to npm with provenance
115
+ - Builds `.skill` packages and creates a GitHub Release
116
+ - Skips publish if the version tag already exists
117
+
118
+ ## Archive
119
+
120
+ Legacy skills from v1.x are preserved in `archive/` for reference:
121
+ - play-tight (Browser Automation)
122
+ - pixel-pusher (UI/UX Design)
123
+ - cyberarian (Document Lifecycle Management)
124
+ - start-right (Repository Scaffolding)
125
+ - graphite-skill (Git/Graphite Workflows)
126
+
127
+ ## License
128
+
129
+ MIT — see [LICENSE](LICENSE)
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@slamb2k/mad-skills",
3
+ "version": "2.0.6",
4
+ "description": "Claude Code skills collection with CI/CD and npx installer",
5
+ "type": "module",
6
+ "bin": {
7
+ "claude-skills": "./src/cli.js"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/slamb2k/mad-skills"
12
+ },
13
+ "files": [
14
+ "src/",
15
+ "skills/"
16
+ ],
17
+ "scripts": {
18
+ "validate": "node scripts/validate-skills.js",
19
+ "lint": "node scripts/lint-skills.js",
20
+ "eval": "node scripts/run-evals.js",
21
+ "eval:update": "node scripts/run-evals.js --update-snapshots",
22
+ "build:manifests": "node scripts/build-manifests.js",
23
+ "build:skills": "node scripts/package-skills.js",
24
+ "build": "npm run build:manifests && npm run build:skills",
25
+ "prepublishOnly": "npm run validate && npm run build:manifests",
26
+ "test": "npm run validate && npm run lint && npm run eval"
27
+ },
28
+ "keywords": [
29
+ "claude",
30
+ "claude-code",
31
+ "skills",
32
+ "mcp",
33
+ "ai"
34
+ ],
35
+ "license": "MIT",
36
+ "engines": {
37
+ "node": ">=18"
38
+ },
39
+ "devDependencies": {
40
+ "@anthropic-ai/sdk": "^0.39.0"
41
+ }
42
+ }
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: brace
3
+ description: >
4
+ Initialize any project directory with the GOTCHA/BRACE framework for agentic
5
+ AI systems. Creates the 6-layer structure (Goals, Orchestration, Tools,
6
+ Context, Hard prompts, Args), BRACE build methodology, and a project
7
+ CLAUDE.md. Recommends claude-mem for persistent memory. Idempotent — safe
8
+ to run on existing projects. Triggers: "init gotcha", "setup brace", "brace",
9
+ "initialize framework", "bootstrap gotcha".
10
+ argument-hint: [--no-brace] [--force]
11
+ ---
12
+
13
+ # Brace - GOTCHA/BRACE Framework Bootstrap
14
+
15
+ When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
16
+ Pick ONE tagline at random — vary your choice each time:
17
+
18
+ ```
19
+ {tagline}
20
+
21
+ ██╗██████╗ ██████╗ █████╗ ██████╗███████╗
22
+ ██╔╝██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔════╝
23
+ ██╔╝ ██████╔╝██████╔╝███████║██║ █████╗
24
+ ██╔╝ ██╔══██╗██╔══██╗██╔══██║██║ ██╔══╝
25
+ ██╔╝ ██████╔╝██║ ██║██║ ██║╚██████╗███████╗
26
+ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚══════╝
27
+
28
+ ```
29
+
30
+ Taglines:
31
+ - Bracing the structure...
32
+ - Reinforcing before load!
33
+ - Locking in the framework!
34
+ - Preparing for heavy lifting!
35
+ - Cross-bracing the foundation!
36
+ - Tightening the load path!
37
+ - Structural integrity confirmed!
38
+ - Brace for impact!
39
+
40
+ Follow instructions in: [instructions.md](instructions.md)
41
+
42
+ ## Subagent Architecture
43
+
44
+ - Phase 1 (scan): **Bash** subagent, **haiku** model
45
+ - Phase 4 (scaffold): **general-purpose** subagent (content generation)
46
+ - Phase 5 (verify): **Bash** subagent, **haiku** model
47
+
48
+ ## Flags
49
+
50
+ - `--no-brace` — Skip BRACE build methodology
51
+ - `--force` — Overwrite existing files without prompting
@@ -0,0 +1,28 @@
1
+ # Credentials & secrets
2
+ .env
3
+ .env.*
4
+ *.pem
5
+ *.key
6
+ credentials.json
7
+ token.json
8
+
9
+ # Data & databases
10
+ data/
11
+ *.db
12
+ *.sqlite
13
+ *.sqlite3
14
+
15
+ # Temp & scratch
16
+ .tmp/
17
+
18
+ # Memory embeddings cache
19
+ memory/*.npy
20
+
21
+ # Python
22
+ __pycache__/
23
+ *.pyc
24
+ .venv/
25
+
26
+ # OS files
27
+ .DS_Store
28
+ Thumbs.db
@@ -0,0 +1,53 @@
1
+ # Global Preferences & Universal Principles
2
+
3
+ Template appended to `~/.claude/CLAUDE.md` by brace when the user
4
+ selects "global" or "both" installation level. The Phase 4 agent inserts
5
+ this content before the "## Current Skills" section.
6
+
7
+ ---
8
+
9
+ BEGIN TEMPLATE
10
+
11
+ ## Global Preferences
12
+
13
+ These defaults apply to all projects. Override in a project-level CLAUDE.md.
14
+
15
+ ### Tooling
16
+ - **Python**: Use `uv` for virtual environments and dependency management
17
+ - **JavaScript/TypeScript**: Use `bun` over `node`/`npm`/`yarn`
18
+ - **Git**: Use conventional commits with scope — `feat(scope): message`
19
+
20
+ ### Code Quality
21
+ - Prefer editing existing files over creating new ones
22
+ - Do not create documentation files (README, CHANGELOG) unless asked
23
+ - Do not add comments, docstrings, or type annotations to code you didn't change
24
+ - Prefer simple, readable code over clever abstractions
25
+
26
+ ### Security
27
+ - Never commit `.env`, credentials, or API keys
28
+ - Check `git diff --staged` for secrets before committing
29
+
30
+ ### Python
31
+ - Use `pathlib` over `os.path`
32
+ - Use f-strings over `.format()` or `%`
33
+ - Type hints on function signatures, not internal variables
34
+
35
+ ### Testing
36
+ - Always run tests after making changes unless told to skip
37
+
38
+ ## Universal Operating Principles
39
+
40
+ ### Question & Assumption Accountability
41
+ - When making an assumption, state it explicitly and record it
42
+ - When a question can't be answered immediately, log it as an open item
43
+ - When deferring a fix or skipping an edge case, document why
44
+ - At the end of each task, review all assumptions and open questions
45
+ - Never close a task with unacknowledged open questions
46
+ - Present unresolved items to the user with context and suggested actions
47
+
48
+ ### Communication
49
+ - When stuck, explain what's missing — don't guess or invent capabilities
50
+ - When a workflow fails mid-execution, preserve intermediate outputs
51
+ - Verify output format before chaining into another tool or step
52
+
53
+ END TEMPLATE
@@ -0,0 +1,229 @@
1
+ # Brace Instructions
2
+
3
+ Initialize any project directory with the GOTCHA/BRACE framework. Idempotent —
4
+ safe to re-run on existing projects. Content templates and subagent prompts
5
+ are in `references/`.
6
+
7
+ **Key principle:** Scan first, present plan, get approval, then act.
8
+
9
+ Phase prompts: `references/phase-prompts.md`
10
+ Scaffold manifest: `references/scaffold-manifest.md`
11
+ Report format: `references/report-template.md`
12
+
13
+ ---
14
+
15
+ ## Flags
16
+
17
+ Parse optional flags from the request:
18
+ - `--no-brace` — Skip BRACE build methodology (goals/build_app.md)
19
+ - `--force` — Overwrite existing files without prompting
20
+
21
+ ---
22
+
23
+ ## Pre-flight
24
+
25
+ Before starting, check all dependencies in this table:
26
+
27
+ | Dependency | Type | Check | Required | Resolution | Detail |
28
+ |-----------|------|-------|----------|------------|--------|
29
+ | claude-mem | plugin | — | no | ask | `claude plugin install claude-mem` |
30
+
31
+ For each row, in order:
32
+ 1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
33
+ 2. If found: continue silently
34
+ 3. If missing: apply Resolution strategy
35
+ - **stop**: notify user with Detail, halt execution
36
+ - **url**: notify user with Detail (install link), halt execution
37
+ - **install**: notify user, run the command in Detail, continue if successful
38
+ - **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
39
+ - **fallback**: notify user with Detail, continue with degraded behavior
40
+ 4. After all checks: summarize what's available and what's degraded
41
+
42
+ 1. Capture **FLAGS** from the user's request
43
+ 2. Create a task list tracking all 5 phases
44
+
45
+ ---
46
+
47
+ ## Phase 1: Directory Scan
48
+
49
+ Launch **Bash** subagent (**haiku**):
50
+
51
+ ```
52
+ Task(
53
+ subagent_type: "Bash",
54
+ model: "haiku",
55
+ description: "Scan directory for existing GOTCHA structure",
56
+ prompt: <read from references/phase-prompts.md#phase-1>
57
+ )
58
+ ```
59
+
60
+ Parse SCAN_REPORT. Extract:
61
+ - `directory_name` (used as default project name)
62
+ - `existing_dirs` / `missing_dirs`
63
+ - `existing_files` / `missing_files`
64
+ - `has_claude_md` / `has_gitignore`
65
+ - `has_atlas` (legacy ATLAS naming detected)
66
+ - `has_forge` (legacy FORGE naming detected)
67
+
68
+ ---
69
+
70
+ ## Phase 1b: Legacy Upgrade Detection
71
+
72
+ **Skip if neither `has_atlas` nor `has_forge` is true.**
73
+
74
+ If SCAN_REPORT shows `has_atlas: true` or `has_forge: true`, ask the user via AskUserQuestion:
75
+
76
+ Question: "Legacy naming detected. Upgrade to BRACE?"
77
+ Options:
78
+ - "Yes, upgrade to BRACE" — Replace legacy references with BRACE equivalents
79
+ - "No, leave as-is" — Keep existing naming
80
+
81
+ Store result as `upgrade_legacy: true|false` in USER_CONFIG.
82
+
83
+ ---
84
+
85
+ ## Phase 2: Project Inquiry
86
+
87
+ **Runs on primary thread** (user interaction required).
88
+
89
+ 1. Derive default project name from SCAN_REPORT `directory_name`
90
+ 2. Present via AskUserQuestion:
91
+
92
+ Question: "What to include in GOTCHA setup?"
93
+ Options:
94
+ - "Full GOTCHA + BRACE (Recommended)"
95
+ - "GOTCHA structure only (no BRACE methodology)"
96
+ - "Cancel"
97
+
98
+ 3. If not cancelled, ask for project description (one sentence) via
99
+ AskUserQuestion with free text.
100
+
101
+ 4. Ask installation level via AskUserQuestion:
102
+
103
+ Question: "Where should global preferences and universal principles go?"
104
+ Options:
105
+ - "Both — global + project (Recommended)" → portable AND global coverage
106
+ - "Global (~/.claude/CLAUDE.md) only" → applies to all projects
107
+ - "Project level only" → self-contained, portable
108
+
109
+ 5. Store as USER_CONFIG:
110
+ - project_name: from directory name or user override
111
+ - description: from user input
112
+ - include_brace: true/false (based on selection and `--no-brace`)
113
+ - install_level: "both" | "global" | "project"
114
+
115
+ **If cancelled, stop here.**
116
+
117
+ ---
118
+
119
+ ## Phase 3: Present Plan & Approve
120
+
121
+ Build the ACTION_PLAN from SCAN_REPORT + USER_CONFIG + FLAGS.
122
+
123
+ For each item in `references/scaffold-manifest.md`:
124
+ - If component not selected in USER_CONFIG → status: "not selected"
125
+ - If item already exists (from SCAN_REPORT) and no `--force` → status: "skip"
126
+ - If item exists and `--force` → status: "overwrite"
127
+ - If CLAUDE.md exists → status: "merge" (append GOTCHA section)
128
+ - If .gitignore exists → status: "merge" (append missing entries)
129
+ - Otherwise → status: "create"
130
+
131
+ If `upgrade_legacy` is true in USER_CONFIG, set status "upgrade" for:
132
+ - CLAUDE.md (replaces "merge" or "skip" — upgrade takes priority)
133
+ - goals/build_app.md (replaces "skip")
134
+ - goals/manifest.md (replaces "skip")
135
+
136
+ Present plan summary to user via AskUserQuestion:
137
+
138
+ ```
139
+ GOTCHA Framework Setup for: {project_name}
140
+
141
+ Will create: {list of items with status "create"}
142
+ Will merge: {list of items with status "merge"}
143
+ Will upgrade: {list of items with status "upgrade" — legacy → BRACE}
144
+ Will skip: {count} existing items
145
+ Not selected: {count} items
146
+ Global config: {install_level description}
147
+
148
+ Proceed?
149
+ ```
150
+
151
+ Options: "Yes, proceed" / "Cancel"
152
+
153
+ **If cancelled, stop here.**
154
+
155
+ ---
156
+
157
+ ## Phase 4: Scaffold Structure
158
+
159
+ Launch **general-purpose** subagent:
160
+
161
+ ```
162
+ Task(
163
+ subagent_type: "general-purpose",
164
+ description: "Create GOTCHA framework structure",
165
+ prompt: <read from references/phase-prompts.md#phase-4>
166
+ )
167
+ ```
168
+
169
+ Before sending the prompt, substitute these variables:
170
+ - `{ACTION_PLAN}` — the action plan from Phase 3
171
+ - `{PROJECT_NAME}` — from USER_CONFIG
172
+ - `{PROJECT_DESCRIPTION}` — from USER_CONFIG
173
+ - `{INSTALL_LEVEL}` — from USER_CONFIG ("both", "global", or "project")
174
+ - `{CLAUDE_MD_TEMPLATE}` — read from `references/claude-md-template.md`
175
+ (the section between BEGIN TEMPLATE and END TEMPLATE)
176
+ - `{GITIGNORE_CONTENT}` — read from `assets/gitignore-template`
177
+ - `{GOALS_MANIFEST}` — read from `references/scaffold-manifest.md`
178
+ (the goals/manifest.md content block)
179
+ - `{TOOLS_MANIFEST}` — read from `references/scaffold-manifest.md`
180
+ (the tools/manifest.md content block)
181
+ - `{BRACE_WORKFLOW}` — read from `references/brace-workflow.md`
182
+ (the section after the header, used for goals/build_app.md)
183
+ - `{GLOBAL_PREFERENCES_CONTENT}` — read from `assets/global-preferences-template.md`
184
+ (the section between BEGIN TEMPLATE and END TEMPLATE)
185
+
186
+ Parse SCAFFOLD_REPORT. If status is "failed", report to user and stop.
187
+
188
+ ---
189
+
190
+ ## Phase 5: Verification & Report
191
+
192
+ Launch **Bash** subagent (**haiku**):
193
+
194
+ ```
195
+ Task(
196
+ subagent_type: "Bash",
197
+ model: "haiku",
198
+ description: "Verify GOTCHA structure",
199
+ prompt: <read from references/phase-prompts.md#phase-5>
200
+ )
201
+ ```
202
+
203
+ Parse VERIFY_REPORT. Present the final summary using the format in
204
+ `references/report-template.md`.
205
+
206
+ ---
207
+
208
+ ## Idempotency Rules
209
+
210
+ - **Skip** directories and files that already exist (unless `--force`)
211
+ - **Merge** CLAUDE.md: append GOTCHA section if file exists but lacks it
212
+ - **Merge** .gitignore: append missing entries only
213
+ - **Never delete** user content
214
+ - **Never overwrite** without `--force` or explicit user approval
215
+
216
+ ---
217
+
218
+ ## Error Handling
219
+
220
+ Standard escalation pattern:
221
+ 1. If retryable (permission issue after mkdir): retry once
222
+ 2. If persistent: report to user with specific error
223
+ 3. Offer: skip and continue / abort
224
+ 4. Never silently swallow errors
225
+
226
+ Common issues:
227
+ - Permission denied → report, suggest checking directory permissions
228
+ - CLAUDE.md merge conflict → show both versions, let user choose
229
+ - Directory is read-only → abort with clear message
@@ -0,0 +1,109 @@
1
+ # BRACE Build Methodology
2
+
3
+ Content for `goals/build_app.md`. Copied during brace Phase 4.
4
+
5
+ ---
6
+
7
+ ## Goal
8
+
9
+ Build full-stack applications using AI assistance within the GOTCHA framework.
10
+ BRACE is a 5-step process that ensures apps are production-ready.
11
+
12
+ | Step | Phase | What You Do |
13
+ |------|-------|-------------|
14
+ | **B** | Brief | Define problem, users, success metrics |
15
+ | **R** | Research | Data schema, integrations map, stack proposal |
16
+ | **A** | Architect | Design structure, validate all connections |
17
+ | **C** | Construct | Build with layered architecture |
18
+ | **E** | Evaluate | Test functionality, error handling |
19
+
20
+ ---
21
+
22
+ ## B — Brief
23
+
24
+ **Purpose:** Know exactly what you are building before touching code.
25
+
26
+ 1. **What problem does this solve?** — One sentence.
27
+ 2. **Who is this for?** — Specific user, not "everyone".
28
+ 3. **What does success look like?** — Measurable outcome.
29
+ 4. **What are the constraints?** — Budget, time, technical limits.
30
+
31
+ **Output:** App Brief (problem, user, success criteria, constraints)
32
+
33
+ ---
34
+
35
+ ## R — Research
36
+
37
+ **Purpose:** Design before building. Define the source of truth.
38
+
39
+ 1. **Data schema** — Tables, fields, relationships
40
+ 2. **Integrations map** — External services, auth types, API availability
41
+ 3. **Technology stack proposal** — Database, backend, frontend (user approves)
42
+ 4. **Edge cases** — Rate limits, auth expiry, timeouts, invalid input
43
+
44
+ **Output:** Schema, approved stack, integrations checklist, edge cases
45
+
46
+ ---
47
+
48
+ ## A — Architect
49
+
50
+ **Purpose:** Design structure and validate all connections BEFORE building.
51
+
52
+ Checklist:
53
+ - [ ] Database connection tested
54
+ - [ ] All API keys verified
55
+ - [ ] OAuth flows working
56
+ - [ ] Environment variables set
57
+ - [ ] Rate limits understood
58
+
59
+ **Output:** All green. Fix anything that fails before proceeding.
60
+
61
+ ---
62
+
63
+ ## C — Construct
64
+
65
+ **Purpose:** Build with proper architecture.
66
+
67
+ Build order:
68
+ 1. Database schema first
69
+ 2. Backend API routes second
70
+ 3. Frontend UI last
71
+
72
+ Follow GOTCHA separation: frontend (display), backend (logic), database (truth).
73
+
74
+ **Output:** Working application with functional DB, API, and UI.
75
+
76
+ ---
77
+
78
+ ## E — Evaluate
79
+
80
+ **Purpose:** Test before shipping.
81
+
82
+ - **Functional:** All buttons work, data saves/retrieves, navigation works
83
+ - **Integration:** API calls succeed, auth persists, rate limits respected
84
+ - **Edge cases:** Invalid input handled, empty states display, errors show feedback
85
+ - **User acceptance:** Solves the original problem, no major friction
86
+
87
+ **Output:** Test report (passed, failed, needs fixing)
88
+
89
+ ---
90
+
91
+ ## Anti-Patterns
92
+
93
+ 1. Building before designing — rewrites everything
94
+ 2. Skipping connection validation — hours wasted on broken integrations
95
+ 3. No data modeling — schema changes cascade into UI rewrites
96
+ 4. No testing — ship broken code, lose trust
97
+ 5. Hardcoding everything — no flexibility for changes
98
+
99
+ ---
100
+
101
+ ## GOTCHA Layer Mapping
102
+
103
+ | BRACE Step | GOTCHA Layer |
104
+ |------------|--------------|
105
+ | Brief | Goals (define the process) |
106
+ | Research | Context (reference patterns) |
107
+ | Architect | Args (environment setup) |
108
+ | Construct | Tools (execution) |
109
+ | Evaluate | Orchestration (AI validates) |