@leejungkiin/awkit 1.4.0 → 1.4.2
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/bin/awk.js +432 -6
- package/bin/claude-generators.js +122 -0
- package/core/AGENTS.md +16 -0
- package/core/CLAUDE.md +155 -0
- package/core/GEMINI.md +44 -9
- package/package.json +1 -1
- package/skills/ai-sprite-maker/SKILL.md +81 -0
- package/skills/ai-sprite-maker/scripts/animate_sprite.py +102 -0
- package/skills/ai-sprite-maker/scripts/process_sprites.py +140 -0
- package/skills/code-review/SKILL.md +21 -33
- package/skills/lucylab-tts/SKILL.md +64 -0
- package/skills/lucylab-tts/resources/voices_library.json +908 -0
- package/skills/lucylab-tts/scripts/.env +1 -0
- package/skills/lucylab-tts/scripts/lucylab_tts.py +506 -0
- package/skills/orchestrator/SKILL.md +5 -0
- package/skills/short-maker/SKILL.md +150 -0
- package/skills/short-maker/_backup/storyboard.html +106 -0
- package/skills/short-maker/_backup/video_mixer.py +296 -0
- package/skills/short-maker/outputs/fitbite-promo/background.jpg +0 -0
- package/skills/short-maker/outputs/fitbite-promo/final/promo-final.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/script.md +19 -0
- package/skills/short-maker/outputs/fitbite-promo/segments/scene-01.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/segments/scene-02.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/segments/scene-03.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/segments/scene-04.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-01.png +0 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-02.png +0 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-03.png +0 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-04.png +0 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard.html +133 -0
- package/skills/short-maker/outputs/fitbite-promo/storyboard.json +38 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/merged_chroma.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/merged_crossfaded.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/ready_00.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/ready_01.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/ready_02.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/temp/ready_03.mp4 +0 -0
- package/skills/short-maker/outputs/fitbite-promo/tts/manifest.json +31 -0
- package/skills/short-maker/outputs/fitbite-promo/tts/scene-01.wav +0 -0
- package/skills/short-maker/outputs/fitbite-promo/tts/scene-02.wav +0 -0
- package/skills/short-maker/outputs/fitbite-promo/tts/scene-03.wav +0 -0
- package/skills/short-maker/outputs/fitbite-promo/tts/scene-04.wav +0 -0
- package/skills/short-maker/outputs/fitbite-promo/tts_script.txt +11 -0
- package/skills/short-maker/scripts/google-flow-cli/.project-identity +41 -0
- package/skills/short-maker/scripts/google-flow-cli/.trae/rules/project_rules.md +52 -0
- package/skills/short-maker/scripts/google-flow-cli/CODEBASE.md +67 -0
- package/skills/short-maker/scripts/google-flow-cli/GoogleFlowCli.code-workspace +29 -0
- package/skills/short-maker/scripts/google-flow-cli/README.md +168 -0
- package/skills/short-maker/scripts/google-flow-cli/docs/specs/PROJECT.md +12 -0
- package/skills/short-maker/scripts/google-flow-cli/docs/specs/REQUIREMENTS.md +22 -0
- package/skills/short-maker/scripts/google-flow-cli/docs/specs/ROADMAP.md +16 -0
- package/skills/short-maker/scripts/google-flow-cli/docs/specs/TECH-SPEC.md +13 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/__init__.py +3 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/api/__init__.py +19 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/api/client.py +1921 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/api/models.py +64 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/api/rpc_ids.py +98 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/auth/__init__.py +15 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/auth/browser_auth.py +692 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/auth/humanizer.py +417 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/auth/proxy_ext.py +120 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/auth/recaptcha.py +482 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/__init__.py +5 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/client.py +414 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/cli/__init__.py +1 -0
- package/skills/short-maker/scripts/google-flow-cli/gflow/cli/main.py +1075 -0
- package/skills/short-maker/scripts/google-flow-cli/pyproject.toml +36 -0
- package/skills/short-maker/scripts/google-flow-cli/script.txt +22 -0
- package/skills/short-maker/scripts/google-flow-cli/tests/__init__.py +0 -0
- package/skills/short-maker/scripts/google-flow-cli/tests/test_batchexecute.py +113 -0
- package/skills/short-maker/scripts/google-flow-cli/tests/test_client.py +190 -0
- package/skills/short-maker/templates/aida_script.md +40 -0
- package/skills/short-maker/templates/mimic_analyzer.md +29 -0
- package/skills/single-flow-task-execution/SKILL.md +9 -6
- package/skills/skill-creator/SKILL.md +44 -0
- package/skills/spm-build-analysis/SKILL.md +92 -0
- package/skills/spm-build-analysis/references/build-optimization-sources.md +155 -0
- package/skills/spm-build-analysis/references/recommendation-format.md +85 -0
- package/skills/spm-build-analysis/references/spm-analysis-checks.md +105 -0
- package/skills/spm-build-analysis/scripts/check_spm_pins.py +118 -0
- package/skills/symphony-enforcer/SKILL.md +51 -83
- package/skills/symphony-orchestrator/SKILL.md +1 -1
- package/skills/trello-sync/SKILL.md +27 -28
- package/skills/verification-gate/SKILL.md +13 -2
- package/skills/xcode-build-benchmark/SKILL.md +88 -0
- package/skills/xcode-build-benchmark/references/benchmark-artifacts.md +94 -0
- package/skills/xcode-build-benchmark/references/benchmarking-workflow.md +67 -0
- package/skills/xcode-build-benchmark/schemas/build-benchmark.schema.json +230 -0
- package/skills/xcode-build-benchmark/scripts/benchmark_builds.py +308 -0
- package/skills/xcode-build-fixer/SKILL.md +218 -0
- package/skills/xcode-build-fixer/references/build-settings-best-practices.md +216 -0
- package/skills/xcode-build-fixer/references/fix-patterns.md +290 -0
- package/skills/xcode-build-fixer/references/recommendation-format.md +85 -0
- package/skills/xcode-build-fixer/scripts/benchmark_builds.py +308 -0
- package/skills/xcode-build-orchestrator/SKILL.md +156 -0
- package/skills/xcode-build-orchestrator/references/benchmark-artifacts.md +94 -0
- package/skills/xcode-build-orchestrator/references/build-settings-best-practices.md +216 -0
- package/skills/xcode-build-orchestrator/references/orchestration-report-template.md +143 -0
- package/skills/xcode-build-orchestrator/references/recommendation-format.md +85 -0
- package/skills/xcode-build-orchestrator/scripts/benchmark_builds.py +308 -0
- package/skills/xcode-build-orchestrator/scripts/diagnose_compilation.py +273 -0
- package/skills/xcode-build-orchestrator/scripts/generate_optimization_report.py +533 -0
- package/skills/xcode-compilation-analyzer/SKILL.md +89 -0
- package/skills/xcode-compilation-analyzer/references/build-optimization-sources.md +155 -0
- package/skills/xcode-compilation-analyzer/references/code-compilation-checks.md +106 -0
- package/skills/xcode-compilation-analyzer/references/recommendation-format.md +85 -0
- package/skills/xcode-compilation-analyzer/scripts/diagnose_compilation.py +273 -0
- package/skills/xcode-project-analyzer/SKILL.md +76 -0
- package/skills/xcode-project-analyzer/references/build-optimization-sources.md +155 -0
- package/skills/xcode-project-analyzer/references/build-settings-best-practices.md +216 -0
- package/skills/xcode-project-analyzer/references/project-audit-checks.md +101 -0
- package/skills/xcode-project-analyzer/references/recommendation-format.md +85 -0
- package/templates/project-identity/android.json +0 -10
- package/templates/project-identity/backend-nestjs.json +0 -10
- package/templates/project-identity/expo.json +0 -10
- package/templates/project-identity/ios.json +0 -10
- package/templates/project-identity/web-nextjs.json +0 -10
- package/workflows/_uncategorized/ship-to-code.md +85 -0
- package/workflows/context/codebase-sync.md +10 -87
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xcode-build-fixer
|
|
3
|
+
description: Áp dụng các thay đổi tối ưu hoá Xcode build đã phê duyệt dựa trên best practices, sau đó chạy re-benchmark để kiểm chứng cải thiện. Sử dụng khi dev đã phê duyệt bản kế hoạch từ xcode-build-orchestrator, muốn áp dụng cụ thể các build fixes, cần trợ giúp đổi build settings, bảo vệ script phase, sửa lỗi biên dịch source, hoặc cấu trúc lại SPM.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Xcode Build Fixer
|
|
7
|
+
|
|
8
|
+
Use this skill to implement approved build optimization changes and verify them with a benchmark.
|
|
9
|
+
|
|
10
|
+
## Core Rules
|
|
11
|
+
|
|
12
|
+
- Only apply changes that have explicit developer approval.
|
|
13
|
+
- Apply one logical fix at a time so changes are reviewable and reversible.
|
|
14
|
+
- Re-benchmark after applying changes to verify improvement.
|
|
15
|
+
- Report exactly what changed, which files were touched, and the measured delta.
|
|
16
|
+
- If a change produces no improvement or causes a regression, flag it immediately.
|
|
17
|
+
|
|
18
|
+
## Inputs
|
|
19
|
+
|
|
20
|
+
The fixer expects one of:
|
|
21
|
+
|
|
22
|
+
- An approved optimization plan at `.build-benchmark/optimization-plan.md` with checked approval boxes.
|
|
23
|
+
- An explicit developer instruction describing the fix to apply (e.g., "set `DEBUG_INFORMATION_FORMAT` to `dwarf` for Debug").
|
|
24
|
+
|
|
25
|
+
When working from an optimization plan, read the approval checklist and implement only the checked items.
|
|
26
|
+
|
|
27
|
+
## Fix Categories
|
|
28
|
+
|
|
29
|
+
### Build Settings
|
|
30
|
+
|
|
31
|
+
Change `project.pbxproj` values to match the recommendations in [build-settings-best-practices.md](references/build-settings-best-practices.md).
|
|
32
|
+
|
|
33
|
+
Typical fixes:
|
|
34
|
+
|
|
35
|
+
- Set `DEBUG_INFORMATION_FORMAT = dwarf` for Debug
|
|
36
|
+
- Set `SWIFT_COMPILATION_MODE = singlefile` for Debug
|
|
37
|
+
- Enable `COMPILATION_CACHING = YES`
|
|
38
|
+
- Enable `EAGER_LINKING = YES` for Debug
|
|
39
|
+
- Align cross-target settings to eliminate module variants
|
|
40
|
+
|
|
41
|
+
When editing `project.pbxproj`, locate the correct `buildSettings` block by matching the target name and configuration name. Verify the change with `xcodebuild -showBuildSettings` after applying.
|
|
42
|
+
|
|
43
|
+
### Script Phases
|
|
44
|
+
|
|
45
|
+
Fix run script phases that waste time during incremental or debug builds.
|
|
46
|
+
|
|
47
|
+
Typical fixes:
|
|
48
|
+
|
|
49
|
+
- Add input and output file declarations so Xcode can skip unchanged scripts.
|
|
50
|
+
- Add configuration guards: `[[ "$CONFIGURATION" != "Release" ]] && exit 0` for release-only scripts.
|
|
51
|
+
- Move input/output lists into `.xcfilelist` files when the list is long.
|
|
52
|
+
- Enable `Based on dependency analysis` when inputs and outputs are declared.
|
|
53
|
+
|
|
54
|
+
### Source-Level Compilation Fixes
|
|
55
|
+
|
|
56
|
+
Apply code changes that reduce type-checker and compiler overhead. See [references/fix-patterns.md](references/fix-patterns.md) for before/after patterns.
|
|
57
|
+
|
|
58
|
+
Typical fixes:
|
|
59
|
+
|
|
60
|
+
- Add explicit type annotations to complex expressions.
|
|
61
|
+
- Break long chained or nested expressions into intermediate typed variables.
|
|
62
|
+
- Mark classes `final` when they are not subclassed.
|
|
63
|
+
- Tighten access control (`private`/`fileprivate`) for internal-only symbols.
|
|
64
|
+
- Extract monolithic SwiftUI `body` properties into smaller composed subviews.
|
|
65
|
+
- Replace deeply nested result-builder code with separate typed helpers.
|
|
66
|
+
- Add explicit return types to closures passed to generic functions.
|
|
67
|
+
|
|
68
|
+
### SPM Restructuring
|
|
69
|
+
|
|
70
|
+
Restructure Swift packages to improve build parallelism and reduce rebuild scope.
|
|
71
|
+
|
|
72
|
+
Typical fixes:
|
|
73
|
+
|
|
74
|
+
- Move shared types to a lower-layer module to eliminate circular or upward dependencies.
|
|
75
|
+
- Split oversized modules (200+ files) by feature area.
|
|
76
|
+
- Extract protocol definitions into lightweight interface modules.
|
|
77
|
+
- Remove unnecessary `@_exported import` usage.
|
|
78
|
+
- Align build options across targets that import the same packages to prevent module variant duplication.
|
|
79
|
+
- Pin branch-tracked dependencies to tagged versions or commit hashes for deterministic resolution.
|
|
80
|
+
|
|
81
|
+
Before applying version pin changes:
|
|
82
|
+
|
|
83
|
+
- Run `git ls-remote --tags <url>` to confirm tags exist. If the upstream has no tags, pin to a specific revision hash instead.
|
|
84
|
+
- Verify the pinned version resolves successfully with `xcodebuild -resolvePackageDependencies` before proceeding.
|
|
85
|
+
|
|
86
|
+
## Execution Workflow
|
|
87
|
+
|
|
88
|
+
1. Read the approved optimization plan or developer instruction.
|
|
89
|
+
2. For each approved item, identify the exact files and locations to change.
|
|
90
|
+
3. Apply the change.
|
|
91
|
+
4. Verify the change compiles: run a quick `xcodebuild build` to confirm no errors were introduced.
|
|
92
|
+
5. After all approved changes are applied, re-benchmark using the same inputs from the original baseline:
|
|
93
|
+
```bash
|
|
94
|
+
python3 scripts/benchmark_builds.py \
|
|
95
|
+
--project App.xcodeproj \
|
|
96
|
+
--scheme MyApp \
|
|
97
|
+
--configuration Debug \
|
|
98
|
+
--destination "platform=iOS Simulator,name=iPhone 16" \
|
|
99
|
+
--output-dir .build-benchmark
|
|
100
|
+
```
|
|
101
|
+
6. Compare post-change medians to the baseline and report deltas.
|
|
102
|
+
|
|
103
|
+
## Evaluating Regressions
|
|
104
|
+
|
|
105
|
+
Not every slower number is a true regression. The fixer must evaluate the full picture before recommending a revert.
|
|
106
|
+
|
|
107
|
+
### Compilation caching trade-off
|
|
108
|
+
|
|
109
|
+
A change like `COMPILATION_CACHING = YES` may make a standard clean build slightly slower (cache population overhead) while making cached clean builds significantly faster. Since cached clean builds reflect the realistic developer workflow (branch switching, pulling changes, Clean Build Folder with a warm cache), a slower standard clean build paired with a faster cached clean build is a net improvement, not a regression. The same logic applies to any change where the first-time cost is higher but subsequent builds benefit.
|
|
110
|
+
|
|
111
|
+
### Compare all build types
|
|
112
|
+
|
|
113
|
+
Evaluate standard clean, cached clean (when available), and incremental builds together. A change is only a clear regression if it makes the metrics that matter to the developer's daily workflow worse. If only the cold-start clean build is slower but the developer rarely does truly cold builds, that may be acceptable.
|
|
114
|
+
|
|
115
|
+
### Per-change vs. cumulative
|
|
116
|
+
|
|
117
|
+
A single change that regresses on its own may still be worth keeping if it enables a larger cumulative improvement (e.g., enabling compilation caching makes one build type slower but unlocks cache benefits for everything else).
|
|
118
|
+
|
|
119
|
+
### Best-practice settings are not revert candidates
|
|
120
|
+
|
|
121
|
+
Some build settings are Apple's recommended modern defaults. These should be applied and kept regardless of whether the immediate benchmark shows a measurable improvement. They are not speculative optimizations -- they align the project with Apple's toolchain direction and will compound in value over future Xcode releases. The fixer must never recommend reverting these settings based on a single benchmark result.
|
|
122
|
+
|
|
123
|
+
Best-practice settings that should always be kept once applied:
|
|
124
|
+
|
|
125
|
+
- `COMPILATION_CACHING = YES` -- Apple is actively investing in this; the cache improves with each Xcode release and compounds across real workflows
|
|
126
|
+
- `EAGER_LINKING = YES` (Debug) -- allows the linker to overlap with compilation
|
|
127
|
+
- `SWIFT_USE_INTEGRATED_DRIVER = YES` -- eliminates inter-process scheduling overhead
|
|
128
|
+
- `DEBUG_INFORMATION_FORMAT = dwarf` (Debug) -- avoids unnecessary dSYM generation
|
|
129
|
+
- `SWIFT_COMPILATION_MODE = singlefile` (Debug) -- incremental recompilation
|
|
130
|
+
- `ONLY_ACTIVE_ARCH = YES` (Debug) -- no reason to build all architectures locally
|
|
131
|
+
|
|
132
|
+
When reporting on these settings, use language like: "Applied recommended build setting. No immediate benchmark improvement measured, but this aligns with Apple's recommended configuration and positions the project for future Xcode improvements."
|
|
133
|
+
|
|
134
|
+
### When to recommend revert (speculative changes only)
|
|
135
|
+
|
|
136
|
+
For changes that are not best-practice settings (e.g., source refactors, linkage experiments, script phase modifications, dependency restructuring):
|
|
137
|
+
|
|
138
|
+
- If the cumulative pass shows wall-clock regression across all measured build types (standard clean, cached clean, and incremental are all slower), recommend reverting all speculative changes unless the developer explicitly asks to keep specific items for non-performance reasons.
|
|
139
|
+
- For each individual speculative change: if it shows no median improvement and no cached/incremental benefit either, flag it with `Recommend revert` and the measured delta.
|
|
140
|
+
- Distinguish between "outlier reduction only" (improved worst-case but not median) and "median improvement" (improved typical developer wait).
|
|
141
|
+
- When a change trades off one build type for another (e.g., slower standard clean but faster cached clean), present both numbers clearly and let the developer decide. Frame it as: "Standard clean builds are X.Xs slower, but cached clean builds (the realistic daily workflow) are Y.Ys faster."
|
|
142
|
+
|
|
143
|
+
## Reporting
|
|
144
|
+
|
|
145
|
+
Lead with the wall-clock result in plain language:
|
|
146
|
+
|
|
147
|
+
> "Your clean build now takes X.Xs (was Y.Ys) -- Z.Zs faster."
|
|
148
|
+
> "Your incremental build now takes X.Xs (was Y.Ys) -- Z.Zs faster."
|
|
149
|
+
|
|
150
|
+
Then include:
|
|
151
|
+
|
|
152
|
+
- Post-change clean build wall-clock median
|
|
153
|
+
- Post-change incremental build wall-clock median
|
|
154
|
+
- Absolute and percentage wall-clock deltas for both
|
|
155
|
+
- Confidence notes if benchmark noise is high
|
|
156
|
+
- List of files modified per fix
|
|
157
|
+
- Any deviations from the original recommendation
|
|
158
|
+
|
|
159
|
+
If cumulative task metrics improved but wall-clock did not, say plainly: "Compiler workload decreased but build wait time did not improve. This is expected when Xcode runs these tasks in parallel with other equally long work."
|
|
160
|
+
|
|
161
|
+
If a fix produced no measurable wall-time improvement, note `No measurable wall-time improvement` and suggest whether to keep (e.g. for code quality) or revert.
|
|
162
|
+
|
|
163
|
+
For changes valuable for non-benchmark reasons (deterministic package resolution, branch-switch caching), label them: "No wait-time improvement expected from this change. The benefit is [deterministic builds / faster branch switching / reduced CI cost]."
|
|
164
|
+
|
|
165
|
+
Note: `COMPILATION_CACHING` has been measured at 5-14% faster clean builds across tested projects (87 to 1,991 Swift files). The benefit compounds in real developer workflows where the cache persists between builds -- branch switching, pulling changes, and CI with persistent DerivedData. The benchmark script auto-detects this setting and runs a cached clean phase for validation.
|
|
166
|
+
|
|
167
|
+
## Execution Report
|
|
168
|
+
|
|
169
|
+
After the optimization pass is complete, produce a structured execution report. This gives the developer a clear summary of what was attempted, what worked, and what the final state is.
|
|
170
|
+
|
|
171
|
+
Structure:
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
## Execution Report
|
|
175
|
+
|
|
176
|
+
### Baseline
|
|
177
|
+
- Clean build median: X.Xs
|
|
178
|
+
- Cached clean build median: X.Xs (if applicable)
|
|
179
|
+
- Incremental build median: X.Xs
|
|
180
|
+
|
|
181
|
+
### Changes Applied
|
|
182
|
+
|
|
183
|
+
| # | Change | Actionability | Measured Result | Status |
|
|
184
|
+
|---|--------|---------------|-----------------|--------|
|
|
185
|
+
| 1 | Description | repo-local | Clean: X.Xs→Y.Ys, Incr: X.Xs→Y.Ys | Kept / Reverted / Blocked |
|
|
186
|
+
| 2 | ... | ... | ... | ... |
|
|
187
|
+
|
|
188
|
+
### Final Cumulative Result
|
|
189
|
+
- Clean build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
|
|
190
|
+
- Cached clean build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
|
|
191
|
+
- Incremental build median: X.Xs (was Y.Ys) -- Z.Zs faster/slower
|
|
192
|
+
- **Net result:** Faster / Slower / Unchanged
|
|
193
|
+
|
|
194
|
+
### Blocked or Non-Actionable Findings
|
|
195
|
+
- Finding: reason it could not be addressed from the repo
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Status values:
|
|
199
|
+
|
|
200
|
+
- `Kept` -- Change improved or maintained build times and was kept.
|
|
201
|
+
- `Kept (best practice)` -- Change is a recommended build setting; kept regardless of immediate benchmark result.
|
|
202
|
+
- `Reverted` -- Change regressed build times and was reverted.
|
|
203
|
+
- `Blocked` -- Change could not be applied due to project structure, Xcode behavior, or external constraints.
|
|
204
|
+
- `No improvement` -- Change compiled but showed no measurable wall-time benefit. Include whether it was kept (for non-performance reasons) or reverted.
|
|
205
|
+
|
|
206
|
+
## Escalation
|
|
207
|
+
|
|
208
|
+
If during implementation you discover issues outside this skill's scope:
|
|
209
|
+
|
|
210
|
+
- Project-level analysis gaps: hand off to [`xcode-project-analyzer`](../xcode-project-analyzer/SKILL.md)
|
|
211
|
+
- Compilation hotspot analysis: hand off to [`xcode-compilation-analyzer`](../xcode-compilation-analyzer/SKILL.md)
|
|
212
|
+
- Package graph issues: hand off to [`spm-build-analysis`](../spm-build-analysis/SKILL.md)
|
|
213
|
+
|
|
214
|
+
## Additional Resources
|
|
215
|
+
|
|
216
|
+
- For concrete before/after fix patterns, see [references/fix-patterns.md](references/fix-patterns.md)
|
|
217
|
+
- For build settings best practices, see [references/build-settings-best-practices.md](references/build-settings-best-practices.md)
|
|
218
|
+
- For the recommendation format, see [references/recommendation-format.md](references/recommendation-format.md)
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Build Settings Best Practices
|
|
2
|
+
|
|
3
|
+
This reference lists Xcode build settings that affect build performance. Use it to audit a project and produce a pass/fail checklist.
|
|
4
|
+
|
|
5
|
+
The scope is strictly **build performance**. Do not flag language-migration settings like `SWIFT_STRICT_CONCURRENCY` or `SWIFT_UPCOMING_FEATURE_*` -- those are developer adoption choices unrelated to build speed.
|
|
6
|
+
|
|
7
|
+
## How To Read This Reference
|
|
8
|
+
|
|
9
|
+
Each setting includes:
|
|
10
|
+
|
|
11
|
+
- **Setting name** and the Xcode build-settings key
|
|
12
|
+
- **Recommended value** for Debug and Release
|
|
13
|
+
- **Why it matters** for build time
|
|
14
|
+
- **Risk** of changing it
|
|
15
|
+
|
|
16
|
+
Use checkmark and cross indicators when reporting:
|
|
17
|
+
|
|
18
|
+
- `[x]` -- setting matches the recommended value
|
|
19
|
+
- `[ ]` -- setting does not match; include the actual value and the expected value
|
|
20
|
+
|
|
21
|
+
## Debug Configuration
|
|
22
|
+
|
|
23
|
+
These settings optimize for fast iteration during development.
|
|
24
|
+
|
|
25
|
+
### Compilation Mode
|
|
26
|
+
|
|
27
|
+
- **Key:** `SWIFT_COMPILATION_MODE`
|
|
28
|
+
- **Recommended:** `singlefile` (Xcode UI: "Incremental"; or unset -- Xcode defaults to singlefile for Debug)
|
|
29
|
+
- **Why:** Single-file mode recompiles only changed files. `wholemodule` recompiles the entire target on every change.
|
|
30
|
+
- **Risk:** Low
|
|
31
|
+
|
|
32
|
+
### Swift Optimization Level
|
|
33
|
+
|
|
34
|
+
- **Key:** `SWIFT_OPTIMIZATION_LEVEL`
|
|
35
|
+
- **Recommended:** `-Onone`
|
|
36
|
+
- **Why:** Optimization passes add significant compile time. Debug builds do not benefit from runtime speed improvements.
|
|
37
|
+
- **Risk:** Low
|
|
38
|
+
|
|
39
|
+
### GCC Optimization Level
|
|
40
|
+
|
|
41
|
+
- **Key:** `GCC_OPTIMIZATION_LEVEL`
|
|
42
|
+
- **Recommended:** `0`
|
|
43
|
+
- **Why:** Same rationale as Swift optimization level, but for C/C++/Objective-C sources.
|
|
44
|
+
- **Risk:** Low
|
|
45
|
+
|
|
46
|
+
### Build Active Architecture Only
|
|
47
|
+
|
|
48
|
+
- **Key:** `ONLY_ACTIVE_ARCH` (`BUILD_ACTIVE_ARCHITECTURE_ONLY`)
|
|
49
|
+
- **Recommended:** `YES`
|
|
50
|
+
- **Why:** Building all architectures doubles or triples compile and link time for no debug benefit.
|
|
51
|
+
- **Risk:** Low
|
|
52
|
+
|
|
53
|
+
### Debug Information Format
|
|
54
|
+
|
|
55
|
+
- **Key:** `DEBUG_INFORMATION_FORMAT`
|
|
56
|
+
- **Recommended:** `dwarf`
|
|
57
|
+
- **Why:** `dwarf-with-dsym` generates a separate dSYM bundle which adds overhead. Plain `dwarf` embeds debug info directly in the binary, which is sufficient for local debugging.
|
|
58
|
+
- **Risk:** Low
|
|
59
|
+
|
|
60
|
+
### Enable Testability
|
|
61
|
+
|
|
62
|
+
- **Key:** `ENABLE_TESTABILITY`
|
|
63
|
+
- **Recommended:** `YES`
|
|
64
|
+
- **Why:** Required for `@testable import`. Adds minor overhead by exporting internal symbols, but this is expected during development.
|
|
65
|
+
- **Risk:** Low
|
|
66
|
+
|
|
67
|
+
### Active Compilation Conditions
|
|
68
|
+
|
|
69
|
+
- **Key:** `SWIFT_ACTIVE_COMPILATION_CONDITIONS`
|
|
70
|
+
- **Recommended:** Should include `DEBUG`
|
|
71
|
+
- **Why:** Guards conditional compilation blocks (e.g., `#if DEBUG`) and ensures debug-only code paths are included.
|
|
72
|
+
- **Risk:** Low
|
|
73
|
+
|
|
74
|
+
### Eager Linking
|
|
75
|
+
|
|
76
|
+
- **Key:** `EAGER_LINKING`
|
|
77
|
+
- **Recommended:** `YES`
|
|
78
|
+
- **Why:** Allows the linker to start work before all compilation tasks finish, reducing wall-clock build time. Particularly effective for Debug builds where link time is a meaningful fraction of total build time.
|
|
79
|
+
- **Risk:** Low
|
|
80
|
+
|
|
81
|
+
## Release Configuration
|
|
82
|
+
|
|
83
|
+
These settings optimize for production builds.
|
|
84
|
+
|
|
85
|
+
### Compilation Mode
|
|
86
|
+
|
|
87
|
+
- **Key:** `SWIFT_COMPILATION_MODE`
|
|
88
|
+
- **Recommended:** `wholemodule`
|
|
89
|
+
- **Why:** Whole-module optimization produces faster runtime code. Build time is secondary for release.
|
|
90
|
+
- **Risk:** Low
|
|
91
|
+
|
|
92
|
+
### Swift Optimization Level
|
|
93
|
+
|
|
94
|
+
- **Key:** `SWIFT_OPTIMIZATION_LEVEL`
|
|
95
|
+
- **Recommended:** `-O` or `-Osize`
|
|
96
|
+
- **Why:** Produces optimized binaries. `-Osize` trades some speed for smaller binary size.
|
|
97
|
+
- **Risk:** Low
|
|
98
|
+
|
|
99
|
+
### GCC Optimization Level
|
|
100
|
+
|
|
101
|
+
- **Key:** `GCC_OPTIMIZATION_LEVEL`
|
|
102
|
+
- **Recommended:** `s`
|
|
103
|
+
- **Why:** Optimizes C/C++/Objective-C for size, matching the typical release expectation.
|
|
104
|
+
- **Risk:** Low
|
|
105
|
+
|
|
106
|
+
### Build Active Architecture Only
|
|
107
|
+
|
|
108
|
+
- **Key:** `ONLY_ACTIVE_ARCH`
|
|
109
|
+
- **Recommended:** `NO`
|
|
110
|
+
- **Why:** Release builds must include all supported architectures for distribution.
|
|
111
|
+
- **Risk:** Low
|
|
112
|
+
|
|
113
|
+
### Debug Information Format
|
|
114
|
+
|
|
115
|
+
- **Key:** `DEBUG_INFORMATION_FORMAT`
|
|
116
|
+
- **Recommended:** `dwarf-with-dsym`
|
|
117
|
+
- **Why:** dSYM bundles are required for crash symbolication in production.
|
|
118
|
+
- **Risk:** Low
|
|
119
|
+
|
|
120
|
+
### Enable Testability
|
|
121
|
+
|
|
122
|
+
- **Key:** `ENABLE_TESTABILITY`
|
|
123
|
+
- **Recommended:** `NO`
|
|
124
|
+
- **Why:** Removes internal-symbol export overhead from release builds. Testing should use Debug configuration.
|
|
125
|
+
- **Risk:** Low
|
|
126
|
+
|
|
127
|
+
## General (All Configurations)
|
|
128
|
+
|
|
129
|
+
### Compilation Caching
|
|
130
|
+
|
|
131
|
+
- **Key:** `COMPILATION_CACHING`
|
|
132
|
+
- **Recommended:** `YES`
|
|
133
|
+
- **Why:** Caches compilation results for Swift and C-family sources so repeated compilations of the same inputs are served from cache. The biggest wins come from branch switching and clean builds where source files are recompiled unchanged. This is an opt-in feature. The umbrella setting controls both `SWIFT_ENABLE_COMPILE_CACHE` and `CLANG_ENABLE_COMPILE_CACHE` under the hood; those can be toggled independently if needed.
|
|
134
|
+
- **Measurement:** Measured 5-14% faster clean builds across tested projects (87 to 1,991 Swift files). The benefit compounds in real developer workflows where the cache persists between builds -- branch switching, pulling changes, and CI with persistent DerivedData -- though the exact savings depend on how many files change between builds.
|
|
135
|
+
- **Risk:** Low -- can also be enabled via per-user project settings so it does not need to be committed to the shared project file.
|
|
136
|
+
|
|
137
|
+
### Integrated Swift Driver
|
|
138
|
+
|
|
139
|
+
- **Key:** `SWIFT_USE_INTEGRATED_DRIVER`
|
|
140
|
+
- **Recommended:** `YES`
|
|
141
|
+
- **Why:** Uses the integrated Swift driver which runs inside the build system process, eliminating inter-process overhead for compilation scheduling. Enabled by default in modern Xcode but worth verifying in migrated projects.
|
|
142
|
+
- **Risk:** Low
|
|
143
|
+
|
|
144
|
+
### Clang Module Compilation
|
|
145
|
+
|
|
146
|
+
- **Key:** `CLANG_ENABLE_MODULES`
|
|
147
|
+
- **Recommended:** `YES`
|
|
148
|
+
- **Why:** Enables Clang module compilation for C/Objective-C sources, caching module maps on disk instead of reprocessing headers on every import. Eliminates redundant header parsing across translation units.
|
|
149
|
+
- **Risk:** Low
|
|
150
|
+
|
|
151
|
+
### Explicit Module Builds
|
|
152
|
+
|
|
153
|
+
- **Key:** `SWIFT_ENABLE_EXPLICIT_MODULES` (C/ObjC enabled by default in Xcode 16+; for Swift use `_EXPERIMENTAL_SWIFT_EXPLICIT_MODULES`)
|
|
154
|
+
- **Recommended:** Evaluate per-project
|
|
155
|
+
- **Why:** Makes module compilation visible to the build system as discrete tasks, improving parallelism and scheduling. Reduces redundant module rebuilds by making dependency edges explicit. Some projects see regressions due to the overhead of dependency scanning, so benchmark before and after enabling.
|
|
156
|
+
- **Risk:** Medium -- test thoroughly; currently experimental for Swift targets.
|
|
157
|
+
|
|
158
|
+
## Cross-Target Consistency
|
|
159
|
+
|
|
160
|
+
These checks find settings differences between targets that cause redundant build work.
|
|
161
|
+
|
|
162
|
+
### Project-Level vs Target-Level Overrides
|
|
163
|
+
|
|
164
|
+
Build-affecting settings should be set at the project level unless a target has a specific reason to override. Unnecessary per-target overrides cause confusion and can silently create module variants.
|
|
165
|
+
|
|
166
|
+
Settings to check for project-level consistency:
|
|
167
|
+
|
|
168
|
+
- `SWIFT_COMPILATION_MODE`
|
|
169
|
+
- `SWIFT_OPTIMIZATION_LEVEL`
|
|
170
|
+
- `ONLY_ACTIVE_ARCH`
|
|
171
|
+
- `DEBUG_INFORMATION_FORMAT`
|
|
172
|
+
|
|
173
|
+
### Module Variant Duplication
|
|
174
|
+
|
|
175
|
+
When multiple targets import the same SPM package but compile with different Swift compiler options, the build system produces separate module variants for each combination. This inflates `SwiftEmitModule` task counts.
|
|
176
|
+
|
|
177
|
+
Check for drift in:
|
|
178
|
+
|
|
179
|
+
- `SWIFT_OPTIMIZATION_LEVEL`
|
|
180
|
+
- `SWIFT_COMPILATION_MODE`
|
|
181
|
+
- `OTHER_SWIFT_FLAGS`
|
|
182
|
+
- Target-level build settings that override project defaults
|
|
183
|
+
|
|
184
|
+
### Out of Scope
|
|
185
|
+
|
|
186
|
+
Do **not** flag the following as build-performance issues:
|
|
187
|
+
|
|
188
|
+
- `SWIFT_STRICT_CONCURRENCY` -- language migration choice
|
|
189
|
+
- `SWIFT_UPCOMING_FEATURE_*` -- language migration choice
|
|
190
|
+
- `SWIFT_APPROACHABLE_CONCURRENCY` -- language migration choice
|
|
191
|
+
- `SWIFT_ACTIVE_COMPILATION_CONDITIONS` values beyond `DEBUG` (e.g., `WIDGETS`, `APPCLIP`) -- intentional per-target customization
|
|
192
|
+
|
|
193
|
+
## Checklist Output Format
|
|
194
|
+
|
|
195
|
+
When reporting results, use this structure:
|
|
196
|
+
|
|
197
|
+
```markdown
|
|
198
|
+
### Debug Configuration
|
|
199
|
+
- [x] `SWIFT_COMPILATION_MODE`: `singlefile` (recommended: `singlefile`)
|
|
200
|
+
- [ ] `DEBUG_INFORMATION_FORMAT`: `dwarf-with-dsym` (recommended: `dwarf`)
|
|
201
|
+
- [x] `SWIFT_OPTIMIZATION_LEVEL`: `-Onone` (recommended: `-Onone`)
|
|
202
|
+
...
|
|
203
|
+
|
|
204
|
+
### Release Configuration
|
|
205
|
+
- [x] `SWIFT_COMPILATION_MODE`: `wholemodule` (recommended: `wholemodule`)
|
|
206
|
+
...
|
|
207
|
+
|
|
208
|
+
### General (All Configurations)
|
|
209
|
+
- [ ] `COMPILATION_CACHING`: `NO` (recommended: `YES`)
|
|
210
|
+
...
|
|
211
|
+
|
|
212
|
+
### Cross-Target Consistency
|
|
213
|
+
- [x] All targets inherit `SWIFT_OPTIMIZATION_LEVEL` from project level
|
|
214
|
+
- [ ] `OTHER_SWIFT_FLAGS` differs between Stock Analyzer and StockAnalyzerClip
|
|
215
|
+
...
|
|
216
|
+
```
|