antigravity-flow 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/README.md +182 -0
- package/dist/bin/ag-flow.js +127 -0
- package/dist/src/adapters/ConsoleLoggerAdapter.js +52 -0
- package/dist/src/adapters/EjsTemplateAdapter.js +66 -0
- package/dist/src/adapters/JsonLocalizationAdapter.js +81 -0
- package/dist/src/adapters/NodeFileSystemAdapter.js +52 -0
- package/dist/src/adapters/index.js +20 -0
- package/dist/src/commands/guide.js +89 -0
- package/dist/src/commands/index.js +19 -0
- package/dist/src/commands/init.js +581 -0
- package/dist/src/commands/templates.js +143 -0
- package/dist/src/core/ConfigService.js +75 -0
- package/dist/src/core/ContextGenerator.js +27 -0
- package/dist/src/core/DockerfileGenerator.js +151 -0
- package/dist/src/core/GitignoreGenerator.js +129 -0
- package/dist/src/core/PipelineGenerator.js +68 -0
- package/dist/src/core/RulesComposer.js +62 -0
- package/dist/src/core/StackDetector.js +115 -0
- package/dist/src/core/WorkflowGenerator.js +137 -0
- package/dist/src/core/index.js +26 -0
- package/dist/src/core/interfaces.js +2 -0
- package/dist/src/core/pipelines/PipelineStrategy.js +97 -0
- package/dist/src/core/types.js +300 -0
- package/dist/src/locales/en.json +293 -0
- package/dist/src/locales/fr.json +293 -0
- package/dist/src/templates/docker/django.Dockerfile.ejs +21 -0
- package/dist/src/templates/docker/dockerignore.ejs +12 -0
- package/dist/src/templates/docker/go.Dockerfile.ejs +20 -0
- package/dist/src/templates/docker/nestjs.Dockerfile.ejs +25 -0
- package/dist/src/templates/docker/node.Dockerfile.ejs +13 -0
- package/dist/src/templates/docker/python.Dockerfile.ejs +13 -0
- package/dist/src/templates/docker/springboot.Dockerfile.ejs +25 -0
- package/dist/src/templates/en/architect.md.ejs +85 -0
- package/dist/src/templates/en/ba.md.ejs +88 -0
- package/dist/src/templates/en/data.md.ejs +47 -0
- package/dist/src/templates/en/dev.md.ejs +77 -0
- package/dist/src/templates/en/devops.md.ejs +54 -0
- package/dist/src/templates/en/fragments/arch/feature-sliced.md.ejs +12 -0
- package/dist/src/templates/en/fragments/arch/hexagonal.md.ejs +14 -0
- package/dist/src/templates/en/fragments/arch/mvc.md.ejs +11 -0
- package/dist/src/templates/en/fragments/aspnet-core.md.ejs +11 -0
- package/dist/src/templates/en/fragments/base-rules.md.ejs +5 -0
- package/dist/src/templates/en/fragments/django.md.ejs +12 -0
- package/dist/src/templates/en/fragments/fastapi.md.ejs +11 -0
- package/dist/src/templates/en/fragments/flutter.md.ejs +11 -0
- package/dist/src/templates/en/fragments/nestjs.md.ejs +5 -0
- package/dist/src/templates/en/fragments/nextjs.md.ejs +10 -0
- package/dist/src/templates/en/fragments/react-native.md.ejs +12 -0
- package/dist/src/templates/en/fragments/react.md.ejs +5 -0
- package/dist/src/templates/en/fragments/rigor/legacy.md.ejs +6 -0
- package/dist/src/templates/en/fragments/rigor/prototype.md.ejs +6 -0
- package/dist/src/templates/en/fragments/rigor/strict.md.ejs +7 -0
- package/dist/src/templates/en/fragments/rust.md.ejs +11 -0
- package/dist/src/templates/en/fragments/scrypto.md.ejs +8 -0
- package/dist/src/templates/en/fragments/solidity.md.ejs +20 -0
- package/dist/src/templates/en/fragments/spring-boot.md.ejs +13 -0
- package/dist/src/templates/en/guide.txt +48 -0
- package/dist/src/templates/en/lead.md.ejs +76 -0
- package/dist/src/templates/en/pipelines/github-dotnet.yml.ejs +24 -0
- package/dist/src/templates/en/pipelines/github-flutter.yml.ejs +24 -0
- package/dist/src/templates/en/pipelines/github-nestjs.yml.ejs +26 -0
- package/dist/src/templates/en/pipelines/github-react.yml.ejs +26 -0
- package/dist/src/templates/en/pipelines/github-rust.yml.ejs +38 -0
- package/dist/src/templates/en/pipelines/github-scrypto.yml.ejs +34 -0
- package/dist/src/templates/en/po.md.ejs +86 -0
- package/dist/src/templates/en/project-context.md.ejs +26 -0
- package/dist/src/templates/en/qa.md.ejs +103 -0
- package/dist/src/templates/en/rules.md.ejs +30 -0
- package/dist/src/templates/en/security.md.ejs +55 -0
- package/dist/src/templates/en/techwriter.md.ejs +46 -0
- package/dist/src/templates/fr/architect.md.ejs +15 -0
- package/dist/src/templates/fr/ba.md.ejs +11 -0
- package/dist/src/templates/fr/data.md.ejs +47 -0
- package/dist/src/templates/fr/dev.md.ejs +11 -0
- package/dist/src/templates/fr/devops.md.ejs +54 -0
- package/dist/src/templates/fr/fragments/arch/feature-sliced.md.ejs +12 -0
- package/dist/src/templates/fr/fragments/arch/hexagonal.md.ejs +14 -0
- package/dist/src/templates/fr/fragments/arch/mvc.md.ejs +11 -0
- package/dist/src/templates/fr/fragments/aspnet-core.md.ejs +11 -0
- package/dist/src/templates/fr/fragments/flutter.md.ejs +11 -0
- package/dist/src/templates/fr/fragments/rigor/legacy.md.ejs +6 -0
- package/dist/src/templates/fr/fragments/rigor/prototype.md.ejs +6 -0
- package/dist/src/templates/fr/fragments/rigor/strict.md.ejs +7 -0
- package/dist/src/templates/fr/fragments/rust.md.ejs +10 -0
- package/dist/src/templates/fr/fragments/scrypto.md.ejs +8 -0
- package/dist/src/templates/fr/guide.txt +47 -0
- package/dist/src/templates/fr/lead.md.ejs +12 -0
- package/dist/src/templates/fr/po.md.ejs +11 -0
- package/dist/src/templates/fr/project-context.md.ejs +28 -0
- package/dist/src/templates/fr/qa.md.ejs +14 -0
- package/dist/src/templates/fr/rules.md.ejs +30 -0
- package/dist/src/templates/fr/security.md.ejs +55 -0
- package/dist/src/templates/fr/techwriter.md.ejs +46 -0
- package/dist/src/templates/gitignore/dotnet.txt +6 -0
- package/dist/src/templates/gitignore/go.txt +15 -0
- package/dist/src/templates/gitignore/java.txt +4 -0
- package/dist/src/templates/gitignore/jetbrains.txt +4 -0
- package/dist/src/templates/gitignore/linux.txt +5 -0
- package/dist/src/templates/gitignore/macos.txt +3 -0
- package/dist/src/templates/gitignore/node.txt +11 -0
- package/dist/src/templates/gitignore/python.txt +10 -0
- package/dist/src/templates/gitignore/rust.txt +3 -0
- package/dist/src/templates/gitignore/solidity.txt +19 -0
- package/dist/src/templates/gitignore/vscode.txt +6 -0
- package/dist/src/templates/gitignore/windows.txt +4 -0
- package/dist/tests/commands/InitCommand.spec.js +529 -0
- package/dist/tests/commands/InitConfig.spec.js +108 -0
- package/dist/tests/core/ConfigService.spec.js +97 -0
- package/dist/tests/core/ContextGenerator.spec.js +51 -0
- package/dist/tests/core/PipelineGenerator.spec.js +206 -0
- package/dist/tests/core/RulesComposer.spec.js +89 -0
- package/dist/tests/core/StackDetector.spec.js +69 -0
- package/dist/tests/core/Types.spec.js +243 -0
- package/dist/tests/core/WorkflowGenerator.spec.js +99 -0
- package/package.json +55 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Standard Development Workflow
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. **Understanding**:
|
|
6
|
+
- Analyze the user request and relevant files.
|
|
7
|
+
- Identify impacted modules and dependencies.
|
|
8
|
+
- Review existing tests and documentation.
|
|
9
|
+
- Check for related issues or technical debt.
|
|
10
|
+
|
|
11
|
+
2. **Planning**:
|
|
12
|
+
- Break down the task into smaller, testable increments.
|
|
13
|
+
- Propose an implementation plan before coding.
|
|
14
|
+
- Identify potential risks and edge cases.
|
|
15
|
+
- Estimate effort and communicate blockers early.
|
|
16
|
+
|
|
17
|
+
3. **Implementation**:
|
|
18
|
+
- Create or modify source code following project conventions.
|
|
19
|
+
- Use TDD (write tests before code) if applicable.
|
|
20
|
+
- Follow the architecture guidelines (see `.agent/rules/coding-standards.md`).
|
|
21
|
+
- Keep commits small and focused (one logical change per commit).
|
|
22
|
+
|
|
23
|
+
4. **Database & Migrations**:
|
|
24
|
+
- Create migrations for schema changes: `<%= buildCommand.includes('nest') ? 'npm run migration:generate' : 'npx prisma migrate dev' %>`.
|
|
25
|
+
- Never modify production data directly.
|
|
26
|
+
- Test migrations on a fresh database.
|
|
27
|
+
|
|
28
|
+
5. **Environment & Configuration**:
|
|
29
|
+
- Use environment variables for secrets and config.
|
|
30
|
+
- Document new environment variables in `.env.example`.
|
|
31
|
+
- Never commit secrets to version control.
|
|
32
|
+
|
|
33
|
+
6. **Verification**:
|
|
34
|
+
- Run `<%= buildCommand %>` to check compilation.
|
|
35
|
+
- Run `<%= testCommand %>` for unit tests.
|
|
36
|
+
- Run `npm run lint` or equivalent for style checks.
|
|
37
|
+
- Verify no regressions in affected areas.
|
|
38
|
+
|
|
39
|
+
7. **Logging & Observability**:
|
|
40
|
+
- Add appropriate log statements (info, warn, error).
|
|
41
|
+
- Include correlation IDs for traceability.
|
|
42
|
+
- Avoid logging sensitive data (PII, credentials).
|
|
43
|
+
|
|
44
|
+
8. **Feature Flags** (if applicable):
|
|
45
|
+
- Wrap new features in feature flags for safe rollout.
|
|
46
|
+
- Document flag purpose and cleanup timeline.
|
|
47
|
+
|
|
48
|
+
9. **Commit & PR**:
|
|
49
|
+
- Propose a commit following the convention: `feat(scope): description`.
|
|
50
|
+
- Write a clear PR description with context and testing notes.
|
|
51
|
+
- Link related issues or tickets.
|
|
52
|
+
- Request appropriate reviewers.
|
|
53
|
+
|
|
54
|
+
10. **Rollback Planning**:
|
|
55
|
+
- Document rollback procedure for complex changes.
|
|
56
|
+
- Ensure migrations are reversible when possible.
|
|
57
|
+
- Test rollback in staging environment.
|
|
58
|
+
|
|
59
|
+
11. **Loop**:
|
|
60
|
+
- Ask the user if there are other tasks or if the feature is complete.
|
|
61
|
+
- If complete, propose creating a Pull Request.
|
|
62
|
+
- Update task tracking and documentation.
|
|
63
|
+
|
|
64
|
+
## Quick Reference Commands
|
|
65
|
+
```bash
|
|
66
|
+
# Build
|
|
67
|
+
<%= buildCommand %>
|
|
68
|
+
|
|
69
|
+
# Test
|
|
70
|
+
<%= testCommand %>
|
|
71
|
+
|
|
72
|
+
# Lint
|
|
73
|
+
npm run lint
|
|
74
|
+
|
|
75
|
+
# Format
|
|
76
|
+
npm run format
|
|
77
|
+
```
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: DevOps & Infrastructure Workflow
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. **Infrastructure as Code (IaC)**:
|
|
6
|
+
- Define all infrastructure using code (Terraform, Pulumi, CloudFormation).
|
|
7
|
+
- Version control your infrastructure configurations.
|
|
8
|
+
- Maintain state files securely (remote state with locking).
|
|
9
|
+
- Use modular and reusable infrastructure components.
|
|
10
|
+
|
|
11
|
+
2. **CI/CD Pipelines**:
|
|
12
|
+
- Ensure fast and reliable build pipelines (<%= buildCommand %>).
|
|
13
|
+
- Implement automated testing (unit, integration, e2e) in CI (<%= testCommand %>).
|
|
14
|
+
- Use artifact management for build outputs (Docker images, packages).
|
|
15
|
+
- Implement staged deployments (Dev -> Staging -> Prod).
|
|
16
|
+
|
|
17
|
+
3. **Containerization & Orchestration**:
|
|
18
|
+
- Create optimized and secure Dockerfiles (multi-stage builds).
|
|
19
|
+
- Manage container orchestration (Kubernetes, Docker Swarm).
|
|
20
|
+
- Define resource limits and requests.
|
|
21
|
+
- Ensure proper secrets management (Vault, K8s Secrets).
|
|
22
|
+
|
|
23
|
+
4. **Observability & Monitoring**:
|
|
24
|
+
- Set up centralized logging (ELK, Splunk, CloudWatch).
|
|
25
|
+
- Configure metrics collection (Prometheus, Grafana).
|
|
26
|
+
- Implement distributed tracing (Jaeger, Zipkin, OpenTelemetry).
|
|
27
|
+
- Define actionable alerts for critical incidents.
|
|
28
|
+
|
|
29
|
+
5. **Security & Compliance (DevSecOps)**:
|
|
30
|
+
- Integrate security scanning in CI/CD (SAST, DAST, dependency check).
|
|
31
|
+
- Automate compliance checks.
|
|
32
|
+
- Manage access controls (IAM, RBAC) with least privilege.
|
|
33
|
+
- Regular patching and updates.
|
|
34
|
+
|
|
35
|
+
6. **Release Management**:
|
|
36
|
+
- Define versioning strategy (Semantic Versioning).
|
|
37
|
+
- Implement deployment strategies (Blue/Green, Canary, Rolling).
|
|
38
|
+
- Automate rollback procedures.
|
|
39
|
+
- Maintain release notes and changelogs.
|
|
40
|
+
|
|
41
|
+
7. **Disaster Recovery & Backup**:
|
|
42
|
+
- Implement automated backup strategies for databases and state.
|
|
43
|
+
- Regular testing of restore procedures.
|
|
44
|
+
- Define high availability and failover configurations.
|
|
45
|
+
|
|
46
|
+
<%- folderStructure %>
|
|
47
|
+
|
|
48
|
+
## DevOps Checklist
|
|
49
|
+
- [ ] Infrastructure code is versioned
|
|
50
|
+
- [ ] CI/CD pipeline is active and green
|
|
51
|
+
- [ ] Secrets are managed securely outside of repo
|
|
52
|
+
- [ ] Monitoring dashboards are accessible
|
|
53
|
+
- [ ] Backups are configured and tested
|
|
54
|
+
- [ ] Immutability of deployments is enforced
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
### Proposed Folder Structure (Feature-Sliced Design)
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
src/
|
|
5
|
+
├── app/ # App-wide settings, styles, providers
|
|
6
|
+
├── processes/ # Complex inter-page scenarios (Auth, Payment)
|
|
7
|
+
├── pages/ # Full pages (Routing)
|
|
8
|
+
├── widgets/ # Composition of features/entities
|
|
9
|
+
├── features/ # User interactions (Add to Cart, Login)
|
|
10
|
+
├── entities/ # Business entities (User, Product)
|
|
11
|
+
└── shared/ # Reusable code (UI Kit, libs)
|
|
12
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
### Proposed Folder Structure (Hexagonal / Clean Architecture)
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
src/
|
|
5
|
+
├── core/ # Domain & Application Layer (Pure TS/JS, No external deps)
|
|
6
|
+
│ ├── entities/ # Domain Logic & Types
|
|
7
|
+
│ ├── interfaces/ # Ports (Interfaces for Repositories, Services)
|
|
8
|
+
│ └── use-cases/ # Application Business Rules
|
|
9
|
+
├── adapters/ # Infrastructure Layer
|
|
10
|
+
│ ├── persistence/ # Database implementations (TypeORM, Prisma...)
|
|
11
|
+
│ ├── api/ # External APIs (Stripe, formatting...)
|
|
12
|
+
│ └── ui/ # Presenters / CLI Adapters
|
|
13
|
+
└── infrastructure/ # Framework configuration (NestJS Modules, Express setup)
|
|
14
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### Proposed Folder Structure (MVC / Layered)
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
src/
|
|
5
|
+
├── controllers/ # Handle incoming requests (Routing)
|
|
6
|
+
├── models/ # Data Models & Schemas
|
|
7
|
+
├── services/ # Business Logic
|
|
8
|
+
├── views/ # UI Templates (if applicable)
|
|
9
|
+
├── utils/ # Helper functions
|
|
10
|
+
└── config/ # Configuration & Env variables
|
|
11
|
+
```
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### ASP.NET Core Standards
|
|
2
|
+
|
|
3
|
+
- **Dependency Injection**: Use built-in DI container for services and repositories.
|
|
4
|
+
- **Async/Await**: Use asynchronous programming pattern for all I/O bound operations.
|
|
5
|
+
- **Nullable Reference Types**: Enable and respect `<Nullable>enable</Nullable>`.
|
|
6
|
+
- **Folder Structure**:
|
|
7
|
+
- `Controllers/`: API endpoints.
|
|
8
|
+
- `Services/`: Business logic.
|
|
9
|
+
- `Repositories/`: Data access.
|
|
10
|
+
- `Models/`: Domain entities and DTOs.
|
|
11
|
+
- `Program.cs`: configuration and startup.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
## Base Coding Standards
|
|
2
|
+
|
|
3
|
+
1. **SOLID Principles**: Adhere to Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
|
|
4
|
+
2. **Clean Code**: Write code that is easy to read, understand, and maintain. Use meaningful names.
|
|
5
|
+
3. **DRY (Don't Repeat Yourself)**: Avoid duplication. Extract common logic into reusable functions or components.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Django Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Project Structure**: Organize apps by domain/feature, not by type.
|
|
4
|
+
2. **Models**: Keep models thin, use managers for complex queries.
|
|
5
|
+
3. **Views**: Prefer class-based views for reusability.
|
|
6
|
+
4. **Forms**: Use Django forms for validation, ModelForms for CRUD.
|
|
7
|
+
5. **Migrations**: Always review generated migrations before applying.
|
|
8
|
+
6. **Signals**: Avoid signals for business logic, use explicit service calls.
|
|
9
|
+
7. **Templates**: Minimize logic in templates, use template tags.
|
|
10
|
+
8. **Settings**: Use django-environ or similar for environment configuration.
|
|
11
|
+
9. **Security**: Enable CSRF, use Django's security middleware.
|
|
12
|
+
10. **Testing**: Use pytest-django for testing, factory_boy for fixtures.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
## FastAPI Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Pydantic Models**: Use Pydantic for request/response validation and serialization.
|
|
4
|
+
2. **Dependency Injection**: Use `Depends()` for dependency injection.
|
|
5
|
+
3. **Async**: Use `async def` for I/O-bound operations.
|
|
6
|
+
4. **Type Hints**: Always use type hints for parameters and return types.
|
|
7
|
+
5. **Routers**: Organize endpoints in APIRouter modules by domain.
|
|
8
|
+
6. **Background Tasks**: Use BackgroundTasks for async operations.
|
|
9
|
+
7. **Error Handling**: Use HTTPException for API errors with proper status codes.
|
|
10
|
+
8. **Settings**: Use pydantic-settings for configuration management.
|
|
11
|
+
9. **Middleware**: Use middleware for CORS, logging, and request tracing.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### Flutter Standards
|
|
2
|
+
|
|
3
|
+
- **State Management**: Clearly define the state management solution (Provider, Riverpod, BLoC).
|
|
4
|
+
- **Widgets**: Split UI into small, reusable widgets.
|
|
5
|
+
- **Null Safety**: Strict adherence to null safety rules.
|
|
6
|
+
- **Folder Structure**:
|
|
7
|
+
- `lib/main.dart`: Entry point.
|
|
8
|
+
- `lib/src/`: Private implementation code.
|
|
9
|
+
- `lib/widgets/`: Reusable components.
|
|
10
|
+
- `lib/screens/` or `lib/pages/`: Application views.
|
|
11
|
+
- `lib/models/`: Data models.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## Next.js Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **App Router**: Use the App Router (app/) for new projects. Only use Pages Router for legacy compatibility.
|
|
4
|
+
2. **Server Components**: Use Server Components by default. Add `'use client'` only when needed.
|
|
5
|
+
3. **Data Fetching**: Use `fetch()` with caching strategies, not `getServerSideProps`/`getStaticProps`.
|
|
6
|
+
4. **API Routes**: Use Route Handlers (app/api/) for server-side logic.
|
|
7
|
+
5. **Metadata**: Use the Metadata API for SEO, not manual `<head>` manipulation.
|
|
8
|
+
6. **Image Optimization**: Always use `next/image` for images.
|
|
9
|
+
7. **Environment Variables**: Use `NEXT_PUBLIC_` prefix for client-exposed variables only.
|
|
10
|
+
8. **Middleware**: Use middleware.ts for authentication and redirects.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## React Native Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Navigation**: Use React Navigation for routing.
|
|
4
|
+
2. **State Management**: Use React Query for server state, Zustand/Redux for client state.
|
|
5
|
+
3. **Styling**: Use StyleSheet.create() for performance, consider NativeWind.
|
|
6
|
+
4. **Native Modules**: Minimize native code, use Expo modules when possible.
|
|
7
|
+
5. **Performance**: Use FlatList for long lists, avoid anonymous functions in render.
|
|
8
|
+
6. **Platform-Specific**: Use Platform.select() for platform-specific code.
|
|
9
|
+
7. **Assets**: Optimize images for mobile, use appropriate resolutions.
|
|
10
|
+
8. **Testing**: Use React Native Testing Library, Detox for E2E.
|
|
11
|
+
9. **OTA Updates**: Use EAS Update for over-the-air updates.
|
|
12
|
+
10. **Deep Linking**: Configure deep links for navigation from external sources.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
## React Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Functional Components**: Use functional components with Hooks. Avoid class components.
|
|
4
|
+
2. **Custom Hooks**: Extract complex logic into custom hooks (e.g., `useAuth`, `useFetch`).
|
|
5
|
+
3. **Component Structure**: Keep components small and focused. One component per file.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
### 🛡️ Legacy Refactoring Rules
|
|
2
|
+
- **Characterization Tests First**: Before changing any code, write tests that capture the current behavior (bugs and all).
|
|
3
|
+
- **Refactoring Strategy**: Use the "Strangler Fig" pattern for major rewrites. refactor only the code you touch ("Boy Scout Rule").
|
|
4
|
+
- **Code Coverage**: Do not enforce 100% on old code. Focus on coverage for *new* code and *changed* legacy code.
|
|
5
|
+
- **Technical Debt**: Mark known issues with `// TODO: [Legacy]`. Don't try to fix everything at once.
|
|
6
|
+
- **Types**: Use `any` effectively if types are missing, but aim to introduce interfaces for boundary layers.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
### 🚀 Prototype Rigor Mode
|
|
2
|
+
|
|
3
|
+
- **Speed First**: Focus on delivering features and validating hypotheses.
|
|
4
|
+
- **Testing**: Critical path tests only. TDD is optional.
|
|
5
|
+
- **Technical Debt**: Allowed, but must be marked with `// TODO: [Refactor]`.
|
|
6
|
+
- **Typing**: `any` allowed for rapid prototyping, refine later.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
### 🛡️ Strict Rigor Mode
|
|
2
|
+
|
|
3
|
+
- **Test Driven Development (TDD)**: Mandatory. Write failing tests before writing code.
|
|
4
|
+
- **Coverage**: Maintain 100% code coverage.
|
|
5
|
+
- **Typing**: No `any`. Strict TypeScript configuration enabled.
|
|
6
|
+
- **Code Reviews**: 2 approvals required. No self-merging.
|
|
7
|
+
- **Documentation**: All public APIs must be documented with JSDoc/TSDoc.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
### Rust Development Standards
|
|
2
|
+
|
|
3
|
+
- **Toolchain**: Use `cargo` for dependency management, build, and test.
|
|
4
|
+
- **Formatting**: Enforce `cargo fmt` (rustfmt) for consistent code style.
|
|
5
|
+
- **Linting**: Use `cargo clippy` and address all warnings.
|
|
6
|
+
- **Error Handling**: Use `Result` and `Option` types explicitly. Avoid `unwrap()` and `expect()` in production code; prefer `?` propagation or pattern matching.
|
|
7
|
+
- **Concurrency**: Use `tokio` or `std::thread` appropriately. Ensure thread safety with `Arc`, `Mutex`, `RwLock`.
|
|
8
|
+
- **Testing**:
|
|
9
|
+
- Unit tests in the same file module `#[cfg(test)] mod tests { ... }`.
|
|
10
|
+
- Integration tests in `tests/` directory.
|
|
11
|
+
- **Documentation**: Write documentation comments `///` for all public APIs.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
### 🧩 Scrypto (RadixDLT) Guidelines
|
|
2
|
+
- **Asset-Oriented**: Treat resources (Tokens, NFTs) as first-class citizens using `Buckets` and `Vaults`. Avoid tracking balances in generic maps.
|
|
3
|
+
- **Blueprints & Components**: Keep blueprints modular. Use `functions` for instantiation and `methods` for state mutation.
|
|
4
|
+
- **Testing**:
|
|
5
|
+
- Use `TestEnvironment` for unit tests (fast, isolated).
|
|
6
|
+
- Use `LedgerSimulator` for integration tests (manifest-based).
|
|
7
|
+
- Run tests with `cargo test`.
|
|
8
|
+
- **Security**: Use `Badges` for authorization (Actor-Virtual-Badge pattern). Validate all resource movements (withdrawals/deposits).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Solidity Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Version Pragma**: Always specify a specific Solidity version or range.
|
|
4
|
+
2. **Visibility**: Explicitly declare function visibility (public, external, internal, private).
|
|
5
|
+
3. **Reentrancy**: Follow CEI pattern (Checks-Effects-Interactions) to prevent reentrancy.
|
|
6
|
+
4. **Gas Optimization**: Minimize storage writes, use `memory` for temporary data.
|
|
7
|
+
5. **Events**: Emit events for all state changes for off-chain indexing.
|
|
8
|
+
6. **Access Control**: Use OpenZeppelin's Ownable or AccessControl.
|
|
9
|
+
7. **Error Handling**: Use custom errors instead of require strings for gas efficiency.
|
|
10
|
+
8. **Testing**: Use Foundry or Hardhat for comprehensive testing.
|
|
11
|
+
9. **Upgradability**: Use proxy patterns (UUPS, Transparent) if upgradeable.
|
|
12
|
+
10. **Audit**: All contracts must be audited before mainnet deployment.
|
|
13
|
+
|
|
14
|
+
### Security Checklist
|
|
15
|
+
- [ ] Reentrancy guards implemented
|
|
16
|
+
- [ ] Integer overflow/underflow handled (Solidity 0.8+)
|
|
17
|
+
- [ ] Access control verified
|
|
18
|
+
- [ ] External call risks assessed
|
|
19
|
+
- [ ] Flash loan attack vectors considered
|
|
20
|
+
- [ ] Front-running mitigations in place
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Spring Boot Specific Rules
|
|
2
|
+
|
|
3
|
+
1. **Project Structure**: Organize by feature/domain, not by layer.
|
|
4
|
+
2. **Dependency Injection**: Use constructor injection, avoid field injection.
|
|
5
|
+
3. **Configuration**: Use application.yml with profiles for environments.
|
|
6
|
+
4. **REST Controllers**: Use @RestController with proper HTTP methods and status codes.
|
|
7
|
+
5. **Service Layer**: Keep business logic in @Service classes.
|
|
8
|
+
6. **Repository**: Use Spring Data JPA repositories, custom queries in @Query.
|
|
9
|
+
7. **Validation**: Use @Valid and Bean Validation annotations.
|
|
10
|
+
8. **Exception Handling**: Use @ControllerAdvice for global exception handling.
|
|
11
|
+
9. **Security**: Use Spring Security for authentication and authorization.
|
|
12
|
+
10. **Testing**: Use @SpringBootTest for integration, @WebMvcTest for controllers.
|
|
13
|
+
11. **Actuator**: Enable health and metrics endpoints for observability.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
___ _ _ _ _
|
|
3
|
+
/ _ \ | | (_) (_) |
|
|
4
|
+
/ /_\ \_ __| |_ _ __ _ _ __ __ ___ _____| |_ _ _
|
|
5
|
+
| _ | '_ \ __| |/ _` | '__/ _` \ \ / / | | __| | | |
|
|
6
|
+
| | | | | | | |_| | (_| | | | (_| |\ V /| | | | |_| |
|
|
7
|
+
\_| |_/_| |_|\__|_|\__, |_| \__,_| \_/ |_|_| \__, |
|
|
8
|
+
__/ | __/ |
|
|
9
|
+
|___/ |___/
|
|
10
|
+
|
|
11
|
+
Welcome to the Antigravity Workflow CLI!
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
ag-flow [command]
|
|
15
|
+
|
|
16
|
+
Commands:
|
|
17
|
+
init Initialize the agent workflow in your current directory.
|
|
18
|
+
- Auto-detects your Tech Stack (Node, Rust, Python, etc.)
|
|
19
|
+
- Generates specific Agent Rules (.agent/rules/coding-standards.md)
|
|
20
|
+
- Creates CI/CD Pipelines (.github/workflows/)
|
|
21
|
+
- Sets up Role-Based Prompts (.agent/workflows/)
|
|
22
|
+
- Generates .gitignore and Dockerfile optimized for your stack
|
|
23
|
+
|
|
24
|
+
Options:
|
|
25
|
+
--config <path> Run initialization from a configuration file (skip prompts)
|
|
26
|
+
|
|
27
|
+
guide Show this help message.
|
|
28
|
+
|
|
29
|
+
Workflows Generated:
|
|
30
|
+
After running 'init', you will find markdown files in '.agent/workflows/'.
|
|
31
|
+
Copy the content of these files (e.g., 'dev.md') into your AI Agent (Cursor, Windsurf)
|
|
32
|
+
to prime it with your project's specific context and rules.
|
|
33
|
+
|
|
34
|
+
Supported Stacks:
|
|
35
|
+
- Frontend: React, Vue, Angular, Flutter
|
|
36
|
+
- Backend: NestJS, ASP.NET Core, Python, Node.js, Rust
|
|
37
|
+
- Smart Contracts: Scrypto
|
|
38
|
+
|
|
39
|
+
Rigor Modes:
|
|
40
|
+
- Strict: Enforces TDD, 100% test coverage, and strict typing.
|
|
41
|
+
- Prototype: Focuses on speed and MVP validation.
|
|
42
|
+
|
|
43
|
+
Configuration:
|
|
44
|
+
Your settings are saved in '.agent/antigravity.json'.
|
|
45
|
+
You can edit this file to manually adjust your project context.
|
|
46
|
+
|
|
47
|
+
Need more help?
|
|
48
|
+
Visit: https://github.com/antigravity/flow
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Tech Lead & Standards Workflow
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. **Code Review**:
|
|
6
|
+
- Review Pull Requests for code quality, security, and best practices.
|
|
7
|
+
- Ensure adherence to SOLID and Clean Code principles.
|
|
8
|
+
- Verify tests cover new functionality.
|
|
9
|
+
- Check for potential performance issues.
|
|
10
|
+
- Provide constructive, actionable feedback.
|
|
11
|
+
|
|
12
|
+
2. **Architecture Validation**:
|
|
13
|
+
- Validate design decisions and patterns.
|
|
14
|
+
- Ensure separation of concerns.
|
|
15
|
+
- Verify dependency direction follows architecture rules.
|
|
16
|
+
- Review for unnecessary complexity.
|
|
17
|
+
|
|
18
|
+
3. **Technical Debt Management**:
|
|
19
|
+
- Maintain a technical debt backlog.
|
|
20
|
+
- Prioritize debt based on impact and effort.
|
|
21
|
+
- Allocate time each sprint for debt reduction.
|
|
22
|
+
- Track debt metrics over time.
|
|
23
|
+
- Tag debt items with severity: `// TODO: [Tech-Debt-High]`.
|
|
24
|
+
|
|
25
|
+
4. **Sprint Metrics & Velocity**:
|
|
26
|
+
- Track team velocity and trends.
|
|
27
|
+
- Monitor code quality metrics (coverage, complexity).
|
|
28
|
+
- Review cycle time and lead time.
|
|
29
|
+
- Identify and address bottlenecks.
|
|
30
|
+
|
|
31
|
+
5. **Mentoring & Growth**:
|
|
32
|
+
- Provide constructive feedback to team members.
|
|
33
|
+
- Guide on complex technical issues.
|
|
34
|
+
- Encourage knowledge sharing and learning.
|
|
35
|
+
- Conduct pair programming sessions.
|
|
36
|
+
- Support career development discussions.
|
|
37
|
+
|
|
38
|
+
6. **Knowledge Sharing**:
|
|
39
|
+
- Organize tech talks and brown bag sessions.
|
|
40
|
+
- Document and share learnings from incidents.
|
|
41
|
+
- Maintain internal wikis and runbooks.
|
|
42
|
+
- Encourage writing internal blog posts.
|
|
43
|
+
|
|
44
|
+
7. **Incident Management**:
|
|
45
|
+
- Define incident severity levels.
|
|
46
|
+
- Establish on-call rotation and escalation paths.
|
|
47
|
+
- Lead incident response and coordination.
|
|
48
|
+
- Conduct blameless post-mortems.
|
|
49
|
+
- Track incident metrics (MTTR, MTTD).
|
|
50
|
+
|
|
51
|
+
8. **Tooling & Automation**:
|
|
52
|
+
- Maintain build pipelines and CI/CD.
|
|
53
|
+
- Ensure linting rules are enforced.
|
|
54
|
+
- Automate repetitive tasks.
|
|
55
|
+
- Evaluate and adopt new tools thoughtfully.
|
|
56
|
+
- Ensure `<%= buildCommand %>` runs smoothly.
|
|
57
|
+
|
|
58
|
+
9. **Release Management**:
|
|
59
|
+
- Coordinate release planning.
|
|
60
|
+
- Ensure release notes are complete.
|
|
61
|
+
- Verify rollback procedures exist.
|
|
62
|
+
- Monitor post-release stability.
|
|
63
|
+
|
|
64
|
+
10. **Cross-Team Collaboration**:
|
|
65
|
+
- Align with other teams on shared dependencies.
|
|
66
|
+
- Participate in architecture forums.
|
|
67
|
+
- Represent team in technical discussions.
|
|
68
|
+
- Communicate technical decisions clearly.
|
|
69
|
+
|
|
70
|
+
## Lead Dev Checklist
|
|
71
|
+
- [ ] All PRs reviewed within SLA
|
|
72
|
+
- [ ] Technical debt is tracked and addressed
|
|
73
|
+
- [ ] Team has clear understanding of architecture
|
|
74
|
+
- [ ] Incidents have post-mortems
|
|
75
|
+
- [ ] Knowledge is documented and shared
|
|
76
|
+
- [ ] Metrics are tracked and improving
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: .NET CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- name: Setup .NET
|
|
16
|
+
uses: actions/setup-dotnet@v3
|
|
17
|
+
with:
|
|
18
|
+
dotnet-version: 6.0.x
|
|
19
|
+
- name: Restore dependencies
|
|
20
|
+
run: dotnet restore
|
|
21
|
+
- name: Build
|
|
22
|
+
run: <%= project.buildCommand %>
|
|
23
|
+
- name: Test
|
|
24
|
+
run: <%= project.testCommand %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Flutter CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-java@v2
|
|
16
|
+
with:
|
|
17
|
+
distribution: 'zulu'
|
|
18
|
+
java-version: '11'
|
|
19
|
+
- uses: subosito/flutter-action@v2
|
|
20
|
+
with:
|
|
21
|
+
flutter-version: '3.x'
|
|
22
|
+
- run: flutter pub get
|
|
23
|
+
- run: <%= project.testCommand %>
|
|
24
|
+
- run: <%= project.buildCommand %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: NestJS CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [18.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v3
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
- run: npm ci
|
|
25
|
+
- run: <%= project.buildCommand %>
|
|
26
|
+
- run: <%= project.testCommand %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: React CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
node-version: [18.x]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v3
|
|
19
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
20
|
+
uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: ${{ matrix.node-version }}
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
- run: npm ci
|
|
25
|
+
- run: <%= project.buildCommand %>
|
|
26
|
+
- run: <%= project.testCommand %>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Rust CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main", "develop" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main", "develop" ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
name: Build and Test
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v3
|
|
19
|
+
|
|
20
|
+
- name: Set up Rust
|
|
21
|
+
uses: actions-rs/toolchain@v1
|
|
22
|
+
with:
|
|
23
|
+
profile: minimal
|
|
24
|
+
toolchain: stable
|
|
25
|
+
override: true
|
|
26
|
+
components: rustfmt, clippy
|
|
27
|
+
|
|
28
|
+
- name: Check Formatting
|
|
29
|
+
run: cargo fmt -- --check
|
|
30
|
+
|
|
31
|
+
- name: Clippy Linting
|
|
32
|
+
run: cargo clippy -- -D warnings
|
|
33
|
+
|
|
34
|
+
- name: Build
|
|
35
|
+
run: cargo build --verbose
|
|
36
|
+
|
|
37
|
+
- name: Run Tests
|
|
38
|
+
run: cargo test --verbose
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Scrypto CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build_and_test:
|
|
14
|
+
name: Build & Test
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install Rust Toolchain
|
|
20
|
+
uses: dtolnay/rust-toolchain@stable
|
|
21
|
+
with:
|
|
22
|
+
targets: wasm32-unknown-unknown
|
|
23
|
+
|
|
24
|
+
# Optional: Install Scrypto CLI if needed for specific build steps,
|
|
25
|
+
# but standard cargo test usually suffices for logic verification.
|
|
26
|
+
# - name: Install Scrypto Simulator (optional/expensive)
|
|
27
|
+
# run: |
|
|
28
|
+
# cargo install --force radix-clis
|
|
29
|
+
|
|
30
|
+
- name: Build
|
|
31
|
+
run: cargo build --release --target wasm32-unknown-unknown
|
|
32
|
+
|
|
33
|
+
- name: Run Tests
|
|
34
|
+
run: cargo test
|