Skip to content

Commit 38902f1

Browse files
authored
Merge pull request #1 from askgina/feat/initial-scaffold
feat: scaffold Ask Gina SDK, CLI, plugins, and evals
2 parents eb87ecd + 88d5998 commit 38902f1

153 files changed

Lines changed: 19316 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# ADR Format
2+
3+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
4+
5+
Create the `docs/adr/` directory lazily: only when the first ADR is needed.
6+
7+
## Template
8+
9+
```md
10+
# {Short title of the decision}
11+
12+
{1-3 sentences: what's the context, what did we decide, and why.}
13+
```
14+
15+
That's it. An ADR can be a single paragraph. The value is in recording _that_ a decision was made and _why_, not in filling out sections.
16+
17+
## Optional sections
18+
19+
Only include these when they add genuine value. Most ADRs won't need them.
20+
21+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`): useful when decisions are revisited
22+
- **Considered Options**: only when the rejected alternatives are worth remembering
23+
- **Consequences**: only when non-obvious downstream effects need to be called out
24+
25+
## Numbering
26+
27+
Scan `docs/adr/` for the highest existing number and increment by one.
28+
29+
## When to offer an ADR
30+
31+
All three of these must be true:
32+
33+
1. **Hard to reverse**: the cost of changing your mind later is meaningful
34+
2. **Surprising without context**: a future reader will look at the code and wonder "why on earth did they do it this way?"
35+
3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
36+
37+
If a decision is easy to reverse, skip it: you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
38+
39+
### What qualifies
40+
41+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
42+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
43+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library: just the ones that would take a quarter to swap out.
44+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
45+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
46+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
47+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it; otherwise someone will suggest GraphQL again in six months.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# CONTEXT.md Format
2+
3+
## Structure
4+
5+
```md
6+
# {Context Name}
7+
8+
{One or two sentence description of what this context is and why it exists.}
9+
10+
## Language
11+
12+
**Order**:
13+
{A one or two sentence description of the term}
14+
_Avoid_: Purchase, transaction
15+
16+
**Invoice**:
17+
A request for payment sent to a customer after delivery.
18+
_Avoid_: Bill, payment request
19+
20+
**Customer**:
21+
A person or organization that places orders.
22+
_Avoid_: Client, buyer, account
23+
```
24+
25+
## Rules
26+
27+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
28+
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
29+
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
30+
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
31+
32+
## Single vs multi-context repos
33+
34+
**Single context (most repos):** One `CONTEXT.md` at the repo root.
35+
36+
**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
37+
38+
```md
39+
# Context Map
40+
41+
## Contexts
42+
43+
- [Ordering](./src/ordering/CONTEXT.md): receives and tracks customer orders
44+
- [Billing](./src/billing/CONTEXT.md): generates invoices and processes payments
45+
- [Fulfillment](./src/fulfillment/CONTEXT.md): manages warehouse picking and shipping
46+
47+
## Relationships
48+
49+
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
50+
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
51+
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
52+
```
53+
54+
The skill infers which structure applies:
55+
56+
- If `CONTEXT-MAP.md` exists, read it to find contexts
57+
- If only a root `CONTEXT.md` exists, single context
58+
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
59+
60+
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
name: domain-modeling
3+
description: Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.
4+
---
5+
6+
# Domain Modeling
7+
8+
Actively build and sharpen the project's domain model as you design. This is the _active_ discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. (Merely _reading_ `CONTEXT.md` for vocabulary is not this skill: that's a one-line habit any skill can do. This skill is for when you're changing the model, not just consuming it.)
9+
10+
## File structure
11+
12+
Most repos have a single context:
13+
14+
```
15+
/
16+
├── CONTEXT.md
17+
├── docs/
18+
│ └── adr/
19+
│ ├── 0001-event-sourced-orders.md
20+
│ └── 0002-postgres-for-write-model.md
21+
└── src/
22+
```
23+
24+
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
25+
26+
```
27+
/
28+
├── CONTEXT-MAP.md
29+
├── docs/
30+
│ └── adr/ ← system-wide decisions
31+
├── src/
32+
│ ├── ordering/
33+
│ │ ├── CONTEXT.md
34+
│ │ └── docs/adr/ ← context-specific decisions
35+
│ └── billing/
36+
│ ├── CONTEXT.md
37+
│ └── docs/adr/
38+
```
39+
40+
Create files lazily: only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
41+
42+
## During the session
43+
44+
### Challenge against the glossary
45+
46+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"
47+
48+
### Sharpen fuzzy language
49+
50+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account': do you mean the Customer or the User? Those are different things."
51+
52+
### Discuss concrete scenarios
53+
54+
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
55+
56+
### Cross-reference with code
57+
58+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?"
59+
60+
### Update CONTEXT.md inline
61+
62+
When a term is resolved, update `CONTEXT.md` right there. Don't batch these up: capture them as they happen. Use the format in [CONTEXT-FORMAT.md](./CONTEXT-FORMAT.md).
63+
64+
`CONTEXT.md` should be totally devoid of implementation details. Do not treat `CONTEXT.md` as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.
65+
66+
### Offer ADRs sparingly
67+
68+
Only offer to create an ADR when all three are true:
69+
70+
1. **Hard to reverse**: the cost of changing your mind later is meaningful
71+
2. **Surprising without context**: a future reader will wonder "why did they do it this way?"
72+
3. **The result of a real trade-off**: there were genuine alternatives and you picked one for specific reasons
73+
74+
If any of the three is missing, skip the ADR. Use the format in [ADR-FORMAT.md](./ADR-FORMAT.md).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface:
2+
display_name: "Domain Modeling"
3+
short_description: "Build and sharpen a domain model"

.agents/skills/grilling/SKILL.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: grilling
3+
description: Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
4+
---
5+
6+
Interview the user relentlessly until you reach a shared understanding. Map this as a **design tree**: every decision branches into the decisions that hang off it.
7+
8+
Work the tree in **rounds**. The **frontier** is every decision whose prerequisites are already settled: the questions you can ask _now_ without guessing at answers you haven't heard yet. Ask the whole frontier in one round: number each question and give your recommended answer. Then wait for the user's answers before the next round.
9+
10+
Format a round like so:
11+
12+
```
13+
❓ **Q1** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
14+
15+
➡️ <your recommended answer>
16+
17+
---
18+
19+
❓ **Q2** - **<question title>**: <question body, might be multiple paragraphs, including multiple choices>
20+
21+
➡️ <your recommended answer>
22+
```
23+
24+
Each round the user answers reshapes the tree: settled decisions push the frontier outward and unblock questions that depended on them. Recompute the frontier and ask the next round. A question whose answer depends on another question still open in this round belongs to a _later_ round, not this one.
25+
26+
Finding _facts_ is your job, never the user's. When a frontier question needs a fact from the environment (filesystem, tools, etc.), dispatch a sub-agent to find it; don't ask the user for anything you could look up yourself. Don't block on it: a running exploration is an unsettled prerequisite, so only the questions downstream of it wait for the sub-agent to report; ask the rest of the frontier now. The _decisions_ are the user's: put each to them and wait.
27+
28+
The session is done when the frontier is empty: every branch of the design tree visited, nothing left silently assumed. Do not act on it until the user confirms you have reached a shared understanding.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
interface:
2+
display_name: "Grilling"
3+
short_description: "Stress-test thinking a round of questions at a time"

.agents/skills/prototype/LOGIC.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Logic Prototype
2+
3+
A single, self-contained HTML file (a **shareable demo**) that lets anyone drive a state model by clicking buttons. Use this when the question is about **business logic, state transitions, or data shape**: the kind of thing that looks reasonable on paper but only feels wrong once you push it through real cases.
4+
5+
Because it's one file with nothing to install, you can hand it to a non-developer (a designer, a PM, a domain expert) and let them feel the model for themselves. So it speaks their language, not the code's.
6+
7+
## When this is the right shape
8+
9+
- "I'm not sure if this state machine handles the edge case where X then Y."
10+
- "Does this data model actually let me represent the case where..."
11+
- "I want to feel out what the API should look like before writing it."
12+
- Anything where someone wants to **press buttons and watch state change**.
13+
14+
If the question is "what should this look like," this is the wrong branch. Use [UI.md](UI.md).
15+
16+
## Process
17+
18+
### 1. State the question
19+
20+
Before writing code, write down what state model and what question you're prototyping. One paragraph, at the top of the demo (in a visible intro, not just a comment). A logic prototype that answers the wrong question is pure waste, so make the question explicit so it can be checked later, whether the user is watching now or returning to it AFK.
21+
22+
### 2. Isolate the logic in a portable module
23+
24+
Put the actual logic (the bit that's answering the question) in a single `<script>` block written as a small, pure module that could be lifted out and dropped into the real codebase later. The page around it is throwaway; this module isn't.
25+
26+
The right shape depends on the question:
27+
28+
- **A pure reducer**: `(state, action) => state`. Good when actions are discrete events and state is a single value.
29+
- **A state machine**: explicit states and transitions. Good when "which actions are even legal right now" is part of the question.
30+
- **A small set of pure functions** over a plain data type. Good when there's no implicit current state, just transformations.
31+
- **A class or module with a clear method surface** when the logic genuinely owns ongoing internal state.
32+
33+
Pick whichever shape best fits the question being asked, _not_ whichever is easiest to wire to a page. Keep it pure: no DOM, no `document`, no button handlers reaching inside it. The page calls into it; nothing flows the other direction. This is what makes the prototype useful past its own lifetime: once the question's answered, the validated reducer / machine / function set lifts into the real module on its own.
34+
35+
### 3. Build the shareable HTML file
36+
37+
One file, plain HTML/CSS/JS: no framework, no bundler, no server, everything inline so it opens by double-click and survives being emailed around. Anyone should be able to run it by opening it.
38+
39+
Write it for a non-developer. Every label is in **domain language**, not code: buttons and state read like the business, not the reducer. Explain in plain words what's happening.
40+
41+
Lay it out with a clean hierarchy, top to bottom:
42+
43+
1. **Title and one-line explanation** of what this demo lets you explore (the question from step 1).
44+
2. **Current state**: the full relevant state, rendered as a readable panel (labelled fields, not a raw JSON dump), re-rendered after every click so the change is visible. Where it helps a non-developer follow, call out what just changed.
45+
3. **Free-play buttons**: one button per action, always available, so anyone can poke at the model in any order. Each click dispatches its action and re-renders the state.
46+
4. **Guided walkthroughs**: a set of **scenarios**, one per tab. Each tab holds a short plain-language description of the scenario (the situation it sets up and what to watch for) and underneath it, the ordered **buttons to press** for that scenario. Each step is a real button: clicking it performs that action and moves to the next step. Starting a walkthrough resets to a known initial state so the scenario runs the same way every time.
47+
48+
Choose scenarios that demonstrate the awkward cases, the ones hard to reason about on paper: the happy path, a tricky edge case, an attempt at something that should be illegal.
49+
50+
Keep it beautiful but restrained: clean typography, generous spacing, one accent colour. No animations, no gimmicks: nothing that competes with the state and the buttons.
51+
52+
### 4. Hand it over
53+
54+
Send them the file, or open it for them. They'll click through the walkthroughs and free-play whenever they get to it; the interesting moments are when they say "wait, that shouldn't be possible" or "huh, I assumed X would be different"; those are the bugs in the _idea_, which is the whole point. If they want new actions or a new scenario, add them. Prototypes evolve.
55+
56+
### 5. Capture the answer and the prototype
57+
58+
Once the prototype has answered its question, capture the answer, then capture the prototype the way the [SKILL](SKILL.md) describes. The logic-specific mapping: the validated reducer / machine / function set lifts into the real module (the decision, absorbed); the HTML shell rides along to the throwaway branch that keeps the prototype as a primary source, and being one self-contained file, it stays trivially re-runnable there.
59+
60+
## Anti-patterns
61+
62+
- **Don't add tests.** A prototype that needs tests is no longer a prototype.
63+
- **Don't wire it to the real database.** Use in-memory state unless the question is specifically about persistence.
64+
- **Don't generalise.** No "what if we wanted to support X later." The prototype answers one question.
65+
- **Don't blur the logic and the page together.** If the pure module references the DOM, `document`, or button handlers, it's no longer liftable. Keep the page as a thin shell over a pure module.
66+
- **Don't reach for a framework, bundler, or server.** One file the recipient double-clicks; a React app or a dev server defeats "shareable".
67+
- **Don't ship the HTML shell into production.** The page is optimised for being clicked through by hand. The logic module behind it is the bit worth keeping.

.agents/skills/prototype/SKILL.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: prototype
3+
description: Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
4+
---
5+
6+
# Prototype
7+
8+
A prototype is **throwaway code that answers a question**. The question decides the shape.
9+
10+
## Pick a branch
11+
12+
Identify which question is being answered, using the user's prompt, the surrounding code, or by asking if the user is around:
13+
14+
- **"Does this logic / state model feel right?"**[LOGIC.md](LOGIC.md). Build a single shareable HTML file (free-play buttons plus tabbed guided walkthroughs) that pushes the state machine through cases that are hard to reason about on paper, and that a non-developer can drive.
15+
- **"What should this look like?"**[UI.md](UI.md). Generate several radically different UI variations on a single route, switchable via a URL search param and a floating bottom bar.
16+
17+
The two branches produce very different artifacts, so getting this wrong wastes the whole prototype. If the question is genuinely ambiguous and the user isn't reachable, default to whichever branch better matches the surrounding code (a backend module → logic; a page or component → UI) and state the assumption at the top of the prototype.
18+
19+
## Rules that apply to both
20+
21+
1. **Throwaway from day one, and clearly marked as such.** Locate the prototype code close to where it will actually be used (next to the module or page it's prototyping for) so context is obvious, but name it so a casual reader can see it's a prototype, not production. For throwaway UI routes, obey whatever routing convention the project already uses; don't invent a new top-level structure.
22+
2. **Trivial to run.** A UI prototype starts from one command in the project's task runner: `pnpm <name>`, `python <path>`, `bun <path>`, etc. A logic demo is a single HTML file the user double-clicks. Either way, no thinking required to start it.
23+
3. **No persistence by default.** State lives in memory. Persistence is the thing the prototype is _checking_, not something it should depend on. If the question explicitly involves a database, hit a scratch DB or a local file with a clear "PROTOTYPE, wipe me" name.
24+
4. **Skip the polish.** No tests, no error handling beyond what makes the prototype _runnable_, no abstractions. The point is to learn something fast.
25+
5. **Surface the state.** After every action (logic) or on every variant switch (UI), print or render the full relevant state so the user can see what changed.
26+
6. **Capture it when done.** Fold any validated decision into the real code, then capture the prototype itself as a **primary source**: commit it to a throwaway branch, out of main, and leave a context pointer to that branch on the implementation issue. Capture the answer too (the verdict and the question it settled) in the issue or a commit. The main branch keeps only the validated decision.

0 commit comments

Comments
 (0)