@iasiv5/dsh-skills 1.3.6 → 1.3.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-skills",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Agent skill 合集,装插件即用、免拷贝 skills 目录;作者自用,不推广。版本无关,详见仓库。",
5
5
  "keywords": [
6
6
  "dsh",
@@ -37,6 +37,8 @@ Produce a page if any of these is true:
37
37
 
38
38
  Otherwise answer in plain text. When unsure: the more the question "needs a picture to understand", the more it calls for a page.
39
39
 
40
+ When the user asks you to explain a repository, draw its architecture or show how its code is organized: read `${CLAUDE_SKILL_DIR}/references/codebase.md` and follow it before you write the draft.
41
+
40
42
  Automatic pages are for replies to the user. An internal report returned to another agent is not one:
41
43
 
42
44
  - If a parent agent or a coordinator delegated research, implementation, a review or a progress report, return the text or structure it asked for, with the findings and the evidence. Render no page.
@@ -150,7 +152,7 @@ Write a component as a fenced code block (```` ```flow ```` … ```` ``` ````);
150
152
  | A state machine: states and the events between them, a connection lifecycle, a protocol handshake | `state [LR]` | `[*] -> Idle`, `Idle -> Open: connect()`, `Open -> Open: retransmit` (self-transition), `Open -> [*]` |
151
153
  | A data model: entities, their columns and the relations between them | `er [LR]` | entity at column 0, indented `name [type] [PK\|FK\|UK]` fields, `user_id FK -> User`, `User 1--* Order: places` |
152
154
  | Classes, code interfaces and their relationships | `class [LR]` | declare `class User` and `interface Store`, indent `+id: string` or `+save(): void`, then `User ..> Store: uses` |
153
- | An HTTP or RPC interface contract | `api` | `GET /users/{id}` or `RPC users.UserService/GetUser`, sections `path`, `query`, `headers`, `request [Type]`, `response STATUS [Type]`, indented `id string required` or `email string optional` |
155
+ | HTTP/RPC contracts or one requirement changing several endpoints | `api` | `GET /users/{id}` or `RPC users.UserService/GetUser`, sections `path`, `query`, `headers`, `request [Type]`, `response STATUS [Type]`, indented `id string required` or `email string optional`; multiple endpoints per block; `+` / `-` / `~` markers on endpoints, sections or fields |
154
156
  | Messages between actors over time | `sequence [num]` | `A -> B: request`, `B --> A: response`, `note A, B: note`, `== phase ==` |
155
157
  | Hierarchy / directories / taxonomy | `tree [list]` | indentation for levels, `label \| description`, `` `id` label `` |
156
158
  | History / phases | `timeline [v]` | `time \| title \| description`, `*` highlights |
@@ -163,7 +165,7 @@ Write a component as a fenced code block (```` ```flow ```` … ```` ``` ````);
163
165
  | Multi-dimension comparison, can / cannot list | Markdown table | write ok / no / warn in the status column |
164
166
  | What a real screen, photo or render looks like, as an existing file | image | `![what it shows](/absolute/path.png)` alone on a line |
165
167
  | Code that exists in the project | code block that quotes the file | ```` ```ts src=path/to/file.ts lines=18-30 hl=22 ```` and an empty block |
166
- | A plan, refactor or PR summary that changes structure | `flow`, `state`, `tree` or `er` with change markers | start a line with `+ ` added, `- ` removed, `~ ` changed (a node, field, entity or state only): `+ A -> B`, `- A -> B`, `~ Node`, tree `+ file.js`, `- dir/`, er `+ Coupon`, ` + phone string`, `+ User 1--* Coupon` |
168
+ | A plan, refactor or PR summary that changes structure | `flow`, `state`, `tree`, `er` or `api` with change markers | start a line with `+ ` added, `- ` removed, `~ ` changed (a node, field, entity, state, endpoint or section only): `+ A -> B`, `- A -> B`, `~ Node`, tree `+ file.js`, `- dir/`, er `+ Coupon`, ` + phone string`, `+ User 1--* Coupon` |
167
169
  | A change to code | diff block | ```` ```diff file=path/to/file.ts ```` and the unified diff inside |
168
170
  | Code that does not exist yet, or a command | code block | ```` ```ts title="name · sketch" ```` with the code inside |
169
171
 
@@ -173,7 +175,7 @@ Selection rules:
173
175
  - Conclusion first. The first panel or the lead gives the core answer; the following panels give the evidence.
174
176
  - One panel, one question. With more than 8 panels, split the page or cut panels.
175
177
  - `span` is a hint. In a browser the sheet sizes each panel to its content and fills every row, so write no `span` for a wide table or diagram. Write `span` only for a panel that must stand out (`span` = `cols` gives it a row of its own). `span` and `rows` are whole numbers; a fraction such as `span=2.5` is an error. `rows` applies only to the plain grid (without JavaScript, in print and on narrow screens); the browser layout ignores it.
176
- - To show what a plan, refactor or PR summary changes in structure, write one `flow`, `state`, `tree` or `er` and mark the changed lines with `+ `, `- ` or `~ `, not a before and an after. Leave unchanged lines bare. The page shows colors, badges and counts in its Changes view and adds a Before / After switch that shows the plain diagram on either side. To change a link or a relationship, remove the old one with `-` and add the new one with `+`. A name that starts with `- ` needs brackets in `flow` (`[- Gateway]`) or `\- item` in `tree`. A marked entity gives its fields its marker; a marked field does not mark its entity. See `am help flow`, `am help state`, `am help tree` and `am help er`.
178
+ - To show what a plan, refactor or PR summary changes in structure, write one `flow`, `state`, `tree`, `er` or `api` and mark the changed lines with `+ `, `- ` or `~ `, not a before and an after. Leave unchanged lines bare. The page shows colors, badges and counts in its Changes view and adds a Before / After switch that shows the plain diagram on either side. To change a link or a relationship, remove the old one with `-` and add the new one with `+`. A name that starts with `- ` needs brackets in `flow` (`[- Gateway]`) or `\- item` in `tree`. A marked entity gives its fields its marker; a marked field does not mark its entity. In `api`, added or removed endpoints and sections pass their marker to their children. Write paired `-` old and `+` new definitions to preserve exact changes; `~` alone has no old value. See `am help flow`, `am help state`, `am help tree`, `am help er` and `am help api`.
177
179
  - Quote code that exists with `src=` and `lines=`: the CLI reads the lines, so you type no code and the code is real. Use a path inside the current folder; files outside it are refused. Pick the 10–40 lines that make the point. Mark code that does not exist yet as a sketch in `title=`. In a diff block every line starts with `+`, `-`, a space or `@@`; do not cut lines with `...`, split the diff into two hunks. The render lists every file it embedded; tell the user before they share a page that holds private code. See `am help code`.
178
180
  - Use an image only for what a diagram cannot show, such as a real UI. Use an existing file by its absolute path (PNG, JPG, GIF, WebP, AVIF or SVG, up to 5 MB). The alt text is the caption, so write what the picture shows. Images must be local files: remote images do not load in the page. Never generate or invent an image. See `am help image`.
179
181
  - Use `ask` only for a fork that changes what you do next, such as a plan or a choice between options: 1 to 5 per page, each in the panel it changes, the question in 15 words or fewer. These numbers are writing advice the CLI does not check: more decisions mean more asks (each in the panel it changes) or splitting the page, and the CLI enforces 2 to 6 options per ask. Mark the option you would pick with `*`. An option may carry a preview: indent a `:::` block under it (any component, or `html`/`svg`), and add `cards` to lay the options out in a grid; draw a preview only when seeing the option is what makes the choice clear (a layout, a drawing, a look), and leave it out for a text choice and for options where it adds nothing. A preview shows on the page only: a host's question tool carries just the question and option text, so it does not reach the user there. Every page has a Reply button: the user picks options, comments on any panel and copies one reply back. When a page has asks, say in your reply how many decisions are open and that the suggested options are what you would do. If your host can ask questions (Claude Code's AskUserQuestion), put those asks to the user with that choice tool after the reply, never before it: the reply carries the page link, and the user should be able to open the page before answering.
@@ -0,0 +1,38 @@
1
+ # Codebase architecture pages
2
+
3
+ Read this when SKILL.md section 1 sends you here: the user asks you to explain a repository, draw its architecture, or show how its code is organized. `am` means the full `node ".../scripts/am.mjs"` command from SKILL.md section 2; write the path out in full.
4
+
5
+ The page is worth its evidence. Explore the code first, record each claim with the lines that prove it, and draw only what you read. One question gets one page.
6
+
7
+ ## Explore
8
+
9
+ Work from the repository root, in this order. Each step ends on its own bar.
10
+
11
+ 1. **Entry points.** Find every way into the program: `bin` and `main` in `package.json`, `[project.scripts]` in `pyproject.toml`, `cmd/` in Go, `[[bin]]` in `Cargo.toml`, the CLI command table, the route table, the exported index. Done when each entry point has a `path:line`.
12
+ 2. **Module boundaries.** List the source files in the working tree, new untracked files included and ignored files left out. A module is a folder or file whose imports stay mostly inside it. Scope the map to the question. For "how is this organized", read the imports of each top-level folder; done when every source file belongs to one module and each module's dependencies are known. For "how does X work", the map is provisional; done when the top-level modules are named, and step 3 reads each module's imports when the trace reaches it.
13
+ 3. **Main path.** Take the request the question is about, or the most common one (the default command, the main route). Trace it from its entry point to its output, one call at a time. Done when every hop has a `path:line`.
14
+ 4. **Data and config.** Read the types, schemas or tables on the main path, and where settings load from, with their defaults and precedence. Done when each type and setting the main path reads has a `path:line`.
15
+
16
+ On a repository too large to read in this context: once the modules in scope are known, give each one to a subagent, one per module. Brief it with the question, the module's files, its place in the boundaries, and the evidence rule below. Ask for the module's job in one sentence, its entry functions, its part of the main path, and every claim with its span. Merge the reports, then trace the hand-offs between modules yourself.
17
+
18
+ ## Evidence
19
+
20
+ - Cite every claim about the code as an inline code span: `` `src/cli.js:42` `` for one line, `` `src/cli.js:42-60` `` for a range, the path relative to the repository root. Write the span when you read the line.
21
+ - Put spans in panel text, table cells and `tree` notes. Diagram labels name parts; the panel text under the diagram cites them.
22
+ - A claim with no line to cite is an inference: mark it as not checked and say how to check it.
23
+ - `am render` checks the spans it can place in the current folder: the file exists and the lines are inside it. A failed span prints a `refs n warnings` line with its draft line. Fix it as you fix a code warning: open the file, find the right lines, correct the span, render again.
24
+ - The check skips some spans: a missing file at the root, a root file with no extension (`LICENSE`), a secret or binary file, and diagram text. A clean render is not proof; the proof is that you read each cited line when you wrote its span.
25
+
26
+ ## Draft
27
+
28
+ Render from the repository root, so `src=` and the spans resolve against it.
29
+
30
+ - **Frontmatter:** `commit:` set to `git rev-parse --short HEAD`, with `+dirty` appended when `git status --porcelain` prints anything. The page header shows it, so the reader knows which code the page describes.
31
+ - **Lead:** the answer in two or three sentences.
32
+ - **Modules:** a `tree`, one line per module, `folder/ | job`.
33
+ - **Main path:** a `flow` for how parts connect, or a `sequence` for calls between parts over time. Use the same names as the module tree.
34
+ - **Key code:** code blocks with `src=` and `lines=` for the few spots the main path turns on.
35
+ - **Module table:** module, its files, its job, what it depends on.
36
+ - **Data model,** when the question is about data: an `er` or `class` diagram.
37
+
38
+ Order the panels by the question: "how does X work" leads with the main path; "how is this organized" leads with the modules.