Introduction¶
Developers of intelligent agents likely share this experience: once the functional code is written, applying for software copyright reveals that the time spent isn’t on coding, but on organizing the required materials. Source code documents require 50 lines per page, a continuous 60-page length, and a header containing the software name and version number; the user manual requires a fixed six-chapter structure; and the application form requires fields for the completion date, line count, and percentage of programming languages. Manually assembling these documents is often more exhausting than writing the code itself, and minor formatting discrepancies often lead to rejection.
The DSH plugin introduced below targets this pain point: provide it with a code repository and a software name, and it generates the source code document (docx), user manual (docx), interface screenshots, and a draft of the application form fields locally. The maintainer is feely0208, the package name is @deepwhale-cn/dsh-copyright-kit, the version is 0.1.0, and it is licensed under the MIT License. Its positioning is “auxiliary drafting + layout + verification”; it is not a substitute for a proxy service, nor does it constitute legal advice.
What is this¶
One-sentence positioning: Convert “code repository + software name” into drafts of materials required for software copyright registration, all generated locally.
It solves three things:
- Layout of source code documents: Fixed 50 lines per page, explicit page breaks, and headers/page number fields are all generated by the script, relying on manual adjustment.
- Skeleton of the user manual: Layout follows the six-chapter structure of registration habits; information not provided by the user is marked as
【待补充】, not fabricated. - Derivation of application form fields: Draft values are provided for fields like software name, version number, line count, and language percentage, with derivation basis and confidence levels annotated for each item.
Core Features¶
Source Code Documents¶
Recursively collects source code from the repository, filters according to skip rules, and writes it to docx:
- Skips dependencies and build directories like
node_modules,.venv,dist, skips lock files, binaries, media files, hidden files, and symbolic links, skips project manifests likepackage.json, and does not collect files larger than 1MB or suspected to be generated by compression. - Fixed 50 lines per page, with empty lines added if necessary; explicit page breaks are used between pages, relying on content overflowing naturally.
- If the source code exceeds 60 pages, the first 30 pages + the last 30 pages are taken; middle pages are not included, which will be noted in the plan.
- The left side of the header is “Software Name Version Number”, and the right side is the
PAGEfield for page numbers. - Layout is A4, with top/bottom margins of 2.0cm and left/right margins of 2.5cm. The body text uses Consolas/宋体 at 9pt with a fixed line spacing of 13.6pt.
After generation, the plugin automatically re-reads the docx to verify the number of pages, lines per page, headers, and page number fields, returning the results together so you don’t have to flip through page by page.
Skeleton of the User Manual¶
Layout follows a six-chapter structure: Overview, Main Functions, Operating Environment, Operation Instructions, Technical Features, and Version Description. If the user provides functions and overview, they are filled in; information not provided is written as 【待补充:…】. The first publication date cannot be deduced from the code and is left blank.
Interface Screenshots¶
Calls the headless mode of the local Chrome or Chromium to capture http(s) addresses or local HTML files, defaulting to 1440×900. Screenshots are rendered locally; the plugin itself does not initiate network requests; whether the target address is connected to the internet is decided by the user.
Application Form Field Drafts¶
Produces 申请表字段草稿.json and .md, containing software name, version number, completion date, first publication date, line count, and programming language percentage. The line count is calculated by accumulating file lines, which is different from the “valid code lines” metric of the registration system; the plugin will note this. Uncertain fields are left blank, with derivation basis and confidence provided.
Plan First, Then Write to Disk¶
The sidebar “Copyright Workshop” panel splits the process into two steps. The first step, “Generate Plan”, lists which files will be collected, how many skipped, total lines, original pages vs. actual pages used, language percentage, and prerequisites for each material (python-docx, Chrome availability). Writing to disk only happens after the plan is confirmed. The generation results display the path and verification status of each artifact. Changes in input will invalidate the old plan, avoiding the use of old plans with new parameters.
Installation and Activation¶
The installation command is as follows, taken from the plugin README:
dsh plugin --profile web add @deepwhale-cn/dsh-copyright-kit
After installation, a “Copyright Workshop” icon will appear in the sidebar. The command itself uses the package name, not the GitHub address, so do not try to guess and type dsh plugin add github:owner/repo.
In addition to the required @deepseek-ai/dsh-tools, the plugin declares a runtime requirement of dsh >=0.1.0-rc.6 <0.3.0 and Node.js version 18 or higher.
Prerequisites¶
If either of these two dependencies is missing, an explicit error will be reported; silent failure will not occur.
- python3 + python-docx, used to generate docx:
python3 -m pip install python-docx
The interpreter can be specified via the environment variable DSH_COPYRIGHT_PYTHON.
- Google Chrome or Chromium, only used when taking screenshots. It searches for common paths by default, such as
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome, but can also be specified viaDSH_COPYRIGHT_CHROME=/path/to/chrome.
There are two optional environment variables:
| Variable | Function | Default Value |
|---|---|---|
DSH_COPYRIGHT_OUT |
Output root directory | ~/CopyrightMaterials |
DSH_COPYRIGHT_REPOS_DIR |
Scan root for candidate repositories in the panel | ~/dsh-guard |
Typical Usage¶
Method 1: Follow a two-step process in the panel: first check the “Generate Plan” to review the scope of files collected and prerequisites, then click “Start Generation” after confirmation.
Method 2: Simply say in the chat: “Use the Copyright Workshop to generate source code and the application form for this repository.”
Method 3: Call the server-side tools. The parameters for the four tools are as follows:
| Tool | Main Parameters | Description |
|---|---|---|
copyright_source_doc |
repo, software_name, version, output |
Generate source code docx and verify by reading back |
copyright_manual |
software_name, version, functions[], overview, environment, output |
Generate user manual skeleton, placeholders for missing info |
copyright_screenshots |
targets[], output_dir, width, height |
Local Chrome headless screenshots |
copyright_form |
repo, software_name, version, output |
Derive application form field drafts |
The output structure is as follows, using the default output root directory as an example:
~/CopyrightMaterials/<SoftwareName>-<Version>/
├── SourceCode.docx
├── UserManual.docx
├── Screenshots/
│ ├── 01-Home.png
│ └── ...
├── 申请表字段草稿.json
└── 申请表字段草稿.md
Self-Check¶
The repository comes with three commands; running them locally confirms the plugin is functional:
node --check lib/index.js
node scripts/preflight-client.mjs .
node scripts/selftest.mjs
selftest only writes to the system temp directory and does not go online, covering 80-page trimming, 50 lines per page, headers and PAGE fields, physical capacity, manual placeholders, blank fields in the application form, local HTML screenshots, and the HTTP panel interface.
Applicable Scenarios and Notes¶
Suitable for developers and teams who need to apply for software copyright, have a code repository, and do not want to manually format source code and user manuals.
A few points to note:
- This is an auxiliary drafting tool and does not constitute legal advice. The format and content of the materials still need to be verified by the applicant or an agency according to registration requirements; determining whether something constitutes a work and who owns the rights is the responsibility of the applicant.
- The plugin runs with the permissions of the current dsh process. You should check the source code and license before installing to decide whether to use it for internal code. This plugin is under the MIT license and includes a
LICENSEfile in the repository. - The plugin itself does not connect to the internet, only reads source code, and does not write any files except for the output directory.
- The application form fields are just drafts; the final version is subject to the form in the Copyright Protection Center system.
- The user manual will not fabricate information; missing parts will always be marked with
【待补充】.
Conclusion¶
The value of this plugin lies in delegating the most mechanical parts of registration materials to the script: pagination, headers, screenshots, field derivation, and verification reading. It does not guarantee registration approval, nor does it replace manual verification, but it frees people from adjusting formats page by page.
Plugin directory page: https://www.skillhub.cn/plugins/feely0208/dsh-copyright-kit
GitHub: https://github.com/feely0208/dsh-copyright-kit