cc-discipline 2.9.0 → 2.10.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/bin/cli.js +2 -0
- package/init.sh +63 -5
- package/package.json +1 -1
- package/templates/.claude/skills/self-check/SKILL.md +5 -0
package/bin/cli.js
CHANGED
|
@@ -131,9 +131,11 @@ Examples:
|
|
|
131
131
|
|
|
132
132
|
// Run the bash script
|
|
133
133
|
const unixScript = toUnixPath(script);
|
|
134
|
+
const pkgVersion = require(path.join(PKG_DIR, 'package.json')).version;
|
|
134
135
|
const env = {
|
|
135
136
|
...process.env,
|
|
136
137
|
CC_DISCIPLINE_PKG_DIR: process.platform === 'win32' ? toUnixPath(PKG_DIR) : PKG_DIR,
|
|
138
|
+
CC_DISCIPLINE_VERSION: pkgVersion,
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
const result = spawnSync(bash, [unixScript, ...scriptArgs], {
|
package/init.sh
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
# cd your-project && bash /path/to/init.sh --stack "3 4" --name myapp --global
|
|
6
6
|
# Or: curl -sL https://raw.githubusercontent.com/YOU/cc-discipline/main/init.sh | bash
|
|
7
7
|
|
|
8
|
-
set -e
|
|
8
|
+
# On Windows (Git Bash), set -e causes silent failures due to path/command differences.
|
|
9
|
+
# Use explicit error checking for critical operations instead.
|
|
10
|
+
if [[ "$(uname -s)" != MINGW* ]] && [[ "$(uname -s)" != MSYS* ]]; then
|
|
11
|
+
set -e
|
|
12
|
+
fi
|
|
9
13
|
|
|
10
|
-
# ─── Version
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
# ─── Version ───
|
|
15
|
+
# cli.js sets CC_DISCIPLINE_VERSION on Windows where node paths are tricky
|
|
16
|
+
VERSION="${CC_DISCIPLINE_VERSION:-unknown}"
|
|
17
|
+
if [ "$VERSION" = "unknown" ]; then
|
|
18
|
+
_INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
if command -v node &>/dev/null && [ -f "$_INIT_DIR/package.json" ]; then
|
|
20
|
+
VERSION=$(node -p "require('$_INIT_DIR/package.json').version" 2>/dev/null) || true
|
|
21
|
+
fi
|
|
14
22
|
fi
|
|
15
23
|
VERSION="${VERSION:-unknown}"
|
|
16
24
|
|
|
@@ -460,6 +468,56 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
|
460
468
|
echo -e "${GREEN} ✓ Global rules installed${NC}"
|
|
461
469
|
fi
|
|
462
470
|
|
|
471
|
+
# ─── Install status line (optional) ───
|
|
472
|
+
GLOBAL_SETTINGS="$HOME/.claude/settings.json"
|
|
473
|
+
HAS_STATUSLINE=false
|
|
474
|
+
if [ -f "$GLOBAL_SETTINGS" ] && command -v jq &>/dev/null; then
|
|
475
|
+
if jq -e '.statusLine' "$GLOBAL_SETTINGS" &>/dev/null; then
|
|
476
|
+
HAS_STATUSLINE=true
|
|
477
|
+
fi
|
|
478
|
+
elif [ -f "$GLOBAL_SETTINGS" ] && grep -q '"statusLine"' "$GLOBAL_SETTINGS" 2>/dev/null; then
|
|
479
|
+
HAS_STATUSLINE=true
|
|
480
|
+
fi
|
|
481
|
+
|
|
482
|
+
if [ "$HAS_STATUSLINE" = false ]; then
|
|
483
|
+
if [ "$ARG_AUTO" = true ]; then
|
|
484
|
+
# Auto mode: skip statusline (don't install without asking)
|
|
485
|
+
true
|
|
486
|
+
else
|
|
487
|
+
echo ""
|
|
488
|
+
echo -e "${BLUE}Install ccstatusline? (shows model, context %, git branch in terminal)${NC}"
|
|
489
|
+
echo " This adds a status line to all Claude Code sessions via ~/.claude/settings.json"
|
|
490
|
+
read -p "Install status line? (y/N) " -n 1 -r
|
|
491
|
+
echo
|
|
492
|
+
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
493
|
+
mkdir -p ~/.claude
|
|
494
|
+
if [ -f "$GLOBAL_SETTINGS" ]; then
|
|
495
|
+
# Merge statusLine into existing settings
|
|
496
|
+
if command -v jq &>/dev/null; then
|
|
497
|
+
EXISTING=$(cat "$GLOBAL_SETTINGS")
|
|
498
|
+
echo "$EXISTING" | jq '. + {"statusLine": {"type": "command", "command": "npx -y ccstatusline@latest", "padding": 0}}' > "$GLOBAL_SETTINGS"
|
|
499
|
+
else
|
|
500
|
+
# No jq — warn user to add manually
|
|
501
|
+
echo -e "${YELLOW} jq not found — please add statusLine to ~/.claude/settings.json manually:${NC}"
|
|
502
|
+
echo ' "statusLine": {"type": "command", "command": "npx -y ccstatusline@latest", "padding": 0}'
|
|
503
|
+
fi
|
|
504
|
+
else
|
|
505
|
+
# No existing settings — create new
|
|
506
|
+
cat > "$GLOBAL_SETTINGS" <<'SEOF'
|
|
507
|
+
{
|
|
508
|
+
"statusLine": {
|
|
509
|
+
"type": "command",
|
|
510
|
+
"command": "npx -y ccstatusline@latest",
|
|
511
|
+
"padding": 0
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
SEOF
|
|
515
|
+
fi
|
|
516
|
+
echo -e "${GREEN} ✓ Status line installed (run 'npx -y ccstatusline@latest' once to configure widgets)${NC}"
|
|
517
|
+
fi
|
|
518
|
+
fi
|
|
519
|
+
fi
|
|
520
|
+
|
|
463
521
|
# ─── Write version marker ───
|
|
464
522
|
echo "$VERSION" > .claude/.cc-discipline-version
|
|
465
523
|
|
package/package.json
CHANGED
|
@@ -30,6 +30,7 @@ Pause and honestly answer every question below. Do NOT skip any. Do NOT rational
|
|
|
30
30
|
- Have I blamed an external tool/library/PDK without ruling out my own mistakes first?
|
|
31
31
|
- Have I altered or paraphrased tool output instead of quoting verbatim?
|
|
32
32
|
- Is there anything I stated confidently but am actually unsure about?
|
|
33
|
+
- Am I suggesting to compact, start a new session, or "continue tomorrow"? If so — is context actually full (you can't see the percentage, so the answer is NO), or am I using it as an excuse to escape difficulty? **Context anxiety is not a valid reason to stop working. Re-read progress.md and keep going.**
|
|
33
34
|
- If yes to any: **correct it now. Label uncertain claims as "unverified" or "assumption". Downgrade false ✅ to ⚠️ with reason.**
|
|
34
35
|
|
|
35
36
|
## 4. Am I respecting scope?
|
|
@@ -75,3 +76,7 @@ Issues found: [list, or "none"]
|
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
If any issues were found, stop working and report to the user before continuing.
|
|
79
|
+
|
|
80
|
+
## Reminder
|
|
81
|
+
|
|
82
|
+
If this self-check revealed problems — that's OK. It means the check is working. The work you're doing is complex, and complex work hits obstacles. That's normal, not a sign of failure. The user chose you for hard problems — easy ones don't need you. Take a breath, address what the check found, and keep going with care and focus. Steady, deliberate progress on hard problems is where you provide the most value.
|