Skip to content

Commit 9794ff4

Browse files
laysakuraclaude
andcommitted
Replace entire codebase with wish-ng implementation
This commit replaces all code with the wish-ng architecture, which includes: - Consolidated package structure under packages/ directory - New AI integration (wish-ai) - Command & Control functionality (wish-c2 with Sliver) - CLI interface (wish-cli) - Core functionality (wish-core) - Knowledge management (wish-knowledge) - Comprehensive e2e testing framework - Improved project structure and dependencies Note: .claude/settings.local.json is not included (properly ignored) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c7d3097 commit 9794ff4

File tree

514 files changed

+48695
-46071
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

514 files changed

+48695
-46071
lines changed

.claude/commands/brc.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# +brc - Branch Review & Cleanup
2+
3+
Review differences between current branch and main branch, and perform branch cleanup.
4+
5+
## Overview
6+
7+
This command performs comprehensive quality checks and cleanup before PR creation. It focuses on:
8+
9+
- Ensuring code quality (lint, format)
10+
- Removing unnecessary files and code
11+
- **Complete cleanup of tmp/ directory**
12+
- Reviewing and resolving TODOs
13+
- Ensuring test success
14+
15+
## Execution Steps
16+
17+
### 1. Review Differences
18+
```bash
19+
git diff main...HEAD
20+
git diff --name-only main...HEAD
21+
```
22+
Review files and content changed in the current branch.
23+
24+
### 2. Remove Unnecessary Files and Code Fragments
25+
- Remove debug print statements, console.log, temporary commented-out code
26+
- Remove temporary test files (test_*.py, *.log, *.tmp, etc.) not used in actual tests
27+
- Remove unused import statements
28+
- Remove experimental code only used during implementation
29+
- **tmp/ directory cleanup**:
30+
```bash
31+
# Check tmp/ directory contents
32+
if [ -d "tmp/" ]; then
33+
echo "=== tmp/ directory contents ==="
34+
ls -la tmp/
35+
echo "Delete these files? (y/N)"
36+
# Wait for user confirmation
37+
read -r response
38+
if [[ "$response" =~ ^[Yy]$ ]]; then
39+
rm -rf tmp/*
40+
echo "Cleaned up tmp/ directory"
41+
fi
42+
else
43+
echo "tmp/ directory does not exist"
44+
fi
45+
```
46+
47+
### 3. Review and Resolve TODOs
48+
```bash
49+
# Search for TODO comments
50+
rg "TODO|FIXME|XXX|HACK" --type-add 'code:*.{py,ts,js,tsx,jsx}' -t code
51+
```
52+
- Review each TODO found
53+
- Immediately resolve items that should be addressed in current branch
54+
- For items to remain as future tasks, clearly document reasons in summary
55+
56+
### 4. Fix Formatting
57+
```bash
58+
make format
59+
make lint
60+
```
61+
- If lint errors exist, review error messages and fix
62+
- Manually fix errors that cannot be auto-fixed
63+
64+
### 5. Fix Tests
65+
```bash
66+
make test
67+
```
68+
- If tests fail:
69+
- First analyze error messages
70+
- Verify test expectations are correct
71+
- Determine whether to fix implementation or tests
72+
- If implementation should take priority over tests, document reasons in summary
73+
74+
### 6. Final Review and Summary Display
75+
Display summary in the following format:
76+
77+
```
78+
## Branch Review Summary
79+
80+
### Changes
81+
- Changed files: X files
82+
- Added lines: +XXX
83+
- Deleted lines: -XXX
84+
85+
### Cleanup Performed
86+
- [ ] Removed unnecessary debug code
87+
- [ ] Removed unused imports
88+
- [ ] Removed temporary files
89+
- [ ] Cleaned up tmp/ directory
90+
91+
### TODO Status
92+
- Resolved: X items
93+
- Remaining: X items
94+
- [Reason] TODO content
95+
96+
### Test & Quality Check
97+
- [ ] make format: PASS/FAIL
98+
- [ ] make lint: PASS/FAIL
99+
- [ ] make test: PASS/FAIL
100+
101+
### Remaining Issues
102+
(Document if any)
103+
104+
### Next Steps
105+
(If all checks PASS)
106+
Ready to create PR. Create PR with the following command:
107+
gh pr create --title "Title" --body "Description"
108+
```
109+
110+
## Notes
111+
- Carefully judge unnecessary code to not compromise implementation intent
112+
- If tests fail, don't hastily fix tests; prioritize verifying implementation correctness
113+
- Don't automatically create PR; prompt for user's final confirmation
114+
- **About tmp/ directory**:
115+
- All intermediate files created by Claude Code (test files, planning documents, etc.) are placed in tmp/
116+
- Always perform cleanup when executing +brc
117+
- Request user confirmation before deletion

