claudekit-cli 1.0.0 → 1.1.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/.github/workflows/ci.yml +2 -0
- package/CHANGELOG.md +19 -0
- package/CLAUDE.md +7 -0
- package/README.md +61 -3
- package/biome.json +3 -0
- package/dist/index.js +102 -0
- package/package.json +1 -1
- package/src/commands/version.ts +135 -0
- package/src/index.ts +11 -0
- package/src/types.ts +7 -0
- package/tests/commands/version.test.ts +297 -0
- package/.claude/agents/brainstormer.md +0 -96
- package/.claude/agents/code-reviewer.md +0 -141
- package/.claude/agents/copywriter.md +0 -108
- package/.claude/agents/database-admin.md +0 -86
- package/.claude/agents/debugger.md +0 -124
- package/.claude/agents/docs-manager.md +0 -115
- package/.claude/agents/git-manager.md +0 -60
- package/.claude/agents/journal-writer.md +0 -111
- package/.claude/agents/planner.md +0 -87
- package/.claude/agents/project-manager.md +0 -113
- package/.claude/agents/researcher.md +0 -173
- package/.claude/agents/scout.md +0 -123
- package/.claude/agents/tester.md +0 -95
- package/.claude/agents/ui-ux-designer.md +0 -206
- package/.claude/commands/bootstrap.md +0 -104
- package/.claude/commands/brainstorm.md +0 -67
- package/.claude/commands/content/enhance.md +0 -13
- package/.claude/commands/content/fast.md +0 -11
- package/.claude/commands/content/good.md +0 -13
- package/.claude/commands/cook.md +0 -19
- package/.claude/commands/debug.md +0 -10
- package/.claude/commands/design/3d.md +0 -65
- package/.claude/commands/design/describe.md +0 -13
- package/.claude/commands/design/fast.md +0 -19
- package/.claude/commands/design/good.md +0 -23
- package/.claude/commands/design/screenshot.md +0 -23
- package/.claude/commands/design/video.md +0 -23
- package/.claude/commands/docs/init.md +0 -13
- package/.claude/commands/docs/summarize.md +0 -10
- package/.claude/commands/docs/update.md +0 -21
- package/.claude/commands/fix/ci.md +0 -11
- package/.claude/commands/fix/fast.md +0 -12
- package/.claude/commands/fix/hard.md +0 -18
- package/.claude/commands/fix/logs.md +0 -16
- package/.claude/commands/fix/test.md +0 -18
- package/.claude/commands/fix/types.md +0 -10
- package/.claude/commands/git/cm.md +0 -5
- package/.claude/commands/git/cp.md +0 -4
- package/.claude/commands/integrate/polar.md +0 -42
- package/.claude/commands/plan/ci.md +0 -12
- package/.claude/commands/plan/two.md +0 -13
- package/.claude/commands/plan.md +0 -10
- package/.claude/commands/scout.md +0 -29
- package/.claude/commands/test.md +0 -7
- package/.claude/commands/watzup.md +0 -8
- package/.claude/hooks/telegram_notify.sh +0 -136
- package/.claude/send-discord.sh +0 -64
- package/.claude/settings.json +0 -7
- package/.claude/statusline.sh +0 -143
- package/.claude/workflows/development-rules.md +0 -80
- package/.claude/workflows/documentation-management.md +0 -28
- package/.claude/workflows/orchestration-protocol.md +0 -16
- package/.claude/workflows/primary-workflow.md +0 -41
- package/.opencode/agent/code-reviewer.md +0 -141
- package/.opencode/agent/debugger.md +0 -74
- package/.opencode/agent/docs-manager.md +0 -119
- package/.opencode/agent/git-manager.md +0 -60
- package/.opencode/agent/planner-researcher.md +0 -100
- package/.opencode/agent/planner.md +0 -87
- package/.opencode/agent/project-manager.md +0 -113
- package/.opencode/agent/researcher.md +0 -173
- package/.opencode/agent/solution-brainstormer.md +0 -89
- package/.opencode/agent/system-architecture.md +0 -192
- package/.opencode/agent/tester.md +0 -96
- package/.opencode/agent/ui-ux-designer.md +0 -203
- package/.opencode/agent/ui-ux-developer.md +0 -97
- package/.opencode/command/cook.md +0 -7
- package/.opencode/command/debug.md +0 -10
- package/.opencode/command/design/3d.md +0 -65
- package/.opencode/command/design/fast.md +0 -18
- package/.opencode/command/design/good.md +0 -21
- package/.opencode/command/design/screenshot.md +0 -22
- package/.opencode/command/design/video.md +0 -22
- package/.opencode/command/docs/init.md +0 -11
- package/.opencode/command/docs/summarize.md +0 -10
- package/.opencode/command/docs/update.md +0 -18
- package/.opencode/command/fix/ci.md +0 -8
- package/.opencode/command/fix/fast.md +0 -11
- package/.opencode/command/fix/hard.md +0 -15
- package/.opencode/command/fix/logs.md +0 -16
- package/.opencode/command/fix/test.md +0 -18
- package/.opencode/command/fix/types.md +0 -10
- package/.opencode/command/git/cm.md +0 -5
- package/.opencode/command/git/cp.md +0 -4
- package/.opencode/command/plan/ci.md +0 -12
- package/.opencode/command/plan/two.md +0 -13
- package/.opencode/command/plan.md +0 -10
- package/.opencode/command/test.md +0 -7
- package/.opencode/command/watzup.md +0 -8
- package/docs/code-standards.md +0 -1128
- package/docs/codebase-summary.md +0 -821
- package/docs/github-setup.md +0 -176
- package/docs/project-pdr.md +0 -739
- package/docs/system-architecture.md +0 -950
- package/docs/tech-stack.md +0 -290
- package/plans/251008-claudekit-cli-implementation-plan.md +0 -1469
- package/plans/reports/251008-from-code-reviewer-to-developer-review-report.md +0 -864
- package/plans/reports/251008-from-tester-to-developer-test-summary-report.md +0 -409
- package/plans/reports/251008-researcher-download-extraction-report.md +0 -1377
- package/plans/reports/251008-researcher-github-api-report.md +0 -1339
- package/plans/research/251008-cli-frameworks-bun-research.md +0 -1051
- package/plans/templates/bug-fix-template.md +0 -69
- package/plans/templates/feature-implementation-template.md +0 -84
- package/plans/templates/refactor-template.md +0 -82
- package/plans/templates/template-usage-guide.md +0 -58
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze the codebase and update documentation
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Use `docs-manager` agent to analyze the codebase and update `docs/codebase-summary.md`
|
|
6
|
-
|
|
7
|
-
## Notes:
|
|
8
|
-
- Use `docs/` directory as the source of truth for documentation.
|
|
9
|
-
|
|
10
|
-
**IMPORTANT**: **Do not** start implementing.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze the codebase and update documentation
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Use `docs/` directory as the source of truth for documentation.
|
|
6
|
-
Use `docs-manager` agent to analyze the codebase and update documentation:
|
|
7
|
-
- `README.md`: Update README
|
|
8
|
-
- `docs/project-overview-pdr.md`: Update project overview and PDR (Product Development Requirements)
|
|
9
|
-
- `docs/codebase-summary.md`: Update codebase summary
|
|
10
|
-
- `docs/code-standards.md`: Update codebase structure and code standards
|
|
11
|
-
- `docs/system-architecture.md`: Update system architecture
|
|
12
|
-
- `docs/project-roadmap.md`: Update project roadmap
|
|
13
|
-
- `docs/deployment-guide.md` [optional]: Update deployment guide
|
|
14
|
-
- `docs/design-guidelines.md` [optional]: Update design guidelines
|
|
15
|
-
|
|
16
|
-
## Additional requests
|
|
17
|
-
<additional_requests>
|
|
18
|
-
$ARGUMENTS
|
|
19
|
-
</additional_requests>
|
|
20
|
-
|
|
21
|
-
**IMPORTANT**: **Do not** start implementing.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze Github Actions logs and fix issues
|
|
3
|
-
---
|
|
4
|
-
## Github Actions URL
|
|
5
|
-
<url>$ARGUMENTS</url>
|
|
6
|
-
|
|
7
|
-
## Workflow
|
|
8
|
-
- Use the `planer-researcher` to read the github actions logs, analyze and find the root causes of the issues, then provide a detailed plan for implementing the fixes.
|
|
9
|
-
- Use proper developer agents to implement the plan.
|
|
10
|
-
- Use `tester` agent to run the tests, make sure it works, then report back to main agent.
|
|
11
|
-
- If there are issues or failed tests, ask main agent to fix all of them and repeat the process until all tests pass.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze and fix the issue [FAST]
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Analyze and fix this issue:
|
|
6
|
-
<issue>$ARGUMENTS</issue>
|
|
7
|
-
|
|
8
|
-
## Workflow
|
|
9
|
-
|
|
10
|
-
- If the user provides a screenshots or videos, use `eyes_analyze` tool from Human MCP to describe as detailed as possible the issue, make sure developers can predict the root causes easily based on the description.
|
|
11
|
-
- Use `tester` agent to test the fix and make sure it works, then report back to main agent.
|
|
12
|
-
- If there are issues or failed tests, ask main agent to fix all of them and repeat the process until all tests pass.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Use subagents to plan and fix hard issues
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Ultrathink to plan & start fixing these issues follow the Orchestration Protocol, Core Responsibilities, Subagents Team and Development Rules:
|
|
6
|
-
<issues>$ARGUMENTS</issues>
|
|
7
|
-
|
|
8
|
-
## Workflow:
|
|
9
|
-
|
|
10
|
-
If the user provides a screenshots or videos, use `eyes_analyze` tool from Human MCP to describe as detailed as possible the issue, make sure developers can predict the root causes easily based on the description.
|
|
11
|
-
|
|
12
|
-
1. Use `planner` subagent and `researcher` subagent to create a implementation plan with TODO tasks in `./plans` directory.
|
|
13
|
-
2. Then use general agent (main agent) to implement the plan step by step.
|
|
14
|
-
3. Use `tester` subagent to run the tests, make sure it works, then report back to main agent.
|
|
15
|
-
4. If there are issues or failed tests, use `debugger` subagent to find the root cause of the issues, then ask main agent to fix all of them and
|
|
16
|
-
5. Repeat the process until all tests pass or no more issues are reported.
|
|
17
|
-
6. After finishing, delegate to `code-reviewer` subagent to review code. If there are critical issues, ask main agent to improve the code and test everything again.
|
|
18
|
-
7. Report back to user with a summary of the changes and explain everything briefly.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze logs and fix issues
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Use `debugger` agent to analyze the `./logs.txt` file, identify root causes of any errors or issues and respond with a report and solution.
|
|
6
|
-
So the main agent can fix them.
|
|
7
|
-
|
|
8
|
-
## Rules
|
|
9
|
-
|
|
10
|
-
- Use `debugger` agent to read and analyze the entire `./logs.txt` file
|
|
11
|
-
- Identify all errors, warnings, and potential issues
|
|
12
|
-
- Determine the root causes of each issue
|
|
13
|
-
- Fix all identified problems systematically based on the report
|
|
14
|
-
- Verify fixes by running appropriate commands
|
|
15
|
-
- Re-analyze logs after fixes to ensure issues are resolved
|
|
16
|
-
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Run test suite and fix issues
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Reported Issues:
|
|
6
|
-
<issue>
|
|
7
|
-
$ARGUMENTS
|
|
8
|
-
</issue>
|
|
9
|
-
|
|
10
|
-
## Workflow:
|
|
11
|
-
1. First use `tester` subagent to compile the code and fix all syntax errors if any.
|
|
12
|
-
2. Then use `tester` subagent to run the tests.
|
|
13
|
-
3. If there are issues or failed tests, use `debugger` subagent to find the root cause of the issues.
|
|
14
|
-
4. Then use `planner` subagent to create a implementation plan with TODO tasks in `./plans` directory.
|
|
15
|
-
5. Then implement the plan step by step.
|
|
16
|
-
6. Use `tester` subagent to run the tests after implementing the plan, make sure it works, then report back to main agent.
|
|
17
|
-
7. After finishing, delegate to `code-reviewer` agent to review code. If there are critical issues, ask main agent to improve the code and test everything again.
|
|
18
|
-
8. Repeat this process until all tests pass and no more errors are reported.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Implement payment integration with Polar.sh
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
Think harder to plan & start implementing payment integration with [Polar.sh](https://polar.sh/docs/llms-full.txt) follow the Orchestration Protocol, Core Responsibilities, Subagents Team and Development Rules:
|
|
6
|
-
<tasks>$ARGUMENTS</tasks>
|
|
7
|
-
|
|
8
|
-
## Workflow:
|
|
9
|
-
|
|
10
|
-
### Fullfill the request
|
|
11
|
-
|
|
12
|
-
* If you don't have any questions, skip this step and go to `Planning` step.
|
|
13
|
-
* If you have any questions, ask the user to clarify them.
|
|
14
|
-
* Ask 1 question at a time, wait for the user to answer before moving to the next question.
|
|
15
|
-
* Repeat this process until you have all the information you need to proceed.
|
|
16
|
-
|
|
17
|
-
### Planning
|
|
18
|
-
|
|
19
|
-
1. Use `planner` subagent to read the Polar.sh docs and create a implementation plan with TODO tasks in `./plans` directory.
|
|
20
|
-
2. Ask user to review and approve the plan, if the user requests to change the plan, repeat the previous step until the user approves the plan.
|
|
21
|
-
|
|
22
|
-
### Implementation
|
|
23
|
-
|
|
24
|
-
1. When user approves the plan, use **general agent (main agent)** to implement the plan step by step.
|
|
25
|
-
2. Run type checking and compile the code to make sure there are no syntax errors.
|
|
26
|
-
|
|
27
|
-
### Testing & Code Review
|
|
28
|
-
|
|
29
|
-
5. Write the tests for the plan, make sure you don't use fake data just to pass the tests, tests should be real and cover all possible cases.
|
|
30
|
-
6. Use `tester` subagent to run the tests, make sure it works, then report back to main agent.
|
|
31
|
-
7. If there are issues or failed tests, use `debugger` subagent to find the root cause of the issues, then ask main agent to fix all of them and
|
|
32
|
-
8. Repeat the process until all tests pass or no more issues are reported. Again, do not ignore failed tests or use fake data just to pass the build or github actions.
|
|
33
|
-
9. When all tests pass, delegate to `code-reviewer` subagent to review code. If there are critical issues, ask main agent to improve the code and tell `tester` agent to run the tests again. Repeat the process until all tests pass.
|
|
34
|
-
10. When all code is reviewed, the tasks are completed, report back to user with a summary of the changes and explain everything briefly, ask user to review the changes and approve them.
|
|
35
|
-
|
|
36
|
-
### Documentation
|
|
37
|
-
|
|
38
|
-
11. If user approves the changes, use `docs-manager` subagent to update the docs if needed.
|
|
39
|
-
|
|
40
|
-
### Final Report
|
|
41
|
-
|
|
42
|
-
12. Report back to user with a summary of the changes and explain everything briefly, guide user to get started and suggest the next steps.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Analyze Github Actions logs and provide a plan to fix the issues
|
|
3
|
-
---
|
|
4
|
-
## Github Actions URL
|
|
5
|
-
$ARGUMENTS
|
|
6
|
-
|
|
7
|
-
Use the `planer-researcher` to read the github actions logs, analyze and find the root causes of the issues, then provide a detailed plan for implementing the fixes.
|
|
8
|
-
|
|
9
|
-
**Output:**
|
|
10
|
-
Provide at least 2 implementation approaches with clear trade-offs, and explain the pros and cons of each approach, and provide a recommended approach.
|
|
11
|
-
|
|
12
|
-
**IMPORTANT:** Ask the user for confirmation before implementing.
|
|
@@ -1,13 +0,0 @@
|
|
|
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.
|
package/.claude/commands/plan.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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.
|
package/.claude/commands/test.md
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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.
|
|
@@ -1,136 +0,0 @@
|
|
|
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
|
package/.claude/send-discord.sh
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
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
|
package/.claude/settings.json
DELETED
package/.claude/statusline.sh
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
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
|