SkillsGrove
SkillsGrove/Documentos de oficina/nguyenquanicd/VLSIT_ASIC_SOC_AI_SKILLS/vlsit-spec-to-docx

vlsit-spec-to-docx

Instalación

$npx skills add https://github.com/nguyenquanicd/VLSIT_ASIC_SOC_AI_SKILLS --skill vlsit-spec-to-docx
$git clone --depth 1 https://github.com/nguyenquanicd/VLSIT_ASIC_SOC_AI_SKILLS.git /tmp/VLSIT_ASIC_SOC_AI_SKILLS && mkdir -p ~/.claude/skills && cp -r /tmp/VLSIT_ASIC_SOC_AI_SKILLS/.agents/skills/vlsit-spec-to-docx ~/.claude/skills/vlsit-spec-to-docx
Instala por favor esta Agent Skill por mí: https://github.com/nguyenquanicd/VLSIT_ASIC_SOC_AI_SKILLS/tree/5c59c24bbd694add930a641d582d1817f52ab510/.agents/skills/vlsit-spec-to-docx. Lee primero su SKILL.md y sus scripts, y solo instálala en mi carpeta de skills cuando hayas confirmado que es segura.

Resumen

Descripción original · Apache-2.0Convert a Markdown design specification into a filled copy of the VLSIT IP Microarchitecture Specification DOCX template, asking the user for every missing fact and never inventing content. Use when the user asks to turn a spec, or the current design specification, into the DOCX template format.
El SKILL.md siguiente se reproduce de nguyenquanicd/VLSIT_ASIC_SOC_AI_SKILLS (commit 5c59c24) bajo la licencia Apache-2.0. El texto no se ha modificado; solo se omiten los metadatos de cabecera del archivo, las imágenes se muestran como enlaces y los archivos muy largos se truncan. Copyright owner or entity authorized by. Licencia: LICENSE. Solo se muestra el archivo de instrucciones; consulta el repositorio original para ver los scripts.

Specification to DOCX template

<!-- VLSIT_TERMINOLOGY_START -->

Terminology: Register-Transfer Level (RTL); Intellectual Property (hardware IP) (IP); Synopsys Design Constraints (timing context) (SDC); Clock-Domain Crossing (CDC); Application-Specific Integrated Circuit (ASIC); Advanced Peripheral Bus (APB); System on Chip (SoC). Read reference/vlsit_glossary.md before using this skill. Expand abbreviations on first use in generated prose; preserve code identifiers and resolve context-dependent meanings from the specification.

<!-- VLSIT_TERMINOLOGY_END -->

Turn a Markdown design specification into a filled copy of the VLSIT IP Microarchitecture Specification DOCX template. The source specification stays the technical authority; this skill does not invent a value, a waveform, or a constraint that the source, a reference RTL file, or a user answer does not provide.

Precedence: rule.md overrides this file, and this file overrides the files under reference/, when they differ.

Reply language: reply to the user in the language the user writes; the document itself is professional English (R-006).

What the run produces

Output Content
<source>_updated.md the source specification plus the answers and RTL-derived facts, each marked [added: <source>, <date>] (R-004)
content.json the section-by-section content in the schema of reference/vlsit_content_schema.md
<IP>_Design_Specification.docx the filled template
drawn figure files (optional) a .drawio or WaveJSON source plus its raster export, when the user asked for a missing figure to be drawn (step 9b)
run_report.md inventory, gap list, decisions, verification results, figure provenance

The template and two worked examples ship with the skill: reference/vlsit_spec_template.docx (the format template), reference/vlsit_content_example.json (a fragment showing every content block type), and reference/vlsit_example/ (one complete APB4-to-TL-UL run: input specification, validated content, filled DOCX, and run report). Read the example README before the first real run.

Workflow

1. Read the rules

Read rule.md in full before doing anything else. Step 11 checks the result by rule ID.

2. Find Python

powershell -NoProfile -ExecutionPolicy Bypass -File "<skill folder>\scripts\vlsit_find_python.ps1"
sh "<skill folder>/scripts/vlsit_find_python.sh"

It prints the path of a working Python 3.8 or later, or NOT FOUND with exit code 3. If Python is missing, stop and let the user choose between installing it themselves and approving the installer (-Install / --install).

The docx and lxml packages are needed by the fill step only. Check them with <python> -c "import docx"; when absent, ask the user before installing (pip install python-docx) — the user may prefer another machine or another tool. Pillow is optional and is needed only to crop a block diagram (step 9).

3. Take the input

Ask the user for the specification file, or for the folder that holds it, when the request does not name one (R-001). Then inventory the folder — specification Markdown, figures/, waveforms/, research/, rtl/, verification/ — and read the companion files that matter before asking anything. Write the inventory into run_report.md.

If the user gives only a folder with several specifications, ask which one is the subject.

4. Probe the template

<python> "<skill folder>\scripts\vlsit_template_probe.py" "reference\vlsit_spec_template.docx" --out template_map.json

It prints the fourteen sections, the paragraphs styled Guidance, the table captions, and the figure placeholders, and writes the same data as JSON. Read reference/vlsit_template_contract.md for what each section must contain. Use the same probe on a user-supplied template when the user has one.

5. Scan the source and map it

<python> "<skill folder>\scripts\vlsit_spec_scan.py" "<source.md>" --out gaps.json --folder "<input folder>"

It extracts the heading tree, the requirement IDs, the tables, and the assets, maps each source section onto the fourteen template sections, and writes gaps.json plus a short report: which template section has no source, which one has source but no figure, and which mandatory element (SDC, software flow, waveform, worked example) is absent.

Read reference/vlsit_spec_mapping.md when a mapping is ambiguous — one source section may feed two template sections, and the reverse.

6. Ask the gaps, or ask for RTL

