@punks/cli 1.0.2 → 1.0.4
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 +10 -1
- package/dist/data/catalog/lint.ts +10 -18
- package/dist/data/catalog/packs.ts +2 -2
- package/dist/data/catalog/skills.ts +1 -0
- package/dist/data/scripts/sync-subagents.mjs +163 -120
- package/dist/data/subagents/manifest.mjs +29 -0
- package/dist/index.js +151 -159
- package/dist/skills/agnostic/backend/logging-best-practices/SKILL.md +127 -0
- package/dist/skills/agnostic/backend/logging-best-practices/rules/context.md +157 -0
- package/dist/skills/agnostic/backend/logging-best-practices/rules/pitfalls.md +118 -0
- package/dist/skills/agnostic/backend/logging-best-practices/rules/structure.md +193 -0
- package/dist/skills/agnostic/backend/logging-best-practices/rules/wide-events.md +113 -0
- package/dist/skills/agnostic/cli/dp-cli/SKILL.md +24 -5
- package/dist/skills/agnostic/cli/dp-cli/references/commands.md +2 -2
- package/dist/skills/agnostic/cli/dp-cli/references/post-command-flow.md +2 -0
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +1 -1
- package/docs/README.md +7 -1
- package/docs/reference/dp-requirements.md +16 -1
- package/docs/runbooks/dp-cli-scaffolding.md +26 -7
- package/package.json +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Wide Events / Canonical Log Lines
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
tags: logging, wide-events, canonical-log-lines
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Wide Events / Canonical Log Lines
|
|
8
|
+
|
|
9
|
+
**Impact: CRITICAL**
|
|
10
|
+
|
|
11
|
+
Wide events (also called canonical log lines) are the foundation of effective logging. For each request, emit **a single context-rich event per service**. Instead of scattering 10-20 log lines throughout your request handler, consolidate everything into one comprehensive event emitted at the end of the request.
|
|
12
|
+
|
|
13
|
+
### The Pattern
|
|
14
|
+
|
|
15
|
+
Build the event throughout the request lifecycle, then emit once at completion in a `finally` block. This ensures the event is always emitted with complete context, even during failures.
|
|
16
|
+
|
|
17
|
+
**Incorrect:**
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
app.post('/articles', async (c) => {
|
|
21
|
+
console.log('Received POST /articles request');
|
|
22
|
+
|
|
23
|
+
const body = await c.req.json();
|
|
24
|
+
console.log('Request body parsed', { title: body.title });
|
|
25
|
+
|
|
26
|
+
const user = await getUser(c.get('userId'));
|
|
27
|
+
console.log('User fetched', { userId: user.id });
|
|
28
|
+
|
|
29
|
+
const article = await database.saveArticle({ ...body, ownerId: user.id });
|
|
30
|
+
console.log('Article saved', { articleId: article.id });
|
|
31
|
+
|
|
32
|
+
await cache.set(article.id, article);
|
|
33
|
+
console.log('Cache updated');
|
|
34
|
+
|
|
35
|
+
console.log('Request completed successfully');
|
|
36
|
+
return c.json({ article }, 201);
|
|
37
|
+
});
|
|
38
|
+
// 6 disconnected log lines with scattered context
|
|
39
|
+
// Cannot query: "show me all article creates by free trial users"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Correct:**
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
app.post('/articles', async (c) => {
|
|
46
|
+
const startTime = Date.now();
|
|
47
|
+
const wideEvent: Record<string, unknown> = {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
path: '/articles',
|
|
50
|
+
service: 'articles',
|
|
51
|
+
requestId: c.get('requestId'),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const body = await c.req.json();
|
|
56
|
+
const user = await getUser(c.get('userId'));
|
|
57
|
+
wideEvent.user = {
|
|
58
|
+
id: user.id,
|
|
59
|
+
subscription: user.subscription,
|
|
60
|
+
trial: user.trial,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const article = await database.saveArticle({ ...body, ownerId: user.id });
|
|
64
|
+
wideEvent.article = {
|
|
65
|
+
id: article.id,
|
|
66
|
+
title: article.title,
|
|
67
|
+
published: article.published,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
await cache.set(article.id, article);
|
|
71
|
+
wideEvent.cache = { operation: 'write', key: article.id };
|
|
72
|
+
|
|
73
|
+
wideEvent.status_code = 201;
|
|
74
|
+
wideEvent.outcome = 'success';
|
|
75
|
+
return c.json({ article }, 201);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
wideEvent.status_code = 500;
|
|
78
|
+
wideEvent.outcome = 'error';
|
|
79
|
+
wideEvent.error = { message: error.message, type: error.name };
|
|
80
|
+
throw error;
|
|
81
|
+
} finally {
|
|
82
|
+
wideEvent.duration_ms = Date.now() - startTime;
|
|
83
|
+
wideEvent.timestamp = new Date().toISOString();
|
|
84
|
+
logger.info(JSON.stringify(wideEvent));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
// Single event with all context - queryable by any field
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Connect Events with Request ID
|
|
91
|
+
|
|
92
|
+
Every wide event must include a unique request ID that is propagated across all service hops. This is the only way to reconstruct the full journey of a request through a distributed system.
|
|
93
|
+
|
|
94
|
+
```typescript
|
|
95
|
+
// Service A - generate and propagate
|
|
96
|
+
const requestId = c.get('requestId') || crypto.randomUUID();
|
|
97
|
+
wideEvent.requestId = requestId;
|
|
98
|
+
|
|
99
|
+
await fetch('http://downstream-service/endpoint', {
|
|
100
|
+
headers: { 'x-request-id': requestId },
|
|
101
|
+
body: JSON.stringify(data),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
// Service B - extract and use
|
|
105
|
+
const requestId = c.req.header('x-request-id');
|
|
106
|
+
wideEvent.requestId = requestId; // Same ID links events together
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Emit in Finally Block
|
|
110
|
+
|
|
111
|
+
Always emit wide events in a `finally` block or equivalent. This ensures the event is emitted with complete context regardless of success or failure.
|
|
112
|
+
|
|
113
|
+
Reference: [Stripe Blog - Canonical Log Lines](https://stripe.com/blog/canonical-log-lines)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dp-cli
|
|
3
|
-
description: Operates the
|
|
4
|
-
metadata: {"
|
|
3
|
+
description: Operates the Devpunks `dp` CLI and interactively follows scaffold, stage, update, and post-command handoff artifacts through to completion. Use when a repo contains `.devpunks/` output, when the user mentions `dp scaffold`, `dp update`, Devpunks CLI setup, or asks what to do after running a `dp` command.
|
|
4
|
+
metadata: {"Devpunks":{"entrypoint":true}}
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# DP CLI
|
|
8
8
|
|
|
9
|
-
The `dp` CLI scaffolds
|
|
9
|
+
The `dp` CLI scaffolds Devpunks agent assets and writes follow-up instructions for the next agent.
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
dp scaffold setup
|
|
15
|
-
dp scaffold
|
|
16
|
-
dp scaffold
|
|
15
|
+
dp scaffold init
|
|
16
|
+
dp scaffold backlog
|
|
17
17
|
dp update --check
|
|
18
18
|
dp update --write
|
|
19
19
|
```
|
|
@@ -26,6 +26,20 @@ After any command, read the command output and generated artifacts before acting
|
|
|
26
26
|
|
|
27
27
|
Do not summarize the generated files and stop. Read the handoff, execute the specs, reconcile generated assets, and report only remaining unresolved items.
|
|
28
28
|
|
|
29
|
+
## Interactive Rule
|
|
30
|
+
|
|
31
|
+
Prompt the user frequently when post-scaffold choices affect project policy or shape.
|
|
32
|
+
|
|
33
|
+
Ask before:
|
|
34
|
+
|
|
35
|
+
- choosing which generated prompt scopes to collapse, split, or prioritize
|
|
36
|
+
- replacing existing lint or format tooling with Oxlint/Oxfmt
|
|
37
|
+
- deciding which core libraries to clone and inspect with `opensrc`
|
|
38
|
+
- changing package scripts, task pipelines, CI, hooks, or docs
|
|
39
|
+
- resolving conflicts between existing repo guidance and scaffold specs
|
|
40
|
+
|
|
41
|
+
Do not ask for trivial file reads, validation commands, or direct execution of already-approved scaffold instructions.
|
|
42
|
+
|
|
29
43
|
## Command Workflows
|
|
30
44
|
|
|
31
45
|
See [references/commands.md](references/commands.md) for command intent and when to use each command.
|
|
@@ -48,6 +62,10 @@ Read `.devpunks/AGENT-SYSTEM-PROMPT.md` first when present.
|
|
|
48
62
|
|
|
49
63
|
Then author or reconcile the final repo files requested by the specs, including prompt files, harness mirrors, lint configuration, and subagent manifests.
|
|
50
64
|
|
|
65
|
+
Before authoring prompts or plans, identify the detected core libraries whose source behavior matters. Ask the user which ones to prioritize if the choice is not obvious, then run `opensrc path <package>` or `opensrc path owner/repo` only for that focused set.
|
|
66
|
+
|
|
67
|
+
When lint specs suggest Oxlint or hooks suggest Oxfmt, treat migration as a repo-policy change. Ask before replacing existing ESLint/Prettier/Biome scripts or CI, then update package scripts, task pipelines, editor/docs references, and hooks together.
|
|
68
|
+
|
|
51
69
|
## Update
|
|
52
70
|
|
|
53
71
|
After `dp update`, inspect `.devpunks/scaffold-manifest.json` and the update summary.
|
|
@@ -63,3 +81,4 @@ After `dp update`, inspect `.devpunks/scaffold-manifest.json` and the update sum
|
|
|
63
81
|
- required tools were checked when `.devpunks/required-tools.json` exists.
|
|
64
82
|
- final prompt files and harness mirrors match the handoff contract.
|
|
65
83
|
- subagent manifests were reconciled when specs exist.
|
|
84
|
+
- user decisions were requested for policy-level choices instead of guessed silently.
|
|
@@ -8,13 +8,13 @@ It detects package manifests, resolves packs, writes `.agents/`, harness files,
|
|
|
8
8
|
|
|
9
9
|
It does not finish all repo-specific authoring. The next agent must use `.devpunks/AGENT-SYSTEM-PROMPT.md` and `.devpunks/specs/**` to generate final scoped guidance and reconcile assets.
|
|
10
10
|
|
|
11
|
-
## `dp scaffold
|
|
11
|
+
## `dp scaffold init`
|
|
12
12
|
|
|
13
13
|
Use before boilerplate exists.
|
|
14
14
|
|
|
15
15
|
It scaffolds requirements-stage assets and prints an operator prompt. Follow that prompt before moving to another stage.
|
|
16
16
|
|
|
17
|
-
## `dp scaffold
|
|
17
|
+
## `dp scaffold backlog`
|
|
18
18
|
|
|
19
19
|
Use to inspect or enter the backlog stage.
|
|
20
20
|
|
|
@@ -32,6 +32,8 @@ After `dp scaffold setup`:
|
|
|
32
32
|
- Keep `.agents/skills/` as the main skill directory; only `.claude/skills` mirrors it.
|
|
33
33
|
- Reconcile `.agents/subagents/manifest.mjs` with both `.agents/subagents/manifest.prompt.md` and `.devpunks/specs/subagents/manifest-spec.json`.
|
|
34
34
|
- Use lint specs to produce or update the repo's real lint config when requested.
|
|
35
|
+
- Ask before replacing existing lint/format tooling with Oxlint/Oxfmt. If approved, update scripts, CI/task pipelines, hooks, and docs together.
|
|
36
|
+
- Ask which detected core libraries to inspect when source context is broad; then use `opensrc path <package>` or `opensrc path owner/repo` for only the chosen set.
|
|
35
37
|
|
|
36
38
|
Do not stop after saying the files exist.
|
|
37
39
|
|
|
@@ -25,7 +25,7 @@ Downstream contract:
|
|
|
25
25
|
|
|
26
26
|
- a raw requirements discussion
|
|
27
27
|
- an existing messy backlog
|
|
28
|
-
- `requirements-grill` artifacts from `/Users/stefan/Desktop/repos/
|
|
28
|
+
- `requirements-grill` artifacts from `/Users/stefan/Desktop/repos/weareDevpunks-multiplai/.agents/skills/requirements-grill`
|
|
29
29
|
|
|
30
30
|
When grill artifacts exist, treat them as the highest-signal structured source for backlog derivation.
|
|
31
31
|
|
package/docs/README.md
CHANGED
|
@@ -12,13 +12,19 @@ Implementation notes:
|
|
|
12
12
|
- runtime projection/writing logic lives in `src/scaffold/`
|
|
13
13
|
- `punks update` refreshes scaffold-managed assets from `.devpunks/scaffold-manifest.json`
|
|
14
14
|
- CLI startup checks npm's `latest` dist-tag for `@punks/cli` and prints a self-update notice when the installed CLI is behind. Set `DP_NO_UPDATE_CHECK=1` to skip the check or `DP_UPDATE_TAG=next` to compare against another dist-tag.
|
|
15
|
+
- CLI startup also checks for the `dp-cli` skill through the `skills` CLI, installing it globally when absent and updating it when present. Set `DP_NO_SKILL_UPDATE_CHECK=1` to skip this best-effort pass.
|
|
15
16
|
- baseline releases use `baseline/stable/*` GitHub release tags, separate from npm executable tags such as `v1.0.1`
|
|
16
17
|
- shared neutral hook and sync assets live in `src/data/hooks/` and `src/data/scripts/`
|
|
17
18
|
- scaffolded required tools always include `portless` and `skills` so generated guidance can standardize local dev origins and keep skill entrypoints up to date
|
|
19
|
+
- `punks scaffold setup` checks the base required tools (`portless`, `skills`) before repo detection and checks selected-pack tools after pack confirmation.
|
|
20
|
+
- Oxlint specs/starter config are scaffolded only when scanned manifests already declare `oxlint`; the auto format/lint hook is scaffolded only when manifests declare `oxfmt`. Other lint/format stacks are intentionally left untouched for now.
|
|
18
21
|
- the default debug pack scaffolds the local `debug-agent` skill and installs/verifies the `debug-agent` CLI without running its agent-install wizard
|
|
19
22
|
- scaffolded repos keep project-local skills in `.agents/skills/`; only `.claude/skills` is a compatibility symlink mirror
|
|
20
23
|
- React scaffold surfaces include `async-react-patterns` alongside the existing React composition, structure, and Vercel guidance so agents avoid outdated manual async state patterns.
|
|
21
24
|
- Next.js detection implies the React pack even when `react` / `react-dom` are not directly listed in scanned manifests.
|
|
22
25
|
- Frontend surface detection scaffolds `frontend-domain-structure` with the frontend pack when React or Next.js is detected.
|
|
23
|
-
- Backend surface detection scaffolds `backend-domain-structure
|
|
26
|
+
- Backend surface detection scaffolds `backend-domain-structure`, `backend-recoverable-actions`, and `logging-best-practices` when backend framework/data/auth packages are detected, or when workspace names/paths clearly identify API, backend, server, or service packages. Workspace prompt specs apply backend packs only to backend-looking workspaces, not frontend workspaces that happen to share repo-level backend/data detections.
|
|
27
|
+
- Drizzle detection selects the `drizzle` pack for data-layer prompt/lint metadata, but does not imply Effect skills or Effect opensrc references unless `effect` / `@effect/*` is also detected.
|
|
28
|
+
- Scaffold no longer preselects concrete opensrc repositories. Post-scaffold agents must choose and clone the core detected libraries whose source behavior matters before authoring final prompts or plans.
|
|
29
|
+
- The default subagent manifest includes a read-only `code-review` template that uses `simplify` and `improve-codebase-architecture`; root prompt guidance routes review requests to findings-first review before broad refactor planning.
|
|
24
30
|
- Non-surface agnostic skill groups are mandatory scaffold packs (`debug`, `docs`, `planning`, `quality`, `research`, `requirements`, `subagents`); `frontend` and `backend` remain detection-driven.
|
|
@@ -67,7 +67,7 @@ That wiki tree is not the same thing as `docs/`. It owns specs, raw inputs, and
|
|
|
67
67
|
It should:
|
|
68
68
|
|
|
69
69
|
- detect repo facts, not ask the agent to invent them
|
|
70
|
-
- resolve those facts to predefined
|
|
70
|
+
- resolve those facts to predefined Devpunks packs
|
|
71
71
|
- scaffold the shared AI setup
|
|
72
72
|
- emit instructions/specs the next agent can use to generate repo-scoped prompts and subagent config
|
|
73
73
|
|
|
@@ -106,6 +106,8 @@ Initial technology mapping:
|
|
|
106
106
|
- `turbo` -> `turborepo`
|
|
107
107
|
- `effect`, `@effect/*` -> `effect`
|
|
108
108
|
|
|
109
|
+
`drizzle` is data-layer detection only. It must not imply Effect skills or Effect source references unless the `effect` pack is selected independently.
|
|
110
|
+
|
|
109
111
|
## Pack Contract
|
|
110
112
|
|
|
111
113
|
Pack resolution happens at pack level only during `punks scaffold setup`.
|
|
@@ -147,6 +149,11 @@ Framework/data packs may layer on top of that surface:
|
|
|
147
149
|
- `tanstack-query`
|
|
148
150
|
`tanstack-query`
|
|
149
151
|
|
|
152
|
+
Backend-oriented agnostic skills should be grouped into a single detected backend surface pack:
|
|
153
|
+
|
|
154
|
+
- `backend`
|
|
155
|
+
`backend-domain-structure`, `backend-recoverable-actions`, `logging-best-practices`
|
|
156
|
+
|
|
150
157
|
## Prompt Contract
|
|
151
158
|
|
|
152
159
|
Pre-boilerplate commands use fixed stdout operator prompts.
|
|
@@ -188,6 +195,10 @@ Current examples:
|
|
|
188
195
|
|
|
189
196
|
The scaffold output should also record the resolved tool requirements in a machine-readable manifest.
|
|
190
197
|
|
|
198
|
+
`punks scaffold setup` should check base required tools before repo detection so missing `skills` or `portless` is surfaced immediately. Tools required only by selected packs can be checked after pack confirmation.
|
|
199
|
+
|
|
200
|
+
Scaffold output should not preselect concrete opensrc repositories. The generated post-scaffold instructions should require the next agent to identify the core detected libraries whose source behavior matters, ask the user when that set is ambiguous, and run `opensrc path <package>` or `opensrc path owner/repo` for only that focused set.
|
|
201
|
+
|
|
191
202
|
## Lint Scaffold Contract
|
|
192
203
|
|
|
193
204
|
The shipped starter/root lint baseline should exclude generated and non-source surfaces by default, including:
|
|
@@ -196,6 +207,10 @@ The shipped starter/root lint baseline should exclude generated and non-source s
|
|
|
196
207
|
- all dot-directories
|
|
197
208
|
- generated agent/harness folders unless a target repo explicitly opts them back into lint scope
|
|
198
209
|
|
|
210
|
+
When scaffold guidance leads an agent to adopt Oxlint or Oxfmt, it must tell the agent to replace existing lint/format entrypoints deliberately: package scripts, task pipelines, CI, editor/docs references, and agent hooks should agree on the new tools.
|
|
211
|
+
|
|
212
|
+
Until additional lint/format stacks are supported, repo-aware setup should emit Oxlint specs/starter config only when `oxlint` is declared in scanned package manifests and emit the Oxfmt/Oxlint format hook only when `oxfmt` is declared. Repos without those packages should get no lint/format scaffold surfaces.
|
|
213
|
+
|
|
199
214
|
## Dedicated CLI Repo Contract
|
|
200
215
|
|
|
201
216
|
The standalone private `wearedevpunks/cli` repo remains the source of truth for:
|
|
@@ -72,6 +72,9 @@ Current scope:
|
|
|
72
72
|
- treat React, Next.js, and TanStack Query as separate frontend capability layers; React is the plain framework pack triggered by `react` / `react-dom` or implied by `next`, and pulls in `async-react-patterns` to prevent outdated manual async state modeling
|
|
73
73
|
- include the `frontend` agnostic surface pack only when React or Next.js is detected; it carries product UI, browser validation, and frontend domain-structure guidance
|
|
74
74
|
- include the `backend` agnostic surface pack when backend framework/data/auth packages are detected (`elysia`, `@trpc/*`, `drizzle-orm`, `drizzle-kit`, `better-auth`) or when package names/manifest paths clearly mark an API/backend/server/service workspace
|
|
75
|
+
- assign backend packs only to backend-looking workspace prompt specs; do not add backend skills to frontend-looking workspaces just because backend/data/auth packs exist elsewhere in the repo
|
|
76
|
+
- include backend logging guidance through `logging-best-practices` anywhere the backend surface pack applies, so backend prompts cover wide events, request context, and production debugging signals alongside structure and recoverability
|
|
77
|
+
- keep Drizzle as data-layer guidance only; do not scaffold Effect skills or Effect opensrc references from Drizzle unless `effect` / `@effect/*` is also detected
|
|
75
78
|
- keep all non-surface agnostic skill packs mandatory (`debug`, `docs`, `planning`, `quality`, `research`, `requirements`, `subagents`)
|
|
76
79
|
- detect monorepo signals from `pnpm-workspace.yaml`, `turbo.json`, root workspaces, and workspace package count
|
|
77
80
|
- resolve predefined packs from those facts
|
|
@@ -89,9 +92,12 @@ Current scope:
|
|
|
89
92
|
- write a paste-ready next-agent prompt file and try to copy it to the clipboard automatically
|
|
90
93
|
- include `portless` in the required tools manifest so follow-up agents can standardize local dev URLs across worktrees and avoid raw port collisions
|
|
91
94
|
- include `skills` in the required tools manifest so follow-up agents can install/update public skill entrypoints such as `dp-cli`
|
|
95
|
+
- check the base required tools (`portless`, `skills`) at the start of setup before repo detection, then check selected-pack tools after pack confirmation
|
|
92
96
|
- include `debug-agent` through the default debug pack and install/verify the `debug-agent` CLI without running `debug-agent init`, because the CLI already scaffolds the project-local skill
|
|
97
|
+
- scaffold Oxlint specs/starter config only when scanned package manifests declare `oxlint`, and scaffold the `format-edited-file` Oxfmt/Oxlint hook only when manifests declare `oxfmt`; repos without those tools keep their existing lint/format setup untouched
|
|
93
98
|
- select language packs separately from framework packs; TypeScript is selected from a `typescript` package dependency or nested `.ts` / `.tsx` files, and Python is selected from nested `.py` files, while ignoring root config files plus vendor, virtualenv, scaffold, docs, examples, scripts, `opensrc`, cache, and build output
|
|
94
99
|
- seed Python subagent templates that combine the Python language skills into `python-app`, `python-async`, and `python-testing` specialists
|
|
100
|
+
- seed a read-only `code-review` subagent template that uses `simplify` for changed-code cleanup review and `improve-codebase-architecture` for grounded architecture-friction findings
|
|
95
101
|
|
|
96
102
|
If `-o, --output` points at a path that does not exist yet, `punks scaffold setup` creates it before writing the generated files.
|
|
97
103
|
|
|
@@ -107,10 +113,10 @@ After confirmation, `punks scaffold setup` writes:
|
|
|
107
113
|
- `.devpunks/AGENT-HANDOFF.md`
|
|
108
114
|
- `.devpunks/AGENT-SYSTEM-PROMPT.md`
|
|
109
115
|
- `.devpunks/required-tools.json`
|
|
110
|
-
- `.devpunks/specs/lint/assets.json`
|
|
111
|
-
- `.devpunks/specs/lint/selection.json`
|
|
112
|
-
- `.devpunks/specs/lint/README.md`
|
|
113
|
-
- `.devpunks/specs/lint/oxlint-starter.json` when no root Oxlint config already exists
|
|
116
|
+
- `.devpunks/specs/lint/assets.json` when `oxlint` is declared
|
|
117
|
+
- `.devpunks/specs/lint/selection.json` when `oxlint` is declared
|
|
118
|
+
- `.devpunks/specs/lint/README.md` when `oxlint` is declared
|
|
119
|
+
- `.devpunks/specs/lint/oxlint-starter.json` when `oxlint` is declared and no root Oxlint config already exists
|
|
114
120
|
- `.devpunks/specs/prompts/shared-agents.md`
|
|
115
121
|
- `.devpunks/specs/prompts/root.md`
|
|
116
122
|
- `.devpunks/specs/prompts/docs.md`
|
|
@@ -126,13 +132,17 @@ It does **not** write final root/docs/workspace `AGENTS.md` files yet. Those rem
|
|
|
126
132
|
|
|
127
133
|
After scaffold completes, the CLI writes `.devpunks/AGENT-SYSTEM-PROMPT.md`, tries to copy that prompt to the clipboard, and ends with a short terminal section telling the operator to paste that generated prompt into the next agent.
|
|
128
134
|
|
|
129
|
-
Scaffolded guidance treats `portless` as the local-development URL baseline.
|
|
135
|
+
Scaffolded guidance treats `portless` as the local-development URL baseline. Root/handoff guidance tells follow-up agents to prefer stable `*.localhost` subdomains over raw `localhost:<port>` values in env examples, endpoint defaults, callback URLs, allowed origins, CORS, and app-to-app proxy targets. Scoped prompts should repeat portless guidance only when that workspace directly owns URL, origin, callback, CORS, or proxy configuration.
|
|
136
|
+
|
|
137
|
+
Scaffolded guidance does not emit concrete opensrc repository refs. The post-scaffold agent must identify the detected core libraries whose source behavior matters for prompt, plan, lint, or implementation decisions, ask the user when the priority is ambiguous, then run `opensrc path <package>` or `opensrc path owner/repo` for that focused set.
|
|
138
|
+
|
|
139
|
+
Root prompt guidance routes code review requests to findings-first review with precise file/line references. It tells review agents to use `simplify` for clarity, naming, duplication, derivable state, and unnecessary abstraction, and to use `improve-codebase-architecture` only when observed review friction justifies candidate refactors or follow-up RFCs.
|
|
130
140
|
|
|
131
141
|
When the next agent authors those final prompt files, each root/docs/workspace `AGENTS.md` should be treated as the neutral source of truth and mirrored by a sibling `CLAUDE.md` symlink. `.agents/AGENTS.md` remains the shared global neutral source, and `.claude/CLAUDE.md` should mirror it.
|
|
132
142
|
|
|
133
143
|
Keep `.agents/skills/` as the main skill directory. Only `.claude/skills` is generated as a compatibility symlink; Codex, Cursor, and OpenCode should read skills from `.agents/skills` instead of maintaining `.codex/skills`, `.cursor/skills`, or `.opencode/skills` mirrors.
|
|
134
144
|
|
|
135
|
-
It also does **not** mutate the repo's final Oxlint config. Lint is scaffolded as selected pack-owned assets plus placement guidance so the follow-up agent can fit the final `.oxlintrc.json` shape to the real repo layout.
|
|
145
|
+
It also does **not** mutate the repo's final Oxlint config. Lint is scaffolded as selected pack-owned assets plus placement guidance only when `oxlint` is already present in scanned package manifests, so the follow-up agent can fit the final `.oxlintrc.json` shape to the real repo layout. If the agent adopts Oxlint or Oxfmt, it must replace existing lint/format setup deliberately by updating package scripts, task pipelines, editor/docs references, CI, and agent hooks together instead of leaving stale ESLint/Prettier/Biome entrypoints behind.
|
|
136
146
|
|
|
137
147
|
The scaffolded starter baseline excludes lock files and dot-directories by default so generated/vendor surfaces do not get linted as product code.
|
|
138
148
|
|
|
@@ -196,9 +206,18 @@ bun run baseline:publish
|
|
|
196
206
|
|
|
197
207
|
`baseline:build` creates `dist/baseline/scaffold-baseline.json` and `dist/baseline/scaffold-baseline.tgz`. `baseline:publish` creates a GitHub release tag under `baseline/stable/*` and uploads both assets.
|
|
198
208
|
|
|
209
|
+
Publish npm executable releases with `bun run release:publish` from a clean worktree after authenticating with npm:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
npm login --registry=https://registry.npmjs.org/
|
|
213
|
+
npm whoami
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The npm account must have publish access to `@punks/cli`; otherwise npm may report a confusing scoped-package 404 during `npm publish`.
|
|
217
|
+
|
|
199
218
|
## CLI Self-Update Detection
|
|
200
219
|
|
|
201
|
-
The CLI also performs
|
|
220
|
+
The CLI also performs best-effort startup checks on normal command startup. It checks the npm package version for `@punks/cli`, and it checks for the `dp-cli` skill through the global `skills` CLI, installing it when absent and updating it when present. These are separate from `punks update`, which updates scaffold-managed repo assets.
|
|
202
221
|
|
|
203
222
|
- checks `https://registry.npmjs.org/%40punks%2Fcli/latest`
|
|
204
223
|
- compares that dist-tag version with the bundled CLI version
|