Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .claude/commands/commit-user.md

This file was deleted.

43 changes: 13 additions & 30 deletions .claude/commands/session-commit.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,31 @@
---
allowed-tools: Bash(git *), Read, Edit, Write
description: Stage changes, update progress log, and commit (end-of-session)
allowed-tools: Bash(git *)
description: Stage changes and commit (end-of-session)
---

# Session Commit

Automate end-of-session cleanup: stage, log progress, commit.
Automate end-of-session cleanup: stage and commit.

## Steps

1. **Assess changes** run these in parallel:
1. **Assess changes** -- run these in parallel:
- `git status`
- `git diff HEAD`
- `git branch --show-current`
- `git log --oneline -10`

2. **Stage everything** if there are unstaged or untracked changes:
2. **Stage everything** -- if there are unstaged or untracked changes:
- Use `git add <specific-files>` (not `git add .`)
- Never stage files that likely contain secrets (.env, credentials, etc.)
- Skip if everything is already staged

3. **Update progress log** — read `docs/claude-progress.txt`, then prepend a new entry at the top (after the header line) following the format in `docs/references/claude-progress-readme.md`.
- Analyze the staged diff to determine what was done
- Use today's actual date
- Be concise but complete
- Stage the updated file: `git add docs/claude-progress.txt`
3. **Draft and commit** -- follow all rules from `docs/references/commit-message-guide.md`:
- Subject: `<type>: <description>`, imperative mood
- Body is optional if the subject is descriptive enough, otherwise explain what and why
- No em dashes anywhere in the message

4. **Migrate blockers** — if the progress entry you just wrote has a `Blockers:` line that is NOT `None`:
- Read `docs/agent-struggles.json`
- For each blocker, append an entry:

```json
{
"date": "<today>",
"description": "<blocker text from progress entry>",
"cause": "<your best short assessment>",
"suggestion": "<what would fix or prevent this>",
"resolved": false
}
```

- Stage: `git add docs/agent-struggles.json`

5. **Draft and commit** — follow all rules from `docs/references/commit-message-guide.md`. Determine authorship mode (tandem vs autonomous) from the guide. Use a HEREDOC:
Determine authorship mode (tandem vs autonomous) from the guide. Use a HEREDOC:

```bash
git commit -m "$(cat <<'EOF'
Expand All @@ -55,11 +38,11 @@ Automate end-of-session cleanup: stage, log progress, commit.
)"
```

6. **Verify** run `git status` and `git log --oneline -1` to confirm success.
4. **Verify** -- run `git status` and `git log --oneline -1` to confirm success. If the commit fails due to the commit-msg hook, read the error output, fix the message, and create a NEW commit (never amend).

## Rules

- Analyze the FULL diff for accurate progress and commit message
- Analyze the FULL diff for an accurate commit message
- Never commit secrets or sensitive files
- If commit fails due to pre-commit hook, fix and create a NEW commit (never amend)
- If commit fails due to pre-commit or commit-msg hook, fix and create a NEW commit (never amend)
- Do NOT push to remote
45 changes: 45 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env sh

MSG_FILE="$1"

# Strip comment lines
MSG=$(grep -v '^#' "$MSG_FILE")

SUBJECT=$(echo "$MSG" | head -1)

# Skip merge, fixup, and squash commits
case "$SUBJECT" in
Merge\ branch\ *|Merge\ remote-tracking\ *|Merge\ tag\ *) exit 0 ;;
fixup\!\ *|squash\!\ *) exit 0 ;;
esac

ERRORS=""

# 1. Conventional commit format
TYPES="feat|fix|refactor|docs|test|chore|style|perf|ci|build"
if ! echo "$SUBJECT" | grep -qE "^($TYPES): .+"; then
ERRORS="$ERRORS
Subject must match '<type>: <description>'.
Types: feat, fix, refactor, docs, test, chore, style, perf, ci, build"
fi

# 2. Authorship trailer
if ! echo "$MSG" | grep -qE '^(Co-Authored-By|Signed-off-by): .+'; then
ERRORS="$ERRORS
Missing authorship trailer (Co-Authored-By or Signed-off-by)."
fi

# 3. No em dashes
if echo "$MSG" | grep -q '—'; then
ERRORS="$ERRORS
Em dashes are not allowed. Use commas, periods, or parentheses."
fi

if [ -n "$ERRORS" ]; then
echo ""
echo "commit-msg: FAILED"
echo "$ERRORS"
echo ""
echo "See docs/references/commit-message-guide.md for rules."
exit 1
fi
12 changes: 12 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

yarn lint
yarn type-check

cd backend
go vet ./...
if [ -n "$(gofmt -l .)" ]; then
echo "Go files not formatted. Run: gofmt -w backend/"
gofmt -l .
exit 1
fi
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"cypress-merge": "mochawesome-merge ./integration-tests/screenshots/cypress_report*.json > ./integration-tests/screenshots/cypress.json",
"cypress-generate": "marge -o ./integration-tests/screenshots/ -f cypress-report -t 'OpenShift Console Plugin Template Cypress Test Results' -p 'OpenShift Cypress Plugin Template Test Results' --showPassed false --assetsDir ./integration-tests/screenshots/cypress/assets ./integration-tests/screenshots/cypress.json",
"cypress-postreport": "yarn cypress-merge && yarn cypress-generate",
"type-check": "tsc --noEmit",
"prepare": "husky",
"webpack": "node -r ts-node/register ./node_modules/.bin/webpack"
},
"devDependencies": {
Expand Down Expand Up @@ -55,6 +57,7 @@
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^17.4.0",
"husky": "^9.1.7",
"i18next": "^23.11.5",
"i18next-parser": "^9.4.0",
"jsdom": "^29.0.2",
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"strict": true,
"allowSyntheticDefaultImports": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"types": ["vitest/globals"]
},
"include": ["src", "testing"],
Expand Down
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5559,6 +5559,7 @@ __metadata:
eslint-plugin-react: "npm:^7.37.5"
eslint-plugin-react-hooks: "npm:^7.0.1"
globals: "npm:^17.4.0"
husky: "npm:^9.1.7"
i18next: "npm:^23.11.5"
i18next-parser: "npm:^9.4.0"
jsdom: "npm:^29.0.2"
Expand Down Expand Up @@ -8987,6 +8988,15 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^9.1.7":
version: 9.1.7
resolution: "husky@npm:9.1.7"
bin:
husky: bin.js
checksum: 10c0/35bb110a71086c48906aa7cd3ed4913fb913823715359d65e32e0b964cb1e255593b0ae8014a5005c66a68e6fa66c38dcfa8056dbbdfb8b0187c0ffe7ee3a58f
languageName: node
linkType: hard

"hyperdyperid@npm:^1.2.0":
version: 1.2.0
resolution: "hyperdyperid@npm:1.2.0"
Expand Down