commit 087d2b04d6794a02ad270a42e54793eb933a9b2d Author: Zhongwei Li Date: Sun Nov 30 08:32:10 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..ef1c671 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,14 @@ +{ + "name": "engineering-workflow-tools", + "description": "Engineering workflow automation tools for git operations, code review implementation, and test fixing", + "version": "0.0.0-2025.11.28", + "author": { + "name": "ando", + "email": "ando@kivilaid.ee" + }, + "skills": [ + "./skills/git-pushing", + "./skills/review-implementing", + "./skills/test-fixing" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..47f64f2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# engineering-workflow-tools + +Engineering workflow automation tools for git operations, code review implementation, and test fixing diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..216c9c7 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,52 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:kivilaid/plugin-marketplace:engineering-workflow-tools", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "b7936615660307f4bcd4e9650a54300862ddb0e3", + "treeHash": "fafaf116dc906687964711cb9785f6fefdd3c86c850f3f268a200d490081dedf", + "generatedAt": "2025-11-28T10:19:36.843096Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "engineering-workflow-tools", + "description": "Engineering workflow automation tools for git operations, code review implementation, and test fixing" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "bd81b4ac30f27a5b118ed3368ca867b6e075b7ac305dbdf7e1cdabfe2990a1bc" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "6a95ff68590c6257af34c60350d28891f4ec3df6ad16151feb3ad9f2cf125639" + }, + { + "path": "skills/git-pushing/SKILL.md", + "sha256": "22a2d8582faa80af777ce8c8f39308a83506afbfc2e7f478bd1d03194f94d2d9" + }, + { + "path": "skills/test-fixing/SKILL.md", + "sha256": "ec3fa75f25afdc0a95521202e80e327c79692a2fb6d3d9a38e2be913e7c888ce" + }, + { + "path": "skills/review-implementing/SKILL.md", + "sha256": "aa209116f12bd88d8b978bd038f2117202a75d57fe9c4b4314a3f06016f2b787" + } + ], + "dirSha256": "fafaf116dc906687964711cb9785f6fefdd3c86c850f3f268a200d490081dedf" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/git-pushing/SKILL.md b/skills/git-pushing/SKILL.md new file mode 100644 index 0000000..83d07e3 --- /dev/null +++ b/skills/git-pushing/SKILL.md @@ -0,0 +1,83 @@ +--- +name: git-pushing +description: Stage, commit, and push git changes with conventional commit messages. Use when user wants to commit and push changes, mentions pushing to remote, or asks to save and push their work. Also activates when user says "push changes", "commit and push", or similar git workflow requests. +--- + +# Git Push Workflow + +Stage all changes, create a conventional commit, and push to the remote branch. + +## When to Use + +Automatically activate when the user: +- Explicitly asks to push changes ("push this", "commit and push") +- Mentions saving work to remote ("save to github", "push to remote") +- Completes a feature and wants to share it +- Says phrases like "let's push this up" or "commit these changes" + +## Workflow + +### 1. Check Git Status + +Run `git status` to understand: +- Which files have changed +- What will be committed +- Current branch name + +### 2. Stage Changes + +- Run `git add .` to stage all changes +- Alternatively, stage specific files if partial commit is needed + +### 3. Create Commit Message + +**If user provided a message:** +- Use it directly + +**If no message provided:** +- Analyze changes using `git diff` +- Generate a conventional commit message: + - Format: `type(scope): description` + - Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore` + - Keep description concise (50-90 characters) + - Use imperative mood: "Add" not "Added" +- Always append Claude Code footer: + ``` + 🤖 Generated with [Claude Code](https://claude.com/claude-code) + + Co-Authored-By: Claude + ``` + +**Use heredoc format:** +```bash +git commit -m "$(cat <<'EOF' +commit message here + +🤖 Generated with [Claude Code](https://claude.com/claude-code) + +Co-Authored-By: Claude +EOF +)" +``` + +### 4. Push to Remote + +- Run `git push` to push commits +- If push fails due to diverged branches, inform user and ask how to proceed + +### 5. Confirm Success + +- Report commit hash +- Summarize what was committed +- Confirm push succeeded + +## Examples + +User: "Push these changes" +→ Check status, stage all, generate commit message, push + +User: "Commit with message 'fix: resolve table extraction issue'" +→ Use provided message, push + +User: "Let's save this to github" +→ Activate workflow, generate appropriate commit message diff --git a/skills/review-implementing/SKILL.md b/skills/review-implementing/SKILL.md new file mode 100644 index 0000000..1f14735 --- /dev/null +++ b/skills/review-implementing/SKILL.md @@ -0,0 +1,155 @@ +--- +name: review-implementing +description: Process and implement code review feedback systematically. Use when user provides reviewer comments, PR feedback, code review notes, or asks to implement suggestions from reviews. Activates on phrases like "implement this feedback", "address review comments", or when user pastes reviewer notes. +--- + +# Review Feedback Implementation + +Systematically process and implement changes based on code review feedback. + +## When to Use + +Automatically activate when the user: +- Provides reviewer comments or feedback +- Pastes PR review notes +- Mentions implementing review suggestions +- Says "address these comments" or "implement feedback" +- Shares a list of changes requested by reviewers + +## Systematic Workflow + +### 1. Parse Reviewer Notes + +Identify individual feedback items: +- Split numbered lists (1., 2., etc.) +- Handle bullet points or unnumbered feedback +- Extract distinct change requests +- Clarify any ambiguous items before starting + +### 2. Create Todo List + +Use TodoWrite tool to create actionable tasks: +- Each feedback item becomes one or more todos +- Break down complex feedback into smaller tasks +- Make tasks specific and measurable +- Mark first task as `in_progress` before starting + +Example: +``` +- Add type hints to extract function +- Fix duplicate tag detection logic +- Update docstring in chain.py +- Add unit test for edge case +``` + +### 3. Implement Changes Systematically + +For each todo item: + +**Locate relevant code:** +- Use Grep to search for functions/classes +- Use Glob to find files by pattern +- Read current implementation + +**Make changes:** +- Use Edit tool for modifications +- Follow project conventions (CLAUDE.md) +- Preserve existing functionality unless changing behavior + +**Verify changes:** +- Check syntax correctness +- Run relevant tests if applicable +- Ensure changes address reviewer's intent + +**Update status:** +- Mark todo as `completed` immediately after finishing +- Move to next todo (only one `in_progress` at a time) + +### 4. Handle Different Feedback Types + +**Code changes:** +- Use Edit tool for existing code +- Follow type hint conventions (PEP 604/585) +- Maintain consistent style + +**New features:** +- Create new files with Write tool if needed +- Add corresponding tests +- Update documentation + +**Documentation:** +- Update docstrings following project style +- Modify markdown files as needed +- Keep explanations concise + +**Tests:** +- Write tests as functions, not classes +- Use descriptive names +- Follow pytest conventions + +**Refactoring:** +- Preserve functionality +- Improve code structure +- Run tests to verify no regressions + +### 5. Validation + +After implementing changes: +- Run affected tests +- Check for linting errors: `uv run ruff check` +- Verify changes don't break existing functionality + +### 6. Communication + +Keep user informed: +- Update todo list in real-time +- Ask for clarification on ambiguous feedback +- Report blockers or challenges +- Summarize changes at completion + +## Edge Cases + +**Conflicting feedback:** +- Ask user for guidance +- Explain the conflict clearly + +**Breaking changes required:** +- Notify user before implementing +- Discuss impact and alternatives + +**Tests fail after changes:** +- Fix tests before marking todo complete +- Ensure all related tests pass + +**Referenced code doesn't exist:** +- Ask user for clarification +- Verify understanding before proceeding + +## Important Guidelines + +- **Always use TodoWrite** for tracking progress +- **Mark todos completed immediately** after each item +- **Only one todo in_progress** at any time +- **Don't batch completions** - update status in real-time +- **Ask questions** for unclear feedback +- **Run tests** if changes affect tested code +- **Follow CLAUDE.md conventions** for all code changes +- **Use conventional commits** if creating commits afterward + +## Example + +User: "Implement these review comments: +1. Add type hints to the extract function +2. Fix the duplicate tag detection logic +3. Update the docstring in chain.py" + +**Actions:** +1. Create TodoWrite with 3 items +2. Mark item 1 as in_progress +3. Grep for extract function +4. Read file containing function +5. Edit to add type hints +6. Mark item 1 completed +7. Mark item 2 in_progress +8. Repeat process for remaining items +9. Summarize all changes made diff --git a/skills/test-fixing/SKILL.md b/skills/test-fixing/SKILL.md new file mode 100644 index 0000000..bce5730 --- /dev/null +++ b/skills/test-fixing/SKILL.md @@ -0,0 +1,110 @@ +--- +name: test-fixing +description: Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass. Activates on phrases like "fix the tests", "tests are failing", or "make the test suite green". +--- + +# Test Fixing Workflow + +Systematically identify and fix all failing tests using smart grouping strategies. + +## When to Use + +Automatically activate when the user: +- Explicitly asks to fix tests ("fix these tests", "make tests pass") +- Reports test failures ("tests are failing", "test suite is broken") +- Completes implementation and wants tests passing +- Mentions CI/CD failures due to tests + +## Systematic Approach + +### 1. Initial Test Run + +Run `make test` to identify all failing tests. + +Analyze output for: +- Total number of failures +- Error types and patterns +- Affected modules/files + +### 2. Smart Error Grouping + +Group similar failures by: +- **Error type**: ImportError, AttributeError, AssertionError, etc. +- **Module/file**: Same file causing multiple test failures +- **Root cause**: Missing dependencies, API changes, refactoring impacts + +Prioritize groups by: +- Number of affected tests (highest impact first) +- Dependency order (fix infrastructure before functionality) + +### 3. Systematic Fixing Process + +For each group (starting with highest impact): + +1. **Identify root cause** + - Read relevant code + - Check recent changes with `git diff` + - Understand the error pattern + +2. **Implement fix** + - Use Edit tool for code changes + - Follow project conventions (see CLAUDE.md) + - Make minimal, focused changes + +3. **Verify fix** + - Run subset of tests for this group + - Use pytest markers or file patterns: + ```bash + uv run pytest tests/path/to/test_file.py -v + uv run pytest -k "pattern" -v + ``` + - Ensure group passes before moving on + +4. **Move to next group** + +### 4. Fix Order Strategy + +**Infrastructure first:** +- Import errors +- Missing dependencies +- Configuration issues + +**Then API changes:** +- Function signature changes +- Module reorganization +- Renamed variables/functions + +**Finally, logic issues:** +- Assertion failures +- Business logic bugs +- Edge case handling + +### 5. Final Verification + +After all groups fixed: +- Run complete test suite: `make test` +- Verify no regressions +- Check test coverage remains intact + +## Best Practices + +- Fix one group at a time +- Run focused tests after each fix +- Use `git diff` to understand recent changes +- Look for patterns in failures +- Don't move to next group until current passes +- Keep changes minimal and focused + +## Example Workflow + +User: "The tests are failing after my refactor" + +1. Run `make test` → 15 failures identified +2. Group errors: + - 8 ImportErrors (module renamed) + - 5 AttributeErrors (function signature changed) + - 2 AssertionErrors (logic bugs) +3. Fix ImportErrors first → Run subset → Verify +4. Fix AttributeErrors → Run subset → Verify +5. Fix AssertionErrors → Run subset → Verify +6. Run full suite → All pass ✓