@givolt/i3-composer-agent 0.0.0-stage → 1.0.0

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 (231) hide show
  1. package/.agents/plugins/marketplace.json +23 -0
  2. package/.claude/commands/build.md +44 -0
  3. package/.claude/commands/code-simplify.md +22 -0
  4. package/.claude/commands/constraints.md +32 -0
  5. package/.claude/commands/plan.md +18 -0
  6. package/.claude/commands/review.md +16 -0
  7. package/.claude/commands/ship.md +72 -0
  8. package/.claude/commands/spec.md +17 -0
  9. package/.claude/commands/test.md +19 -0
  10. package/.claude/commands/webperf.md +32 -0
  11. package/.claude-plugin/marketplace.json +27 -0
  12. package/.claude-plugin/plugin.json +19 -0
  13. package/.codex-plugin/plugin.json +28 -0
  14. package/.gemini/commands/build.toml +43 -0
  15. package/.gemini/commands/code-simplify.toml +22 -0
  16. package/.gemini/commands/constraints.toml +32 -0
  17. package/.gemini/commands/planning.toml +18 -0
  18. package/.gemini/commands/review.toml +16 -0
  19. package/.gemini/commands/ship.toml +72 -0
  20. package/.gemini/commands/spec.toml +17 -0
  21. package/.gemini/commands/test.toml +19 -0
  22. package/.gemini/commands/webperf.toml +32 -0
  23. package/CHANGELOG.md +23 -0
  24. package/LICENSE +21 -0
  25. package/NOTICE.md +9 -0
  26. package/README.md +117 -2
  27. package/agents/code-reviewer.md +102 -0
  28. package/agents/security-auditor.md +112 -0
  29. package/agents/test-engineer.md +95 -0
  30. package/agents/web-performance-auditor.md +184 -0
  31. package/bin/i3-composer-agent.cjs +122 -0
  32. package/commands/build.toml +43 -0
  33. package/commands/code-simplify.toml +22 -0
  34. package/commands/constraints.toml +32 -0
  35. package/commands/planning.toml +18 -0
  36. package/commands/review.toml +16 -0
  37. package/commands/ship.toml +72 -0
  38. package/commands/spec.toml +17 -0
  39. package/commands/test.toml +19 -0
  40. package/commands/webperf.toml +32 -0
  41. package/docs/adoption-guide.md +129 -0
  42. package/docs/advanced-per-agent-configuration.md +70 -0
  43. package/docs/agents.md +123 -0
  44. package/docs/antigravity-setup.md +128 -0
  45. package/docs/codebuddy-setup.md +41 -0
  46. package/docs/codex-setup.md +34 -0
  47. package/docs/commandcode-setup.md +69 -0
  48. package/docs/comparison.md +131 -0
  49. package/docs/copilot-cli-setup.md +64 -0
  50. package/docs/copilot-setup.md +162 -0
  51. package/docs/cursor-setup.md +225 -0
  52. package/docs/developer-onboarding.md +116 -0
  53. package/docs/gemini-cli-setup.md +133 -0
  54. package/docs/getting-started.md +208 -0
  55. package/docs/opencode-setup.md +259 -0
  56. package/docs/other-hosts.md +7 -0
  57. package/docs/skill-anatomy.md +203 -0
  58. package/docs/windsurf-setup.md +48 -0
  59. package/evals/README.md +101 -0
  60. package/evals/cases/api-and-interface-design.json +45 -0
  61. package/evals/cases/browser-testing-with-devtools.json +44 -0
  62. package/evals/cases/ci-cd-and-automation.json +45 -0
  63. package/evals/cases/code-review-and-quality.json +49 -0
  64. package/evals/cases/code-simplification.json +45 -0
  65. package/evals/cases/constraint-driven-development.json +79 -0
  66. package/evals/cases/context-engineering.json +44 -0
  67. package/evals/cases/debugging-and-error-recovery.json +58 -0
  68. package/evals/cases/deprecation-and-migration.json +52 -0
  69. package/evals/cases/documentation-and-adrs.json +44 -0
  70. package/evals/cases/doubt-driven-development.json +43 -0
  71. package/evals/cases/frontend-ui-engineering.json +52 -0
  72. package/evals/cases/git-workflow-and-versioning.json +47 -0
  73. package/evals/cases/idea-refine.json +43 -0
  74. package/evals/cases/incremental-implementation.json +57 -0
  75. package/evals/cases/interview-me.json +42 -0
  76. package/evals/cases/observability-and-instrumentation.json +44 -0
  77. package/evals/cases/performance-optimization.json +53 -0
  78. package/evals/cases/planning-and-task-breakdown.json +45 -0
  79. package/evals/cases/security-and-hardening.json +53 -0
  80. package/evals/cases/shipping-and-launch.json +56 -0
  81. package/evals/cases/source-driven-development.json +44 -0
  82. package/evals/cases/spec-driven-development.json +72 -0
  83. package/evals/cases/test-driven-development.json +73 -0
  84. package/evals/cases/using-agent-skills.json +44 -0
  85. package/evals/fixtures/api-and-interface-design/service-brief.md +19 -0
  86. package/evals/fixtures/browser-testing-with-devtools/README.md +5 -0
  87. package/evals/fixtures/browser-testing-with-devtools/index.html +24 -0
  88. package/evals/fixtures/browser-testing-with-devtools/server.js +15 -0
  89. package/evals/fixtures/ci-cd-and-automation/package.json +8 -0
  90. package/evals/fixtures/ci-cd-and-automation/src/slug.js +3 -0
  91. package/evals/fixtures/ci-cd-and-automation/test/slug.test.js +9 -0
  92. package/evals/fixtures/code-review-and-quality/user-search.diff +16 -0
  93. package/evals/fixtures/code-simplification/config-parser.js +46 -0
  94. package/evals/fixtures/code-simplification/config-parser.test.js +15 -0
  95. package/evals/fixtures/context-engineering/context-audit.md +15 -0
  96. package/evals/fixtures/debugging-and-error-recovery/pagination.js +8 -0
  97. package/evals/fixtures/debugging-and-error-recovery/pagination.test.js +9 -0
  98. package/evals/fixtures/debugging-and-error-recovery/time-pressure.md +6 -0
  99. package/evals/fixtures/deprecation-and-migration/api-inventory.md +9 -0
  100. package/evals/fixtures/documentation-and-adrs/decision-context.md +16 -0
  101. package/evals/fixtures/doubt-driven-development/migration-plan.md +19 -0
  102. package/evals/fixtures/frontend-ui-engineering/Button.tsx +7 -0
  103. package/evals/fixtures/frontend-ui-engineering/design-system.md +11 -0
  104. package/evals/fixtures/git-workflow-and-versioning/.eval/working-tree.patch +21 -0
  105. package/evals/fixtures/git-workflow-and-versioning/app.js +7 -0
  106. package/evals/fixtures/git-workflow-and-versioning/app.test.js +9 -0
  107. package/evals/fixtures/incremental-implementation/reports.js +7 -0
  108. package/evals/fixtures/incremental-implementation/reports.test.js +12 -0
  109. package/evals/fixtures/incremental-implementation/tasks/plan.md +8 -0
  110. package/evals/fixtures/incremental-implementation-pressure/draft-export.js +17 -0
  111. package/evals/fixtures/incremental-implementation-pressure/scenario.md +9 -0
  112. package/evals/fixtures/observability-and-instrumentation/operations.md +11 -0
  113. package/evals/fixtures/observability-and-instrumentation/payment-retry.js +14 -0
  114. package/evals/fixtures/performance-optimization/benchmark.js +15 -0
  115. package/evals/fixtures/performance-optimization/products.js +14 -0
  116. package/evals/fixtures/planning-and-task-breakdown/notifications-spec.md +18 -0
  117. package/evals/fixtures/security-and-hardening/webhook.js +11 -0
  118. package/evals/fixtures/security-and-hardening/webhook.test.js +13 -0
  119. package/evals/fixtures/shipping-and-launch/authority-pressure.md +6 -0
  120. package/evals/fixtures/shipping-and-launch/launch-status.md +11 -0
  121. package/evals/fixtures/source-driven-development/framework-task.md +10 -0
  122. package/evals/fixtures/spec-driven-development/billing-brief.md +16 -0
  123. package/evals/fixtures/spec-driven-development-decomposition/portal-brief.md +22 -0
  124. package/evals/fixtures/test-driven-development/BUG.md +10 -0
  125. package/evals/fixtures/test-driven-development/README.md +28 -0
  126. package/evals/fixtures/test-driven-development/package.json +9 -0
  127. package/evals/fixtures/test-driven-development/src/split.js +8 -0
  128. package/evals/fixtures/test-driven-development/test/split.test.js +13 -0
  129. package/evals/fixtures/test-driven-development-ecosystem/README.md +9 -0
  130. package/evals/fixtures/test-driven-development-ecosystem/ledger.py +15 -0
  131. package/evals/fixtures/test-driven-development-ecosystem/test_ledger.py +19 -0
  132. package/evals/fixtures/using-agent-skills/incident.md +6 -0
  133. package/evals/plugin/code-review-fires/graders/off-by-one.md +7 -0
  134. package/evals/plugin/code-review-fires/graders/severity-labels.md +4 -0
  135. package/evals/plugin/code-review-fires/graders/skill-fired.md +5 -0
  136. package/evals/plugin/code-review-fires/prompt.md +31 -0
  137. package/evals/plugin/code-review-stays-quiet/graders/not-fired.md +8 -0
  138. package/evals/plugin/code-review-stays-quiet/graders/tdd-fired.md +6 -0
  139. package/evals/plugin/code-review-stays-quiet/prompt.md +8 -0
  140. package/evals/plugin/code-review-stays-quiet-on-commit-message/graders/not-fired.md +8 -0
  141. package/evals/plugin/code-review-stays-quiet-on-commit-message/prompt.md +25 -0
  142. package/evals/skill-impact.md +6 -0
  143. package/hooks/SDD-CACHE.md +167 -0
  144. package/hooks/SIMPLIFY-IGNORE.md +91 -0
  145. package/hooks/sdd-cache-post.sh +135 -0
  146. package/hooks/sdd-cache-pre.sh +106 -0
  147. package/hooks/sdd-cache-test.sh +246 -0
  148. package/hooks/session-start-test.sh +47 -0
  149. package/hooks/session-start.sh +33 -0
  150. package/hooks/simplify-ignore-test.sh +476 -0
  151. package/hooks/simplify-ignore.sh +352 -0
  152. package/package.json +89 -4
  153. package/plugin.json +7 -0
  154. package/rebrand/MAINTENANCE.md +112 -0
  155. package/rebrand/NOTICE.md +9 -0
  156. package/rebrand/PR-WORKFLOW.md +34 -0
  157. package/rebrand/UNIFICATION-SPEC.md +33 -0
  158. package/rebrand/VALIDATION.md +28 -0
  159. package/rebrand/VERSIONING.md +32 -0
  160. package/rebrand/apply.cjs +194 -0
  161. package/rebrand/brand.json +13 -0
  162. package/rebrand/catalog.cjs +56 -0
  163. package/rebrand/fork-patches.json +12 -0
  164. package/rebrand/overlay/.github/workflows/test-plugin-install.yml +177 -0
  165. package/rebrand/overlay/CHANGELOG.md +23 -0
  166. package/rebrand/overlay/bin/i3-composer-agent.cjs +122 -0
  167. package/rebrand/overlay/scripts/validate-brand.cjs +44 -0
  168. package/rebrand/overlay/tests/bundle.test.cjs +85 -0
  169. package/rebrand/package.template.json +82 -0
  170. package/rebrand/rebrand.sh +4 -0
  171. package/rebrand/record-upstream.cjs +37 -0
  172. package/rebrand/templates/README.md +86 -0
  173. package/rebrand/templates/codebuddy-setup.md +41 -0
  174. package/rebrand/templates/codex-setup.md +34 -0
  175. package/rebrand/tests/pipeline.test.cjs +185 -0
  176. package/rebrand/upstream.json +171 -0
  177. package/references/accessibility-checklist.md +160 -0
  178. package/references/definition-of-done.md +67 -0
  179. package/references/observability-checklist.md +92 -0
  180. package/references/orchestration-patterns.md +370 -0
  181. package/references/performance-checklist.md +236 -0
  182. package/references/security-checklist.md +248 -0
  183. package/references/testing-patterns.md +235 -0
  184. package/scripts/floor-guard-reference-test.js +291 -0
  185. package/scripts/lib/skill-lint-test.js +650 -0
  186. package/scripts/lib/skill-lint.js +584 -0
  187. package/scripts/run-evals-test.js +623 -0
  188. package/scripts/run-evals.js +638 -0
  189. package/scripts/validate-artifact-paths-test.js +179 -0
  190. package/scripts/validate-artifact-paths.js +128 -0
  191. package/scripts/validate-brand.cjs +44 -0
  192. package/scripts/validate-commands-test.js +216 -0
  193. package/scripts/validate-commands.js +222 -0
  194. package/scripts/validate-reference-links-test.js +495 -0
  195. package/scripts/validate-reference-links.js +187 -0
  196. package/scripts/validate-skills.js +69 -0
  197. package/scripts/validate-versions-test.js +32 -0
  198. package/scripts/validate-versions.js +35 -0
  199. package/skills/api-and-interface-design/SKILL.md +367 -0
  200. package/skills/browser-testing-with-devtools/SKILL.md +317 -0
  201. package/skills/ci-cd-and-automation/SKILL.md +390 -0
  202. package/skills/code-review-and-quality/SKILL.md +398 -0
  203. package/skills/code-simplification/SKILL.md +331 -0
  204. package/skills/constraint-driven-development/SKILL.md +311 -0
  205. package/skills/constraint-driven-development/references/floor-guard.md +182 -0
  206. package/skills/context-engineering/SKILL.md +353 -0
  207. package/skills/debugging-and-error-recovery/SKILL.md +300 -0
  208. package/skills/deprecation-and-migration/SKILL.md +247 -0
  209. package/skills/documentation-and-adrs/SKILL.md +288 -0
  210. package/skills/doubt-driven-development/SKILL.md +243 -0
  211. package/skills/frontend-ui-engineering/SKILL.md +340 -0
  212. package/skills/git-workflow-and-versioning/SKILL.md +355 -0
  213. package/skills/idea-refine/SKILL.md +178 -0
  214. package/skills/idea-refine/examples.md +238 -0
  215. package/skills/idea-refine/frameworks.md +99 -0
  216. package/skills/idea-refine/refinement-criteria.md +113 -0
  217. package/skills/idea-refine/scripts/idea-refine.sh +15 -0
  218. package/skills/incremental-implementation/SKILL.md +249 -0
  219. package/skills/interview-me/SKILL.md +235 -0
  220. package/skills/observability-and-instrumentation/SKILL.md +238 -0
  221. package/skills/performance-optimization/SKILL.md +267 -0
  222. package/skills/performance-optimization/references/optimization-patterns.md +250 -0
  223. package/skills/planning-and-task-breakdown/SKILL.md +257 -0
  224. package/skills/security-and-hardening/SKILL.md +216 -0
  225. package/skills/security-and-hardening/references/hardening-patterns.md +324 -0
  226. package/skills/shipping-and-launch/SKILL.md +330 -0
  227. package/skills/source-driven-development/SKILL.md +216 -0
  228. package/skills/spec-driven-development/SKILL.md +259 -0
  229. package/skills/test-driven-development/SKILL.md +398 -0
  230. package/skills/using-agent-skills/SKILL.md +192 -0
  231. package/tests/bundle.test.cjs +85 -0