Ask the user about every gap in at most four questions per round and two rounds, with concrete questions ("Section 9 SDC lists a 400 MHz target; is the period 2.5 ns, and which I/O delay applies to PADDR?"). When the gap is behavioural and the user has RTL, ask for the RTL files and read them (R-003); never modify them.

Record every answer and every RTL-derived fact in <source-name>_updated.md (R-004), then re-scan the updated file. Do not proceed while a required section is unresolved.

7. Write the content

Author content.json against reference/vlsit_content_schema.md, using reference/vlsit_writing_guide.md for the required elements of each section and the house prose style. Start from reference/vlsit_content_example.json to see the file format.

Then validate it:

<python> "<skill folder>\scripts\vlsit_content_check.py" content.json --source "<source>_updated.md" --template template_map.json

Fix every ERROR and read every WARN. A section that is genuinely not applicable is written as {"status": "na", "reason": "<why>", "confirmed_by_user": true} (R-005).

8. Show the plan and get approval

Present one compact table — template section, source of the content, figure, open items — and ask for approval before the document is written. The document is a controlled artefact, so an unapproved structural mistake would be copied into every later revision.

9. Prepare the figures, or draw a missing one

9a — an existing asset. Run:

<python> "<skill folder>\scripts\vlsit_figure_prepare.py" "<figure image>" --out "<figures out folder>" --crop-mode auto

It copies the asset, or crops the drawing out of an image that also carries the draw.io description tables and legend (R-012), and prints the crop box. Show the result to the user and get approval before it is inserted. When the crop is uncertain, ask the user to export a diagram-only image instead of guessing.

9b — no asset exists. Ask whether the user wants the figure drawn (R-018) and stop until the answer arrives. When the answer is yes, read reference/vlsit_figure_methods.md and follow it: a block or function diagram uses the VLSIT draw.io library and its spec-JSON generator from the sibling hierarchy-diagram skill (R-020), a timing figure uses WaveJSON for the bundled WaveDrom (R-021), each drawing is validated with its native checker and shown for approval (R-022), and only a raster image is inserted into the document (R-023). A public reference figure may be used only under R-024. When the answer is no, record the section that stays without a figure.

10. Fill, then verify

<python> "<skill folder>\scripts\vlsit_docx_fill.py" --template "reference\vlsit_spec_template.docx" --content content.json --out "<IP>_Design_Specification.docx"
<python> "<skill folder>\scripts\vlsit_docx_check.py" "<IP>_Design_Specification.docx" --template-map template_map.json
<python> "<skill folder>\scripts\vlsit_docx_render.py" "<IP>_Design_Specification.docx" --out "<pages folder>"

vlsit_docx_fill.py refuses to overwrite an existing file without --force (R-014). Fix content in content.json and re-run; never edit the DOCX.

vlsit_docx_render.py needs LibreOffice; when it is not installed it exits with a clear message. Then ask the user whether to install LibreOffice or to accept structure-only verification, and say so in the report (R-015). Inspect the rendered pages for table overflow, clipped figures and broken page breaks.

11. Verify against the rules and report

Check every rule ID of rule.md: R-013 and R-015 through the script results above, the rest by reading the output and the run report. Then report, in the user's language: the input used, the gaps and how each was answered, the files written, the RESULT lines of the three checks, which pages were inspected, and what remains untested.

Scripts

Script Read or run it when
scripts/vlsit_find_python.ps1, scripts/vlsit_find_python.sh Step 2, and after a Python install
scripts/vlsit_template_probe.py Step 4: list the sections, guidance paragraphs, table captions and figure placeholders of a template
scripts/vlsit_spec_scan.py Step 5: map the source specification to the template and list the gaps
scripts/vlsit_content_check.py Step 7 and after any edit of content.json
scripts/vlsit_figure_prepare.py Step 9: copy or crop a figure and report the crop box
scripts/vlsit_docx_fill.py Step 10: fill the template from content.json
scripts/vlsit_docx_check.py Step 10: verify the produced document structurally
scripts/vlsit_docx_render.py Step 10: render the document to PDF and page images

Reference

File Read it when
reference/vlsit_template_contract.md Step 4 and step 8: what each of the fourteen sections must contain
reference/vlsit_spec_mapping.md Step 5: mapping the VLSIT specification sections onto the template
reference/vlsit_content_schema.md Step 7: the format of content.json
reference/vlsit_writing_guide.md Step 7: required elements and prose style per section
reference/vlsit_figure_methods.md Step 9b: how to draw a missing block diagram or waveform, validate it, and get a raster the document can hold
reference/vlsit_spec_template.docx The format template itself; copy it, never edit it in place
reference/vlsit_content_example.json A worked content.json fragment showing every block type
reference/vlsit_example/vlsit_example_readme.md Read before the first real run: example contents, limits, and reproduction steps
reference/vlsit_example/vlsit_example_spec.md Input of the worked example
reference/vlsit_example/vlsit_example_content.json Validated structured content of the worked example
reference/vlsit_example/vlsit_example_output.docx Filled DOCX output of the worked example
reference/vlsit_example/vlsit_example_run_report.md Run report of the worked example

Environment

Python 3.8 or later. python-docx and lxml are required for filling the template. Pillow is optional for figure cropping; PyMuPDF is optional for page images; LibreOffice renders the result for layout review. Check each dependency only when its feature is needed, and ask before installing anything. No network access is needed at run time.

Drawing a missing figure (step 9b) uses the sibling skills vlsit-rtl-hierarchy-diagram (library, spec-JSON generator, validators) and vlsit-wavedrom-waveform (bundled WaveDrom, lint, viewer), installed beside this skill. When they are absent, tell the user and ask whether to install them or to leave the section without a figure.

Ver el texto completo de la licencia (Apache-2.0)
Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.