@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.
Files changed (119) hide show
  1. package/bin/awk.js +432 -6
  2. package/bin/claude-generators.js +122 -0
  3. package/core/AGENTS.md +16 -0
  4. package/core/CLAUDE.md +155 -0
  5. package/core/GEMINI.md +44 -9
  6. package/package.json +1 -1
  7. package/skills/ai-sprite-maker/SKILL.md +81 -0
  8. package/skills/ai-sprite-maker/scripts/animate_sprite.py +102 -0
  9. package/skills/ai-sprite-maker/scripts/process_sprites.py +140 -0
  10. package/skills/code-review/SKILL.md +21 -33
  11. package/skills/lucylab-tts/SKILL.md +64 -0
  12. package/skills/lucylab-tts/resources/voices_library.json +908 -0
  13. package/skills/lucylab-tts/scripts/.env +1 -0
  14. package/skills/lucylab-tts/scripts/lucylab_tts.py +506 -0
  15. package/skills/orchestrator/SKILL.md +5 -0
  16. package/skills/short-maker/SKILL.md +150 -0
  17. package/skills/short-maker/_backup/storyboard.html +106 -0
  18. package/skills/short-maker/_backup/video_mixer.py +296 -0
  19. package/skills/short-maker/outputs/fitbite-promo/background.jpg +0 -0
  20. package/skills/short-maker/outputs/fitbite-promo/final/promo-final.mp4 +0 -0
  21. package/skills/short-maker/outputs/fitbite-promo/script.md +19 -0
  22. package/skills/short-maker/outputs/fitbite-promo/segments/scene-01.mp4 +0 -0
  23. package/skills/short-maker/outputs/fitbite-promo/segments/scene-02.mp4 +0 -0
  24. package/skills/short-maker/outputs/fitbite-promo/segments/scene-03.mp4 +0 -0
  25. package/skills/short-maker/outputs/fitbite-promo/segments/scene-04.mp4 +0 -0
  26. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-01.png +0 -0
  27. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-02.png +0 -0
  28. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-03.png +0 -0
  29. package/skills/short-maker/outputs/fitbite-promo/storyboard/scene-04.png +0 -0
  30. package/skills/short-maker/outputs/fitbite-promo/storyboard.html +133 -0
  31. package/skills/short-maker/outputs/fitbite-promo/storyboard.json +38 -0
  32. package/skills/short-maker/outputs/fitbite-promo/temp/merged_chroma.mp4 +0 -0
  33. package/skills/short-maker/outputs/fitbite-promo/temp/merged_crossfaded.mp4 +0 -0
  34. package/skills/short-maker/outputs/fitbite-promo/temp/ready_00.mp4 +0 -0
  35. package/skills/short-maker/outputs/fitbite-promo/temp/ready_01.mp4 +0 -0
  36. package/skills/short-maker/outputs/fitbite-promo/temp/ready_02.mp4 +0 -0
  37. package/skills/short-maker/outputs/fitbite-promo/temp/ready_03.mp4 +0 -0
  38. package/skills/short-maker/outputs/fitbite-promo/tts/manifest.json +31 -0
  39. package/skills/short-maker/outputs/fitbite-promo/tts/scene-01.wav +0 -0
  40. package/skills/short-maker/outputs/fitbite-promo/tts/scene-02.wav +0 -0
  41. package/skills/short-maker/outputs/fitbite-promo/tts/scene-03.wav +0 -0
  42. package/skills/short-maker/outputs/fitbite-promo/tts/scene-04.wav +0 -0
  43. package/skills/short-maker/outputs/fitbite-promo/tts_script.txt +11 -0
  44. package/skills/short-maker/scripts/google-flow-cli/.project-identity +41 -0
  45. package/skills/short-maker/scripts/google-flow-cli/.trae/rules/project_rules.md +52 -0
  46. package/skills/short-maker/scripts/google-flow-cli/CODEBASE.md +67 -0
  47. package/skills/short-maker/scripts/google-flow-cli/GoogleFlowCli.code-workspace +29 -0
  48. package/skills/short-maker/scripts/google-flow-cli/README.md +168 -0
  49. package/skills/short-maker/scripts/google-flow-cli/docs/specs/PROJECT.md +12 -0
  50. package/skills/short-maker/scripts/google-flow-cli/docs/specs/REQUIREMENTS.md +22 -0
  51. package/skills/short-maker/scripts/google-flow-cli/docs/specs/ROADMAP.md +16 -0
  52. package/skills/short-maker/scripts/google-flow-cli/docs/specs/TECH-SPEC.md +13 -0
  53. package/skills/short-maker/scripts/google-flow-cli/gflow/__init__.py +3 -0
  54. package/skills/short-maker/scripts/google-flow-cli/gflow/api/__init__.py +19 -0
  55. package/skills/short-maker/scripts/google-flow-cli/gflow/api/client.py +1921 -0
  56. package/skills/short-maker/scripts/google-flow-cli/gflow/api/models.py +64 -0
  57. package/skills/short-maker/scripts/google-flow-cli/gflow/api/rpc_ids.py +98 -0
  58. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/__init__.py +15 -0
  59. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/browser_auth.py +692 -0
  60. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/humanizer.py +417 -0
  61. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/proxy_ext.py +120 -0
  62. package/skills/short-maker/scripts/google-flow-cli/gflow/auth/recaptcha.py +482 -0
  63. package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/__init__.py +5 -0
  64. package/skills/short-maker/scripts/google-flow-cli/gflow/batchexecute/client.py +414 -0
  65. package/skills/short-maker/scripts/google-flow-cli/gflow/cli/__init__.py +1 -0
  66. package/skills/short-maker/scripts/google-flow-cli/gflow/cli/main.py +1075 -0
  67. package/skills/short-maker/scripts/google-flow-cli/pyproject.toml +36 -0
  68. package/skills/short-maker/scripts/google-flow-cli/script.txt +22 -0
  69. package/skills/short-maker/scripts/google-flow-cli/tests/__init__.py +0 -0
  70. package/skills/short-maker/scripts/google-flow-cli/tests/test_batchexecute.py +113 -0
  71. package/skills/short-maker/scripts/google-flow-cli/tests/test_client.py +190 -0
  72. package/skills/short-maker/templates/aida_script.md +40 -0
  73. package/skills/short-maker/templates/mimic_analyzer.md +29 -0
  74. package/skills/single-flow-task-execution/SKILL.md +9 -6
  75. package/skills/skill-creator/SKILL.md +44 -0
  76. package/skills/spm-build-analysis/SKILL.md +92 -0
  77. package/skills/spm-build-analysis/references/build-optimization-sources.md +155 -0
  78. package/skills/spm-build-analysis/references/recommendation-format.md +85 -0
  79. package/skills/spm-build-analysis/references/spm-analysis-checks.md +105 -0
  80. package/skills/spm-build-analysis/scripts/check_spm_pins.py +118 -0
  81. package/skills/symphony-enforcer/SKILL.md +51 -83
  82. package/skills/symphony-orchestrator/SKILL.md +1 -1
  83. package/skills/trello-sync/SKILL.md +27 -28
  84. package/skills/verification-gate/SKILL.md +13 -2
  85. package/skills/xcode-build-benchmark/SKILL.md +88 -0
  86. package/skills/xcode-build-benchmark/references/benchmark-artifacts.md +94 -0
  87. package/skills/xcode-build-benchmark/references/benchmarking-workflow.md +67 -0
  88. package/skills/xcode-build-benchmark/schemas/build-benchmark.schema.json +230 -0
  89. package/skills/xcode-build-benchmark/scripts/benchmark_builds.py +308 -0
  90. package/skills/xcode-build-fixer/SKILL.md +218 -0
  91. package/skills/xcode-build-fixer/references/build-settings-best-practices.md +216 -0
  92. package/skills/xcode-build-fixer/references/fix-patterns.md +290 -0
  93. package/skills/xcode-build-fixer/references/recommendation-format.md +85 -0
  94. package/skills/xcode-build-fixer/scripts/benchmark_builds.py +308 -0
  95. package/skills/xcode-build-orchestrator/SKILL.md +156 -0
  96. package/skills/xcode-build-orchestrator/references/benchmark-artifacts.md +94 -0
  97. package/skills/xcode-build-orchestrator/references/build-settings-best-practices.md +216 -0
  98. package/skills/xcode-build-orchestrator/references/orchestration-report-template.md +143 -0
  99. package/skills/xcode-build-orchestrator/references/recommendation-format.md +85 -0
  100. package/skills/xcode-build-orchestrator/scripts/benchmark_builds.py +308 -0
  101. package/skills/xcode-build-orchestrator/scripts/diagnose_compilation.py +273 -0
  102. package/skills/xcode-build-orchestrator/scripts/generate_optimization_report.py +533 -0
  103. package/skills/xcode-compilation-analyzer/SKILL.md +89 -0
  104. package/skills/xcode-compilation-analyzer/references/build-optimization-sources.md +155 -0
  105. package/skills/xcode-compilation-analyzer/references/code-compilation-checks.md +106 -0
  106. package/skills/xcode-compilation-analyzer/references/recommendation-format.md +85 -0
  107. package/skills/xcode-compilation-analyzer/scripts/diagnose_compilation.py +273 -0
  108. package/skills/xcode-project-analyzer/SKILL.md +76 -0
  109. package/skills/xcode-project-analyzer/references/build-optimization-sources.md +155 -0
  110. package/skills/xcode-project-analyzer/references/build-settings-best-practices.md +216 -0
  111. package/skills/xcode-project-analyzer/references/project-audit-checks.md +101 -0
  112. package/skills/xcode-project-analyzer/references/recommendation-format.md +85 -0
  113. package/templates/project-identity/android.json +0 -10
  114. package/templates/project-identity/backend-nestjs.json +0 -10
  115. package/templates/project-identity/expo.json +0 -10
  116. package/templates/project-identity/ios.json +0 -10
  117. package/templates/project-identity/web-nextjs.json +0 -10
  118. package/workflows/_uncategorized/ship-to-code.md +85 -0
  119. package/workflows/context/codebase-sync.md +10 -87
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: xcode-build-orchestrator
3
+ description: Điều phối tối ưu hoá Xcode build bằng cách chạy benchmark trước, sau đó kích hoạt các skill phân tích chuyên sâu, ưu tiên các vấn đề tìm được, yêu cầu phê duyệt rõ ràng từ dev, giao phó việc sửa lỗi cho xcode-build-fixer, và cuối cùng chạy lại benchmark để đối chiếu. Sử dụng khi lập trình viên muốn một luồng tối ưu Xcode toàn diện từ A-Z, muốn tăng tốc độ build, cần audit toàn bộ cấu hình build, hoặc cần một đợt kiểm tra "đề xuất trước - sửa sau" bao gồm cả code, build settings và Swift Packages.
4
+ ---
5
+
6
+ # Xcode Build Orchestrator
7
+
8
+ Use this skill as the recommend-first entrypoint for end-to-end Xcode build optimization work.
9
+
10
+ ## Non-Negotiable Rules
11
+
12
+ - Wall-clock build time (how long the developer waits) is the primary success metric. Every recommendation must state its expected impact on the developer's actual wait time.
13
+ - Start in recommendation mode.
14
+ - Benchmark before making changes.
15
+ - Do not modify project files, source files, packages, or scripts without explicit developer approval.
16
+ - Preserve the evidence trail for every recommendation.
17
+ - Re-benchmark after approved changes and report the wall-clock delta.
18
+
19
+ ## Two-Phase Workflow
20
+
21
+ The orchestration is designed as two distinct phases separated by developer review.
22
+
23
+ ### Phase 1 -- Analyze (recommend-only)
24
+
25
+ Run this phase in agent mode because the agent needs to execute builds, run benchmark scripts, write benchmark artifacts, and generate the optimization report. However, treat Phase 1 as **recommend-only**: do not modify any project files, source files, packages, or build settings. The only files the agent creates during this phase are benchmark artifacts and the optimization plan inside `.build-benchmark/`.
26
+
27
+ 1. Collect the build target context: workspace or project, scheme, configuration, destination, and current pain point. When both `.xcworkspace` and `.xcodeproj` exist, prefer `.xcodeproj` unless the workspace contains sub-projects required for the build. Workspaces that reference external projects may fail if those projects are not checked out.
28
+ 2. Run `xcode-build-benchmark` to establish a baseline if no fresh benchmark exists. The benchmark script auto-detects `COMPILATION_CACHING = YES` and includes cached clean builds that measure the realistic developer experience (warm cache). If the build fails to compile, check `git log` for a recent buildable commit. When working in a worktree, cherry-picking a targeted build fix from a feature branch is acceptable to reach a buildable state. If SPM packages reference gitignored directories in their `exclude:` paths (e.g., `__Snapshots__`), create those directories before building -- worktrees do not contain gitignored content and `xcodebuild -resolvePackageDependencies` will crash otherwise.
29
+ 3. Verify the benchmark artifact has non-empty `timing_summary_categories`. If empty, the timing summary parser may have failed -- re-parse the raw logs or inspect them manually. If `COMPILATION_CACHING` is enabled, also verify the artifact includes `cached_clean` runs.
30
+ - **Benchmark confidence check**: For each build type (clean, cached clean, incremental), compare the min and max values. If the spread (max - min) exceeds 20% of the median, flag the benchmark as having high variance and recommend running additional repetitions (5+ runs) before drawing conclusions. High variance makes it difficult to distinguish real improvements from noise. After applying changes, only claim an improvement if the post-change median falls outside the baseline's min-max range.
31
+ 4. If incremental builds are the primary pain point and Xcode 16.4+ is available, recommend the developer enable **Task Backtraces** (Scheme Editor > Build tab > Build Debugging > "Task Backtraces"). This reveals why each task re-ran, which is critical for diagnosing unexpected replanning or input invalidation. Include any Task Backtrace evidence in the analysis.
32
+ 5. Determine whether compile tasks are likely blocking wall-clock progress or just consuming parallel CPU time. Compare the sum of all timing-summary category seconds against the wall-clock median: if the sum is 2x+ the median, most work is parallelized and compile hotspot fixes are unlikely to reduce wait time. If `SwiftCompile`, `CompileC`, `SwiftEmitModule`, or `Planning Swift module` dominate the timing summary **and** appear likely to be on the critical path, run `diagnose_compilation.py` to capture type-checking hotspots. If they are parallelized, still run diagnostics but label findings as "parallel efficiency improvements" rather than "build time improvements."
33
+ 6. Run the specialist analyses that fit the evidence by reading each skill's SKILL.md and applying its workflow:
34
+ - [`xcode-compilation-analyzer`](../xcode-compilation-analyzer/SKILL.md)
35
+ - [`xcode-project-analyzer`](../xcode-project-analyzer/SKILL.md)
36
+ - [`spm-build-analysis`](../spm-build-analysis/SKILL.md)
37
+ 7. Merge findings into a single prioritized improvement plan.
38
+ 8. Generate the markdown optimization report using `generate_optimization_report.py` and save it to `.build-benchmark/optimization-plan.md`. This report includes the build settings audit, timing analysis, prioritized recommendations, and an approval checklist.
39
+ 9. Stop and present the plan to the developer for review.
40
+
41
+ The developer reviews `.build-benchmark/optimization-plan.md`, checks the approval boxes for the recommendations they want implemented, and then triggers phase 2.
42
+
43
+ ### Phase 2 -- Execute and verify (agent mode)
44
+
45
+ Run this phase in agent mode after the developer has reviewed and approved recommendations from the plan. Delegate all implementation work to [`xcode-build-fixer`](../xcode-build-fixer/SKILL.md) by reading its SKILL.md and applying its workflow.
46
+
47
+ 10. Read `.build-benchmark/optimization-plan.md` and identify the approved items from the approval checklist.
48
+ 11. Hand off to `xcode-build-fixer` with the approved plan. The fixer applies each approved change, verifies compilation, and re-benchmarks.
49
+ 12. Append verification results to the optimization plan: post-change medians, absolute and percentage deltas, and confidence notes.
50
+ 13. Report before and after results, plus any remaining follow-up opportunities.
51
+
52
+ ## Prioritization Rules
53
+
54
+ The goal is to reduce how long the developer waits for builds to finish.
55
+
56
+ 1. Identify the developer's primary pain (clean build, incremental build, or both) and the measured wall-clock median.
57
+ 2. Determine what is likely **blocking** wall-clock progress:
58
+ - If the sum of all timing-summary category seconds is 2x+ the wall-clock median, most work is parallelized. Compile hotspot fixes are unlikely to reduce wait time.
59
+ - If a single serial category (e.g. `PhaseScriptExecution`, `CompileAssetCatalog`, `CodeSign`) accounts for a large fraction of wall-clock, that is the real bottleneck.
60
+ - If `Planning Swift module` or `SwiftEmitModule` dominates incremental builds, the cause is likely invalidation or module size, not individual file compile speed.
61
+ 3. Rank recommendations by likely wall-time savings, not cumulative task reduction.
62
+ 4. Source-level compile fixes should not outrank project/graph/configuration fixes unless evidence suggests they are on the critical path.
63
+
64
+ Prefer changes that are measurable, reversible, and low-risk.
65
+
66
+ ## Recommendation Impact Language
67
+
68
+ Every recommendation presented to the developer must include one of these impact statements:
69
+
70
+ - "Expected to reduce your [clean/incremental] build by approximately X seconds."
71
+ - "Reduces parallel compile work but is unlikely to reduce your build wait time because other tasks take equally long."
72
+ - "Impact on wait time is uncertain -- re-benchmark after applying to confirm."
73
+ - "No wait-time improvement expected. The benefit is [deterministic builds / faster branch switching / reduced CI cost]."
74
+ - For COMPILATION_CACHING specifically: "Measured 5-14% faster clean builds across tested projects. The benefit compounds in real workflows where the cache persists between builds -- branch switching, pulling changes, and CI with persistent DerivedData."
75
+
76
+ Never quote cumulative task-time savings as the headline impact. If a change reduces 5 seconds of parallel compile work but another equally long task still runs, the developer's wait time does not change.
77
+
78
+ ## Approval Gate
79
+
80
+ Before implementing anything, present a short approval list that includes:
81
+
82
+ - recommendation name
83
+ - expected wait-time impact (using the impact language above)
84
+ - evidence summary
85
+ - affected files or settings
86
+ - whether the change is low, medium, or high risk
87
+
88
+ Wait for explicit developer approval.
89
+
90
+ ## Post-Approval Execution
91
+
92
+ After approval, delegate to `xcode-build-fixer`:
93
+
94
+ - the fixer implements only the approved items
95
+ - changes are applied atomically and kept scoped
96
+ - any deviations from the original recommendation plan are noted
97
+ - the fixer re-benchmarks with the same benchmark contract
98
+
99
+ ## Final Report
100
+
101
+ Lead with the wall-clock result in plain language, e.g.: "Your clean build now takes 82s (was 86s) -- 4s faster." Then include:
102
+
103
+ - baseline clean and incremental wall-clock medians
104
+ - post-change clean and incremental wall-clock medians
105
+ - absolute and percentage wall-clock deltas
106
+ - what changed
107
+ - what was intentionally left unchanged
108
+ - confidence notes if noise prevents a strong conclusion -- if benchmark variance is high (min-to-max spread exceeds 20% of median), say so explicitly rather than presenting noisy numbers as definitive improvements or regressions
109
+ - 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."
110
+ - a ready-to-paste community results row and a link to open a PR (see the report template)
111
+
112
+ ## Preferred Command Paths
113
+
114
+ ### Benchmark
115
+
116
+ ```bash
117
+ python3 scripts/benchmark_builds.py \
118
+ --project App.xcodeproj \
119
+ --scheme MyApp \
120
+ --configuration Debug \
121
+ --destination "platform=iOS Simulator,name=iPhone 16" \
122
+ --output-dir .build-benchmark
123
+ ```
124
+
125
+ For macOS apps use `--destination "platform=macOS"`. For watchOS use `--destination "platform=watchOS Simulator,name=Apple Watch Series 10"`. For tvOS use `--destination "platform=tvOS Simulator,name=Apple TV"`. Omit `--destination` to use the scheme's default.
126
+
127
+ To measure real incremental builds (file-touched rebuild) instead of zero-change builds, add `--touch-file path/to/SomeFile.swift`.
128
+
129
+ ### Compilation Diagnostics
130
+
131
+ ```bash
132
+ python3 scripts/diagnose_compilation.py \
133
+ --project App.xcodeproj \
134
+ --scheme MyApp \
135
+ --configuration Debug \
136
+ --destination "platform=iOS Simulator,name=iPhone 16" \
137
+ --threshold 100 \
138
+ --output-dir .build-benchmark
139
+ ```
140
+
141
+ ### Optimization Report
142
+
143
+ ```bash
144
+ python3 scripts/generate_optimization_report.py \
145
+ --benchmark .build-benchmark/<artifact>.json \
146
+ --project-path App.xcodeproj \
147
+ --diagnostics .build-benchmark/<diagnostics>.json \
148
+ --output .build-benchmark/optimization-plan.md
149
+ ```
150
+
151
+ ## Additional Resources
152
+
153
+ - For the report template, see [references/orchestration-report-template.md](references/orchestration-report-template.md)
154
+ - For benchmark artifact requirements, see [references/benchmark-artifacts.md](references/benchmark-artifacts.md)
155
+ - For the recommendation format, see [references/recommendation-format.md](references/recommendation-format.md)
156
+ - For build settings best practices, see [references/build-settings-best-practices.md](references/build-settings-best-practices.md)
@@ -0,0 +1,94 @@
1
+ # Benchmark Artifacts
2
+
3
+ All skills in this repository should treat `.build-benchmark/` as the canonical location for measured build evidence.
4
+
5
+ ## Goals
6
+
7
+ - Keep build measurements reproducible.
8
+ - Make clean and incremental build data easy to compare.
9
+ - Preserve enough context for later specialist analysis without rerunning the benchmark.
10
+
11
+ ## Wall-Clock vs Cumulative Task Time
12
+
13
+ The `duration_seconds` field on each run and the `median_seconds` in the summary represent **wall-clock time** -- how long the developer actually waits. This is the primary success metric.
14
+
15
+ The `timing_summary_categories` are **aggregated task times** parsed from Xcode's Build Timing Summary. Because Xcode runs many tasks in parallel across CPU cores, these totals typically exceed the wall-clock duration. A large cumulative `SwiftCompile` value is diagnostic evidence of compiler workload, not proof that compilation is blocking the build. Always compare category totals against the wall-clock median before concluding that a category is a bottleneck.
16
+
17
+ ## File Layout
18
+
19
+ Recommended outputs:
20
+
21
+ - `.build-benchmark/<timestamp>-<scheme>.json`
22
+ - `.build-benchmark/<timestamp>-<scheme>-clean-1.log`
23
+ - `.build-benchmark/<timestamp>-<scheme>-clean-2.log`
24
+ - `.build-benchmark/<timestamp>-<scheme>-clean-3.log`
25
+ - `.build-benchmark/<timestamp>-<scheme>-cached-clean-1.log` (when COMPILATION_CACHING is enabled)
26
+ - `.build-benchmark/<timestamp>-<scheme>-cached-clean-2.log`
27
+ - `.build-benchmark/<timestamp>-<scheme>-cached-clean-3.log`
28
+ - `.build-benchmark/<timestamp>-<scheme>-incremental-1.log`
29
+ - `.build-benchmark/<timestamp>-<scheme>-incremental-2.log`
30
+ - `.build-benchmark/<timestamp>-<scheme>-incremental-3.log`
31
+
32
+ Use an ISO-like UTC timestamp without spaces so the files sort naturally.
33
+
34
+ ## Artifact Requirements
35
+
36
+ Each JSON artifact should include:
37
+
38
+ - schema version
39
+ - creation timestamp
40
+ - project context
41
+ - environment details when available
42
+ - the normalized build command
43
+ - separate `clean` and `incremental` run arrays
44
+ - summary statistics for each build type
45
+ - parsed timing-summary categories
46
+ - free-form notes for caveats or noise
47
+
48
+ ## Clean, Cached Clean, And Incremental Separation
49
+
50
+ Do not merge different build type measurements into a single list. They answer different questions:
51
+
52
+ - **Clean builds** show full build-system, package, and module setup cost with a cold compilation cache.
53
+ - **Cached clean builds** show clean build cost when the compilation cache is warm. This is the realistic scenario for branch switching, pulling changes, or Clean Build Folder. Only present when `COMPILATION_CACHING = YES` is detected.
54
+ - **Incremental builds** show edit-loop productivity and script or cache invalidation problems.
55
+
56
+ ## Raw Logs
57
+
58
+ Store raw `xcodebuild` output beside the JSON artifact whenever possible. That allows later skills to:
59
+
60
+ - re-parse timing summaries
61
+ - inspect failed builds
62
+ - search for long type-check warnings
63
+ - correlate build-system phases with recommendations
64
+
65
+ ## Measurement Caveats
66
+
67
+ ### COMPILATION_CACHING
68
+
69
+ `COMPILATION_CACHING = YES` stores compiled artifacts in a system-managed cache outside DerivedData so that repeated compilations of identical inputs are served from cache. The standard clean-build benchmark (`xcodebuild clean` between runs) may add overhead from cache population without showing the corresponding cache-hit benefit.
70
+
71
+ The benchmark script automatically detects `COMPILATION_CACHING = YES` and runs a **cached clean** benchmark phase. This phase:
72
+
73
+ 1. Builds once to warm the compilation cache.
74
+ 2. Deletes DerivedData (but not the compilation cache) before each measured run.
75
+ 3. Rebuilds, measuring the cache-hit clean build time.
76
+
77
+ The cached clean metric captures the realistic developer experience: branch switching, pulling changes, and Clean Build Folder. Use the cached clean median as the primary comparison metric when evaluating `COMPILATION_CACHING` impact.
78
+
79
+ To skip this phase, pass `--no-cached-clean`.
80
+
81
+ ### First-Run Variance
82
+
83
+ The first clean build after the warmup cycle often runs 20-40% slower than subsequent clean builds due to cold OS-level caches (disk I/O, dynamic linker cache, etc.). The benchmark script mitigates this by running a warmup clean+build cycle before measured runs. If variance between the first and later clean runs is still high, prefer the median or min over the mean, and note the variance in the artifact's `notes` field.
84
+
85
+ ## Shared Consumer Expectations
86
+
87
+ Any skill reading a benchmark artifact should be able to identify:
88
+
89
+ - what was measured
90
+ - how it was measured
91
+ - whether the run succeeded
92
+ - whether the results are stable enough to compare
93
+
94
+ For the authoritative field-level schema, see the `build-benchmark.schema.json` bundled with the xcode-build-benchmark skill.
@@ -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
+ ```
@@ -0,0 +1,143 @@
1
+ # Orchestration Report Template
2
+
3
+ Use this structure when the orchestrator consolidates benchmark evidence and specialist findings. The `generate_optimization_report.py` script produces this format automatically when given the benchmark and diagnostics artifacts.
4
+
5
+ ```markdown
6
+ # Xcode Build Optimization Plan
7
+
8
+ ## Project Context
9
+ - **Project:** `App.xcodeproj`
10
+ - **Scheme:** `MyApp`
11
+ - **Configuration:** `Debug`
12
+ - **Destination:** `platform=iOS Simulator,name=iPhone 16`
13
+ - **Xcode:** Xcode 26.x
14
+ - **Date:** 2026-01-01T00:00:00Z
15
+ - **Benchmark artifact:** `.build-benchmark/<timestamp>-<scheme>.json`
16
+
17
+ ## Baseline Benchmarks
18
+
19
+ | Metric | Clean | Cached Clean | Zero-Change |
20
+ |--------|-------|-------------|-------------|
21
+ | Median | 0.000s | 0.000s | 0.000s |
22
+ | Min | 0.000s | 0.000s | 0.000s |
23
+ | Max | 0.000s | 0.000s | 0.000s |
24
+ | Runs | 3 | 3 | 3 |
25
+
26
+ > **Cached Clean** = clean build with a warm compilation cache. This is the realistic scenario for branch switching, pulling changes, or Clean Build Folder. Only present when `COMPILATION_CACHING = YES` is detected. "Zero-Change" = rebuild with no edits (measures fixed overhead). Use `--touch-file` in the benchmark script to measure true incremental builds where a source file is modified.
27
+
28
+ ### Clean Build Timing Summary
29
+
30
+ > **Note:** These are aggregated task times across all CPU cores. Because Xcode runs many tasks in parallel, these totals typically exceed the actual build wait time shown above. A large number here does not mean it is blocking your build.
31
+
32
+ | Category | Tasks | Seconds |
33
+ |----------|------:|--------:|
34
+ | SwiftCompile | 325 | 271.245s |
35
+ | SwiftEmitModule | 30 | 23.625s |
36
+ | ... | ... | ... |
37
+
38
+ ## Build Settings Audit
39
+
40
+ ### Debug Configuration
41
+ - [x] `SWIFT_COMPILATION_MODE`: `(unset)` (recommended: `incremental`)
42
+ - [x] `SWIFT_OPTIMIZATION_LEVEL`: `-Onone` (recommended: `-Onone`)
43
+ - [x] `GCC_OPTIMIZATION_LEVEL`: `0` (recommended: `0`)
44
+ - [x] `ONLY_ACTIVE_ARCH`: `YES` (recommended: `YES`)
45
+ - [x] `DEBUG_INFORMATION_FORMAT`: `dwarf` (recommended: `dwarf`)
46
+ - [x] `ENABLE_TESTABILITY`: `YES` (recommended: `YES`)
47
+ - [x] `EAGER_LINKING`: `YES` (recommended: `YES`)
48
+
49
+ ### General (All Configurations)
50
+ - [x] `COMPILATION_CACHING`: `YES` (recommended: `YES`)
51
+ - [x] `SWIFT_USE_INTEGRATED_DRIVER`: `YES` (recommended: `YES`)
52
+ - [x] `CLANG_ENABLE_MODULES`: `YES` (recommended: `YES`)
53
+
54
+ ### Release Configuration
55
+ - [x] `SWIFT_COMPILATION_MODE`: `wholemodule` (recommended: `wholemodule`)
56
+ - [x] `SWIFT_OPTIMIZATION_LEVEL`: `-O` (recommended: `-O`)
57
+ - ...
58
+
59
+ ### Cross-Target Consistency
60
+ - [x] `SWIFT_COMPILATION_MODE` is consistent across all targets
61
+ - [ ] `OTHER_SWIFT_FLAGS` has target-level overrides: ...
62
+
63
+ ## Compilation Diagnostics
64
+
65
+ | Duration | Kind | File | Line | Name |
66
+ |---------:|------|------|-----:|------|
67
+ | 150ms | function-body | MyView.swift | 42 | body |
68
+ | ... | ... | ... | ... | ... |
69
+
70
+ ## Prioritized Recommendations
71
+
72
+ ### 1. Recommendation title
73
+ **Wait-Time Impact:** Expected to reduce your clean build by approximately 3 seconds.
74
+ **Category:** project
75
+ **Evidence:** ...
76
+ **Impact:** High
77
+ **Confidence:** High
78
+ **Risk:** Low
79
+
80
+ ## Approval Checklist
81
+ - [ ] **1. Recommendation title** -- Wait-Time Impact: ~3s clean build reduction | Risk: Low
82
+ - [ ] **2. Another recommendation** -- Wait-Time Impact: Uncertain, re-benchmark to confirm | Risk: Low
83
+
84
+ ## Next Steps
85
+
86
+ After implementing approved changes, re-benchmark with the same inputs:
87
+
88
+ ...
89
+
90
+ Compare the new wall-clock medians against the baseline. Report results as:
91
+ "Your [clean/incremental] build now takes X.Xs (was Y.Ys) -- Z.Zs faster/slower."
92
+
93
+ ## Execution Report (post-approval)
94
+
95
+ ### Baseline
96
+ - Clean build median: X.Xs
97
+ - Cached clean build median: X.Xs (if applicable)
98
+ - Incremental build median: X.Xs
99
+
100
+ ### Changes Applied
101
+
102
+ | # | Change | Actionability | Measured Result | Status |
103
+ |---|--------|---------------|-----------------|--------|
104
+ | 1 | Description of change | repo-local | Clean: X.Xs→Y.Ys, Incr: X.Xs→Y.Ys | Kept / Reverted / Blocked |
105
+ | 2 | ... | ... | ... | ... |
106
+
107
+ Status values: `Kept`, `Kept (best practice)`, `Reverted`, `Blocked`, `No improvement`
108
+
109
+ ### Final Cumulative Result
110
+ - Post-change clean build: X.Xs (was Y.Ys) -- Z.Zs faster/slower
111
+ - Post-change cached clean build: X.Xs (was Y.Ys) -- Z.Zs faster/slower (when COMPILATION_CACHING enabled)
112
+ - Post-change incremental build: X.Xs (was Y.Ys) -- Z.Zs faster/slower
113
+ - **Net result:** Faster / Slower / Unchanged
114
+ - If cumulative task metrics improved but wall-clock did not: "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."
115
+ - If standard clean builds are slower but cached clean builds are faster: "Standard clean builds show overhead from compilation cache population. Cached clean builds (the realistic developer workflow) are faster, confirming the net benefit."
116
+
117
+ ### Blocked or Non-Actionable Findings
118
+ - Finding: reason it could not be addressed from the repo
119
+
120
+ ## Remaining follow-up ideas
121
+ - Item:
122
+ - Why it was deferred:
123
+
124
+ ## Share your results
125
+
126
+ Add your improvement to the community results table by opening a pull request.
127
+ Copy the row below and append it to the table in README.md:
128
+
129
+ | <project-name> | X.Xs → X.Xs (-X.Xs / X% faster) | X.Xs → X.Xs (-X.Xs / X% faster) |
130
+
131
+ Open a PR: https://github.com/AvdLee/Xcode-Build-Optimization-Agent-Skill/edit/main/README.md
132
+ ```
133
+
134
+ ## Usage Notes
135
+
136
+ - Keep approval-required items explicit.
137
+ - Do not imply that an unapproved recommendation was applied.
138
+ - If results are noisy, say that the verification is inconclusive instead of overstating success.
139
+ - The Build Settings Audit scope is strictly build performance. Do not flag language-migration settings like `SWIFT_STRICT_CONCURRENCY` or `SWIFT_UPCOMING_FEATURE_*`.
140
+ - The Compilation Diagnostics section is populated by `diagnose_compilation.py`. If not run, note that it was skipped.
141
+ - `COMPILATION_CACHING` has been measured at 5-14% faster clean builds across tested projects. The benefit compounds in real developer workflows (branch switching, pulling changes, CI with persistent DerivedData). The benchmark script auto-detects this setting and runs a cached clean phase for validation.
142
+ - When recommending SPM version pins, verify that tagged versions exist (`git ls-remote --tags`) before suggesting a pin-to-tag change. If no tags exist, recommend pinning to a commit revision hash.
143
+ - Before including a local package in a build-time recommendation, verify it is referenced in `project.pbxproj` via `XCLocalSwiftPackageReference`. Packages that exist on disk but are not linked do not affect build time.