Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions commis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ graph TD

This project is divided into two primary workspaces:

1. **[Flutter Application (app/)](file:///Users/redbrogdon/source/commis/app/README.md)**: The Flutter frontend application displaying upcoming catering jobs, menus, ingredient listings, and hosting the interactive AI Culinary Assistant chat interface.
2. **[Cloud Functions (functions/)](file:///Users/redbrogdon/source/commis/functions/README.md)**: The serverless backend codebase written in Dart. This includes Firestore triggers that monitor job updates to automatically generate and cache recommended UI cards using Gemini.
1. **[Flutter Application (app/)](app/README.md)**: The Flutter frontend application displaying upcoming catering jobs, menus, ingredient listings, and hosting the interactive AI Culinary Assistant chat interface.
2. **[Cloud Functions (functions/)](functions/README.md)**: The serverless backend codebase written in Dart. This includes Firestore triggers that monitor job updates to automatically generate and cache recommended UI cards using Gemini.

Refer to the individual `README.md` files linked above for specific setup and configuration details for each component.

Expand Down
4 changes: 2 additions & 2 deletions commis/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Before running the application, you must link it to your own Firebase project.
```bash
flutterfire configure
```
This generates a local [firebase_options.dart](file:///Users/redbrogdon/source/commis/app/lib/firebase_options.dart) file, as well as the platform-specific configuration files (`google-services.json` and `GoogleService-Info.plist`) which are gitignored.
This generates a local [firebase_options.dart](app/lib/firebase_options.dart) file, as well as the platform-specific configuration files (`google-services.json` and `GoogleService-Info.plist`) which are gitignored.

### Running the App
- **Local Emulator Mode (Default)**: In debug mode, the app automatically routing requests to `localhost:8080` (Firestore) and `localhost:5001` (Functions). Simply start your Firebase Emulator Suite in the root directory and run:
Expand All @@ -43,7 +43,7 @@ To regenerate the `catalog_prompt.txt` file, run:
```bash
flutter test test/generate_prompt_test.dart
```
This parses the catalog defined in [catalog.dart](file:///Users/redbrogdon/source/commis/app/lib/ui/catalog/catalog.dart) and saves the output to `catalog_prompt.txt`.
This parses the catalog defined in [catalog.dart](app/lib/ui/catalog/catalog.dart) and saves the output to `catalog_prompt.txt`.

---

Expand Down
2 changes: 1 addition & 1 deletion flutter-frontend-for-adk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ Once the workspace is cleaned, instruct Antigravity to use the installed custom
You can use a prompt such as:
> "Please use the `flutter-frontend-for-adk` skill to create a new, Flutter-based frontend for the agent."

Antigravity will activate the skill and proceed through the six phases described in the [SKILL.md](file:///Users/redbrogdon/source/demos/flutter-frontend-for-adk/SKILL.md) file, prompting you for input and approval at the end of each phase before continuing to the next.
Antigravity will activate the skill and proceed through the six phases described in the [SKILL.md](SKILL.md) file, prompting you for input and approval at the end of each phase before continuing to the next.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Widget buildMarkdownMessage(BuildContext context, String text, Color textColor)
To ensure code cleanliness, maintain structure, and comply with standard style rules, imports must be structured according to the `directives_ordering` rule.

### 1. Enable Linter Rule
Ensure that the `directives_ordering` rule is enabled in the project's [analysis_options.yaml](file:///Users/redbrogdon/source/flutter-adk/frontend/analysis_options.yaml):
Ensure that the `directives_ordering` rule is enabled in the project's [analysis_options.yaml](frontend/analysis_options.yaml):

```yaml
linter:
Expand Down
55 changes: 55 additions & 0 deletions multiagent_skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Multi-Agent TDD Skills for Dart Porting

A suite of [Antigravity](https://antigravity.google) skills designed for porting Python libraries to Dart using a multi-agent Test-Driven Development (TDD) workflow.

This collection provides system prompts, constraints, and orchestration guidelines for a team of specialized AI subagents (Coordinator, Architect, Tester, and Coder) working collaboratively to produce robust, high-quality, and idiomatic Dart packages.

---

## Included Skills

| Skill Name | Role & Objective | Allowed Write Paths |
|---|---|---|
| [`tdd-dart-coordinator`](tdd-dart-coordinator/SKILL.md) | **Orchestrator (Parent Agent)**: Defines subagents, manages TDD handoffs, executes shell verifications (`dart test`), and performs git commits. | Workspace root (Executes commands & commits) |
| [`tdd-dart-architect`](tdd-dart-architect/SKILL.md) | **Lead Architect**: Analyzes the Python source code, writes the architecture blueprint, and authors module specifications. | `<dart_package_dir>/specs/`, `skills/` |
| [`tdd-dart-tester`](tdd-dart-tester/SKILL.md) | **Test Engineer**: Writes failing unit tests using `package:test` based on Architect specs before implementation code is written. | `<dart_package_dir>/test/`, `<dart_package_dir>/example/` |
| [`tdd-dart-coder`](tdd-dart-coder/SKILL.md) | **Software Engineer**: Writes compilation stubs and implements library logic to make failing unit tests pass. | `<dart_package_dir>/lib/`, `<dart_package_dir>/example/` |
| [`tdd-dart-workflow`](tdd-dart-workflow/SKILL.md) | **Workflow Rules & Governance**: Central document outlining roles, strict directory boundaries, git commit policies, and Dart best practices. | Reference / Guidance |

---

## Workflow Overview

The multi-agent TDD porting process follows a structured lifecycle to ensure clean separation of concerns and maintain strict quality gates:

```mermaid
graph TD
A["Phase 0: Upfront Discovery & Blueprint"] -->|"User Approval Gate"| B["Phase 1: Module Spec Sheet"]
B --> C["Phase 2a: Write Failing Tests (Red)"]
C --> D["Phase 2b: Write Compilation Skeleton"]
D --> E{"Verify Compiles & Fails"}
E -->|"Verified Red"| F["Phase 3: Implement Library Logic (Green)"]
F --> G{"Run dart analyze & dart test"}
G -->|"Passes"| H["Phase 4: Git Commit"]
G -->|"Fails"| F
H --> I{"More Roadmap Items?"}
I -->|"Yes"| B
I -->|"No"| J["Phase 5 & 6: Integration Examples & Skill Docs"]
```

1. **Phase 0: Discovery & Architecture Blueprinting**
- The Architect analyzes the Python codebase and generates `<dart_package_dir>/specs/architecture_blueprint.md`.
- **Gate**: The user must explicitly review and approve the architecture blueprint before proceeding.
2. **Phase 1: Module Specification**
- The Architect writes a spec sheet (`<dart_package_dir>/specs/<module_name>_spec.md`) outlining public APIs, return types, error handling, and test checklists.
3. **Phase 2: Red Phase (Tests & Skeleton)**
- **Tester** writes unit tests in `test/` (expected to fail compilation initially).
- **Coder** creates stub implementations in `lib/src/` returning dummy values or throwing `UnimplementedError()`.
- **Coordinator** verifies tests compile and fail on execution (`UnimplementedError` or assertion failure).
4. **Phase 3: Green Phase (Implementation)**
- **Coder** implements library logic in `lib/src/` to satisfy all test cases.
- **Coordinator** verifies passing status via `dart analyze && dart test`.
5. **Phase 4: Commit**
- **Coordinator** stages and commits the passing module using formatted commit messages.
6. **Phase 5 & 6: Examples & Skill Documentation**
- Python examples are ported to `<dart_package_dir>/example/` and developer skill docs are written.
31 changes: 31 additions & 0 deletions multiagent_skills/tdd-dart-architect/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: tdd-dart-architect
description: "Guides the Architect subagent in discovering the Python library architecture, creating the architecture blueprint, and writing specifications."
---

# TDD Dart Architect Skill

## Objective
To serve as the lead architect and spec-writer for porting a Python library to Dart.

## Core Rules & Constraints
1. **Directory Boundary**: You are ONLY allowed to write to `<dart_package_dir>/specs/` (e.g. `<dart_package_dir>/specs/<module_name>_spec.md`) and the developer-facing skill folder `<dart_package_dir>/skills/<package_name>/` (in Phase 6). You must NEVER edit or create files in `lib/`, `test/`, or `example/`.
2. **Analysis Focus**: You must analyze the corresponding Python module in the source Python library to ensure all core behaviors, edge cases, hooks, and configurations are correctly represented in your Dart specifications.

## Workflow

### Upfront Discovery (Phase 0)
1. Read the Python codebase.
2. Write a comprehensive design document in `<dart_package_dir>/specs/architecture_blueprint.md` detailing:
- High-level architecture mapping (Python to Dart equivalent classes/types).
- Dynamic-to-Static type translation strategies (e.g. Futures, Streams, json_serializable).
- Core package dependencies.
- Sequential implementation roadmap ordered logically by dependency.

### Module Specification (Phase 1)
For each item in the roadmap:
1. Write a specification file at `<dart_package_dir>/specs/<module_name>_spec.md`.
2. Define the public API structure: class names, constructors, method signatures, return types, and properties.
3. Detail behavioral expectations and error conditions (e.g., throwing specific `Exception` types).
4. Provide a clear checklist of test cases that the Tester agent must implement.
5. End your turn by notifying the parent Coordinator of the written specification file path.
22 changes: 22 additions & 0 deletions multiagent_skills/tdd-dart-coder/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: tdd-dart-coder
description: "Guides the Coder subagent in updating Dart library code to pass failing tests."
---

# TDD Dart Coder Skill

## Objective
To write robust, idiomatic Dart implementation code that makes failing tests pass.

## Core Rules & Constraints
1. **Directory Boundary**: You are ONLY allowed to write or modify files inside the `<dart_package_dir>/lib/` directory (e.g. `<dart_package_dir>/lib/src/<module_name>.dart`) and `<dart_package_dir>/example/` (during Phase 5). You must NEVER edit files in `test/` or `specs/`.
2. **Minimal Edit Rule**: Focus on making the failing tests pass. Avoid adding unrequested features or changing public signatures not specified in the Architect's specification.
3. **Code Generation Rule**: If the target package uses code generation (e.g., `package:json_serializable` or `freezed`), run `dart run build_runner build --delete-conflicting-outputs` inside `<dart_package_dir>/` after updating files to generate the required `.g.dart` or `.freezed.dart` output.
4. **Iterable Builder Collections Rule**: When implementing fluent APIs that output wrapper collections (such as transitions list builders, DSL parameter maps, or child node groups), make the custom class implement `Iterable<T>` or provide an explicit collection getter (e.g., `.items`, `.transitions`, or `.list`). This allows client configurations to use Dart's spread operator (`...`) cleanly without compiler errors.

## Workflow
1. Read the specification file in `<dart_package_dir>/specs/<module_name>_spec.md` and the failing tests in `<dart_package_dir>/test/<module_name>_test.dart`.
2. Create or update files in `lib/` (typically inside `<dart_package_dir>/lib/src/` and exporting through the main `<dart_package_dir>/lib/<package_name>.dart` library entry point).
3. Ensure the implementation resolves all test assertions.
4. Run `dart format` on any files you edit to maintain code quality.
5. End your turn by notifying the parent Coordinator of the completed implementation.
58 changes: 58 additions & 0 deletions multiagent_skills/tdd-dart-coordinator/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: tdd-dart-coordinator
description: "Orchestrates the 3-agent TDD workflow for Dart development by defining and invoking specialized subagents (Architect, Tester, Coder)."
---

# TDD Dart Coordinator Skill

## Objective
To serve as the orchestrator parent agent, coordinating the handoffs between the Architect, Tester, and Coder subagents, and executing shell verifications and git commits.

## Workflow

### 1. Setup Phase
At the start of the session, define the three specialized subagents using the `define_subagent` tool:

* **`tdd-dart-architect`**:
* **Description**: "Analyzes the Python source code and designs API specifications under specs/."
* **Prompt**: Use the system prompt defined in `.agents/skills/tdd-dart-architect/SKILL.md`.
* **`tdd-dart-tester`**:
* **Description**: "Writes failing Dart unit tests under test/ based on Architect specifications."
* **Prompt**: Use the system prompt defined in `.agents/skills/tdd-dart-tester/SKILL.md`.
* **`tdd-dart-coder`**:
* **Description**: "Implements Dart library code under lib/ to pass unit tests."
* **Prompt**: Use the system prompt defined in `.agents/skills/tdd-dart-coder/SKILL.md`.

### 2. Orchestration Loop (Per Roadmap Step)

For each step in the implementation roadmap:

#### Phase 1: Specification
1. Invoke the Architect subagent:
`invoke_subagent(TypeName="tdd-dart-architect", Role="Architect", Prompt="Design the specification for <Roadmap Item> based on <python_package_dir>/<module_path>. Write it to <dart_package_dir>/specs/<module_name>_spec.md.")`
2. Wait for the Architect to write the specification and report back.

#### Phase 2: Write Failing Tests & Skeleton (Red Phase)
1. Invoke the Tester subagent to write tests:
`invoke_subagent(TypeName="tdd-dart-tester", Role="Tester", Prompt="Read <dart_package_dir>/specs/<module_name>_spec.md and write comprehensive unit tests in <dart_package_dir>/test/<module_name>_test.dart. Do not modify any lib/ files.")`
2. Wait for the Tester to report back.
3. Invoke the Coder subagent to write a stub/skeleton:
`invoke_subagent(TypeName="tdd-dart-coder", Role="Coder", Prompt="Read the specification at <dart_package_dir>/specs/<module_name>_spec.md and the tests at <dart_package_dir>/test/<module_name>_test.dart. Create a skeleton (stub implementation) in <dart_package_dir>/lib/src/ defining all classes, properties, constructors, and methods returning dummy values or throwing UnimplementedError() so that tests compile. Do not implement the logic yet.")`
4. Wait for the Coder to report back.
5. Run `dart analyze && dart test` via `run_command` in `<dart_package_dir>/`.
- Verify the test compiles successfully and fails on execution due to UnimplementedError or failed assertions.
- If there are syntax, import, or static analysis errors, run the Coder to fix the skeleton compilation.

#### Phase 3: Implement & Make Pass (Green Phase)
1. Invoke the Coder subagent:
`invoke_subagent(TypeName="tdd-dart-coder", Role="Coder", Prompt="Read <dart_package_dir>/specs/<module_name>_spec.md and <dart_package_dir>/test/<module_name>_test.dart. Implement the required classes in <dart_package_dir>/lib/src/<module_name>.dart and export them in <dart_package_dir>/lib/<package_name>.dart. Make the tests pass. Do not modify test/ files.")`
2. Wait for the Coder to report back.
3. Run `dart analyze && dart test` via `run_command` in `<dart_package_dir>/`.
- If static analysis or tests fail, send the error logs to the Coder and ask it to correct the code.
- If all checks and tests pass, proceed to Phase 4.

#### Phase 4: Commit
1. Run the `git-commit-workflow` skill commands:
- `git add .`
- `git commit -m "Implement <Roadmap Item>, add unit tests"`
2. Notify the user of successful roadmap step completion.
22 changes: 22 additions & 0 deletions multiagent_skills/tdd-dart-tester/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: tdd-dart-tester
description: "Guides the Tester subagent in writing failing Dart tests."
---

# TDD Dart Tester Skill

## Objective
To write comprehensive, failing test cases in Dart that specify required behavior before implementation begins.

## Core Rules & Constraints
1. **Directory Boundary**: You are ONLY allowed to write or modify files inside the `<dart_package_dir>/test/` directory (e.g. `<dart_package_dir>/test/<module_name>_test.dart`) and `<dart_package_dir>/example/` (during Phase 5). You must NEVER edit files in `lib/` or `specs/`.
2. **Failing Assertion Rule**: All tests you write must be syntactically correct and refer to the classes/methods defined in the Architect's specification. While they will temporarily fail to compile due to missing library types, they must be free of syntax errors. Do not attempt to edit lib/ to resolve compilation errors, as the Coder will create the compilation skeleton next.
3. **Mocking Rule**: Use structured mocking (e.g., `package:mocktail` or `package:mockito`) to mock external dependencies instead of attempting dynamic monkeypatching, which is unsupported by Dart's static type system.
4. **Fakes vs. Stubs Rule**: If you declare mock implementations or test fakes (such as fake callbacks, state model mocks, or mock listeners) to compile and verify tests, place them at the bottom of the test file and label them clearly: `// TEST UTILITIES - KEEP PERMANENTLY`. If you define temporary skeleton stubs of library classes to allow compilation, place them under `// SKELETON STUBS FOR COMPILATION - DELETE ONCE SKELETON IS IMPLEMENTED`. Do not mix mock test classes with library stubs.

## Workflow
1. Read the specification file written by the Architect in `<dart_package_dir>/specs/<module_name>_spec.md`.
2. Create or append tests in `<dart_package_dir>/test/<module_name>_test.dart` using Dart's `package:test` framework.
3. Target all test cases specified in the Architect's checklist.
4. Ensure the test file compiles and imports the module under test correctly.
5. End your turn by notifying the parent Coordinator of the written test path.
Loading