agentic-team 0.0.0-stage → 6.2.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/LICENSE +21 -0
- package/README.md +189 -2
- package/bin/build-template.js +208 -0
- package/bin/index.js +1334 -0
- package/bin/platforms.js +510 -0
- package/package.json +41 -4
- package/template/.claude-plugin/plugin.json +10 -0
- package/template/.orchestra/README.md +391 -0
- package/template/.orchestra/blueprints/README.md +87 -0
- package/template/.orchestra/blueprints/api-only.md +46 -0
- package/template/.orchestra/blueprints/component-crud-resource.md +25 -0
- package/template/.orchestra/blueprints/saas-starter.md +69 -0
- package/template/.orchestra/config.yml +293 -0
- package/template/.orchestra/roles/orchestrator.md +105 -0
- package/template/.orchestra/roles/product-manager.md +439 -0
- package/template/.orchestra/scripts/compact-diff.awk +45 -0
- package/template/.orchestra/scripts/context.mjs +373 -0
- package/template/.orchestra/stacks/README.md +81 -0
- package/template/.orchestra/stacks/_lib/common.sh +3095 -0
- package/template/.orchestra/stacks/_repo/setup.sh +1113 -0
- package/template/.orchestra/stacks/backend-hono/claude/commands/endpoint.md +13 -0
- package/template/.orchestra/stacks/backend-hono/claude/skills/api-endpoint/SKILL.md +111 -0
- package/template/.orchestra/stacks/backend-hono/claude/skills/testing/SKILL.md +75 -0
- package/template/.orchestra/stacks/backend-hono/setup.sh +5945 -0
- package/template/.orchestra/stacks/backend-hono/stack.md +195 -0
- package/template/.orchestra/stacks/mobile-android-native/claude/commands/component.md +13 -0
- package/template/.orchestra/stacks/mobile-android-native/claude/skills/design-component/SKILL.md +58 -0
- package/template/.orchestra/stacks/mobile-android-native/setup.sh +607 -0
- package/template/.orchestra/stacks/mobile-android-native/stack.md +138 -0
- package/template/.orchestra/stacks/mobile-expo/claude/commands/component.md +12 -0
- package/template/.orchestra/stacks/mobile-expo/claude/skills/design-component/SKILL.md +92 -0
- package/template/.orchestra/stacks/mobile-expo/setup.sh +470 -0
- package/template/.orchestra/stacks/mobile-expo/stack.md +141 -0
- package/template/.orchestra/stacks/mobile-ios-native/claude/commands/component.md +12 -0
- package/template/.orchestra/stacks/mobile-ios-native/claude/skills/design-component/SKILL.md +58 -0
- package/template/.orchestra/stacks/mobile-ios-native/setup.sh +468 -0
- package/template/.orchestra/stacks/mobile-ios-native/stack.md +130 -0
- package/template/.orchestra/stacks/web-nextjs/claude/commands/component.md +12 -0
- package/template/.orchestra/stacks/web-nextjs/claude/skills/design-component/SKILL.md +100 -0
- package/template/.orchestra/stacks/web-nextjs/claude/skills/design-tokens/SKILL.md +61 -0
- package/template/.orchestra/stacks/web-nextjs/setup.sh +128 -0
- package/template/.orchestra/stacks/web-nextjs/stack.md +170 -0
- package/template/.orchestra/stacks/web-vite-react/claude/commands/component.md +12 -0
- package/template/.orchestra/stacks/web-vite-react/claude/skills/design-component/SKILL.md +100 -0
- package/template/.orchestra/stacks/web-vite-react/claude/skills/design-tokens/SKILL.md +61 -0
- package/template/.orchestra/stacks/web-vite-react/setup.sh +185 -0
- package/template/.orchestra/stacks/web-vite-react/stack.md +177 -0
- package/template/.orchestra/trackers/github.sh +467 -0
- package/template/CLAUDE.md +54 -0
- package/template/agents/architect.md +83 -0
- package/template/agents/engineer-high.md +17 -0
- package/template/agents/engineer-low.md +17 -0
- package/template/agents/engineer-max.md +17 -0
- package/template/agents/engineer-medium.md +17 -0
- package/template/agents/engineer-xhigh.md +17 -0
- package/template/agents/lead.md +925 -0
- package/template/agents/milestone-reviewer.md +65 -0
- package/template/agents/orchestrator.md +105 -0
- package/template/agents/product-manager.md +439 -0
- package/template/agents/re-reviewer.md +25 -0
- package/template/agents/reviewer.md +303 -0
- package/template/agents/scaffolder.md +206 -0
- package/template/agents/tracker.md +202 -0
- package/template/commands/blueprint.md +23 -0
- package/template/commands/create-role.md +64 -0
- package/template/commands/export.md +45 -0
- package/template/commands/help.md +56 -0
- package/template/commands/hotfix.md +14 -0
- package/template/commands/orchestrator.md +12 -0
- package/template/commands/pm.md +18 -0
- package/template/commands/rewind.md +63 -0
- package/template/commands/setup.md +15 -0
- package/template/commands/start.md +29 -0
- package/template/commands/status.md +11 -0
- package/template/commands/sync.md +76 -0
- package/template/commands/verifier.md +53 -0
- package/template/hooks/audit-context.sh +166 -0
- package/template/hooks/enforce-role.sh +193 -0
- package/template/hooks/protect-system-files.sh +123 -0
- package/template/hooks/review-rounds.sh +172 -0
- package/template/rules/acceptance-check.orchestra.md +11 -0
- package/template/rules/analytics-kpi.orchestra.md +56 -0
- package/template/rules/code-standards.orchestra.md +35 -0
- package/template/rules/comments.orchestra.md +77 -0
- package/template/rules/commit-format.orchestra.md +20 -0
- package/template/rules/dependency-upgrade.orchestra.md +112 -0
- package/template/rules/design-parity.orchestra.md +181 -0
- package/template/rules/observability.orchestra.md +121 -0
- package/template/rules/performance.orchestra.md +190 -0
- package/template/rules/phase-limits.orchestra.md +3 -0
- package/template/rules/pull-request.orchestra.md +218 -0
- package/template/rules/role-boundaries.orchestra.md +132 -0
- package/template/rules/security.orchestra.md +106 -0
- package/template/rules/stuck-detection.orchestra.md +25 -0
- package/template/rules/testing-standards.orchestra.md +219 -0
- package/template/rules/tracker-authority.orchestra.md +198 -0
- package/template/rules/verification-gate.orchestra.md +56 -0
- package/template/skills/accessibility/SKILL.md +31 -0
- package/template/skills/android-testing/SKILL.md +112 -0
- package/template/skills/architecture/SKILL.md +175 -0
- package/template/skills/auth-setup/SKILL.md +105 -0
- package/template/skills/best-practices/SKILL.md +29 -0
- package/template/skills/code-optimizer/SKILL.md +27 -0
- package/template/skills/core-web-vitals/SKILL.md +32 -0
- package/template/skills/crud-api/SKILL.md +32 -0
- package/template/skills/debug/SKILL.md +28 -0
- package/template/skills/deployment/SKILL.md +104 -0
- package/template/skills/error-handling/SKILL.md +154 -0
- package/template/skills/frontend-design/SKILL.md +30 -0
- package/template/skills/fullstack-infrastructure/SKILL.md +108 -0
- package/template/skills/ios-testing/SKILL.md +100 -0
- package/template/skills/mobile-testing/SKILL.md +102 -0
- package/template/skills/observability/SKILL.md +91 -0
- package/template/skills/project-structure/SKILL.md +114 -0
- package/template/skills/push-notifications/SKILL.md +146 -0
- package/template/skills/react-best-practices/SKILL.md +31 -0
- package/template/skills/realtime/SKILL.md +146 -0
- package/template/skills/review/SKILL.md +82 -0
- package/template/skills/testing/SKILL.md +45 -0
- package/template/skills/web-quality-audit/SKILL.md +47 -0
- package/template/skills/web-testing/SKILL.md +120 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Add an API endpoint.
|
|
2
|
+
|
|
3
|
+
Usage: `/api:endpoint {method} {path}`
|
|
4
|
+
|
|
5
|
+
1. Load the `api-endpoint` skill. Follow its order — it is not optional.
|
|
6
|
+
2. Copy the shape of `src/features/health/`. It is the reference.
|
|
7
|
+
3. Schema first: Zod with realistic examples on every non-obvious field.
|
|
8
|
+
4. Declare every status code the route can return, errors included.
|
|
9
|
+
5. Keep the handler thin. Throw `AppError`; never format an error inline.
|
|
10
|
+
6. Add a service **only** if there is a decision to make. A forwarder is not.
|
|
11
|
+
7. Write the four required tests, through the real app object.
|
|
12
|
+
8. Run `npm run typecheck && npm run lint && npm run test:coverage`.
|
|
13
|
+
9. Read your endpoint in Swagger UI as a caller would before reporting done.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: api-endpoint
|
|
3
|
+
description: "Add or change a Hono endpoint — schema, route definition, handler, service decision, tests. Use for any work under src/features/."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adding an endpoint
|
|
7
|
+
|
|
8
|
+
Copy the shape of `src/features/health/`. It is the reference
|
|
9
|
+
implementation, not a placeholder.
|
|
10
|
+
|
|
11
|
+
## 1. Schema — `schema.ts`
|
|
12
|
+
|
|
13
|
+
Zod first. This object is the validator and the OpenAPI document.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
export const CreateUserBody = z.object({
|
|
17
|
+
email: z.string().email().openapi({ example: "ada@example.com" }),
|
|
18
|
+
name: z.string().min(1).openapi({ example: "Ada Lovelace" }),
|
|
19
|
+
}).openapi("CreateUserBody");
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Every field carries a realistic example unless it is self-evident. Not
|
|
23
|
+
`"string"`. Not `"foo"`. Someone reads these to decide how to call you,
|
|
24
|
+
and a useless example costs them an hour.
|
|
25
|
+
|
|
26
|
+
## 2. Route definition — `routes.ts`
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
const route = createRoute({
|
|
30
|
+
method: "post",
|
|
31
|
+
path: "/users",
|
|
32
|
+
tags: ["users"],
|
|
33
|
+
summary: "Create a user",
|
|
34
|
+
description: "Creates a user and returns it. Email must be unique.",
|
|
35
|
+
request: { body: { content: { "application/json": { schema: CreateUserBody } } } },
|
|
36
|
+
responses: {
|
|
37
|
+
201: { content: { "application/json": { schema: UserResponse } }, description: "Created" },
|
|
38
|
+
409: { content: { "application/json": { schema: ErrorSchema } }, description: "Email taken" },
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Declare **every** status code the handler can return, errors included. An
|
|
44
|
+
undocumented 404 is a lie in the spec.
|
|
45
|
+
|
|
46
|
+
## 3. Handler
|
|
47
|
+
|
|
48
|
+
Parse, authorize, delegate, respond. That is the whole job.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export function userRoutes(deps: Deps) {
|
|
52
|
+
return new OpenAPIHono().openapi(route, async (c) => {
|
|
53
|
+
const body = c.req.valid("json");
|
|
54
|
+
const user = await createUser(deps, body); // throws AppError on conflict
|
|
55
|
+
return c.json(user, 201);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Throw `AppError`. Never format an error response in a handler — the single
|
|
61
|
+
`onError` in `app.ts` owns that.
|
|
62
|
+
|
|
63
|
+
## 4. Service — only if there is a decision
|
|
64
|
+
|
|
65
|
+
Add `service.ts` when the feature branches, orchestrates more than one
|
|
66
|
+
source, or enforces a rule that holds regardless of transport.
|
|
67
|
+
|
|
68
|
+
If the handler validates and then touches one store, **do not add one**. A
|
|
69
|
+
service that forwards a single call means the next person opens two files
|
|
70
|
+
to learn nothing happened in the first.
|
|
71
|
+
|
|
72
|
+
## 5. Tests
|
|
73
|
+
|
|
74
|
+
Minimum four, through the real app:
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
const app = createApp({ ...fakes });
|
|
78
|
+
|
|
79
|
+
it("creates a user", …) // happy path
|
|
80
|
+
it("rejects an invalid email", …) // validation → 400
|
|
81
|
+
it("rejects an unauthenticated caller", …) // authorization → 401
|
|
82
|
+
it("returns the shared error shape on conflict", …) // 409 body shape
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Never mock our own code. Mock only the true edges: outbound HTTP, the
|
|
86
|
+
clock, randomness, the database driver.
|
|
87
|
+
|
|
88
|
+
If this endpoint calls a third-party library, test our wrapper — a
|
|
89
|
+
Dependabot bump that changes behavior has to turn the suite red.
|
|
90
|
+
|
|
91
|
+
## 6. Verify
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run typecheck && npm run lint && npm run test:coverage
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Coverage thresholds are enforced at 100. Then open Swagger UI and read
|
|
98
|
+
your endpoint as a caller would. If it reads badly there, it is wrong.
|
|
99
|
+
|
|
100
|
+
## Checklist
|
|
101
|
+
|
|
102
|
+
- [ ] schemas defined with Zod, realistic examples on every non-obvious field
|
|
103
|
+
- [ ] every returnable status code declared, errors included
|
|
104
|
+
- [ ] summary, description, tag
|
|
105
|
+
- [ ] handler is thin; `AppError` thrown, never formatted inline
|
|
106
|
+
- [ ] service added only because there was a decision to make
|
|
107
|
+
- [ ] authorization enforced on the route
|
|
108
|
+
- [ ] four tests minimum, through the real app
|
|
109
|
+
- [ ] coverage still 100
|
|
110
|
+
- [ ] correct and readable in Swagger UI
|
|
111
|
+
- [ ] no stack trace, query, or internal path in any response body
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: testing
|
|
3
|
+
description: "Decide what kind of test to write and what must be covered in this API. Use when adding tests, or when a coverage threshold fails."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Testing this API
|
|
7
|
+
|
|
8
|
+
## Which kind of test
|
|
9
|
+
|
|
10
|
+
| Situation | Test |
|
|
11
|
+
|---|---|
|
|
12
|
+
| An endpoint exists | Integration through `app.request()` |
|
|
13
|
+
| Pure logic with real branching | Unit test |
|
|
14
|
+
| A function wrapping a third-party library | Unit test on our wrapper |
|
|
15
|
+
| A function that only forwards | None — delete the forwarder instead |
|
|
16
|
+
|
|
17
|
+
**Integration-first** is the default. Driving the real app object covers
|
|
18
|
+
routing, validation, the handler, serialisation, and the error shape in
|
|
19
|
+
one test, with no server and no network. It fails for the reasons things
|
|
20
|
+
actually break.
|
|
21
|
+
|
|
22
|
+
## What never to mock
|
|
23
|
+
|
|
24
|
+
Our own code. If a test needs to mock a module we wrote, the design is
|
|
25
|
+
telling you those two things are tangled — fix the design.
|
|
26
|
+
|
|
27
|
+
Mock only true edges:
|
|
28
|
+
|
|
29
|
+
- outbound HTTP
|
|
30
|
+
- the clock (`deps.now`)
|
|
31
|
+
- randomness and id generation
|
|
32
|
+
- the database driver
|
|
33
|
+
|
|
34
|
+
These are injected through `Deps`, so a fake is a plain object, not a
|
|
35
|
+
framework.
|
|
36
|
+
|
|
37
|
+
## The Dependabot rule
|
|
38
|
+
|
|
39
|
+
> If one of our functions calls into a third-party library, that function
|
|
40
|
+
> has a test.
|
|
41
|
+
|
|
42
|
+
This is the entire reason the suite exists. When a bump changes behavior,
|
|
43
|
+
the suite must go red — otherwise a green build means nothing and every
|
|
44
|
+
dependency PR needs a human to read the changelog.
|
|
45
|
+
|
|
46
|
+
## Every endpoint, four tests minimum
|
|
47
|
+
|
|
48
|
+
1. happy path — correct status, correct body
|
|
49
|
+
2. validation failure — 400 and the shared error shape
|
|
50
|
+
3. authorization failure — 401 or 403
|
|
51
|
+
4. the documented error case — 404, 409, whatever the route declares
|
|
52
|
+
|
|
53
|
+
An endpoint with only a happy-path test is untested. The failure paths are
|
|
54
|
+
where the bugs are.
|
|
55
|
+
|
|
56
|
+
## Coverage
|
|
57
|
+
|
|
58
|
+
100% lines, functions, branches, statements — enforced in
|
|
59
|
+
`vitest.config.ts`. A drop fails the run.
|
|
60
|
+
|
|
61
|
+
Only `src/index.ts` is excluded, because it binds a port and nothing else.
|
|
62
|
+
Any new exclusion needs a comment justifying it, and "hard to test" is not
|
|
63
|
+
a justification — it is usually the design telling you something.
|
|
64
|
+
|
|
65
|
+
Chasing the last few percent by testing getters is not the point. If a
|
|
66
|
+
branch is uncoverable, ask whether it should exist.
|
|
67
|
+
|
|
68
|
+
## Test style
|
|
69
|
+
|
|
70
|
+
- One behavior per test. The name says the scenario, not the method.
|
|
71
|
+
- Arrange with real objects where possible. A fixture builder beats a
|
|
72
|
+
twelve-line literal repeated in nine tests.
|
|
73
|
+
- No shared mutable state between tests. Each builds its own app.
|
|
74
|
+
- Assert on the whole response body, not one field — that is how you catch
|
|
75
|
+
an accidental extra property leaking out.
|