@@ -0,0 +1,352 @@
1
+ #!/bin/bash
2
+ # simplify-ignore.sh — Hook for Read (PreToolUse), Edit|Write (PostToolUse), Stop
3
+ #
4
+ # PreToolUse Read → backs up file, replaces blocks with BLOCK_<hash> in-place
5
+ # PostToolUse Edit → expands placeholders, re-filters so file stays hidden
6
+ # PostToolUse Write → expands placeholders, re-filters so file stays hidden
7
+ # Stop → expands the placeholders still in the file on disk, so a
8
+ # change made by any route survives; the backup is used
9
+ # only when no placeholder is left to expand
10
+ #
11
+ # The file on disk ALWAYS has placeholders while the session is active.
12
+ # The real content is that file with its placeholders expanded; the backup
13
+ # holds the last state the hook itself saw.
14
+ #
15
+ # Dependencies: jq, shasum or sha1sum (auto-detected)
16
+
17
+ set -euo pipefail
18
+
19
+ # Bash 5.2+ turns on patsub_replacement by default, which makes `&` and
20
+ # backslash special on the replacement side of ${var//pattern/replacement}:
21
+ # `&` expands to the matched text and `\\` collapses. expand_file substitutes
22
+ # raw block content there, and code routinely contains `&&` and backslashes,
23
+ # so the option must be off or protected blocks come back corrupted on Linux.
24
+ # Older bashes do not know the option; ignore the error there.
25
+ shopt -u patsub_replacement 2>/dev/null || true
26
+
27
+ if ! command -v jq >/dev/null 2>&1; then
28
+ printf '%s\n' "error: missing jq" >&2; exit 1
29
+ fi
30
+
31
+ CACHE="${CLAUDE_PROJECT_DIR:-.}/.claude/.simplify-ignore-cache"
32
+ if [ -t 0 ]; then INPUT="{}"; else INPUT=$(cat); fi
33
+
34
+ # Parse hook input — trap errors explicitly so set -e doesn't cause
35
+ # a silent exit on malformed JSON, and surface a useful diagnostic.
36
+ parse_error=""
37
+ TOOL_NAME=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null) || {
38
+ parse_error="failed to parse .tool_name from hook input"
39
+ TOOL_NAME=""
40
+ }
41
+ FILE_PATH=$(printf '%s' "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null) || {
42
+ parse_error="failed to parse .tool_input.file_path from hook input"
43
+ FILE_PATH=""
44
+ }
45
+ if [ -n "$parse_error" ]; then
46
+ printf 'Warning: %s (input: %.120s)\n' "$parse_error" "$INPUT" >&2
47
+ fi
48
+
49
+ hash_cmd() {
50
+ if command -v shasum >/dev/null 2>&1; then shasum
51
+ elif command -v sha1sum >/dev/null 2>&1; then sha1sum
52
+ else printf '%s\n' "error: missing shasum or sha1sum" >&2; exit 1; fi
53
+ }
54
+ file_id() { printf '%s' "$1" | hash_cmd | cut -c1-16; }
55
+ block_hash() { printf '%s' "$1" | hash_cmd | cut -c1-8; }
56
+ # Escape glob metacharacters so ${var/pattern/repl} treats pattern as literal.
57
+ # Needed for Bash 3.2 (macOS) where quotes don't suppress globbing in PE patterns.
58
+ escape_glob() {
59
+ local s="$1"
60
+ s="${s//\\/\\\\}"
61
+ s="${s//\*/\\*}"
62
+ s="${s//\?/\\?}"
63
+ s="${s//\[/\\[}"
64
+ printf '%s' "$s"
65
+ }
66
+
67
+ # ── filter_file: replace simplify-ignore blocks with BLOCK_<hash> placeholders ─
68
+ # Reads $1 (source), writes filtered version to $2 (dest), saves blocks to cache.
69
+ # Returns 0 if blocks were found, 1 if none.
70
+ filter_file() {
71
+ local src="$1" dest="$2" fid="$3"
72
+ : > "$dest"
73
+ rm -f "$CACHE/${fid}".block.* "$CACHE/${fid}".reason.* "$CACHE/${fid}".prefix.* "$CACHE/${fid}".suffix.*
74
+
75
+ local count=0 in_block=0 buf="" reason="" prefix="" suffix=""
76
+
77
+ while IFS= read -r line || [ -n "$line" ]; do
78
+ # Check for start marker (no fork — uses bash case)
79
+ if [ $in_block -eq 0 ]; then
80
+ case "$line" in *simplify-ignore-start*)
81
+ in_block=1
82
+ buf="$line"
83
+ # Extract comment prefix/suffix to preserve language-appropriate syntax
84
+ prefix="${line%%simplify-ignore-start*}"
85
+ suffix=""
86
+ case "$line" in *'*/'*) suffix=" */" ;; *'-->'*) suffix=" -->" ;; esac
87
+ reason=$(printf '%s' "$line" | sed -n 's/.*simplify-ignore-start:[[:space:]]*//p' \
88
+ | sed 's/[[:space:]]*\*\/.*$//' | sed 's/[[:space:]]*-->.*$//' | sed 's/[[:space:]]*$//')
89
+ # Handle single-line block (start + end on same line)
90
+ case "$line" in *simplify-ignore-end*)
91
+ in_block=0
92
+ # Write single-line block immediately and skip to next line
93
+ # to avoid the end-marker check below firing again
94
+ local h; h=$(block_hash "$buf")
95
+ count=$((count + 1))
96
+ printf '%s' "$buf" > "$CACHE/${fid}.block.${h}"
97
+ [ -n "$reason" ] && printf '%s' "$reason" > "$CACHE/${fid}.reason.${h}"
98
+ printf '%s' "$prefix" > "$CACHE/${fid}.prefix.${h}"
99
+ printf '%s' "$suffix" > "$CACHE/${fid}.suffix.${h}"
100
+ if [ -n "$reason" ]; then
101
+ printf '%s\n' "${prefix}BLOCK_${h}: ${reason}${suffix}" >> "$dest"
102
+ else
103
+ printf '%s\n' "${prefix}BLOCK_${h}${suffix}" >> "$dest"
104
+ fi
105
+ buf=""; reason=""; prefix=""; suffix=""
106
+ continue
107
+ ;; *)
108
+ continue
109
+ ;;
110
+ esac
111
+ ;; esac
112
+ fi
113
+ # Accumulate block content
114
+ if [ $in_block -eq 1 ]; then
115
+ buf="${buf}
116
+ ${line}"
117
+ fi
118
+ # Check for end marker
119
+ case "$line" in *simplify-ignore-end*)
120
+ if [ $in_block -eq 1 ]; then
121
+ local h; h=$(block_hash "$buf")
122
+ count=$((count + 1))
123
+ printf '%s' "$buf" > "$CACHE/${fid}.block.${h}"
124
+ [ -n "$reason" ] && printf '%s' "$reason" > "$CACHE/${fid}.reason.${h}"
125
+ printf '%s' "$prefix" > "$CACHE/${fid}.prefix.${h}"
126
+ printf '%s' "$suffix" > "$CACHE/${fid}.suffix.${h}"
127
+ if [ -n "$reason" ]; then
128
+ printf '%s\n' "${prefix}BLOCK_${h}: ${reason}${suffix}" >> "$dest"
129
+ else
130
+ printf '%s\n' "${prefix}BLOCK_${h}${suffix}" >> "$dest"
131
+ fi
132
+ in_block=0; buf=""; reason=""; prefix=""; suffix=""
133
+ continue
134
+ fi
135
+ ;;
136
+ esac
137
+ [ $in_block -eq 0 ] && printf '%s\n' "$line" >> "$dest"
138
+ done < "$src"
139
+
140
+ # Unclosed block → flush as-is
141
+ if [ $in_block -eq 1 ] && [ -n "$buf" ]; then
142
+ printf 'Warning: unclosed simplify-ignore-start in %s (block not hidden)\n' "$src" >&2
143
+ printf '%s\n' "$buf" >> "$dest"
144
+ fi
145
+
146
+ # Preserve trailing newline status of source
147
+ if [ -s "$dest" ] && [ -s "$src" ] && [ -n "$(tail -c 1 "$src")" ]; then
148
+ perl -pe 'chomp if eof' "$dest" > "${dest}.nnl" && \
149
+ cat "${dest}.nnl" > "$dest" && rm -f "${dest}.nnl"
150
+ fi
151
+
152
+ [ $count -gt 0 ] && return 0 || return 1
153
+ }
154
+
155
+ # ── expand_file: replace BLOCK_<hash> placeholders with the real block code ───
156
+ # Reads $1 (source), writes the expanded version to $2 (dest), using the blocks
157
+ # cached under $3 (file id). Warns on placeholders that were altered or deleted.
158
+ expand_file() {
159
+ local src="$1" dest="$2" fid="$3"
160
+ local line bf h bp bs br placeholder block_content esc_placeholder esc_fuzzy bh first_line
161
+ rm -f "$dest"
162
+ while IFS= read -r line || [ -n "$line" ]; do
163
+ case "$line" in *BLOCK_*)
164
+ # Expand all placeholders on this line (supports multiple per line)
165
+ for bf in "$CACHE/${fid}".block.*; do
166
+ [ -f "$bf" ] || continue
167
+ h="${bf##*.}"
168
+ case "$line" in *"BLOCK_${h}"*)
169
+ # Reconstruct the exact placeholder pattern
170
+ bp=""; bs=""; br=""
171
+ [ -f "$CACHE/${fid}.prefix.${h}" ] && bp=$(cat "$CACHE/${fid}.prefix.${h}")
172
+ [ -f "$CACHE/${fid}.suffix.${h}" ] && bs=$(cat "$CACHE/${fid}.suffix.${h}")
173
+ [ -f "$CACHE/${fid}.reason.${h}" ] && br=$(cat "$CACHE/${fid}.reason.${h}")
174
+ if [ -n "$br" ]; then
175
+ placeholder="${bp}BLOCK_${h}: ${br}${bs}"
176
+ else
177
+ placeholder="${bp}BLOCK_${h}${bs}"
178
+ fi
179
+ block_content=$(cat "$bf"; printf x); block_content="${block_content%x}"
180
+ # Escape glob metacharacters (* ? [ \) in the pattern
181
+ esc_placeholder=$(escape_glob "$placeholder")
182
+ # Bash native substitution (// = global replace): replace placeholder, keep surrounding code
183
+ line="${line//$esc_placeholder/$block_content}"
184
+ # Fallback: if model altered the reason text, try without reason
185
+ # (only trigger if BLOCK_hash is still present AND wasn't in the original block content)
186
+ case "$block_content" in *"BLOCK_${h}"*) ;; *)
187
+ case "$line" in *"BLOCK_${h}"*)
188
+ printf 'Warning: placeholder BLOCK_%s was modified by model, using fuzzy match\n' "$h" >&2
189
+ esc_fuzzy=$(escape_glob "${bp}BLOCK_${h}${bs}")
190
+ line="${line//$esc_fuzzy/$block_content}"
191
+ # Last resort: match just the hash token
192
+ case "$line" in *"BLOCK_${h}"*)
193
+ line="${line//BLOCK_${h}/$block_content}"
194
+ ;; esac
195
+ ;; esac
196
+ ;; esac
197
+ ;; esac
198
+ done
199
+ ;; esac
200
+ printf '%s\n' "$line" >> "$dest"
201
+ done < "$src"
202
+ # Preserve trailing newline status
203
+ if [ -s "$dest" ] && [ -s "$src" ] && [ -n "$(tail -c 1 "$src")" ]; then
204
+ perl -pe 'chomp if eof' "$dest" > "${dest}.nnl" && \
205
+ cat "${dest}.nnl" > "$dest" && rm -f "${dest}.nnl"
206
+ fi
207
+ # Warn if model deleted a protected block entirely
208
+ for bf in "$CACHE/${fid}".block.*; do
209
+ [ -f "$bf" ] || continue
210
+ bh="${bf##*.}"
211
+ # After expansion, blocks appear as original code (simplify-ignore-start).
212
+ # If neither the expanded code nor the placeholder is in EXPANDED, it was deleted.
213
+ if ! grep -qF "BLOCK_${bh}" "$dest" 2>/dev/null; then
214
+ # Get first line of block to check if it was expanded back
215
+ first_line=$(head -1 "$bf")
216
+ if ! grep -qF "$first_line" "$dest" 2>/dev/null; then
217
+ printf 'Warning: protected block BLOCK_%s was deleted by model\n' "$bh" >&2
218
+ fi
219
+ fi
220
+ done
221
+ return 0
222
+ }
223
+
224
+ # ── has_placeholders: is a cached BLOCK_<hash> for $2 still present in file $1? ─
225
+ has_placeholders() {
226
+ local f="$1" fid="$2" bf h
227
+ for bf in "$CACHE/${fid}".block.*; do
228
+ [ -f "$bf" ] || continue
229
+ h="${bf##*.}"
230
+ grep -qF "BLOCK_${h}" "$f" 2>/dev/null && return 0
231
+ done
232
+ return 1
233
+ }
234
+
235
+ # ── Stop: expand each cached file in place, backup only as fallback ──────────
236
+ if [ -z "$TOOL_NAME" ]; then
237
+ [ -d "$CACHE" ] || exit 0
238
+ for bak in "$CACHE"/*.bak; do
239
+ [ -f "$bak" ] || continue
240
+ fid="${bak##*/}"; fid="${fid%.bak}"
241
+ pathfile="$CACHE/${fid}.path"
242
+ [ -f "$pathfile" ] || { rm -f "$bak"; continue; }
243
+ orig=$(cat "$pathfile")
244
+ if [ -f "$orig" ]; then
245
+ # A change can reach the file through a route that fires no Edit or Write
246
+ # event (a Bash command, a formatter, an external editor), and the backup
247
+ # is stale for all of them. Expand what is on disk rather than overwrite it.
248
+ if has_placeholders "$orig" "$fid"; then
249
+ EXPANDED="$CACHE/${fid}.$$.expanded"
250
+ expand_file "$orig" "$EXPANDED" "$fid"
251
+ cat "$EXPANDED" > "$orig"
252
+ rm -f "$EXPANDED"
253
+ else
254
+ # Nothing left to expand — the file was rewritten wholesale, so the
255
+ # backup is the only remaining copy of the protected blocks. Keep the
256
+ # rewrite in the cache before the backup overwrites it, so the work is
257
+ # recoverable rather than lost.
258
+ rewritten="$CACHE/${fid}.recovered"
259
+ cat "$orig" > "$rewritten"
260
+ cat "$bak" > "$orig"
261
+ printf 'Warning: no BLOCK_ placeholder left in %s, restored from backup. Rewrite kept at %s\n' \
262
+ "$orig" "$rewritten" >&2
263
+ fi
264
+ rm -f "$bak" "$pathfile" "$CACHE/${fid}".block.* "$CACHE/${fid}".reason.* "$CACHE/${fid}".prefix.* "$CACHE/${fid}".suffix.*
265
+ rmdir "$CACHE/${fid}.lock" 2>/dev/null
266
+ else
267
+ # File was moved/deleted — save backup as .recovered, don't destroy it
268
+ mkdir -p "$(dirname "${orig}.recovered")"
269
+ mv "$bak" "${orig}.recovered"
270
+ rm -f "$pathfile" "$CACHE/${fid}".block.* "$CACHE/${fid}".reason.* "$CACHE/${fid}".prefix.* "$CACHE/${fid}".suffix.*
271
+ rmdir "$CACHE/${fid}.lock" 2>/dev/null
272
+ printf 'Warning: %s was moved/deleted. Recovered original to %s.recovered\n' "$orig" "$orig" >&2
273
+ fi
274
+ done
275
+ # Clean orphan locks (created but crash before backup)
276
+ for lockdir in "$CACHE"/*.lock; do
277
+ [ -d "$lockdir" ] || continue
278
+ rmdir "$lockdir" 2>/dev/null
279
+ done
280
+ exit 0
281
+ fi
282
+
283
+ [ -z "$FILE_PATH" ] && exit 0
284
+
285
+ # ── PreToolUse Read: filter in-place ──────────────────────────────────────────
286
+ if [ "$TOOL_NAME" = "Read" ]; then
287
+ [ -f "$FILE_PATH" ] || exit 0
288
+ case "$(basename "$FILE_PATH")" in simplify-ignore*|SIMPLIFY-IGNORE*) exit 0 ;; esac
289
+
290
+ mkdir -p "$CACHE"
291
+ ID=$(file_id "$FILE_PATH")
292
+
293
+ # If backup exists, file is already filtered — skip
294
+ [ -f "$CACHE/${ID}.bak" ] && exit 0
295
+
296
+ grep -q 'simplify-ignore-start' -- "$FILE_PATH" || exit 0
297
+
298
+ # Atomic lock: mkdir fails if another session races us
299
+ if ! mkdir "$CACHE/${ID}.lock" 2>/dev/null; then
300
+ # Lock exists — reclaim only if stale (>60s old, no backup = crash leftover)
301
+ if [ ! -f "$CACHE/${ID}.bak" ] && \
302
+ [ -n "$(find "$CACHE/${ID}.lock" -maxdepth 0 -mmin +1 2>/dev/null)" ]; then
303
+ rmdir "$CACHE/${ID}.lock" 2>/dev/null || true
304
+ mkdir "$CACHE/${ID}.lock" 2>/dev/null || exit 0
305
+ else
306
+ exit 0
307
+ fi
308
+ fi
309
+
310
+ # Back up the original (preserve trailing newline status)
311
+ cp -p "$FILE_PATH" "$CACHE/${ID}.bak" 2>/dev/null || cp "$FILE_PATH" "$CACHE/${ID}.bak"
312
+ printf '%s' "$FILE_PATH" > "$CACHE/${ID}.path"
313
+
314
+ # Filter in-place (cat > preserves inode and permissions)
315
+ FILTERED="$CACHE/${ID}.$$.tmp"
316
+ rm -f "$FILTERED"
317
+ if filter_file "$FILE_PATH" "$FILTERED" "$ID"; then
318
+ cat "$FILTERED" > "$FILE_PATH"
319
+ rm -f "$FILTERED"
320
+ else
321
+ rm -f "$FILTERED" "$CACHE/${ID}.bak" "$CACHE/${ID}.path"
322
+ rmdir "$CACHE/${ID}.lock" 2>/dev/null
323
+ fi
324
+ exit 0
325
+ fi
326
+
327
+ # ── PostToolUse Edit|Write: expand, then re-filter ────────────────────────────
328
+ if [ "$TOOL_NAME" = "Edit" ] || [ "$TOOL_NAME" = "Write" ]; then
329
+ ID=$(file_id "$FILE_PATH")
330
+ [ -f "$CACHE/${ID}.bak" ] || exit 0
331
+ ls "$CACHE/${ID}".block.* >/dev/null 2>&1 || exit 0
332
+
333
+ # Expand placeholders, preserving any inline code the model added around them
334
+ EXPANDED="$CACHE/${ID}.$$.expanded"
335
+ expand_file "$FILE_PATH" "$EXPANDED" "$ID"
336
+ # Preserve inode and permissions
337
+ cat "$EXPANDED" > "$FILE_PATH"
338
+ rm -f "$EXPANDED"
339
+
340
+ # Save expanded version as new backup (this is the "real" file with model's changes)
341
+ cp "$FILE_PATH" "$CACHE/${ID}.bak"
342
+
343
+ # Re-filter in-place so the file on disk stays with placeholders
344
+ FILTERED="$CACHE/${ID}.$$.tmp"
345
+ rm -f "$FILTERED"
346
+ if filter_file "$FILE_PATH" "$FILTERED" "$ID"; then
347
+ cat "$FILTERED" > "$FILE_PATH"
348
+ rm -f "$FILTERED"
349
+ fi
350
+
351
+ exit 0
352
+ fi
package/package.json CHANGED
@@ -1,6 +1,91 @@
1
1
  {
2
2
  "name": "@givolt/i3-composer-agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "i3 Composer Agent: production-grade engineering skills and lifecycle commands for AI coding agents.",
4
+ "license": "MIT",
5
+ "author": "Givolt",
6
+ "contributors": [
7
+ {
8
+ "name": "Addy Osmani"
9
+ }
10
+ ],
11
+ "bin": {
12
+ "i3-composer-agent": "bin/i3-composer-agent.cjs"
13
+ },
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public",
19
+ "registry": "https://registry.npmjs.org/"
20
+ },
21
+ "files": [
22
+ "bin/",
23
+ "skills/",
24
+ "references/",
25
+ "agents/",
26
+ "commands/",
27
+ ".claude/commands/",
28
+ ".gemini/commands/",
29
+ ".claude-plugin/",
30
+ ".codex-plugin/",
31
+ ".agents/plugins/",
32
+ "hooks/",
33
+ "docs/",
34
+ "scripts/",
35
+ "evals/",
36
+ "rebrand/",
37
+ "tests/",
38
+ "plugin.json",
39
+ "NOTICE.md",
40
+ "CHANGELOG.md"
41
+ ],
42
+ "scripts": {
43
+ "rebrand": "node rebrand/apply.cjs --apply",
44
+ "rebrand:check": "node rebrand/apply.cjs --check",
45
+ "validate": "node scripts/validate-brand.cjs && node scripts/validate-skills.js && node scripts/validate-versions.js && node scripts/validate-commands.js && node scripts/validate-reference-links.js && node scripts/validate-artifact-paths.js",
46
+ "test": "node --test scripts/*-test.js scripts/lib/*-test.js tests/*.test.cjs rebrand/tests/*.test.cjs",
47
+ "prepack": "npm run validate"
48
+ },
49
+ "keywords": [
50
+ "i3-composer",
51
+ "agent-skills",
52
+ "codebuddy",
53
+ "codex",
54
+ "claude-code"
55
+ ],
56
+ "i3ComposerAgent": {
57
+ "pluginFiles": [
58
+ "bin",
59
+ "skills",
60
+ "references",
61
+ "agents",
62
+ "commands",
63
+ ".claude/commands",
64
+ ".gemini/commands",
65
+ ".claude-plugin",
66
+ ".codex-plugin",
67
+ ".agents/plugins",
68
+ "hooks",
69
+ "docs",
70
+ "scripts",
71
+ "evals",
72
+ "rebrand",
73
+ "tests",
74
+ "plugin.json",
75
+ "package.json",
76
+ "README.md",
77
+ "LICENSE",
78
+ "NOTICE.md",
79
+ "CHANGELOG.md"
80
+ ],
81
+ "upstreamVersion": "0.6.12",
82
+ "upstreamCommit": "1401c8b8030e023baeebb31781a6653fe8e93026",
83
+ "upstreamRepository": "https://github.com/addyosmani/agent-skills"
84
+ },
85
+ "version": "1.0.0",
86
+ "repository": {
87
+ "type": "git",
88
+ "url": "https://github.com/49780522/i3-composer-agent.git"
89
+ },
90
+ "homepage": "https://github.com/49780522/i3-composer-agent#readme"
91
+ }
package/plugin.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "i3-composer-agent",
3
+ "version": "1.0.0",
4
+ "description": "Production-grade engineering skills for AI coding agents covering the development lifecycle from spec to ship.",
5
+ "homepage": "https://github.com/49780522/i3-composer-agent",
6
+ "repository": "https://github.com/49780522/i3-composer-agent"
7
+ }
@@ -0,0 +1,112 @@
1
+ # i3 Composer Agent 仓库维护
2
+
3
+ 本指南只适用于 Agent 仓库;GSD / i3 Composer Work 是另一个独立仓库。
4
+ 这里借鉴其维护方式,不复用其源码、安装产物或 Git 分支。
5
+
6
+ ## 仓库和分支
7
+
8
+ - 品牌仓库:`https://github.com/49780522/i3-composer-agent`(Private)。
9
+ - `origin` 指向品牌仓库;`upstream` 指向 `https://github.com/addyosmani/agent-skills.git`。
10
+ - `agent/source`:原始上游源码与名称,加本项目 `rebrand/` 工具和规则。
11
+ - `main`:经过重放与验证的品牌快照;npm 身份为 `@givolt/i3-composer-agent`。
12
+ - `i3-composer-agent-v0.6.12`:已经发布的首次包所对应的原始品牌提交。
13
+
14
+ 源码工作树为 `/Users/howard/Workspace/composer-skills-source/agent-source`;
15
+ 品牌工作树为 `/Users/howard/Workspace/composer-skills-source/agent-skills`。
16
+ 旧的 Agent 本地 `i3/source` 分支已改为 `agent/source`,避免与 GSD 分支名称混淆。
17
+
18
+ ## 获取源码
19
+
20
+ ```bash
21
+ git clone https://github.com/49780522/i3-composer-agent.git
22
+ cd i3-composer-agent
23
+ git remote add upstream https://github.com/addyosmani/agent-skills.git
24
+ git fetch upstream --tags
25
+ git worktree add --track -b agent/source ../agent-source origin/agent/source
26
+ ```
27
+
28
+ 源分支没有发行用的根 package.json。包入口、发行测试和配置由
29
+ `rebrand/overlay/`、`package.template.json` 在品牌候选中生成。
30
+
31
+ ## 同步上游
32
+
33
+ 1. 在 Agent 源工作树获取上游,选择并审查一个明确的版本或提交。
34
+ 2. 从 `agent/source` 创建维护分支,合并该 ref 并解决源码冲突。
35
+ 3. 从同一 ref 记录上游目录和 Skill frontmatter;审查记录中的新增、删除和描述变化。
36
+ 4. 调整文字补丁、分发 overlay 和品牌模板;源码分支保持原始名称。
37
+ 5. 运行源验证,提交维护分支,通过 PR 合入 `agent/source`。
38
+ 6. 从更新后的源分支创建独立品牌候选工作树,重放、验证和打包。
39
+ 7. 将验证过的品牌快照通过发行 PR 更新 `main`;npm 发布单独执行。
40
+
41
+ 源维护阶段示例(把示例分支和 ref 替换为实际选定值):
42
+
43
+ ```bash
44
+ cd /Users/howard/Workspace/composer-skills-source/agent-source
45
+ git fetch upstream --tags
46
+ git switch -c sync/upstream-next agent/source
47
+ git merge --no-commit --no-ff upstream/main
48
+ # 审查并处理源码冲突后:
49
+ node rebrand/record-upstream.cjs upstream/main
50
+ node --test scripts/*-test.js scripts/lib/*-test.js rebrand/tests/*.test.cjs
51
+ ```
52
+
53
+ 记录工具读取 Git 对象中的上游文件,写入 `upstream.json` 和 `brand.json` 的基线。
54
+ 它不会把任意本地新增文件认定为上游。发布版本由 `brand.json.releaseVersion`
55
+ 控制,与 `upstream.json.upstreamVersion` 分开;按实际更改递增,保持六份清单一致。
56
+
57
+ 品牌版本从 `1.0.0` 开始使用独立编号;本次仅修改 i3,上游基线保留为 `0.6.12`。
58
+ 之后的当前基线以 `upstream.json` 记录为准。
59
+ 仅修改 i3 的修复或分发规则时,只递增品牌版本;上游版本和提交保持原值。
60
+ README、CLI 帮助和准备完成提示同时显示这两个版本;`--version` 保留单一品牌版本输出。
61
+ 具体规则与历史版本处理见 [VERSIONING.md](VERSIONING.md)。
62
+
63
+ ## 创建品牌候选
64
+
65
+ 从源分支创建候选,每次换一个分支名和独立目录:
66
+
67
+ ```bash
68
+ cd /Users/howard/Workspace/composer-skills-source/agent-skills
69
+ git fetch origin
70
+ git worktree add -b release/agent-next ../agent-candidate origin/agent/source
71
+ cd ../agent-candidate
72
+ bash rebrand/rebrand.sh --apply
73
+ bash rebrand/rebrand.sh --check
74
+ npm run validate
75
+ npm test
76
+ node scripts/run-evals.js --min-rank1 95
77
+ bash hooks/session-start-test.sh
78
+ bash hooks/sdd-cache-test.sh
79
+ bash hooks/simplify-ignore-test.sh
80
+ mkdir -p ../releases/next
81
+ npm pack --pack-destination ../releases/next
82
+ ```
83
+
84
+ 在打包前先创建输出目录。对 tarball 重新解包,验证 CLI、完整文件目录及宿主清单。
85
+ 源码分支上执行 `--apply` 会在写入前失败;不得把未经重放的源分支直接更新到 `main`。
86
+ 源 PR 与发行 PR 的边界见 [PR-WORKFLOW.md](PR-WORKFLOW.md)。
87
+
88
+ ## 审查重放规则
89
+
90
+ - `fork-patches.json`:明确的文字补丁,源文本不再匹配时失败,要求人工适配。
91
+ - `overlay/`:本项目的 npm CLI、发行测试、品牌校验和发行 CI;上游相关文件改变时需合并审查。
92
+ - `templates/`:品牌 README 和安装指南;上游对应说明改变时同步模板。
93
+ - 目录数量、Skill 表、命令表和插件描述由已记录的目录生成,不固定为 25/9。
94
+ - Skill frontmatter 保留原文;校验比较换行规范化后的哈希,兼容 LF/CRLF 检出。
95
+ - LICENSE、NOTICE、真实上游链接、历史评估说明和标准名称保留。
96
+ - 如果上游新增根 package.json,重放会失败,先适配分发配置和依赖再继续。
97
+
98
+ ## 发布及验收
99
+
100
+ 维护流程与安装能力分开验收。当前 npm CLI 准备文件并打印宿主注册命令;
101
+ 实际宿主安装范围、启用、命令执行以及交互向导仍需各自验证。
102
+ Codex 的生命周期斜杠命令适配是独立工作,已有 Skill ID 不因维护流程改名。
103
+
104
+ 发布审核通过后,发布已经测过的 tarball,先使用试用标签,完成 registry 安装验证后再更新 latest:
105
+
106
+ ```bash
107
+ npm publish /absolute/path/to/reviewed-package.tgz --access public --tag next
108
+ npm dist-tag add @givolt/i3-composer-agent@<reviewed-version> latest
109
+ ```
110
+
111
+ 每个已发布包名和版本只用一次。GitHub Actions 与 GSD 品牌仓库一样先保持关闭,
112
+ 适配并验证 CI 后再启用。当前验证范围见 [VALIDATION.md](VALIDATION.md)。
@@ -0,0 +1,9 @@
1
+ # Attribution
2
+
3
+ i3 Composer Agent is a branded distribution of
4
+ [Agent Skills](https://github.com/addyosmani/agent-skills) by Addy Osmani.
5
+ The initial distribution is based on upstream commit `1401c8b` (version 0.6.12).
6
+
7
+ The original MIT license and copyright notice are preserved in LICENSE.
8
+ Givolt maintains the branding, npm distribution, and bundle preparation CLI.
9
+ The original skill IDs, command workflows, and persona definitions are retained.
@@ -0,0 +1,34 @@
1
+ # Agent 源码与发行 PR
2
+
3
+ 此流程只操作 49780522/i3-composer-agent。GSD 仓库只是维护方法的参考。
4
+
5
+ 源码、修复和重放规则的 PR 以 `agent/source` 为 base,从该分支创建维护分支。
6
+ 保持上游文件的原始名称;本项目分发工具放在 `rebrand/`。
7
+
8
+ ```bash
9
+ git fetch origin
10
+ git worktree add -b fix/my-change ../agent-fix origin/agent/source
11
+ cd ../agent-fix
12
+ node --test scripts/*-test.js scripts/lib/*-test.js rebrand/tests/*.test.cjs
13
+ ```
14
+
15
+ 修改重放规则后,从维护提交另建品牌候选并执行 MAINTENANCE.md 中的完整验证。
16
+ 审查和暂存本次文件后提交,再推送并创建源码 PR:
17
+
18
+ ```bash
19
+ git push -u origin fix/my-change
20
+ gh pr create --base agent/source --head fix/my-change
21
+ ```
22
+
23
+ 源码 PR 合入后,从最新 `agent/source` 建立候选,重放、验证、打包并提交品牌内容。
24
+ 发行 PR 以 `main` 为 base;head 必须包含验证后的品牌快照。
25
+
26
+ 当 main 和源候选历史产生合并冲突时,从 main 创建发行 PR 分支,合入已验证的
27
+ 品牌候选并审查冲突。最终跟踪文件树必须与验证过的候选一致,然后提交:
28
+
29
+ ```bash
30
+ git diff --cached <validated-candidate-commit>
31
+ ```
32
+
33
+ 上述差异应为空。若合并中需要实际代码调整,重新验证调整后的发行内容和 tarball。
34
+ 不要把原始 agent/source 直接作为发行 PR 的 head;不向 upstream 推送品牌提交。
@@ -0,0 +1,33 @@
1
+ # Agent 项目维护流程统一
2
+
3
+ 用户已确认借鉴 GSD 项目维护方式,并要求项目互相独立。本规范只约束 Agent 仓库。
4
+
5
+ ## 目标与边界
6
+
7
+ - `upstream` 指向 addyosmani/agent-skills;`origin` 指向私有品牌仓库 49780522/i3-composer-agent。
8
+ - `agent/source` 保留上游原始名称和源码,在 `rebrand/` 保存本项目的分发工具与转换规则。
9
+ - 候选从 `agent/source` 创建,在候选中重放;`main` 保存经过验证的品牌快照。
10
+ - GSD 仓库只读,不使用它的源码、分支或安装产物。
11
+ - Skill ID、流程命令内容、Persona、参考文件和 MIT 来源署名保持既有契约。
12
+ - 本次完善源码同步和品牌重放;交互安装向导、Codex 命令适配及新的 npm 发布独立处理。
13
+
14
+ ## 实现与命令
15
+
16
+ 转换入口保持 Node.js 20+ 和零依赖:`node rebrand/apply.cjs --apply|--check`;另提供与 GSD 相同形式的 `bash rebrand/rebrand.sh` 入口。
17
+
18
+ 上游基线由 `node rebrand/record-upstream.cjs <明确的 ref>` 从 Git 对象记录;源码分支上运行 `node --test rebrand/tests/*.test.cjs`。候选执行 `npm run validate`、`npm test` 和既有路由/hook 检查。
19
+
20
+ 代码沿用 CommonJS、Node 内置 fs/path/assert。分发专属文件放在 `rebrand/overlay/`,发行包配置由模板生成,不把 branded README 或清单混入源码分支。
21
+
22
+ ## 验收条件
23
+
24
+ 1. 从干净上游源码及本项目规则能生成完整品牌包,重复重放不产生差异。
25
+ 2. 在 `agent/source` 上执行写入式重放必须失败且不修改源码。
26
+ 3. 记录上游新增 Skill/Command 后能生成相应清单和说明;删失或改写已记录 Skill ID 时校验失败。
27
+ 4. 上游的 25 个 Skill frontmatter、24 个非元 Skill、4 个 Persona、7 个共享参考保持原始内容;9 个流程只变品牌命名空间。
28
+ 5. 本地候选通过完整测试,并从打包结果运行 CLI 与校验。
29
+ 6. 独立品牌仓库中的源/发行分支及远程关系正确;首次发布标签保持原来的 0.6.12 提交。
30
+
31
+ ## 执行顺序
32
+
33
+ 先为源到品牌的重放、源码保护、目录增长与完整性写失败测试;实现工具及模板生成;验证真实上游归档;提交源分支;生成并审查品牌候选;最后建立远程并同步分支。