oneie 3.6.27 → 3.6.28
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/.claude/agents/agent-clone.md +2 -0
- package/.claude/agents/agent-writer.md +722 -0
- package/.claude/commands/one.md +70 -8
- package/.claude/commands/server.md +97 -48
- package/.claude/commands/start.md +182 -0
- package/.claude/hooks/write-news.sh +194 -0
- package/CLAUDE.md +150 -1057
- package/one/things/plans/video-backend.md +638 -0
- package/one/things/plans/video-frontend.md +432 -0
- package/one/things/plans/video-old-archived.md +656 -0
- package/package.json +1 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Write News Hook - Auto-generate news articles from git commits
|
|
4
|
+
# Invokes agent-writer to create engaging content about platform changes
|
|
5
|
+
|
|
6
|
+
PROJECT_DIR="$(git rev-parse --show-toplevel)"
|
|
7
|
+
HOOKS_DIR="$PROJECT_DIR/.claude/hooks"
|
|
8
|
+
NEWS_DIR="$PROJECT_DIR/web/src/content/news"
|
|
9
|
+
|
|
10
|
+
# Get the last commit info
|
|
11
|
+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
|
|
12
|
+
COMMIT_HASH=$(git log -1 --pretty=%H)
|
|
13
|
+
COMMIT_DATE=$(date +%Y-%m-%d)
|
|
14
|
+
COMMIT_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD | head -20)
|
|
15
|
+
COMMIT_STATS=$(git diff HEAD~1 HEAD --shortstat)
|
|
16
|
+
|
|
17
|
+
# Extract commit type (feat|fix|docs|refactor|perf|test)
|
|
18
|
+
COMMIT_TYPE=$(echo "$COMMIT_MESSAGE" | grep -oE '^(feat|fix|docs|refactor|perf|test|chore|style|build|ci)' | head -1)
|
|
19
|
+
|
|
20
|
+
# Skip if not newsworthy
|
|
21
|
+
if [[ "$COMMIT_TYPE" == "docs" ]] || [[ "$COMMIT_TYPE" == "chore" ]] || [[ "$COMMIT_TYPE" == "style" ]] || [[ "$COMMIT_TYPE" == "test" ]]; then
|
|
22
|
+
echo "✓ Skipping news generation for $COMMIT_TYPE commit"
|
|
23
|
+
exit 0
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Skip if commit message contains [skip-news] or [no-news]
|
|
27
|
+
if echo "$COMMIT_MESSAGE" | grep -qiE '\[(skip-news|no-news)\]'; then
|
|
28
|
+
echo "✓ Skipping news generation ([skip-news] flag detected)"
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Determine category based on commit type
|
|
33
|
+
case "$COMMIT_TYPE" in
|
|
34
|
+
feat)
|
|
35
|
+
CATEGORY="feature"
|
|
36
|
+
TYPE="feature_update"
|
|
37
|
+
;;
|
|
38
|
+
fix)
|
|
39
|
+
CATEGORY="infrastructure"
|
|
40
|
+
TYPE="bug_fix"
|
|
41
|
+
;;
|
|
42
|
+
perf)
|
|
43
|
+
CATEGORY="article"
|
|
44
|
+
TYPE="performance"
|
|
45
|
+
;;
|
|
46
|
+
refactor)
|
|
47
|
+
CATEGORY="infrastructure"
|
|
48
|
+
TYPE="architecture"
|
|
49
|
+
;;
|
|
50
|
+
*)
|
|
51
|
+
CATEGORY="article"
|
|
52
|
+
TYPE="update"
|
|
53
|
+
;;
|
|
54
|
+
esac
|
|
55
|
+
|
|
56
|
+
# Determine repo from changed files
|
|
57
|
+
REPO="one"
|
|
58
|
+
if echo "$COMMIT_FILES" | grep -q "^web/"; then
|
|
59
|
+
REPO="web"
|
|
60
|
+
elif echo "$COMMIT_FILES" | grep -q "^backend/"; then
|
|
61
|
+
REPO="backend"
|
|
62
|
+
elif echo "$COMMIT_FILES" | grep -q "^cli/"; then
|
|
63
|
+
REPO="cli"
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Generate descriptive slug from commit message
|
|
67
|
+
# Remove type prefix, convert to lowercase, replace spaces with hyphens
|
|
68
|
+
SLUG=$(echo "$COMMIT_MESSAGE" | \
|
|
69
|
+
sed -E 's/^(feat|fix|docs|refactor|perf|test|chore|style|build|ci)[:(]//i' | \
|
|
70
|
+
sed -E 's/\)://g' | \
|
|
71
|
+
sed -E 's/[^a-zA-Z0-9 -]//g' | \
|
|
72
|
+
tr '[:upper:]' '[:lower:]' | \
|
|
73
|
+
tr -s ' ' '-' | \
|
|
74
|
+
sed 's/^-//;s/-$//' | \
|
|
75
|
+
cut -c1-60)
|
|
76
|
+
|
|
77
|
+
# Create news file path (slug only, no date in filename)
|
|
78
|
+
NEWS_FILE="$NEWS_DIR/${SLUG}.md"
|
|
79
|
+
|
|
80
|
+
# Skip if file already exists
|
|
81
|
+
if [ -f "$NEWS_FILE" ]; then
|
|
82
|
+
echo "✓ News article already exists: $SLUG.md"
|
|
83
|
+
exit 0
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Prepare context for agent-writer
|
|
87
|
+
CONTEXT=$(cat <<EOF
|
|
88
|
+
# News Article Request
|
|
89
|
+
|
|
90
|
+
## Commit Information
|
|
91
|
+
|
|
92
|
+
**Message:** $COMMIT_MESSAGE
|
|
93
|
+
**Hash:** $COMMIT_HASH
|
|
94
|
+
**Date:** $COMMIT_DATE
|
|
95
|
+
**Type:** $COMMIT_TYPE
|
|
96
|
+
**Category:** $CATEGORY
|
|
97
|
+
**Repo:** $REPO
|
|
98
|
+
|
|
99
|
+
## Files Changed
|
|
100
|
+
|
|
101
|
+
\`\`\`
|
|
102
|
+
$COMMIT_FILES
|
|
103
|
+
\`\`\`
|
|
104
|
+
|
|
105
|
+
## Stats
|
|
106
|
+
|
|
107
|
+
$COMMIT_STATS
|
|
108
|
+
|
|
109
|
+
## Your Task
|
|
110
|
+
|
|
111
|
+
Write an engaging news article about this change for \`web/src/content/news/${SLUG}.md\`.
|
|
112
|
+
|
|
113
|
+
**Requirements:**
|
|
114
|
+
1. Use today's date ($COMMIT_DATE) in frontmatter
|
|
115
|
+
2. Follow the agent-writer voice guidelines (authority, humor, warmth, education)
|
|
116
|
+
3. Make it newsworthy—focus on user benefits, not just code changes
|
|
117
|
+
4. Include practical examples where relevant
|
|
118
|
+
5. Keep it scannable (short paragraphs, headers, code blocks)
|
|
119
|
+
6. Write in the style of Alex Hormozi, Wired, Ars Technica, Fast Company
|
|
120
|
+
|
|
121
|
+
**Frontmatter template:**
|
|
122
|
+
|
|
123
|
+
\`\`\`yaml
|
|
124
|
+
---
|
|
125
|
+
title: "[Benefit-Focused Headline]"
|
|
126
|
+
date: $COMMIT_DATE
|
|
127
|
+
description: "One-sentence value proposition"
|
|
128
|
+
author: "ONE Platform Team"
|
|
129
|
+
type: "$TYPE"
|
|
130
|
+
tags: ["tag1", "tag2", "tag3"]
|
|
131
|
+
category: "$CATEGORY"
|
|
132
|
+
repo: "$REPO"
|
|
133
|
+
draft: false
|
|
134
|
+
---
|
|
135
|
+
\`\`\`
|
|
136
|
+
|
|
137
|
+
**Article structure:**
|
|
138
|
+
1. **What Changed** - Clear explanation of the update
|
|
139
|
+
2. **Why This Matters** - Connect to user needs/pain points
|
|
140
|
+
3. **How It Works** - Technical details with examples
|
|
141
|
+
4. **What You Can Do Now** - Clear next steps
|
|
142
|
+
|
|
143
|
+
Make it compelling. Make people care.
|
|
144
|
+
EOF
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
# Create temporary file for agent-writer output
|
|
148
|
+
TEMP_FILE=$(mktemp)
|
|
149
|
+
|
|
150
|
+
# Write context to temp file
|
|
151
|
+
echo "$CONTEXT" > "$TEMP_FILE"
|
|
152
|
+
|
|
153
|
+
echo ""
|
|
154
|
+
echo "📝 Generating news article for: $COMMIT_MESSAGE"
|
|
155
|
+
echo " File: $SLUG.md"
|
|
156
|
+
echo " Category: $CATEGORY"
|
|
157
|
+
echo " Repo: $REPO"
|
|
158
|
+
echo ""
|
|
159
|
+
|
|
160
|
+
# Note: This hook prepares the context but doesn't auto-generate
|
|
161
|
+
# To enable auto-generation, uncomment the following and install Claude Code CLI:
|
|
162
|
+
|
|
163
|
+
# # Invoke agent-writer via Claude Code (if available)
|
|
164
|
+
# if command -v claude &> /dev/null; then
|
|
165
|
+
# claude task --agent agent-writer --prompt "$(cat $TEMP_FILE)" --output "$NEWS_FILE"
|
|
166
|
+
# if [ $? -eq 0 ]; then
|
|
167
|
+
# echo "✓ News article generated: $NEWS_FILE"
|
|
168
|
+
# # Stage the new file
|
|
169
|
+
# git add "$NEWS_FILE"
|
|
170
|
+
# else
|
|
171
|
+
# echo "✗ Failed to generate news article"
|
|
172
|
+
# fi
|
|
173
|
+
# else
|
|
174
|
+
# echo "⚠️ Claude Code CLI not found. To enable auto-generation:"
|
|
175
|
+
# echo " 1. Install Claude Code CLI"
|
|
176
|
+
# echo " 2. Uncomment the generation code in .claude/hooks/write-news.sh"
|
|
177
|
+
# fi
|
|
178
|
+
|
|
179
|
+
# Manual workflow for now
|
|
180
|
+
echo "📋 Context prepared. To generate the article:"
|
|
181
|
+
echo ""
|
|
182
|
+
echo " Ask Claude Code:"
|
|
183
|
+
echo " 'Use agent-writer to create a news article from this commit:'"
|
|
184
|
+
echo " Then paste this context or run:"
|
|
185
|
+
echo ""
|
|
186
|
+
echo " cat $TEMP_FILE"
|
|
187
|
+
echo ""
|
|
188
|
+
echo " Save output to: $NEWS_FILE"
|
|
189
|
+
echo ""
|
|
190
|
+
|
|
191
|
+
# Keep temp file for manual use
|
|
192
|
+
echo "$TEMP_FILE" > "$HOOKS_DIR/.last-news-context"
|
|
193
|
+
|
|
194
|
+
exit 0
|