You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: CDK Lambda handlers and shared task pipeline conventions
3
+
globs: cdk/src/handlers/**/*.ts
4
+
alwaysApply: false
5
+
---
6
+
7
+
# CDK handlers
8
+
9
+
- Prefer extending existing helpers in `cdk/src/handlers/shared/` (orchestration, validation, preflight) over duplicating logic.
10
+
- When changing API shapes, edit **`cdk/src/handlers/shared/types.ts`** and mirror the same definitions in **`cli/src/types.ts`**.
11
+
- Add or update Jest tests under **`cdk/test/handlers/`** or **`cdk/test/handlers/shared/`** next to the behavior you change (see **AGENTS.md** for a file map).
12
+
- Use **`mise //cdk:test`** and **`mise //cdk:compile`** from the repo root instead of ad-hoc `jest` / `tsc` in the wrong directory.
13
+
- Task lifecycle and admission behavior are described in **`docs/design/ORCHESTRATOR.md`**.
description: Authoritative docs live under guides/ and design/; Starlight is generated
3
+
globs: docs/guides/**/*.md,docs/design/**/*.md
4
+
alwaysApply: false
5
+
---
6
+
7
+
# Documentation sources
8
+
9
+
- Edit **`docs/guides/`** and **`docs/design/`** (and root **`CONTRIBUTING.md`** when it affects the site). Do **not** hand-edit **`docs/src/content/docs/`** — that tree is produced by **`docs/scripts/sync-starlight.mjs`**.
10
+
- After changing guides or design Markdown, run **`mise //docs:sync`** or **`mise //docs:build`** from the repo root.
11
+
- **`AGENTS.md`** is the root entry for contributors and coding agents; keep it in sync conceptually when you change cross-cutting dev workflows.
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/rfc.yml
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,21 @@ body:
9
9
attributes:
10
10
value: |
11
11
Use this template for significant feature or design proposals. Please add as much detail as possible. See the [ROADMAP](https://github.com/krokoko/bgagent/blob/main/docs/guides/ROADMAP.md) and [design docs](https://github.com/krokoko/bgagent/tree/main/docs/design) for existing direction; your RFC should align or explain divergence.
12
+
- type: dropdown
13
+
id: area
14
+
attributes:
15
+
label: Primary area
16
+
description: Which part of the repo does this RFC mainly affect?
Copy file name to clipboardExpand all lines: AGENTS.md
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,40 @@ You are an **AWS CDK (Cloud Development Kit) and TypeScript** expert. This proje
8
8
9
9
## Project knowledge
10
10
11
-
To get started and understand the developer flow, follow the [Developer guide](./docs/guides/DEVELOPER_GUIDE.md). For architecture and design, see [docs/design/](./docs/design/ARCHITECTURE.md).
11
+
To get started and understand the developer flow, follow the [Developer guide](./docs/guides/DEVELOPER_GUIDE.md). For architecture and design, see [docs/design/](./docs/design/ARCHITECTURE.md). Task lifecycle and handler contracts are summarized in [Orchestrator design](./docs/design/ORCHESTRATOR.md) (including **API and agent contracts**).
12
+
13
+
### Where to make changes
14
+
15
+
Use this routing before editing so the right package and tests get updated:
| User-facing or design prose |`docs/guides/`, `docs/design/`| Run **`mise //docs:sync`** or **`mise //docs:build`** (do not edit `docs/src/content/docs/` by hand) |
- Editing **`docs/src/content/docs/`** instead of **`docs/guides/`** or **`docs/design/`** — content is generated; sync from sources.
41
+
- Changing **`cdk/.../types.ts`** without updating **`cli/src/types.ts`** — CLI and API drift.
42
+
- Running raw **`jest`/`tsc`/`cdk`** from muscle memory — prefer **`mise //cdk:test`**, **`mise //cdk:compile`**, **`mise //cdk:synth`** (see [Commands you can use](#commands-you-can-use)).
43
+
-**`MISE_EXPERIMENTAL=1`** — required for namespaced tasks like **`mise //cdk:build`** (see [CONTRIBUTING.md](./CONTRIBUTING.md)).
44
+
-**`mise run build`** runs **`//agent:quality`** before CDK — the deployed image bundles **`agent/`**; agent changes belong in that tree.
12
45
13
46
### Tech stack
14
47
@@ -24,7 +57,7 @@ To get started and understand the developer flow, follow the [Developer guide](.
24
57
-**`scripts/`** (root) — Optional cross-package helpers; **`scripts/ci-build.sh`** runs the full monorepo build (same as CI).
-**`cli/`** — `@backgroundagent/cli` — CLI tool for interacting with the deployed REST API (see below).
27
-
-**`agent/`** — Python code that runs inside the agent compute environment (entrypoint, server, system prompt, Dockerfile, requirements).
60
+
-**`agent/`** — Python code that runs inside the agent compute environment (entrypoint, server, system prompt, Dockerfile, requirements). The system prompt is refactored into `agent/prompts/` with a shared base template and per-task-type workflow variants (`new_task`, `pr_iteration`, `pr_review`).
28
61
-**`docs/`** — Authoritative Markdown in `guides/` (developer, user, roadmap, prompt) and `design/`; assets in `diagrams/`, `imgs/`. The Starlight docs site lives here (`astro.config.mjs`, `package.json`); `src/content/docs/` is refreshed via `docs/scripts/sync-starlight.mjs`.
29
62
-**`CONTRIBUTING.md`** — Contribution guidelines at the repository root.
30
63
-**`package.json`** (root), **`yarn.lock`** — Yarn workspace root (minimal manifest); dependencies live in **`cdk/`**, **`cli/`**, and **`docs/`** package manifests.
@@ -40,7 +73,7 @@ The `@backgroundagent/cli` package provides the `bgagent` executable for submitt
40
73
-`src/api-client.ts` — HTTP client wrapping `fetch` with auth header injection
-`src/types.ts` — API request/response types (mirrored from `cdk/src/handlers/shared/types.ts`)
76
+
-`src/types.ts` — API request/response types (mirrored from `cdk/src/handlers/shared/types.ts`), including `TaskType` (`new_task` | `pr_iteration` | `pr_review`)
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,8 @@ When filing an issue, please check [existing open](https://github.com/aws-sample
22
22
23
23
### Pull Request Checklist
24
24
25
+
When planning edits, use **[AGENTS.md](./AGENTS.md)** at the repo root for **where to change code** (CDK vs CLI vs agent vs docs), **which tests to extend**, and **common pitfalls** (generated docs, mirrored API types, `mise` tasks).
26
+
25
27
*[ ] Testing
26
28
- Unit test added (prefer not to modify an existing test, otherwise, it's probably a breaking change)
27
29
- Integration test added (if adding a new pattern or making a significant update to an existing pattern)
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,9 @@ Each task follows a **blueprint** — a hybrid workflow that mixes deterministic
42
42
43
43
1.**Admission** — the orchestrator validates the request, checks concurrency limits, and queues the task if needed.
44
44
2.**Context hydration** — the platform gathers context: task description, GitHub issue body, repo-intrinsic knowledge (CLAUDE.md, README), and memory from past tasks on the same repo.
45
-
3.**Agent execution** — the agent runs in an isolated MicroVM: clones the repo, creates a branch, edits code, commits, runs tests and lint. The orchestrator polls for completion without blocking compute.
46
-
4.**Finalization** — the orchestrator infers the result (PR created or not), runs optional validation (lint, tests), extracts learnings into memory, and updates task status.
45
+
3.**Pre-flight** — fail-closed readiness checks verify GitHub API reachability and repository access before consuming compute. Doomed tasks fail fast with a clear reason (`GITHUB_UNREACHABLE`, `REPO_NOT_FOUND_OR_NO_ACCESS`) instead of burning runtime.
46
+
4.**Agent execution** — the agent runs in an isolated MicroVM with persistent session storage for select caches: clones the repo, creates a branch, edits code, commits, runs tests and lint. The orchestrator polls for completion without blocking compute.
47
+
5.**Finalization** — the orchestrator infers the result (PR created or not), runs optional validation (lint, tests), extracts learnings into memory, and updates task status.
47
48
48
49
For the full architecture, see [ARCHITECTURE.md](./docs/design/ARCHITECTURE.md).
49
50
@@ -58,7 +59,7 @@ ABCA is under active development. The platform ships iteratively — each iterat
0 commit comments