claudekit-cli 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.
- package/.claude/agents/brainstormer.md +96 -0
- package/.claude/agents/code-reviewer.md +141 -0
- package/.claude/agents/copywriter.md +108 -0
- package/.claude/agents/database-admin.md +86 -0
- package/.claude/agents/debugger.md +124 -0
- package/.claude/agents/docs-manager.md +115 -0
- package/.claude/agents/git-manager.md +60 -0
- package/.claude/agents/journal-writer.md +111 -0
- package/.claude/agents/planner.md +87 -0
- package/.claude/agents/project-manager.md +113 -0
- package/.claude/agents/researcher.md +173 -0
- package/.claude/agents/scout.md +123 -0
- package/.claude/agents/tester.md +95 -0
- package/.claude/agents/ui-ux-designer.md +206 -0
- package/.claude/commands/bootstrap.md +104 -0
- package/.claude/commands/brainstorm.md +67 -0
- package/.claude/commands/content/enhance.md +13 -0
- package/.claude/commands/content/fast.md +11 -0
- package/.claude/commands/content/good.md +13 -0
- package/.claude/commands/cook.md +19 -0
- package/.claude/commands/debug.md +10 -0
- package/.claude/commands/design/3d.md +65 -0
- package/.claude/commands/design/describe.md +13 -0
- package/.claude/commands/design/fast.md +19 -0
- package/.claude/commands/design/good.md +23 -0
- package/.claude/commands/design/screenshot.md +23 -0
- package/.claude/commands/design/video.md +23 -0
- package/.claude/commands/docs/init.md +13 -0
- package/.claude/commands/docs/summarize.md +10 -0
- package/.claude/commands/docs/update.md +21 -0
- package/.claude/commands/fix/ci.md +11 -0
- package/.claude/commands/fix/fast.md +12 -0
- package/.claude/commands/fix/hard.md +18 -0
- package/.claude/commands/fix/logs.md +16 -0
- package/.claude/commands/fix/test.md +18 -0
- package/.claude/commands/fix/types.md +10 -0
- package/.claude/commands/git/cm.md +5 -0
- package/.claude/commands/git/cp.md +4 -0
- package/.claude/commands/integrate/polar.md +42 -0
- package/.claude/commands/plan/ci.md +12 -0
- package/.claude/commands/plan/two.md +13 -0
- package/.claude/commands/plan.md +10 -0
- package/.claude/commands/scout.md +29 -0
- package/.claude/commands/test.md +7 -0
- package/.claude/commands/watzup.md +8 -0
- package/.claude/hooks/telegram_notify.sh +136 -0
- package/.claude/send-discord.sh +64 -0
- package/.claude/settings.json +7 -0
- package/.claude/statusline.sh +143 -0
- package/.claude/workflows/development-rules.md +80 -0
- package/.claude/workflows/documentation-management.md +28 -0
- package/.claude/workflows/orchestration-protocol.md +16 -0
- package/.claude/workflows/primary-workflow.md +41 -0
- package/.github/workflows/ci.yml +43 -0
- package/.github/workflows/release.yml +58 -0
- package/.opencode/agent/code-reviewer.md +141 -0
- package/.opencode/agent/debugger.md +74 -0
- package/.opencode/agent/docs-manager.md +119 -0
- package/.opencode/agent/git-manager.md +60 -0
- package/.opencode/agent/planner-researcher.md +100 -0
- package/.opencode/agent/planner.md +87 -0
- package/.opencode/agent/project-manager.md +113 -0
- package/.opencode/agent/researcher.md +173 -0
- package/.opencode/agent/solution-brainstormer.md +89 -0
- package/.opencode/agent/system-architecture.md +192 -0
- package/.opencode/agent/tester.md +96 -0
- package/.opencode/agent/ui-ux-designer.md +203 -0
- package/.opencode/agent/ui-ux-developer.md +97 -0
- package/.opencode/command/cook.md +7 -0
- package/.opencode/command/debug.md +10 -0
- package/.opencode/command/design/3d.md +65 -0
- package/.opencode/command/design/fast.md +18 -0
- package/.opencode/command/design/good.md +21 -0
- package/.opencode/command/design/screenshot.md +22 -0
- package/.opencode/command/design/video.md +22 -0
- package/.opencode/command/docs/init.md +11 -0
- package/.opencode/command/docs/summarize.md +10 -0
- package/.opencode/command/docs/update.md +18 -0
- package/.opencode/command/fix/ci.md +8 -0
- package/.opencode/command/fix/fast.md +11 -0
- package/.opencode/command/fix/hard.md +15 -0
- package/.opencode/command/fix/logs.md +16 -0
- package/.opencode/command/fix/test.md +18 -0
- package/.opencode/command/fix/types.md +10 -0
- package/.opencode/command/git/cm.md +5 -0
- package/.opencode/command/git/cp.md +4 -0
- package/.opencode/command/plan/ci.md +12 -0
- package/.opencode/command/plan/two.md +13 -0
- package/.opencode/command/plan.md +10 -0
- package/.opencode/command/test.md +7 -0
- package/.opencode/command/watzup.md +8 -0
- package/.releaserc.json +17 -0
- package/.repomixignore +15 -0
- package/AGENTS.md +217 -0
- package/CHANGELOG.md +16 -0
- package/CLAUDE.md +33 -0
- package/README.md +214 -0
- package/biome.json +25 -0
- package/bun.lock +1238 -0
- package/dist/index.js +19100 -0
- package/docs/code-standards.md +1128 -0
- package/docs/codebase-summary.md +821 -0
- package/docs/github-setup.md +176 -0
- package/docs/project-pdr.md +739 -0
- package/docs/system-architecture.md +950 -0
- package/docs/tech-stack.md +290 -0
- package/package.json +60 -0
- package/plans/251008-claudekit-cli-implementation-plan.md +1469 -0
- package/plans/reports/251008-from-code-reviewer-to-developer-review-report.md +864 -0
- package/plans/reports/251008-from-tester-to-developer-test-summary-report.md +409 -0
- package/plans/reports/251008-researcher-download-extraction-report.md +1377 -0
- package/plans/reports/251008-researcher-github-api-report.md +1339 -0
- package/plans/research/251008-cli-frameworks-bun-research.md +1051 -0
- package/plans/templates/bug-fix-template.md +69 -0
- package/plans/templates/feature-implementation-template.md +84 -0
- package/plans/templates/refactor-template.md +82 -0
- package/plans/templates/template-usage-guide.md +58 -0
- package/src/commands/new.ts +118 -0
- package/src/commands/update.ts +114 -0
- package/src/index.ts +44 -0
- package/src/lib/auth.ts +157 -0
- package/src/lib/download.ts +180 -0
- package/src/lib/github.ts +157 -0
- package/src/lib/merge.ts +116 -0
- package/src/lib/prompts.ts +113 -0
- package/src/types.ts +149 -0
- package/src/utils/config.ts +87 -0
- package/src/utils/logger.ts +37 -0
- package/tests/lib/auth.test.ts +116 -0
- package/tests/lib/download.test.ts +70 -0
- package/tests/lib/github.test.ts +52 -0
- package/tests/lib/merge.test.ts +138 -0
- package/tests/lib/prompts.test.ts +66 -0
- package/tests/types.test.ts +255 -0
- package/tests/utils/config.test.ts +263 -0
- package/tests/utils/logger.test.ts +124 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Research & create an implementation plan with 2 approaches
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Use the `planner` subagent to plan for this task:
|
|
6
|
+
<task>
|
|
7
|
+
$ARGUMENTS
|
|
8
|
+
</task>
|
|
9
|
+
|
|
10
|
+
**Output:**
|
|
11
|
+
Provide at least 2 implementation approaches with clear trade-offs, and explain the pros and cons of each approach, and provide a recommended approach.
|
|
12
|
+
|
|
13
|
+
**IMPORTANT**: **Do not** start implementing.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Scout given directories to respond to the user's requests
|
|
3
|
+
argument-hint: [user-prompt] [scale]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
Search the codebase for files needed to complete the task using a fast, token efficient agent.
|
|
9
|
+
|
|
10
|
+
## User's requests & target directories
|
|
11
|
+
<user_requests>$ARGUMENTS</user_requests>
|
|
12
|
+
|
|
13
|
+
## Variables
|
|
14
|
+
|
|
15
|
+
USER_PROMPT: $1
|
|
16
|
+
SCALE: $2 (defaults to 3)
|
|
17
|
+
RELEVANT_FILE_OUTPUT_DIR: `plans/scouts/`
|
|
18
|
+
|
|
19
|
+
## Workflow:
|
|
20
|
+
- Write a prompt for 'SCALE' number of agents to the Task tool that will immediately call the Bash tool to run these commands to kick off your agents to conduct the search:
|
|
21
|
+
- `gemini -p "[prompt]" --model gemini-2.5-flash-preview-09-2025`
|
|
22
|
+
- `opencode run "[prompt]" --model opencode/grok-code` (if count > 3)
|
|
23
|
+
|
|
24
|
+
**How to prompt the agents:**
|
|
25
|
+
- IMPORTANT: Kick these agents off in parallel using the Task tool, analyze and divide folders for each agent to scout intelligently and quickly.
|
|
26
|
+
- IMPORTANT: These agents are calling OTHER agentic coding tools to search the codebase. DO NOT call any search tools yourself.
|
|
27
|
+
- IMPORTANT: That means with the Task tool, you'll immediately call the Bash tool to run the respective agentic coding tool (gemini, opencode, claude, etc.)
|
|
28
|
+
- IMPORTANT: Instruct the agents to quickly search the codebase for files needed to complete the task. This isn't about a full blown search, just a quick search to find the files needed to complete the task.
|
|
29
|
+
- Instruct the subagent to use a timeout of 3 minutes for each agent's bash call. Skip any agents that don't return within the timeout, don't restart them.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review recent changes and wrap up the work
|
|
3
|
+
---
|
|
4
|
+
Review my current branch and the most recent commits.
|
|
5
|
+
Provide a detailed summary of all changes, including what was modified, added, or removed.
|
|
6
|
+
Analyze the overall impact and quality of the changes.
|
|
7
|
+
|
|
8
|
+
**IMPORTANT**: **Do not** start implementing.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Telegram Notification Hook for Claude Code (Project-Specific)
|
|
4
|
+
# This hook sends a notification to Telegram when Claude finishes a task
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Read JSON input from stdin
|
|
9
|
+
INPUT=$(cat)
|
|
10
|
+
|
|
11
|
+
# Extract relevant information from the hook input
|
|
12
|
+
HOOK_TYPE=$(echo "$INPUT" | jq -r '.hookType // "unknown"')
|
|
13
|
+
PROJECT_DIR=$(echo "$INPUT" | jq -r '.projectDir // ""')
|
|
14
|
+
TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S')
|
|
15
|
+
SESSION_ID=$(echo "$INPUT" | jq -r '.sessionId // ""')
|
|
16
|
+
PROJECT_NAME=$(basename "$PROJECT_DIR")
|
|
17
|
+
|
|
18
|
+
# Configuration - these will be set via environment variables
|
|
19
|
+
TELEGRAM_BOT_TOKEN="${TELEGRAM_BOT_TOKEN:-}"
|
|
20
|
+
TELEGRAM_CHAT_ID="${TELEGRAM_CHAT_ID:-}"
|
|
21
|
+
|
|
22
|
+
# Validate required environment variables
|
|
23
|
+
if [[ -z "$TELEGRAM_BOT_TOKEN" ]]; then
|
|
24
|
+
echo "Error: TELEGRAM_BOT_TOKEN environment variable not set" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
|
|
28
|
+
if [[ -z "$TELEGRAM_CHAT_ID" ]]; then
|
|
29
|
+
echo "Error: TELEGRAM_CHAT_ID environment variable not set" >&2
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Function to send Telegram message
|
|
34
|
+
send_telegram_message() {
|
|
35
|
+
local message="$1"
|
|
36
|
+
local url="https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage"
|
|
37
|
+
|
|
38
|
+
# Escape special characters for JSON
|
|
39
|
+
local escaped_message=$(echo "$message" | jq -Rs .)
|
|
40
|
+
|
|
41
|
+
local payload=$(cat <<EOF
|
|
42
|
+
{
|
|
43
|
+
"chat_id": "${TELEGRAM_CHAT_ID}",
|
|
44
|
+
"text": ${escaped_message},
|
|
45
|
+
"parse_mode": "Markdown",
|
|
46
|
+
"disable_web_page_preview": true
|
|
47
|
+
}
|
|
48
|
+
EOF
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
curl -s -X POST \
|
|
52
|
+
-H "Content-Type: application/json" \
|
|
53
|
+
-d "$payload" \
|
|
54
|
+
"$url" > /dev/null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
# Generate summary based on hook type
|
|
58
|
+
case "$HOOK_TYPE" in
|
|
59
|
+
"Stop")
|
|
60
|
+
# Extract tool usage summary
|
|
61
|
+
TOOLS_USED=$(echo "$INPUT" | jq -r '.toolsUsed[]?.tool // empty' | sort | uniq -c | sort -nr)
|
|
62
|
+
FILES_MODIFIED=$(echo "$INPUT" | jq -r '.toolsUsed[]? | select(.tool == "Edit" or .tool == "Write" or .tool == "MultiEdit") | .parameters.file_path // empty' | sort | uniq)
|
|
63
|
+
|
|
64
|
+
# Count operations
|
|
65
|
+
TOTAL_TOOLS=$(echo "$INPUT" | jq '.toolsUsed | length')
|
|
66
|
+
|
|
67
|
+
# Build summary message
|
|
68
|
+
MESSAGE="🚀 *DevPocket Task Completed*
|
|
69
|
+
|
|
70
|
+
📅 *Time:* ${TIMESTAMP}
|
|
71
|
+
📁 *Project:* ${PROJECT_NAME}
|
|
72
|
+
🔧 *Total Operations:* ${TOTAL_TOOLS}
|
|
73
|
+
🆔 *Session:* ${SESSION_ID:0:8}...
|
|
74
|
+
|
|
75
|
+
*Tools Used:*"
|
|
76
|
+
|
|
77
|
+
if [[ -n "$TOOLS_USED" ]]; then
|
|
78
|
+
MESSAGE="${MESSAGE}
|
|
79
|
+
\`\`\`
|
|
80
|
+
${TOOLS_USED}
|
|
81
|
+
\`\`\`"
|
|
82
|
+
else
|
|
83
|
+
MESSAGE="${MESSAGE}
|
|
84
|
+
None"
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
if [[ -n "$FILES_MODIFIED" ]]; then
|
|
88
|
+
MESSAGE="${MESSAGE}
|
|
89
|
+
|
|
90
|
+
*Files Modified:*"
|
|
91
|
+
while IFS= read -r file; do
|
|
92
|
+
if [[ -n "$file" ]]; then
|
|
93
|
+
# Show relative path from project root
|
|
94
|
+
relative_file=$(echo "$file" | sed "s|^${PROJECT_DIR}/||")
|
|
95
|
+
MESSAGE="${MESSAGE}
|
|
96
|
+
• ${relative_file}"
|
|
97
|
+
fi
|
|
98
|
+
done <<< "$FILES_MODIFIED"
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
MESSAGE="${MESSAGE}
|
|
102
|
+
|
|
103
|
+
📍 *Location:* \`${PROJECT_DIR}\`"
|
|
104
|
+
;;
|
|
105
|
+
|
|
106
|
+
"SubagentStop")
|
|
107
|
+
SUBAGENT_TYPE=$(echo "$INPUT" | jq -r '.subagentType // "unknown"')
|
|
108
|
+
MESSAGE="🤖 *DevPocket Subagent Completed*
|
|
109
|
+
|
|
110
|
+
📅 *Time:* ${TIMESTAMP}
|
|
111
|
+
📁 *Project:* ${PROJECT_NAME}
|
|
112
|
+
🔧 *Agent Type:* ${SUBAGENT_TYPE}
|
|
113
|
+
🆔 *Session:* ${SESSION_ID:0:8}...
|
|
114
|
+
|
|
115
|
+
Specialized agent completed its task.
|
|
116
|
+
|
|
117
|
+
📍 *Location:* \`${PROJECT_DIR}\`"
|
|
118
|
+
;;
|
|
119
|
+
|
|
120
|
+
*)
|
|
121
|
+
MESSAGE="📝 *DevPocket Code Event*
|
|
122
|
+
|
|
123
|
+
📅 *Time:* ${TIMESTAMP}
|
|
124
|
+
📁 *Project:* ${PROJECT_NAME}
|
|
125
|
+
📋 *Event:* ${HOOK_TYPE}
|
|
126
|
+
🆔 *Session:* ${SESSION_ID:0:8}...
|
|
127
|
+
|
|
128
|
+
📍 *Location:* \`${PROJECT_DIR}\`"
|
|
129
|
+
;;
|
|
130
|
+
esac
|
|
131
|
+
|
|
132
|
+
# Send the notification
|
|
133
|
+
send_telegram_message "$MESSAGE"
|
|
134
|
+
|
|
135
|
+
# Log the notification (optional)
|
|
136
|
+
echo "Telegram notification sent for $HOOK_TYPE event in project $PROJECT_NAME" >&2
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Usage: ./send-discord.sh 'Your message here'
|
|
4
|
+
# Note: Remember to escape the string
|
|
5
|
+
|
|
6
|
+
# Load environment variables from .env file
|
|
7
|
+
if [[ -f .env ]]; then
|
|
8
|
+
echo "Loading .env file..."
|
|
9
|
+
set -a # automatically export all variables
|
|
10
|
+
source .env
|
|
11
|
+
set +a # turn off automatic export
|
|
12
|
+
echo "✅ Environment loaded, DISCORD_WEBHOOK_URL=$(echo ${DISCORD_WEBHOOK_URL:0:50}...)"
|
|
13
|
+
else
|
|
14
|
+
echo "Warning: .env file not found"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
message="$1"
|
|
18
|
+
|
|
19
|
+
if [[ -z "$DISCORD_WEBHOOK_URL" ]]; then
|
|
20
|
+
echo "⚠️ Discord notification skipped: DISCORD_WEBHOOK_URL not set"
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Prepare message for Discord (Discord markdown supports \n)
|
|
25
|
+
discord_message="$message"
|
|
26
|
+
|
|
27
|
+
# Discord embeds for richer formatting
|
|
28
|
+
payload=$(cat <<EOF
|
|
29
|
+
{
|
|
30
|
+
"embeds": [{
|
|
31
|
+
"title": "🤖 Claude Code Session Complete",
|
|
32
|
+
"description": "$discord_message",
|
|
33
|
+
"color": 5763719,
|
|
34
|
+
"timestamp": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
|
|
35
|
+
"footer": {
|
|
36
|
+
"text": "DevPocket API • $(basename "$(pwd)")"
|
|
37
|
+
},
|
|
38
|
+
"fields": [
|
|
39
|
+
{
|
|
40
|
+
"name": "⏰ Session Time",
|
|
41
|
+
"value": "$(date '+%H:%M:%S')",
|
|
42
|
+
"inline": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "📂 Project",
|
|
46
|
+
"value": "$(basename "$(pwd)")",
|
|
47
|
+
"inline": true
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}]
|
|
51
|
+
}
|
|
52
|
+
EOF
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
curl -s -X POST "$DISCORD_WEBHOOK_URL" \
|
|
56
|
+
-H "Content-Type: application/json" \
|
|
57
|
+
-d "$payload" >/dev/null 2>&1
|
|
58
|
+
|
|
59
|
+
if [[ $? -eq 0 ]]; then
|
|
60
|
+
echo "✅ Discord notification sent"
|
|
61
|
+
else
|
|
62
|
+
echo "❌ Failed to send Discord notification"
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Generated by cc-statusline (https://www.npmjs.com/package/@chongdashu/cc-statusline)
|
|
3
|
+
# Custom Claude Code statusline - Created: 2025-08-19T05:45:09.773Z
|
|
4
|
+
# Theme: detailed | Colors: true | Features: directory, git, model, usage, session, tokens
|
|
5
|
+
|
|
6
|
+
input=$(cat)
|
|
7
|
+
|
|
8
|
+
# ---- color helpers (TTY-aware, respect NO_COLOR) ----
|
|
9
|
+
use_color=1
|
|
10
|
+
[ -t 1 ] || use_color=0
|
|
11
|
+
[ -n "$NO_COLOR" ] && use_color=0
|
|
12
|
+
|
|
13
|
+
C() { if [ "$use_color" -eq 1 ]; then printf '\033[%sm' "$1"; fi; }
|
|
14
|
+
RST() { if [ "$use_color" -eq 1 ]; then printf '\033[0m'; fi; }
|
|
15
|
+
|
|
16
|
+
# ---- basic colors ----
|
|
17
|
+
dir_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;36m'; fi; } # cyan
|
|
18
|
+
model_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;35m'; fi; } # magenta
|
|
19
|
+
version_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;33m'; fi; } # yellow
|
|
20
|
+
rst() { if [ "$use_color" -eq 1 ]; then printf '\033[0m'; fi; }
|
|
21
|
+
|
|
22
|
+
# ---- time helpers ----
|
|
23
|
+
to_epoch() {
|
|
24
|
+
ts="$1"
|
|
25
|
+
if command -v gdate >/dev/null 2>&1; then gdate -d "$ts" +%s 2>/dev/null && return; fi
|
|
26
|
+
date -u -j -f "%Y-%m-%dT%H:%M:%S%z" "${ts/Z/+0000}" +%s 2>/dev/null && return
|
|
27
|
+
python3 - "$ts" <<'PY' 2>/dev/null
|
|
28
|
+
import sys, datetime
|
|
29
|
+
s=sys.argv[1].replace('Z','+00:00')
|
|
30
|
+
print(int(datetime.datetime.fromisoformat(s).timestamp()))
|
|
31
|
+
PY
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fmt_time_hm() {
|
|
35
|
+
epoch="$1"
|
|
36
|
+
if date -r 0 +%s >/dev/null 2>&1; then date -r "$epoch" +"%H:%M"; else date -d "@$epoch" +"%H:%M"; fi
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
progress_bar() {
|
|
40
|
+
pct="${1:-0}"; width="${2:-10}"
|
|
41
|
+
[[ "$pct" =~ ^[0-9]+$ ]] || pct=0; ((pct<0))&&pct=0; ((pct>100))&&pct=100
|
|
42
|
+
filled=$(( pct * width / 100 )); empty=$(( width - filled ))
|
|
43
|
+
printf '%*s' "$filled" '' | tr ' ' '='
|
|
44
|
+
printf '%*s' "$empty" '' | tr ' ' '-'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# git utilities
|
|
48
|
+
num_or_zero() { v="$1"; [[ "$v" =~ ^[0-9]+$ ]] && echo "$v" || echo 0; }
|
|
49
|
+
|
|
50
|
+
# ---- basics ----
|
|
51
|
+
if command -v jq >/dev/null 2>&1; then
|
|
52
|
+
current_dir=$(echo "$input" | jq -r '.workspace.current_dir // .cwd // "unknown"' 2>/dev/null | sed "s|^$HOME|~|g")
|
|
53
|
+
model_name=$(echo "$input" | jq -r '.model.display_name // "Claude"' 2>/dev/null)
|
|
54
|
+
model_version=$(echo "$input" | jq -r '.model.version // ""' 2>/dev/null)
|
|
55
|
+
else
|
|
56
|
+
current_dir="unknown"
|
|
57
|
+
model_name="Claude"; model_version=""
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# ---- git colors ----
|
|
61
|
+
git_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;32m'; fi; }
|
|
62
|
+
rst() { if [ "$use_color" -eq 1 ]; then printf '\033[0m'; fi; }
|
|
63
|
+
|
|
64
|
+
# ---- git ----
|
|
65
|
+
git_branch=""
|
|
66
|
+
if git rev-parse --git-dir >/dev/null 2>&1; then
|
|
67
|
+
git_branch=$(git branch --show-current 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
# ---- usage colors ----
|
|
71
|
+
usage_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;35m'; fi; }
|
|
72
|
+
cost_color() { if [ "$use_color" -eq 1 ]; then printf '\033[1;36m'; fi; }
|
|
73
|
+
session_color() {
|
|
74
|
+
rem_pct=$(( 100 - session_pct ))
|
|
75
|
+
if (( rem_pct <= 10 )); then SCLR='1;31'
|
|
76
|
+
elif (( rem_pct <= 25 )); then SCLR='1;33'
|
|
77
|
+
else SCLR='1;32'; fi
|
|
78
|
+
if [ "$use_color" -eq 1 ]; then printf '\033[%sm' "$SCLR"; fi
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# ---- ccusage integration ----
|
|
82
|
+
session_txt=""; session_pct=0; session_bar=""
|
|
83
|
+
cost_usd=""; cost_per_hour=""; tpm=""; tot_tokens=""
|
|
84
|
+
|
|
85
|
+
if command -v jq >/dev/null 2>&1; then
|
|
86
|
+
blocks_output=$(npx ccusage@latest blocks --json 2>/dev/null || ccusage blocks --json 2>/dev/null)
|
|
87
|
+
if [ -n "$blocks_output" ]; then
|
|
88
|
+
active_block=$(echo "$blocks_output" | jq -c '.blocks[] | select(.isActive == true)' 2>/dev/null | head -n1)
|
|
89
|
+
if [ -n "$active_block" ]; then
|
|
90
|
+
cost_usd=$(echo "$active_block" | jq -r '.costUSD // empty')
|
|
91
|
+
cost_per_hour=$(echo "$active_block" | jq -r '.burnRate.costPerHour // empty')
|
|
92
|
+
tot_tokens=$(echo "$active_block" | jq -r '.totalTokens // empty')
|
|
93
|
+
|
|
94
|
+
# Session time calculation
|
|
95
|
+
reset_time_str=$(echo "$active_block" | jq -r '.usageLimitResetTime // .endTime // empty')
|
|
96
|
+
start_time_str=$(echo "$active_block" | jq -r '.startTime // empty')
|
|
97
|
+
|
|
98
|
+
if [ -n "$reset_time_str" ] && [ -n "$start_time_str" ]; then
|
|
99
|
+
start_sec=$(to_epoch "$start_time_str"); end_sec=$(to_epoch "$reset_time_str"); now_sec=$(date +%s)
|
|
100
|
+
total=$(( end_sec - start_sec )); (( total<1 )) && total=1
|
|
101
|
+
elapsed=$(( now_sec - start_sec )); (( elapsed<0 ))&&elapsed=0; (( elapsed>total ))&&elapsed=$total
|
|
102
|
+
session_pct=$(( elapsed * 100 / total ))
|
|
103
|
+
remaining=$(( end_sec - now_sec )); (( remaining<0 )) && remaining=0
|
|
104
|
+
rh=$(( remaining / 3600 )); rm=$(( (remaining % 3600) / 60 ))
|
|
105
|
+
end_hm=$(fmt_time_hm "$end_sec")
|
|
106
|
+
session_txt="$(printf '%dh %dm until reset at %s (%d%%)' "$rh" "$rm" "$end_hm" "$session_pct")"
|
|
107
|
+
session_bar=$(progress_bar "$session_pct" 10)
|
|
108
|
+
fi
|
|
109
|
+
fi
|
|
110
|
+
fi
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
# ---- render statusline ----
|
|
114
|
+
printf '📁 %s%s%s' "$(dir_color)" "$current_dir" "$(rst)"
|
|
115
|
+
# git display
|
|
116
|
+
if [ -n "$git_branch" ]; then
|
|
117
|
+
printf ' 🌿 %s%s%s' "$(git_color)" "$git_branch" "$(rst)"
|
|
118
|
+
fi
|
|
119
|
+
printf ' 🤖 %s%s%s' "$(model_color)" "$model_name" "$(rst)"
|
|
120
|
+
if [ -n "$model_version" ] && [ "$model_version" != "null" ]; then
|
|
121
|
+
printf ' 🏷️ %s%s%s' "$(version_color)" "$model_version" "$(rst)"
|
|
122
|
+
fi
|
|
123
|
+
# session time
|
|
124
|
+
if [ -n "$session_txt" ]; then
|
|
125
|
+
printf ' ⌛ %s%s%s' "$(session_color)" "$session_txt" "$(rst)"
|
|
126
|
+
printf ' %s[%s]%s' "$(session_color)" "$session_bar" "$(rst)"
|
|
127
|
+
fi
|
|
128
|
+
# cost
|
|
129
|
+
if [ -n "$cost_usd" ] && [[ "$cost_usd" =~ ^[0-9.]+$ ]]; then
|
|
130
|
+
if [ -n "$cost_per_hour" ] && [[ "$cost_per_hour" =~ ^[0-9.]+$ ]]; then
|
|
131
|
+
printf ' 💵 %s$%.2f ($%.2f/h)%s' "$(cost_color)" "$cost_usd" "$cost_per_hour" "$(rst)"
|
|
132
|
+
else
|
|
133
|
+
printf ' 💵 %s$%.2f%s' "$(cost_color)" "$cost_usd" "$(rst)"
|
|
134
|
+
fi
|
|
135
|
+
fi
|
|
136
|
+
# tokens
|
|
137
|
+
if [ -n "$tot_tokens" ] && [[ "$tot_tokens" =~ ^[0-9]+$ ]]; then
|
|
138
|
+
if [ -n "$tpm" ] && [[ "$tpm" =~ ^[0-9.]+$ ]] && false; then
|
|
139
|
+
printf ' 📊 %s%s tok (%.0f tpm)%s' "$(usage_color)" "$tot_tokens" "$tpm" "$(rst)"
|
|
140
|
+
else
|
|
141
|
+
printf ' 📊 %s%s tok%s' "$(usage_color)" "$tot_tokens" "$(rst)"
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Development Rules
|
|
2
|
+
|
|
3
|
+
## General
|
|
4
|
+
- **File Size Management**: Keep individual code files under 500 lines for optimal context management
|
|
5
|
+
- Split large files into smaller, focused components
|
|
6
|
+
- Use composition over inheritance for complex widgets
|
|
7
|
+
- Extract utility functions into separate modules
|
|
8
|
+
- Create dedicated service classes for business logic
|
|
9
|
+
- Use `context7` mcp tools for exploring latest docs of plugins/packages
|
|
10
|
+
- Use `gh` bash command to interact with Github features.
|
|
11
|
+
- Use `psql` bash command to query database for debugging.
|
|
12
|
+
- Use `eyes` mcp tools for describing details of images, videos, documents, etc.
|
|
13
|
+
- Use `hands` mcp tools for generating images, videos, documents, etc.
|
|
14
|
+
- Use `brain` mcp tools for sequential thinking, analyzing code, debugging, etc.
|
|
15
|
+
- **[IMPORTANT]** Follow the codebase structure and code standards in `./docs` during implementation
|
|
16
|
+
- **[IMPORTANT]** When you finish the implementation, send a full summary report to Discord channel with `./.claude/send-discord.sh 'Your message here'` script (remember to escape the string).
|
|
17
|
+
- **[IMPORTANT]** Do not just simulate the implementation or mocking them, always implement the real code.
|
|
18
|
+
|
|
19
|
+
## Architecture Guidelines
|
|
20
|
+
|
|
21
|
+
### Core Principles
|
|
22
|
+
|
|
23
|
+
**YAGNI (You Aren't Gonna Need It)**
|
|
24
|
+
- Only implement what's needed now
|
|
25
|
+
- No speculative features
|
|
26
|
+
- Simple, focused solutions
|
|
27
|
+
|
|
28
|
+
**KISS (Keep It Simple, Stupid)**
|
|
29
|
+
- Straightforward logic
|
|
30
|
+
- No over-engineering
|
|
31
|
+
- Readable code
|
|
32
|
+
|
|
33
|
+
**DRY (Don't Repeat Yourself)**
|
|
34
|
+
- Reusable components
|
|
35
|
+
- Extract common patterns
|
|
36
|
+
- Centralized logic
|
|
37
|
+
|
|
38
|
+
## Subagents
|
|
39
|
+
Delegate detailed tasks to these subagents according to their roles & expertises:
|
|
40
|
+
- Use file system (in markdown format) to hand over reports in `./plans/reports` directory from agent to agent with this file name format: `YYMMDD-from-agent-name-to-agent-name-task-name-report.md`.
|
|
41
|
+
- Use `planner` agent to plan for the implementation plan using templates in `./plans/templates/` (`planner` agent can spawn multiple `researcher` agents in parallel to explore different approaches with "Query Fan-Out" technique).
|
|
42
|
+
- Use `database-admin` agent to run tests and analyze the summary report.
|
|
43
|
+
- Use `tester` agent to run tests and analyze the summary report.
|
|
44
|
+
- Use `debugger` agent to collect logs in server or github actions to analyze the summary report.
|
|
45
|
+
- Use `code-reviewer` agent to review code according to the implementation plan.
|
|
46
|
+
- Use `docs-manager` agent to update docs in `./docs` directory if any (espcially for `./docs/codebase-summary.md` when significant changes are made).
|
|
47
|
+
- Use `git-manager` agent to commit and push code changes.
|
|
48
|
+
- Use `project-manager` agent for project's progress tracking, completion verification & TODO status management.
|
|
49
|
+
- **[IMPORTANT]** Always delegate to `project-manager` agent after completing significant features, major milestones, or when requested to update project documentation.
|
|
50
|
+
- **IMPORTANT:** You can intelligently spawn multiple subagents **in parallel** or **chain them sequentially** to handle the tasks efficiently.
|
|
51
|
+
|
|
52
|
+
## Code Quality Guidelines
|
|
53
|
+
- Read and follow codebase structure and code standards in `./docs`
|
|
54
|
+
- Don't be too harsh on code linting, but make sure there are no syntax errors and code are compilable
|
|
55
|
+
- Prioritize functionality and readability over strict style enforcement and code formatting
|
|
56
|
+
- Use reasonable code quality standards that enhance developer productivity
|
|
57
|
+
- Use try catch error handling & cover security standards
|
|
58
|
+
- Use `code-reviewer` agent to review code after every implementation
|
|
59
|
+
|
|
60
|
+
## Pre-commit/Push Rules
|
|
61
|
+
- Run linting before commit
|
|
62
|
+
- Run tests before push (DO NOT ignore failed tests just to pass the build or github actions)
|
|
63
|
+
- Keep commits focused on the actual code changes
|
|
64
|
+
- **DO NOT** commit and push any confidential information (such as dotenv files, API keys, database credentials, etc.) to git repository!
|
|
65
|
+
- NEVER automatically add AI attribution signatures like:
|
|
66
|
+
"🤖 Generated with [Claude Code]"
|
|
67
|
+
"Co-Authored-By: Claude noreply@anthropic.com"
|
|
68
|
+
Any AI tool attribution or signature
|
|
69
|
+
- Create clean, professional commit messages without AI references. Use conventional commit format.
|
|
70
|
+
|
|
71
|
+
## Code Implementation
|
|
72
|
+
|
|
73
|
+
- Before you start, delegate to `planner` agent to create a implementation plan with TODO tasks in `./plans` directory.
|
|
74
|
+
- When in planning phase, use multiple `researcher` agents in parallel to conduct research on different relevant technical topics and report back to `planner` agent to create implementation plan.
|
|
75
|
+
- Write clean, readable, and maintainable code
|
|
76
|
+
- Follow established architectural patterns
|
|
77
|
+
- Implement features according to specifications
|
|
78
|
+
- Handle edge cases and error scenarios
|
|
79
|
+
- **DO NOT** create new enhanced files, update to the existing files directly.
|
|
80
|
+
- **[IMPORTANT]** After creating or modifying code file, run compile command/script to check for any compile errors.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Project Documentation Management
|
|
2
|
+
|
|
3
|
+
### Roadmap & Changelog Maintenance
|
|
4
|
+
- **Project Roadmap** (`./docs/development-roadmap.md`): Living document tracking project phases, milestones, and progress
|
|
5
|
+
- **Project Changelog** (`./docs/project-changelog.md`): Detailed record of all significant changes, features, and fixes
|
|
6
|
+
- **System Architecture** (`./docs/system-architecture.md`): Detailed record of all significant changes, features, and fixes
|
|
7
|
+
- **Code Standards** (`./docs/code-standards.md`): Detailed record of all significant changes, features, and fixes
|
|
8
|
+
|
|
9
|
+
### Automatic Updates Required
|
|
10
|
+
- **After Feature Implementation**: Update roadmap progress status and changelog entries
|
|
11
|
+
- **After Major Milestones**: Review and adjust roadmap phases, update success metrics
|
|
12
|
+
- **After Bug Fixes**: Document fixes in changelog with severity and impact
|
|
13
|
+
- **After Security Updates**: Record security improvements and version updates
|
|
14
|
+
- **Weekly Reviews**: Update progress percentages and milestone statuses
|
|
15
|
+
|
|
16
|
+
### Documentation Triggers
|
|
17
|
+
The `project-manager` agent MUST update these documents when:
|
|
18
|
+
- A development phase status changes (e.g., from "In Progress" to "Complete")
|
|
19
|
+
- Major features are implemented or released
|
|
20
|
+
- Significant bugs are resolved or security patches applied
|
|
21
|
+
- Project timeline or scope adjustments are made
|
|
22
|
+
- External dependencies or breaking changes occur
|
|
23
|
+
|
|
24
|
+
### Update Protocol
|
|
25
|
+
1. **Before Updates**: Always read current roadmap and changelog status
|
|
26
|
+
2. **During Updates**: Maintain version consistency and proper formatting
|
|
27
|
+
3. **After Updates**: Verify links, dates, and cross-references are accurate
|
|
28
|
+
4. **Quality Check**: Ensure updates align with actual implementation progress
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Orchestration Protocol
|
|
2
|
+
|
|
3
|
+
#### Sequential Chaining
|
|
4
|
+
Chain subagents when tasks have dependencies or require outputs from previous steps:
|
|
5
|
+
- **Planning → Implementation → Testing → Review**: Use for feature development
|
|
6
|
+
- **Research → Design → Code → Documentation**: Use for new system components
|
|
7
|
+
- Each agent completes fully before the next begins
|
|
8
|
+
- Pass context and outputs between agents in the chain
|
|
9
|
+
|
|
10
|
+
#### Parallel Execution
|
|
11
|
+
Spawn multiple subagents simultaneously for independent tasks:
|
|
12
|
+
- **Code + Tests + Docs**: When implementing separate, non-conflicting components
|
|
13
|
+
- **Multiple Feature Branches**: Different agents working on isolated features
|
|
14
|
+
- **Cross-platform Development**: iOS and Android specific implementations
|
|
15
|
+
- **Careful Coordination**: Ensure no file conflicts or shared resource contention
|
|
16
|
+
- **Merge Strategy**: Plan integration points before parallel execution begins
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Primary Workflow
|
|
2
|
+
|
|
3
|
+
#### 1. Code Implementation
|
|
4
|
+
- Before you start, delegate to `planner` agent to create a implementation plan with TODO tasks in `./plans` directory.
|
|
5
|
+
- When in planning phase, use multiple `researcher` agents in parallel to conduct research on different relevant technical topics and report back to `planner` agent to create implementation plan.
|
|
6
|
+
- Write clean, readable, and maintainable code
|
|
7
|
+
- Follow established architectural patterns
|
|
8
|
+
- Implement features according to specifications
|
|
9
|
+
- Handle edge cases and error scenarios
|
|
10
|
+
- **DO NOT** create new enhanced files, update to the existing files directly.
|
|
11
|
+
- **[IMPORTANT]** After creating or modifying code file, run compile command/script to check for any compile errors.
|
|
12
|
+
|
|
13
|
+
#### 2. Testing
|
|
14
|
+
- Delegate to `tester` agent to run tests and analyze the summary report.
|
|
15
|
+
- Write comprehensive unit tests
|
|
16
|
+
- Ensure high code coverage
|
|
17
|
+
- Test error scenarios
|
|
18
|
+
- Validate performance requirements
|
|
19
|
+
- Tests are critical for ensuring code quality and reliability, **DO NOT** ignore failing tests just to pass the build.
|
|
20
|
+
- **IMPORTANT:** Always fix failing tests follow the recommendations and delegate to `tester` agent to run tests again, only finish your session when all tests pass.
|
|
21
|
+
|
|
22
|
+
#### 3. Code Quality
|
|
23
|
+
- After finish implementation, delegate to `code-reviewer` agent to review code.
|
|
24
|
+
- Follow coding standards and conventions
|
|
25
|
+
- Write self-documenting code
|
|
26
|
+
- Add meaningful comments for complex logic
|
|
27
|
+
- Optimize for performance and maintainability
|
|
28
|
+
|
|
29
|
+
#### 4. Integration
|
|
30
|
+
- Always follow the plan given by `planner` agent
|
|
31
|
+
- Ensure seamless integration with existing code
|
|
32
|
+
- Follow API contracts precisely
|
|
33
|
+
- Maintain backward compatibility
|
|
34
|
+
- Document breaking changes
|
|
35
|
+
- Delegate to `docs-manager` agent to update docs in `./docs` directory if any.
|
|
36
|
+
|
|
37
|
+
#### 5. Debugging
|
|
38
|
+
- When a user report bugs or issues on the server or a CI/CD pipeline, delegate to `debugger` agent to run tests and analyze the summary report.
|
|
39
|
+
- Read the summary report from `debugger` agent and implement the fix.
|
|
40
|
+
- Delegate to `tester` agent to run tests and analyze the summary report.
|
|
41
|
+
- If the `tester` agent reports failed tests, fix them follow the recommendations.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
- master
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
test:
|
|
15
|
+
name: Test
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repository
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Setup Bun
|
|
23
|
+
uses: oven-sh/setup-bun@v2
|
|
24
|
+
with:
|
|
25
|
+
bun-version: latest
|
|
26
|
+
|
|
27
|
+
- name: Install system dependencies
|
|
28
|
+
run: sudo apt-get update && sudo apt-get install -y libsecret-1-dev
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: bun install --frozen-lockfile
|
|
32
|
+
|
|
33
|
+
- name: Run type check
|
|
34
|
+
run: bun run typecheck
|
|
35
|
+
|
|
36
|
+
- name: Run linter
|
|
37
|
+
run: bun run lint
|
|
38
|
+
|
|
39
|
+
- name: Run tests
|
|
40
|
+
run: bun test
|
|
41
|
+
|
|
42
|
+
- name: Build
|
|
43
|
+
run: bun run build
|