feat(build): add compact summary mode
This commit is contained in:
1 parent
1355cbe3cd
commit
ab3007cf48
2 files changed
+16
-18
No files matched your search
+11
-9
@@ -34,6 +34,7 @@ rule_skill_files=()
|
||||
rule_skill_names=()
|
||||
rule_skill_triggers=()
|
||||
while IFS=$'\t' read -r rule_file skill_name trigger; do
|
||||
trigger=${trigger%$'\r'}
|
||||
[ "$rule_file" != rule_file ] || continue
|
||||
[ -n "$rule_file" ] || continue
|
||||
[ -n "$skill_name" ] || { printf 'Missing skill_name in rule-skill manifest row for %s.\n' "$rule_file" >&2; exit 1; }
|
||||
@@ -69,7 +70,12 @@ quote_toml() {
|
||||
printf '"%s"' "$value"
|
||||
}
|
||||
|
||||
bash "$shared/hooks/scripts/test-session-config.sh" "$root"
|
||||
session_output=$(bash "$shared/hooks/scripts/test-session-config.sh" "$root") || { printf '%s\n' "$session_output" >&2; exit 1; }
|
||||
if [ "$summary" = true ]; then
|
||||
printf '%s\n' "$session_output" | sed '/^PASS session configuration$/d'
|
||||
else
|
||||
printf '%s\n' "$session_output"
|
||||
fi
|
||||
rm -rf -- "$output"
|
||||
|
||||
agent_dirs=("$shared"/agents/*/)
|
||||
@@ -109,7 +115,7 @@ Load rule files when their subject applies:
|
||||
- rules/git.md for Git operations.
|
||||
- rules/refactoring.md for refactoring work.
|
||||
- rules/definition-of-done.md when validating completion.
|
||||
- rules/decision-rule.md when requirements, behavior, or technical choices need to be evaluated.
|
||||
- rules/decision-rule.md when requirements are unresolved, behavior is ambiguous, or a meaningful technical choice remains.
|
||||
BLOCK
|
||||
|
||||
for platform in windows linux; do
|
||||
@@ -121,11 +127,7 @@ copy_directory "$shared/hooks" "$output/codex-$platform/hooks"
|
||||
copy_directory "$shared/hooks" "$output/claude-$platform/hooks"
|
||||
copy_directory "$shared/statusline" "$output/claude-$platform/statusline"
|
||||
|
||||
# Claude: general.md stays a plain, always-applied rule file. Every technology- or
|
||||
# situation-specific rule becomes a skill instead, so only its name and description
|
||||
# sit permanently in context; the full text loads only when the skill is invoked.
|
||||
mkdir -p "$output/claude-$platform/rules"
|
||||
cp "$shared/rules/general.md" "$output/claude-$platform/rules/general.md"
|
||||
|
||||
claude_rule_loading_list=""
|
||||
for i in "${!rule_skill_names[@]}"; do
|
||||
@@ -137,14 +139,14 @@ for i in "${!rule_skill_names[@]}"; do
|
||||
[ -d "$rule_source" ] && rule_body="$rule_source/index.md"
|
||||
skill_dir="$output/claude-$platform/skills/rules/$skill_name"
|
||||
mkdir -p "$skill_dir"
|
||||
{ printf -- '---\nname: %s\ndescription: Use for %s.\n---\n\n' "$skill_name" "$trigger"; cat "$rule_body"; } > "$skill_dir/SKILL.md"
|
||||
{ printf -- '---\nname: %s\ndescription: %s\n---\n\n' "$skill_name" "$(quote_toml "Use for $trigger.")"; cat "$rule_body"; } > "$skill_dir/SKILL.md"
|
||||
if [ -d "$rule_source/references" ]; then
|
||||
copy_directory "$rule_source/references" "$skill_dir/references"
|
||||
fi
|
||||
claude_rule_loading_list="${claude_rule_loading_list}- ${skill_name} for ${trigger}.
|
||||
"
|
||||
done
|
||||
claude_rule_loading="Always apply \`rules/general.md\` before starting any task, embedded below.
|
||||
claude_rule_loading="General rules are embedded below.
|
||||
|
||||
Detect the languages, frameworks, tools, and change areas from the repository and the requested work. Invoke every matching rule skill before editing. Invoke all matching rule skills when multiple technologies apply.
|
||||
|
||||
@@ -228,4 +230,4 @@ if [ -n "$leftover_tokens" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'PASS build: codex-windows, claude-windows, codex-linux, claude-linux\n'
|
||||
if [ "$summary" = true ]; then printf 'Build: PASS | 4 packages\n'; else printf 'PASS build: codex-windows, claude-windows, codex-linux, claude-linux\n'; fi
|
||||
Reference in new issue
Block a user