zrb 1.21.29__py3-none-any.whl → 2.0.0a4__py3-none-any.whl
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.
Potentially problematic release.
This version of zrb might be problematic. Click here for more details.
- zrb/__init__.py +118 -129
- zrb/builtin/__init__.py +54 -2
- zrb/builtin/llm/chat.py +147 -0
- zrb/callback/callback.py +8 -1
- zrb/cmd/cmd_result.py +2 -1
- zrb/config/config.py +491 -280
- zrb/config/helper.py +84 -0
- zrb/config/web_auth_config.py +50 -35
- zrb/context/any_shared_context.py +13 -2
- zrb/context/context.py +31 -3
- zrb/context/print_fn.py +13 -0
- zrb/context/shared_context.py +14 -1
- zrb/input/option_input.py +30 -2
- zrb/llm/agent/__init__.py +9 -0
- zrb/llm/agent/agent.py +215 -0
- zrb/llm/agent/summarizer.py +20 -0
- zrb/llm/app/__init__.py +10 -0
- zrb/llm/app/completion.py +281 -0
- zrb/llm/app/confirmation/allow_tool.py +66 -0
- zrb/llm/app/confirmation/handler.py +178 -0
- zrb/llm/app/confirmation/replace_confirmation.py +77 -0
- zrb/llm/app/keybinding.py +34 -0
- zrb/llm/app/layout.py +117 -0
- zrb/llm/app/lexer.py +155 -0
- zrb/llm/app/redirection.py +28 -0
- zrb/llm/app/style.py +16 -0
- zrb/llm/app/ui.py +733 -0
- zrb/llm/config/__init__.py +4 -0
- zrb/llm/config/config.py +122 -0
- zrb/llm/config/limiter.py +247 -0
- zrb/llm/history_manager/__init__.py +4 -0
- zrb/llm/history_manager/any_history_manager.py +23 -0
- zrb/llm/history_manager/file_history_manager.py +91 -0
- zrb/llm/history_processor/summarizer.py +108 -0
- zrb/llm/note/__init__.py +3 -0
- zrb/llm/note/manager.py +122 -0
- zrb/llm/prompt/__init__.py +29 -0
- zrb/llm/prompt/claude_compatibility.py +92 -0
- zrb/llm/prompt/compose.py +55 -0
- zrb/llm/prompt/default.py +51 -0
- zrb/llm/prompt/markdown/mandate.md +23 -0
- zrb/llm/prompt/markdown/persona.md +3 -0
- zrb/llm/prompt/markdown/summarizer.md +21 -0
- zrb/llm/prompt/note.py +41 -0
- zrb/llm/prompt/system_context.py +46 -0
- zrb/llm/prompt/zrb.py +41 -0
- zrb/llm/skill/__init__.py +3 -0
- zrb/llm/skill/manager.py +86 -0
- zrb/llm/task/__init__.py +4 -0
- zrb/llm/task/llm_chat_task.py +316 -0
- zrb/llm/task/llm_task.py +245 -0
- zrb/llm/tool/__init__.py +39 -0
- zrb/llm/tool/bash.py +75 -0
- zrb/llm/tool/code.py +266 -0
- zrb/llm/tool/file.py +419 -0
- zrb/llm/tool/note.py +70 -0
- zrb/{builtin/llm → llm}/tool/rag.py +8 -5
- zrb/llm/tool/search/brave.py +53 -0
- zrb/llm/tool/search/searxng.py +47 -0
- zrb/llm/tool/search/serpapi.py +47 -0
- zrb/llm/tool/skill.py +19 -0
- zrb/llm/tool/sub_agent.py +70 -0
- zrb/llm/tool/web.py +97 -0
- zrb/llm/tool/zrb_task.py +66 -0
- zrb/llm/util/attachment.py +101 -0
- zrb/llm/util/prompt.py +104 -0
- zrb/llm/util/stream_response.py +178 -0
- zrb/session/any_session.py +0 -3
- zrb/session/session.py +1 -1
- zrb/task/base/context.py +25 -13
- zrb/task/base/execution.py +52 -47
- zrb/task/base/lifecycle.py +7 -4
- zrb/task/base_task.py +48 -49
- zrb/task/base_trigger.py +4 -1
- zrb/task/cmd_task.py +6 -0
- zrb/task/http_check.py +11 -5
- zrb/task/make_task.py +3 -0
- zrb/task/rsync_task.py +5 -0
- zrb/task/scaffolder.py +7 -4
- zrb/task/scheduler.py +3 -0
- zrb/task/tcp_check.py +6 -4
- zrb/util/ascii_art/art/bee.txt +17 -0
- zrb/util/ascii_art/art/cat.txt +9 -0
- zrb/util/ascii_art/art/ghost.txt +16 -0
- zrb/util/ascii_art/art/panda.txt +17 -0
- zrb/util/ascii_art/art/rose.txt +14 -0
- zrb/util/ascii_art/art/unicorn.txt +15 -0
- zrb/util/ascii_art/banner.py +92 -0
- zrb/util/cli/markdown.py +22 -2
- zrb/util/cmd/command.py +33 -10
- zrb/util/file.py +51 -32
- zrb/util/match.py +78 -0
- zrb/util/run.py +3 -3
- {zrb-1.21.29.dist-info → zrb-2.0.0a4.dist-info}/METADATA +9 -15
- {zrb-1.21.29.dist-info → zrb-2.0.0a4.dist-info}/RECORD +100 -128
- zrb/attr/__init__.py +0 -0
- zrb/builtin/llm/attachment.py +0 -40
- zrb/builtin/llm/chat_completion.py +0 -274
- zrb/builtin/llm/chat_session.py +0 -270
- zrb/builtin/llm/chat_session_cmd.py +0 -288
- zrb/builtin/llm/chat_trigger.py +0 -79
- zrb/builtin/llm/history.py +0 -71
- zrb/builtin/llm/input.py +0 -27
- zrb/builtin/llm/llm_ask.py +0 -269
- zrb/builtin/llm/previous-session.js +0 -21
- zrb/builtin/llm/tool/__init__.py +0 -0
- zrb/builtin/llm/tool/api.py +0 -75
- zrb/builtin/llm/tool/cli.py +0 -52
- zrb/builtin/llm/tool/code.py +0 -236
- zrb/builtin/llm/tool/file.py +0 -560
- zrb/builtin/llm/tool/note.py +0 -84
- zrb/builtin/llm/tool/sub_agent.py +0 -150
- zrb/builtin/llm/tool/web.py +0 -171
- zrb/builtin/project/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/_zrb/module/template/app_template/module/my_module/service/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/common/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/module/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/module/auth/service/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/module/auth/service/permission/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/module/auth/service/role/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/module/auth/service/user/__init__.py +0 -0
- zrb/builtin/project/add/fastapp/fastapp_template/my_app_name/schema/__init__.py +0 -0
- zrb/builtin/project/create/__init__.py +0 -0
- zrb/builtin/shell/__init__.py +0 -0
- zrb/builtin/shell/autocomplete/__init__.py +0 -0
- zrb/callback/__init__.py +0 -0
- zrb/cmd/__init__.py +0 -0
- zrb/config/default_prompt/interactive_system_prompt.md +0 -29
- zrb/config/default_prompt/persona.md +0 -1
- zrb/config/default_prompt/summarization_prompt.md +0 -57
- zrb/config/default_prompt/system_prompt.md +0 -38
- zrb/config/llm_config.py +0 -339
- zrb/config/llm_context/config.py +0 -166
- zrb/config/llm_context/config_parser.py +0 -40
- zrb/config/llm_context/workflow.py +0 -81
- zrb/config/llm_rate_limitter.py +0 -190
- zrb/content_transformer/__init__.py +0 -0
- zrb/context/__init__.py +0 -0
- zrb/dot_dict/__init__.py +0 -0
- zrb/env/__init__.py +0 -0
- zrb/group/__init__.py +0 -0
- zrb/input/__init__.py +0 -0
- zrb/runner/__init__.py +0 -0
- zrb/runner/web_route/__init__.py +0 -0
- zrb/runner/web_route/home_page/__init__.py +0 -0
- zrb/session/__init__.py +0 -0
- zrb/session_state_log/__init__.py +0 -0
- zrb/session_state_logger/__init__.py +0 -0
- zrb/task/__init__.py +0 -0
- zrb/task/base/__init__.py +0 -0
- zrb/task/llm/__init__.py +0 -0
- zrb/task/llm/agent.py +0 -204
- zrb/task/llm/agent_runner.py +0 -152
- zrb/task/llm/config.py +0 -122
- zrb/task/llm/conversation_history.py +0 -209
- zrb/task/llm/conversation_history_model.py +0 -67
- zrb/task/llm/default_workflow/coding/workflow.md +0 -41
- zrb/task/llm/default_workflow/copywriting/workflow.md +0 -68
- zrb/task/llm/default_workflow/git/workflow.md +0 -118
- zrb/task/llm/default_workflow/golang/workflow.md +0 -128
- zrb/task/llm/default_workflow/html-css/workflow.md +0 -135
- zrb/task/llm/default_workflow/java/workflow.md +0 -146
- zrb/task/llm/default_workflow/javascript/workflow.md +0 -158
- zrb/task/llm/default_workflow/python/workflow.md +0 -160
- zrb/task/llm/default_workflow/researching/workflow.md +0 -153
- zrb/task/llm/default_workflow/rust/workflow.md +0 -162
- zrb/task/llm/default_workflow/shell/workflow.md +0 -299
- zrb/task/llm/error.py +0 -95
- zrb/task/llm/file_replacement.py +0 -206
- zrb/task/llm/file_tool_model.py +0 -57
- zrb/task/llm/history_processor.py +0 -206
- zrb/task/llm/history_summarization.py +0 -25
- zrb/task/llm/print_node.py +0 -221
- zrb/task/llm/prompt.py +0 -321
- zrb/task/llm/subagent_conversation_history.py +0 -41
- zrb/task/llm/tool_wrapper.py +0 -361
- zrb/task/llm/typing.py +0 -3
- zrb/task/llm/workflow.py +0 -76
- zrb/task/llm_task.py +0 -379
- zrb/task_status/__init__.py +0 -0
- zrb/util/__init__.py +0 -0
- zrb/util/cli/__init__.py +0 -0
- zrb/util/cmd/__init__.py +0 -0
- zrb/util/codemod/__init__.py +0 -0
- zrb/util/string/__init__.py +0 -0
- zrb/xcom/__init__.py +0 -0
- /zrb/{config/default_prompt/file_extractor_system_prompt.md → llm/prompt/markdown/file_extractor.md} +0 -0
- /zrb/{config/default_prompt/repo_extractor_system_prompt.md → llm/prompt/markdown/repo_extractor.md} +0 -0
- /zrb/{config/default_prompt/repo_summarizer_system_prompt.md → llm/prompt/markdown/repo_summarizer.md} +0 -0
- {zrb-1.21.29.dist-info → zrb-2.0.0a4.dist-info}/WHEEL +0 -0
- {zrb-1.21.29.dist-info → zrb-2.0.0a4.dist-info}/entry_points.txt +0 -0
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "A workflow for developing with Go, including project analysis and best practices."
|
|
3
|
-
---
|
|
4
|
-
Follow this workflow to deliver high-quality, idiomatic Go code that respects project conventions.
|
|
5
|
-
|
|
6
|
-
# Core Mandates
|
|
7
|
-
|
|
8
|
-
- **Simplicity First:** Write clear, simple, and readable code
|
|
9
|
-
- **Idiomatic Go:** Follow Go conventions and community standards
|
|
10
|
-
- **Tool Integration:** Leverage Go's excellent tooling ecosystem
|
|
11
|
-
- **Safety and Reliability:** Write robust, well-tested code
|
|
12
|
-
|
|
13
|
-
# Tool Usage Guideline
|
|
14
|
-
- Use `read_from_file` to analyze Go modules and configuration
|
|
15
|
-
- Use `search_files` to find Go patterns and conventions
|
|
16
|
-
- Use `run_shell_command` for Go toolchain operations
|
|
17
|
-
- Use `list_files` to understand project structure
|
|
18
|
-
|
|
19
|
-
# Step 1: Project Analysis
|
|
20
|
-
|
|
21
|
-
1. **Module Information:** Examine `go.mod` for module path and dependencies
|
|
22
|
-
2. **Workspace:** Check for `go.work` for multi-module workspace configuration
|
|
23
|
-
3. **Tooling:** Look for `Makefile` with build, test, and lint commands
|
|
24
|
-
4. **CI/CD Configuration:** Check `.github/workflows/go.yml` for verification commands
|
|
25
|
-
5. **Linting Config:** Examine `.golangci.yml` for linting rules
|
|
26
|
-
6. **Package Structure:** Analyze `pkg/`, `internal/`, and `cmd/` directories
|
|
27
|
-
|
|
28
|
-
# Step 2: Understand Conventions
|
|
29
|
-
|
|
30
|
-
1. **Formatting:** `go fmt` is mandatory for all code
|
|
31
|
-
2. **Linting:** Adhere to project's `golangci-lint` configuration
|
|
32
|
-
3. **Package Naming:** Use short, concise, all-lowercase package names
|
|
33
|
-
4. **Error Handling:** Match existing error handling patterns
|
|
34
|
-
5. **Testing:** Follow established test structure and patterns
|
|
35
|
-
|
|
36
|
-
# Step 3: Implementation Planning
|
|
37
|
-
|
|
38
|
-
1. **File Structure:** Plan where new code should be placed based on project conventions
|
|
39
|
-
2. **Dependencies:** Identify if new dependencies are needed and verify they're appropriate
|
|
40
|
-
3. **API Design:** Consider how new code integrates with existing APIs
|
|
41
|
-
4. **Testing Strategy:** Plan comprehensive tests for new functionality
|
|
42
|
-
|
|
43
|
-
# Step 4: Write Code
|
|
44
|
-
|
|
45
|
-
## Code Quality Standards
|
|
46
|
-
- **Formatting:** All code must be `go fmt` compliant
|
|
47
|
-
- **Linting:** Address all `golangci-lint` warnings
|
|
48
|
-
- **Naming:** Follow Go naming conventions (camelCase for variables, PascalCase for exports)
|
|
49
|
-
- **Documentation:** Add godoc comments for exported functions and types
|
|
50
|
-
|
|
51
|
-
## Implementation Patterns
|
|
52
|
-
- **Error Handling:** Use appropriate error wrapping based on project patterns
|
|
53
|
-
- **Concurrency:** Follow existing goroutine and channel usage patterns
|
|
54
|
-
- **Interfaces:** Define small, focused interfaces
|
|
55
|
-
- **Composition:** Prefer composition over inheritance
|
|
56
|
-
|
|
57
|
-
# Step 5: Testing and Verification
|
|
58
|
-
|
|
59
|
-
1. **Write Tests:** Create comprehensive tests for all new functionality
|
|
60
|
-
2. **Run Tests:** Execute `go test ./...` to verify functionality
|
|
61
|
-
3. **Format Code:** Run `go fmt ./...` to ensure proper formatting
|
|
62
|
-
4. **Lint Code:** Run `golangci-lint run` to catch issues
|
|
63
|
-
5. **Build Verification:** Run `go build ./...` to ensure code compiles
|
|
64
|
-
|
|
65
|
-
# Step 6: Quality Assurance
|
|
66
|
-
|
|
67
|
-
## Testing Standards
|
|
68
|
-
- **Table-Driven Tests:** Use for comprehensive test coverage
|
|
69
|
-
- **Test Files:** Place tests in `_test.go` files within the same package
|
|
70
|
-
- **Benchmarks:** Add benchmarks for performance-critical code
|
|
71
|
-
- **Examples:** Include example code in documentation
|
|
72
|
-
|
|
73
|
-
## Code Review Checklist
|
|
74
|
-
- [ ] Code follows project formatting standards
|
|
75
|
-
- [ ] All tests pass
|
|
76
|
-
- [ ] No linting warnings
|
|
77
|
-
- [ ] Error handling is appropriate
|
|
78
|
-
- [ ] Documentation is complete
|
|
79
|
-
- [ ] Performance considerations addressed
|
|
80
|
-
|
|
81
|
-
# Step 7: Finalize and Deliver
|
|
82
|
-
|
|
83
|
-
1. **Verify Dependencies:** Run `go mod tidy` to clean up dependencies
|
|
84
|
-
2. **Run Full Test Suite:** Ensure all existing tests still pass
|
|
85
|
-
3. **Document Changes:** Update relevant documentation
|
|
86
|
-
4. **Prepare for Review:** Ensure code is ready for team review
|
|
87
|
-
|
|
88
|
-
# Common Commands Reference
|
|
89
|
-
|
|
90
|
-
## Development
|
|
91
|
-
- `go fmt ./...`: Format all Go code
|
|
92
|
-
- `go vet ./...`: Report suspicious constructs
|
|
93
|
-
- `go build ./...`: Build all packages
|
|
94
|
-
- `go run ./cmd/my-app`: Run a specific application
|
|
95
|
-
|
|
96
|
-
## Testing
|
|
97
|
-
- `go test ./...`: Run all tests
|
|
98
|
-
- `go test -v ./...`: Run tests with verbose output
|
|
99
|
-
- `go test -race ./...`: Run tests with race detector
|
|
100
|
-
- `go test -bench=. ./...`: Run benchmarks
|
|
101
|
-
|
|
102
|
-
## Dependency Management
|
|
103
|
-
- `go mod tidy`: Add missing and remove unused modules
|
|
104
|
-
- `go mod download`: Download modules to local cache
|
|
105
|
-
- `go list -m all`: List all dependencies
|
|
106
|
-
- `go get package@version`: Add or update a dependency
|
|
107
|
-
|
|
108
|
-
## Debugging
|
|
109
|
-
- `dlv debug`: Debug with Delve
|
|
110
|
-
- `go tool pprof`: Performance profiling
|
|
111
|
-
- `go tool trace`: Execution tracing
|
|
112
|
-
|
|
113
|
-
# Risk Assessment Guidelines
|
|
114
|
-
|
|
115
|
-
## Low Risk (Proceed Directly)
|
|
116
|
-
- Reading configuration files
|
|
117
|
-
- Running tests and linters
|
|
118
|
-
- Adding tests to existing packages
|
|
119
|
-
|
|
120
|
-
## Moderate Risk (Explain and Confirm)
|
|
121
|
-
- Adding new dependencies
|
|
122
|
-
- Modifying core business logic
|
|
123
|
-
- Changing public API interfaces
|
|
124
|
-
|
|
125
|
-
## High Risk (Refuse and Explain)
|
|
126
|
-
- Modifying critical system paths
|
|
127
|
-
- Operations that could break the build
|
|
128
|
-
- Changes that affect multiple teams
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "A workflow for developing with HTML and CSS, including project analysis and best practices."
|
|
3
|
-
---
|
|
4
|
-
Follow this workflow to create accessible, responsive, and maintainable web interfaces.
|
|
5
|
-
|
|
6
|
-
# Core Mandates
|
|
7
|
-
|
|
8
|
-
- **Semantic HTML:** Use HTML elements for their intended purpose
|
|
9
|
-
- **Accessibility First:** Ensure content is accessible to all users
|
|
10
|
-
- **Responsive Design:** Create interfaces that work across all devices
|
|
11
|
-
- **Performance:** Optimize for fast loading and smooth interactions
|
|
12
|
-
|
|
13
|
-
# Tool Usage Guideline
|
|
14
|
-
- Use `read_from_file` to analyze HTML/CSS structure and patterns
|
|
15
|
-
- Use `search_files` to find specific styles or markup patterns
|
|
16
|
-
- Use `run_shell_command` for linting and formatting tools
|
|
17
|
-
- Use `list_files` to understand project structure
|
|
18
|
-
|
|
19
|
-
# Step 1: Project Analysis
|
|
20
|
-
|
|
21
|
-
1. **HTML Files:** Examine `*.html` for structure, doctype, and meta tags
|
|
22
|
-
2. **CSS Files:** Analyze `*.css` for architecture (BEM, SMACSS) and frameworks
|
|
23
|
-
3. **Preprocessors:** Check for Sass (`*.scss`), Less (`*.less`), or other preprocessors
|
|
24
|
-
4. **Frameworks:** Identify usage of Bootstrap, Tailwind CSS, or other CSS frameworks
|
|
25
|
-
5. **Configuration:** Look for `.stylelintrc`, `.prettierrc`, and other config files
|
|
26
|
-
6. **Build Tools:** Check for Webpack, Vite, or other build configurations
|
|
27
|
-
|
|
28
|
-
# Step 2: Understand Conventions
|
|
29
|
-
|
|
30
|
-
1. **HTML Standards:** Follow semantic HTML5 elements and attributes
|
|
31
|
-
2. **CSS Methodology:** Adhere to project's CSS architecture (BEM, SMACSS, etc.)
|
|
32
|
-
3. **Accessibility:** Implement WCAG guidelines and ARIA attributes
|
|
33
|
-
4. **Responsive Patterns:** Follow established breakpoints and grid systems
|
|
34
|
-
5. **Performance:** Optimize images, minimize CSS, and leverage browser caching
|
|
35
|
-
|
|
36
|
-
# Step 3: Implementation Planning
|
|
37
|
-
|
|
38
|
-
1. **Component Structure:** Plan HTML structure based on project patterns
|
|
39
|
-
2. **Styling Approach:** Determine CSS organization and naming conventions
|
|
40
|
-
3. **Responsive Strategy:** Plan breakpoints and adaptive layouts
|
|
41
|
-
4. **Accessibility:** Identify required ARIA attributes and keyboard navigation
|
|
42
|
-
5. **Browser Compatibility:** Consider cross-browser testing requirements
|
|
43
|
-
|
|
44
|
-
# Step 4: Write Markup and Styles
|
|
45
|
-
|
|
46
|
-
## HTML Best Practices
|
|
47
|
-
- **Semantic Structure:** Use appropriate elements (`<nav>`, `<main>`, `<article>`, etc.)
|
|
48
|
-
- **Accessibility:** Include `alt` attributes, proper headings, and ARIA labels
|
|
49
|
-
- **SEO Optimization:** Use proper meta tags and semantic markup
|
|
50
|
-
- **Performance:** Minimize DOM depth and avoid unnecessary elements
|
|
51
|
-
|
|
52
|
-
## CSS Best Practices
|
|
53
|
-
- **Methodology:** Follow established naming conventions (BEM, etc.)
|
|
54
|
-
- **Organization:** Use logical grouping and consistent ordering
|
|
55
|
-
- **Responsive Design:** Implement mobile-first media queries
|
|
56
|
-
- **Performance:** Minimize specificity and avoid expensive selectors
|
|
57
|
-
- **Maintainability:** Use variables and modular organization
|
|
58
|
-
|
|
59
|
-
# Step 5: Testing and Verification
|
|
60
|
-
|
|
61
|
-
1. **HTML Validation:** Validate markup using W3C validator
|
|
62
|
-
2. **Accessibility Testing:** Test with screen readers and accessibility tools
|
|
63
|
-
3. **Cross-Browser Testing:** Verify rendering across target browsers
|
|
64
|
-
4. **Responsive Testing:** Test on different screen sizes and devices
|
|
65
|
-
5. **Performance Testing:** Check load times and rendering performance
|
|
66
|
-
|
|
67
|
-
# Step 6: Quality Assurance
|
|
68
|
-
|
|
69
|
-
## Linting and Formatting
|
|
70
|
-
- **HTML Linting:** Use tools like HTMLHint or validator
|
|
71
|
-
- **CSS Linting:** Run `stylelint` with project configuration
|
|
72
|
-
- **Formatting:** Use Prettier or project-specific formatters
|
|
73
|
-
- **Code Quality:** Ensure consistent indentation and organization
|
|
74
|
-
|
|
75
|
-
## Browser Compatibility
|
|
76
|
-
- **Progressive Enhancement:** Ensure core functionality works everywhere
|
|
77
|
-
- **Feature Detection:** Use modern features with fallbacks
|
|
78
|
-
- **Vendor Prefixing:** Use Autoprefixer for cross-browser compatibility
|
|
79
|
-
|
|
80
|
-
# Step 7: Optimization
|
|
81
|
-
|
|
82
|
-
## Performance Optimization
|
|
83
|
-
- **CSS Minification:** Use tools like cssnano for production
|
|
84
|
-
- **Image Optimization:** Compress and use appropriate formats
|
|
85
|
-
- **Critical CSS:** Inline above-the-fold styles for faster rendering
|
|
86
|
-
- **Lazy Loading:** Defer non-critical resources
|
|
87
|
-
|
|
88
|
-
## Accessibility Optimization
|
|
89
|
-
- **Keyboard Navigation:** Ensure all interactive elements are keyboard accessible
|
|
90
|
-
- **Screen Reader Compatibility:** Test with NVDA, VoiceOver, or JAWS
|
|
91
|
-
- **Color Contrast:** Verify sufficient contrast ratios
|
|
92
|
-
- **Focus Management:** Implement proper focus indicators and order
|
|
93
|
-
|
|
94
|
-
# Step 8: Finalize and Deliver
|
|
95
|
-
|
|
96
|
-
1. **Final Validation:** Run comprehensive validation and testing
|
|
97
|
-
2. **Documentation:** Update style guides or component documentation
|
|
98
|
-
3. **Performance Review:** Verify optimization targets are met
|
|
99
|
-
4. **Accessibility Audit:** Complete final accessibility checks
|
|
100
|
-
|
|
101
|
-
# Common Commands Reference
|
|
102
|
-
|
|
103
|
-
## Development Tools
|
|
104
|
-
- `stylelint "**/*.css"`: Lint CSS files
|
|
105
|
-
- `prettier --check "**/*.html"`: Check HTML formatting
|
|
106
|
-
- `prettier --write "**/*.{html,css}"`: Format HTML and CSS files
|
|
107
|
-
- `npx htmlhint "**/*.html"`: Lint HTML files
|
|
108
|
-
|
|
109
|
-
## Build and Optimization
|
|
110
|
-
- `npm run build`: Build project (if using build tools)
|
|
111
|
-
- `npm run dev`: Start development server
|
|
112
|
-
- `npm run lint`: Run all linting
|
|
113
|
-
- `npm run format`: Format all code
|
|
114
|
-
|
|
115
|
-
## Testing
|
|
116
|
-
- `npm test`: Run tests (if test framework configured)
|
|
117
|
-
- Browser developer tools for manual testing
|
|
118
|
-
- Lighthouse for performance and accessibility audits
|
|
119
|
-
|
|
120
|
-
# Risk Assessment Guidelines
|
|
121
|
-
|
|
122
|
-
## Low Risk (Proceed Directly)
|
|
123
|
-
- Adding new CSS classes following established patterns
|
|
124
|
-
- Creating new HTML components with semantic markup
|
|
125
|
-
- Running linters and validators
|
|
126
|
-
|
|
127
|
-
## Moderate Risk (Explain and Confirm)
|
|
128
|
-
- Modifying core layout or grid systems
|
|
129
|
-
- Changing established CSS architecture
|
|
130
|
-
- Adding new dependencies or frameworks
|
|
131
|
-
|
|
132
|
-
## High Risk (Refuse and Explain)
|
|
133
|
-
- Breaking existing responsive layouts
|
|
134
|
-
- Removing accessibility features
|
|
135
|
-
- Changes that affect multiple pages or components
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "A workflow for developing with Java, including project analysis and best practices."
|
|
3
|
-
---
|
|
4
|
-
Follow this workflow to deliver robust, maintainable Java code that follows project conventions.
|
|
5
|
-
|
|
6
|
-
# Core Mandates
|
|
7
|
-
|
|
8
|
-
- **Object-Oriented Excellence:** Follow SOLID principles and design patterns
|
|
9
|
-
- **Type Safety:** Leverage Java's strong typing system
|
|
10
|
-
- **Tool Integration:** Use Maven/Gradle and IDE tools effectively
|
|
11
|
-
- **Enterprise Standards:** Follow established Java enterprise patterns
|
|
12
|
-
|
|
13
|
-
# Tool Usage Guideline
|
|
14
|
-
- Use `read_from_file` to analyze build configurations and source code
|
|
15
|
-
- Use `search_files` to find Java patterns and conventions
|
|
16
|
-
- Use `run_shell_command` for build and test operations
|
|
17
|
-
- Use `list_files` to understand project structure
|
|
18
|
-
|
|
19
|
-
# Step 1: Project Analysis
|
|
20
|
-
|
|
21
|
-
1. **Build System:** Examine `pom.xml` (Maven) or `build.gradle` (Gradle)
|
|
22
|
-
2. **Java Version:** Check `.java-version` or build configuration
|
|
23
|
-
3. **Style Configuration:** Look for `.checkstyle.xml`, `.pmd.xml`, `.editorconfig`
|
|
24
|
-
4. **Testing Framework:** Analyze `src/test/java` and test dependencies
|
|
25
|
-
5. **Project Structure:** Understand package organization and module boundaries
|
|
26
|
-
6. **Dependencies:** Review dependency management and versioning
|
|
27
|
-
|
|
28
|
-
# Step 2: Understand Conventions
|
|
29
|
-
|
|
30
|
-
1. **Code Style:** Adhere to project's configured linter (Checkstyle, PMD)
|
|
31
|
-
2. **Package Organization:** Follow established package naming and structure
|
|
32
|
-
3. **Class Design:** Use appropriate design patterns and principles
|
|
33
|
-
4. **Exception Handling:** Follow project's exception handling strategy
|
|
34
|
-
5. **Testing Patterns:** Use established test frameworks and patterns
|
|
35
|
-
|
|
36
|
-
# Step 3: Implementation Planning
|
|
37
|
-
|
|
38
|
-
1. **Class Structure:** Plan new classes and interfaces based on project patterns
|
|
39
|
-
2. **Package Placement:** Determine appropriate package for new code
|
|
40
|
-
3. **Dependencies:** Identify required dependencies and verify compatibility
|
|
41
|
-
4. **API Design:** Consider public interfaces and backward compatibility
|
|
42
|
-
5. **Testing Strategy:** Plan comprehensive unit and integration tests
|
|
43
|
-
|
|
44
|
-
# Step 4: Write Code
|
|
45
|
-
|
|
46
|
-
## Code Quality Standards
|
|
47
|
-
- **Formatting:** Follow project's code style configuration
|
|
48
|
-
- **Documentation:** Add Javadoc for public APIs and complex logic
|
|
49
|
-
- **Naming:** Use clear, descriptive names following Java conventions
|
|
50
|
-
- **Immutability:** Prefer immutable objects where appropriate
|
|
51
|
-
- **Composition:** Favor composition over inheritance
|
|
52
|
-
|
|
53
|
-
## Implementation Patterns
|
|
54
|
-
- **Exception Handling:** Use checked exceptions for recoverable errors, unchecked for programming errors
|
|
55
|
-
- **Collections:** Use appropriate collection types and avoid raw types
|
|
56
|
-
- **Streams:** Leverage Java Streams for functional-style operations
|
|
57
|
-
- **Optional:** Use `Optional` for nullable return values
|
|
58
|
-
- **Records:** Use records for data carrier classes (Java 14+)
|
|
59
|
-
|
|
60
|
-
# Step 5: Testing and Verification
|
|
61
|
-
|
|
62
|
-
1. **Write Unit Tests:** Create comprehensive tests for all new functionality
|
|
63
|
-
2. **Run Tests:** Execute `mvn test` or `gradle test` to verify functionality
|
|
64
|
-
3. **Static Analysis:** Run Checkstyle, PMD, or other configured linters
|
|
65
|
-
4. **Build Verification:** Ensure code compiles without warnings
|
|
66
|
-
5. **Integration Tests:** Add integration tests for cross-component functionality
|
|
67
|
-
|
|
68
|
-
# Step 6: Quality Assurance
|
|
69
|
-
|
|
70
|
-
## Testing Standards
|
|
71
|
-
- **Test Structure:** Follow project's test organization patterns
|
|
72
|
-
- **Mocking:** Use appropriate mocking frameworks (Mockito, etc.)
|
|
73
|
-
- **Assertions:** Use fluent assertion libraries (AssertJ, Hamcrest)
|
|
74
|
-
- **Coverage:** Aim for high test coverage of business logic
|
|
75
|
-
|
|
76
|
-
## Code Review Checklist
|
|
77
|
-
- [ ] Code follows project formatting standards
|
|
78
|
-
- [ ] All tests pass with good coverage
|
|
79
|
-
- [ ] No static analysis warnings
|
|
80
|
-
- [ ] Exception handling is appropriate
|
|
81
|
-
- [ ] Javadoc is complete for public APIs
|
|
82
|
-
- [ ] Performance considerations addressed
|
|
83
|
-
- [ ] Thread safety considered where needed
|
|
84
|
-
|
|
85
|
-
# Step 7: Build and Deployment
|
|
86
|
-
|
|
87
|
-
## Maven Commands
|
|
88
|
-
- `mvn clean`: Clean build artifacts
|
|
89
|
-
- `mvn compile`: Compile source code
|
|
90
|
-
- `mvn test`: Run unit tests
|
|
91
|
-
- `mvn package`: Create deployable package
|
|
92
|
-
- `mvn install`: Install to local repository
|
|
93
|
-
- `mvn verify`: Run integration tests
|
|
94
|
-
|
|
95
|
-
## Gradle Commands
|
|
96
|
-
- `./gradlew clean`: Clean build artifacts
|
|
97
|
-
- `./gradlew build`: Build and test
|
|
98
|
-
- `./gradlew test`: Run unit tests
|
|
99
|
-
- `./gradlew check`: Run all checks
|
|
100
|
-
|
|
101
|
-
# Step 8: Finalize and Deliver
|
|
102
|
-
|
|
103
|
-
1. **Verify Dependencies:** Ensure dependency versions are consistent
|
|
104
|
-
2. **Run Full Test Suite:** Verify all existing tests still pass
|
|
105
|
-
3. **Static Analysis:** Address any remaining linting issues
|
|
106
|
-
4. **Documentation:** Update relevant documentation and Javadoc
|
|
107
|
-
5. **Performance Testing:** Verify performance characteristics
|
|
108
|
-
|
|
109
|
-
# Advanced Java Features
|
|
110
|
-
|
|
111
|
-
## Modern Java (8+)
|
|
112
|
-
- **Lambdas:** Use for concise functional programming
|
|
113
|
-
- **Streams:** Process collections efficiently
|
|
114
|
-
- **Optional:** Handle null values safely
|
|
115
|
-
- **Modules:** Use Java Platform Module System (JPMS) if configured
|
|
116
|
-
|
|
117
|
-
## Concurrency
|
|
118
|
-
- **CompletableFuture:** For asynchronous programming
|
|
119
|
-
- **Executors:** Manage thread pools effectively
|
|
120
|
-
- **Concurrent Collections:** Use thread-safe collections
|
|
121
|
-
- **Synchronization:** Prefer higher-level concurrency utilities
|
|
122
|
-
|
|
123
|
-
## Enterprise Patterns
|
|
124
|
-
- **Dependency Injection:** Use Spring, CDI, or other DI frameworks
|
|
125
|
-
- **AOP:** Implement cross-cutting concerns appropriately
|
|
126
|
-
- **Persistence:** Follow established ORM patterns (JPA, Hibernate)
|
|
127
|
-
- **REST APIs:** Use JAX-RS or Spring MVC consistently
|
|
128
|
-
|
|
129
|
-
# Risk Assessment Guidelines
|
|
130
|
-
|
|
131
|
-
## Low Risk (Proceed Directly)
|
|
132
|
-
- Adding tests to existing test suites
|
|
133
|
-
- Implementing utility methods in existing classes
|
|
134
|
-
- Following established patterns in new classes
|
|
135
|
-
|
|
136
|
-
## Moderate Risk (Explain and Confirm)
|
|
137
|
-
- Modifying core business logic
|
|
138
|
-
- Changing public API interfaces
|
|
139
|
-
- Adding new dependencies
|
|
140
|
-
- Modifying build configuration
|
|
141
|
-
|
|
142
|
-
## High Risk (Refuse and Explain)
|
|
143
|
-
- Breaking backward compatibility
|
|
144
|
-
- Modifying critical security components
|
|
145
|
-
- Changes affecting multiple modules
|
|
146
|
-
- Operations that could break the build system
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: "A workflow for developing with JavaScript and TypeScript, including project analysis and best practices."
|
|
3
|
-
---
|
|
4
|
-
Follow this workflow to deliver robust, maintainable JavaScript/TypeScript code that follows project conventions.
|
|
5
|
-
|
|
6
|
-
# Core Mandates
|
|
7
|
-
|
|
8
|
-
- **Type Safety First:** Use TypeScript when available, proper typing in JavaScript
|
|
9
|
-
- **Modern Standards:** Follow ES6+ features and best practices
|
|
10
|
-
- **Framework Consistency:** Adhere to project's framework conventions
|
|
11
|
-
- **Tool Integration:** Leverage comprehensive JavaScript tooling ecosystem
|
|
12
|
-
|
|
13
|
-
# Tool Usage Guideline
|
|
14
|
-
- Use `read_from_file` to analyze package.json and configuration files
|
|
15
|
-
- Use `search_files` to find JavaScript/TypeScript patterns
|
|
16
|
-
- Use `run_shell_command` for npm/yarn/pnpm operations
|
|
17
|
-
- Use `list_files` to understand project structure
|
|
18
|
-
|
|
19
|
-
# Step 1: Project Analysis
|
|
20
|
-
|
|
21
|
-
1. **Package Management:** Examine `package.json` and lock files (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`)
|
|
22
|
-
2. **TypeScript Configuration:** Check for `tsconfig.json` and TypeScript usage
|
|
23
|
-
3. **Linting Configuration:** Look for `.eslintrc.js`, `.prettierrc`, ESLint config in `package.json`
|
|
24
|
-
4. **Build Configuration:** Analyze `webpack.config.js`, `vite.config.ts`, `rollup.config.js`
|
|
25
|
-
5. **Testing Framework:** Check for `jest.config.js`, `vitest.config.ts`, test directories
|
|
26
|
-
6. **Framework Usage:** Identify React, Vue, Angular, or other framework usage
|
|
27
|
-
|
|
28
|
-
# Step 2: Understand Conventions
|
|
29
|
-
|
|
30
|
-
1. **Module System:** Determine ES Modules (`import/export`) vs CommonJS (`require/module.exports`)
|
|
31
|
-
2. **TypeScript Strictness:** Adhere to project's TypeScript configuration
|
|
32
|
-
3. **Framework Patterns:** Follow established component, state management, and routing patterns
|
|
33
|
-
4. **Styling Approach:** Understand CSS-in-JS, CSS modules, or traditional CSS usage
|
|
34
|
-
5. **Testing Strategy:** Follow established test patterns and mocking approaches
|
|
35
|
-
|
|
36
|
-
# Step 3: Implementation Planning
|
|
37
|
-
|
|
38
|
-
1. **File Structure:** Plan where new code should be placed based on project conventions
|
|
39
|
-
2. **Type Definitions:** Plan TypeScript interfaces and types for new functionality
|
|
40
|
-
3. **Component Design:** Design React/Vue/Angular components following established patterns
|
|
41
|
-
4. **State Management:** Determine appropriate state management approach
|
|
42
|
-
5. **Testing Strategy:** Plan comprehensive unit, integration, and end-to-end tests
|
|
43
|
-
|
|
44
|
-
# Step 4: Write Code
|
|
45
|
-
|
|
46
|
-
## Code Quality Standards
|
|
47
|
-
- **Formatting:** Use Prettier with project configuration
|
|
48
|
-
- **Linting:** Follow ESLint rules and address all warnings
|
|
49
|
-
- **Type Safety:** Use TypeScript strictly when available
|
|
50
|
-
- **Naming:** Use clear, descriptive names following project conventions
|
|
51
|
-
- **Documentation:** Add JSDoc/TSDoc for complex functions and public APIs
|
|
52
|
-
|
|
53
|
-
## Framework-Specific Patterns
|
|
54
|
-
|
|
55
|
-
### React
|
|
56
|
-
- **Functional Components:** Use hooks-based functional components
|
|
57
|
-
- **State Management:** Follow established patterns (useState, useReducer, Redux, etc.)
|
|
58
|
-
- **Performance:** Use React.memo, useMemo, useCallback appropriately
|
|
59
|
-
- **Testing:** Use React Testing Library and established testing patterns
|
|
60
|
-
|
|
61
|
-
### Vue
|
|
62
|
-
- **Composition API:** Prefer Composition API over Options API
|
|
63
|
-
- **State Management:** Use Pinia or Vuex following project patterns
|
|
64
|
-
- **Component Structure:** Follow single-file component conventions
|
|
65
|
-
- **Testing:** Use Vue Test Utils and established testing patterns
|
|
66
|
-
|
|
67
|
-
### Angular
|
|
68
|
-
- **Component Structure:** Follow Angular module and component conventions
|
|
69
|
-
- **Dependency Injection:** Use Angular's DI system appropriately
|
|
70
|
-
- **RxJS:** Follow established reactive programming patterns
|
|
71
|
-
- **Testing:** Use Angular Testing utilities and established patterns
|
|
72
|
-
|
|
73
|
-
# Step 5: Testing and Verification
|
|
74
|
-
|
|
75
|
-
1. **Write Tests:** Create comprehensive tests for all new functionality
|
|
76
|
-
2. **Run Tests:** Execute `npm test` or framework-specific test commands
|
|
77
|
-
3. **Type Checking:** Run `npm run typecheck` or `tsc --noEmit`
|
|
78
|
-
4. **Linting:** Run `npm run lint` to catch code quality issues
|
|
79
|
-
5. **Build Verification:** Run `npm run build` to ensure code compiles correctly
|
|
80
|
-
|
|
81
|
-
# Step 6: Quality Assurance
|
|
82
|
-
|
|
83
|
-
## Testing Standards
|
|
84
|
-
- **Unit Tests:** Test individual functions and components in isolation
|
|
85
|
-
- **Integration Tests:** Test component interactions and API integrations
|
|
86
|
-
- **End-to-End Tests:** Test complete user workflows (if configured)
|
|
87
|
-
- **Mocking:** Use appropriate mocking libraries and patterns
|
|
88
|
-
- **Coverage:** Aim for high test coverage of business logic
|
|
89
|
-
|
|
90
|
-
## Code Review Checklist
|
|
91
|
-
- [ ] Code follows project formatting and linting standards
|
|
92
|
-
- [ ] All tests pass with good coverage
|
|
93
|
-
- [ ] TypeScript compiles without errors (if applicable)
|
|
94
|
-
- [ ] No ESLint warnings
|
|
95
|
-
- [ ] Documentation is complete for complex logic
|
|
96
|
-
- [ ] Performance considerations addressed
|
|
97
|
-
- [ ] Accessibility requirements met
|
|
98
|
-
|
|
99
|
-
# Step 7: Package Management
|
|
100
|
-
|
|
101
|
-
## Dependency Management
|
|
102
|
-
- **npm:** Use `npm install <package>` for new dependencies
|
|
103
|
-
- **yarn:** Use `yarn add <package>` for new dependencies
|
|
104
|
-
- **pnpm:** Use `pnpm add <package>` for new dependencies
|
|
105
|
-
- **Version Management:** Follow project's versioning strategy
|
|
106
|
-
|
|
107
|
-
## Script Execution
|
|
108
|
-
- `npm install` / `yarn install` / `pnpm install`: Install dependencies
|
|
109
|
-
- `npm run dev` / `yarn dev` / `pnpm dev`: Start development server
|
|
110
|
-
- `npm run build` / `yarn build` / `pnpm build`: Build for production
|
|
111
|
-
- `npm run lint` / `yarn lint` / `pnpm lint`: Run linting
|
|
112
|
-
|
|
113
|
-
# Step 8: Finalize and Deliver
|
|
114
|
-
|
|
115
|
-
1. **Verify Dependencies:** Ensure dependency versions are consistent
|
|
116
|
-
2. **Run Full Test Suite:** Verify all existing tests still pass
|
|
117
|
-
3. **Type Checking:** Ensure TypeScript compilation succeeds
|
|
118
|
-
4. **Build Verification:** Confirm production build works correctly
|
|
119
|
-
5. **Documentation:** Update relevant documentation and comments
|
|
120
|
-
|
|
121
|
-
# Common Commands Reference
|
|
122
|
-
|
|
123
|
-
## Development
|
|
124
|
-
- `npm run dev`: Start development server
|
|
125
|
-
- `npm run build`: Build for production
|
|
126
|
-
- `npm run typecheck`: Type check TypeScript code
|
|
127
|
-
- `npm run lint`: Run ESLint
|
|
128
|
-
- `npm run format`: Format code with Prettier
|
|
129
|
-
|
|
130
|
-
## Testing
|
|
131
|
-
- `npm test`: Run tests
|
|
132
|
-
- `npm run test:watch`: Run tests in watch mode
|
|
133
|
-
- `npm run test:coverage`: Run tests with coverage
|
|
134
|
-
- `npm run test:e2e`: Run end-to-end tests (if configured)
|
|
135
|
-
|
|
136
|
-
## Debugging
|
|
137
|
-
- Browser developer tools for frontend debugging
|
|
138
|
-
- `node --inspect` for Node.js debugging
|
|
139
|
-
- Framework-specific debugging tools
|
|
140
|
-
|
|
141
|
-
# Risk Assessment Guidelines
|
|
142
|
-
|
|
143
|
-
## Low Risk (Proceed Directly)
|
|
144
|
-
- Adding tests to existing test suites
|
|
145
|
-
- Implementing utility functions following established patterns
|
|
146
|
-
- Creating new components in established patterns
|
|
147
|
-
|
|
148
|
-
## Moderate Risk (Explain and Confirm)
|
|
149
|
-
- Modifying core application state
|
|
150
|
-
- Changing public API interfaces
|
|
151
|
-
- Adding new dependencies
|
|
152
|
-
- Modifying build configuration
|
|
153
|
-
|
|
154
|
-
## High Risk (Refuse and Explain)
|
|
155
|
-
- Breaking TypeScript strict mode compliance
|
|
156
|
-
- Modifying critical security components
|
|
157
|
-
- Changes affecting multiple applications
|
|
158
|
-
- Operations that could break the build system
|