docs: rebalance prose cleanup and add trimming skill
This commit is contained in:
@@ -5,13 +5,14 @@ description: Use when reviewing a pull request in the deepseek-harness repo —
|
||||
|
||||
# Reviewing a DeepSeek-Harness PR
|
||||
|
||||
Read the diff against the PR's current base and enough surrounding code to understand the design, then verify suspected defects before reporting them. Re-establish that base after a retarget or merge. Prioritize correctness, lifecycle, security, and contract failures over style; a short review with one substantiated blocker is better than a list of nits.
|
||||
**This skill is guidance, not a complete checklist.** Read the diff against the PR's current base and enough surrounding code to understand the design, then verify suspected defects before reporting them. Re-establish that base after a retarget or merge. Prioritize correctness, lifecycle, security, and contract failures over style; a short review with one substantiated blocker is better than a list of nits.
|
||||
|
||||
## Sources of truth
|
||||
|
||||
- [AGENTS.md](../../../AGENTS.md) and [packages/AGENTS.md](../../../packages/AGENTS.md): repository and package rules.
|
||||
- [docs/defensive-patterns.md](../../../docs/defensive-patterns.md): subprocess, callback, async-state, and disposal bug classes.
|
||||
- [docs/AGENTS.md](../../../docs/AGENTS.md): documentation placement and prose discipline.
|
||||
- [dsh-trim-prose](../dsh-trim-prose/SKILL.md): editorial judgment for comments, docs, prompts, and visible strings.
|
||||
- [docs/testing.md](../../../docs/testing.md) and the [quality-gates RFC](../../../docs/rfc/implemented/process/2026-06-11-quality-gates.md): required test tiers and gates.
|
||||
- [RFC index](../../../docs/rfc/README.md): design rationale. Treat disagreement with an RFC as a design discussion, not an automatic veto.
|
||||
- For bilingual changes, read [translation-rules.md](../../../docs/i18n/translation-rules.md), [terminology.md](../../../docs/i18n/terminology.md), and [dsh-translate-docs](../dsh-translate-docs/SKILL.md).
|
||||
|
||||
@@ -5,7 +5,7 @@ description: 'Use when writing, moving, reviewing, or auditing documentation in
|
||||
|
||||
# Applying the DeepSeek Harness Documentation Standard
|
||||
|
||||
The contract lives in [docs/AGENTS.md](../../../docs/AGENTS.md). This workflow covers Markdown, JSDoc, and code comments; use judgment rather than treating length alone as a defect.
|
||||
The contract lives in [docs/AGENTS.md](../../../docs/AGENTS.md). This workflow covers placement, corpus audits, budgets, and validation across Markdown, JSDoc, and code comments. It is guidance, not a script; use [dsh-trim-prose](../dsh-trim-prose/SKILL.md) for editorial judgment and never treat length alone as a defect.
|
||||
|
||||
## Sources of truth (read, don't re-summarize)
|
||||
|
||||
@@ -27,12 +27,12 @@ Run the placement test in the standard's taxonomy table, then check the constrai
|
||||
|
||||
The audit is a hunt for the standard's slop checklist, cheapest probes first. Establish the PR's current base first; after a retarget or base merge, repeat the audit for prose introduced by the new base rather than relying on the earlier result.
|
||||
|
||||
1. Measure: `pnpm run verify-doc-budgets --list`, then `git ls-files '*.md' | grep -v '^vendor/' | xargs wc -w | sort -rn | head -30` to spot unbudgeted outliers.
|
||||
2. Hunt narrated history: `rg -n -g '!vendor' "no longer|used to|previously|was moved|renamed" --glob '*.md' --glob '*.ts'` and keep only contrasts against a live alternative.
|
||||
1. Measure: `pnpm run verify-doc-budgets --list`, then `git ls-files '*.md' ':(exclude)vendor/**' | xargs wc -w | sort -rn | head -30` to spot unbudgeted outliers.
|
||||
2. Hunt narrated history: `rg -n "no longer|used to|previously|was moved|renamed" --glob '*.md' --glob '*.ts' --glob '!vendor/**'` and keep only contrasts against a live alternative. Keep the vendor exclusion last so include globs cannot override it.
|
||||
3. Inspect long comments for reasoning transcripts: control-flow narration, test walkthroughs, proof of obvious branches, review findings, rejected local alternatives, and the same rationale repeated beside sibling methods. Preserve only a non-obvious contract or durable rationale; otherwise delete the comment.
|
||||
4. Hunt duplication by grepping distinctive phrases. Keep one home and replace other copies with links.
|
||||
5. Replace hand-written catalogs, test/status inventories, and JSDoc restatements with the authoritative tree, script, or generated reference.
|
||||
6. In `implemented/` RFCs, remove migration plans, test checklists, and future-tense spec language; keep the decision, rationale, and shipped constraints.
|
||||
6. In `implemented/` RFCs, remove migration plans, acceptance-task checklists, and future-tense spec language. Keep concise verification contracts that identify the behaviors and tiers pinning the shipped decision, plus named coverage gaps.
|
||||
7. If removing prose changes a promised behavior rather than its explanation, use a proposed RFC first (follow [dsh-find-simplifications](../dsh-find-simplifications/SKILL.md)).
|
||||
|
||||
Keep every load-bearing rule, preferably as one to three lines plus a link to its rationale. Cut stories, duplicates, status notes, and the path used to derive the rule. Do not create a new explanation merely to relocate disposable reasoning.
|
||||
|
||||
71
.agents/skills/dsh-trim-prose/SKILL.md
Normal file
71
.agents/skills/dsh-trim-prose/SKILL.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
name: dsh-trim-prose
|
||||
description: Use when trimming, restoring, or auditing prose in the deepseek-harness repo, including Markdown, JSDoc, code and test comments, prompts, descriptions, diagnostics, and CLI or UI strings; especially for generated-sounding narration, duplicated explanation, or an earlier edit that may have removed contract detail.
|
||||
---
|
||||
|
||||
# Trim DeepSeek Harness Prose
|
||||
|
||||
Preserve the contract while removing reasoning transcripts, repetition, and decoration. This skill owns editorial judgment; use [dsh-doc-standards](../dsh-doc-standards/SKILL.md) for placement, budgets, bilingual pairs, and documentation gates. It is guidance, not a script.
|
||||
|
||||
## Inputs and exclusions
|
||||
|
||||
Require an explicit `scope`. If it is missing, report the required input and stop; do not infer a repository-wide scope or begin an interview.
|
||||
|
||||
Accept `mode: automatic | interactive`; default to `automatic`. Enter interactive mode only when the user explicitly requests questions or calibration.
|
||||
|
||||
Always exclude `vendor/` from discovery, review, and edits, even when the requested scope is the whole repository. Do not follow a symlink into it. Put exclusions after inclusion globs so a later include cannot re-admit it: for example, end ripgrep commands with `--glob '!vendor/**'`, and give Git commands an explicit `:(exclude)vendor/**` pathspec. If the requested scope contains only `vendor/`, report that no eligible files remain.
|
||||
|
||||
Treat generated catalogs, translations, snapshots, and fixtures as derivative. Edit the owning source or scenario first, then regenerate or synchronize the derivative artifact. Follow the bilingual workflow when either side of a documentation pair changes.
|
||||
|
||||
## Preserve the complete proposition
|
||||
|
||||
Before editing, identify every proposition in the passage. Preserve each relevant:
|
||||
|
||||
- actor and action;
|
||||
- condition, timing, and ordering;
|
||||
- modality such as must, may, or never;
|
||||
- negative guarantee and exception;
|
||||
- ownership, side effect, failure mode, and consequence.
|
||||
|
||||
Remove adjectives, repetition, and narration only when every factual clause survives and the result is clearer. A smaller word count alone is not an improvement.
|
||||
|
||||
Keep a complete local contract at the point of use: behavior, failure, ownership, and consequence that a caller or maintainer needs there. Aggressively link to the owning document for architecture, rationale, algorithms, history, or extended examples. One explanation has one home; essential contract facts may repeat locally.
|
||||
|
||||
Keep non-obvious rationale when omitting it could plausibly cause misuse or an incorrect simplification. Otherwise state the consequence and link the rationale home.
|
||||
|
||||
## Calibrate by prose surface
|
||||
|
||||
- **Public JSDoc:** retain caller-visible return distinctions, throws or rejections, side effects, ownership, timing, cancellation, and durability.
|
||||
- **Internal comments:** retain orientation for non-local structure and obviously complicated local structure. Delete control-flow narration and code restatement.
|
||||
- **Module comments:** retain the module's role, boundaries, and non-obvious architecture choices; link architecture choices to their owning explanation.
|
||||
- **Tests:** retain only non-obvious test design—why a fixture, assertion, platform accommodation, real entry path, or indirect observation is necessary. Delete walkthroughs and inventories.
|
||||
- **Cookbooks:** retain prerequisites, required actions, the real entry path, observable verification, and concise warnings.
|
||||
- **READMEs:** retain the consumer contract: configuration, semantics, failures, limitations, extension points, and model-visible effects. Link algorithms and design rationale.
|
||||
- **RFCs:** presume unique rationale, mechanisms, alternatives, consequences, shipped verification contracts, and named coverage gaps are load-bearing. Implemented RFCs state shipped reality in the present tense; remove planning checklists, not evidence of what pins the decision.
|
||||
- **Postmortems:** retain the incident sequence, evidence, causal chain, impact, and prevention. Remove repeated persuasion or implementation detail that does not establish causality.
|
||||
- **Skills and agent instructions:** preserve behavioral guardrails and explicit scope statements such as “guidance, not a script/checklist.” Keep the workflow concise and link its source of truth.
|
||||
- **Examples and configuration comments:** retain boundaries, non-obvious wiring or load order, security stance, replay behavior, exceptions, and likely misuse. Do not narrate entries that the configuration already shows.
|
||||
- **Prompts and visible strings:** treat wording as behavior. Inspect generated output and run behavior validation or state why no snapshot applies.
|
||||
- **Diagnostics:** retain the failing subject or path, violated rule, and correction when it is non-obvious. Remove internal execution narration.
|
||||
|
||||
Preserve searchable mechanism names and meaningful modal, temporal, or negative emphasis. Normalize decorative emphasis only.
|
||||
|
||||
## Workflow
|
||||
|
||||
1. Confirm the scope, mode, current branch or PR base, and applicable `AGENTS.md` files. Do not inspect unrelated branches.
|
||||
2. Read [the documentation standard](../../../docs/AGENTS.md) and the owning code or document before judging a passage. For calibration or unfamiliar cases, read [the distilled examples](references/examples.md).
|
||||
3. Inspect the requested scope, not only the largest files. Use searches and word counts to find candidates, then judge passages semantically.
|
||||
4. Classify each candidate as keep, trim, restore, restructure, or defer. Apply clear changes; do not manufacture edits to satisfy a deletion target.
|
||||
5. Update the owner before derivative artifacts. Re-check analogous passages after learning a new rule.
|
||||
6. Run the narrow relevant checks, documentation gates, `git diff --check`, and behavior tests for visible strings. Verify the final diff contains no `vendor/` path and report any accidental vendor match rather than claiming a clean exclusion history.
|
||||
7. Report the inspected scope, clear changes, deliberate keeps, deferred cases, and checks actually run.
|
||||
|
||||
## Borderline decisions
|
||||
|
||||
A case is borderline only when at least two versions satisfy the complete-proposition rule but trade accepted principles, and this skill does not already resolve the tradeoff. A new prose shape with one contract-preserving answer is not borderline.
|
||||
|
||||
In automatic mode, apply clear edits and report genuine borderline cases without asking questions. Do not weaken a proposition to make progress.
|
||||
|
||||
In interactive mode, group analogous passages under the governing principle. Present two or three viable versions, recommend one, and state the factual or structural difference. Do not offer inferior distractors. Use the user's requested channel; when calibrating a PR through inline comments, place the recommended provisional version in the diff and attach the alternatives to that exact line.
|
||||
|
||||
After the user decides, distill the principle and versions into [the examples](references/examples.md), without PR history or reviewer narration, and apply the learned rule to every analogous passage in scope.
|
||||
4
.agents/skills/dsh-trim-prose/agents/openai.yaml
Normal file
4
.agents/skills/dsh-trim-prose/agents/openai.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
interface:
|
||||
display_name: "Trim DSH Prose"
|
||||
short_description: "Balance concise prose with complete contracts"
|
||||
default_prompt: "Use $dsh-trim-prose to audit a specified repository scope and trim or restore prose without losing contract details."
|
||||
127
.agents/skills/dsh-trim-prose/references/examples.md
Normal file
127
.agents/skills/dsh-trim-prose/references/examples.md
Normal file
@@ -0,0 +1,127 @@
|
||||
# Distilled prose examples
|
||||
|
||||
Use these examples to identify the governing principle, not as text templates. “Balanced” preserves every load-bearing proposition with the least explanation needed at that location.
|
||||
|
||||
## Preserve every factual clause
|
||||
|
||||
**Original:** “The coordinator carefully serializes writes per session, flushes buffered events before disposal resolves, and reports backend failures to the caller.”
|
||||
|
||||
**Over-trimmed:** “The coordinator serializes persistence.”
|
||||
|
||||
**Balanced:** “The coordinator serializes writes per session, flushes buffered events before disposal resolves, and reports backend failures to the caller.”
|
||||
|
||||
Remove decoration and repetition, not propositions. Actor, per-session scope, disposal ordering, and failure visibility are separate facts.
|
||||
|
||||
## Explicit skill scope is functional
|
||||
|
||||
**Over-trimmed:** “Read the sources and use judgment.”
|
||||
|
||||
**Balanced:** “This skill is guidance, not a complete checklist. Use judgment beyond the named checks; documented requirements still apply.”
|
||||
|
||||
**Over-detailed:** Several paragraphs defending why lists cannot replace independent reasoning.
|
||||
|
||||
Keep the explicit limitation because it changes how an agent applies the workflow. Trim repeated persuasion, not the guardrail.
|
||||
|
||||
## A cookbook keeps action and verification
|
||||
|
||||
**Over-trimmed:** “Add tests for the tool.”
|
||||
|
||||
**Balanced:** “Test registration and disposal at unit level, exercise the tool through the real loader path, and add a snapshot when its rendered output changes. Verify the assertion observes the external result rather than the model's report.”
|
||||
|
||||
**Over-detailed:** A walkthrough of every fixture file and assertion already visible in the example code.
|
||||
|
||||
Keep the test tiers, required action, real entry path, and observable verification. Remove fixture narration.
|
||||
|
||||
## Preserve ownership and timing
|
||||
|
||||
**Over-trimmed:** “Provider work is cancelled during teardown.”
|
||||
|
||||
**Balanced:** “The runtime requests provider cancellation before releasing the child scope; the provider remains responsible for joining its workers before disposal resolves.”
|
||||
|
||||
**Over-detailed:** A chronological account of every promise and callback used to implement teardown.
|
||||
|
||||
The actor, ordering, ownership boundary, and completion guarantee are separate factual clauses.
|
||||
|
||||
## Orient complicated code without narrating it
|
||||
|
||||
**Over-trimmed:** “Worker realm support.”
|
||||
|
||||
**Balanced:** “Owns the worker realm and its host bridge. Realm initialization is single-shot; disposal terminates the worker and rejects later calls. See the worker-isolation RFC for the protocol rationale.”
|
||||
|
||||
**Over-detailed:** A paragraph-by-paragraph preview of the classes and helper functions below.
|
||||
|
||||
Keep role, boundaries, and non-obvious lifecycle behavior. Link architecture rationale and let the code show local control flow.
|
||||
|
||||
## Public JSDoc includes failures
|
||||
|
||||
**Over-trimmed:** “Returns the realm global.”
|
||||
|
||||
**Balanced:** “Returns the initialized realm global. Throws if initialization has not completed or the realm has already been disposed.”
|
||||
|
||||
**Over-detailed:** The internal state-machine branches and exact helper calls that lead to each throw.
|
||||
|
||||
Throws and state preconditions are caller-visible contract facts.
|
||||
|
||||
## Keep a concise implementation mapping
|
||||
|
||||
**Over-trimmed:** “Search provider backed by an external API.”
|
||||
|
||||
**Balanced:** “Maps each provider result to the shared search-result shape, preserving the title, URL, and text while omitting provider-only ranking metadata.”
|
||||
|
||||
**Over-detailed:** A field-by-field restatement of the mapping code, including fields with identical names and obvious assignments.
|
||||
|
||||
Keep mapping details that explain an abstraction boundary or intentional information loss.
|
||||
|
||||
## Link rationale while keeping the local contract
|
||||
|
||||
**Over-trimmed:** “Disposal is documented in the lifecycle RFC.”
|
||||
|
||||
**Balanced:** “Disposal aborts the run and waits for provider quiescence. See the lifecycle RFC for ownership and race handling.”
|
||||
|
||||
**Over-detailed:** Repeating the RFC's promise choreography and rejected ownership models beside every disposer.
|
||||
|
||||
Keep the behavior and completion guarantee where callers need them. Link aggressively for the algorithm and rationale; a link cannot replace the local contract.
|
||||
|
||||
## Implemented RFCs retain verification contracts
|
||||
|
||||
**Over-trimmed:** Deleting the entire Testing section because the RFC has already shipped.
|
||||
|
||||
**Balanced:** “Unit tests cover cancellation before and after publication, disposal quiescence, and provider reload. A built-entry smoke covers the real loader path; snapshot coverage is deferred because the transport is process-specific.”
|
||||
|
||||
**Over-detailed:** A file-by-file walkthrough of fixtures and assertions with no additional behavioral distinction.
|
||||
|
||||
Remove migration tasks and test narration. Keep the tiers, behaviors they pin, real entry path, and named coverage gaps.
|
||||
|
||||
## A security boundary may need one concrete example
|
||||
|
||||
**Over-trimmed:** “Mounted plugins share the host's authority.”
|
||||
|
||||
**Balanced:** “Mounted plugins share the host's authority; for example, access to `ctx.bash` permits commands with the host executor's privileges.”
|
||||
|
||||
**Over-detailed:** A list of every service a plugin could misuse and every hypothetical exploit.
|
||||
|
||||
Keep one example when it makes an otherwise abstract boundary operationally clear.
|
||||
|
||||
## Delete reasoning transcripts entirely
|
||||
|
||||
**Over-detailed:** “First the loop checks whether the value is absent. If it is absent, the next branch returns early. Otherwise it continues, which is why the final assertion is safe.”
|
||||
|
||||
**Balanced:** No comment when the code already expresses those branches. If the early return protects a non-obvious invariant, state only that invariant.
|
||||
|
||||
Do not compress a reasoning transcript into shorter narration; remove it.
|
||||
|
||||
## Configuration comments explain what the tree cannot
|
||||
|
||||
**Over-detailed:** “This entry loads the local filesystem provider, followed by the policy plugin, followed by the read, write, and edit tools,” when the adjacent entries already show that order.
|
||||
|
||||
**Balanced:** “Load policy before the model-facing tools so their write and edit calls pass through the read-before-mutation gate.”
|
||||
|
||||
Keep the consequence of order, a surprising scope rule, or a security boundary. Let the configuration show its own inventory.
|
||||
|
||||
## Do not trim for word count alone
|
||||
|
||||
**Current:** “The adapter converts provider errors into the shared error type so callers can handle authentication, rate-limit, and transient failures uniformly.”
|
||||
|
||||
**Shorter but worse:** “The adapter normalizes provider errors.”
|
||||
|
||||
**Balanced decision:** Keep the current sentence unless a link or surrounding contract already carries the failure categories. The shorter version loses the consequence and distinctions without improving structure.
|
||||
Reference in New Issue
Block a user