.claude/commands/e2e.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# +e2e: End-to-End Test Execution
2+
3+
This shortcut executes phased end-to-end tests for wish-cli-basic-ui.
4+
5+
## Execution Command
6+
7+
```bash
8+
make e2e
9+
```
10+
11+
## Usage
12+
13+
```bash
14+
+e2e # wish CLI e2e test (all phases)
15+
```
16+
17+
## Test Configuration
18+
19+
### Level 1: Component Integration Tests
20+
- ✅ Basic application startup/shutdown tests
21+
-`/help` command functionality verification
22+
-`/status` command functionality verification
23+
-`/mode` command functionality verification
24+
25+
### Level 2: Workflow Integration Tests
26+
- ✅ Invalid command error handling
27+
- ✅ Invalid mode error handling
28+
- ✅ Multiple command sequential execution
29+
- ✅ Session state consistency verification
30+
- ✅ Recovery functionality after errors
31+
32+
## Execution Methods
33+
34+
**Execute from Claude Code:**
35+
```bash
36+
+e2e
37+
```
38+
39+
**Phased execution:**
40+
```bash
41+
make e2e-component # Level 1 only
42+
make e2e-workflow # Level 2 only
43+
make e2e # All phases
44+
```
45+
46+
**Direct pytest execution:**
47+
```bash
48+
uv run pytest e2e-tests/component/ -v
49+
uv run pytest e2e-tests/workflows/ -v
50+
```
51+
52+
## Test Result Interpretation
53+
54+
### Success Output Example
55+
```
56+
🚀 Starting wish-cli-basic-ui E2E Tests
57+
==================================================
58+
🧪 Running: test_basic_startup
59+
✅ PASS basic_startup (2.31s): Application started and exited successfully
60+
🧪 Running: test_help_command
61+
✅ PASS help_command (1.87s): Help command displayed expected content
62+
...
63+
✅ ALL TESTS PASSED
64+
```
65+
66+
### Handling Failures
67+
68+
**Common Issues:**
69+
1. **Startup failure**: Reinstall dependencies with `uv sync --dev`
70+
2. **Timeout**: Check system load
71+
3. **Command errors**: Verify latest code is deployed
72+
73+
**Debug Methods:**
74+
```bash
75+
# Run tests with detailed output
76+
python scripts/e2e_test.py --verbose
77+
78+
# Manual functionality verification
79+
uv run wish
80+
```
81+
82+
## Continuous Quality Management
83+
84+
This E2E test is executed in the following situations:
85+
- Functionality verification after adding new features
86+
- Regression testing after bug fixes
87+
- Quality verification before PR creation
88+
- Automated execution in CI/CD pipeline
89+
90+
## Expected Behavior
91+
92+
- **All tests pass**: Basic functionality working normally
93+
- **Partial failures**: Related functionality needs fixing
94+
- **All tests fail**: Possible basic environment issues
95+
96+
## Notes
97+
98+
- Test execution time: Approximately 10-30 seconds
99+
- Minimal external dependencies (uses mocks)
100+
- No actual network connection required
101+
- Environment cleanup is automatic

.claude/commands/fixci.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Investigate and fix CI failures for the Pull Request associated with the current branch.
2+
3+
Follow these steps:
4+
5+
1. **Identify PR information**: Execute `gh pr list --head $(git branch --show-current)` to identify the PR number and URL associated with the current branch. If no PR is found, prompt the user to create a PR.
6+
7+
2. **Check CI status**: Use `gh pr checks` to display a summary of CI status for the identified PR.
8+
9+
3. **Analyze failure logs**: Combine `gh run list` and `gh run view --log-failed` to retrieve and display error logs from failed jobs in the latest workflow run.
10+
11+
4. **Root cause analysis and fix proposal**:
12+
- Analyze the displayed error logs to identify the root cause of failures (e.g., test failures, lint errors, build issues).
13+
- Based on the identified cause, develop a specific fix strategy.
14+
- Present the fix strategy to the user and obtain approval before proceeding with code modifications.
15+
16+
5. **Fix and verify**:
17+
- Modify code according to the approved strategy.
18+
- After fixes, run `make lint` and `make test` locally to verify the issues are resolved.
19+
20+
6. **Commit and push**: Commit the fixes and push to remote to trigger CI re-run.

