axiom-coding-agent-setup 1.2.0 → 1.3.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/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/.agents/skills/grill-with-docs/SKILL.md +7 -0
- package/.agents/skills/grill-with-docs/agents/openai.yaml +5 -0
- package/.agents/skills/grilling/SKILL.md +28 -0
- package/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/.agents/skills/huggingface-deployment/SKILL.md +12 -11
- package/.agents/skills/implement/SKILL.md +15 -0
- package/.agents/skills/implement/agents/openai.yaml +5 -0
- package/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/.agents/skills/tdd/SKILL.md +38 -0
- package/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/.agents/skills/tdd/mocking.md +59 -0
- package/.agents/skills/tdd/tests.md +77 -0
- package/.agents/skills/to-spec/SKILL.md +75 -0
- package/.agents/skills/to-spec/agents/openai.yaml +5 -0
- package/.agents/skills/to-tickets/SKILL.md +105 -0
- package/.agents/skills/to-tickets/agents/openai.yaml +5 -0
- package/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/.agents/skills/triage/SKILL.md +112 -0
- package/.agents/skills/triage/agents/openai.yaml +5 -0
- package/.agents/skills/wayfinder/SKILL.md +128 -0
- package/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/README.md +10 -1
- package/bin/cli.js +21 -0
- package/package.json +1 -1
- package/skills-lock.json +117 -57
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Triage Labels
|
|
2
|
+
|
|
3
|
+
The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
|
|
4
|
+
|
|
5
|
+
| Label in mattpocock/skills | Label in our tracker | Meaning |
|
|
6
|
+
| -------------------------- | -------------------- | ---------------------------------------- |
|
|
7
|
+
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
|
|
8
|
+
| `needs-info` | `needs-info` | Waiting on reporter for more information |
|
|
9
|
+
| `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
|
|
10
|
+
| `ready-for-human` | `ready-for-human` | Requires human implementation |
|
|
11
|
+
| `wontfix` | `wontfix` | Will not be actioned |
|
|
12
|
+
|
|
13
|
+
When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
|
|
14
|
+
|
|
15
|
+
Edit the right-hand column to match whatever vocabulary you actually use.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tdd
|
|
3
|
+
description: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Test-Driven Development
|
|
7
|
+
|
|
8
|
+
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.
|
|
9
|
+
|
|
10
|
+
When exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
|
|
11
|
+
|
|
12
|
+
## What a good test is
|
|
13
|
+
|
|
14
|
+
Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: "user can checkout with valid cart" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure.
|
|
15
|
+
|
|
16
|
+
See [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.
|
|
17
|
+
|
|
18
|
+
## Seams: where tests go
|
|
19
|
+
|
|
20
|
+
A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
|
|
21
|
+
|
|
22
|
+
**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
|
|
23
|
+
|
|
24
|
+
Ask: "What's the public interface, and which seams should we test?"
|
|
25
|
+
|
|
26
|
+
When the shape of that interface is itself in question (how deep the module is, where the seam belongs, what the interface should expose), call the Skill tool with "codebase-design" for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.
|
|
27
|
+
|
|
28
|
+
## Anti-patterns
|
|
29
|
+
|
|
30
|
+
- **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.
|
|
31
|
+
- **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.
|
|
32
|
+
- **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.
|
|
33
|
+
|
|
34
|
+
## Rules of the loop
|
|
35
|
+
|
|
36
|
+
- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
|
|
37
|
+
- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
|
|
38
|
+
- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# When to Mock
|
|
2
|
+
|
|
3
|
+
Mock at **system boundaries** only:
|
|
4
|
+
|
|
5
|
+
- External APIs (payment, email, etc.)
|
|
6
|
+
- Databases (sometimes - prefer test DB)
|
|
7
|
+
- Time/randomness
|
|
8
|
+
- File system (sometimes)
|
|
9
|
+
|
|
10
|
+
Don't mock:
|
|
11
|
+
|
|
12
|
+
- Your own classes/modules
|
|
13
|
+
- Internal collaborators
|
|
14
|
+
- Anything you control
|
|
15
|
+
|
|
16
|
+
## Designing for Mockability
|
|
17
|
+
|
|
18
|
+
At system boundaries, design interfaces that are easy to mock:
|
|
19
|
+
|
|
20
|
+
**1. Use dependency injection**
|
|
21
|
+
|
|
22
|
+
Pass external dependencies in rather than creating them internally:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// Easy to mock
|
|
26
|
+
function processPayment(order, paymentClient) {
|
|
27
|
+
return paymentClient.charge(order.total);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Hard to mock
|
|
31
|
+
function processPayment(order) {
|
|
32
|
+
const client = new StripeClient(process.env.STRIPE_KEY);
|
|
33
|
+
return client.charge(order.total);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**2. Prefer SDK-style interfaces over generic fetchers**
|
|
38
|
+
|
|
39
|
+
Create specific functions for each external operation instead of one generic function with conditional logic:
|
|
40
|
+
|
|
41
|
+
```typescript
|
|
42
|
+
// GOOD: Each function is independently mockable
|
|
43
|
+
const api = {
|
|
44
|
+
getUser: (id) => fetch(`/users/${id}`),
|
|
45
|
+
getOrders: (userId) => fetch(`/users/${userId}/orders`),
|
|
46
|
+
createOrder: (data) => fetch('/orders', { method: 'POST', body: data }),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// BAD: Mocking requires conditional logic inside the mock
|
|
50
|
+
const api = {
|
|
51
|
+
fetch: (endpoint, options) => fetch(endpoint, options),
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The SDK approach means:
|
|
56
|
+
- Each mock returns one specific shape
|
|
57
|
+
- No conditional logic in test setup
|
|
58
|
+
- Easier to see which endpoints a test exercises
|
|
59
|
+
- Type safety per endpoint
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Good and Bad Tests
|
|
2
|
+
|
|
3
|
+
## Good Tests
|
|
4
|
+
|
|
5
|
+
**Integration-style**: Test through real interfaces, not mocks of internal parts.
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// GOOD: Tests observable behavior
|
|
9
|
+
test("user can checkout with valid cart", async () => {
|
|
10
|
+
const cart = createCart();
|
|
11
|
+
cart.add(product);
|
|
12
|
+
const result = await checkout(cart, paymentMethod);
|
|
13
|
+
expect(result.status).toBe("confirmed");
|
|
14
|
+
});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Characteristics:
|
|
18
|
+
|
|
19
|
+
- Tests behavior users/callers care about
|
|
20
|
+
- Uses public API only
|
|
21
|
+
- Survives internal refactors
|
|
22
|
+
- Describes WHAT, not HOW
|
|
23
|
+
- One logical assertion per test
|
|
24
|
+
|
|
25
|
+
## Bad Tests
|
|
26
|
+
|
|
27
|
+
**Implementation-detail tests**: Coupled to internal structure.
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
// BAD: Tests implementation details
|
|
31
|
+
test("checkout calls paymentService.process", async () => {
|
|
32
|
+
const mockPayment = jest.mock(paymentService);
|
|
33
|
+
await checkout(cart, payment);
|
|
34
|
+
expect(mockPayment.process).toHaveBeenCalledWith(cart.total);
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Red flags:
|
|
39
|
+
|
|
40
|
+
- Mocking internal collaborators
|
|
41
|
+
- Testing private methods
|
|
42
|
+
- Asserting on call counts/order
|
|
43
|
+
- Test breaks when refactoring without behavior change
|
|
44
|
+
- Test name describes HOW not WHAT
|
|
45
|
+
- Verifying through external means instead of interface
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// BAD: Bypasses interface to verify
|
|
49
|
+
test("createUser saves to database", async () => {
|
|
50
|
+
await createUser({ name: "Alice" });
|
|
51
|
+
const row = await db.query("SELECT * FROM users WHERE name = ?", ["Alice"]);
|
|
52
|
+
expect(row).toBeDefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// GOOD: Verifies through interface
|
|
56
|
+
test("createUser makes user retrievable", async () => {
|
|
57
|
+
const user = await createUser({ name: "Alice" });
|
|
58
|
+
const retrieved = await getUser(user.id);
|
|
59
|
+
expect(retrieved.name).toBe("Alice");
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Tautological tests**: Expected value restates the implementation, so the test passes by construction.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// BAD: Expected value is recomputed the way the code computes it
|
|
67
|
+
test("calculateTotal sums line items", () => {
|
|
68
|
+
const items = [{ price: 10 }, { price: 5 }];
|
|
69
|
+
const expected = items.reduce((sum, i) => sum + i.price, 0);
|
|
70
|
+
expect(calculateTotal(items)).toBe(expected);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// GOOD: Expected value is an independent, known literal
|
|
74
|
+
test("calculateTotal sums line items", () => {
|
|
75
|
+
expect(calculateTotal([{ price: 10 }, { price: 5 }])).toBe(15);
|
|
76
|
+
});
|
|
77
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: to-spec
|
|
3
|
+
description: "Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
This skill takes the current conversation context and codebase understanding and produces a spec. Do NOT interview the user; just synthesize what you already know.
|
|
8
|
+
|
|
9
|
+
The issue tracker and triage label vocabulary should have been provided to you. If not, tell the user to run `/setup-matt-pocock-skills`.
|
|
10
|
+
|
|
11
|
+
## Process
|
|
12
|
+
|
|
13
|
+
1. Explore the repo to understand the current state of the codebase, if you haven't already. Use the project's domain glossary vocabulary throughout the spec, and respect any ADRs in the area you're touching.
|
|
14
|
+
|
|
15
|
+
2. Sketch out the seams at which you're going to test the feature. Existing seams should be preferred to new ones. Use the highest seam possible. If new seams are needed, propose them at the highest point you can. The fewer seams across the codebase, the better - the ideal number is one.
|
|
16
|
+
|
|
17
|
+
Check with the user that these seams match their expectations.
|
|
18
|
+
|
|
19
|
+
3. Write the spec using the template below, then publish it to the project issue tracker. Apply the `ready-for-agent` triage label - no need for additional triage.
|
|
20
|
+
|
|
21
|
+
<spec-template>
|
|
22
|
+
|
|
23
|
+
## Problem Statement
|
|
24
|
+
|
|
25
|
+
The problem that the user is facing, from the user's perspective.
|
|
26
|
+
|
|
27
|
+
## Solution
|
|
28
|
+
|
|
29
|
+
The solution to the problem, from the user's perspective.
|
|
30
|
+
|
|
31
|
+
## User Stories
|
|
32
|
+
|
|
33
|
+
A LONG, numbered list of user stories. Each user story should be in the format of:
|
|
34
|
+
|
|
35
|
+
1. As an <actor>, I want a <feature>, so that <benefit>
|
|
36
|
+
|
|
37
|
+
<user-story-example>
|
|
38
|
+
1. As a mobile bank customer, I want to see balance on my accounts, so that I can make better informed decisions about my spending
|
|
39
|
+
</user-story-example>
|
|
40
|
+
|
|
41
|
+
This list of user stories should be extremely extensive and cover all aspects of the feature.
|
|
42
|
+
|
|
43
|
+
## Implementation Decisions
|
|
44
|
+
|
|
45
|
+
A list of implementation decisions that were made. This can include:
|
|
46
|
+
|
|
47
|
+
- The modules that will be built/modified
|
|
48
|
+
- The interfaces of those modules that will be modified
|
|
49
|
+
- Technical clarifications from the developer
|
|
50
|
+
- Architectural decisions
|
|
51
|
+
- Schema changes
|
|
52
|
+
- API contracts
|
|
53
|
+
- Specific interactions
|
|
54
|
+
|
|
55
|
+
Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
|
|
56
|
+
|
|
57
|
+
Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it within the relevant decision and note briefly that it came from a prototype. Trim to the decision-rich parts, not a working demo, just the important bits.
|
|
58
|
+
|
|
59
|
+
## Testing Decisions
|
|
60
|
+
|
|
61
|
+
A list of testing decisions that were made. Include:
|
|
62
|
+
|
|
63
|
+
- A description of what makes a good test (only test external behavior, not implementation details)
|
|
64
|
+
- Which modules will be tested
|
|
65
|
+
- Prior art for the tests (i.e. similar types of tests in the codebase)
|
|
66
|
+
|
|
67
|
+
## Out of Scope
|
|
68
|
+
|
|
69
|
+
A description of the things that are out of scope for this spec.
|
|
70
|
+
|
|
71
|
+
## Further Notes
|
|
72
|
+
|
|
73
|
+
Any further notes about the feature.
|
|
74
|
+
|
|
75
|
+
</spec-template>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: to-tickets
|
|
3
|
+
description: Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker).
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# To Tickets
|
|
8
|
+
|
|
9
|
+
Break a plan, spec, or conversation into a set of **tickets**: tracer-bullet vertical slices, each declaring the tickets that **block** it.
|
|
10
|
+
|
|
11
|
+
The issue tracker and triage label vocabulary should have been provided to you. If not, tell the user to run `/setup-matt-pocock-skills`.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
### 1. Gather context
|
|
16
|
+
|
|
17
|
+
Work from whatever is already in the conversation context. If the user passes a reference (a spec path, an issue number or URL) as an argument, fetch it and read its full body and comments.
|
|
18
|
+
|
|
19
|
+
### 2. Explore the codebase (optional)
|
|
20
|
+
|
|
21
|
+
If you have not already explored the codebase, do so to understand the current state of the code. Ticket titles and descriptions should use the project's domain glossary vocabulary, and respect ADRs in the area you're touching.
|
|
22
|
+
|
|
23
|
+
Look for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
|
|
24
|
+
|
|
25
|
+
### 3. Draft vertical slices
|
|
26
|
+
|
|
27
|
+
Break the work into **tracer bullet** tickets.
|
|
28
|
+
|
|
29
|
+
<vertical-slice-rules>
|
|
30
|
+
|
|
31
|
+
- Each slice cuts a narrow but COMPLETE path through every layer (schema, API, UI, tests): vertical, NOT a horizontal slice of one layer
|
|
32
|
+
- A completed slice is demoable or verifiable on its own
|
|
33
|
+
- Each slice is sized to fit in a single fresh context window
|
|
34
|
+
- Any prefactoring should be done first
|
|
35
|
+
|
|
36
|
+
</vertical-slice-rules>
|
|
37
|
+
|
|
38
|
+
Give each ticket its **blocking edges**: the other tickets that must complete before it can start. A ticket with no blockers can start immediately.
|
|
39
|
+
|
|
40
|
+
**Wide refactors are the exception to vertical slicing.** A **wide refactor** is one mechanical change (rename a column, retype a shared symbol) whose **blast radius** fans across the whole codebase, so a single edit breaks thousands of call sites at once and no vertical slice can land green. Don't force it into a tracer bullet; sequence it as **expand–contract**. First expand: add the new form beside the old so nothing breaks. Then migrate the call sites over in batches sized by blast radius (per package, per directory), each batch its own ticket blocked by the expand, keeping CI green batch to batch because the old form still exists. Finally contract: delete the old form once no caller remains, in a ticket blocked by every migrate batch. When even the batches can't stay green alone, keep the sequence but let them share an integration branch that all block a final integrate-and-verify ticket; green is promised only there.
|
|
41
|
+
|
|
42
|
+
### 4. Quiz the user
|
|
43
|
+
|
|
44
|
+
Present the proposed breakdown as a numbered list. For each ticket, show:
|
|
45
|
+
|
|
46
|
+
- **Title**: short descriptive name
|
|
47
|
+
- **Blocked by**: which other tickets (if any) must complete first
|
|
48
|
+
- **What it delivers**: the end-to-end behaviour this ticket makes work
|
|
49
|
+
|
|
50
|
+
Ask the user:
|
|
51
|
+
|
|
52
|
+
- Does the granularity feel right? (too coarse / too fine)
|
|
53
|
+
- Are the blocking edges correct: does each ticket only depend on tickets that genuinely gate it?
|
|
54
|
+
- Should any tickets be merged or split further?
|
|
55
|
+
|
|
56
|
+
Iterate until the user approves the breakdown.
|
|
57
|
+
|
|
58
|
+
### 5. Publish the tickets to the configured tracker
|
|
59
|
+
|
|
60
|
+
Publish the approved tickets. **How** depends on the tracker `/setup-matt-pocock-skills` configured; the tickets are the same either way, only the shape of the blocking edges changes:
|
|
61
|
+
|
|
62
|
+
- **Local files** → write one file per ticket under `.scratch/<feature-slug>/issues/<NN>-<slug>.md`, numbered from `01` in dependency order (blockers first). Each file's "Blocked by" lists the numbers/titles it depends on. Use the per-ticket file template below: one ticket per file, never a single combined file.
|
|
63
|
+
- **A real issue tracker (GitHub, Linear, …)** → publish one issue per ticket in dependency order (blockers first) so each ticket's blocking edges can reference real identifiers. Use the platform's native blocking / sub-issue relationship where it has one; otherwise set each ticket's "Blocked by" to the blocking issues. Apply the `ready-for-agent` triage label unless instructed otherwise; the tickets are agent-grabbable by construction.
|
|
64
|
+
|
|
65
|
+
Work the **frontier**: any ticket whose blockers are all done. For a purely linear chain that means top to bottom.
|
|
66
|
+
|
|
67
|
+
Do NOT close or modify any parent issue.
|
|
68
|
+
|
|
69
|
+
<local-ticket-template>
|
|
70
|
+
|
|
71
|
+
# <NN>: <Ticket title>
|
|
72
|
+
|
|
73
|
+
**What to build:** the end-to-end behaviour this ticket makes work, from the user's perspective, not a layer-by-layer implementation list.
|
|
74
|
+
|
|
75
|
+
**Blocked by:** the numbers/titles of the tickets that gate this one, or "None (can start immediately)".
|
|
76
|
+
|
|
77
|
+
**Status:** ready-for-agent
|
|
78
|
+
|
|
79
|
+
- [ ] Acceptance criterion 1
|
|
80
|
+
- [ ] Acceptance criterion 2
|
|
81
|
+
|
|
82
|
+
</local-ticket-template>
|
|
83
|
+
|
|
84
|
+
<issue-template>
|
|
85
|
+
|
|
86
|
+
## Parent
|
|
87
|
+
|
|
88
|
+
A reference to the parent issue on the tracker (if the source was an existing issue, otherwise omit this section).
|
|
89
|
+
|
|
90
|
+
## What to build
|
|
91
|
+
|
|
92
|
+
The end-to-end behaviour this ticket makes work, from the user's perspective, not layer-by-layer implementation.
|
|
93
|
+
|
|
94
|
+
## Acceptance criteria
|
|
95
|
+
|
|
96
|
+
- [ ] Criterion 1
|
|
97
|
+
- [ ] Criterion 2
|
|
98
|
+
|
|
99
|
+
## Blocked by
|
|
100
|
+
|
|
101
|
+
- A reference to each blocking ticket, or "None (can start immediately)".
|
|
102
|
+
|
|
103
|
+
</issue-template>
|
|
104
|
+
|
|
105
|
+
In either form, avoid specific file paths or code snippets: they go stale fast. Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it and note briefly that it came from a prototype. Trim to the decision-rich parts, not a working demo, just the important bits.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Writing Agent Briefs
|
|
2
|
+
|
|
3
|
+
An agent brief is a structured comment posted on a GitHub issue or PR when it moves to `ready-for-agent`. It is the authoritative specification that an AFK agent will work from. The original body and discussion are context: the agent brief is the contract.
|
|
4
|
+
|
|
5
|
+
The brief states **what the agent should do**, which stretches to both surfaces: for an issue, that's building the change from nothing; for a PR, it's what's left to do *to the existing diff*: finish it, close gaps, address review points. Same principles either way; the PR example below shows the difference.
|
|
6
|
+
|
|
7
|
+
## Principles
|
|
8
|
+
|
|
9
|
+
### Durability over precision
|
|
10
|
+
|
|
11
|
+
The issue may sit in `ready-for-agent` for days or weeks. The codebase will change in the meantime. Write the brief so it stays useful even as files are renamed, moved, or refactored.
|
|
12
|
+
|
|
13
|
+
- **Do** describe interfaces, types, and behavioral contracts
|
|
14
|
+
- **Do** name specific types, function signatures, or config shapes that the agent should look for or modify
|
|
15
|
+
- **Don't** reference file paths: they go stale
|
|
16
|
+
- **Don't** reference line numbers
|
|
17
|
+
- **Don't** assume the current implementation structure will remain the same
|
|
18
|
+
|
|
19
|
+
### Behavioral, not procedural
|
|
20
|
+
|
|
21
|
+
Describe **what** the system should do, not **how** to implement it. The agent will explore the codebase fresh and make its own implementation decisions.
|
|
22
|
+
|
|
23
|
+
- **Good:** "The `SkillConfig` type should accept an optional `schedule` field of type `CronExpression`"
|
|
24
|
+
- **Bad:** "Open src/types/skill.ts and add a schedule field on line 42"
|
|
25
|
+
- **Good:** "When a user runs `/triage` with no arguments, they should see a summary of issues needing attention"
|
|
26
|
+
- **Bad:** "Add a switch statement in the main handler function"
|
|
27
|
+
|
|
28
|
+
### Complete acceptance criteria
|
|
29
|
+
|
|
30
|
+
The agent needs to know when it's done. Every agent brief must have concrete, testable acceptance criteria. Each criterion should be independently verifiable.
|
|
31
|
+
|
|
32
|
+
- **Good:** "Running `gh issue list --label needs-triage` returns issues that have been through initial classification"
|
|
33
|
+
- **Bad:** "Triage should work correctly"
|
|
34
|
+
|
|
35
|
+
### Explicit scope boundaries
|
|
36
|
+
|
|
37
|
+
State what is out of scope. This prevents the agent from gold-plating or making assumptions about adjacent features.
|
|
38
|
+
|
|
39
|
+
## Template
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
## Agent Brief
|
|
43
|
+
|
|
44
|
+
**Category:** bug / enhancement
|
|
45
|
+
**Summary:** one-line description of what needs to happen
|
|
46
|
+
|
|
47
|
+
**Current behavior:**
|
|
48
|
+
Describe what happens now. For bugs, this is the broken behavior.
|
|
49
|
+
For enhancements, this is the status quo the feature builds on.
|
|
50
|
+
|
|
51
|
+
**Desired behavior:**
|
|
52
|
+
Describe what should happen after the agent's work is complete.
|
|
53
|
+
Be specific about edge cases and error conditions.
|
|
54
|
+
|
|
55
|
+
**Key interfaces:**
|
|
56
|
+
- `TypeName`: what needs to change and why
|
|
57
|
+
- `functionName()` return type: what it currently returns vs what it should return
|
|
58
|
+
- Config shape: any new configuration options needed
|
|
59
|
+
|
|
60
|
+
**Acceptance criteria:**
|
|
61
|
+
- [ ] Specific, testable criterion 1
|
|
62
|
+
- [ ] Specific, testable criterion 2
|
|
63
|
+
- [ ] Specific, testable criterion 3
|
|
64
|
+
|
|
65
|
+
**Out of scope:**
|
|
66
|
+
- Thing that should NOT be changed or addressed in this issue
|
|
67
|
+
- Adjacent feature that might seem related but is separate
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Examples
|
|
71
|
+
|
|
72
|
+
### Good agent brief (bug)
|
|
73
|
+
|
|
74
|
+
```markdown
|
|
75
|
+
## Agent Brief
|
|
76
|
+
|
|
77
|
+
**Category:** bug
|
|
78
|
+
**Summary:** Skill description truncation drops mid-word, producing broken output
|
|
79
|
+
|
|
80
|
+
**Current behavior:**
|
|
81
|
+
When a skill description exceeds 1024 characters, it is truncated at exactly
|
|
82
|
+
1024 characters regardless of word boundaries. This produces descriptions
|
|
83
|
+
that end mid-word (e.g. "Use when the user wants to confi").
|
|
84
|
+
|
|
85
|
+
**Desired behavior:**
|
|
86
|
+
Truncation should break at the last word boundary before 1024 characters
|
|
87
|
+
and append "..." to indicate truncation.
|
|
88
|
+
|
|
89
|
+
**Key interfaces:**
|
|
90
|
+
- The `SkillMetadata` type's `description` field: no type change needed,
|
|
91
|
+
but the validation/processing logic that populates it needs to respect
|
|
92
|
+
word boundaries
|
|
93
|
+
- Any function that reads SKILL.md frontmatter and extracts the description
|
|
94
|
+
|
|
95
|
+
**Acceptance criteria:**
|
|
96
|
+
- [ ] Descriptions under 1024 chars are unchanged
|
|
97
|
+
- [ ] Descriptions over 1024 chars are truncated at the last word boundary
|
|
98
|
+
before 1024 chars
|
|
99
|
+
- [ ] Truncated descriptions end with "..."
|
|
100
|
+
- [ ] The total length including "..." does not exceed 1024 chars
|
|
101
|
+
|
|
102
|
+
**Out of scope:**
|
|
103
|
+
- Changing the 1024 char limit itself
|
|
104
|
+
- Multi-line description support
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Good agent brief (enhancement)
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
## Agent Brief
|
|
111
|
+
|
|
112
|
+
**Category:** enhancement
|
|
113
|
+
**Summary:** Add `.out-of-scope/` directory support for tracking rejected feature requests
|
|
114
|
+
|
|
115
|
+
**Current behavior:**
|
|
116
|
+
When a feature request is rejected, the issue is closed with a `wontfix` label
|
|
117
|
+
and a comment. There is no persistent record of the decision or reasoning.
|
|
118
|
+
Future similar requests require the maintainer to recall or search for the
|
|
119
|
+
prior discussion.
|
|
120
|
+
|
|
121
|
+
**Desired behavior:**
|
|
122
|
+
Rejected feature requests should be documented in `.out-of-scope/<concept>.md`
|
|
123
|
+
files that capture the decision, reasoning, and links to all issues that
|
|
124
|
+
requested the feature. When triaging new issues, these files should be
|
|
125
|
+
checked for matches.
|
|
126
|
+
|
|
127
|
+
**Key interfaces:**
|
|
128
|
+
- Markdown file format in `.out-of-scope/`: each file should have a
|
|
129
|
+
`# Concept Name` heading, a `**Decision:**` line, a `**Reason:**` line,
|
|
130
|
+
and a `**Prior requests:**` list with issue links
|
|
131
|
+
- The triage workflow should read all `.out-of-scope/*.md` files early
|
|
132
|
+
and match incoming issues against them by concept similarity
|
|
133
|
+
|
|
134
|
+
**Acceptance criteria:**
|
|
135
|
+
- [ ] Closing a feature as wontfix creates/updates a file in `.out-of-scope/`
|
|
136
|
+
- [ ] The file includes the decision, reasoning, and link to the closed issue
|
|
137
|
+
- [ ] If a matching `.out-of-scope/` file already exists, the new issue is
|
|
138
|
+
appended to its "Prior requests" list rather than creating a duplicate
|
|
139
|
+
- [ ] During triage, existing `.out-of-scope/` files are checked and surfaced
|
|
140
|
+
when a new issue matches a prior rejection
|
|
141
|
+
|
|
142
|
+
**Out of scope:**
|
|
143
|
+
- Automated matching (human confirms the match)
|
|
144
|
+
- Reopening previously rejected features
|
|
145
|
+
- Bug reports (only enhancement rejections go to `.out-of-scope/`)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Good agent brief (PR)
|
|
149
|
+
|
|
150
|
+
For a PR, "Current behavior" describes the state of the diff, and the brief asks the agent to finish or fix it rather than build from scratch.
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
## Agent Brief
|
|
154
|
+
|
|
155
|
+
**Category:** enhancement
|
|
156
|
+
**Summary:** Finish the contributor's `--json` output flag for `triage list`
|
|
157
|
+
|
|
158
|
+
**Current behavior:**
|
|
159
|
+
The PR adds a `--json` flag that serializes the issue list to JSON. The happy
|
|
160
|
+
path works and the diff matches the project's command structure. Two gaps
|
|
161
|
+
remain: errors are still printed as human text (not JSON), and the new flag has
|
|
162
|
+
no test coverage.
|
|
163
|
+
|
|
164
|
+
**Desired behavior:**
|
|
165
|
+
With `--json`, all output (including errors) is well-formed JSON on stdout,
|
|
166
|
+
and the command's exit codes are unchanged. The existing human-readable output
|
|
167
|
+
is untouched when the flag is absent.
|
|
168
|
+
|
|
169
|
+
**Key interfaces:**
|
|
170
|
+
- The command's error path should emit `{ "error": string }` under `--json`
|
|
171
|
+
instead of the plain-text error
|
|
172
|
+
- Reuse the existing serializer the PR already added; don't introduce a second
|
|
173
|
+
|
|
174
|
+
**Acceptance criteria:**
|
|
175
|
+
- [ ] `triage list --json` emits valid JSON for both success and error cases
|
|
176
|
+
- [ ] Exit codes match the non-JSON command
|
|
177
|
+
- [ ] A test covers the `--json` success output and one error case
|
|
178
|
+
- [ ] Default (non-JSON) output is byte-for-byte unchanged
|
|
179
|
+
|
|
180
|
+
**Out of scope:**
|
|
181
|
+
- Adding `--json` to any other command
|
|
182
|
+
- Changing the JSON shape of the success payload the PR already defined
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Bad agent brief
|
|
186
|
+
|
|
187
|
+
```markdown
|
|
188
|
+
## Agent Brief
|
|
189
|
+
|
|
190
|
+
**Summary:** Fix the triage bug
|
|
191
|
+
|
|
192
|
+
**What to do:**
|
|
193
|
+
The triage thing is broken. Look at the main file and fix it.
|
|
194
|
+
The function around line 150 has the issue.
|
|
195
|
+
|
|
196
|
+
**Files to change:**
|
|
197
|
+
- src/triage/handler.ts (line 150)
|
|
198
|
+
- src/types.ts (line 42)
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
This is bad because:
|
|
202
|
+
- No category
|
|
203
|
+
- Vague description ("the triage thing is broken")
|
|
204
|
+
- References file paths and line numbers that will go stale
|
|
205
|
+
- No acceptance criteria
|
|
206
|
+
- No scope boundaries
|
|
207
|
+
- No description of current vs desired behavior
|