@chc880/everything-antigravity 1.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/LICENSE +21 -0
- package/README.md +54 -0
- package/assets/rules/common/coding-style.md +53 -0
- package/assets/rules/common/git-workflow.md +47 -0
- package/assets/rules/common/patterns.md +36 -0
- package/assets/rules/common/performance.md +21 -0
- package/assets/rules/common/security.md +34 -0
- package/assets/rules/common/testing.md +29 -0
- package/assets/rules/golang/coding-style.md +40 -0
- package/assets/rules/golang/patterns.md +44 -0
- package/assets/rules/golang/security.md +33 -0
- package/assets/rules/golang/testing.md +30 -0
- package/assets/rules/python/coding-style.md +52 -0
- package/assets/rules/python/patterns.md +39 -0
- package/assets/rules/python/security.md +30 -0
- package/assets/rules/python/testing.md +38 -0
- package/assets/rules/typescript/coding-style.md +44 -0
- package/assets/rules/typescript/patterns.md +50 -0
- package/assets/rules/typescript/security.md +27 -0
- package/assets/rules/typescript/testing.md +24 -0
- package/assets/skills/agent-guides/SKILL.md +40 -0
- package/assets/skills/agent-guides/references/architect.md +209 -0
- package/assets/skills/agent-guides/references/build-error-resolver.md +530 -0
- package/assets/skills/agent-guides/references/code-reviewer.md +102 -0
- package/assets/skills/agent-guides/references/database-reviewer.md +652 -0
- package/assets/skills/agent-guides/references/doc-updater.md +450 -0
- package/assets/skills/agent-guides/references/e2e-runner.md +795 -0
- package/assets/skills/agent-guides/references/go-build-resolver.md +366 -0
- package/assets/skills/agent-guides/references/go-reviewer.md +265 -0
- package/assets/skills/agent-guides/references/planner.md +117 -0
- package/assets/skills/agent-guides/references/python-reviewer.md +467 -0
- package/assets/skills/agent-guides/references/refactor-cleaner.md +304 -0
- package/assets/skills/agent-guides/references/security-reviewer.md +543 -0
- package/assets/skills/agent-guides/references/tdd-guide.md +278 -0
- package/assets/skills/backend-patterns/SKILL.md +587 -0
- package/assets/skills/clickhouse-io/SKILL.md +429 -0
- package/assets/skills/coding-standards/SKILL.md +520 -0
- package/assets/skills/cpp-testing/SKILL.md +322 -0
- package/assets/skills/django-patterns/SKILL.md +733 -0
- package/assets/skills/django-security/SKILL.md +592 -0
- package/assets/skills/django-tdd/SKILL.md +728 -0
- package/assets/skills/django-verification/SKILL.md +460 -0
- package/assets/skills/frontend-patterns/SKILL.md +631 -0
- package/assets/skills/golang-patterns/SKILL.md +673 -0
- package/assets/skills/golang-testing/SKILL.md +719 -0
- package/assets/skills/java-coding-standards/SKILL.md +138 -0
- package/assets/skills/jpa-patterns/SKILL.md +141 -0
- package/assets/skills/knowledge-management/SKILL.md +77 -0
- package/assets/skills/nutrient-document-processing/SKILL.md +165 -0
- package/assets/skills/postgres-patterns/SKILL.md +146 -0
- package/assets/skills/python-patterns/SKILL.md +749 -0
- package/assets/skills/python-testing/SKILL.md +815 -0
- package/assets/skills/security-hardening/SKILL.md +76 -0
- package/assets/skills/security-review/SKILL.md +494 -0
- package/assets/skills/security-review/cloud-infrastructure-security.md +361 -0
- package/assets/skills/springboot-patterns/SKILL.md +304 -0
- package/assets/skills/springboot-security/SKILL.md +119 -0
- package/assets/skills/springboot-tdd/SKILL.md +157 -0
- package/assets/skills/springboot-verification/SKILL.md +100 -0
- package/assets/skills/tdd-workflow/SKILL.md +409 -0
- package/assets/workflows/build-fix.md +50 -0
- package/assets/workflows/code-review.md +61 -0
- package/assets/workflows/e2e.md +65 -0
- package/assets/workflows/go-build.md +39 -0
- package/assets/workflows/go-review.md +44 -0
- package/assets/workflows/go-test.md +61 -0
- package/assets/workflows/plan.md +93 -0
- package/assets/workflows/python-review.md +95 -0
- package/assets/workflows/setup-pm.md +36 -0
- package/assets/workflows/tdd.md +75 -0
- package/assets/workflows/verify.md +81 -0
- package/bin/cli.js +69 -0
- package/lib/installer.js +301 -0
- package/package.json +34 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Enforce TDD workflow for Go. Write table-driven tests first, then implement. Verify 80%+ coverage with go test -cover.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Go TDD
|
|
6
|
+
|
|
7
|
+
Test-driven development workflow for Go.
|
|
8
|
+
|
|
9
|
+
## Workflow Steps
|
|
10
|
+
|
|
11
|
+
1. Write table-driven tests first
|
|
12
|
+
2. Run `go test ./...` — verify tests fail
|
|
13
|
+
3. Implement minimal code to pass
|
|
14
|
+
4. Run `go test -race ./...` — verify tests pass
|
|
15
|
+
5. Refactor with tests green
|
|
16
|
+
6. Run `go test -cover ./...` — verify 80%+ coverage
|
|
17
|
+
|
|
18
|
+
## Table-Driven Test Template
|
|
19
|
+
|
|
20
|
+
```go
|
|
21
|
+
func TestFunctionName(t *testing.T) {
|
|
22
|
+
tests := []struct {
|
|
23
|
+
name string
|
|
24
|
+
input InputType
|
|
25
|
+
expected OutputType
|
|
26
|
+
wantErr bool
|
|
27
|
+
}{
|
|
28
|
+
{
|
|
29
|
+
name: "valid input",
|
|
30
|
+
input: validInput,
|
|
31
|
+
expected: expectedOutput,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "invalid input",
|
|
35
|
+
input: invalidInput,
|
|
36
|
+
wantErr: true,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for _, tt := range tests {
|
|
41
|
+
t.Run(tt.name, func(t *testing.T) {
|
|
42
|
+
got, err := FunctionName(tt.input)
|
|
43
|
+
if (err != nil) != tt.wantErr {
|
|
44
|
+
t.Errorf("error = %v, wantErr %v", err, tt.wantErr)
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
if got != tt.expected {
|
|
48
|
+
t.Errorf("got = %v, want %v", got, tt.expected)
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Coverage Verification
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
go test -cover ./...
|
|
59
|
+
go test -coverprofile=coverage.out ./...
|
|
60
|
+
go tool cover -html=coverage.out
|
|
61
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Restate requirements, assess risks, and create step-by-step implementation plan. WAIT for user CONFIRM before touching any code.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Plan Command
|
|
6
|
+
|
|
7
|
+
Create a comprehensive implementation plan before writing any code. Leverages Antigravity's Planning Mode and Artifact system for structured planning.
|
|
8
|
+
|
|
9
|
+
## What This Command Does
|
|
10
|
+
|
|
11
|
+
1. **Restate Requirements** — Clarify what needs to be built
|
|
12
|
+
2. **Identify Risks** — Surface potential issues and blockers
|
|
13
|
+
3. **Create Implementation Plan** — Use `implementation_plan.md` artifact
|
|
14
|
+
4. **Create Task List** — Use `task.md` artifact for progress tracking
|
|
15
|
+
5. **Wait for Confirmation** — MUST receive user approval before proceeding
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
Use `/plan` when:
|
|
20
|
+
- Starting a new feature
|
|
21
|
+
- Making significant architectural changes
|
|
22
|
+
- Working on complex refactoring
|
|
23
|
+
- Multiple files/components will be affected
|
|
24
|
+
- Requirements are unclear or ambiguous
|
|
25
|
+
|
|
26
|
+
## Workflow Steps (利用 Antigravity Planning Mode)
|
|
27
|
+
|
|
28
|
+
### Step 1: 进入 Planning Mode
|
|
29
|
+
设置 `task_boundary` 的 Mode 为 `PLANNING`,开始结构化规划。
|
|
30
|
+
|
|
31
|
+
### Step 2: 分析需求
|
|
32
|
+
- 完整阅读相关代码和文档
|
|
33
|
+
- 查询 Knowledge Items (KI) 是否有相关历史知识
|
|
34
|
+
- 明确需求边界和验收标准
|
|
35
|
+
|
|
36
|
+
### Step 3: 创建 Implementation Plan Artifact
|
|
37
|
+
创建 `implementation_plan.md`,包含:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
# Implementation Plan: [Feature Name]
|
|
41
|
+
|
|
42
|
+
## Overview
|
|
43
|
+
[2-3 sentence summary]
|
|
44
|
+
|
|
45
|
+
## User Review Required
|
|
46
|
+
> [!WARNING]
|
|
47
|
+
> [Breaking changes or critical decisions]
|
|
48
|
+
|
|
49
|
+
## Proposed Changes
|
|
50
|
+
### [Component Name]
|
|
51
|
+
#### [MODIFY] [filename](file:///path/to/file)
|
|
52
|
+
- 具体变更描述
|
|
53
|
+
|
|
54
|
+
#### [NEW] [filename](file:///path/to/new/file)
|
|
55
|
+
- 新文件用途
|
|
56
|
+
|
|
57
|
+
## Verification Plan
|
|
58
|
+
### Automated Tests
|
|
59
|
+
- 具体测试命令
|
|
60
|
+
|
|
61
|
+
### Manual Verification
|
|
62
|
+
- 手动验证步骤
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Step 4: 创建 Task Artifact
|
|
66
|
+
创建 `task.md`,将方案拆解为可跟踪的任务项:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
# Task List
|
|
70
|
+
- [ ] Phase 1: ...
|
|
71
|
+
- [ ] Sub-task 1.1
|
|
72
|
+
- [ ] Sub-task 1.2
|
|
73
|
+
- [ ] Phase 2: ...
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 5: 等待审批
|
|
77
|
+
使用 `notify_user` 工具将方案提交用户审批。**CRITICAL**: 用户明确批准前不得开始编码。
|
|
78
|
+
|
|
79
|
+
## 审批后
|
|
80
|
+
|
|
81
|
+
用户批准后:
|
|
82
|
+
1. 切换到 EXECUTION mode
|
|
83
|
+
2. 按 `task.md` 逐项执行
|
|
84
|
+
3. 用 `[/]` 标记进行中、`[x]` 标记完成
|
|
85
|
+
4. 完成后切换到 VERIFICATION mode
|
|
86
|
+
5. 使用 `/verify` workflow 验证
|
|
87
|
+
|
|
88
|
+
## Integration with Other Workflows
|
|
89
|
+
|
|
90
|
+
- After planning: `/tdd` for test-driven implementation
|
|
91
|
+
- After implementation: `/verify` for verification
|
|
92
|
+
- If build fails: `/build-fix` to fix errors
|
|
93
|
+
- After completion: `/code-review` for review
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Comprehensive Python code review for PEP 8 compliance, type hints, security, and Pythonic idioms.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Python Code Review
|
|
6
|
+
|
|
7
|
+
Comprehensive Python-specific code review.
|
|
8
|
+
|
|
9
|
+
## Automated Checks
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Type checking
|
|
13
|
+
mypy .
|
|
14
|
+
|
|
15
|
+
# Linting and formatting
|
|
16
|
+
ruff check .
|
|
17
|
+
black --check .
|
|
18
|
+
isort --check-only .
|
|
19
|
+
|
|
20
|
+
# Security scanning
|
|
21
|
+
bandit -r .
|
|
22
|
+
|
|
23
|
+
# Testing
|
|
24
|
+
pytest --cov=src --cov-report=term-missing
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Review Categories
|
|
28
|
+
|
|
29
|
+
### CRITICAL (Must Fix)
|
|
30
|
+
- SQL/Command injection vulnerabilities
|
|
31
|
+
- Unsafe `eval`/`exec` usage
|
|
32
|
+
- Pickle unsafe deserialization
|
|
33
|
+
- Hardcoded credentials
|
|
34
|
+
- YAML `unsafe_load`
|
|
35
|
+
- Bare `except` clauses hiding errors
|
|
36
|
+
|
|
37
|
+
### HIGH (Should Fix)
|
|
38
|
+
- Missing type hints on public functions
|
|
39
|
+
- Mutable default arguments
|
|
40
|
+
- Swallowing exceptions silently
|
|
41
|
+
- Not using context managers for resources
|
|
42
|
+
- Race conditions without locks
|
|
43
|
+
|
|
44
|
+
### MEDIUM (Consider)
|
|
45
|
+
- PEP 8 formatting violations
|
|
46
|
+
- Missing docstrings on public functions
|
|
47
|
+
- `print()` statements instead of `logging`
|
|
48
|
+
- Magic numbers without named constants
|
|
49
|
+
- Not using f-strings
|
|
50
|
+
|
|
51
|
+
## Common Fixes
|
|
52
|
+
|
|
53
|
+
### Fix Mutable Defaults
|
|
54
|
+
```python
|
|
55
|
+
# Bad
|
|
56
|
+
def process(items=[]):
|
|
57
|
+
items.append("new")
|
|
58
|
+
|
|
59
|
+
# Good
|
|
60
|
+
def process(items=None):
|
|
61
|
+
if items is None:
|
|
62
|
+
items = []
|
|
63
|
+
items.append("new")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Add Type Hints
|
|
67
|
+
```python
|
|
68
|
+
# Bad
|
|
69
|
+
def calculate(x, y):
|
|
70
|
+
return x + y
|
|
71
|
+
|
|
72
|
+
# Good
|
|
73
|
+
def calculate(x: int | float, y: int | float) -> int | float:
|
|
74
|
+
return x + y
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Use Context Managers
|
|
78
|
+
```python
|
|
79
|
+
# Bad
|
|
80
|
+
f = open("file.txt")
|
|
81
|
+
data = f.read()
|
|
82
|
+
f.close()
|
|
83
|
+
|
|
84
|
+
# Good
|
|
85
|
+
with open("file.txt") as f:
|
|
86
|
+
data = f.read()
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Approval Criteria
|
|
90
|
+
|
|
91
|
+
| Status | Condition |
|
|
92
|
+
|--------|-----------|
|
|
93
|
+
| ✅ Approve | No CRITICAL or HIGH issues |
|
|
94
|
+
| ⚠️ Warning | Only MEDIUM issues |
|
|
95
|
+
| ❌ Block | CRITICAL or HIGH issues found |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Configure your preferred package manager (npm/pnpm/yarn/bun)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Package Manager Setup
|
|
6
|
+
|
|
7
|
+
Configure your preferred JavaScript/TypeScript package manager for this project.
|
|
8
|
+
|
|
9
|
+
## Detection Priority
|
|
10
|
+
|
|
11
|
+
When determining which package manager to use:
|
|
12
|
+
|
|
13
|
+
1. **Lock file** — Presence of `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, or `bun.lockb`
|
|
14
|
+
2. **package.json** — `packageManager` field
|
|
15
|
+
3. **Fallback** — First available (pnpm > bun > yarn > npm)
|
|
16
|
+
|
|
17
|
+
## Setup Steps
|
|
18
|
+
|
|
19
|
+
1. Ask the user which package manager they prefer
|
|
20
|
+
2. Check if it's installed: `which pnpm` / `which yarn` / `which bun`
|
|
21
|
+
3. If not installed, provide install instructions
|
|
22
|
+
4. Set `packageManager` field in `package.json`
|
|
23
|
+
5. Generate appropriate lock file
|
|
24
|
+
|
|
25
|
+
## Install Instructions
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# pnpm
|
|
29
|
+
npm install -g pnpm
|
|
30
|
+
|
|
31
|
+
# yarn
|
|
32
|
+
npm install -g yarn
|
|
33
|
+
|
|
34
|
+
# bun
|
|
35
|
+
curl -fsSL https://bun.sh/install | bash
|
|
36
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Enforce test-driven development workflow. Write tests FIRST, then implement minimal code to pass. Ensure 80%+ coverage.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# TDD Workflow
|
|
6
|
+
|
|
7
|
+
Enforce strict test-driven development: write tests first, then implement.
|
|
8
|
+
|
|
9
|
+
## The TDD Cycle
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
RED → GREEN → REFACTOR → VERIFY
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
1. **RED** — Write a failing test
|
|
16
|
+
2. **GREEN** — Write minimal code to make the test pass
|
|
17
|
+
3. **REFACTOR** — Improve code quality while keeping tests green
|
|
18
|
+
4. **VERIFY** — Check coverage is 80%+
|
|
19
|
+
|
|
20
|
+
## Step-by-Step Process
|
|
21
|
+
|
|
22
|
+
### Step 1: Understand the Feature
|
|
23
|
+
- Read requirements carefully
|
|
24
|
+
- Identify success criteria
|
|
25
|
+
- List edge cases
|
|
26
|
+
|
|
27
|
+
### Step 2: Write Tests First
|
|
28
|
+
Write tests that describe the expected behavior:
|
|
29
|
+
- Happy path tests
|
|
30
|
+
- Edge case tests (empty, null, boundary values)
|
|
31
|
+
- Error handling tests
|
|
32
|
+
|
|
33
|
+
### Step 3: Run Tests (They Should Fail)
|
|
34
|
+
Verify that tests fail for the right reason — this validates the test is meaningful.
|
|
35
|
+
|
|
36
|
+
### Step 4: Implement Code
|
|
37
|
+
Write **minimal** code to make tests pass. No gold-plating.
|
|
38
|
+
|
|
39
|
+
### Step 5: Run Tests Again
|
|
40
|
+
All tests should now pass.
|
|
41
|
+
|
|
42
|
+
### Step 6: Refactor
|
|
43
|
+
Improve code quality while keeping tests green:
|
|
44
|
+
- Remove duplication
|
|
45
|
+
- Improve naming
|
|
46
|
+
- Optimize performance
|
|
47
|
+
- Enhance readability
|
|
48
|
+
|
|
49
|
+
### Step 7: Verify Coverage
|
|
50
|
+
Run coverage report and verify 80%+ coverage achieved.
|
|
51
|
+
|
|
52
|
+
## Best Practices
|
|
53
|
+
|
|
54
|
+
1. **Write Tests First** — Always TDD
|
|
55
|
+
2. **One Assert Per Test** — Focus on single behavior
|
|
56
|
+
3. **Descriptive Test Names** — Explain what's tested
|
|
57
|
+
4. **Arrange-Act-Assert** — Clear test structure
|
|
58
|
+
5. **Mock External Dependencies** — Isolate unit tests
|
|
59
|
+
6. **Test Edge Cases** — Null, undefined, empty, large
|
|
60
|
+
7. **Test Error Paths** — Not just happy paths
|
|
61
|
+
8. **Keep Tests Fast** — Unit tests <50ms each
|
|
62
|
+
9. **Clean Up After Tests** — No side effects
|
|
63
|
+
10. **Review Coverage Reports** — Identify gaps
|
|
64
|
+
|
|
65
|
+
## Language-Specific Commands
|
|
66
|
+
|
|
67
|
+
- **TypeScript/JavaScript**: `npm test -- --coverage`
|
|
68
|
+
- **Python**: `pytest --cov=src --cov-report=term-missing`
|
|
69
|
+
- **Go**: `go test -cover ./...`
|
|
70
|
+
|
|
71
|
+
## Integration with Other Workflows
|
|
72
|
+
|
|
73
|
+
- Use `/plan` first for complex features
|
|
74
|
+
- Use `/code-review` after implementation
|
|
75
|
+
- Use `/build-fix` if build errors occur
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Verify implementation completeness. Run tests, check build, generate walkthrough report.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Verify Command
|
|
6
|
+
|
|
7
|
+
Verify that implementation is correct and complete. Leverages Antigravity's Verification Mode and Walkthrough artifact.
|
|
8
|
+
|
|
9
|
+
## When to Use
|
|
10
|
+
|
|
11
|
+
Use `/verify` after completing an implementation, typically after `/plan` → `/tdd` cycle.
|
|
12
|
+
|
|
13
|
+
## Workflow Steps
|
|
14
|
+
|
|
15
|
+
### Step 1: 进入 Verification Mode
|
|
16
|
+
设置 `task_boundary` 的 Mode 为 `VERIFICATION`。
|
|
17
|
+
|
|
18
|
+
### Step 2: 运行测试
|
|
19
|
+
```bash
|
|
20
|
+
# TypeScript/JavaScript
|
|
21
|
+
npm test -- --coverage
|
|
22
|
+
|
|
23
|
+
# Python
|
|
24
|
+
pytest --cov=src --cov-report=term-missing
|
|
25
|
+
|
|
26
|
+
# Go
|
|
27
|
+
go test -race -cover ./...
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Step 3: 检查构建
|
|
31
|
+
```bash
|
|
32
|
+
# TypeScript
|
|
33
|
+
npx tsc --noEmit
|
|
34
|
+
|
|
35
|
+
# Python
|
|
36
|
+
python -m py_compile src/*.py
|
|
37
|
+
|
|
38
|
+
# Go
|
|
39
|
+
go build ./...
|
|
40
|
+
go vet ./...
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 4: 验证清单
|
|
44
|
+
|
|
45
|
+
- [ ] 所有测试通过
|
|
46
|
+
- [ ] 覆盖率 ≥ 80%
|
|
47
|
+
- [ ] 构建无错误
|
|
48
|
+
- [ ] Lint 无警告
|
|
49
|
+
- [ ] 无安全漏洞(hardcoded secrets, SQL injection 等)
|
|
50
|
+
- [ ] 无 Claude Code 残留引用(仅 Everything Antigravity)
|
|
51
|
+
- [ ] 无调试代码残留(console.log, print, fmt.Println)
|
|
52
|
+
- [ ] API 文档已更新(如有)
|
|
53
|
+
- [ ] README 已更新(如有)
|
|
54
|
+
|
|
55
|
+
### Step 5: 生成 Walkthrough
|
|
56
|
+
创建 `walkthrough.md` artifact,记录:
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# Walkthrough: [Feature Name]
|
|
60
|
+
|
|
61
|
+
## Changes Made
|
|
62
|
+
- 具体修改列表(使用 render_diffs)
|
|
63
|
+
|
|
64
|
+
## What Was Tested
|
|
65
|
+
- 测试结果和覆盖率
|
|
66
|
+
|
|
67
|
+
## Validation Results
|
|
68
|
+
- 构建状态
|
|
69
|
+
- 测试通过率
|
|
70
|
+
- 截图/录屏(如有 UI 变更)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Step 6: 通知用户
|
|
74
|
+
使用 `notify_user` 将 walkthrough 提交用户查看。
|
|
75
|
+
|
|
76
|
+
## Integration with Other Workflows
|
|
77
|
+
|
|
78
|
+
- Before verify: `/plan` → `/tdd` → implement
|
|
79
|
+
- If issues found: go back to EXECUTION mode and fix
|
|
80
|
+
- If fundamental issues: go back to `/plan`
|
|
81
|
+
- After verify: `/code-review` for final review
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Everything Antigravity CLI
|
|
5
|
+
*
|
|
6
|
+
* 用法:
|
|
7
|
+
* ea init # 安装全部到当前项目
|
|
8
|
+
* ea init --lang typescript # 仅安装 TypeScript 规则
|
|
9
|
+
* ea status # 查看安装状态
|
|
10
|
+
* ea uninstall # 卸载(自动备份)
|
|
11
|
+
* ea help # 帮助
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const { install, uninstall, status, showHelp } = require('../lib/installer');
|
|
15
|
+
|
|
16
|
+
const args = process.argv.slice(2);
|
|
17
|
+
const command = args[0] || 'help';
|
|
18
|
+
const restArgs = args.slice(1);
|
|
19
|
+
|
|
20
|
+
// 解析子参数
|
|
21
|
+
function parseFlags(arr) {
|
|
22
|
+
const flags = {};
|
|
23
|
+
let lang = 'all';
|
|
24
|
+
for (let i = 0; i < arr.length; i++) {
|
|
25
|
+
const a = arr[i];
|
|
26
|
+
if (a === '--lang' || a === '-l') {
|
|
27
|
+
lang = arr[++i] || 'all';
|
|
28
|
+
} else if (!a.startsWith('-')) {
|
|
29
|
+
lang = a;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// 语言别名
|
|
33
|
+
const LANG_ALIASES = { ts: 'typescript', js: 'typescript', py: 'python', go: 'golang' };
|
|
34
|
+
lang = LANG_ALIASES[lang] || lang;
|
|
35
|
+
return { lang };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// 路由命令
|
|
39
|
+
switch (command) {
|
|
40
|
+
case 'init':
|
|
41
|
+
case 'install':
|
|
42
|
+
case 'i': {
|
|
43
|
+
const { lang } = parseFlags(restArgs);
|
|
44
|
+
install(lang);
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
case 'status':
|
|
49
|
+
case 's':
|
|
50
|
+
status();
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case 'uninstall':
|
|
54
|
+
case 'remove':
|
|
55
|
+
case 'rm':
|
|
56
|
+
uninstall();
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 'help':
|
|
60
|
+
case '-h':
|
|
61
|
+
case '--help':
|
|
62
|
+
showHelp();
|
|
63
|
+
break;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
console.log(`未知命令: ${command}\n`);
|
|
67
|
+
showHelp();
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|