amazingteam 3.0.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/.ai-team/agents/architect.md +144 -0
- package/.ai-team/agents/ci-analyst.md +188 -0
- package/.ai-team/agents/developer.md +176 -0
- package/.ai-team/agents/planner.md +355 -0
- package/.ai-team/agents/qa.md +189 -0
- package/.ai-team/agents/reviewer.md +211 -0
- package/.ai-team/agents/triage.md +146 -0
- package/.ai-team/commands/ci-analyze.md +116 -0
- package/.ai-team/commands/design.md +100 -0
- package/.ai-team/commands/implement.md +108 -0
- package/.ai-team/commands/release-check.md +142 -0
- package/.ai-team/commands/review.md +142 -0
- package/.ai-team/commands/test.md +115 -0
- package/.ai-team/commands/triage.md +138 -0
- package/.ai-team/memory/architect/architecture_notes.md +67 -0
- package/.ai-team/memory/architect/design_rationale.md +113 -0
- package/.ai-team/memory/architect/module_map.md +84 -0
- package/.ai-team/memory/ci-analyst/failure_patterns.md +102 -0
- package/.ai-team/memory/ci-analyst/runbook_references.md +87 -0
- package/.ai-team/memory/developer/bug_investigation.md +102 -0
- package/.ai-team/memory/developer/build_issues.md +115 -0
- package/.ai-team/memory/developer/implementation_notes.md +83 -0
- package/.ai-team/memory/failures/failure_library.md +103 -0
- package/.ai-team/memory/planner/decomposition_notes.md +82 -0
- package/.ai-team/memory/planner/flow_rules.md +86 -0
- package/.ai-team/memory/planner/github_issue_patterns.md +229 -0
- package/.ai-team/memory/qa/regression_cases.md +101 -0
- package/.ai-team/memory/qa/test_strategy.md +138 -0
- package/.ai-team/memory/qa/validation_notes.md +110 -0
- package/.ai-team/memory/reviewer/quality_rules.md +105 -0
- package/.ai-team/memory/reviewer/recurring_risks.md +109 -0
- package/.ai-team/memory/reviewer/review_notes.md +124 -0
- package/.ai-team/memory/triage/classification_heuristics.md +82 -0
- package/.ai-team/memory/triage/debug_notes.md +87 -0
- package/.ai-team/opencode.template.jsonc +216 -0
- package/.ai-team/skills/bugfix-playbook/skill.md +174 -0
- package/.ai-team/skills/ci-failure-analysis/skill.md +176 -0
- package/.ai-team/skills/issue-triage/skill.md +163 -0
- package/.ai-team/skills/regression-checklist/skill.md +176 -0
- package/.ai-team/skills/release-readiness-check/skill.md +216 -0
- package/.ai-team/skills/repo-architecture-reader/skill.md +139 -0
- package/.ai-team/skills/safe-refactor-checklist/skill.md +215 -0
- package/.ai-team/skills/task-breakdown-and-dispatch/skill.md +151 -0
- package/.ai-team/skills/test-first-feature-dev/skill.md +205 -0
- package/.ai-team/workflows/ci.yml +81 -0
- package/.ai-team/workflows/nightly-ai-maintenance.yml +129 -0
- package/.ai-team/workflows/opencode.yml +33 -0
- package/.ai-team/workflows/pr-check.yml +41 -0
- package/.foundation/foundation.lock +38 -0
- package/.foundation/local-overrides.md +97 -0
- package/.foundation/upgrade-history.md +38 -0
- package/.opencode/agents/architect.md +38 -0
- package/.opencode/agents/ci-analyst.md +38 -0
- package/.opencode/agents/developer.md +43 -0
- package/.opencode/agents/planner.md +47 -0
- package/.opencode/agents/qa.md +34 -0
- package/.opencode/agents/reviewer.md +38 -0
- package/.opencode/agents/triage.md +37 -0
- package/.opencode/commands/auto.md +264 -0
- package/.opencode/commands/breakdown-issue.md +94 -0
- package/.opencode/commands/ci-analyze.md +15 -0
- package/.opencode/commands/close-parent-task.md +122 -0
- package/.opencode/commands/design.md +15 -0
- package/.opencode/commands/dispatch-next.md +102 -0
- package/.opencode/commands/implement.md +16 -0
- package/.opencode/commands/release-check.md +16 -0
- package/.opencode/commands/resume.md +88 -0
- package/.opencode/commands/review.md +15 -0
- package/.opencode/commands/show-blockers.md +97 -0
- package/.opencode/commands/summarize-parent.md +121 -0
- package/.opencode/commands/test.md +15 -0
- package/.opencode/commands/triage.md +109 -0
- package/.opencode/skills/bugfix-playbook/SKILL.md +81 -0
- package/.opencode/skills/ci-failure-analysis/SKILL.md +94 -0
- package/.opencode/skills/issue-triage/SKILL.md +80 -0
- package/.opencode/skills/regression-checklist/SKILL.md +81 -0
- package/.opencode/skills/release-readiness-check/SKILL.md +81 -0
- package/.opencode/skills/repo-architecture-reader/SKILL.md +65 -0
- package/.opencode/skills/safe-refactor-checklist/SKILL.md +76 -0
- package/.opencode/skills/task-breakdown-and-dispatch/SKILL.md +255 -0
- package/.opencode/skills/test-first-feature-dev/SKILL.md +78 -0
- package/AGENTS.md +879 -0
- package/CHANGELOG.md +261 -0
- package/LICENSE +21 -0
- package/README.md +1215 -0
- package/VERSION +1 -0
- package/action/__tests__/downloader.test.js +251 -0
- package/action/__tests__/merger.test.js +156 -0
- package/action/__tests__/path-resolver.test.js +199 -0
- package/action/__tests__/validator.test.js +310 -0
- package/action/action.yml +61 -0
- package/action/index.js +223 -0
- package/action/lib/downloader.js +344 -0
- package/action/lib/merger.js +170 -0
- package/action/lib/path-resolver.js +176 -0
- package/action/lib/setup.js +286 -0
- package/action/lib/validator.js +324 -0
- package/cli/__tests__/cli.test.js +270 -0
- package/cli/amazingteam.cjs +225 -0
- package/cli/commands/check-update.cjs +159 -0
- package/cli/commands/init.cjs +412 -0
- package/cli/commands/local.cjs +264 -0
- package/cli/commands/migrate.cjs +316 -0
- package/cli/commands/status.cjs +241 -0
- package/cli/commands/upgrade.cjs +213 -0
- package/cli/commands/validate.cjs +259 -0
- package/cli/commands/version.cjs +59 -0
- package/cli/sync.cjs +237 -0
- package/dist/index.js +35 -0
- package/docs/architecture/overview.md +138 -0
- package/docs/blocker_resolution_design.md +372 -0
- package/docs/bootstrap-model.md +356 -0
- package/docs/config-reference.md +458 -0
- package/docs/how-to-use.md +178 -0
- package/docs/migration-to-v3.md +355 -0
- package/docs/overlay-guide.md +156 -0
- package/docs/patterns/README.md +67 -0
- package/docs/quick-start-v3.md +330 -0
- package/docs/releases/README.md +64 -0
- package/docs/runbooks/ci/README.md +62 -0
- package/docs/runbooks/ci/build-debug.md +120 -0
- package/docs/runbooks/ci/flaky-tests.md +127 -0
- package/docs/runbooks/getting-started.md +81 -0
- package/docs/upgrade-policy.md +188 -0
- package/docs/versioning.md +199 -0
- package/overlays/README.md +30 -0
- package/overlays/ai-agent-product/.ai-team/skills/llm-integration/skill.md +99 -0
- package/overlays/ai-agent-product/docs/ai-agent-architecture.md +68 -0
- package/overlays/ai-agent-product/overlay.yaml +26 -0
- package/overlays/cpp-qt-desktop/.ai-team/skills/qt-signals-slots/skill.md +60 -0
- package/overlays/cpp-qt-desktop/docs/qt-conventions.md +64 -0
- package/overlays/cpp-qt-desktop/overlay.yaml +22 -0
- package/overlays/python-backend/.ai-team/skills/python-testing/skill.md +90 -0
- package/overlays/python-backend/docs/python-style.md +78 -0
- package/overlays/python-backend/overlay.yaml +22 -0
- package/overlays/web-fullstack/.ai-team/skills/frontend-testing/skill.md +70 -0
- package/overlays/web-fullstack/docs/frontend-conventions.md +68 -0
- package/overlays/web-fullstack/overlay.yaml +26 -0
- package/package.json +84 -0
- package/presets/default.yaml +161 -0
- package/presets/go.yaml +43 -0
- package/presets/python.yaml +43 -0
- package/presets/typescript.yaml +40 -0
- package/schemas/config.schema.json +239 -0
- package/scripts/diff_foundation_vs_project.sh +134 -0
- package/scripts/generate_docs.sh +200 -0
- package/scripts/init_project.sh +455 -0
- package/scripts/plan_upgrade.sh +268 -0
- package/scripts/upgrade_foundation.sh +365 -0
- package/scripts/validate-foundation.cjs +278 -0
- package/scripts/validate_foundation.sh +192 -0
- package/scripts/validate_project_setup.sh +171 -0
- package/tasks/README.md +94 -0
- package/tasks/_template/analysis.md +76 -0
- package/tasks/_template/design.md +121 -0
- package/tasks/_template/implementation.md +121 -0
- package/tasks/_template/release.md +119 -0
- package/tasks/_template/review.md +131 -0
- package/tasks/_template/subtasks/task.yaml +24 -0
- package/tasks/_template/task.yaml +75 -0
- package/tasks/_template/validation.md +128 -0
- package/templates/amazingteam.yml +81 -0
- package/templates/gitignore +14 -0
- package/templates/opencode.jsonc +216 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Qt Signals & Slots Skill
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Guide for implementing Qt signals and slots pattern in C++ applications.
|
|
6
|
+
|
|
7
|
+
## Best Practices
|
|
8
|
+
|
|
9
|
+
### Signal Declaration
|
|
10
|
+
|
|
11
|
+
```cpp
|
|
12
|
+
signals:
|
|
13
|
+
void dataChanged(const QString& id);
|
|
14
|
+
void statusUpdated(Status newStatus);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Slot Declaration
|
|
18
|
+
|
|
19
|
+
```cpp
|
|
20
|
+
public slots:
|
|
21
|
+
void onDataChanged(const QString& id);
|
|
22
|
+
void handleStatusUpdate(Status newStatus);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Connection Patterns
|
|
26
|
+
|
|
27
|
+
```cpp
|
|
28
|
+
// Old syntax (Qt 4/5 compatible)
|
|
29
|
+
connect(sender, SIGNAL(dataChanged(QString)),
|
|
30
|
+
receiver, SLOT(onDataChanged(QString)));
|
|
31
|
+
|
|
32
|
+
// New syntax (Qt 5+, preferred)
|
|
33
|
+
connect(sender, &Sender::dataChanged,
|
|
34
|
+
receiver, &Receiver::onDataChanged);
|
|
35
|
+
|
|
36
|
+
// Lambda connection
|
|
37
|
+
connect(sender, &Sender::dataChanged, this, [this](const QString& id) {
|
|
38
|
+
handleDataChange(id);
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Common Mistakes to Avoid
|
|
43
|
+
|
|
44
|
+
1. **Missing Q_OBJECT macro** - Always include in class declaration
|
|
45
|
+
2. **Signal-slot signature mismatch** - Parameters must match exactly
|
|
46
|
+
3. **Dangling connections** - Use Qt::UniqueConnection when appropriate
|
|
47
|
+
4. **Blocking slots** - Avoid heavy operations in slots
|
|
48
|
+
|
|
49
|
+
## Testing Signals
|
|
50
|
+
|
|
51
|
+
```cpp
|
|
52
|
+
QSignalSpy spy(&object, &MyClass::dataChanged);
|
|
53
|
+
emit object.doSomething();
|
|
54
|
+
QCOMPARE(spy.count(), 1);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Thread Safety
|
|
58
|
+
|
|
59
|
+
- Use `Qt::QueuedConnection` for cross-thread communication
|
|
60
|
+
- Avoid direct signal emission from worker threads to UI
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Qt Coding Conventions
|
|
2
|
+
|
|
3
|
+
## Naming Conventions
|
|
4
|
+
|
|
5
|
+
| Type | Convention | Example |
|
|
6
|
+
|------|------------|---------|
|
|
7
|
+
| Classes | PascalCase | `MainWindow` |
|
|
8
|
+
| Functions | camelCase | `calculateTotal()` |
|
|
9
|
+
| Variables | camelCase | `userName` |
|
|
10
|
+
| Constants | camelCase | `maxRetryCount` |
|
|
11
|
+
| Member variables | m_ prefix | `m_userName` |
|
|
12
|
+
| Signals | camelCase | `dataChanged()` |
|
|
13
|
+
| Slots | camelCase | `onDataChanged()` |
|
|
14
|
+
|
|
15
|
+
## File Organization
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
src/
|
|
19
|
+
├── main.cpp
|
|
20
|
+
├── mainwindow.h
|
|
21
|
+
├── mainwindow.cpp
|
|
22
|
+
├── models/
|
|
23
|
+
│ ├── usermodel.h
|
|
24
|
+
│ └── usermodel.cpp
|
|
25
|
+
└── widgets/
|
|
26
|
+
├── customwidget.h
|
|
27
|
+
└── customwidget.cpp
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Header Guards
|
|
31
|
+
|
|
32
|
+
```cpp
|
|
33
|
+
#ifndef MAINWINDOW_H
|
|
34
|
+
#define MAINWINDOW_H
|
|
35
|
+
|
|
36
|
+
// ... declarations
|
|
37
|
+
|
|
38
|
+
#endif // MAINWINDOW_H
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Memory Management
|
|
42
|
+
|
|
43
|
+
- Parent-child ownership for QObjects
|
|
44
|
+
- Use `std::unique_ptr` for non-QObject types
|
|
45
|
+
- Avoid raw pointers for ownership
|
|
46
|
+
|
|
47
|
+
## Signal-Slot Connections
|
|
48
|
+
|
|
49
|
+
```cpp
|
|
50
|
+
// Preferred: New syntax
|
|
51
|
+
connect(sender, &Sender::signal, receiver, &Receiver::slot);
|
|
52
|
+
|
|
53
|
+
// With lambda
|
|
54
|
+
connect(button, &QPushButton::clicked, this, [this]() {
|
|
55
|
+
handleClick();
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Best Practices
|
|
60
|
+
|
|
61
|
+
1. Use Qt's property system for QML integration
|
|
62
|
+
2. Prefer `QString` over `std::string`
|
|
63
|
+
3. Use Qt's container classes for Qt integration
|
|
64
|
+
4. Enable Qt's memory debugger in debug builds
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: cpp-qt-desktop
|
|
2
|
+
description: C++ Qt desktop application configuration
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
compatible_foundation_versions:
|
|
5
|
+
- "2.0.0"
|
|
6
|
+
|
|
7
|
+
overrides:
|
|
8
|
+
- .ai-team/agents/developer.md
|
|
9
|
+
- .github/workflows/ci.yml
|
|
10
|
+
|
|
11
|
+
additions:
|
|
12
|
+
- .ai-team/skills/qt-signals-slots/
|
|
13
|
+
- docs/qt-conventions.md
|
|
14
|
+
|
|
15
|
+
language: cpp
|
|
16
|
+
framework: qt
|
|
17
|
+
build_system: cmake
|
|
18
|
+
|
|
19
|
+
environment:
|
|
20
|
+
compiler: gcc
|
|
21
|
+
qt_version: "6.x"
|
|
22
|
+
cmake_minimum: "3.16"
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Python Testing Skill
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Guide for testing Python backend services.
|
|
6
|
+
|
|
7
|
+
## Testing Stack
|
|
8
|
+
|
|
9
|
+
- **pytest**: Test framework
|
|
10
|
+
- **pytest-asyncio**: Async test support
|
|
11
|
+
- **pytest-cov**: Coverage reporting
|
|
12
|
+
- **faker**: Test data generation
|
|
13
|
+
- **freezegun**: Time manipulation
|
|
14
|
+
|
|
15
|
+
## Test Structure
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
tests/
|
|
19
|
+
├── unit/
|
|
20
|
+
│ ├── test_services/
|
|
21
|
+
│ └── test_models/
|
|
22
|
+
├── integration/
|
|
23
|
+
│ ├── test_api/
|
|
24
|
+
│ └── test_database/
|
|
25
|
+
└── conftest.py
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Writing Tests
|
|
29
|
+
|
|
30
|
+
### Basic Test
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
def test_create_user():
|
|
34
|
+
user = User(name="test", email="test@example.com")
|
|
35
|
+
assert user.name == "test"
|
|
36
|
+
assert user.is_valid()
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Async Test
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
@pytest.mark.asyncio
|
|
43
|
+
async def test_async_operation():
|
|
44
|
+
result = await async_function()
|
|
45
|
+
assert result is not None
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Fixture Usage
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
@pytest.fixture
|
|
52
|
+
def mock_database():
|
|
53
|
+
return MockDatabase()
|
|
54
|
+
|
|
55
|
+
def test_with_mock(mock_database):
|
|
56
|
+
repo = UserRepository(mock_database)
|
|
57
|
+
assert repo.find(1) is not None
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Coverage Requirements
|
|
61
|
+
|
|
62
|
+
- Minimum coverage: 80%
|
|
63
|
+
- Critical paths: 100%
|
|
64
|
+
- Run: `pytest --cov=src --cov-report=html`
|
|
65
|
+
|
|
66
|
+
## Common Patterns
|
|
67
|
+
|
|
68
|
+
### Mocking External Services
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from unittest.mock import patch, AsyncMock
|
|
72
|
+
|
|
73
|
+
@patch("module.external_api")
|
|
74
|
+
async def test_api_call(mock_api):
|
|
75
|
+
mock_api.return_value = AsyncMock(return_value={"status": "ok"})
|
|
76
|
+
result = await call_api()
|
|
77
|
+
assert result["status"] == "ok"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Database Testing
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
@pytest.fixture
|
|
84
|
+
async def db_session():
|
|
85
|
+
async with engine.begin() as conn:
|
|
86
|
+
await conn.run_sync(Base.metadata.create_all)
|
|
87
|
+
yield session
|
|
88
|
+
async with engine.begin() as conn:
|
|
89
|
+
await conn.run_sync(Base.metadata.drop_all)
|
|
90
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Python Style Guide
|
|
2
|
+
|
|
3
|
+
## Code Style
|
|
4
|
+
|
|
5
|
+
This project follows PEP 8 with some modifications.
|
|
6
|
+
|
|
7
|
+
### Formatting Tools
|
|
8
|
+
|
|
9
|
+
- **Formatter**: Black (line length: 88)
|
|
10
|
+
- **Linter**: Ruff
|
|
11
|
+
- **Type Checker**: mypy
|
|
12
|
+
- **Import Sorter**: isort
|
|
13
|
+
|
|
14
|
+
### Naming Conventions
|
|
15
|
+
|
|
16
|
+
| Type | Convention | Example |
|
|
17
|
+
|------|------------|---------|
|
|
18
|
+
| Modules | snake_case | `user_service.py` |
|
|
19
|
+
| Classes | PascalCase | `UserService` |
|
|
20
|
+
| Functions | snake_case | `get_user_by_id` |
|
|
21
|
+
| Variables | snake_case | `user_name` |
|
|
22
|
+
| Constants | SCREAMING_SNAKE_CASE | `MAX_RETRY_COUNT` |
|
|
23
|
+
| Private | _prefix | `_internal_method` |
|
|
24
|
+
|
|
25
|
+
### Type Hints
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from typing import Optional, List
|
|
29
|
+
|
|
30
|
+
def get_user(user_id: int) -> Optional[User]:
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
def get_users() -> List[User]:
|
|
34
|
+
...
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Docstrings
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
def calculate_total(items: List[Item]) -> float:
|
|
41
|
+
"""Calculate the total price of items.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
items: List of items to sum.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
Total price including tax.
|
|
48
|
+
|
|
49
|
+
Raises:
|
|
50
|
+
ValueError: If items is empty.
|
|
51
|
+
"""
|
|
52
|
+
...
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Project Structure
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
src/
|
|
59
|
+
├── __init__.py
|
|
60
|
+
├── main.py
|
|
61
|
+
├── api/
|
|
62
|
+
│ ├── __init__.py
|
|
63
|
+
│ └── routes.py
|
|
64
|
+
├── services/
|
|
65
|
+
│ ├── __init__.py
|
|
66
|
+
│ └── user_service.py
|
|
67
|
+
└── models/
|
|
68
|
+
├── __init__.py
|
|
69
|
+
└── user.py
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Best Practices
|
|
73
|
+
|
|
74
|
+
1. Use f-strings for string formatting
|
|
75
|
+
2. Prefer composition over inheritance
|
|
76
|
+
3. Use dataclasses for data containers
|
|
77
|
+
4. Keep functions under 30 lines
|
|
78
|
+
5. Write docstrings for public APIs
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: python-backend
|
|
2
|
+
description: Python backend service configuration
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
compatible_foundation_versions:
|
|
5
|
+
- "2.0.0"
|
|
6
|
+
|
|
7
|
+
overrides:
|
|
8
|
+
- .ai-team/agents/developer.md
|
|
9
|
+
- .github/workflows/ci.yml
|
|
10
|
+
|
|
11
|
+
additions:
|
|
12
|
+
- .ai-team/skills/python-testing/
|
|
13
|
+
- docs/python-style.md
|
|
14
|
+
|
|
15
|
+
language: python
|
|
16
|
+
framework: fastapi
|
|
17
|
+
package_manager: poetry
|
|
18
|
+
|
|
19
|
+
environment:
|
|
20
|
+
python_version: "3.11"
|
|
21
|
+
linter: ruff
|
|
22
|
+
formatter: black
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Frontend Testing Skill
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Guide for testing React/Next.js frontend applications.
|
|
6
|
+
|
|
7
|
+
## Testing Stack
|
|
8
|
+
|
|
9
|
+
- **Jest**: Test runner
|
|
10
|
+
- **React Testing Library**: Component testing
|
|
11
|
+
- **Playwright**: E2E testing
|
|
12
|
+
- **MSW**: API mocking
|
|
13
|
+
|
|
14
|
+
## Component Testing
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
18
|
+
import { Button } from './Button';
|
|
19
|
+
|
|
20
|
+
describe('Button', () => {
|
|
21
|
+
it('renders with text', () => {
|
|
22
|
+
render(<Button>Click me</Button>);
|
|
23
|
+
expect(screen.getByText('Click me')).toBeInTheDocument();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('calls onClick when clicked', () => {
|
|
27
|
+
const handleClick = jest.fn();
|
|
28
|
+
render(<Button onClick={handleClick}>Click</Button>);
|
|
29
|
+
fireEvent.click(screen.getByText('Click'));
|
|
30
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Hook Testing
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { renderHook, act } from '@testing-library/react-hooks';
|
|
39
|
+
import { useCounter } from './useCounter';
|
|
40
|
+
|
|
41
|
+
describe('useCounter', () => {
|
|
42
|
+
it('increments counter', () => {
|
|
43
|
+
const { result } = renderHook(() => useCounter());
|
|
44
|
+
act(() => result.current.increment());
|
|
45
|
+
expect(result.current.count).toBe(1);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## E2E Testing with Playwright
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import { test, expect } from '@playwright/test';
|
|
54
|
+
|
|
55
|
+
test('user can login', async ({ page }) => {
|
|
56
|
+
await page.goto('/login');
|
|
57
|
+
await page.fill('[name="email"]', 'test@example.com');
|
|
58
|
+
await page.fill('[name="password"]', 'password');
|
|
59
|
+
await page.click('button[type="submit"]');
|
|
60
|
+
await expect(page).toHaveURL('/dashboard');
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Best Practices
|
|
65
|
+
|
|
66
|
+
1. Test user behavior, not implementation
|
|
67
|
+
2. Use `data-testid` for reliable selectors
|
|
68
|
+
3. Mock API calls with MSW
|
|
69
|
+
4. Keep tests isolated
|
|
70
|
+
5. Aim for 80% coverage
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Frontend Conventions
|
|
2
|
+
|
|
3
|
+
## Component Structure
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
// Component file structure
|
|
7
|
+
components/
|
|
8
|
+
├── Button/
|
|
9
|
+
│ ├── Button.tsx
|
|
10
|
+
│ ├── Button.test.tsx
|
|
11
|
+
│ ├── Button.styles.ts
|
|
12
|
+
│ └── index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Naming Conventions
|
|
16
|
+
|
|
17
|
+
| Type | Convention | Example |
|
|
18
|
+
|------|------------|---------|
|
|
19
|
+
| Components | PascalCase | `UserProfile` |
|
|
20
|
+
| Hooks | use prefix | `useAuth` |
|
|
21
|
+
| Utils | camelCase | `formatDate` |
|
|
22
|
+
| Constants | SCREAMING_SNAKE_CASE | `API_BASE_URL` |
|
|
23
|
+
| Types | PascalCase | `UserProps` |
|
|
24
|
+
|
|
25
|
+
## Component Template
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
interface ButtonProps {
|
|
29
|
+
variant?: 'primary' | 'secondary';
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function Button({
|
|
35
|
+
variant = 'primary',
|
|
36
|
+
onClick,
|
|
37
|
+
children
|
|
38
|
+
}: ButtonProps) {
|
|
39
|
+
return (
|
|
40
|
+
<button
|
|
41
|
+
className={`btn btn-${variant}`}
|
|
42
|
+
onClick={onClick}
|
|
43
|
+
>
|
|
44
|
+
{children}
|
|
45
|
+
</button>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## State Management
|
|
51
|
+
|
|
52
|
+
- Local state: `useState`
|
|
53
|
+
- Server state: React Query / SWR
|
|
54
|
+
- Global state: Zustand / Jotai
|
|
55
|
+
|
|
56
|
+
## Styling
|
|
57
|
+
|
|
58
|
+
- CSS Modules or Tailwind CSS
|
|
59
|
+
- Avoid inline styles
|
|
60
|
+
- Use consistent spacing scale
|
|
61
|
+
|
|
62
|
+
## Best Practices
|
|
63
|
+
|
|
64
|
+
1. Keep components under 100 lines
|
|
65
|
+
2. Extract reusable logic to hooks
|
|
66
|
+
3. Use TypeScript strict mode
|
|
67
|
+
4. Write tests for critical components
|
|
68
|
+
5. Document props with JSDoc
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: web-fullstack
|
|
2
|
+
description: Full-stack web application configuration
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
compatible_foundation_versions:
|
|
5
|
+
- "2.0.0"
|
|
6
|
+
|
|
7
|
+
overrides:
|
|
8
|
+
- .ai-team/agents/developer.md
|
|
9
|
+
- .ai-team/agents/qa.md
|
|
10
|
+
- .github/workflows/ci.yml
|
|
11
|
+
|
|
12
|
+
additions:
|
|
13
|
+
- .ai-team/skills/frontend-testing/
|
|
14
|
+
- .ai-team/skills/backend-testing/
|
|
15
|
+
- docs/frontend-conventions.md
|
|
16
|
+
- docs/backend-conventions.md
|
|
17
|
+
|
|
18
|
+
language: typescript
|
|
19
|
+
framework: nextjs
|
|
20
|
+
package_manager: npm
|
|
21
|
+
|
|
22
|
+
environment:
|
|
23
|
+
node_version: "20"
|
|
24
|
+
frontend_framework: react
|
|
25
|
+
backend_framework: nextjs
|
|
26
|
+
css_framework: tailwind
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "amazingteam",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "AI-powered autonomous development team foundation - Reusable development scaffolding with controlled self-bootstrap capability",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"amazingteam": "./cli/amazingteam.cjs"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
".ai-team/",
|
|
12
|
+
".opencode/",
|
|
13
|
+
"cli/",
|
|
14
|
+
"action/",
|
|
15
|
+
"scripts/",
|
|
16
|
+
"templates/",
|
|
17
|
+
"presets/",
|
|
18
|
+
"schemas/",
|
|
19
|
+
".foundation/",
|
|
20
|
+
"docs/",
|
|
21
|
+
"overlays/",
|
|
22
|
+
"tasks/_template/",
|
|
23
|
+
"VERSION",
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"AGENTS.md",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"dev": "tsc --watch",
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"test:watch": "jest --watch",
|
|
34
|
+
"test:coverage": "jest --coverage",
|
|
35
|
+
"lint": "eslint src --ext .ts",
|
|
36
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"clean": "rm -rf dist",
|
|
39
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
40
|
+
"validate": "node scripts/validate-foundation.cjs",
|
|
41
|
+
"validate:project": "bash scripts/validate_project_setup.sh",
|
|
42
|
+
"init": "bash scripts/init_project.sh",
|
|
43
|
+
"plan-upgrade": "bash scripts/plan_upgrade.sh",
|
|
44
|
+
"upgrade": "bash scripts/upgrade_foundation.sh",
|
|
45
|
+
"generate-docs": "bash scripts/generate_docs.sh"
|
|
46
|
+
},
|
|
47
|
+
"keywords": [
|
|
48
|
+
"ai",
|
|
49
|
+
"automation",
|
|
50
|
+
"development",
|
|
51
|
+
"template",
|
|
52
|
+
"foundation",
|
|
53
|
+
"bootstrap",
|
|
54
|
+
"opencode",
|
|
55
|
+
"github-actions",
|
|
56
|
+
"autonomous",
|
|
57
|
+
"dev-tools",
|
|
58
|
+
"self-bootstrap",
|
|
59
|
+
"remote-loading"
|
|
60
|
+
],
|
|
61
|
+
"author": "AI Team",
|
|
62
|
+
"license": "MIT",
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "https://github.com/Burburton/amazingteam.git"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@actions/core": "^1.10.1",
|
|
69
|
+
"@actions/github": "^6.0.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/jest": "^29.5.12",
|
|
73
|
+
"@types/node": "^20.11.0",
|
|
74
|
+
"eslint": "^8.56.0",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
76
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
77
|
+
"jest": "^29.7.0",
|
|
78
|
+
"ts-jest": "^29.1.1",
|
|
79
|
+
"typescript": "^5.3.3"
|
|
80
|
+
},
|
|
81
|
+
"engines": {
|
|
82
|
+
"node": ">=18.0.0"
|
|
83
|
+
}
|
|
84
|
+
}
|