@punks/cli 2.1.7 → 2.1.10
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/README.md +2 -2
- package/dist/data/AGENTS.md +3 -1
- package/dist/data/catalog/hooks.ts +8 -0
- package/dist/data/catalog/lint.ts +28 -82
- package/dist/data/catalog/packs.ts +8 -6
- package/dist/data/catalog/skills.ts +48 -0
- package/dist/data/catalog/tools.ts +9 -1
- package/dist/data/hooks/format-edited-file.mjs +1 -1
- package/dist/data/hooks/scaffold-update-check.mjs +181 -0
- package/dist/data/hooks.test.ts +19 -2
- package/dist/data/scripts/sync-subagents.mjs +70 -37
- package/dist/data/subagents/manifest.mjs +120 -0
- package/dist/index.js +1916 -767
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +3 -3
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +1 -1
- package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +46 -0
- package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +4 -0
- package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +67 -0
- package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +41 -0
- package/dist/skills/agnostic/docs/writing-beats/SKILL.md +69 -0
- package/dist/skills/agnostic/docs/writing-fragments/SKILL.md +76 -0
- package/dist/skills/agnostic/docs/writing-shape/SKILL.md +75 -0
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -2
- package/dist/skills/agnostic/planning/create-plan/references/planner-phase.md +1 -1
- package/dist/skills/agnostic/planning/create-spec/SKILL.md +57 -12
- package/dist/skills/agnostic/planning/create-spec/references/backlog-sync.md +5 -2
- package/dist/skills/agnostic/planning/create-spec/references/discovery.md +24 -16
- package/dist/skills/agnostic/planning/create-spec/references/folder-naming.md +6 -2
- package/dist/skills/agnostic/planning/create-spec/references/wiki-bookkeeping.md +29 -5
- package/dist/skills/agnostic/planning/implement-spec/SKILL.md +34 -7
- package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +32 -9
- package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +4 -2
- package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +3 -3
- package/dist/skills/agnostic/planning/implement-spec/references/sequential.md +16 -6
- package/dist/skills/agnostic/planning/stack/SKILL.md +89 -0
- package/dist/skills/agnostic/quality/autoreview/SKILL.md +191 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/autoreview +1176 -0
- package/dist/skills/agnostic/quality/autoreview/scripts/test-review-harness +176 -0
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +7 -5
- package/dist/skills/frameworks/tanstack-query/tanstack-query/SKILL.md +621 -830
- package/dist/skills/frameworks/tanstack-start/tanstack-start/SKILL.md +250 -0
- package/dist/skills/phases/delivery-phase/SKILL.md +6 -1
- package/dist/skills/phases/docs-ingest-phase/SKILL.md +28 -20
- package/dist/skills/phases/docs-ingest-phase/references/fumadocs-routing.md +8 -5
- package/dist/skills/phases/docs-ingest-phase/references/public-docs.md +82 -0
- package/dist/skills/phases/requirements-phase/SKILL.md +2 -0
- package/dist/skills/phases/review-phase/SKILL.md +26 -9
- package/package.json +1 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tanstack-start
|
|
3
|
+
description: Full-stack React framework powered by TanStack Router with SSR, streaming, server functions, and deployment to any hosting provider.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TanStack Start Skills
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
TanStack Start is a full-stack React framework built on TanStack Router, powered by Vite and Nitro (via Vinxi). It provides server-side rendering, streaming, server functions (RPC), middleware, API routes, and deploys to any platform via Nitro presets.
|
|
11
|
+
|
|
12
|
+
**Package:** `@tanstack/react-start`
|
|
13
|
+
**Router Plugin:** `@tanstack/router-plugin`
|
|
14
|
+
**Build Tool:** Vinxi (Vite + Nitro)
|
|
15
|
+
**Status:** RC (Release Candidate)
|
|
16
|
+
**RSC Support:** React Server Components support is in active development and will land as a non-breaking v1.x addition
|
|
17
|
+
|
|
18
|
+
## Installation & Project Setup
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @tanstack/cli create my-app
|
|
22
|
+
# Or manually:
|
|
23
|
+
npm install @tanstack/react-start @tanstack/react-router react react-dom
|
|
24
|
+
npm install -D @tanstack/router-plugin typescript vite vite-tsconfig-paths
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Project Structure
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
my-app/
|
|
31
|
+
app/
|
|
32
|
+
routes/
|
|
33
|
+
__root.tsx # Root layout
|
|
34
|
+
index.tsx # / route
|
|
35
|
+
posts.$postId.tsx # /posts/:postId
|
|
36
|
+
api/
|
|
37
|
+
users.ts # /api/users API route
|
|
38
|
+
client.tsx # Client entry
|
|
39
|
+
router.tsx # Router creation
|
|
40
|
+
ssr.tsx # SSR entry
|
|
41
|
+
routeTree.gen.ts # Auto-generated route tree
|
|
42
|
+
app.config.ts # TanStack Start config
|
|
43
|
+
tsconfig.json
|
|
44
|
+
package.json
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Configuration (`app.config.ts`)
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { defineConfig } from '@tanstack/react-start/config'
|
|
51
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
52
|
+
|
|
53
|
+
export default defineConfig({
|
|
54
|
+
vite: {
|
|
55
|
+
plugins: [
|
|
56
|
+
viteTsConfigPaths({ projects: ['./tsconfig.json'] }),
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
server: {
|
|
60
|
+
preset: 'node-server', // 'vercel' | 'netlify' | 'cloudflare-pages' | etc.
|
|
61
|
+
},
|
|
62
|
+
tsr: {
|
|
63
|
+
appDirectory: './app',
|
|
64
|
+
routesDirectory: './app/routes',
|
|
65
|
+
generatedRouteTree: './app/routeTree.gen.ts',
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Server Functions (`createServerFn`)
|
|
71
|
+
|
|
72
|
+
Server functions provide type-safe RPC calls between client and server.
|
|
73
|
+
|
|
74
|
+
### Basic Server Functions
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { createServerFn } from '@tanstack/react-start'
|
|
78
|
+
|
|
79
|
+
// GET (data fetching, cacheable)
|
|
80
|
+
const getUsers = createServerFn()
|
|
81
|
+
.handler(async () => {
|
|
82
|
+
const users = await db.query.users.findMany()
|
|
83
|
+
return users
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
// POST (mutations, side effects)
|
|
87
|
+
const createUser = createServerFn({ method: 'POST' })
|
|
88
|
+
.validator((data: { name: string; email: string }) => data)
|
|
89
|
+
.handler(async ({ data }) => {
|
|
90
|
+
const user = await db.insert(users).values(data).returning()
|
|
91
|
+
return user
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### With Zod Validation
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { z } from 'zod'
|
|
99
|
+
|
|
100
|
+
const updateUser = createServerFn({ method: 'POST' })
|
|
101
|
+
.validator(
|
|
102
|
+
z.object({
|
|
103
|
+
id: z.string(),
|
|
104
|
+
name: z.string().min(1),
|
|
105
|
+
email: z.string().email(),
|
|
106
|
+
})
|
|
107
|
+
)
|
|
108
|
+
.handler(async ({ data }) => {
|
|
109
|
+
// data is fully typed: { id: string; name: string; email: string }
|
|
110
|
+
return await db.update(users).set(data).where(eq(users.id, data.id))
|
|
111
|
+
})
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Middleware
|
|
115
|
+
|
|
116
|
+
### Creating Middleware
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { createMiddleware } from '@tanstack/react-start'
|
|
120
|
+
|
|
121
|
+
const loggingMiddleware = createMiddleware().handler(async ({ next }) => {
|
|
122
|
+
console.log('Request started')
|
|
123
|
+
const result = await next()
|
|
124
|
+
console.log('Request completed')
|
|
125
|
+
return result
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Auth Middleware with Context
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const authMiddleware = createMiddleware().handler(async ({ next }) => {
|
|
133
|
+
const request = getWebRequest()
|
|
134
|
+
const session = await getSession(request)
|
|
135
|
+
|
|
136
|
+
if (!session?.user) {
|
|
137
|
+
throw redirect({ to: '/login' })
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Pass typed context to handler
|
|
141
|
+
return next({ context: { user: session.user } })
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Chaining Middleware
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
const adminMiddleware = createMiddleware()
|
|
149
|
+
.middleware([authMiddleware])
|
|
150
|
+
.handler(async ({ next, context }) => {
|
|
151
|
+
// context.user is typed from authMiddleware
|
|
152
|
+
if (context.user.role !== 'admin') {
|
|
153
|
+
throw redirect({ to: '/unauthorized' })
|
|
154
|
+
}
|
|
155
|
+
return next({ context: { isAdmin: true } })
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
// Usage
|
|
159
|
+
const adminAction = createServerFn({ method: 'POST' })
|
|
160
|
+
.middleware([adminMiddleware])
|
|
161
|
+
.handler(async ({ context }) => {
|
|
162
|
+
// context: { user: User; isAdmin: boolean }
|
|
163
|
+
return { success: true }
|
|
164
|
+
})
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## API Routes (Server Routes)
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
// app/routes/api/users.ts
|
|
171
|
+
import { createAPIFileRoute } from '@tanstack/react-start/api'
|
|
172
|
+
|
|
173
|
+
export const APIRoute = createAPIFileRoute('/api/users')({
|
|
174
|
+
GET: async ({ request }) => {
|
|
175
|
+
const users = await db.query.users.findMany()
|
|
176
|
+
return Response.json(users)
|
|
177
|
+
},
|
|
178
|
+
POST: async ({ request }) => {
|
|
179
|
+
const body = await request.json()
|
|
180
|
+
const user = await db.insert(users).values(body).returning()
|
|
181
|
+
return new Response(JSON.stringify(user), { status: 201 })
|
|
182
|
+
},
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## SSR Strategies
|
|
187
|
+
|
|
188
|
+
### Streaming SSR (Default)
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
export const Route = createFileRoute('/dashboard')({
|
|
192
|
+
loader: async () => ({
|
|
193
|
+
criticalData: await fetchCriticalData(),
|
|
194
|
+
deferredData: defer(fetchSlowData()),
|
|
195
|
+
}),
|
|
196
|
+
component: Dashboard,
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
function Dashboard() {
|
|
200
|
+
const { criticalData, deferredData } = Route.useLoaderData()
|
|
201
|
+
return (
|
|
202
|
+
<div>
|
|
203
|
+
<CriticalSection data={criticalData} />
|
|
204
|
+
<Suspense fallback={<Loading />}>
|
|
205
|
+
<Await promise={deferredData}>
|
|
206
|
+
{(data) => <SlowSection data={data} />}
|
|
207
|
+
</Await>
|
|
208
|
+
</Suspense>
|
|
209
|
+
</div>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Deployment
|
|
215
|
+
|
|
216
|
+
### Supported Platforms (Nitro Presets)
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
// app.config.ts
|
|
220
|
+
export default defineConfig({
|
|
221
|
+
server: {
|
|
222
|
+
preset: 'node-server', // Self-hosted Node.js
|
|
223
|
+
// preset: 'vercel', // Vercel
|
|
224
|
+
// preset: 'netlify', // Netlify
|
|
225
|
+
// preset: 'cloudflare-pages', // Cloudflare Pages
|
|
226
|
+
// preset: 'aws-lambda', // AWS Lambda
|
|
227
|
+
// preset: 'deno-server', // Deno Deploy
|
|
228
|
+
// preset: 'bun', // Bun
|
|
229
|
+
},
|
|
230
|
+
})
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Best Practices
|
|
234
|
+
|
|
235
|
+
1. **Use validators for all server function inputs** - runtime safety and TypeScript inference
|
|
236
|
+
2. **Compose middleware** for cross-cutting concerns (auth, logging, rate limiting)
|
|
237
|
+
3. **Use `createServerFn` GET** for data fetching (cacheable, preloadable)
|
|
238
|
+
4. **Use `createServerFn` POST** for mutations and side effects
|
|
239
|
+
5. **Use `beforeLoad`** for route-level auth guards
|
|
240
|
+
6. **Use `defer()`** for non-critical data to improve TTFB
|
|
241
|
+
7. **Set `defaultPreload: 'intent'`** on the router for instant navigation
|
|
242
|
+
8. **Co-locate server functions** with the routes that use them
|
|
243
|
+
|
|
244
|
+
## Common Pitfalls
|
|
245
|
+
|
|
246
|
+
- Server functions cannot close over client-side variables (they're extracted to separate bundles)
|
|
247
|
+
- Data returned from server functions must be serializable
|
|
248
|
+
- Forgetting `await` in loaders leads to streaming issues
|
|
249
|
+
- Importing server-only code in client bundles causes build errors
|
|
250
|
+
- Missing `declare module '@tanstack/react-router'` loses all type safety
|
|
@@ -55,7 +55,11 @@ into a single coding pass.
|
|
|
55
55
|
7. **Run docs ingest.**
|
|
56
56
|
- Run `$docs-ingest-phase` when implementation changed product behavior, architecture, setup, operator workflow, docs contracts, or spec domain knowledge.
|
|
57
57
|
- If docs ingest is not needed, record the explicit no-op reason in the final report or delivery notes.
|
|
58
|
-
8. **
|
|
58
|
+
8. **Check stack cleanliness.**
|
|
59
|
+
- Whenever a PR exists, run `stack status` and `stack sync --dry-run`.
|
|
60
|
+
- If the PR is stack-dependent and dry-run reports pending changes, run `stack sync` before closeout.
|
|
61
|
+
- Missing `stack` blocks stack-dependent closeout, but not independent trunk-based work.
|
|
62
|
+
9. **Close out.**
|
|
59
63
|
- Report implementation, review result, validation, docs ingest outcome, debt captured, and remaining blockers.
|
|
60
64
|
|
|
61
65
|
## Mode And Parallel Rules
|
|
@@ -78,5 +82,6 @@ Return a concise delivery report with:
|
|
|
78
82
|
- **Review:** mandatory `$review-phase` result and remaining findings
|
|
79
83
|
- **Debugging:** skipped with reason, or `$debugging-phase` evidence and result
|
|
80
84
|
- **Validation:** commands, browser checks, smoke tests, or manual scenarios run
|
|
85
|
+
- **Stack:** `stack status` / `stack sync --dry-run` result when a PR exists, plus whether `stack sync` ran
|
|
81
86
|
- **Docs ingest:** `$docs-ingest-phase` run, or explicit no-op reason
|
|
82
87
|
- **Exit:** done, blocked, or split into follow-up debt/debugging goal
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docs-ingest-phase
|
|
3
|
-
description:
|
|
3
|
+
description: Ingests specs and docs-affecting changes into canonical private/project docs and public-facing docs. Use when a spec is ready for domain capture, public docs need creation or material updates, wiki/Fumadocs routing changes, or code changes alter architecture, setup, contracts, operator workflow, or user-facing behavior.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Docs Ingest Phase
|
|
7
7
|
|
|
8
8
|
## Contract
|
|
9
9
|
|
|
10
|
-
- **Role:**
|
|
11
|
-
- **Entrypoint type:** public phase entrypoint
|
|
10
|
+
- **Role:** public phase entrypoint for docs ingest and repo-doc maintenance
|
|
12
11
|
- **Upstream:** reviewed or implemented spec folder, or concrete docs-affecting code changes
|
|
13
|
-
- **Delegates to:**
|
|
14
|
-
- **Downstream:** canonical routed
|
|
15
|
-
- **Entry conditions:** resolved spec folder for ingest work, or a concrete docs-affecting code change
|
|
12
|
+
- **Delegates to:** private spec/project ingest, public-doc writer skills, routed page writing, route/navigation bookkeeping
|
|
13
|
+
- **Downstream:** canonical routed public and private docs, durable private writer artifacts, `meta.json` navigation, ingest metadata, wiki log/index updates, and required `docs/` updates
|
|
16
14
|
- **Stop conditions:** ingest bookkeeping complete, required docs updates complete, failures reported honestly
|
|
17
15
|
|
|
18
16
|
## Use When
|
|
19
17
|
|
|
20
18
|
- A reviewed or implemented spec folder should become durable routed domain knowledge.
|
|
19
|
+
- Substantial public-facing documentation needs to be created or materially updated.
|
|
21
20
|
- `apps/wiki` content, Fumadocs navigation, `meta.json`, or routed pages change.
|
|
22
21
|
- Code changes alter architecture, setup, contracts, decisions, runbooks, or operator workflow.
|
|
23
22
|
- `delivery-phase` reaches `$docs-ingest-phase` and docs-affecting changes exist.
|
|
@@ -36,9 +35,10 @@ description: Ingest specs and docs-affecting changes into canonical routed wiki/
|
|
|
36
35
|
- single-repo: `wiki`
|
|
37
36
|
2. Read `<wiki-root>/AGENTS.md` before touching wiki content.
|
|
38
37
|
3. If ingesting a spec, read [references/wiki-ingest.md](references/wiki-ingest.md).
|
|
39
|
-
4. If updating
|
|
40
|
-
5. If updating
|
|
41
|
-
6.
|
|
38
|
+
4. If creating or materially updating public-facing docs, read [references/public-docs.md](references/public-docs.md).
|
|
39
|
+
5. If updating routed docs or navigation, read [references/fumadocs-routing.md](references/fumadocs-routing.md).
|
|
40
|
+
6. If updating root `docs/`, read [references/repo-docs.md](references/repo-docs.md).
|
|
41
|
+
7. Finish by reporting written pages, writer artifacts, metadata changes, docs updates, validation run, and any no-op reason.
|
|
42
42
|
|
|
43
43
|
## Wiki Ingest Pipeline
|
|
44
44
|
|
|
@@ -46,21 +46,30 @@ Run this order exactly:
|
|
|
46
46
|
|
|
47
47
|
```text
|
|
48
48
|
docs-ingest-phase
|
|
49
|
+
-> resolve docs architecture and classify public/private targets
|
|
49
50
|
-> routed flow-writing phase
|
|
50
51
|
-> routed concept-writing phase
|
|
52
|
+
-> public-doc writer flow when substantial public-facing docs are created or materially updated
|
|
51
53
|
-> ingest bookkeeping
|
|
52
54
|
-> route/navigation bookkeeping
|
|
53
55
|
```
|
|
54
56
|
|
|
55
57
|
Why: concept pages can cross-link flow pages, so flows must exist first.
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
Public-doc writer flow:
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
```text
|
|
62
|
+
writing-fragments
|
|
63
|
+
-> writing-beats
|
|
64
|
+
-> writing-shape
|
|
65
|
+
-> final public page write/merge
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run this flow for substantial public-facing page creation or material updates. Small public-doc patches may skip it with an explicit no-op reason.
|
|
60
69
|
|
|
61
|
-
|
|
70
|
+
## Routing
|
|
62
71
|
|
|
63
|
-
Do not create a second routed docs surface or
|
|
72
|
+
Use the repo's existing public docs surfaces for reader-facing pages and its private docs surface for specs, runbooks, maintenance, project context, and durable writer artifacts. Do not enforce Harness Intelligence route names in other repos. Do not create a second routed docs surface or separate `domains/` owner layer just because docs ingest ran.
|
|
64
73
|
|
|
65
74
|
## Output Contract
|
|
66
75
|
|
|
@@ -69,6 +78,8 @@ Always report:
|
|
|
69
78
|
- source spec or docs-affecting change processed
|
|
70
79
|
- flows written or skipped
|
|
71
80
|
- concepts written or skipped
|
|
81
|
+
- public-doc writer artifacts written or skipped
|
|
82
|
+
- public pages written, merged, or skipped
|
|
72
83
|
- routed pages and `meta.json` updates
|
|
73
84
|
- ingest frontmatter/bookkeeping updates
|
|
74
85
|
- root `docs/` updates, if any
|
|
@@ -77,12 +88,9 @@ Always report:
|
|
|
77
88
|
|
|
78
89
|
## Never Do
|
|
79
90
|
|
|
80
|
-
- Leave new or moved routed pages out of
|
|
81
|
-
- Strip
|
|
91
|
+
- Leave new or moved routed pages out of navigation metadata.
|
|
92
|
+
- Strip access-control frontmatter from routed pages.
|
|
82
93
|
- Proceed to concept writing after a flow write fails.
|
|
83
|
-
-
|
|
84
|
-
- Add a second routed docs surface.
|
|
85
|
-
- Create `docs/prd`, `docs/dev`, roadmap, sprint, or backlog-mirror folders.
|
|
94
|
+
- Create duplicate routed docs surfaces, `domains/` owner layers, roadmap mirrors, or backlog mirrors.
|
|
86
95
|
- Put agent task instructions inside human-facing docs pages.
|
|
87
|
-
-
|
|
88
|
-
- Duplicate wiki article content across routed pages and another source tree.
|
|
96
|
+
- Duplicate article content across routed pages and another source tree.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Fumadocs Routing
|
|
2
2
|
|
|
3
|
-
Use this reference when `docs-ingest-phase` updates routed
|
|
3
|
+
Use this reference when `docs-ingest-phase` updates routed Fumadocs docs.
|
|
4
4
|
|
|
5
5
|
## Canonical Routed Content
|
|
6
6
|
|
|
7
|
-
`apps/wiki` owns the wiki application and its documentation content. Routed MDX pages under `content/docs
|
|
7
|
+
`apps/wiki` owns the wiki application and its documentation content. Routed MDX pages under `content/docs` are the canonical human-facing docs surface.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Private route root example from this repo:
|
|
10
10
|
|
|
11
11
|
- `<wiki-root>/content/docs/project`
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ Do not create or maintain a separate canonical `domains/` tree for concepts and
|
|
|
16
16
|
|
|
17
17
|
## Route Boundaries
|
|
18
18
|
|
|
19
|
-
Use
|
|
19
|
+
Use the repo's private docs route for:
|
|
20
20
|
|
|
21
21
|
- specs
|
|
22
22
|
- plans
|
|
@@ -28,9 +28,12 @@ Use `/docs/project` for:
|
|
|
28
28
|
- useful Linear/grill-derived management context
|
|
29
29
|
- project-specific projections
|
|
30
30
|
- docs-ingest-phase concept/flow output
|
|
31
|
+
- durable public-doc writer artifacts
|
|
31
32
|
|
|
32
33
|
Keep implementation specs and notes linked or summarized. Do not paste large source artifacts into routed pages.
|
|
33
34
|
|
|
35
|
+
Use the repo's public-facing docs routes for reader-facing product, usage, domain, command, changelog, and onboarding pages. Do not enforce this repo's public route names in other repos.
|
|
36
|
+
|
|
34
37
|
## Fumadocs Mechanics
|
|
35
38
|
|
|
36
39
|
Fumadocs uses file paths to determine route slugs. Examples:
|
|
@@ -61,7 +64,7 @@ Routed ingest pages should also carry durable metadata when useful:
|
|
|
61
64
|
|
|
62
65
|
```yaml
|
|
63
66
|
domain: <domain>
|
|
64
|
-
type: concept | flow
|
|
67
|
+
type: concept | flow | writer-artifact
|
|
65
68
|
status: proposed | implemented
|
|
66
69
|
source:
|
|
67
70
|
- apps/wiki/specs/<domain>/<spec>/SPEC.md
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Public Docs
|
|
2
|
+
|
|
3
|
+
Use this reference when `docs-ingest-phase` creates or materially updates public-facing documentation.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
Public documentation is reader-facing product, usage, or domain documentation meant for users, adopters, or scaffold recipients.
|
|
8
|
+
|
|
9
|
+
Private documentation is internal project, operator, maintenance, implementation, or planning documentation meant to preserve how the project is built and run.
|
|
10
|
+
|
|
11
|
+
These are audience categories first. Route topology, permission metadata, and scaffold visibility are supporting signals.
|
|
12
|
+
|
|
13
|
+
## Route Discovery
|
|
14
|
+
|
|
15
|
+
Infer the repo's docs architecture before writing:
|
|
16
|
+
|
|
17
|
+
1. Read the wiki/docs `AGENTS.md` when present.
|
|
18
|
+
2. Inspect existing routed docs roots, `meta.json` files, sidebars, and root docs indexes.
|
|
19
|
+
3. Classify candidate targets as public-facing, private technical, or both.
|
|
20
|
+
4. Use the repo's existing public-facing docs surfaces for final reader pages.
|
|
21
|
+
5. Use the repo's existing private docs surface for writer artifacts.
|
|
22
|
+
|
|
23
|
+
Do not hardcode Harness Intelligence route names. In this repo, `/docs/get-started`, `/docs/harness`, `/docs/cli`, and `/docs/changelog` are examples of public-facing surfaces, while `/docs/project` is an example of a private surface.
|
|
24
|
+
|
|
25
|
+
## When To Run The Writer Flow
|
|
26
|
+
|
|
27
|
+
Run the public writer flow for substantial public-facing docs work:
|
|
28
|
+
|
|
29
|
+
- new public-facing page
|
|
30
|
+
- major rewrite of an existing public-facing page
|
|
31
|
+
- delivery-phase change that materially changes product behavior, usage, positioning, or domain explanation
|
|
32
|
+
- private spec/project material being transformed into a reader-facing guide, concept page, usage page, or product/domain article
|
|
33
|
+
|
|
34
|
+
Skip the writer flow for small public-doc patches:
|
|
35
|
+
|
|
36
|
+
- typo fixes
|
|
37
|
+
- tiny command corrections
|
|
38
|
+
- metadata fixes
|
|
39
|
+
- changelog ledger updates
|
|
40
|
+
- narrow link or wording corrections
|
|
41
|
+
|
|
42
|
+
When skipped, report the skipped writer stages with an explicit no-op reason.
|
|
43
|
+
|
|
44
|
+
## Writer Flow
|
|
45
|
+
|
|
46
|
+
Run these reusable skills in order:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
writing-fragments
|
|
50
|
+
-> writing-beats
|
|
51
|
+
-> writing-shape
|
|
52
|
+
-> final public page write/merge
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The writer flow does not replace spec ingestion. If a spec or implementation notes need durable capture, run the private spec/project ingest path as well.
|
|
56
|
+
|
|
57
|
+
When `docs-ingest-phase` orchestrates these skills, call each one in docs-ingest artifact mode:
|
|
58
|
+
|
|
59
|
+
- `writing-fragments` writes or updates `fragments.md`
|
|
60
|
+
- `writing-beats` reads `fragments.md` and writes or updates `beats.md`
|
|
61
|
+
- `writing-shape` reads `fragments.md` plus `beats.md` and writes or updates `shape.md`
|
|
62
|
+
- `docs-ingest-phase` then writes or merges the final public page from those artifacts
|
|
63
|
+
|
|
64
|
+
## Durable Writer Artifacts
|
|
65
|
+
|
|
66
|
+
Substantial public-doc work must leave durable private writer artifacts:
|
|
67
|
+
|
|
68
|
+
- `fragments.md`
|
|
69
|
+
- `beats.md`
|
|
70
|
+
- `shape.md`
|
|
71
|
+
|
|
72
|
+
Organize them as one private artifact bundle per public-doc target or substantial docs pass.
|
|
73
|
+
|
|
74
|
+
Use routed human-facing private pages when the repo has a routed private docs surface. Use source-only private files as a fallback when it does not.
|
|
75
|
+
|
|
76
|
+
Do not enforce a universal path such as `docs/public-docs`. The path is repo-bounded. In this repo, a natural location would be under the private project docs surface, such as `apps/wiki/content/docs/project/public-docs/<topic-or-page-slug>/`.
|
|
77
|
+
|
|
78
|
+
## Traceability
|
|
79
|
+
|
|
80
|
+
Writer artifacts should link forward to the final public page.
|
|
81
|
+
|
|
82
|
+
Final public pages should not visibly link back to private writer artifacts by default. Public pages should stay reader-facing. Non-visible source/frontmatter metadata is allowed when useful and compatible with the repo's docs system.
|
|
@@ -27,6 +27,7 @@ Normally do not create or update a formal agent goal. This phase is an interview
|
|
|
27
27
|
1. Establish phase state.
|
|
28
28
|
- Identify the topic, source artifacts, current backlog target/provider, and any explicit scope boundary.
|
|
29
29
|
- If grill artifacts exist, read status first, then log.
|
|
30
|
+
- If subagents are available and existing artifacts are long, use `requirements-synthesizer` to compress status/log evidence into accepted, rejected, superseded, parked, and unresolved decisions.
|
|
30
31
|
- State assumptions and known unresolved branches tersely.
|
|
31
32
|
|
|
32
33
|
2. Route to `requirements-grill` while decisions are open.
|
|
@@ -42,6 +43,7 @@ Normally do not create or update a formal agent goal. This phase is an interview
|
|
|
42
43
|
|
|
43
44
|
4. Run `write-backlog` only after readiness.
|
|
44
45
|
- Derive modules first, then epics/capabilities, then stories.
|
|
46
|
+
- If subagents are available, use `backlog-shaper` for draft module/epic/story shape before parent review.
|
|
45
47
|
- Use accepted decisions and locked direction only.
|
|
46
48
|
- Preserve parked scope and unresolved items as deferred notes, not silent backlog content.
|
|
47
49
|
- Sync or draft provider payloads only when the user requested backlog write/sync.
|
|
@@ -31,37 +31,50 @@ or validation because delivery owns completion.
|
|
|
31
31
|
1. Identify the review target: diff, PR, branch range, files, spec, plan, docs, or runtime evidence.
|
|
32
32
|
2. State scope and readonly posture. If scope is ambiguous, ask one clarifying question.
|
|
33
33
|
3. Read local guidance in checked directories, especially relevant `AGENTS.md` files under apps, packages, docs, or nested ownership boundaries.
|
|
34
|
-
4.
|
|
34
|
+
4. Identify every scoped skill listed by those `AGENTS.md` prompts for the reviewed paths; those scoped skills are mandatory review lenses for that scope.
|
|
35
|
+
5. Use `autoreview` as the core review runtime.
|
|
36
|
+
6. Activate mandatory review lenses: `simplify`, `improve-codebase-architecture`, and applicable scoped skills.
|
|
37
|
+
|
|
38
|
+
## Review Runtime
|
|
39
|
+
|
|
40
|
+
- `autoreview`: run the OpenClaw structured review helper. This is the core runtime of the review, not a lens.
|
|
35
41
|
|
|
36
42
|
## Review Lenses
|
|
37
43
|
|
|
38
44
|
- `parallel-research`: fan out independent readonly checks when scope can split by subsystem, risk, or hypothesis.
|
|
39
|
-
- `simplify`: inspect clarity, overcomplexity, unnecessary abstraction, derivable state, naming, and scope creep.
|
|
40
|
-
- `improve-codebase-architecture`: surface architectural friction, shallow modules, poor boundaries, and module-depth opportunities.
|
|
41
|
-
- Scoped local guidance: apply applicable directory
|
|
45
|
+
- `simplify`: inspect clarity, overcomplexity, unnecessary abstraction, derivable state, naming, and scope creep. Mandatory.
|
|
46
|
+
- `improve-codebase-architecture`: surface architectural friction, shallow modules, poor boundaries, and module-depth opportunities. Mandatory.
|
|
47
|
+
- Scoped local guidance: apply every applicable directory instruction, stack skill, runbook, and ownership rule discovered in checked paths. Mandatory for every reviewed path.
|
|
42
48
|
|
|
43
|
-
|
|
49
|
+
`simplify`, `improve-codebase-architecture`, and applicable scoped skills are not optional review lenses. `parallel-research` remains conditional.
|
|
44
50
|
|
|
45
51
|
## Workflow
|
|
46
52
|
|
|
47
53
|
1. Gather evidence:
|
|
48
54
|
- inspect status, diff/range/PR metadata, tests, docs, and relevant local instructions
|
|
55
|
+
- for PR review, use the actual PR base branch instead of assuming trunk
|
|
56
|
+
- when stack metadata is relevant, include `stack status` or prior delivery stack evidence as readonly review evidence
|
|
49
57
|
- prefer primary artifacts over tracker summaries
|
|
50
58
|
- record exact files and commands consulted
|
|
51
59
|
2. Split if useful:
|
|
52
60
|
- use `parallel-research` for independent readonly checks
|
|
53
61
|
- synthesize before reporting; disagreements need evidence, not vote counting
|
|
54
|
-
3.
|
|
62
|
+
3. Run structured review:
|
|
63
|
+
- use `autoreview` for the target and capture the exact command
|
|
64
|
+
- verify each accepted finding manually against source, docs, scoped skills, and dependency contracts
|
|
65
|
+
- if standalone review finds code changes are needed, report them; if delivery owns fixes, hand them back to delivery and rerun after fixes
|
|
66
|
+
4. Review findings-first:
|
|
55
67
|
- prioritize bugs, regressions, broken contracts, missing validation, unsafe assumptions, and user-facing risks
|
|
56
68
|
- include file and line references when available
|
|
57
69
|
- separate blocking findings from improvements and optional cleanup
|
|
58
|
-
|
|
70
|
+
5. Apply mandatory local lenses:
|
|
59
71
|
- use `simplify` to flag unnecessary concepts or complexity
|
|
60
72
|
- use `improve-codebase-architecture` to flag deeper boundary opportunities, usually as follow-up RFC candidates
|
|
61
|
-
|
|
73
|
+
- check whether each reviewed path follows the scoped skills named by its nearest `AGENTS.md`
|
|
74
|
+
6. Validate:
|
|
62
75
|
- run readonly checks that match the target when safe: tests, typecheck, lint, build, docs link checks, or focused smoke commands
|
|
63
76
|
- if a check cannot run, state why and the residual risk
|
|
64
|
-
|
|
77
|
+
7. Stop:
|
|
65
78
|
- standalone mode stops after findings and recommended next actions
|
|
66
79
|
- delivery mode returns findings to `delivery-phase`; delivery decides and performs fixes/debug/docs/validation
|
|
67
80
|
|
|
@@ -79,6 +92,8 @@ Then include:
|
|
|
79
92
|
|
|
80
93
|
- open questions or assumptions
|
|
81
94
|
- validation run and result
|
|
95
|
+
- exact autoreview command and clean/accepted-findings result
|
|
96
|
+
- scoped `AGENTS.md` files and mandatory scoped skills checked
|
|
82
97
|
- short summary only after findings
|
|
83
98
|
- whether this was standalone readonly review or delivery-owned review
|
|
84
99
|
|
|
@@ -96,4 +111,6 @@ If there are no findings, say so clearly and still report validation coverage an
|
|
|
96
111
|
- Do not edit code in standalone mode unless the user explicitly asks after seeing the review scope.
|
|
97
112
|
- Do not use `simplify` as permission to refactor; report simplification opportunities unless delivery owns fixes.
|
|
98
113
|
- Do not flatten scoped `AGENTS.md` guidance into generic advice; quote the concrete constraint that matters.
|
|
114
|
+
- Do not skip scoped skills from `AGENTS.md` prompts. They are part of the review contract, not context flavor.
|
|
99
115
|
- Do not let `delivery-phase` skip this phase just because tests passed.
|
|
116
|
+
- Do not run mutating stack commands in review. `review-phase` reports stack evidence only; delivery owns `stack sync`.
|