.claude/commands/fixlint.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# +fixlint: Lint Fix Shortcut
2+
3+
This shortcut executes `make format` and automatically attempts to fix lint errors if they occur.
4+
5+
## Execution Command
6+
7+
```bash
8+
make format
9+
```
10+
11+
## Purpose
12+
13+
- Execute code formatting for all workspaces
14+
- Automatically fix lint errors
15+
- Ensure compliance with code quality standards
16+
17+
## Usage
18+
19+
```bash
20+
+fixlint
21+
```
22+
23+
## Fix Process
24+
25+
1. **Initial format execution**: Format all workspace code with `make format`
26+
2. **Lint check**: Check for lint errors with `make lint`
27+
3. **Auto-fix**: Automatically fix the following types of lint errors:
28+
- Import order errors
29+
- Unused imports
30+
- Line length violations
31+
- Indentation errors
32+
- Whitespace errors
33+
- Naming convention violations
34+
- Code style violations
35+
- Docstring format errors
36+
4. **Re-run**: Execute lint check again after fixes
37+
5. **Iterate**: Repeat steps 2-4 until all lint errors are resolved
38+
39+
## Target
40+
41+
- Entire wish source code
42+
43+
## Tools Used
44+
45+
- **ruff**: Fast Python linter/formatter
46+
- **Auto-fix feature**: Automatic fixes via `ruff check --fix`
47+
48+
## Notes
49+
50+
- Formatting changes do not affect existing logic
51+
- Some complex lint errors may require manual fixes
52+
- Recommended to run before committing
53+
- For large changes, review diffs before committing

.claude/commands/fixtest.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# +fixtest: Test Fix Shortcut
2+
3+
This shortcut executes `make test` and automatically attempts to fix test errors if they occur.
4+
5+
## Execution Command
6+
7+
```bash
8+
make test
9+
```
10+
11+
## Purpose
12+
13+
- Execute unit tests for all workspaces
14+
- Automatically fix test errors
15+
- Iterate until all tests pass
16+
17+
## Usage
18+
19+
```bash
20+
+fixtest
21+
```
22+
23+
## Fix Process
24+
25+
1. **Initial test execution**: Run tests for all workspaces with `make test`
26+
2. **Error analysis**: Identify the cause of failed tests
27+
3. **Auto-fix**: Automatically fix the following types of errors:
28+
- Import errors
29+
- Errors due to module name changes
30+
- Errors due to package structure changes
31+
- Type errors
32+
- Syntax errors
33+
- Dependency errors
34+
4. **Re-run**: Execute tests again after fixes
35+
5. **Iterate**: Repeat steps 2-4 until all tests pass
36+
37+
## Target
38+
39+
- Entire wish test suite
40+
41+
## Notes
42+
43+
- LLM tests (`@pytest.mark.llm`) are excluded
44+
- Time-consuming tests (`@pytest.mark.slow`) are excluded
45+
- Test fixes are executed carefully to avoid breaking existing logic
46+
- Complex business logic errors may require manual review

.claude/commands/pr.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Create a Pull Request from the current branch to the `main` branch following best practices.
2+
If `draft` is specified in `$ARGUMENTS`, create as a draft PR.
3+
4+
Follow these steps:
5+
6+
1. **Pre-checks**:
7+
- Use `git status` to check for uncommitted changes. If any exist, ask the user whether to commit or stash them.
8+
- Use `git branch --show-current` to verify the current branch name is not `main` or `master`.
9+
10+
2. **Sync with remote**:
11+
- Execute `git fetch origin`.
12+
- If the local branch doesn't exist on remote or has unpushed commits, execute `git push -u origin $(git branch --show-current)` to sync with remote.
13+
14+
3. **Generate PR information**:
15+
- **Title**: If there's only one commit in the diff with `main` branch, use the first line of that commit message as the title. If there are multiple commits, convert the branch name to a human-readable format (e.g., `feat/new-feature` -> `Feat: New Feature`) for the title.
16+
- **Body**: Include the list of commits in the diff with `main` branch in bullet point format. Also provide template sections for "Related Issues" and "Testing".
17+
18+
4. **Create PR**:
19+
- Use the `gh pr create` command to create the PR.
20+
- If `$ARGUMENTS` contains `draft`, add the `--draft` flag.

.claude/settings.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"hooks": {
3+
"PreToolUse": [
4+
{
5+
"matcher": "Bash",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "~/.local/bin/enforce-uv-claude-hook"
10+
}
11+
]
12+
},
13+
{
14+
"matcher": "Edit|Write|MultiEdit",
15+
"hooks": [
16+
{
17+
"type": "command",
18+
"command": "~/.local/bin/enforce-no-serialization-claude-hook"
19+
},
20+
{
21+
"type": "command",
22+
"command": "~/.local/bin/restrict-working-directory-claude-hook"
23+
}
24+
]
25+
}
26+
]
27+
}
28+
}

0 commit comments

Comments
 (0)